Skip to main content

jellyflow_layout/
lib.rs

1//! Optional headless layout adapters for Jellyflow.
2//!
3//! This crate keeps automatic layout outside the core document model. Layout engines receive a
4//! projection of a Jellyflow graph and return normal [`GraphTransaction`] values that hosts can
5//! apply explicitly.
6
7#![deny(unsafe_code)]
8
9mod builtin;
10mod dugong;
11mod engine;
12mod family;
13mod freeform;
14mod mind_map;
15mod preset;
16mod projection;
17mod tidy_tree;
18
19#[cfg(feature = "benchmark-internals")]
20pub use dugong::benchmark_internals;
21pub use dugong::{
22    DugongLayoutEngine, layout_graph_to_transaction_with_dugong, layout_graph_with_dugong,
23};
24pub use engine::{
25    DUGONG_LAYOUT_ENGINE_ID, LayoutContext, LayoutDirection, LayoutEdgeRoute, LayoutEngine,
26    LayoutEngineId, LayoutEngineRegistry, LayoutEngineRequest, LayoutError, LayoutNodePosition,
27    LayoutOptions, LayoutRequest, LayoutResult, LayoutScope, LayoutSpacing,
28    MIND_MAP_FREEFORM_LAYOUT_ENGINE_ID, MIND_MAP_RADIAL_LAYOUT_ENGINE_ID,
29    TIDY_TREE_LAYOUT_ENGINE_ID, layout_graph_to_transaction_with_engine, layout_graph_with_engine,
30};
31pub use family::{
32    LAYERED_DAG_LAYOUT_FAMILY_ID, LayoutEngineCapability, LayoutEngineMetadata, LayoutFamilyId,
33    LayoutFamilyMetadata, MIND_MAP_LAYOUT_FAMILY_ID,
34};
35pub use freeform::{
36    MindMapFreeformLayoutEngine, layout_graph_to_transaction_with_mind_map_freeform,
37    layout_graph_with_mind_map_freeform,
38};
39pub use mind_map::{
40    MindMapRadialLayoutEngine, layout_graph_to_transaction_with_mind_map_radial,
41    layout_graph_with_mind_map_radial,
42};
43pub use preset::LayoutPresetBuilder;
44pub use tidy_tree::{
45    TidyTreeLayoutEngine, layout_graph_to_transaction_with_tidy_tree, layout_graph_with_tidy_tree,
46};
47
48/// Returns a registry containing Jellyflow's built-in layout engines.
49pub fn builtin_layout_engine_registry() -> &'static LayoutEngineRegistry {
50    builtin::builtin_layout_registry()
51}
52
53#[cfg(test)]
54mod tests;