Repository navigation
Common Render pipeline 1: ELK - #7803
Conversation
🦋 Changeset detectedLatest commit: cfc264e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…raction # Conflicts: # packages/mermaid-layout-elk/src/render.ts # packages/mermaid/src/rendering-util/layout-algorithms/swimlanes/adjustLayout.ts
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
[sisyphus-bot] Review of #7803 — Refactor ELK onto common layout renderer (posted as a comment since GitHub won't let the PR author submit a formal review; verdict would be COMMENT — this is a draft, so nothing here is blocking). Really nice piece of work — this is a clean, well-structured refactor of some of the gnarliest code in the repo. Notes below are "heads up for when you take it out of draft," not demands. What's working well 🎉
Things to address🟡 [important] No e2e / visual-regression coverage for a shared-rendering + ELK rewrite. Per the repo guidance, shared 🟡 [important] ELK's default layout output changes for every existing
💡 [suggestion] New public API surface. 🟢 [nit] Dead assignment in Nothing here changes the shape of the design, which is solid. The main gate before merge is visual verification of both the dagre-backed diagrams and ELK (especially given the |
|
Thanks for the review. On the e2e/visual-regression point: I do not think it is accurate that this PR ships unit tests only. The existing Cypress visual specs already cover the relevant shared-rendering/ELK paths:
So I agree the full e2e/Argos suite should be green before undrafting, but I would push back on “no e2e / visual-regression coverage.” The coverage already exists and exercises the paths affected by this PR. For the RIGHTDOWN point: agreed that the changeset should make the default behavior explicit. I pushed a follow-up commit clarifying that RIGHTDOWN is now the intended default and that users can set For the dead assignment nit: agreed, removed in the same follow-up commit. |
|
[sisyphus-bot] Follow-up review of #7803 — Common Render pipeline 1: ELK (round 2, posted as a comment since GitHub blocks the PR author from a formal review). Verdict-equivalent: looks good to merge once the full Argos/e2e run is confirmed green. I took the round-1 discussion into account and re-verified everything against the current head ( Resolved since round 1✅ ELK default behavior (was 🟡 important). The follow-up ( ✅ e2e / visual coverage (was 🟡 important) — you're right, I was wrong. I verified the pointers: ✅ Dead assignment (was 🟢 nit). Gone — Re-verified independently🎉 Security: clean. The new shared 🎉 Semver is right. One open item (non-blocking)💡 Public API surface. Two small sanity checks before merge, both yours to wave off:
Design is unchanged and solid, and the follow-ups landed fast. 🚀 |
|
@knsv Did a review on the last changes. [sisyphos-bot] PR #7803 — Common Render Pipeline 1: ELK (codex/elk-prep-extraction → develop) Focus: fixes from knsv's previous review Prior review summary knsv left 5 inline comments on common/index.ts and approved the PR at 12:32 after the author addressed them. Here is the verification of each:
Tests common/index.spec.ts (362 lines, 6 cases) covers the full pipeline:
🎉 The test coverage directly mirrors the createCommonLayoutRenderer options API — easy to read, comprehensive. Security The new common/index.ts uses translate(${x}, ${y}) to position edge labels. The x and y values come from calcLabelPosition / calcTerminalLabelPosition → mathematical operations Edge labels themselves (user-controlled diagram text) flow through insertEdgeLabels → createText.ts, which sanitizes via sanitizeText() before any DOM insertion. The pipeline is No XSS or injection issues identified in the changed files. Verdict: APPROVE All four substantive review items from knsv are addressed, the test suite is solid, and there are no security concerns. knsv has already approved — this is consistent with that |
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.17.0 Release notes: ### Minor Changes - [#7842](mermaid-js/mermaid#7842) [`3670b4e`](mermaid-js/mermaid@3670b4e) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat(c4): render C4 elements through the unified shape system, using the new person shape - [#7812](mermaid-js/mermaid#7812) [`cdfc0ea`](mermaid-js/mermaid@cdfc0ea) Thanks [@knsv-bot](https://github.com/knsv-bot)! - feat(class): route `classDiagram` to the unified (v2) renderer by default Set `class: { defaultRenderer: 'dagre-d3' }` in the config to restore the legacy renderer. - [#7785](mermaid-js/mermaid#7785) [`c45cde9`](mermaid-js/mermaid@c45cde9) Thanks [@knsv-bot](https://github.com/knsv-bot)! - feat(flowchart): add collapsible flowchart subgraphs via `subgraphId@{ view: collapsed }` - [#7828](mermaid-js/mermaid#7828) [`8eb3afc`](mermaid-js/mermaid@8eb3afc) Thanks [@knsv-bot](https://github.com/knsv-bot)! - feat(elk): add `elk.keepEntryNodeOnTop` config option to keep a recursive flow's entry node on top - [#7803](mermaid-js/mermaid#7803) [`74e44eb`](mermaid-js/mermaid@74e44eb) Thanks [@knsv-bot](https://github.com/knsv-bot)! - feat(elk): add `elk.nodePlacementAlignment` config option - [#7792](mermaid-js/mermaid#7792) [`ea55b31`](mermaid-js/mermaid@ea55b31) Thanks [@RodrigojndSantos](https://github.com/RodrigojndSantos)! - feat(er): add subgraph support to ER diagrams. - [#7970](mermaid-js/mermaid#7970) [`a2c0fb6`](mermaid-js/mermaid@a2c0fb6) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat(flowchart): add `folder`, `bucket`, `console` (terminal window) and `browser` shapes - [#7842](mermaid-js/mermaid#7842) [`ae3e115`](mermaid-js/mermaid@ae3e115) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat(flowchart): add `person` shape (circular head above a rounded body), usable in flowcharts via `A@{ shape: person }` - [#7724](mermaid-js/mermaid#7724) [`0fd7a9f`](mermaid-js/mermaid@0fd7a9f) Thanks [@xdumaine](https://github.com/xdumaine)! - feat(xyChart): add legends for named line and bar series ### Patch Changes - [#7847](mermaid-js/mermaid#7847) [`215fe89`](mermaid-js/mermaid@215fe89) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix(c4): named attributes such as `$tags`, `$link` and `$sprite` are no longer clobbered to undefined when they arrive in an earlier positional slot of Person/System/Container/Component/Boundary/Rel statements. - [#7871](mermaid-js/mermaid#7871) [`8d874c4`](mermaid-js/mermaid@8d874c4) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix(flowchart): stop dagre layout from spamming `warn`-level logs on every node/edge/cluster - [#8071](mermaid-js/mermaid#8071) [`b3d1f63`](mermaid-js/mermaid@b3d1f63) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix(block): sibling blocks overlapping in block diagrams when one has a label wider than 200px - [#7870](mermaid-js/mermaid#7870) [`71b8843`](mermaid-js/mermaid@71b8843) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a `RangeError: Invalid array length` crash when rendering certain edges. - [#7924](mermaid-js/mermaid#7924) [`9cbef5d`](mermaid-js/mermaid@9cbef5d) Thanks [@nightt5879](https://github.com/nightt5879)! - fix(treeView): icons disappearing after strict security sanitization. - [#7850](mermaid-js/mermaid#7850) [`a34cbf0`](mermaid-js/mermaid@a34cbf0) Thanks [@aloisklink](https://github.com/aloisklink)! - fix(block): allow classdefs to update text color - [#7937](mermaid-js/mermaid#7937) [`f9cbe1e`](mermaid-js/mermaid@f9cbe1e) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix(dagre): let a diagram's own nodeSpacing/rankSpacing take effect in the unified dagre layout - [#8005](mermaid-js/mermaid#8005) [`90eeece`](mermaid-js/mermaid@90eeece) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix(flowchart): reverts the behavior change from #7672 (fix/4648-directions), since arrows between subgraphs are broken - [#7951](mermaid-js/mermaid#7951) [`afa2f80`](mermaid-js/mermaid@afa2f80) Thanks [@aloisklink](https://github.com/aloisklink)! - perf: use `fastdom` to batch DOM measurements (up to 25% speedup) - Updated dependencies \[[`e848423`](mermaid-js/mermaid@e848423)]: - @mermaid-js/parser@1.2.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@mermaid-js/layout-elk](https://github.com/mermaid-js/mermaid) | [`^0.1.9` → `^1.0.0`](https://renovatebot.com/diffs/npm/@mermaid-js%2flayout-elk/0.1.9/1.0.1) |  |  | --- ### Release Notes <details> <summary>mermaid-js/mermaid (@​mermaid-js/layout-elk)</summary> ### [`v1.0.1`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.1) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@1.0.0...@mermaid-js/layout-elk@1.0.1) ##### Patch Changes - [#​8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@​ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - Updated dependencies \[[`50c9e55`](mermaid-js/mermaid@50c9e55), [`4c90f5c`](mermaid-js/mermaid@4c90f5c), [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5), [`d67331d`](mermaid-js/mermaid@d67331d), [`99a050b`](mermaid-js/mermaid@99a050b), [`9140716`](mermaid-js/mermaid@9140716), [`3101c7d`](mermaid-js/mermaid@3101c7d), [`aa29345`](mermaid-js/mermaid@aa29345), [`967bbde`](mermaid-js/mermaid@967bbde), [`147f343`](mermaid-js/mermaid@147f343), [`40ef7b4`](mermaid-js/mermaid@40ef7b4), [`351d7d2`](mermaid-js/mermaid@351d7d2), [`b657a2c`](mermaid-js/mermaid@b657a2c), [`c38a565`](mermaid-js/mermaid@c38a565), [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2), [`8afd83c`](mermaid-js/mermaid@8afd83c), [`859f1f8`](mermaid-js/mermaid@859f1f8), [`b6d952d`](mermaid-js/mermaid@b6d952d), [`7917c1a`](mermaid-js/mermaid@7917c1a), [`4a722fb`](mermaid-js/mermaid@4a722fb)]: - mermaid\@​12.1.0 ### [`v1.0.0`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%401.0.0) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@0.2.3...@mermaid-js/layout-elk@1.0.0) ##### Major Changes - [#​8213](mermaid-js/mermaid#8213) [`33442fd`](mermaid-js/mermaid@33442fd) Thanks [@​aloisklink](https://github.com/aloisklink)! - chore!: require ES2024, Safari 17.4+, Node.JS v22.12+ Mermaid is now built to target Safari 17.4+ and ES2024. If you need to support older browsers, you may need to polyfill or transpile mermaid. Safari 17.4+ has been chosen as the floor, as unlike Firefox/Chrome, older iOS devices don't get major Safari updates. Node.JS v22.12+ is also declared as requirement in our `package.json` files, but as mermaid requires a browser, this is mainly so we can use dependencies that also declare a Node.JS v22.12+ requirement, without causing issues for users when running `npm install`. ##### Minor Changes - [#​8152](mermaid-js/mermaid#8152) [`d4bea0d`](mermaid-js/mermaid@d4bea0d) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - feat: `elk.preset` picks a named combination of the options that decide where nodes end up. Three options settle node positions, and they sit in different phases of the layout: which layer a node lands in, where it goes within that layer, and which edges get reversed to make the graph acyclic. Choosing them well means knowing all three interact; `preset` names the combinations worth using. - `default` — network simplex layering, balanced Brandes-Koepf placement at the top level and inside subgraphs, and depth-first cycle breaking. Balanced placement centres branches and composite-state entries; depth-first breaking gives shorter back edges on graphs that loop. - `legacy` — reproduces what earlier versions actually rendered: Brandes-Koepf placement with ELK's own greedy cycle breaking. - `modelOrder` — as `depthFirst`, but breaks cycles by greedy model order, which disturbs declaration order least at the cost of longer back edges. - `depthFirst` — the previous default: network simplex layering and top-level placement, Brandes-Koepf placement inside subgraphs, `NONE` alignment, and depth-first cycle breaking. ```yaml --- config: layout: elk elk: preset: legacy --- ``` Setting `layeringStrategy`, `nodePlacementStrategy`, `nodePlacementAlignment` or `cycleBreakingStrategy` explicitly overrides the preset for that one option and leaves the rest in place, so a preset is a starting point rather than a lock. **Node placement keeps `BRANDES_KOEPF`, but its alignment changes from `NONE` to `BALANCED` and cycle breaking from `GREEDY` to `DEPTH_FIRST`, so existing ELK diagrams will lay out differently.** `preset: legacy` restores the previous behaviour, and is the single switch for it — this is the net change against the last release, measured from what shipped rather than from any intermediate state. Subgraph contents use `BRANDES_KOEPF` under every preset. For `modelOrder` and `depthFirst` that is deliberately not the root's strategy: network simplex inside a frame produced routes that left the subgraph on its bounding-box corner. The two sides are tuned independently, so `nodePlacementStrategy` set explicitly still applies to both. Note that `legacy` uses `GREEDY` cycle breaking rather than the `GREEDY_MODEL_ORDER` the schema previously advertised. That default was declared in the schema but never listed in the shipped defaults, so it reached ELK as undefined and ELK's own default applied — `legacy` reproduces what was rendered, not what was documented. - [#​8152](mermaid-js/mermaid#8152) [`1246a55`](mermaid-js/mermaid@1246a55) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - feat: draw line hops where ELK edges cross, controlled by `elk.lineHops`. Where two edges cross, the one that gives way is drawn with a small arc (or a visible gap) so it is clear which line passes over which. On by default; set `elk.lineHops: false` to draw plain crossings, or `'gap'` to use gaps instead of arcs. ```yaml --- config: layout: elk elk: lineHops: gap --- ``` The crossing detection and both styles already existed and were used by swimlanes — this registers the `afterPaint` hook that lets ELK use them. An edge that takes a hop loses its corner rounding on that segment, which is the trade for a readable crossing; curved edges are skipped rather than rewritten, to avoid corrupting their geometry. **Existing ELK diagrams with crossing edges will render differently.** - [#​8155](mermaid-js/mermaid#8155) [`810893c`](mermaid-js/mermaid@810893c) Thanks [@​ashishjain0512](https://github.com/ashishjain0512)! - feat: this package is now built from mermaid's own ELK implementation instead of carrying its own copy, and is only needed for Mermaid builds that ship without ELK. `mermaid` bundles ELK and registers it automatically, so most projects can drop the dependency and the `registerLayoutLoaders` call. The package remains published and fully functional for the **tiny** build (`mermaid.tiny.js`), which omits ELK to stay small and where registering this is the only way to get an ELK layout. Because it is compiled from mermaid's ELK source rather than importing the whole `mermaid` entry point, the published bundle no longer drags in every diagram type, parser and KaTeX: the minified ESM payload drops from roughly **1.58 MB to 728 kB gzipped**. It stays self-contained, so it still loads from a CDN next to any Mermaid build with no import map. The rendering utilities the ELK source reaches (`dompurify`, `katex`, `dayjs`, `dagre-d3-es`) are now declared in the package's `dependencies`, so the npm build (`.core.mjs`) resolves them through your package manager — they dedupe against the host's copies and show up in audits — instead of carrying invisible inlined copies. > **Maintainers:** `peerDependencies.mermaid` still reads `^11.0.2`. It should be raised to the major that bundles ELK as part of the release. ##### Patch Changes - [#​8152](mermaid-js/mermaid#8152) [`785ca77`](mermaid-js/mermaid@785ca77) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: draw ELK subgraph frames an even distance from their contents. A subgraph could sit 76px from its nodes on one side and 24px on the other, with nothing visible in the gap. ELK sizes a container around everything it put inside, edges included, and an edge that runs against the flow of the layout is routed back around the outside — so a group holding one grew on whichever side that edge left by, and a group without one did not. The lane is real and the edge still needs it, so the space is not reclaimed. What changes is that the frame is no longer drawn around it: the frame is pulled in to an even distance from the group's own children, and the edge keeps its lane just outside, which is what an edge routed around a group should look like anyway. The top is left as ELK set it, since it carries the subgraph's title strip and there is no way to tell how much of that padding is the title and how much is spare. A frame still holds the lanes that genuinely belong to it. An edge with both endpoints inside a group never leaves it, so its lane is part of that group's interior and the frame stays drawn around it — which matters for nested groups, where a lane routed around an inner group sits inside the outer one. **Subgraphs render tighter, and groups that used to be visibly lopsided are now even.** - [#​8228](mermaid-js/mermaid#8228) [`e36b883`](mermaid-js/mermaid@e36b883) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - Reserve subgraph title padding before ELK routes edges so attachments stay on the painted frame. Clip stale interior endpoints along the incoming segment, avoiding edges that run along the subgraph border. - [#​8152](mermaid-js/mermaid#8152) [`1befa91`](mermaid-js/mermaid@1befa91) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: edges leave diamonds, stadiums and other non-rectangular shapes without kinking. ELK routes to ports on a node's bounding box and always leaves one perpendicular to the side it sits on. For a rectangle that port is the attachment point; for anything else the outline is inside the box, so the attachment has to move inwards — and the direction it moves in decides whether the edge stays orthogonal. It used to move along the ray from the node's centre, which lands on the outline at a different offset along the side than the port ELK chose, so the opening segment came out diagonal. The attachment now walks the outline along the edge's own departure axis, staying collinear with ELK's stub: the edge leaves the outline, crosses the box, and carries on in one straight line. Rectangular nodes are unaffected. - [#​8152](mermaid-js/mermaid#8152) [`1348b4f`](mermaid-js/mermaid@1348b4f) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: an edge no longer leaves a subgraph from the frame's corner. `elk.spacing.portsSurrounding` was left at ELK's default of `0`, which permits a port to sit exactly on a node's corner. A corner is the one boundary point with no side to leave from, so the edge came out of the vertex and then ran ALONG the frame's own edge before turning away from it. Subgraphs showed it first, because an edge that crosses a subgraph boundary attaches to the frame rather than to a node inside it, and a frame is large enough for the result to be obvious. A margin is now reserved at the ends of every side, so ELK keeps ports off the corners itself rather than the renderer correcting them afterwards. Over the `elk-edge-cases` corpus this takes the fixtures with a corner endpoint from 8 of 30 down to 3. The value is 12, chosen by measurement: it is the smallest that clears the corner on that corpus. It is not a free parameter — 30 was tried and reorders layers. - [#​8194](mermaid-js/mermaid#8194) [`012e1f7`](mermaid-js/mermaid@012e1f7) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: center edges attached to small nodes such as start/end state circles. ELK's ports-surrounding margin exceeded the side length of nodes narrower than 24px, parking the edge anchor off-center; such anchors are now discarded so the edge aims at the node center. - [#​8152](mermaid-js/mermaid#8152) [`1befa91`](mermaid-js/mermaid@1befa91) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: an edge no longer leaves a node with a tiny kink. ELK spreads an edge's port evenly along a node's side, then routes the edge down a channel whose row rarely lines up with that port exactly. The leftover is a staircase of a few pixels right at the border: leave the port, run a short distance, step perpendicular onto the channel, carry on. With rounded corners the two micro-bends sit on top of each other and read as a glitch — one edge in the sample corpus stepped 3.25px and rendered as two quadratic curves with a zero-length segment between them. The step is now removed by moving the channel onto the port's row, so the edge draws as one straight line and **both ports stay exactly where the layout put them** — sliding an attachment along a node's border leaves a node whose other edges are still evenly spread looking lopsided. Only a step next to a node is touched, and only when it is small and the edge continues the same way afterwards, so a real turn is never collapsed. An edge is left alone entirely when moving its run would drag the far port, or would buy a crossing. Set `elk.straightenEdges: false` to keep the previous behaviour. - [#​8152](mermaid-js/mermaid#8152) [`3b09225`](mermaid-js/mermaid@3b09225) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix: stop ELK subgraphs padding one side more than the other. A subgraph could end up with far more space on one side than the other for no reason a reader could see — 74px on the right of one group against 24px everywhere else. The extra space was a routing lane held open for an edge that runs against the flow of the layout and has to be routed back around, and its width came from `spacing.baseValue`. That base value was doing two jobs at once. Every unset ELK spacing derives from it, so it had to stay large enough that an edge got a straight run before the node it enters — below about 40 the approach came out shorter than the arrowhead and the turn read as happening underneath it. But an edge routed down the inside of a frame claims a lane the same width, so paying for the approach out of the base value also pushed groups clear of their own borders. The two are now bought separately. The base value drops to 24, and the approach run, node separation and edge separation are set explicitly, so edges keep the run they had without the frame paying for it. `elk.layered.spacing.edgeNodeBetweenLayers` is the key that buys the approach. An earlier attempt used `elk.layered.spacing.edgeEdgeBetweenLayers`, which is edge-to-edge and a different quantity, and a note in the source concluded from it that ELK ignored edge-node spacing "in every key form". It does not; that note was wrong and is corrected. Subgraph contents also gain `PORT_POSITION` node flexibility, which lets a node shift so an edge can leave straight rather than bending off the port. (Their placement strategy is covered in the `elk.preset` note.) **Existing diagrams with subgraphs will render differently** — groups get tighter and more even. - [#​8129](mermaid-js/mermaid#8129) [`83f5c47`](mermaid-js/mermaid@83f5c47) Thanks [@​ashishjain0512](https://github.com/ashishjain0512)! - fix(build): externalize `peerDependencies` in core builds so the layout plugins no longer inline a second copy of mermaid `getBuildConfig` only externalized `dependencies`, so a runtime (non-type) import of the peer-depended mermaid resolved through `exports` to `dist/mermaid.core.mjs` and esbuild inlined the whole bundle. `@mermaid-js/layout-elk`'s core entry had grown to 106 files / 6.6 MB, carrying its own mermaid with separate module-level singletons — so mermaid rendering fixes did not reach the ELK layout path until the plugin itself was republished. The core entry is back to 3 files / \~41 KB and now defers to the host's mermaid. The self-contained `esm` entry is unchanged. - Updated dependencies \[[`7a3c1a8`](mermaid-js/mermaid@7a3c1a8), [`0cf3797`](mermaid-js/mermaid@0cf3797), [`846fd65`](mermaid-js/mermaid@846fd65), [`33442fd`](mermaid-js/mermaid@33442fd), [`dc2e453`](mermaid-js/mermaid@dc2e453), [`ce0302d`](mermaid-js/mermaid@ce0302d), [`ad98070`](mermaid-js/mermaid@ad98070), [`e2aab3f`](mermaid-js/mermaid@e2aab3f), [`6b79518`](mermaid-js/mermaid@6b79518), [`30325d4`](mermaid-js/mermaid@30325d4), [`cd48a64`](mermaid-js/mermaid@cd48a64), [`c3ee3c7`](mermaid-js/mermaid@c3ee3c7), [`1ee934d`](mermaid-js/mermaid@1ee934d), [`a7831c5`](mermaid-js/mermaid@a7831c5), [`0cf3797`](mermaid-js/mermaid@0cf3797), [`0320406`](mermaid-js/mermaid@0320406), [`810893c`](mermaid-js/mermaid@810893c), [`e36b883`](mermaid-js/mermaid@e36b883), [`b993915`](mermaid-js/mermaid@b993915), [`4e00c5c`](mermaid-js/mermaid@4e00c5c), [`3f05015`](mermaid-js/mermaid@3f05015), [`d57ed55`](mermaid-js/mermaid@d57ed55), [`1fc5bb3`](mermaid-js/mermaid@1fc5bb3), [`b979eb4`](mermaid-js/mermaid@b979eb4), [`7ee4c3f`](mermaid-js/mermaid@7ee4c3f), [`a6ec7ff`](mermaid-js/mermaid@a6ec7ff), [`1246a55`](mermaid-js/mermaid@1246a55), [`813c766`](mermaid-js/mermaid@813c766), [`8603bdd`](mermaid-js/mermaid@8603bdd), [`43d9fbc`](mermaid-js/mermaid@43d9fbc), [`2878cf3`](mermaid-js/mermaid@2878cf3), [`16b9a7d`](mermaid-js/mermaid@16b9a7d), [`def4c81`](mermaid-js/mermaid@def4c81), [`3802472`](mermaid-js/mermaid@3802472), [`a19bd08`](mermaid-js/mermaid@a19bd08), [`f5af413`](mermaid-js/mermaid@f5af413), [`a3a92ba`](mermaid-js/mermaid@a3a92ba), [`e691042`](mermaid-js/mermaid@e691042), [`ba0deed`](mermaid-js/mermaid@ba0deed), [`b05824a`](mermaid-js/mermaid@b05824a), [`0ec29e9`](mermaid-js/mermaid@0ec29e9), [`0d77926`](mermaid-js/mermaid@0d77926), [`93edd72`](mermaid-js/mermaid@93edd72), [`75e6c30`](mermaid-js/mermaid@75e6c30), [`6df1149`](mermaid-js/mermaid@6df1149), [`a31ecb7`](mermaid-js/mermaid@a31ecb7)]: - mermaid\@​12.0.0 ### [`v0.2.3`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.3) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@0.2.2...@mermaid-js/layout-elk@0.2.3) ##### Patch Changes - [#​7828](mermaid-js/mermaid#7828) [`8eb3afc`](mermaid-js/mermaid@8eb3afc) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - feat(elk): add `elk.keepEntryNodeOnTop` config option to keep a recursive flow's entry node on top - [#​7803](mermaid-js/mermaid#7803) [`74e44eb`](mermaid-js/mermaid@74e44eb) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - feat(elk): add `elk.nodePlacementAlignment` config option - Updated dependencies \[[`215fe89`](mermaid-js/mermaid@215fe89), [`3670b4e`](mermaid-js/mermaid@3670b4e), [`cdfc0ea`](mermaid-js/mermaid@cdfc0ea), [`c45cde9`](mermaid-js/mermaid@c45cde9), [`8d874c4`](mermaid-js/mermaid@8d874c4), [`8eb3afc`](mermaid-js/mermaid@8eb3afc), [`74e44eb`](mermaid-js/mermaid@74e44eb), [`ea55b31`](mermaid-js/mermaid@ea55b31), [`b3d1f63`](mermaid-js/mermaid@b3d1f63), [`71b8843`](mermaid-js/mermaid@71b8843), [`9cbef5d`](mermaid-js/mermaid@9cbef5d), [`a2c0fb6`](mermaid-js/mermaid@a2c0fb6), [`a34cbf0`](mermaid-js/mermaid@a34cbf0), [`f9cbe1e`](mermaid-js/mermaid@f9cbe1e), [`ae3e115`](mermaid-js/mermaid@ae3e115), [`90eeece`](mermaid-js/mermaid@90eeece), [`afa2f80`](mermaid-js/mermaid@afa2f80), [`0fd7a9f`](mermaid-js/mermaid@0fd7a9f)]: - mermaid\@​11.17.0 ### [`v0.2.2`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.2) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@0.2.1...@mermaid-js/layout-elk@0.2.2) ##### Patch Changes - [#​7712](mermaid-js/mermaid#7712) [`e2e518a`](mermaid-js/mermaid@e2e518a) Thanks [@​knsv-bot](https://github.com/knsv-bot)! - fix(elk): propagate `elk.mergeEdges` config to subgraphs in ELK layout — previously edges defined inside a subgraph were not merged even when `elk.mergeEdges: true` was set - Updated dependencies \[[`ea1c48f`](mermaid-js/mermaid@ea1c48f), [`f45cc2c`](mermaid-js/mermaid@f45cc2c), [`f1f4d45`](mermaid-js/mermaid@f1f4d45), [`633c261`](mermaid-js/mermaid@633c261), [`c8ba156`](mermaid-js/mermaid@c8ba156), [`4e4e6c4`](mermaid-js/mermaid@4e4e6c4), [`cfd2391`](mermaid-js/mermaid@cfd2391), [`c1f116d`](mermaid-js/mermaid@c1f116d), [`b4d0442`](mermaid-js/mermaid@b4d0442), [`72fbab1`](mermaid-js/mermaid@72fbab1), [`a6f097d`](mermaid-js/mermaid@a6f097d), [`37f2e36`](mermaid-js/mermaid@37f2e36), [`4e63e9d`](mermaid-js/mermaid@4e63e9d), [`4887e97`](mermaid-js/mermaid@4887e97), [`a4c1e50`](mermaid-js/mermaid@a4c1e50), [`cc75089`](mermaid-js/mermaid@cc75089), [`be2e282`](mermaid-js/mermaid@be2e282), [`d945968`](mermaid-js/mermaid@d945968), [`2f5e9e8`](mermaid-js/mermaid@2f5e9e8), [`8dcdce4`](mermaid-js/mermaid@8dcdce4), [`1bbc189`](mermaid-js/mermaid@1bbc189), [`05223be`](mermaid-js/mermaid@05223be), [`365c1b1`](mermaid-js/mermaid@365c1b1), [`06a32b7`](mermaid-js/mermaid@06a32b7), [`afaf306`](mermaid-js/mermaid@afaf306), [`216e4e9`](mermaid-js/mermaid@216e4e9), [`79e97cd`](mermaid-js/mermaid@79e97cd), [`e5c75e6`](mermaid-js/mermaid@e5c75e6), [`974fa7b`](mermaid-js/mermaid@974fa7b), [`c2305df`](mermaid-js/mermaid@c2305df), [`a4a250b`](mermaid-js/mermaid@a4a250b)]: - mermaid\@​11.16.0 ### [`v0.2.1`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.1) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@0.2.0...@mermaid-js/layout-elk@0.2.1) ##### Patch Changes - [#​7425](mermaid-js/mermaid#7425) [`f16bfbb`](mermaid-js/mermaid@f16bfbb) Thanks [@​knsv](https://github.com/knsv)! - fix: use rounded right-angle edges for ELK layout ELK layout edges now default to `rounded` curve (right-angle segments with rounded corners) instead of inheriting the global `basis` default. This fixes ELK edges that were curving instead of routing at right angles ([#​7213](mermaid-js/mermaid#7213)). Non-ELK layouts are unaffected and keep their existing `basis` default. - Updated dependencies \[[`96a766d`](mermaid-js/mermaid@96a766d), [`32723b2`](mermaid-js/mermaid@32723b2), [`a60e615`](mermaid-js/mermaid@a60e615), [`1a9d45a`](mermaid-js/mermaid@1a9d45a), [`96ca7c0`](mermaid-js/mermaid@96ca7c0), [`60f6331`](mermaid-js/mermaid@60f6331), [`fa15ce8`](mermaid-js/mermaid@fa15ce8), [`33c7c72`](mermaid-js/mermaid@33c7c72), [`3c069b5`](mermaid-js/mermaid@3c069b5), [`9745f32`](mermaid-js/mermaid@9745f32), [`d6db0b0`](mermaid-js/mermaid@d6db0b0), [`cdacb0b`](mermaid-js/mermaid@cdacb0b), [`a408b55`](mermaid-js/mermaid@a408b55), [`712c1ec`](mermaid-js/mermaid@712c1ec), [`981a62e`](mermaid-js/mermaid@981a62e), [`a4bb0b5`](mermaid-js/mermaid@a4bb0b5), [`b0f9d5b`](mermaid-js/mermaid@b0f9d5b), [`981fbb8`](mermaid-js/mermaid@981fbb8), [`93aa657`](mermaid-js/mermaid@93aa657), [`6bc6617`](mermaid-js/mermaid@6bc6617), [`73e9849`](mermaid-js/mermaid@73e9849), [`9d0669a`](mermaid-js/mermaid@9d0669a), [`acce4db`](mermaid-js/mermaid@acce4db), [`7eed6a1`](mermaid-js/mermaid@7eed6a1), [`2000680`](mermaid-js/mermaid@2000680), [`b7c66a2`](mermaid-js/mermaid@b7c66a2), [`f16bfbb`](mermaid-js/mermaid@f16bfbb), [`aac86f7`](mermaid-js/mermaid@aac86f7), [`9745f32`](mermaid-js/mermaid@9745f32), [`2dd29be`](mermaid-js/mermaid@2dd29be), [`ace0367`](mermaid-js/mermaid@ace0367), [`09b74f1`](mermaid-js/mermaid@09b74f1), [`33c7c72`](mermaid-js/mermaid@33c7c72), [`835de00`](mermaid-js/mermaid@835de00), [`a9e4c72`](mermaid-js/mermaid@a9e4c72), [`ff15e51`](mermaid-js/mermaid@ff15e51), [`8bfd477`](mermaid-js/mermaid@8bfd477), [`b136acd`](mermaid-js/mermaid@b136acd), [`e0317ac`](mermaid-js/mermaid@e0317ac)]: - mermaid\@​11.13.0 ### [`v0.2.0`](https://github.com/mermaid-js/mermaid/releases/tag/%40mermaid-js/layout-elk%400.2.0) [Compare Source](https://github.com/mermaid-js/mermaid/compare/@mermaid-js/layout-elk@0.1.9...@mermaid-js/layout-elk@0.2.0) ##### Minor Changes - [#​6802](mermaid-js/mermaid#6802) [`c8e5027`](mermaid-js/mermaid@c8e5027) Thanks [@​darshanr0107](https://github.com/darshanr0107)! - feat: Update mindmap rendering to support multiple layouts, improved edge intersections, and new shapes ##### Patch Changes - Updated dependencies \[[`33bc4a0`](mermaid-js/mermaid@33bc4a0), [`e0b45c2`](mermaid-js/mermaid@e0b45c2), [`012530e`](mermaid-js/mermaid@012530e), [`c8e5027`](mermaid-js/mermaid@c8e5027)]: - mermaid\@​11.11.0 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on tuesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjEzMy4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> Reviewed-on: https://code.futo.org/harbor/harbor/pulls/1843 Reviewed-by: Mark Harding <mark@futo.org>
Summary
elk.nodePlacementAlignmentwithRIGHTDOWNas the Mermaid default for Brandes-Koepf alignment.Verification
pnpm vitest run packages/mermaid-layout-elk/src/__tests__/geometry.spec.ts packages/mermaid-layout-elk/src/__tests__/render.spec.ts packages/mermaid/src/rendering-util/rendering-elements/edges.spec.js packages/mermaid/src/rendering-util/layout-algorithms/common/index.spec.tspnpm vitest run packages/mermaid-layout-elk/src/__tests__/render.spec.ts packages/mermaid/src/config.spec.tsdecision-flow.mmd: defaultnodePlacementAlignmentgivesTask A - Merge = -23.378;NONEgives-90.255;BALANCEDgives-56.816.git diff --checknpx fallow audit --changed-since origin/develop --format jsonreports no dead code or duplication; still reports the known common-renderer complexity finding inpositionRenderedEdgeLabel.Base branch:
develop.