elk 0.4.0
elk: ^0.4.0 copied to clipboard
Partial Dart port of the Eclipse Layout Kernel: the layered algorithm with compound graphs, ports and orthogonal edge routing, and an elkjs-style API.
0.4.0 #
-
Breaking: spacings that ELK derives from
spacing.baseValueare now nullable inElkLayoutOptionsand default to the ELK default timesspacingBaseValue / 20, also in the constructor:spacingEdgeEdge,spacingEdgeEdgeBetweenLayers,spacingEdgeNodeBetweenLayers,spacingComponentComponent,spacingEdgeLabel,spacingNodeLabelandspacingPortLabel. With the constructor's base value 40 these spacings are twice as large as before. Read the effective values from the newresolved*getters (for exampleresolvedEdgeEdge). Layouts fromElkLayoutOptions.fromElkJsondo not change. -
Breaking: the between-layers edge spacings no longer fall back to
spacingEdgeNode; as in ELK, they derive fromspacingBaseValue. -
Breaking:
padding,directionandhierarchyHandlingofElkLayoutOptionsnow hold the explicit (nullable) values. Read the effective values fromresolvedPadding,resolvedDirectionandresolvedHierarchyHandling.paddingOverride,directionOverrideandhierarchyHandlingOverrideare removed. -
Breaking: rename
CenterEdgeLabelPlacementStrategytoElkCenterEdgeLabelPlacement,EdgeLabelSideSelectiontoElkEdgeLabelSideSelection, andElkLayoutOptions.centerLabelPlacementtocenterEdgeLabelPlacement.usesLabelSizeInformation()andtransposedare no longer public. -
Breaking: remove
routeOrthogonal. The engine routes with the generated ELK orthogonal router. -
Breaking: remove
elkUnsupportedFeature. It always returned null. -
Breaking: remove
ElkLabel.sideandElkLabelSide. They had no effect; setelk.layered.edgeLabels.sideSelection(edgeLabelSideSelection) on the graph. -
Breaking: remove
ElkLayoutOptions.algorithm. It was never read; the package always runs the layered algorithm. -
Breaking: remove the
greedySwitchEnabledparameter of theElkLayoutOptionsconstructor andcopyWith. UsegreedySwitchType: ElkGreedySwitch.off. -
Remove the unused
metadependency. The porting notes no longer ship in the package. -
Give every graph in the hierarchy its own random generator, seeded like ELK's
GraphConfigurator. A nestedINCLUDE_CHILDRENgraph no longer draws barycenter perturbations from its parent's generator when the cycle breaker did not create one (for exampleDEPTH_FIRST), which could mirror a layer compared with elkjs. -
A
SEPARATE_CHILDRENcompound withoutelk.directionnow uses ELK's default direction (RIGHT) instead of its parent's direction, as in elkjs. -
Lay out a
SEPARATE_CHILDRENcompound inside anINCLUDE_CHILDRENhierarchy on its own first, as ELK's recursive layout engine does. Its connected components are now split and packed in rows, as in elkjs. -
Generate the ordering-constraint resolver and first-layer randomization from ELK 0.12.2. The layer sweep now also applies constraints to its first layer.
-
Use network-simplex layer assignment generated from ELK 0.12.2 by default. This corrects the layer of one node in the official Trilateration model.
-
Use pure-Dart cycle breaking generated from ELK 0.12.2 by default for all five supported strategies.
-
Generate the two edge-crossing counts used during layer ordering from ELK 0.12.2. Edges joining distinct ports on one node now participate in the count.
-
Generate the port distributor used during layer sweeps from ELK 0.12.2.
-
Generate core barycenter and crossing-count routines from Eclipse ELK 0.12.2. Layout remains synchronous and pure Dart. Barycenter perturbations and port ranks now follow upstream Java float rounding, which can affect close ties.
0.3.0 #
layered: keep the model-order transitive closure out of the plain barycenter sort. A wide layer no longer costs O(n² log n × closure size) per sort; a 918-node graph lays out in 0.12 s instead of 521 s, with identical output. ThepreferEdgesmodel-order strategy does not read the closure and no longer maintains it either.- Breaking: free ports are spread evenly along a node side, as ELK's default DISTRIBUTED alignment does (#93). Before, they were packed 10 px apart at the centre of the side. Port positions and edge routes of existing layouts change, and no option restores the old placement.
- Keep free ports inside
spacing.portsSurroundingon the sides edges use, as elkjs does.
0.2.1 #
- Remove the unused vendored copy of dart_dagre from
lib/src/dagreand itsNOTICE. The layered engine does not use it.
0.2.0 #
- Implement distinct INCLUDE_CHILDREN, SEPARATE_CHILDREN, and INHERIT modes, including JSON aliases and independent direction/hierarchy inheritance. Separated cross-boundary edges remain in the result without route sections or fabricated label positions. Full coordinated hierarchy optimization remains outside the supported contract.
- Preserve deep hierarchy endpoints, labels, and orthogonal boundary routes across nested directions and compound title bands.
- Correct four-side explicit port placement, outward edge attachment, and internal compound-boundary attachment. Preserve self-loop clearance beyond nonzero port rectangles and reserve matching layout margins.
- Place edge, node, and port labels; support crossing constraints and hyperedge junctions; improve self-loop sizing and edge straightening.
- Honor cycle-breaking, model-order, edge-merging, and Brandes–Köpf alignment choices exposed by the public API.
- Parse standard ELK option aliases and spacing keys while retaining legacy aliases. Honor explicit asymmetric root padding in all four directions.
- Include ports, labels, routed strokes, and loops in returned layout bounds.
0.1.1 #
- Fixed explicit north/south ports attaching to
the opposite side of nodes in
ElkDirection.uplayouts.
0.1.0 #
- Initial release.
- Ports:
ElkPort.side/ElkPortSide; edges may reference port ids and attach at computed border points (ElkPositionedNode.ports). - elkjs JSON ingestion:
ElkGraph.fromJson(andfromJsonon nodes/edges/ ports/labels) parse the elkjs graph JSON shape. - Validation harness (
tool/validation/) comparing structural agreement against real elkjs. - ELK-style layered layout: cycle breaking, network-simplex layering, crossing minimization, Brandes–Köpf coordinate assignment.
- Orthogonal edge routing with computed bend points and parallel-edge lanes.
- Compound graphs / clusters with parent-relative result coordinates.
- ELK spacing model (
spacing.baseValue), model order constraints, and Brandes–Köpf fixed-alignment options. - elkjs-style graph API (
ElkGraph/ElkNode/ElkEdge→ElkResult).