Skip to content

Default to time-ordered layouts and automatic labels, and add edge routing - #238

Open
malcolmbarrett wants to merge 320 commits into
mainfrom
defaults-just-work
Open

malcolmbarrett wants to merge 320 commits into
mainfrom
defaults-just-work

Conversation

@malcolmbarrett

@malcolmbarrett malcolmbarrett commented Sep 13, 2026

Copy link
Copy Markdown
Member

Makes DAG plots look right without configuration: time-ordered layouts, labels that stay off the drawing, and edges that can route around nodes.

New defaults

  • layout is now "time_ordered" (was "nicely").
  • label_geom is now geom_dag_label_auto (was geom_dag_label_repel). use_labels stays FALSE.
  • For the previous look: ggdag_options_set(layout = "nicely", label_geom = geom_dag_label_repel).

New features

  • Automatic labels: geom_dag_label_auto(), geom_dag_label_auto2() (borderless), and geom_dag_text_auto() place labels deterministically at draw time, clear of nodes, edges, arrowheads, other labels, and the panel edge. They support max.overlaps and wrap, and warn when a label cannot be placed.
  • Edge routing: geom_dag_routed_arrows() and the edge_route option ("spline" or "orthogonal", ggarrow engine only) detour edges around nodes, computed in device millimetres so routes hold at any plot size. edge_route_options() tunes clearance and spacing.
  • Edge ends: edges stop 2 mm outside each node's outline at any node size and shape, circles and squares alike, under both edge engines, every route style, and in hand-built plots. Automatic labels trace the edges as drawn.
  • Time-ordered layout: exact crossing minimisation, equal scaling on both axes, and time_ordered_coords() now optimises within manually supplied time periods.
  • Repel geoms: recalibrated defaults (padding, a fixed seed) so labels sit near their nodes and reproduce across sessions.

Dependencies

  • ggarrow (>= 0.2.0) from CRAN is now in Imports; the Remotes entry is gone.

Docs

  • NEWS, the vignettes, and the README cover the new defaults, and the README adds the R-universe badge and installation from r-universe.

Also includes many bug fixes; see NEWS. Visual tests run on macOS only, and performance tests are opt-in with GGDAG_RUN_PERF_TESTS=1.

Closes #236.
Closes #232
Closes #186
Closes #20 (this is not specifically dealt with here but I think previous changes + defaulting to time ordering + edge routing largely renders this complete)

… spacing, and merge arrival rows too small to hold
…ps, per-layer head caps, and resections on geom_dag_edges under ggarrow
…r's own head caps, and take resections and circle caps on geom_dag_edges under ggarrow
… off each other's rows, and floor stubs on the drawn ornaments
…drawn edges by their nodes, close the devices the layer helpers open, and name the middle panel snapshot for what it asserts
…el routes traced for every pair of routed layers, and narrow rows in a facet panel one layer draws
…arrivals of a narrow gap rows only in panels where several layers draw, and trace every routed layer's scene as it is drawn
… layer, mapped and elliptical caps under ggarrow, and the adjustment set routes the labels trace
…mapped circle caps into resections under ggarrow, refuse elliptical caps there, and document which setting wins at an end
…eir viewports before closing them, so the suite opens no default device
…per-edge values in a shared scene, and legend keys of arrows with a head and fins
…he farthest reach, route each edge of a shared scene with its own layer's cap and curvature, and give legend keys of arrows with a head and fins room for a shaft
… read the edges a label test compares from one drawing
…s edges of it in a panel, a layer that draws only arcs there included
…2 draws it, as that value for every edge the layer draws
…nodes, and cut each traced edge by the caps of the layers that draw it
…he resections and caps drawn there, and honour a resection or cap the plot maps for a hand-built edge layer
…race each routed scene with the node size its layers route with, and test that a routed layer drawing no edges sets no label caps
…et variable, cut an edge two bent layers draw alike by the nearer cap, and pass a relative legend key length to ggarrow unconverted
…te the faster time-ordered layout, and centre two vignette labels
…er than the deprecated logical text argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add R-universe badge and install instructions to README support edge routing via ggarrow geoms Improved layout for edges Improve coordinates api

1 participant