Skip to content

@graphty/graphty-element / session / LayoutRecommendationCode

Type Alias: LayoutRecommendationCode ​

LayoutRecommendationCode = "recommend.fixed" | "recommend.random" | "recommend.circular" | "recommend.force" | "recommend.first-servable" | "recommend.graphviz-file" | "recommend.graphviz-unavailable"

Defined in: graphty-element/src/session/layout.ts:81

Which rule chose a LayoutRecommendation, as the code of its fact. The application words it; graphty-element writes no sentence for it. Every code carries the same params, the shape the rule read: nodeCount, edgeCount, placedNodes (how many nodes the data placed; zero when the caller did not say) and largeGraphThreshold.

CodeWhy
recommend.fixedEvery node already carries a coordinate, so the arrangement the data arrived with is kept
recommend.randomThe graph is larger than largeGraphThreshold, so it is scattered from a seed instead of settling a force simulation
recommend.circularNothing is connected, so a ring puts the nodes in a readable order where a force layout has no pull to work with
recommend.forceConnected nodes pulled together and unconnected ones pushed apart shows the graph's structure
recommend.first-servableNo rule named an arrangement the catalogue can serve, so this is the first one that can place a graph this size
recommend.graphviz-fileThe file is a Graphviz file with no coordinates, so it is drawn by the engine it names (its layout attribute, or dot); params.engine names it
recommend.graphviz-unavailableThe file asked for a Graphviz engine but @hpcc-js/wasm-graphviz is not installed, so the arrangement the next rule chose is used; params.engine names the engine it asked for

New codes may be added in a minor release: word an unknown one generically.

Since ​

3.20.0