diagram_core/src/structure/cff.rs#
Source: lib/diagram_core/src/structure/cff.rs
structure::cff -- the cross-functional flowchart (ST-05): lanes and phases in a pool
find(doc, s) -> Option<Cff> the flowchart a shape belongs to (the pool itself, one of
its lists, a lane, a phase, a shape in a lane)
pools(doc, owner) every flowchart of a page
layout(tx, eng, &cff) lanes stacked, phases side by side across every lane,
the lists and the pool around them -> what moved
lanes(doc, &cff) / phases(doc, &cff)
create(tx, eng, &src, page, top_left, horizontal, lanes, phases, lang) -> Cff
(JD13) a new flowchart from the masters of stencil `src`
(JFDiagrammer's "cff"): pool, both lists, the lanes and
phases, laid out from `top_left`; create_with takes a
lane or phase already on the page along (a dropped one)
Visio's structure, kept so that Visio recognises it (research in jd10-strukturen.md):
CFF Container Container, categories "CFF Container", takes only "CFF List"; its heading
is the title bar
├ Swimlane List List of the lanes (items: categories "Swimlane"), direction 2 (top to
│ bottom) for horizontal lanes, 0 for vertical ones
└ Phase List List of the phases (items: "Phase"), the other direction
Swimlane Container with its heading on the left (horizontal) or on top (vertical)
Separator Container with its heading on top (horizontal) or on the left; it spans
every lane, a shape in it is its member as well as its lane's
Horizontal (lanes one above the other):
+--------------------------------------------+ title bar (the pool's heading, Ht)
| | phase 1 heading | phase 2 heading | phase row (the phases' headings, Hp)
| lane1 | | |
+-------+------------------+-----------------+
| lane2 | | |
+--------------------------------------------+
Wl (the lanes' headings)
The lanes keep their heights and share one width: the lane headings plus the phases (the last
phase takes what is left), or the widest lane without phases. The phases keep their widths
and span the phase row and every lane. Vertical flowcharts are the same turned: lanes side by
side, the phases one above the other. Lanes and phases carry their shapes; a shape in both
moves by the larger of the two moves on each axis (once, not twice).
struct Cffa cross-functional flowchartpool: ShapeReflane_list: Option<ShapeRef>-- the list of the lanes and of the phasesphase_list: Option<ShapeRef>horizontal: bool-- lanes one above the other (else side by side)
/// the categories of the parts
CAT_POOL: &str = "CFF Container"
CAT_LIST: &str = "CFF List"
CAT_LANE: &str = "Swimlane"
CAT_PHASE: &str = "Phase"
fn is_pool(doc: &Document, s: ShapeRef) -> boolwhether a shape is a flowchart's poolfn of_pool(doc: &Document, pool: ShapeRef) -> Option<Cff>the flowchart of a poolfn find(doc: &Document, s: ShapeRef) -> Option<Cff>the flowchart a shape belongs to: the pool, a list of it, a lane, a phase, a shape insidefn pools(doc: &Document, owner: Owner) -> Vec<Cff>every flowchart on a page or masterfn lanes(doc: &Document, f: &Cff) -> Vec<ShapeRef>the lanes in orderfn phases(doc: &Document, f: &Cff) -> Vec<ShapeRef>the phases in orderfn layout(tx: &mut Transaction, eng: &mut Engine, f: &Cff) -> Result<Vec<ShapeRef>, EditError>lay the flowchart out from its pool's top left corner -> the shapes that movedfn layout_with(tx: &mut Transaction, eng: &mut Engine, f: &Cff, want: Option<f64>) -> Result<Vec<ShapeRef>, EditError>layout with the lanes' length given (a pool or lane resized by hand), else the longest lane's or what the phases need
/// the hidden masters of a flowchart (NameU, as in JFDiagrammer's stencil "cff")
M_POOL: &str = "CFF Container"
M_LANE_LIST: &str = "Swimlane List"
M_PHASE_LIST: &str = "Phase List"
fn lane_master(horizontal: bool) -> &'static strthe master of a lane: horizontal (lanes one above the other) or verticalfn phase_master(horizontal: bool) -> &'static strthe master of a phase (a separator)fn create(tx: &mut Transaction, eng: &mut Engine, src: &Document, page: PageRef, top_left: [f64; 2], horizontal: bool, lanes: usize, phases: usize, lang: usize) -> Result<Cff, EditError>a new flowchart from the masters of stencilsrconpage: the pool, the lane list, the phase list,laneslanes (at least one) andphasesphases, laid out with the pool's top left corner attop_left; names and texts in languagelang(instance::LANGS). Connectors near it are not rerouted (the caller's glue::update)fn create_with( tx: &mut Transaction, eng: &mut Engine, src: &Document, page: PageRef, top_left: [f64; 2], horizontal: bool, lane: Option<ShapeRef>, phase: Option<ShapeRef>, lanes: usize, phases: usize, lang: usize, ) -> Result<Cff, EditError>create with a lane or a phase already on the page (one dropped outside any flowchart) as the first lane or phase; the others are new