From 810893c660ada9e223297a38adcf65d4f4e211a7 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 10:23:56 +0200 Subject: [PATCH 01/31] feat(layout)!: bundle ELK and make it the default layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELK previously shipped as a separate `@mermaid-js/layout-elk` package that sites had to install and register. Its source now lives in core at `rendering-util/layout-algorithms/elk`, is registered automatically, and is the default `layout`. Flowchart, state, class, ER, requirement, use-case and agentflow diagrams that do not specify a `layout` are now laid out by ELK instead of dagre. Mindmap keeps dagre unless a layout is explicitly requested, which needed a way to tell "the user asked for this" from "this is just the default" — `isConfigKeySet` provides it on top of the existing `getUserDefinedConfig`. Bundling: - ELK registers behind `injected.includeLargeFeatures` as a lazy import, so the ESM builds fetch it only when a diagram uses it. The single-file IIFE build inlines it and grows by ~516 kB gzipped. - The tiny build omits ELK and falls back to dagre; its size is unchanged. - `@mermaid-js/layout-elk` remains published and is now built from core's ELK source, so there is one implementation. Because it no longer imports the whole `mermaid` entry point, its payload drops from ~1.58 MB to ~728 kB gzipped. It is how the tiny build gets ELK. Also: - Drops the cross-bundle `mermaid.mermaidAPI.setConfig` hack, which only existed because the separate bundle carried a second mermaid instance. - Routes the state renderer through `getRegisteredLayoutAlgorithm`, which it previously bypassed, so an unavailable layout falls back rather than failing to render. - Pins the e2e suite to dagre in `mermaidUrl` so existing visual baselines are preserved; diagrams that select ELK by syntax opt out, since the detector's choice ranks below a user-supplied layout. - Guards `Object.keys(dependencies)` in the esbuild config, which crashed for a package with no dependencies. Co-Authored-By: Claude Opus 5 --- .build/common.ts | 4 +- .changeset/cluster-label-measurement.md | 2 +- .changeset/elk-container-algorithms.md | 2 +- .changeset/elk-default-layout.md | 27 ++++++ .changeset/layout-elk-built-from-core.md | 11 +++ .esbuild/util.ts | 5 +- docs/config/layouts.md | 20 +++-- docs/config/setup/config/README.md | 1 + .../setup/config/functions/isConfigKeySet.md | 38 ++++++++ .../setup/mermaid/interfaces/MermaidConfig.md | 5 +- docs/intro/syntax-reference.md | 19 +++- docs/syntax/agentflow.md | 16 ++-- docs/syntax/entityRelationshipDiagram.md | 6 +- docs/syntax/flowchart.md | 17 ++-- e2e/helpers/layout-pin.spec.ts | 35 ++++++++ e2e/helpers/util.ts | 27 ++++++ e2e/rendering/elk-default.spec.ts | 87 ++++++++++++++++++ e2e/rendering/flowchart/flowchart-elk.spec.js | 10 +-- e2e/rendering/mmd-snapshots.spec.ts | 16 ++++ packages/mermaid-layout-elk/README.md | 89 ++++++++++--------- packages/mermaid-layout-elk/package.json | 19 ++-- .../src/find-common-ancestor.d.ts | 9 -- packages/mermaid-layout-elk/src/layouts.ts | 26 ------ packages/mermaid-layout-elk/types.d.ts | 12 +++ packages/mermaid/package.json | 1 + packages/mermaid/src/config.spec.ts | 38 ++++++++ packages/mermaid/src/config.ts | 16 ++++ packages/mermaid/src/config.type.ts | 3 + .../flowRenderer-elk-default.spec.ts | 74 +++++++++++++++ .../flowchart/flowRenderer-v3-unified.ts | 5 -- .../diagrams/mindmap/mindmapRenderer.spec.ts | 33 +++++++ .../src/diagrams/mindmap/mindmapRenderer.ts | 16 +++- .../state/stateRenderer-v3-unified.spec.js | 1 + .../state/stateRenderer-v3-unified.ts | 4 +- .../src/docs/.vitepress/theme/mermaid.ts | 2 - packages/mermaid/src/docs/config/layouts.md | 18 ++-- .../src/docs/intro/syntax-reference.md | 19 +++- packages/mermaid/src/docs/syntax/agentflow.md | 16 ++-- .../docs/syntax/entityRelationshipDiagram.md | 6 +- packages/mermaid/src/docs/syntax/flowchart.md | 18 ++-- .../elk}/__tests__/geometry.spec.ts | 0 .../elk}/__tests__/render.spec.ts | 0 .../layout-algorithms/elk/algorithms.ts | 16 ++++ .../elk}/find-common-ancestor.ts | 0 .../layout-algorithms/elk}/geometry.ts | 0 .../layout-algorithms/elk/index.ts | 1 + .../layout-algorithms/elk/plugin.ts | 20 +++++ .../layout-algorithms/elk}/render.ts | 11 +-- .../mermaid/src/rendering-util/render.spec.ts | 55 ++++++++++++ packages/mermaid/src/rendering-util/render.ts | 35 ++++++++ .../mermaid/src/schemas/config.schema.yaml | 5 +- pnpm-lock.yaml | 3 + 52 files changed, 744 insertions(+), 175 deletions(-) create mode 100644 .changeset/elk-default-layout.md create mode 100644 .changeset/layout-elk-built-from-core.md create mode 100644 docs/config/setup/config/functions/isConfigKeySet.md create mode 100644 e2e/helpers/layout-pin.spec.ts create mode 100644 e2e/rendering/elk-default.spec.ts delete mode 100644 packages/mermaid-layout-elk/src/find-common-ancestor.d.ts delete mode 100644 packages/mermaid-layout-elk/src/layouts.ts create mode 100644 packages/mermaid-layout-elk/types.d.ts create mode 100644 packages/mermaid/src/diagrams/flowchart/flowRenderer-elk-default.spec.ts create mode 100644 packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts rename packages/{mermaid-layout-elk/src => mermaid/src/rendering-util/layout-algorithms/elk}/__tests__/geometry.spec.ts (100%) rename packages/{mermaid-layout-elk/src => mermaid/src/rendering-util/layout-algorithms/elk}/__tests__/render.spec.ts (100%) create mode 100644 packages/mermaid/src/rendering-util/layout-algorithms/elk/algorithms.ts rename packages/{mermaid-layout-elk/src => mermaid/src/rendering-util/layout-algorithms/elk}/find-common-ancestor.ts (100%) rename packages/{mermaid-layout-elk/src => mermaid/src/rendering-util/layout-algorithms/elk}/geometry.ts (100%) create mode 100644 packages/mermaid/src/rendering-util/layout-algorithms/elk/index.ts create mode 100644 packages/mermaid/src/rendering-util/layout-algorithms/elk/plugin.ts rename packages/{mermaid-layout-elk/src => mermaid/src/rendering-util/layout-algorithms/elk}/render.ts (99%) create mode 100644 packages/mermaid/src/rendering-util/render.spec.ts diff --git a/.build/common.ts b/.build/common.ts index 2497d443f78..53c43f3911a 100644 --- a/.build/common.ts +++ b/.build/common.ts @@ -31,7 +31,9 @@ export const packageOptions = { 'mermaid-layout-elk': { name: 'mermaid-layout-elk', packageName: 'mermaid-layout-elk', - file: 'layouts.ts', + // Built from mermaid's own ELK source (path is relative to the package's + // `src`) so the plugin and the bundled layout are the same implementation. + file: '../../mermaid/src/rendering-util/layout-algorithms/elk/plugin.ts', }, 'mermaid-layout-tidy-tree': { name: 'mermaid-layout-tidy-tree', diff --git a/.changeset/cluster-label-measurement.md b/.changeset/cluster-label-measurement.md index 44a035b1f29..52d9a7cbd60 100644 --- a/.changeset/cluster-label-measurement.md +++ b/.changeset/cluster-label-measurement.md @@ -6,4 +6,4 @@ feat: `defaultMeasureLayout` accepts a `unwrapGroupLabels` option so a layout en `insertCluster` paints a plain cluster label with an infinite width while the measurement pass wrapped it at 200px, so a layout that sizes compound nodes from the measured label sized them too narrow. Layouts now opt in explicitly; core no longer inspects the layout's name. Markdown cluster labels stay wrapped, since those are painted wrapped. -`@mermaid-js/layout-elk` opts in, which changes the size of labelled subgraphs in ELK-laid-out diagrams. Diagrams laid out with dagre are unaffected. +The bundled ELK layout opts in, which changes the size of labelled subgraphs in ELK-laid-out diagrams. Diagrams laid out with dagre are unaffected. diff --git a/.changeset/elk-container-algorithms.md b/.changeset/elk-container-algorithms.md index 17dcd4cfb71..3e437056072 100644 --- a/.changeset/elk-container-algorithms.md +++ b/.changeset/elk-container-algorithms.md @@ -1,5 +1,5 @@ --- -'@mermaid-js/layout-elk': minor +'mermaid': minor --- feat: let a container pick its own ELK algorithm with `@{ algorithm: … }`, and add `elk.box` and `elk.rectpacking` to the selectable `layout` values. diff --git a/.changeset/elk-default-layout.md b/.changeset/elk-default-layout.md new file mode 100644 index 00000000000..0ba47d76bcd --- /dev/null +++ b/.changeset/elk-default-layout.md @@ -0,0 +1,27 @@ +--- +'mermaid': major +--- + +feat!: **ELK is now bundled with mermaid and is the default layout algorithm.** + +ELK previously shipped as a separate `@mermaid-js/layout-elk` package that sites had to install and register. It is now part of mermaid itself and registered automatically, so `layout: elk` — and the `elk.stress`, `elk.force`, `elk.mrtree`, `elk.sporeOverlap`, `elk.box` and `elk.rectpacking` variants — work with no setup. + +**This changes how existing diagrams look.** Flowchart, state, class, entity-relationship, requirement, use-case and agentflow diagrams that do not specify a `layout` are now laid out by ELK instead of dagre. To keep the previous layout, set dagre explicitly: + +```yaml +--- +config: + layout: dagre +--- +``` + +or globally, `mermaid.initialize({ layout: 'dagre' })`. + +Mindmap is unchanged: it keeps laying out with dagre unless a layout is explicitly requested. + +Other notes: + +- ELK is loaded as a separate chunk in the ESM builds, so it is only fetched when a diagram actually uses it. The single-file IIFE build (`mermaid.min.js`) inlines it and grows by roughly 500 kB gzipped. +- The **tiny** build deliberately omits ELK to stay small, and falls back to dagre for diagrams that ask for an ELK layout. Its size is unchanged. +- `@mermaid-js/layout-elk` is no longer needed on normal builds — existing `mermaid.registerLayoutLoaders(elkLayouts)` calls keep working and can be removed. It is still published, and remains the way to add ELK to the tiny build. +- State diagrams now resolve their layout through the same registration check as every other diagram, so an unavailable layout falls back instead of failing to render. diff --git a/.changeset/layout-elk-built-from-core.md b/.changeset/layout-elk-built-from-core.md new file mode 100644 index 00000000000..1d8d2ad3bd0 --- /dev/null +++ b/.changeset/layout-elk-built-from-core.md @@ -0,0 +1,11 @@ +--- +'@mermaid-js/layout-elk': minor +--- + +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. + +> **Maintainers:** `peerDependencies.mermaid` still reads `^11.0.2`. It should be raised to the major that bundles ELK as part of the release. diff --git a/.esbuild/util.ts b/.esbuild/util.ts index f88be638f53..5a691069728 100644 --- a/.esbuild/util.ts +++ b/.esbuild/util.ts @@ -105,8 +105,9 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => { if (core) { // Core build is used to generate file without bundled dependencies. // This is used by downstream projects to bundle dependencies themselves. - // Ignore dependencies and any dependencies of dependencies - external.push(...Object.keys(dependencies)); + // Ignore dependencies and any dependencies of dependencies. + // A package may legitimately have none at all. + external.push(...Object.keys(dependencies ?? {})); output.external = external; } diff --git a/docs/config/layouts.md b/docs/config/layouts.md index 18e9c9423b8..25d6139c30d 100644 --- a/docs/config/layouts.md +++ b/docs/config/layouts.md @@ -10,19 +10,27 @@ This page lists the available layout algorithms supported in Mermaid diagrams. ## Supported Layouts -- **elk**: [ELK (Eclipse Layout Kernel)](https://www.eclipse.org/elk/) -- **tidy-tree**: Tidy tree layout for hierarchical diagrams [Tidy Tree Configuration](/config/tidy-tree) -- **cose-bilkent**: Cose Bilkent layout for force-directed graphs +- **elk** (default): [ELK (Eclipse Layout Kernel)](https://www.eclipse.org/elk/). Bundled with Mermaid; no setup required. Specific ELK algorithms can be selected as `elk.stress`, `elk.force`, `elk.mrtree`, `elk.sporeOverlap`, `elk.box`, and `elk.rectpacking`. - **dagre**: Dagre layout for layered graphs +- **cose-bilkent**: Cose Bilkent layout for force-directed graphs +- **tidy-tree**: Tidy tree layout for hierarchical diagrams, from the [`@mermaid-js/layout-tidy-tree`](https://www.npmjs.com/package/@mermaid-js/layout-tidy-tree) package [Tidy Tree Configuration](/config/tidy-tree) + +Mindmaps are the one diagram type not laid out with ELK by default; they use +Dagre unless you ask for something else. + +The **tiny** build omits ELK to stay small, and falls back to Dagre for +diagrams that request it. ## How to Use -You can specify the layout in your diagram's YAML config or initialization options. For example: +Since `elk` is the default, a diagram needs no configuration to use it. To pick +a different layout, set it in your diagram's YAML config or initialization +options. For example: ```mermaid-example --- config: - layout: elk + layout: dagre --- graph TD; A-->B; @@ -32,7 +40,7 @@ graph TD; ```mermaid --- config: - layout: elk + layout: dagre --- graph TD; A-->B; diff --git a/docs/config/setup/config/README.md b/docs/config/setup/config/README.md index e84f71a9e8c..31450c74188 100644 --- a/docs/config/setup/config/README.md +++ b/docs/config/setup/config/README.md @@ -22,6 +22,7 @@ - [getEffectiveHtmlLabels](functions/getEffectiveHtmlLabels.md) - [getSiteConfig](functions/getSiteConfig.md) - [getUserDefinedConfig](functions/getUserDefinedConfig.md) +- [isConfigKeySet](functions/isConfigKeySet.md) - [reset](functions/reset.md) - [sanitize](functions/sanitize.md) - [saveConfigFromInitialize](functions/saveConfigFromInitialize.md) diff --git a/docs/config/setup/config/functions/isConfigKeySet.md b/docs/config/setup/config/functions/isConfigKeySet.md new file mode 100644 index 00000000000..233e679858e --- /dev/null +++ b/docs/config/setup/config/functions/isConfigKeySet.md @@ -0,0 +1,38 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/isConfigKeySet.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/isConfigKeySet.md). + +[**mermaid**](../../README.md) + +--- + +# Function: isConfigKeySet() + +> **isConfigKeySet**(`key`): `boolean` + +Defined in: [packages/mermaid/src/config.ts:254](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L254) + +Whether a top-level config key was explicitly supplied by the embedder or by +the diagram, rather than inherited from [defaultConfig](../variables/defaultConfig.md). + +The merged config cannot answer this on its own, because a value the user set +is indistinguishable from a default that happens to match it. Diagrams that +keep a default of their own while still honouring an explicit request need +that distinction. + +## Parameters + +### key + +keyof [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The top-level config key to check. + +## Returns + +`boolean` + +`true` when the key came from `initialize`, a frontmatter config +block, or a directive. diff --git a/docs/config/setup/mermaid/interfaces/MermaidConfig.md b/docs/config/setup/mermaid/interfaces/MermaidConfig.md index 400abd3371b..7fbad071854 100644 --- a/docs/config/setup/mermaid/interfaces/MermaidConfig.md +++ b/docs/config/setup/mermaid/interfaces/MermaidConfig.md @@ -303,10 +303,13 @@ Defined in: [packages/mermaid/src/config.type.ts:251](https://github.com/mermaid > `optional` **layout**: `string` -Defined in: [packages/mermaid/src/config.type.ts:101](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L101) +Defined in: [packages/mermaid/src/config.type.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L104) Defines which layout algorithm to use for rendering the diagram. +Defaults to `elk`, which is bundled with mermaid. The `tiny` build omits +ELK to stay small and falls back to `dagre`. + --- ### legacyMathML? diff --git a/docs/intro/syntax-reference.md b/docs/intro/syntax-reference.md index ffa5fe50347..8e0aba151a0 100644 --- a/docs/intro/syntax-reference.md +++ b/docs/intro/syntax-reference.md @@ -175,8 +175,12 @@ In addition to customizing the look of your diagrams, Mermaid Chart now allows y #### Supported Layout Algorithms: -- Dagre (default): This is the classic layout algorithm that has been used in Mermaid for a long time. It provides a good balance of simplicity and visual clarity, making it ideal for most diagrams. -- ELK: For those who need more sophisticated layout capabilities, especially when working with large or intricate diagrams, the ELK (Eclipse Layout Kernel) layout offers advanced options. It provides a more optimized arrangement, potentially reducing overlapping and improving readability. This is not included out the box but needs to be added when integrating mermaid for sites/applications that want to have elk support. +- ELK (default): The ELK (Eclipse Layout Kernel) layout offers more sophisticated layout capabilities, especially for large or intricate diagrams, producing a more optimized arrangement with fewer overlaps. It is bundled with Mermaid and needs no setup. +- Dagre: The classic layout algorithm used by Mermaid for a long time. It provides a good balance of simplicity and visual clarity, and remains available with `layout: dagre`. + +> **Note** +> The `mermaid` **tiny** build omits ELK to stay small. Diagrams asking for an +> ELK layout there fall back to Dagre. #### How to Select a Layout Algorithm: @@ -267,4 +271,13 @@ B -->|Option 2| D[Path 2] These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. -When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. +When integrating Mermaid, you can include look and layout configuration with the initialize call: + +```js +mermaid.initialize({ look: 'handDrawn', layout: 'elk' }); +``` + +ELK ships with Mermaid, so no separate package or registration is needed — the +`@mermaid-js/layout-elk` dependency and its `registerLayoutLoaders` call can be +removed. That package is still published for builds that omit ELK, which today +means the **tiny** build. diff --git a/docs/syntax/agentflow.md b/docs/syntax/agentflow.md index 6536bb5cc94..e9595690bef 100644 --- a/docs/syntax/agentflow.md +++ b/docs/syntax/agentflow.md @@ -278,13 +278,13 @@ fetch@{ Mermaid itself acts on a small, fixed set of keys: -| Key | Applies to | Effect | -| ------------------------------- | ---------- | ---------------------------------------------------------- | -| `shape` | nodes | Selects the node shape (see the table above) | -| `label`, `labelType` | nodes | Overrides the node's label and how it is parsed | -| `view` | containers | `collapsed` folds the container down to a summary node | -| `algorithm` | containers | Per-container ELK algorithm, with `@mermaid-js/layout-elk` | -| `curve`, `animate`, `animation` | edges | Edge interpolation and animation | +| Key | Applies to | Effect | +| ------------------------------- | ---------- | ------------------------------------------------------ | +| `shape` | nodes | Selects the node shape (see the table above) | +| `label`, `labelType` | nodes | Overrides the node's label and how it is parsed | +| `view` | containers | `collapsed` folds the container down to a summary node | +| `algorithm` | containers | Per-container ELK algorithm | +| `curve`, `animate`, `animation` | edges | Edge interpolation and animation | Everything else is carried through untouched and surfaced to consumers, so the vocabulary below is a convention rather than a closed list — an unknown key is preserved, never rejected. @@ -423,7 +423,7 @@ agentflow diagram uses the standard node, edge, and cluster theme variables. ### Layout -Agentflow renders through the unified renderer, so it works with any registered layout engine. With `@mermaid-js/layout-elk` installed, an individual container can also select its own ELK algorithm: +Agentflow renders through the unified renderer, so it works with any registered layout engine. ELK is the default, and an individual container can also select its own ELK algorithm: ```mermaid-example --- diff --git a/docs/syntax/entityRelationshipDiagram.md b/docs/syntax/entityRelationshipDiagram.md index 18b6dd78084..23c2d015b88 100644 --- a/docs/syntax/entityRelationshipDiagram.md +++ b/docs/syntax/entityRelationshipDiagram.md @@ -853,14 +853,14 @@ erDiagram ### Layout -The layout of the diagram is handled by [`render()`](../config/setup/mermaid/interfaces/Mermaid.md#render). The default layout is dagre. +The layout of the diagram is handled by [`render()`](../config/setup/mermaid/interfaces/Mermaid.md#render). The default layout is the ELK (Eclipse Layout Kernel) layout, which suits larger and more-complex diagrams. For more information, see [Customizing ELK Layout](../intro/syntax-reference.md#customizing-elk-layout). -For larger or more-complex diagrams, you can alternatively apply the ELK (Eclipse Layout Kernel) layout using your YAML frontmatter's `config`. For more information, see [Customizing ELK Layout](../intro/syntax-reference.md#customizing-elk-layout). +To use the classic Dagre layout instead, set it in your YAML frontmatter's `config`: ```yaml --- config: - layout: elk + layout: dagre --- ``` diff --git a/docs/syntax/flowchart.md b/docs/syntax/flowchart.md index aaad8d83b14..3e858303586 100644 --- a/docs/syntax/flowchart.md +++ b/docs/syntax/flowchart.md @@ -2133,21 +2133,20 @@ flowchart LR ### Renderer -The layout of the diagram is done with the renderer. The default renderer is dagre. +The layout of the diagram is done with the layout algorithm. The default is +[ELK](https://www.eclipse.org/elk/), which handles larger and more complex +diagrams well and is bundled with Mermaid. -Starting with Mermaid version 9.4, you can use an alternate renderer named elk. The elk renderer is better for larger and/or more complex diagrams. - -The _elk_ renderer is an experimental feature. -You can change the renderer to elk by adding this directive: +To use the classic Dagre layout instead: ``` config: - flowchart: - defaultRenderer: "elk" + layout: dagre ``` -> **Note** -> Note that the site needs to use mermaid version 9.4+ for this to work and have this featured enabled in the lazy-loading configuration. +The older `flowchart.defaultRenderer: "elk"` directive and the `flowchart-elk` +diagram type still work, but are no longer needed — they predate `layout` and +selected a renderer that is now the default. ### Width diff --git a/e2e/helpers/layout-pin.spec.ts b/e2e/helpers/layout-pin.spec.ts new file mode 100644 index 00000000000..55014cae933 --- /dev/null +++ b/e2e/helpers/layout-pin.spec.ts @@ -0,0 +1,35 @@ +import { describe, expect, it } from 'vitest'; +import { mermaidUrl } from './util.ts'; + +/** + * The suite pins `dagre` so screenshots stay comparable now that ELK is + * mermaid's default. Getting this wrong is invisible locally — baselines live + * in Argos — and would silently move every diagram in the suite at once, so the + * pin's precedence is asserted here rather than left to a screenshot diff. + */ +const layoutOf = (options: Record): string | undefined => { + const url = mermaidUrl('flowchart TD\n A-->B', { ...options } as never, false); + const graph = new URL(url, 'http://localhost').searchParams.get('graph'); + return JSON.parse(Buffer.from(graph!, 'base64').toString()).mermaid.layout; +}; + +describe('e2e baseline layout pin', () => { + it('pins dagre when the spec configures no layout', () => { + expect(layoutOf({})).toBe('dagre'); + }); + + it('leaves an explicitly requested layout alone', () => { + expect(layoutOf({ layout: 'elk' })).toBe('elk'); + expect(layoutOf({ layout: 'elk.mrtree' })).toBe('elk.mrtree'); + }); + + it('applies no layout at all when the diagram opts out', () => { + // `useDiagramLayout` must leave the key unset rather than set 'elk', so the + // diagram sees mermaid's real default and a regression in it would show. + expect(layoutOf({ useDiagramLayout: true })).toBeUndefined(); + }); + + it('still honours an explicit layout alongside the opt-out', () => { + expect(layoutOf({ useDiagramLayout: true, layout: 'elk' })).toBe('elk'); + }); +}); diff --git a/e2e/helpers/util.ts b/e2e/helpers/util.ts index dffe003bb6f..f16cdf895f6 100644 --- a/e2e/helpers/util.ts +++ b/e2e/helpers/util.ts @@ -22,6 +22,12 @@ interface E2EConfig { screenshotPath?: string; /** Fail when mermaid renders its syntax-error diagram instead of the requested type. Default true. */ rejectErrorDiagram?: boolean; + /** + * Skip the dagre baseline pin and let the diagram choose its own layout. + * Needed by diagrams that select ELK through their *syntax* — see + * {@link E2E_BASELINE_LAYOUT}. + */ + useDiagramLayout?: boolean; } type E2EMermaidConfig = MermaidConfig & E2EConfig; @@ -50,12 +56,33 @@ const shortenScreenshotName = (name: string, maxLen = 180): string => { return `${sanitized.slice(0, maxLen - 9)}-${hash}`; }; +/** + * Layout the visual suite's screenshots were originally captured against. + * + * ELK is mermaid's default layout now, so without a pin every existing + * screenshot in the suite would move at once. Pinning here rather than at the + * ~1600 individual call sites keeps those baselines meaningful; specs that + * exercise ELK opt in with `layout: 'elk'`, and there are dedicated ELK suites. + * + * Two ways a diagram picks its own layout, and how each interacts with this: + * - Frontmatter `config.layout` is a directive, which already outranks this + * site-level value, so those diagrams need nothing. + * - `flowchart-elk` / `graph-elk` syntax picks ELK inside the *detector*, and + * `flowDiagram.init` ranks the detector's choice BELOW a user-supplied + * layout. Pinning would silently flip those to dagre, so they must set + * `useDiagramLayout`. + */ +const E2E_BASELINE_LAYOUT = 'dagre'; + export const mermaidUrl = ( graphStr: string | string[], options: E2EMermaidConfig, api: boolean ): string => { options.handDrawnSeed = 1; + if (!options.useDiagramLayout) { + options.layout ??= E2E_BASELINE_LAYOUT; + } options.architecture = { seed: 1, ...(options.architecture ?? {}) }; options.cynefin = { seed: 1, ...(options.cynefin ?? {}) }; const codeObject: CodeObject = { diff --git a/e2e/rendering/elk-default.spec.ts b/e2e/rendering/elk-default.spec.ts new file mode 100644 index 00000000000..1cc42d5e76d --- /dev/null +++ b/e2e/rendering/elk-default.spec.ts @@ -0,0 +1,87 @@ +import { test } from '@playwright/test'; +import { imgSnapshotTest } from '../helpers/util.ts'; + +/** + * ELK is mermaid's default layout, but the rest of this suite pins dagre so its + * baselines stay comparable (see `E2E_BASELINE_LAYOUT` in helpers/util.ts). That + * leaves the shipped default itself uncovered, which is what these render: one + * representative diagram per type that was migrated to ELK, with no layout + * configured at all. + * + * `useDiagramLayout` here means "do not pin" rather than "use ELK" on purpose — + * if the default ever regressed to dagre, these would move, which is the point. + */ +const diagrams: { name: string; code: string }[] = [ + { + name: 'flowchart', + code: `flowchart TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone]`, + }, + { + name: 'state', + code: `stateDiagram-v2 + [*] --> Still + Still --> Moving + Moving --> Crash + Crash --> [*]`, + }, + { + name: 'class', + code: `classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal : +int age + Duck : +String beakColor`, + }, + { + name: 'er', + code: `erDiagram + CUSTOMER ||--o{ ORDER : places + ORDER ||--|{ LINE-ITEM : contains`, + }, + { + name: 'requirement', + code: `requirementDiagram + requirement test_req { + id: 1 + text: the test text. + risk: high + verifymethod: test + } + + element test_entity { + type: simulation + } + + test_entity - satisfies -> test_req`, + }, + { + name: 'usecase', + code: `usecase-beta + systemBoundary "System" + actor User + Login("Sign in") + end + User --> Login`, + }, + { + name: 'agentflow', + code: `agentflow-beta LR + flow review_agent["Code Review Agent"] + receive_pr("Receive PR") + analysis["Code Analysis"] + receive_pr --> analysis + end`, + }, +]; + +test.describe('default layout (elk)', () => { + for (const { name, code } of diagrams) { + test(`renders a ${name} with no layout configured`, async ({ page }, testInfo) => { + await imgSnapshotTest(page, testInfo, code, { useDiagramLayout: true, logLevel: 1 }); + }); + } +}); diff --git a/e2e/rendering/flowchart/flowchart-elk.spec.js b/e2e/rendering/flowchart/flowchart-elk.spec.js index 573e9d3ba3c..f64d12774b2 100644 --- a/e2e/rendering/flowchart/flowchart-elk.spec.js +++ b/e2e/rendering/flowchart/flowchart-elk.spec.js @@ -13,7 +13,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - {} + { useDiagramLayout: true } ); await imgSnapshotTest( page, @@ -25,7 +25,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { defaultRenderer: 'elk' } } + { flowchart: { defaultRenderer: 'elk' }, useDiagramLayout: true } ); }); @@ -42,7 +42,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: true } } + { flowchart: { useMaxWidth: true }, useDiagramLayout: true } ); const svg = page.locator('svg'); await expect(svg).toHaveAttribute('width', '100%'); @@ -62,7 +62,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: false } } + { flowchart: { useMaxWidth: false }, useDiagramLayout: true } ); const svg = page.locator('svg'); const width = parseFloat((await svg.getAttribute('width')) ?? '0'); @@ -77,7 +77,7 @@ test.describe('Flowchart ELK', () => { `flowchart-elk TD A --> B --> C --> D `, - {} + { useDiagramLayout: true } ); await page.locator('svg').evaluate((svg) => { const edges = svg.querySelectorAll('.edges > path'); diff --git a/e2e/rendering/mmd-snapshots.spec.ts b/e2e/rendering/mmd-snapshots.spec.ts index b8b83fd7a07..539231a4246 100644 --- a/e2e/rendering/mmd-snapshots.spec.ts +++ b/e2e/rendering/mmd-snapshots.spec.ts @@ -15,6 +15,21 @@ const fixtures = await collectMmdFixtures(); assertUniqueSnapshotNames(fixtures); const fixtureTree = buildFixtureTree(fixtures); +/** + * `flowchart-elk` / `graph-elk` fixtures select ELK in the detector, whose + * choice `flowDiagram.init` ranks below a user-supplied layout. Pinning the + * baseline layout for these would silently render them with dagre instead, so + * they keep whatever the diagram itself asks for. Fixtures that declare + * `layout:` in frontmatter need no such treatment: a directive already wins. + * + * Deliberately does NOT look at `flowchart.defaultRenderer`. Only + * `flowDiagram.init` promotes the detector's choice into the real config, so on + * a non-flowchart (the class/er/mindmap fixtures that carry it) the setting is + * inert and the fixture must stay pinned like any other. + */ +const selectsElkBySyntax = (source: string): boolean => + /^\s*(?:flowchart-elk|graph-elk)\b/m.test(source); + const registerFixtureNode = (node: FixtureTree): void => { for (const segment of [...node.children.keys()].sort()) { test.describe(segment, () => { @@ -36,6 +51,7 @@ const registerFixtureNode = (node: FixtureTree): void => { // folder (e.g. diagrams/packet) rather than the runner spec file. await imgSnapshotTest(page, testInfo, source, { screenshotPath: `diagrams/${relativePath.replace(/\.mmd$/i, '')}`, + useDiagramLayout: selectsElkBySyntax(source), }); }); } diff --git a/packages/mermaid-layout-elk/README.md b/packages/mermaid-layout-elk/README.md index eec287263a7..8f9bc7b977b 100644 --- a/packages/mermaid-layout-elk/README.md +++ b/packages/mermaid-layout-elk/README.md @@ -1,42 +1,36 @@ # @mermaid-js/layout-elk -This package provides a layout engine for Mermaid based on the [ELK](https://www.eclipse.org/elk/) layout engine. - -> [!NOTE] -> The ELK Layout engine will not be available in all providers that support mermaid by default. -> The websites will have to install the `@mermaid-js/layout-elk` package to use the ELK layout engine. - -## Usage - -``` -flowchart-elk TD - A --> B - A --> C -``` - -``` ---- -config: - layout: elk ---- - -flowchart TD - A --> B - A --> C +The [ELK](https://www.eclipse.org/elk/) layout engine for Mermaid. + +> [!IMPORTANT] +> **Most projects no longer need this package.** ELK is bundled with `mermaid` +> and registered automatically, and it is the default layout — a plain +> `flowchart` is laid out with ELK without any configuration. +> +> This package exists for Mermaid builds that ship without ELK, which today +> means the **tiny** build (`mermaid.tiny.js`). There, registering it is the +> only way to get an ELK layout. + +## Do I need it? + +| Using | Need this package? | +| --------------------------------------- | --------------------------------------- | +| `mermaid` (any normal build, incl. CDN) | No — ELK is built in and is the default | +| `mermaid.tiny.js` | Yes, if you want ELK | + +If you are on a normal build, delete the dependency and the registration call: + +```diff + import mermaid from 'mermaid'; +- import elkLayouts from '@mermaid-js/layout-elk'; +- +- mermaid.registerLayoutLoaders(elkLayouts); ``` -``` ---- -config: - layout: elk.stress ---- - -flowchart TD - A --> B - A --> C -``` +Registering it anyway is harmless — it re-registers the same layouts — but it +loads a second copy of the layout code for no benefit. -### With bundlers +## Usage ```sh npm install @mermaid-js/layout-elk @@ -62,11 +56,26 @@ mermaid.registerLayoutLoaders(elkLayouts); ## Supported layouts -- `elk`: The default layout, which is `elk.layered`. -- `elk.layered`: Layered layout -- `elk.stress`: Stress layout -- `elk.force`: Force layout -- `elk.mrtree`: Multi-root tree layout -- `elk.sporeOverlap`: Spore overlap layout +- `elk` — the default, which is `elk.layered` +- `elk.stress` — stress layout +- `elk.force` — force layout +- `elk.mrtree` — multi-root tree layout +- `elk.sporeOverlap` — spore overlap layout +- `elk.box` — box packing +- `elk.rectpacking` — rectangle packing + +``` +--- +config: + layout: elk.stress +--- + +flowchart TD + A --> B + A --> C +``` + +A single container can also select its own algorithm with `@{ algorithm: … }`, +which additionally accepts `elk.layered` and `elk.radial`. diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index 304cb5fa4e7..be552f20238 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -1,14 +1,14 @@ { "name": "@mermaid-js/layout-elk", "version": "0.2.3", - "description": "ELK layout engine for mermaid", + "description": "ELK layout engine for mermaid builds that do not bundle it (e.g. mermaid.tiny.js)", "module": "dist/mermaid-layout-elk.core.mjs", - "types": "dist/layouts.d.ts", + "types": "./types.d.ts", "type": "module", "exports": { ".": { "import": "./dist/mermaid-layout-elk.core.mjs", - "types": "./dist/layouts.d.ts" + "types": "./types.d.ts" }, "./*": "./*" }, @@ -30,10 +30,6 @@ "Sidharth Vinod" ], "license": "MIT", - "dependencies": { - "d3": "^7.9.0", - "elkjs": "^0.9.3" - }, "devDependencies": { "@types/d3": "^7.4.3", "mermaid": "workspace:^" @@ -42,6 +38,11 @@ "mermaid": "^11.0.2" }, "files": [ - "dist" - ] + "dist", + "types.d.ts" + ], + "dependencies": { + "d3": "^7.9.0", + "elkjs": "^0.9.3" + } } diff --git a/packages/mermaid-layout-elk/src/find-common-ancestor.d.ts b/packages/mermaid-layout-elk/src/find-common-ancestor.d.ts deleted file mode 100644 index db94f42c94f..00000000000 --- a/packages/mermaid-layout-elk/src/find-common-ancestor.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface TreeData { - parentById: Record; - childrenById: Record; -} -export declare const findCommonAncestor: ( - id1: string, - id2: string, - { parentById }: TreeData -) => string; diff --git a/packages/mermaid-layout-elk/src/layouts.ts b/packages/mermaid-layout-elk/src/layouts.ts deleted file mode 100644 index ab687990d9f..00000000000 --- a/packages/mermaid-layout-elk/src/layouts.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { LayoutLoaderDefinition } from 'mermaid'; - -const loader = async () => await import(`./render.js`); -const algos = [ - 'elk.stress', - 'elk.force', - 'elk.mrtree', - 'elk.sporeOverlap', - 'elk.box', - 'elk.rectpacking', -]; - -const layouts: LayoutLoaderDefinition[] = [ - { - name: 'elk', - loader, - algorithm: 'elk.layered', - }, - ...algos.map((algo) => ({ - name: algo, - loader, - algorithm: algo, - })), -]; - -export default layouts; diff --git a/packages/mermaid-layout-elk/types.d.ts b/packages/mermaid-layout-elk/types.d.ts new file mode 100644 index 00000000000..3528a8c5093 --- /dev/null +++ b/packages/mermaid-layout-elk/types.d.ts @@ -0,0 +1,12 @@ +import type { LayoutLoaderDefinition } from 'mermaid'; + +/** + * ELK layouts for Mermaid builds that do not bundle ELK, notably + * `mermaid.tiny.js`. Pass to `mermaid.registerLayoutLoaders`. + * + * Hand-written rather than generated: this package's implementation lives in + * mermaid itself (`rendering-util/layout-algorithms/elk/plugin.ts`), so there + * is no local source for `tsc` to emit declarations from. + */ +declare const layouts: LayoutLoaderDefinition[]; +export default layouts; diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 8569fe06042..b6a43ab6114 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -82,6 +82,7 @@ "dagre-d3-es": "7.0.14", "dayjs": "^1.11.21", "dompurify": "^3.4.12", + "elkjs": "^0.9.3", "es-toolkit": "^1.45.1", "fastdom": "1.0.12", "katex": "^0.16.47", diff --git a/packages/mermaid/src/config.spec.ts b/packages/mermaid/src/config.spec.ts index 83311811164..b3b62b875bf 100644 --- a/packages/mermaid/src/config.spec.ts +++ b/packages/mermaid/src/config.spec.ts @@ -367,3 +367,41 @@ describe('getEffectiveHtmlLabels', () => { expect(configApi.getEffectiveHtmlLabels(config)).toBe(true); }); }); + +describe('isConfigKeySet', () => { + beforeEach(() => { + configApi.reset(); + configApi.setSiteConfig({}); + // `configFromInitialize` deliberately survives `reset`, so clear it too or + // config left behind by earlier tests in this file leaks in. + configApi.saveConfigFromInitialize({}); + }); + + it('reports a key that only has a default as not set', () => { + // `layout` always has a value from defaultConfig, which is exactly why the + // merged config cannot be used to answer this. + expect(configApi.getConfig().layout).toBeDefined(); + expect(configApi.isConfigKeySet('layout')).toBe(false); + }); + + it('reports a key supplied by a directive as set', () => { + configApi.addDirective({ layout: 'dagre' }); + expect(configApi.isConfigKeySet('layout')).toBe(true); + }); + + it('reports a key set to the same value as the default as set', () => { + configApi.addDirective({ layout: configApi.defaultConfig.layout }); + expect(configApi.isConfigKeySet('layout')).toBe(true); + }); + + it('forgets directive-supplied keys after a reset', () => { + configApi.addDirective({ layout: 'dagre' }); + configApi.reset(); + expect(configApi.isConfigKeySet('layout')).toBe(false); + }); + + it('does not leak between keys', () => { + configApi.addDirective({ layout: 'dagre' }); + expect(configApi.isConfigKeySet('theme')).toBe(false); + }); +}); diff --git a/packages/mermaid/src/config.ts b/packages/mermaid/src/config.ts index 67b771a08a0..80b7f0f36dd 100644 --- a/packages/mermaid/src/config.ts +++ b/packages/mermaid/src/config.ts @@ -238,6 +238,22 @@ export const getUserDefinedConfig = (): MermaidConfig => { return userConfig; }; +/** + * Whether a top-level config key was explicitly supplied by the embedder or by + * the diagram, rather than inherited from {@link defaultConfig}. + * + * The merged config cannot answer this on its own, because a value the user set + * is indistinguishable from a default that happens to match it. Diagrams that + * keep a default of their own while still honouring an explicit request need + * that distinction. + * + * @param key - The top-level config key to check. + * @returns `true` when the key came from `initialize`, a frontmatter config + * block, or a directive. + */ +export const isConfigKeySet = (key: keyof MermaidConfig): boolean => + getUserDefinedConfig()[key] !== undefined; + /** * Helper function to handle deprecated flowchart.htmlLabels * @param config - The configuration object (merged config with defaults) diff --git a/packages/mermaid/src/config.type.ts b/packages/mermaid/src/config.type.ts index 6141e7db15c..6976e94f2c4 100644 --- a/packages/mermaid/src/config.type.ts +++ b/packages/mermaid/src/config.type.ts @@ -97,6 +97,9 @@ export interface MermaidConfig { /** * Defines which layout algorithm to use for rendering the diagram. * + * Defaults to `elk`, which is bundled with mermaid. The `tiny` build omits + * ELK to stay small and falls back to `dagre`. + * */ layout?: string; /** diff --git a/packages/mermaid/src/diagrams/flowchart/flowRenderer-elk-default.spec.ts b/packages/mermaid/src/diagrams/flowchart/flowRenderer-elk-default.spec.ts new file mode 100644 index 00000000000..14ee39de1d6 --- /dev/null +++ b/packages/mermaid/src/diagrams/flowchart/flowRenderer-elk-default.spec.ts @@ -0,0 +1,74 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest'; +import * as configApi from '../../config.js'; +import type * as RenderModule from '../../rendering-util/render.js'; +import type * as UtilsModule from '../../utils.js'; + +// Deliberately does NOT mock `getRegisteredLayoutAlgorithm`: the point of this +// spec is the real resolution of the default `layout` config through the real +// loader registry, so it would be meaningless against a stub. +const renderMock = vi.hoisted(() => vi.fn().mockResolvedValue(undefined)); + +vi.mock('../../rendering-util/render.js', async (importOriginal) => ({ + ...(await importOriginal()), + render: renderMock, +})); + +vi.mock('../../rendering-util/insertElementsForSize.js', () => ({ + getDiagramElement: vi.fn().mockReturnValue({ + attr: vi.fn().mockReturnThis(), + select: vi.fn().mockReturnThis(), + node: vi.fn().mockReturnValue(null), + }), +})); + +vi.mock('../../rendering-util/setupViewPortForSVG.js', () => ({ + setupViewPortForSVG: vi.fn(), +})); + +// Partial: the real `render.js` pulls in `internals.ts`, which needs the rest of +// utils; only `insertTitle` is stubbed because it would touch the fake svg. +vi.mock('../../utils.js', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + default: { ...actual.default, insertTitle: vi.fn() }, + }; +}); + +const drawFlowchart = async () => { + const { draw } = await import('./flowRenderer-v3-unified.js'); + const diag = { + type: 'flowchart-v2', + db: { + setDiagramId: vi.fn(), + getData: vi.fn().mockReturnValue({ nodes: [], edges: [], config: { flowchart: {} } }), + getDirection: vi.fn().mockReturnValue('TB'), + getDiagramTitle: vi.fn().mockReturnValue(''), + }, + }; + await draw('graph TB; A', 'test-id', '1.0.0', diag); + return renderMock.mock.calls.at(-1)![0] as { layoutAlgorithm: string }; +}; + +describe('flowchart default layout', () => { + beforeEach(() => { + renderMock.mockClear(); + configApi.reset(); + configApi.setSiteConfig({}); + configApi.saveConfigFromInitialize({}); + }); + + it('lays out with elk when nothing was configured', async () => { + expect((await drawFlowchart()).layoutAlgorithm).toBe('elk'); + }); + + it('still honours an explicit dagre', async () => { + configApi.addDirective({ layout: 'dagre' }); + expect((await drawFlowchart()).layoutAlgorithm).toBe('dagre'); + }); + + it('still honours an explicit elk algorithm variant', async () => { + configApi.addDirective({ layout: 'elk.mrtree' }); + expect((await drawFlowchart()).layoutAlgorithm).toBe('elk.mrtree'); + }); +}); diff --git a/packages/mermaid/src/diagrams/flowchart/flowRenderer-v3-unified.ts b/packages/mermaid/src/diagrams/flowchart/flowRenderer-v3-unified.ts index 5f923be5164..df376218f59 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowRenderer-v3-unified.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowRenderer-v3-unified.ts @@ -33,11 +33,6 @@ export const draw = async function (text: string, id: string, _version: string, data4Layout.type = diag.type; data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout); - if (data4Layout.layoutAlgorithm === 'dagre' && layout === 'elk') { - log.warn( - 'flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.' - ); - } data4Layout.direction = direction; data4Layout.nodeSpacing = conf?.nodeSpacing || 50; data4Layout.rankSpacing = conf?.rankSpacing || 50; diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts new file mode 100644 index 00000000000..85eebb81bfe --- /dev/null +++ b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts @@ -0,0 +1,33 @@ +import { describe, expect, it, vi, beforeEach } from 'vitest'; +import * as configApi from '../../config.js'; +import { resolveMindmapLayout } from './mindmapRenderer.js'; + +describe('mindmap layout selection', () => { + beforeEach(() => { + configApi.reset(); + configApi.setSiteConfig({}); + configApi.saveConfigFromInitialize({}); + }); + + it('uses dagre when no layout was requested, despite the elk default', () => { + const config = configApi.getConfig(); + expect(config.layout).toBe('elk'); + expect(resolveMindmapLayout(config.layout)).toBe('dagre'); + }); + + it('uses elk when the diagram explicitly asks for it', () => { + configApi.addDirective({ layout: 'elk' }); + expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('elk'); + }); + + it('uses cose-bilkent when the diagram explicitly asks for it', () => { + configApi.addDirective({ layout: 'cose-bilkent' }); + expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('cose-bilkent'); + }); + + it('falls back to cose-bilkent for an explicit but unregistered layout', () => { + vi.spyOn(console, 'warn').mockImplementation(() => undefined); + configApi.addDirective({ layout: 'not-a-real-layout' }); + expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('cose-bilkent'); + }); +}); diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts index 0f8e52e1e0f..3d8139d8443 100644 --- a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts +++ b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts @@ -7,7 +7,7 @@ import type { LayoutData } from '../../rendering-util/types.js'; import type { FilledMindMapNode } from './mindmapTypes.js'; import defaultConfig from '../../defaultConfig.js'; import type { MindmapDB } from './mindmapDb.js'; -import { getConfig } from '../../config.js'; +import { getConfig, isConfigKeySet } from '../../config.js'; /** * Update the layout data with actual node dimensions after drawing @@ -30,6 +30,16 @@ function _updateNodeDimensions(data4Layout: LayoutData, mindmapRoot: FilledMindM updateNode(mindmapRoot); } +/** + * Mindmap has not been migrated to ELK, so it keeps laying out with dagre even + * though the global `layout` default is now `elk`. A layout the diagram or the + * embedder explicitly asked for is still honoured. + */ +export const resolveMindmapLayout = (layout: string | undefined) => + getRegisteredLayoutAlgorithm(isConfigKeySet('layout') ? layout : 'dagre', { + fallback: 'cose-bilkent', + }); + export const draw: DrawDefinition = async (text, id, _version, diagObj) => { log.debug('Rendering mindmap diagram\n' + text); @@ -44,9 +54,7 @@ export const draw: DrawDefinition = async (text, id, _version, diagObj) => { const svg = getDiagramElement(id, data4Layout.config.securityLevel); data4Layout.type = diagObj.type; - data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(data4Layout.config.layout, { - fallback: 'cose-bilkent', - }); + data4Layout.layoutAlgorithm = resolveMindmapLayout(data4Layout.config.layout); data4Layout.diagramId = id; diff --git a/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.spec.js b/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.spec.js index f854d1703d3..2bb973c379e 100644 --- a/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.spec.js +++ b/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.spec.js @@ -19,6 +19,7 @@ vi.mock('../../diagram-api/diagramAPI.js', () => ({ })); vi.mock('../../rendering-util/render.js', () => ({ + getRegisteredLayoutAlgorithm: vi.fn().mockReturnValue('dagre'), render: vi.fn((data, svg) => { const layoutNode = data.nodes.find((node) => node.id === 'A') ?? data.nodes[0]; if (layoutNode) { diff --git a/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.ts b/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.ts index 8621b6a422f..93c77b02eb8 100644 --- a/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.ts +++ b/packages/mermaid/src/diagrams/state/stateRenderer-v3-unified.ts @@ -2,7 +2,7 @@ import { getConfig } from '../../diagram-api/diagramAPI.js'; import type { DiagramStyleClassDef } from '../../diagram-api/types.js'; import { log } from '../../logger.js'; import { getDiagramElement } from '../../rendering-util/insertElementsForSize.js'; -import { render } from '../../rendering-util/render.js'; +import { getRegisteredLayoutAlgorithm, render } from '../../rendering-util/render.js'; import { setupViewPortForSVG } from '../../rendering-util/setupViewPortForSVG.js'; import type { LayoutData } from '../../rendering-util/types.js'; import utils from '../../utils.js'; @@ -57,7 +57,7 @@ export const draw = async function (text: string, id: string, _version: string, const svg = getDiagramElement(id, securityLevel); data4Layout.type = diag.type; - data4Layout.layoutAlgorithm = layout; + data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout); // TODO: Should we move these two to baseConfig? These types are not there in StateConfig. diff --git a/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts b/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts index 24dbc39355c..9af7887e95a 100644 --- a/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts +++ b/packages/mermaid/src/docs/.vitepress/theme/mermaid.ts @@ -1,11 +1,9 @@ import mermaid, { type MermaidConfig } from 'mermaid'; import zenuml from '../../../../../mermaid-zenuml/dist/mermaid-zenuml.core.mjs'; import tidyTreeLayout from '../../../../../mermaid-layout-tidy-tree/dist/mermaid-layout-tidy-tree.core.mjs'; -import layouts from '../../../../../mermaid-layout-elk/dist/mermaid-layout-elk.core.mjs'; const init = Promise.all([ mermaid.registerExternalDiagrams([zenuml]), - mermaid.registerLayoutLoaders(layouts), mermaid.registerLayoutLoaders(tidyTreeLayout), ]); mermaid.registerIconPacks([ diff --git a/packages/mermaid/src/docs/config/layouts.md b/packages/mermaid/src/docs/config/layouts.md index 56f5072f661..73a08c6cc10 100644 --- a/packages/mermaid/src/docs/config/layouts.md +++ b/packages/mermaid/src/docs/config/layouts.md @@ -4,19 +4,27 @@ This page lists the available layout algorithms supported in Mermaid diagrams. ## Supported Layouts -- **elk**: [ELK (Eclipse Layout Kernel)](https://www.eclipse.org/elk/) -- **tidy-tree**: Tidy tree layout for hierarchical diagrams [Tidy Tree Configuration](/config/tidy-tree) -- **cose-bilkent**: Cose Bilkent layout for force-directed graphs +- **elk** (default): [ELK (Eclipse Layout Kernel)](https://www.eclipse.org/elk/). Bundled with Mermaid; no setup required. Specific ELK algorithms can be selected as `elk.stress`, `elk.force`, `elk.mrtree`, `elk.sporeOverlap`, `elk.box`, and `elk.rectpacking`. - **dagre**: Dagre layout for layered graphs +- **cose-bilkent**: Cose Bilkent layout for force-directed graphs +- **tidy-tree**: Tidy tree layout for hierarchical diagrams, from the [`@mermaid-js/layout-tidy-tree`](https://www.npmjs.com/package/@mermaid-js/layout-tidy-tree) package [Tidy Tree Configuration](/config/tidy-tree) + +Mindmaps are the one diagram type not laid out with ELK by default; they use +Dagre unless you ask for something else. + +The **tiny** build omits ELK to stay small, and falls back to Dagre for +diagrams that request it. ## How to Use -You can specify the layout in your diagram's YAML config or initialization options. For example: +Since `elk` is the default, a diagram needs no configuration to use it. To pick +a different layout, set it in your diagram's YAML config or initialization +options. For example: ```mermaid --- config: - layout: elk + layout: dagre --- graph TD; A-->B; diff --git a/packages/mermaid/src/docs/intro/syntax-reference.md b/packages/mermaid/src/docs/intro/syntax-reference.md index 8bd7197485b..37cb7a6bf8a 100644 --- a/packages/mermaid/src/docs/intro/syntax-reference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -129,8 +129,12 @@ In addition to customizing the look of your diagrams, Mermaid Chart now allows y #### Supported Layout Algorithms: -- Dagre (default): This is the classic layout algorithm that has been used in Mermaid for a long time. It provides a good balance of simplicity and visual clarity, making it ideal for most diagrams. -- ELK: For those who need more sophisticated layout capabilities, especially when working with large or intricate diagrams, the ELK (Eclipse Layout Kernel) layout offers advanced options. It provides a more optimized arrangement, potentially reducing overlapping and improving readability. This is not included out the box but needs to be added when integrating mermaid for sites/applications that want to have elk support. +- ELK (default): The ELK (Eclipse Layout Kernel) layout offers more sophisticated layout capabilities, especially for large or intricate diagrams, producing a more optimized arrangement with fewer overlaps. It is bundled with Mermaid and needs no setup. +- Dagre: The classic layout algorithm used by Mermaid for a long time. It provides a good balance of simplicity and visual clarity, and remains available with `layout: dagre`. + +> **Note** +> The `mermaid` **tiny** build omits ELK to stay small. Diagrams asking for an +> ELK layout there fall back to Dagre. #### How to Select a Layout Algorithm: @@ -208,4 +212,13 @@ B -->|Option 2| D[Path 2] These options give you the flexibility to create diagrams that not only look great but are also arranged to best suit your data’s structure and flow. -When integrating Mermaid, you can include look and layout configuration with the initialize call. This is also where you add the loading of elk. +When integrating Mermaid, you can include look and layout configuration with the initialize call: + +```js +mermaid.initialize({ look: 'handDrawn', layout: 'elk' }); +``` + +ELK ships with Mermaid, so no separate package or registration is needed — the +`@mermaid-js/layout-elk` dependency and its `registerLayoutLoaders` call can be +removed. That package is still published for builds that omit ELK, which today +means the **tiny** build. diff --git a/packages/mermaid/src/docs/syntax/agentflow.md b/packages/mermaid/src/docs/syntax/agentflow.md index aad5320a95a..82c6aa4e0d8 100644 --- a/packages/mermaid/src/docs/syntax/agentflow.md +++ b/packages/mermaid/src/docs/syntax/agentflow.md @@ -182,13 +182,13 @@ fetch@{ Mermaid itself acts on a small, fixed set of keys: -| Key | Applies to | Effect | -| ------------------------------- | ---------- | ---------------------------------------------------------- | -| `shape` | nodes | Selects the node shape (see the table above) | -| `label`, `labelType` | nodes | Overrides the node's label and how it is parsed | -| `view` | containers | `collapsed` folds the container down to a summary node | -| `algorithm` | containers | Per-container ELK algorithm, with `@mermaid-js/layout-elk` | -| `curve`, `animate`, `animation` | edges | Edge interpolation and animation | +| Key | Applies to | Effect | +| ------------------------------- | ---------- | ------------------------------------------------------ | +| `shape` | nodes | Selects the node shape (see the table above) | +| `label`, `labelType` | nodes | Overrides the node's label and how it is parsed | +| `view` | containers | `collapsed` folds the container down to a summary node | +| `algorithm` | containers | Per-container ELK algorithm | +| `curve`, `animate`, `animation` | edges | Edge interpolation and animation | Everything else is carried through untouched and surfaced to consumers, so the vocabulary below is a convention rather than a closed list — an unknown key is preserved, never rejected. @@ -280,7 +280,7 @@ agentflow diagram uses the standard node, edge, and cluster theme variables. ### Layout -Agentflow renders through the unified renderer, so it works with any registered layout engine. With `@mermaid-js/layout-elk` installed, an individual container can also select its own ELK algorithm: +Agentflow renders through the unified renderer, so it works with any registered layout engine. ELK is the default, and an individual container can also select its own ELK algorithm: ```mermaid --- diff --git a/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md b/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md index 6d7230e9deb..c5cd5ae01bc 100644 --- a/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md +++ b/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md @@ -545,14 +545,14 @@ erDiagram ### Layout -The layout of the diagram is handled by [`render()`](../config/setup/mermaid/interfaces/Mermaid.md#render). The default layout is dagre. +The layout of the diagram is handled by [`render()`](../config/setup/mermaid/interfaces/Mermaid.md#render). The default layout is the ELK (Eclipse Layout Kernel) layout, which suits larger and more-complex diagrams. For more information, see [Customizing ELK Layout](../intro/syntax-reference.md#customizing-elk-layout). -For larger or more-complex diagrams, you can alternatively apply the ELK (Eclipse Layout Kernel) layout using your YAML frontmatter's `config`. For more information, see [Customizing ELK Layout](../intro/syntax-reference.md#customizing-elk-layout). +To use the classic Dagre layout instead, set it in your YAML frontmatter's `config`: ```yaml --- config: - layout: elk + layout: dagre --- ``` diff --git a/packages/mermaid/src/docs/syntax/flowchart.md b/packages/mermaid/src/docs/syntax/flowchart.md index 1bbd624795c..4ed673e82c3 100644 --- a/packages/mermaid/src/docs/syntax/flowchart.md +++ b/packages/mermaid/src/docs/syntax/flowchart.md @@ -1389,22 +1389,20 @@ flowchart LR ### Renderer -The layout of the diagram is done with the renderer. The default renderer is dagre. +The layout of the diagram is done with the layout algorithm. The default is +[ELK](https://www.eclipse.org/elk/), which handles larger and more complex +diagrams well and is bundled with Mermaid. -Starting with Mermaid version 9.4, you can use an alternate renderer named elk. The elk renderer is better for larger and/or more complex diagrams. - -The _elk_ renderer is an experimental feature. -You can change the renderer to elk by adding this directive: +To use the classic Dagre layout instead: ``` config: - flowchart: - defaultRenderer: "elk" + layout: dagre ``` -```note -Note that the site needs to use mermaid version 9.4+ for this to work and have this featured enabled in the lazy-loading configuration. -``` +The older `flowchart.defaultRenderer: "elk"` directive and the `flowchart-elk` +diagram type still work, but are no longer needed — they predate `layout` and +selected a renderer that is now the default. ### Width diff --git a/packages/mermaid-layout-elk/src/__tests__/geometry.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/geometry.spec.ts similarity index 100% rename from packages/mermaid-layout-elk/src/__tests__/geometry.spec.ts rename to packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/geometry.spec.ts diff --git a/packages/mermaid-layout-elk/src/__tests__/render.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts similarity index 100% rename from packages/mermaid-layout-elk/src/__tests__/render.spec.ts rename to packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/algorithms.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/algorithms.ts new file mode 100644 index 00000000000..25f80352660 --- /dev/null +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/algorithms.ts @@ -0,0 +1,16 @@ +/** + * ELK algorithms selectable as `layout: `, in addition to the plain `elk` + * name which maps to `elk.layered`. + * + * Shared by mermaid's own registration and by the standalone + * `@mermaid-js/layout-elk` plugin entry, which each declare their own loader so + * that neither drags the other's dynamic import into its bundle. + */ +export const ELK_ALGORITHMS = [ + 'elk.stress', + 'elk.force', + 'elk.mrtree', + 'elk.sporeOverlap', + 'elk.box', + 'elk.rectpacking', +] as const; diff --git a/packages/mermaid-layout-elk/src/find-common-ancestor.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/find-common-ancestor.ts similarity index 100% rename from packages/mermaid-layout-elk/src/find-common-ancestor.ts rename to packages/mermaid/src/rendering-util/layout-algorithms/elk/find-common-ancestor.ts diff --git a/packages/mermaid-layout-elk/src/geometry.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/geometry.ts similarity index 100% rename from packages/mermaid-layout-elk/src/geometry.ts rename to packages/mermaid/src/rendering-util/layout-algorithms/elk/geometry.ts diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/index.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/index.ts new file mode 100644 index 00000000000..4ad9038bb6e --- /dev/null +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/index.ts @@ -0,0 +1 @@ +export { render } from './render.js'; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/plugin.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/plugin.ts new file mode 100644 index 00000000000..ed68dc34277 --- /dev/null +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/plugin.ts @@ -0,0 +1,20 @@ +import type { LayoutLoaderDefinition } from '../../render.js'; +import { ELK_ALGORITHMS } from './algorithms.js'; + +// Type-only import above, so nothing from core's render module is pulled into +// the plugin bundle. +const loader = async () => await import('./index.js'); + +/** + * Entry point for the standalone `@mermaid-js/layout-elk` package, which is + * built from this file so there is exactly one ELK implementation. + * + * mermaid registers these layouts itself, so the package is only needed for + * builds that ship without ELK — notably `mermaid.tiny.js`. + */ +const layouts: LayoutLoaderDefinition[] = [ + { name: 'elk', loader, algorithm: 'elk.layered' }, + ...ELK_ALGORITHMS.map((algorithm) => ({ name: algorithm, loader, algorithm })), +]; + +export default layouts; diff --git a/packages/mermaid-layout-elk/src/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts similarity index 99% rename from packages/mermaid-layout-elk/src/render.ts rename to packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 1f35abd7b7a..06ed574791e 100644 --- a/packages/mermaid-layout-elk/src/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -1,9 +1,9 @@ -import mermaid, { +import { createCommonLayoutRenderer, defaultMeasureLayout, type CommonLayoutRenderContext, - type LayoutData, -} from 'mermaid'; +} from '../common/index.js'; +import type { LayoutData } from '../../types.js'; // @ts-ignore TODO: Investigate D3 issue import { curveLinear } from 'd3'; import ELK from 'elkjs/lib/elk.bundled.js'; @@ -469,7 +469,6 @@ export function prepareLayoutForElk( context: CommonLayoutRenderContext ): ElkPreparedLayout { const elkContext = getElkLayoutContext(context); - syncElkPackageConfig(elkContext); applyElkEdgeRenderData(data4Layout, elkContext); return { algorithm: elkContext.algorithm }; } @@ -526,10 +525,6 @@ export const render = createCommonLayoutRenderer [node.id, node])); diff --git a/packages/mermaid/src/rendering-util/render.spec.ts b/packages/mermaid/src/rendering-util/render.spec.ts new file mode 100644 index 00000000000..24496de1838 --- /dev/null +++ b/packages/mermaid/src/rendering-util/render.spec.ts @@ -0,0 +1,55 @@ +import { describe, expect, it } from 'vitest'; +import { getLayoutLoaderDefinition, getRegisteredLayoutAlgorithm } from './render.js'; +import { ELK_ALGORITHMS } from './layout-algorithms/elk/algorithms.js'; + +// `injected.includeLargeFeatures` is defined as `true` for the unit-test build +// (see vite.config.ts), so the ELK loaders are registered here. The tiny build +// flips that flag and is covered by the bundle assertions in .esbuild. +describe('default layout loaders', () => { + it('registers elk alongside the built-in layouts', () => { + expect(getRegisteredLayoutAlgorithm('elk')).toBe('elk'); + expect(getRegisteredLayoutAlgorithm('dagre')).toBe('dagre'); + expect(getRegisteredLayoutAlgorithm('swimlane')).toBe('swimlane'); + }); + + it.each(ELK_ALGORITHMS)('registers the %s algorithm under its own name', (algorithm) => { + expect(getRegisteredLayoutAlgorithm(algorithm)).toBe(algorithm); + }); + + it('falls back to dagre for a layout that was never registered', () => { + expect(getRegisteredLayoutAlgorithm('does-not-exist')).toBe('dagre'); + }); + + // Registration only records a name; this proves the lazy import behind it + // resolves to a real layout module now that ELK lives inside the package. + it('lazily loads a renderable elk module', async () => { + const elk = await getLayoutLoaderDefinition('elk').loader(); + expect(typeof elk.render).toBe('function'); + }); + + it('points every elk algorithm at the same loader', () => { + const loaders = new Set( + ['elk', 'elk.stress', 'elk.force', 'elk.mrtree'].map( + (name) => getLayoutLoaderDefinition(name).loader + ) + ); + expect(loaders.size).toBe(1); + }); + + // The standalone plugin entry declares its own loader so the tiny build can + // compile core's away, which means the two lists could drift apart. They must + // register exactly the same layout names. + it('registers the same elk layouts as the standalone plugin entry', async () => { + const pluginLayouts = (await import('./layout-algorithms/elk/plugin.js')).default; + const expected = ['elk', ...ELK_ALGORITHMS]; + expect(pluginLayouts.map((layout) => layout.name)).toEqual(expected); + for (const { name, algorithm } of pluginLayouts) { + expect(getLayoutLoaderDefinition(name).algorithm).toBe(algorithm); + } + }); + + it('maps the bare elk name to the layered algorithm', () => { + expect(getLayoutLoaderDefinition('elk').algorithm).toBe('elk.layered'); + expect(getLayoutLoaderDefinition('elk.mrtree').algorithm).toBe('elk.mrtree'); + }); +}); diff --git a/packages/mermaid/src/rendering-util/render.ts b/packages/mermaid/src/rendering-util/render.ts index 44dd7b16cc2..577bbc0a12b 100644 --- a/packages/mermaid/src/rendering-util/render.ts +++ b/packages/mermaid/src/rendering-util/render.ts @@ -3,6 +3,7 @@ import type { InternalHelpers } from '../internals.js'; import { internalHelpers } from '../internals.js'; import { log } from '../logger.js'; import type { LayoutData } from './types.js'; +import { ELK_ALGORITHMS } from './layout-algorithms/elk/algorithms.js'; // console.log('MUST be removed, this only for keeping dev server working'); // import tmp from './layout-algorithms/dagre/index.js'; @@ -35,6 +36,36 @@ export const registerLayoutLoaders = (loaders: LayoutLoaderDefinition[]) => { } }; +/** + * Look up a registered layout by name. + * + * @internal Not part of the public API; it exists so the registration of the + * built-in layouts can be asserted on directly. + */ +export const getLayoutLoaderDefinition = (name: string): LayoutLoaderDefinition => { + const definition = layoutAlgorithms[name]; + if (!definition) { + throw new Error(`Unknown layout algorithm: ${name}`); + } + return definition; +}; + +/** + * Every ELK entry shares one loader, so all of them resolve to the same lazily + * imported chunk and elkjs is fetched at most once. + * + * The loader is declared here rather than imported from the ELK plugin entry so + * that the tiny build, which compiles this branch away, does not retain a + * dynamic import of elkjs. + */ +const elkLayoutLoaders = (): LayoutLoaderDefinition[] => { + const loader = async () => await import('./layout-algorithms/elk/index.js'); + return [ + { name: 'elk', loader, algorithm: 'elk.layered' }, + ...ELK_ALGORITHMS.map((algorithm) => ({ name: algorithm, loader, algorithm })), + ]; +}; + // TODO: Should we load dagre without lazy loading? const registerDefaultLayoutLoaders = () => { registerLayoutLoaders([ @@ -46,12 +77,16 @@ const registerDefaultLayoutLoaders = () => { name: 'swimlane', loader: async () => await import('./layout-algorithms/swimlanes/index.js'), }, + // elkjs is ~1.6 MB of source, so it is excluded from the tiny build along + // with the other large features. `getRegisteredLayoutAlgorithm` then falls + // back to dagre for diagrams that ask for an ELK layout there. ...(injected.includeLargeFeatures ? [ { name: 'cose-bilkent', loader: async () => await import('./layout-algorithms/cose-bilkent/index.js'), }, + ...elkLayoutLoaders(), ] : []), ]); diff --git a/packages/mermaid/src/schemas/config.schema.yaml b/packages/mermaid/src/schemas/config.schema.yaml index f700b60f732..12cbdf03ee5 100644 --- a/packages/mermaid/src/schemas/config.schema.yaml +++ b/packages/mermaid/src/schemas/config.schema.yaml @@ -103,8 +103,11 @@ properties: layout: description: | Defines which layout algorithm to use for rendering the diagram. + + Defaults to `elk`, which is bundled with mermaid. The `tiny` build omits + ELK to stay small and falls back to `dagre`. type: string - default: 'dagre' + default: 'elk' maxTextSize: description: The maximum allowed size of the users text diagram type: number diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 603f886af37..c1d78d11ad1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -312,6 +312,9 @@ importers: dompurify: specifier: 3.4.12 version: 3.4.12 + elkjs: + specifier: ^0.9.3 + version: 0.9.3 es-toolkit: specifier: ^1.45.1 version: 1.45.1 From 1a718ebc6295925ecb1a880eed8bc94bd72b5327 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 10:37:41 +0200 Subject: [PATCH 02/31] fix(docs): unbreak the docs build and resync generated docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CI failures from bundling ELK. build-docs: the docs site aliases `mermaid` to `dist/mermaid.esm.min.mjs`, and Vite runs `es-module-lexer` over every module for import analysis. The minified ELK chunk is the one module in the graph that lexer rejects, which surfaced as "content contains invalid JS syntax". The unminified ESM build lexes clean (verified across all 136 modules of its graph), and VitePress minifies its own output anyway, so the pre-minified input bought nothing. lint: `layout`'s longer schema description shifted line numbers in the generated config types, so four typedoc pages were stale — the source links in `MermaidConfig`, `LayoutLoaderDefinition`, `RenderOptions` and `getEffectiveHtmlLabels`. Regenerated; the diff is line numbers only. Note for anyone regenerating docs from a git worktree: typedoc requires `.git` to be a directory to discover the repository, and in a worktree it is a file, so it silently emits every "Defined in:" without its source link. The links here were restored to match what CI produces. Co-Authored-By: Claude Opus 5 --- .../functions/getEffectiveHtmlLabels.md | 2 +- .../interfaces/LayoutLoaderDefinition.md | 8 +- .../setup/mermaid/interfaces/MermaidConfig.md | 104 +++++++++--------- .../setup/mermaid/interfaces/RenderOptions.md | 4 +- packages/mermaid/src/docs/vite.config.ts | 6 +- 5 files changed, 64 insertions(+), 60 deletions(-) diff --git a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md index eb1534ae7a9..02121955aaf 100644 --- a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md +++ b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md @@ -12,7 +12,7 @@ > **getEffectiveHtmlLabels**(`config`): `boolean` -Defined in: [packages/mermaid/src/config.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L246) +Defined in: [packages/mermaid/src/config.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L262) Helper function to handle deprecated flowchart.htmlLabels diff --git a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md index 789e62045e1..e9866171c63 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md +++ b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md @@ -10,7 +10,7 @@ # Interface: LayoutLoaderDefinition -Defined in: [packages/mermaid/src/rendering-util/render.ts:24](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L24) +Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25) ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:24](https://github.co > `optional` **algorithm**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L27) +Defined in: [packages/mermaid/src/rendering-util/render.ts:28](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L28) --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.co > **loader**: `LayoutLoader` -Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L26) +Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L27) --- @@ -34,4 +34,4 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.co > **name**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25) +Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L26) diff --git a/docs/config/setup/mermaid/interfaces/MermaidConfig.md b/docs/config/setup/mermaid/interfaces/MermaidConfig.md index 7fbad071854..c84b948c425 100644 --- a/docs/config/setup/mermaid/interfaces/MermaidConfig.md +++ b/docs/config/setup/mermaid/interfaces/MermaidConfig.md @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/config.type.ts:66](https://github.com/mermaid- > `optional` **agentflow**: `AgentflowDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:236](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L236) +Defined in: [packages/mermaid/src/config.type.ts:239](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L239) --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/config.type.ts:236](https://github.com/mermaid > `optional` **altFontFamily**: `string` -Defined in: [packages/mermaid/src/config.type.ts:174](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L174) +Defined in: [packages/mermaid/src/config.type.ts:177](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L177) --- @@ -34,7 +34,7 @@ Defined in: [packages/mermaid/src/config.type.ts:174](https://github.com/mermaid > `optional` **architecture**: `ArchitectureDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:248](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L248) +Defined in: [packages/mermaid/src/config.type.ts:251](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L251) --- @@ -42,7 +42,7 @@ Defined in: [packages/mermaid/src/config.type.ts:248](https://github.com/mermaid > `optional` **arrowMarkerAbsolute**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:193](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L193) +Defined in: [packages/mermaid/src/config.type.ts:196](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L196) Controls whether or arrow markers in html code are absolute paths or anchors. This matters if you are using base tag settings. @@ -53,7 +53,7 @@ This matters if you are using base tag settings. > `optional` **block**: `BlockDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:256](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L256) +Defined in: [packages/mermaid/src/config.type.ts:259](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L259) --- @@ -61,7 +61,7 @@ Defined in: [packages/mermaid/src/config.type.ts:256](https://github.com/mermaid > `optional` **c4**: `C4DiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:253](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L253) +Defined in: [packages/mermaid/src/config.type.ts:256](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L256) --- @@ -69,7 +69,7 @@ Defined in: [packages/mermaid/src/config.type.ts:253](https://github.com/mermaid > `optional` **class**: `ClassDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:241](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L241) +Defined in: [packages/mermaid/src/config.type.ts:244](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L244) --- @@ -77,7 +77,7 @@ Defined in: [packages/mermaid/src/config.type.ts:241](https://github.com/mermaid > `optional` **cynefin**: `CynefinDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L263) +Defined in: [packages/mermaid/src/config.type.ts:266](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L266) --- @@ -85,7 +85,7 @@ Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid > `optional` **darkMode**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:158](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L158) +Defined in: [packages/mermaid/src/config.type.ts:161](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L161) --- @@ -93,7 +93,7 @@ Defined in: [packages/mermaid/src/config.type.ts:158](https://github.com/mermaid > `optional` **deterministicIds**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:226](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L226) +Defined in: [packages/mermaid/src/config.type.ts:229](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L229) This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed. @@ -109,7 +109,7 @@ should not change unless content is changed. > `optional` **deterministicIDSeed**: `string` -Defined in: [packages/mermaid/src/config.type.ts:233](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L233) +Defined in: [packages/mermaid/src/config.type.ts:236](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L236) This option is the optional seed for deterministic ids. If set to `undefined` but deterministicIds is `true`, a simple number iterator is used. @@ -121,7 +121,7 @@ You can set this attribute to base the seed on a static string. > `optional` **dompurifyConfig**: `Config` -Defined in: [packages/mermaid/src/config.type.ts:265](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L265) +Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L268) --- @@ -129,7 +129,7 @@ Defined in: [packages/mermaid/src/config.type.ts:265](https://github.com/mermaid > `optional` **elk**: `object` -Defined in: [packages/mermaid/src/config.type.ts:111](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L111) +Defined in: [packages/mermaid/src/config.type.ts:114](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L114) #### considerModelOrder? @@ -184,7 +184,7 @@ Elk specific option affecting how nodes are placed. > `optional` **er**: `ErDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:243](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L243) +Defined in: [packages/mermaid/src/config.type.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L246) --- @@ -192,7 +192,7 @@ Defined in: [packages/mermaid/src/config.type.ts:243](https://github.com/mermaid > `optional` **eventmodeling**: `EventModelingDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:257](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L257) +Defined in: [packages/mermaid/src/config.type.ts:260](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L260) --- @@ -200,7 +200,7 @@ Defined in: [packages/mermaid/src/config.type.ts:257](https://github.com/mermaid > `optional` **flowchart**: `FlowchartDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:234](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L234) +Defined in: [packages/mermaid/src/config.type.ts:237](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L237) --- @@ -208,7 +208,7 @@ Defined in: [packages/mermaid/src/config.type.ts:234](https://github.com/mermaid > `optional` **fontFamily**: `string` -Defined in: [packages/mermaid/src/config.type.ts:173](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L173) +Defined in: [packages/mermaid/src/config.type.ts:176](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L176) Specifies the font to be used in the rendered diagrams. Can be any possible CSS `font-family`. @@ -220,7 +220,7 @@ See > `optional` **fontSize**: `number` -Defined in: [packages/mermaid/src/config.type.ts:267](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L267) +Defined in: [packages/mermaid/src/config.type.ts:270](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L270) --- @@ -228,7 +228,7 @@ Defined in: [packages/mermaid/src/config.type.ts:267](https://github.com/mermaid > `optional` **forceLegacyMathML**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:215](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L215) +Defined in: [packages/mermaid/src/config.type.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L218) This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS fonts and browser's MathML implementation, this option is recommended if consistent rendering is important. @@ -240,7 +240,7 @@ If set to true, ignores legacyMathML. > `optional` **gantt**: `GanttDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:238](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L238) +Defined in: [packages/mermaid/src/config.type.ts:241](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L241) --- @@ -248,7 +248,7 @@ Defined in: [packages/mermaid/src/config.type.ts:238](https://github.com/mermaid > `optional` **gitGraph**: `GitGraphDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:252](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L252) +Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255) --- @@ -266,7 +266,7 @@ Defines the seed to be used when using handDrawn look. This is important for the > `optional` **htmlLabels**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:166](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L166) +Defined in: [packages/mermaid/src/config.type.ts:169](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L169) Flag for setting whether or not a html tag should be used for rendering labels on nodes and edges. **Note:** Diagram-specific `htmlLabels` settings (e.g., `flowchart.htmlLabels`) are deprecated. @@ -279,7 +279,7 @@ over any diagram-specific settings. > `optional` **ishikawa**: `IshikawaDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:250](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L250) +Defined in: [packages/mermaid/src/config.type.ts:253](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L253) --- @@ -287,7 +287,7 @@ Defined in: [packages/mermaid/src/config.type.ts:250](https://github.com/mermaid > `optional` **journey**: `JourneyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:239](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L239) +Defined in: [packages/mermaid/src/config.type.ts:242](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L242) --- @@ -295,7 +295,7 @@ Defined in: [packages/mermaid/src/config.type.ts:239](https://github.com/mermaid > `optional` **kanban**: `KanbanDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:251](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L251) +Defined in: [packages/mermaid/src/config.type.ts:254](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L254) --- @@ -316,7 +316,7 @@ ELK to stay small and falls back to `dagre`. > `optional` **legacyMathML**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:208](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L208) +Defined in: [packages/mermaid/src/config.type.ts:211](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L211) This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers without their own MathML implementation. If this option is disabled and MathML is not supported, the math @@ -329,7 +329,7 @@ fall back to legacy rendering for KaTeX. > `optional` **logLevel**: `0` | `2` | `1` | `"trace"` | `"debug"` | `"info"` | `"warn"` | `"error"` | `"fatal"` | `3` | `4` | `5` -Defined in: [packages/mermaid/src/config.type.ts:179](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L179) +Defined in: [packages/mermaid/src/config.type.ts:182](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L182) This option decides the amount of logging to be used by mermaid. @@ -349,7 +349,7 @@ Defines which main look to use for the diagram. > `optional` **markdownAutoWrap**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L268) +Defined in: [packages/mermaid/src/config.type.ts:271](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L271) --- @@ -357,7 +357,7 @@ Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid > `optional` **maxEdges**: `number` -Defined in: [packages/mermaid/src/config.type.ts:110](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L110) +Defined in: [packages/mermaid/src/config.type.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L113) Defines the maximum number of edges that can be drawn in a graph. @@ -367,7 +367,7 @@ Defines the maximum number of edges that can be drawn in a graph. > `optional` **maxTextSize**: `number` -Defined in: [packages/mermaid/src/config.type.ts:105](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L105) +Defined in: [packages/mermaid/src/config.type.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L108) The maximum allowed size of the users text diagram @@ -377,7 +377,7 @@ The maximum allowed size of the users text diagram > `optional` **mindmap**: `MindmapDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:249](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L249) +Defined in: [packages/mermaid/src/config.type.ts:252](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L252) --- @@ -385,7 +385,7 @@ Defined in: [packages/mermaid/src/config.type.ts:249](https://github.com/mermaid > `optional` **packet**: `PacketDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255) +Defined in: [packages/mermaid/src/config.type.ts:258](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L258) --- @@ -393,7 +393,7 @@ Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid > `optional` **pie**: `PieDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:244](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L244) +Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247) --- @@ -401,7 +401,7 @@ Defined in: [packages/mermaid/src/config.type.ts:244](https://github.com/mermaid > `optional` **quadrantChart**: `QuadrantChartConfig` -Defined in: [packages/mermaid/src/config.type.ts:245](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L245) +Defined in: [packages/mermaid/src/config.type.ts:248](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L248) --- @@ -409,7 +409,7 @@ Defined in: [packages/mermaid/src/config.type.ts:245](https://github.com/mermaid > `optional` **radar**: `RadarDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:259](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L259) +Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L262) --- @@ -417,7 +417,7 @@ Defined in: [packages/mermaid/src/config.type.ts:259](https://github.com/mermaid > `optional` **railroad**: `RailroadDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:264](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L264) +Defined in: [packages/mermaid/src/config.type.ts:267](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L267) --- @@ -425,7 +425,7 @@ Defined in: [packages/mermaid/src/config.type.ts:264](https://github.com/mermaid > `optional` **requirement**: `RequirementDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247) +Defined in: [packages/mermaid/src/config.type.ts:250](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L250) --- @@ -433,7 +433,7 @@ Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid > `optional` **sankey**: `SankeyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:254](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L254) +Defined in: [packages/mermaid/src/config.type.ts:257](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L257) --- @@ -441,7 +441,7 @@ Defined in: [packages/mermaid/src/config.type.ts:254](https://github.com/mermaid > `optional` **secure**: `string`\[] -Defined in: [packages/mermaid/src/config.type.ts:200](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L200) +Defined in: [packages/mermaid/src/config.type.ts:203](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L203) This option controls which `currentConfig` keys are considered secure and can only be changed via call to `mermaid.initialize`. @@ -453,7 +453,7 @@ This prevents malicious graph directives from overriding a site's default securi > `optional` **securityLevel**: `"strict"` | `"loose"` | `"antiscript"` | `"sandbox"` -Defined in: [packages/mermaid/src/config.type.ts:183](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L183) +Defined in: [packages/mermaid/src/config.type.ts:186](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L186) Level of trust for parsed diagram @@ -463,7 +463,7 @@ Level of trust for parsed diagram > `optional` **sequence**: `SequenceDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:237](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L237) +Defined in: [packages/mermaid/src/config.type.ts:240](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L240) --- @@ -471,7 +471,7 @@ Defined in: [packages/mermaid/src/config.type.ts:237](https://github.com/mermaid > `optional` **startOnLoad**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:187](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L187) +Defined in: [packages/mermaid/src/config.type.ts:190](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L190) Dictates whether mermaid starts on Page load @@ -481,7 +481,7 @@ Dictates whether mermaid starts on Page load > `optional` **state**: `StateDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:242](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L242) +Defined in: [packages/mermaid/src/config.type.ts:245](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L245) --- @@ -489,7 +489,7 @@ Defined in: [packages/mermaid/src/config.type.ts:242](https://github.com/mermaid > `optional` **suppressErrorRendering**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:274](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L274) +Defined in: [packages/mermaid/src/config.type.ts:277](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L277) Suppresses inserting 'Syntax error' diagram in the DOM. This is useful when you want to control how to handle syntax errors in your application. @@ -500,7 +500,7 @@ This is useful when you want to control how to handle syntax errors in your appl > `optional` **swimlane**: `SwimlaneDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:235](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L235) +Defined in: [packages/mermaid/src/config.type.ts:238](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L238) --- @@ -535,7 +535,7 @@ Defined in: [packages/mermaid/src/config.type.ts:85](https://github.com/mermaid- > `optional` **timeline**: `TimelineDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:240](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L240) +Defined in: [packages/mermaid/src/config.type.ts:243](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L243) --- @@ -543,7 +543,7 @@ Defined in: [packages/mermaid/src/config.type.ts:240](https://github.com/mermaid > `optional` **treeView**: `TreeViewDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:258](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L258) +Defined in: [packages/mermaid/src/config.type.ts:261](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L261) --- @@ -551,7 +551,7 @@ Defined in: [packages/mermaid/src/config.type.ts:258](https://github.com/mermaid > `optional` **usecase**: `UsecaseDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:260](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L260) +Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L263) --- @@ -559,7 +559,7 @@ Defined in: [packages/mermaid/src/config.type.ts:260](https://github.com/mermaid > `optional` **venn**: `VennDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:261](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L261) +Defined in: [packages/mermaid/src/config.type.ts:264](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L264) --- @@ -567,7 +567,7 @@ Defined in: [packages/mermaid/src/config.type.ts:261](https://github.com/mermaid > `optional` **wardley-beta**: `WardleyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L262) +Defined in: [packages/mermaid/src/config.type.ts:265](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L265) --- @@ -575,7 +575,7 @@ Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid > `optional` **wrap**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:266](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L266) +Defined in: [packages/mermaid/src/config.type.ts:269](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L269) --- @@ -583,4 +583,4 @@ Defined in: [packages/mermaid/src/config.type.ts:266](https://github.com/mermaid > `optional` **xyChart**: `XYChartConfig` -Defined in: [packages/mermaid/src/config.type.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L246) +Defined in: [packages/mermaid/src/config.type.ts:249](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L249) diff --git a/docs/config/setup/mermaid/interfaces/RenderOptions.md b/docs/config/setup/mermaid/interfaces/RenderOptions.md index a9091206984..61693176702 100644 --- a/docs/config/setup/mermaid/interfaces/RenderOptions.md +++ b/docs/config/setup/mermaid/interfaces/RenderOptions.md @@ -10,7 +10,7 @@ # Interface: RenderOptions -Defined in: [packages/mermaid/src/rendering-util/render.ts:10](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L10) +Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L11) ## Properties @@ -18,4 +18,4 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:10](https://github.co > `optional` **algorithm**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L11) +Defined in: [packages/mermaid/src/rendering-util/render.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L12) diff --git a/packages/mermaid/src/docs/vite.config.ts b/packages/mermaid/src/docs/vite.config.ts index 9738c83310c..85c3c08d3ea 100644 --- a/packages/mermaid/src/docs/vite.config.ts +++ b/packages/mermaid/src/docs/vite.config.ts @@ -77,7 +77,11 @@ export default defineConfig({ ], resolve: { alias: { - mermaid: path.join(__dirname, '../../dist/mermaid.esm.min.mjs'), // Use this one to build + // Deliberately not the minified build: esbuild's syntax minification + // leaves the ELK chunk in a form that `es-module-lexer`, which Vite uses + // for import analysis, fails to lex. VitePress minifies its own output + // anyway, so feeding it a pre-minified bundle bought nothing. + mermaid: path.join(__dirname, '../../dist/mermaid.esm.mjs'), // Use this one to build '@mermaid-js/mermaid-example-diagram': path.join( __dirname, '../../../mermaid-example-diagram/dist/mermaid-example-diagram.esm.min.mjs' From 8105f5b6b7b1bb6e775d55fc9307ec24d4e48a45 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 11:07:47 +0200 Subject: [PATCH 03/31] fix(e2e): stop the dagre pin overriding diagrams that pick their own layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The baseline pin set `layout: dagre` for any spec that did not ask for one, which outranks a diagram type's own choice — so the whole swimlanes suite rendered with dagre and lost its lanes (33 failures on `g.cluster.swimlane` resolving to 0 elements). `swimlanes` is `createFlowDiagram({ defaultLayout: 'swimlane' })`, and `flowDiagram.init` ranks `defaultLayout` below a user-supplied layout — exactly the precedence that `flowchart-elk` already needed an opt-out for. I only special-cased the ELK half of it. Detect this from the diagram source in `mermaidUrl` instead of relying on each spec to pass `useDiagramLayout`, because a missed case does not fail loudly: the swimlanes fixtures under `e2e/diagrams` render through the screenshot-only mmd runner, where a dagre-laid-out swimlanes diagram would have been silently baselined as correct. `useDiagramLayout` stays for `flowchart.defaultRenderer: 'elk'`, which is not detectable from the source — only `flowDiagram.init` promotes it, so it is inert on the class/er/mindmap fixtures that carry it and those must stay pinned. Extends the pin regression spec to cover self-selecting diagrams, multi-graph renders, and a flowchart that merely mentions the keyword in a node label. Co-Authored-By: Claude Opus 5 --- e2e/helpers/layout-pin.spec.ts | 33 +++++++++++++++--- e2e/helpers/util.ts | 34 ++++++++++++++++--- e2e/rendering/flowchart/flowchart-elk.spec.js | 8 ++--- e2e/rendering/mmd-snapshots.spec.ts | 16 --------- 4 files changed, 62 insertions(+), 29 deletions(-) diff --git a/e2e/helpers/layout-pin.spec.ts b/e2e/helpers/layout-pin.spec.ts index 55014cae933..f4aaf1363f3 100644 --- a/e2e/helpers/layout-pin.spec.ts +++ b/e2e/helpers/layout-pin.spec.ts @@ -7,10 +7,15 @@ import { mermaidUrl } from './util.ts'; * in Argos — and would silently move every diagram in the suite at once, so the * pin's precedence is asserted here rather than left to a screenshot diff. */ -const layoutOf = (options: Record): string | undefined => { - const url = mermaidUrl('flowchart TD\n A-->B', { ...options } as never, false); - const graph = new URL(url, 'http://localhost').searchParams.get('graph'); - return JSON.parse(Buffer.from(graph!, 'base64').toString()).mermaid.layout; +const layoutOf = ( + options: Record, + graph: string | string[] = 'flowchart TD\n A-->B' +): string | undefined => { + const url = mermaidUrl(graph, { ...options } as never, false); + // Read the raw value: base64 can contain `+`, which URLSearchParams would + // decode to a space and corrupt. + const encoded = url.slice(url.indexOf('?graph=') + '?graph='.length); + return JSON.parse(Buffer.from(encoded, 'base64').toString()).mermaid.layout; }; describe('e2e baseline layout pin', () => { @@ -32,4 +37,24 @@ describe('e2e baseline layout pin', () => { it('still honours an explicit layout alongside the opt-out', () => { expect(layoutOf({ useDiagramLayout: true, layout: 'elk' })).toBe('elk'); }); + + // A diagram whose *type* picks its layout loses to a user-supplied one, so + // pinning would quietly render it with the wrong engine — swimlanes without + // lanes, `flowchart-elk` as dagre — and a screenshot-only test would just + // bake in the wrong baseline. + it.each([ + ['swimlane-beta LR\n subgraph A\n B-->C\n end'], + ['flowchart-elk TD\n A-->B'], + ['graph-elk TD\n A-->B'], + ])('leaves a diagram that selects its own layout unpinned: %s', (graph) => { + expect(layoutOf({}, graph)).toBeUndefined(); + }); + + it('detects a self-selecting diagram anywhere in a multi-graph render', () => { + expect(layoutOf({}, ['flowchart TD\n A-->B', 'swimlane-beta LR\n X-->Y'])).toBeUndefined(); + }); + + it('still pins an ordinary flowchart that merely mentions swimlanes', () => { + expect(layoutOf({}, 'flowchart TD\n A[swimlane-beta] --> B')).toBe('dagre'); + }); }); diff --git a/e2e/helpers/util.ts b/e2e/helpers/util.ts index f16cdf895f6..3f44e62e0a4 100644 --- a/e2e/helpers/util.ts +++ b/e2e/helpers/util.ts @@ -67,20 +67,44 @@ const shortenScreenshotName = (name: string, maxLen = 180): string => { * Two ways a diagram picks its own layout, and how each interacts with this: * - Frontmatter `config.layout` is a directive, which already outranks this * site-level value, so those diagrams need nothing. - * - `flowchart-elk` / `graph-elk` syntax picks ELK inside the *detector*, and - * `flowDiagram.init` ranks the detector's choice BELOW a user-supplied - * layout. Pinning would silently flip those to dagre, so they must set - * `useDiagramLayout`. + * - The diagram type itself picks one, which `flowDiagram.init` ranks BELOW a + * user-supplied layout — so pinning would silently override it. Those are + * detected by {@link selectsOwnLayout} and left unpinned. */ const E2E_BASELINE_LAYOUT = 'dagre'; +/** + * Diagram syntaxes that select their own layout, which the baseline pin must + * not override. + * + * Two routes, both resolved in `flowDiagram.init` below a user-supplied layout: + * the ELK detector (`flowchart-elk` / `graph-elk`), and a diagram definition's + * own `defaultLayout` (`swimlane-beta`, via `createFlowDiagram`). + * + * Detected from the diagram source rather than left to each spec to remember, + * because getting it wrong does not fail loudly — a swimlanes diagram pinned to + * dagre still renders, just without its lanes, which in a screenshot-only test + * means a silently wrong baseline. + * + * Deliberately does NOT cover `flowchart.defaultRenderer: 'elk'`: only + * `flowDiagram.init` promotes that into the real config, so on the class/er/ + * mindmap fixtures that carry it the setting is inert and they must stay + * pinned. Those few flowcharts that need it pass `useDiagramLayout` instead. + */ +const SELF_SELECTED_LAYOUT_RE = /^\s*(?:flowchart-elk|graph-elk|swimlane-beta)\b/m; + +const selectsOwnLayout = (graphStr: string | string[]): boolean => + (Array.isArray(graphStr) ? graphStr : [graphStr]).some((graph) => + SELF_SELECTED_LAYOUT_RE.test(graph) + ); + export const mermaidUrl = ( graphStr: string | string[], options: E2EMermaidConfig, api: boolean ): string => { options.handDrawnSeed = 1; - if (!options.useDiagramLayout) { + if (!options.useDiagramLayout && !selectsOwnLayout(graphStr)) { options.layout ??= E2E_BASELINE_LAYOUT; } options.architecture = { seed: 1, ...(options.architecture ?? {}) }; diff --git a/e2e/rendering/flowchart/flowchart-elk.spec.js b/e2e/rendering/flowchart/flowchart-elk.spec.js index f64d12774b2..d57ad5204d4 100644 --- a/e2e/rendering/flowchart/flowchart-elk.spec.js +++ b/e2e/rendering/flowchart/flowchart-elk.spec.js @@ -13,7 +13,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { useDiagramLayout: true } + {} ); await imgSnapshotTest( page, @@ -42,7 +42,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: true }, useDiagramLayout: true } + { flowchart: { useMaxWidth: true } } ); const svg = page.locator('svg'); await expect(svg).toHaveAttribute('width', '100%'); @@ -62,7 +62,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: false }, useDiagramLayout: true } + { flowchart: { useMaxWidth: false } } ); const svg = page.locator('svg'); const width = parseFloat((await svg.getAttribute('width')) ?? '0'); @@ -77,7 +77,7 @@ test.describe('Flowchart ELK', () => { `flowchart-elk TD A --> B --> C --> D `, - { useDiagramLayout: true } + {} ); await page.locator('svg').evaluate((svg) => { const edges = svg.querySelectorAll('.edges > path'); diff --git a/e2e/rendering/mmd-snapshots.spec.ts b/e2e/rendering/mmd-snapshots.spec.ts index 539231a4246..b8b83fd7a07 100644 --- a/e2e/rendering/mmd-snapshots.spec.ts +++ b/e2e/rendering/mmd-snapshots.spec.ts @@ -15,21 +15,6 @@ const fixtures = await collectMmdFixtures(); assertUniqueSnapshotNames(fixtures); const fixtureTree = buildFixtureTree(fixtures); -/** - * `flowchart-elk` / `graph-elk` fixtures select ELK in the detector, whose - * choice `flowDiagram.init` ranks below a user-supplied layout. Pinning the - * baseline layout for these would silently render them with dagre instead, so - * they keep whatever the diagram itself asks for. Fixtures that declare - * `layout:` in frontmatter need no such treatment: a directive already wins. - * - * Deliberately does NOT look at `flowchart.defaultRenderer`. Only - * `flowDiagram.init` promotes the detector's choice into the real config, so on - * a non-flowchart (the class/er/mindmap fixtures that carry it) the setting is - * inert and the fixture must stay pinned like any other. - */ -const selectsElkBySyntax = (source: string): boolean => - /^\s*(?:flowchart-elk|graph-elk)\b/m.test(source); - const registerFixtureNode = (node: FixtureTree): void => { for (const segment of [...node.children.keys()].sort()) { test.describe(segment, () => { @@ -51,7 +36,6 @@ const registerFixtureNode = (node: FixtureTree): void => { // folder (e.g. diagrams/packet) rather than the runner spec file. await imgSnapshotTest(page, testInfo, source, { screenshotPath: `diagrams/${relativePath.replace(/\.mmd$/i, '')}`, - useDiagramLayout: selectsElkBySyntax(source), }); }); } From cf03e4d60c8765059bfa55522920737939bf1512 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 14:35:34 +0200 Subject: [PATCH 04/31] test(e2e): drop the dagre pin so baselines show the new ELK default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The suite was pinned to dagre in `mermaidUrl` to keep existing Argos baselines comparable. That hides the layout users will actually get, so remove it and let every diagram render with ELK — the baselines are meant to move. Removes the pin, the `useDiagramLayout` opt-out and the self-selecting-layout detection it needed, plus the regression spec guarding all of it. `e2e/` is now byte-identical to before this branch. Also drops `elk-default.spec.ts`. It existed only to cover the shipped default that the pin was hiding; with no pin, every spec exercises it. Argos will show a large diff across the whole suite. That is the intent: it is the review surface for how diagrams look under ELK. Co-Authored-By: Claude Opus 5 --- e2e/helpers/layout-pin.spec.ts | 60 ------------- e2e/helpers/util.ts | 51 ----------- e2e/rendering/elk-default.spec.ts | 87 ------------------- e2e/rendering/flowchart/flowchart-elk.spec.js | 2 +- 4 files changed, 1 insertion(+), 199 deletions(-) delete mode 100644 e2e/helpers/layout-pin.spec.ts delete mode 100644 e2e/rendering/elk-default.spec.ts diff --git a/e2e/helpers/layout-pin.spec.ts b/e2e/helpers/layout-pin.spec.ts deleted file mode 100644 index f4aaf1363f3..00000000000 --- a/e2e/helpers/layout-pin.spec.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { describe, expect, it } from 'vitest'; -import { mermaidUrl } from './util.ts'; - -/** - * The suite pins `dagre` so screenshots stay comparable now that ELK is - * mermaid's default. Getting this wrong is invisible locally — baselines live - * in Argos — and would silently move every diagram in the suite at once, so the - * pin's precedence is asserted here rather than left to a screenshot diff. - */ -const layoutOf = ( - options: Record, - graph: string | string[] = 'flowchart TD\n A-->B' -): string | undefined => { - const url = mermaidUrl(graph, { ...options } as never, false); - // Read the raw value: base64 can contain `+`, which URLSearchParams would - // decode to a space and corrupt. - const encoded = url.slice(url.indexOf('?graph=') + '?graph='.length); - return JSON.parse(Buffer.from(encoded, 'base64').toString()).mermaid.layout; -}; - -describe('e2e baseline layout pin', () => { - it('pins dagre when the spec configures no layout', () => { - expect(layoutOf({})).toBe('dagre'); - }); - - it('leaves an explicitly requested layout alone', () => { - expect(layoutOf({ layout: 'elk' })).toBe('elk'); - expect(layoutOf({ layout: 'elk.mrtree' })).toBe('elk.mrtree'); - }); - - it('applies no layout at all when the diagram opts out', () => { - // `useDiagramLayout` must leave the key unset rather than set 'elk', so the - // diagram sees mermaid's real default and a regression in it would show. - expect(layoutOf({ useDiagramLayout: true })).toBeUndefined(); - }); - - it('still honours an explicit layout alongside the opt-out', () => { - expect(layoutOf({ useDiagramLayout: true, layout: 'elk' })).toBe('elk'); - }); - - // A diagram whose *type* picks its layout loses to a user-supplied one, so - // pinning would quietly render it with the wrong engine — swimlanes without - // lanes, `flowchart-elk` as dagre — and a screenshot-only test would just - // bake in the wrong baseline. - it.each([ - ['swimlane-beta LR\n subgraph A\n B-->C\n end'], - ['flowchart-elk TD\n A-->B'], - ['graph-elk TD\n A-->B'], - ])('leaves a diagram that selects its own layout unpinned: %s', (graph) => { - expect(layoutOf({}, graph)).toBeUndefined(); - }); - - it('detects a self-selecting diagram anywhere in a multi-graph render', () => { - expect(layoutOf({}, ['flowchart TD\n A-->B', 'swimlane-beta LR\n X-->Y'])).toBeUndefined(); - }); - - it('still pins an ordinary flowchart that merely mentions swimlanes', () => { - expect(layoutOf({}, 'flowchart TD\n A[swimlane-beta] --> B')).toBe('dagre'); - }); -}); diff --git a/e2e/helpers/util.ts b/e2e/helpers/util.ts index 3f44e62e0a4..dffe003bb6f 100644 --- a/e2e/helpers/util.ts +++ b/e2e/helpers/util.ts @@ -22,12 +22,6 @@ interface E2EConfig { screenshotPath?: string; /** Fail when mermaid renders its syntax-error diagram instead of the requested type. Default true. */ rejectErrorDiagram?: boolean; - /** - * Skip the dagre baseline pin and let the diagram choose its own layout. - * Needed by diagrams that select ELK through their *syntax* — see - * {@link E2E_BASELINE_LAYOUT}. - */ - useDiagramLayout?: boolean; } type E2EMermaidConfig = MermaidConfig & E2EConfig; @@ -56,57 +50,12 @@ const shortenScreenshotName = (name: string, maxLen = 180): string => { return `${sanitized.slice(0, maxLen - 9)}-${hash}`; }; -/** - * Layout the visual suite's screenshots were originally captured against. - * - * ELK is mermaid's default layout now, so without a pin every existing - * screenshot in the suite would move at once. Pinning here rather than at the - * ~1600 individual call sites keeps those baselines meaningful; specs that - * exercise ELK opt in with `layout: 'elk'`, and there are dedicated ELK suites. - * - * Two ways a diagram picks its own layout, and how each interacts with this: - * - Frontmatter `config.layout` is a directive, which already outranks this - * site-level value, so those diagrams need nothing. - * - The diagram type itself picks one, which `flowDiagram.init` ranks BELOW a - * user-supplied layout — so pinning would silently override it. Those are - * detected by {@link selectsOwnLayout} and left unpinned. - */ -const E2E_BASELINE_LAYOUT = 'dagre'; - -/** - * Diagram syntaxes that select their own layout, which the baseline pin must - * not override. - * - * Two routes, both resolved in `flowDiagram.init` below a user-supplied layout: - * the ELK detector (`flowchart-elk` / `graph-elk`), and a diagram definition's - * own `defaultLayout` (`swimlane-beta`, via `createFlowDiagram`). - * - * Detected from the diagram source rather than left to each spec to remember, - * because getting it wrong does not fail loudly — a swimlanes diagram pinned to - * dagre still renders, just without its lanes, which in a screenshot-only test - * means a silently wrong baseline. - * - * Deliberately does NOT cover `flowchart.defaultRenderer: 'elk'`: only - * `flowDiagram.init` promotes that into the real config, so on the class/er/ - * mindmap fixtures that carry it the setting is inert and they must stay - * pinned. Those few flowcharts that need it pass `useDiagramLayout` instead. - */ -const SELF_SELECTED_LAYOUT_RE = /^\s*(?:flowchart-elk|graph-elk|swimlane-beta)\b/m; - -const selectsOwnLayout = (graphStr: string | string[]): boolean => - (Array.isArray(graphStr) ? graphStr : [graphStr]).some((graph) => - SELF_SELECTED_LAYOUT_RE.test(graph) - ); - export const mermaidUrl = ( graphStr: string | string[], options: E2EMermaidConfig, api: boolean ): string => { options.handDrawnSeed = 1; - if (!options.useDiagramLayout && !selectsOwnLayout(graphStr)) { - options.layout ??= E2E_BASELINE_LAYOUT; - } options.architecture = { seed: 1, ...(options.architecture ?? {}) }; options.cynefin = { seed: 1, ...(options.cynefin ?? {}) }; const codeObject: CodeObject = { diff --git a/e2e/rendering/elk-default.spec.ts b/e2e/rendering/elk-default.spec.ts deleted file mode 100644 index 1cc42d5e76d..00000000000 --- a/e2e/rendering/elk-default.spec.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { test } from '@playwright/test'; -import { imgSnapshotTest } from '../helpers/util.ts'; - -/** - * ELK is mermaid's default layout, but the rest of this suite pins dagre so its - * baselines stay comparable (see `E2E_BASELINE_LAYOUT` in helpers/util.ts). That - * leaves the shipped default itself uncovered, which is what these render: one - * representative diagram per type that was migrated to ELK, with no layout - * configured at all. - * - * `useDiagramLayout` here means "do not pin" rather than "use ELK" on purpose — - * if the default ever regressed to dagre, these would move, which is the point. - */ -const diagrams: { name: string; code: string }[] = [ - { - name: 'flowchart', - code: `flowchart TD - A[Christmas] -->|Get money| B(Go shopping) - B --> C{Let me think} - C -->|One| D[Laptop] - C -->|Two| E[iPhone]`, - }, - { - name: 'state', - code: `stateDiagram-v2 - [*] --> Still - Still --> Moving - Moving --> Crash - Crash --> [*]`, - }, - { - name: 'class', - code: `classDiagram - Animal <|-- Duck - Animal <|-- Fish - Animal : +int age - Duck : +String beakColor`, - }, - { - name: 'er', - code: `erDiagram - CUSTOMER ||--o{ ORDER : places - ORDER ||--|{ LINE-ITEM : contains`, - }, - { - name: 'requirement', - code: `requirementDiagram - requirement test_req { - id: 1 - text: the test text. - risk: high - verifymethod: test - } - - element test_entity { - type: simulation - } - - test_entity - satisfies -> test_req`, - }, - { - name: 'usecase', - code: `usecase-beta - systemBoundary "System" - actor User - Login("Sign in") - end - User --> Login`, - }, - { - name: 'agentflow', - code: `agentflow-beta LR - flow review_agent["Code Review Agent"] - receive_pr("Receive PR") - analysis["Code Analysis"] - receive_pr --> analysis - end`, - }, -]; - -test.describe('default layout (elk)', () => { - for (const { name, code } of diagrams) { - test(`renders a ${name} with no layout configured`, async ({ page }, testInfo) => { - await imgSnapshotTest(page, testInfo, code, { useDiagramLayout: true, logLevel: 1 }); - }); - } -}); diff --git a/e2e/rendering/flowchart/flowchart-elk.spec.js b/e2e/rendering/flowchart/flowchart-elk.spec.js index d57ad5204d4..573e9d3ba3c 100644 --- a/e2e/rendering/flowchart/flowchart-elk.spec.js +++ b/e2e/rendering/flowchart/flowchart-elk.spec.js @@ -25,7 +25,7 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { defaultRenderer: 'elk' }, useDiagramLayout: true } + { flowchart: { defaultRenderer: 'elk' } } ); }); From e98b0458342b350fc10c4df0b2afa04ba39cc846 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 14:43:04 +0200 Subject: [PATCH 05/31] test: give the usecase docs render spec room for ELK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `usecase.docs.spec.ts` renders all 20 mermaid-example fences from the canonical page through a real layout engine in jsdom. ELK, now the default, does considerably more work than dagre and pays a one-off cost to load elkjs — roughly 55ms per example locally, which on a slower CI runner pushes the whole spec past vitest's 5s default. It timed out in CI while passing locally in 1.1s. Adds an optional timeout passthrough to `jsdomIt` and uses 30s here. Left as a real render rather than pinned to dagre: the point of the spec is that the documented examples render under the layout users actually get. Co-Authored-By: Claude Opus 5 --- .../src/diagrams/usecase/usecase.docs.spec.ts | 36 +++++++----- packages/mermaid/src/tests/util.ts | 58 +++++++++++-------- 2 files changed, 56 insertions(+), 38 deletions(-) diff --git a/packages/mermaid/src/diagrams/usecase/usecase.docs.spec.ts b/packages/mermaid/src/diagrams/usecase/usecase.docs.spec.ts index 8e1d1411813..8c9e18e3a13 100644 --- a/packages/mermaid/src/diagrams/usecase/usecase.docs.spec.ts +++ b/packages/mermaid/src/diagrams/usecase/usecase.docs.spec.ts @@ -27,20 +27,30 @@ const extractMermaidExamples = (markdown: string): string[] => ([, source]) => source ); +// Renders all 20 examples from the page through a real layout engine in jsdom. +// ELK, now the default layout, does considerably more work than dagre and pays +// a one-off cost to load elkjs, which pushes this past vitest's 5s default on +// slower CI runners. +const RENDER_ALL_EXAMPLES_TIMEOUT_MS = 30_000; + describe('usecase public documentation examples', () => { - jsdomIt('parses and renders every mermaid-example fence from the canonical page', async () => { - const examples = extractMermaidExamples(readDocumentation()); - expect(examples.length).toBeGreaterThan(0); + jsdomIt( + 'parses and renders every mermaid-example fence from the canonical page', + async () => { + const examples = extractMermaidExamples(readDocumentation()); + expect(examples.length).toBeGreaterThan(0); - for (const [index, source] of examples.entries()) { - const id = `usecase-doc-example-${index}`; - try { - const { svg } = await mermaidAPI.render(id, source); - expect(svg, `documentation example ${index + 1}`).toContain(' void | Promise) { - return it(message, async (): Promise => { - const oldWindow = global.window; - const oldDocument = global.document; +export function jsdomIt( + message: string, + run: (input: JsdomItInput) => void | Promise, + timeout?: number +) { + return it( + message, + async (): Promise => { + const oldWindow = global.window; + const oldDocument = global.document; - try { - const baseHtml = ` + try { + const baseHtml = ` `; - const dom = new JSDOM(baseHtml, { - resources: 'usable', - beforeParse(_window) { - // Mocks DOM functions that require rendering, JSDOM doesn't - setOnProtectedConstant(_window.Element.prototype, 'getBBox', () => MOCKED_BBOX); - setOnProtectedConstant(_window.Element.prototype, 'getComputedTextLength', () => 200); - }, - }); - setOnProtectedConstant(global, 'window', dom.window); // Fool D3 into thinking it's in a browser - setOnProtectedConstant(global, 'document', dom.window.document); // Fool D3 into thinking it's in a browser - setOnProtectedConstant(global, 'MutationObserver', undefined); // JSDOM doesn't like cytoscape elements + const dom = new JSDOM(baseHtml, { + resources: 'usable', + beforeParse(_window) { + // Mocks DOM functions that require rendering, JSDOM doesn't + setOnProtectedConstant(_window.Element.prototype, 'getBBox', () => MOCKED_BBOX); + setOnProtectedConstant(_window.Element.prototype, 'getComputedTextLength', () => 200); + }, + }); + setOnProtectedConstant(global, 'window', dom.window); // Fool D3 into thinking it's in a browser + setOnProtectedConstant(global, 'document', dom.window.document); // Fool D3 into thinking it's in a browser + setOnProtectedConstant(global, 'MutationObserver', undefined); // JSDOM doesn't like cytoscape elements - const body = select(document.body); - const svg = select('svg'); - await run({ body, svg }); - } finally { - setOnProtectedConstant(global, 'window', oldWindow); - setOnProtectedConstant(global, 'document', oldDocument); - } - }); + const body = select(document.body); + const svg = select('svg'); + await run({ body, svg }); + } finally { + setOnProtectedConstant(global, 'window', oldWindow); + setOnProtectedConstant(global, 'document', oldDocument); + } + }, + timeout + ); } /** From e46e82293de8c66a3ea4a52d1e374bdd119ad2c1 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 14:56:48 +0200 Subject: [PATCH 06/31] style: format the rewritten lineHops imports Prettier collapses the two-symbol import onto one line; my hand-edit after moving the file into core left it expanded. Co-Authored-By: Claude Opus 5 --- .../src/rendering-util/layout-algorithms/elk/lineHops.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/lineHops.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/lineHops.ts index 1fc5a7e9f1a..c554fd94b11 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/lineHops.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/lineHops.ts @@ -1,7 +1,4 @@ -import { - applyLineJumpsToSvg, - type EdgeGeom, -} from '../../rendering-elements/lineJump.js'; +import { applyLineJumpsToSvg, type EdgeGeom } from '../../rendering-elements/lineJump.js'; import type { CommonLayoutPaintContext } from '../common/index.js'; import type { LayoutData } from '../../types.js'; /** From 55226311aaf3537a4649dd631ed4ca0f7c2a22e3 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 15:06:13 +0200 Subject: [PATCH 07/31] fix(mindmap): restore cose-bilkent as the mindmap default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mindmap defaults to `cose-bilkent`, and `mindmapDb.getData()` already decides that: when `getUserDefinedConfig().layout` is undefined it stamps `cose-bilkent` onto the config it hands the renderer. I missed that when making ELK the global default, read only the renderer, and concluded mindmap was effectively on dagre. The override I added then forced dagre unconditionally, so mindmaps silently changed layout engine. Reverting `mindmapRenderer.ts` to its original form restores the correct behaviour and needs nothing new: the db's existing check is unaffected by the global default changing, because an unset `layout` is still unset. Also drops `isConfigKeySet`. It was added solely for that override and duplicated the `getUserDefinedConfig()` idiom `mindmapDb` was already using, so it is now unused public API. Replaces the spec that codified the wrong behaviour with one that guards the right one — mindmap resolves to `cose-bilkent` while the global default is `elk`, and still honours an explicit layout. Co-Authored-By: Claude Opus 5 --- docs/config/setup/config/README.md | 1 - .../setup/config/functions/isConfigKeySet.md | 38 ------------------- packages/mermaid/src/config.spec.ts | 38 ------------------- packages/mermaid/src/config.ts | 16 -------- .../diagrams/mindmap/mindmapLayout.spec.ts | 37 ++++++++++++++++++ .../diagrams/mindmap/mindmapRenderer.spec.ts | 33 ---------------- .../src/diagrams/mindmap/mindmapRenderer.ts | 16 ++------ 7 files changed, 41 insertions(+), 138 deletions(-) delete mode 100644 docs/config/setup/config/functions/isConfigKeySet.md create mode 100644 packages/mermaid/src/diagrams/mindmap/mindmapLayout.spec.ts delete mode 100644 packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts diff --git a/docs/config/setup/config/README.md b/docs/config/setup/config/README.md index 31450c74188..e84f71a9e8c 100644 --- a/docs/config/setup/config/README.md +++ b/docs/config/setup/config/README.md @@ -22,7 +22,6 @@ - [getEffectiveHtmlLabels](functions/getEffectiveHtmlLabels.md) - [getSiteConfig](functions/getSiteConfig.md) - [getUserDefinedConfig](functions/getUserDefinedConfig.md) -- [isConfigKeySet](functions/isConfigKeySet.md) - [reset](functions/reset.md) - [sanitize](functions/sanitize.md) - [saveConfigFromInitialize](functions/saveConfigFromInitialize.md) diff --git a/docs/config/setup/config/functions/isConfigKeySet.md b/docs/config/setup/config/functions/isConfigKeySet.md deleted file mode 100644 index 233e679858e..00000000000 --- a/docs/config/setup/config/functions/isConfigKeySet.md +++ /dev/null @@ -1,38 +0,0 @@ -> **Warning** -> -> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. -> -> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/isConfigKeySet.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/isConfigKeySet.md). - -[**mermaid**](../../README.md) - ---- - -# Function: isConfigKeySet() - -> **isConfigKeySet**(`key`): `boolean` - -Defined in: [packages/mermaid/src/config.ts:254](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L254) - -Whether a top-level config key was explicitly supplied by the embedder or by -the diagram, rather than inherited from [defaultConfig](../variables/defaultConfig.md). - -The merged config cannot answer this on its own, because a value the user set -is indistinguishable from a default that happens to match it. Diagrams that -keep a default of their own while still honouring an explicit request need -that distinction. - -## Parameters - -### key - -keyof [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) - -The top-level config key to check. - -## Returns - -`boolean` - -`true` when the key came from `initialize`, a frontmatter config -block, or a directive. diff --git a/packages/mermaid/src/config.spec.ts b/packages/mermaid/src/config.spec.ts index b3b62b875bf..83311811164 100644 --- a/packages/mermaid/src/config.spec.ts +++ b/packages/mermaid/src/config.spec.ts @@ -367,41 +367,3 @@ describe('getEffectiveHtmlLabels', () => { expect(configApi.getEffectiveHtmlLabels(config)).toBe(true); }); }); - -describe('isConfigKeySet', () => { - beforeEach(() => { - configApi.reset(); - configApi.setSiteConfig({}); - // `configFromInitialize` deliberately survives `reset`, so clear it too or - // config left behind by earlier tests in this file leaks in. - configApi.saveConfigFromInitialize({}); - }); - - it('reports a key that only has a default as not set', () => { - // `layout` always has a value from defaultConfig, which is exactly why the - // merged config cannot be used to answer this. - expect(configApi.getConfig().layout).toBeDefined(); - expect(configApi.isConfigKeySet('layout')).toBe(false); - }); - - it('reports a key supplied by a directive as set', () => { - configApi.addDirective({ layout: 'dagre' }); - expect(configApi.isConfigKeySet('layout')).toBe(true); - }); - - it('reports a key set to the same value as the default as set', () => { - configApi.addDirective({ layout: configApi.defaultConfig.layout }); - expect(configApi.isConfigKeySet('layout')).toBe(true); - }); - - it('forgets directive-supplied keys after a reset', () => { - configApi.addDirective({ layout: 'dagre' }); - configApi.reset(); - expect(configApi.isConfigKeySet('layout')).toBe(false); - }); - - it('does not leak between keys', () => { - configApi.addDirective({ layout: 'dagre' }); - expect(configApi.isConfigKeySet('theme')).toBe(false); - }); -}); diff --git a/packages/mermaid/src/config.ts b/packages/mermaid/src/config.ts index 80b7f0f36dd..67b771a08a0 100644 --- a/packages/mermaid/src/config.ts +++ b/packages/mermaid/src/config.ts @@ -238,22 +238,6 @@ export const getUserDefinedConfig = (): MermaidConfig => { return userConfig; }; -/** - * Whether a top-level config key was explicitly supplied by the embedder or by - * the diagram, rather than inherited from {@link defaultConfig}. - * - * The merged config cannot answer this on its own, because a value the user set - * is indistinguishable from a default that happens to match it. Diagrams that - * keep a default of their own while still honouring an explicit request need - * that distinction. - * - * @param key - The top-level config key to check. - * @returns `true` when the key came from `initialize`, a frontmatter config - * block, or a directive. - */ -export const isConfigKeySet = (key: keyof MermaidConfig): boolean => - getUserDefinedConfig()[key] !== undefined; - /** * Helper function to handle deprecated flowchart.htmlLabels * @param config - The configuration object (merged config with defaults) diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapLayout.spec.ts b/packages/mermaid/src/diagrams/mindmap/mindmapLayout.spec.ts new file mode 100644 index 00000000000..094ddc33a4a --- /dev/null +++ b/packages/mermaid/src/diagrams/mindmap/mindmapLayout.spec.ts @@ -0,0 +1,37 @@ +import { describe, expect, it, beforeEach } from 'vitest'; +import * as configApi from '../../config.js'; +import { MindmapDB } from './mindmapDb.js'; + +/** + * Mindmap picks `cose-bilkent` for itself when the user has not asked for a + * layout, which `mindmapDb.getData()` decides. ELK is now the global default, + * so without these the diagram would quietly start laying out with ELK. + */ +describe('mindmap layout selection', () => { + beforeEach(() => { + configApi.reset(); + configApi.setSiteConfig({}); + configApi.saveConfigFromInitialize({}); + }); + + const resolvedLayout = () => { + const db = new MindmapDB(); + db.getMindmap = () => null; + return db.getData().config.layout; + }; + + it('uses cose-bilkent when no layout was requested, despite the elk default', () => { + expect(configApi.getConfig().layout).toBe('elk'); + expect(resolvedLayout()).toBe('cose-bilkent'); + }); + + it('honours a layout the diagram explicitly asks for', () => { + configApi.addDirective({ layout: 'elk' }); + expect(resolvedLayout()).toBe('elk'); + }); + + it('honours an explicit dagre', () => { + configApi.addDirective({ layout: 'dagre' }); + expect(resolvedLayout()).toBe('dagre'); + }); +}); diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts deleted file mode 100644 index 85eebb81bfe..00000000000 --- a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, expect, it, vi, beforeEach } from 'vitest'; -import * as configApi from '../../config.js'; -import { resolveMindmapLayout } from './mindmapRenderer.js'; - -describe('mindmap layout selection', () => { - beforeEach(() => { - configApi.reset(); - configApi.setSiteConfig({}); - configApi.saveConfigFromInitialize({}); - }); - - it('uses dagre when no layout was requested, despite the elk default', () => { - const config = configApi.getConfig(); - expect(config.layout).toBe('elk'); - expect(resolveMindmapLayout(config.layout)).toBe('dagre'); - }); - - it('uses elk when the diagram explicitly asks for it', () => { - configApi.addDirective({ layout: 'elk' }); - expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('elk'); - }); - - it('uses cose-bilkent when the diagram explicitly asks for it', () => { - configApi.addDirective({ layout: 'cose-bilkent' }); - expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('cose-bilkent'); - }); - - it('falls back to cose-bilkent for an explicit but unregistered layout', () => { - vi.spyOn(console, 'warn').mockImplementation(() => undefined); - configApi.addDirective({ layout: 'not-a-real-layout' }); - expect(resolveMindmapLayout(configApi.getConfig().layout)).toBe('cose-bilkent'); - }); -}); diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts index 3d8139d8443..0f8e52e1e0f 100644 --- a/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts +++ b/packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts @@ -7,7 +7,7 @@ import type { LayoutData } from '../../rendering-util/types.js'; import type { FilledMindMapNode } from './mindmapTypes.js'; import defaultConfig from '../../defaultConfig.js'; import type { MindmapDB } from './mindmapDb.js'; -import { getConfig, isConfigKeySet } from '../../config.js'; +import { getConfig } from '../../config.js'; /** * Update the layout data with actual node dimensions after drawing @@ -30,16 +30,6 @@ function _updateNodeDimensions(data4Layout: LayoutData, mindmapRoot: FilledMindM updateNode(mindmapRoot); } -/** - * Mindmap has not been migrated to ELK, so it keeps laying out with dagre even - * though the global `layout` default is now `elk`. A layout the diagram or the - * embedder explicitly asked for is still honoured. - */ -export const resolveMindmapLayout = (layout: string | undefined) => - getRegisteredLayoutAlgorithm(isConfigKeySet('layout') ? layout : 'dagre', { - fallback: 'cose-bilkent', - }); - export const draw: DrawDefinition = async (text, id, _version, diagObj) => { log.debug('Rendering mindmap diagram\n' + text); @@ -54,7 +44,9 @@ export const draw: DrawDefinition = async (text, id, _version, diagObj) => { const svg = getDiagramElement(id, data4Layout.config.securityLevel); data4Layout.type = diagObj.type; - data4Layout.layoutAlgorithm = resolveMindmapLayout(data4Layout.config.layout); + data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(data4Layout.config.layout, { + fallback: 'cose-bilkent', + }); data4Layout.diagramId = id; From afe237d5f57d78347620034c4a3da52ea54cd8cc Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:13:35 +0000 Subject: [PATCH 08/31] [autofix.ci] apply automated fixes --- docs/config/setup/config/functions/getEffectiveHtmlLabels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md index 02121955aaf..eb1534ae7a9 100644 --- a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md +++ b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md @@ -12,7 +12,7 @@ > **getEffectiveHtmlLabels**(`config`): `boolean` -Defined in: [packages/mermaid/src/config.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L262) +Defined in: [packages/mermaid/src/config.ts:246](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L246) Helper function to handle deprecated flowchart.htmlLabels From 6b6d4370d172b8939c7f88727c7541287e302651 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Fri, 28 Aug 2026 15:52:33 +0200 Subject: [PATCH 09/31] fix(elk): repair config sync and state notes broken by ELK becoming default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two failures from the e2e run, both real. **arrowMarkerAbsolute ignored under ELK.** The e2e viewer registered the standalone `@mermaid-js/layout-elk` bundle, which overrides mermaid's own registration with a second, self-contained copy whose config module never sees `initialize()` — so edges painted with schema defaults. That is exactly what `syncElkPackageConfig` existed for; I removed it believing `setConfig(getConfig())` was an identity round-trip. It is not: the local `setConfig` and the host's `getConfig` are different module instances in the plugin build, so it copies host config into the plugin's copy. Restored as `syncHostConfig`, using a relative `setConfig` rather than the package's default export, so it repairs the plugin build and is a genuine no-op in core. The e2e viewer no longer registers the package either, so the suite exercises the ELK users actually get instead of the plugin build. **State diagrams with notes failed to render.** `note right of ` produced a note node carrying `type`/`isGroup` inherited from the state it annotates, marking the note as a container. The shared paint path then looked up a `note` *cluster* shape, which does not exist, and threw `shapes[shape] is not a function`, blanking the whole diagram. A note is always a leaf inside the note group, so it is now `isGroup: false`. Pre-existing: dagre only reads `isGroup` for edge hints, so it rendered regardless. It surfaces now that state defaults to ELK, and would already reproduce on `layout: elk`. Covered by a unit test that fails without the fix. Co-Authored-By: Claude Opus 5 --- e2e/platform/viewer.js | 6 ++- .../mermaid/src/diagrams/state/dataFetcher.ts | 10 ++++- .../src/diagrams/state/stateNoteNode.spec.js | 45 +++++++++++++++++++ .../layout-algorithms/elk/render.ts | 17 +++++++ 4 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 packages/mermaid/src/diagrams/state/stateNoteNode.spec.js diff --git a/e2e/platform/viewer.js b/e2e/platform/viewer.js index 5910fdb49d8..341a8f90f95 100644 --- a/e2e/platform/viewer.js +++ b/e2e/platform/viewer.js @@ -1,5 +1,4 @@ import externalExample from './mermaid-example-diagram.esm.mjs'; -import layouts from './mermaid-layout-elk.esm.mjs'; import tidyTree from './mermaid-layout-tidy-tree.esm.mjs'; import zenUml from './mermaid-zenuml.esm.mjs'; import mermaid from './mermaid.esm.mjs'; @@ -90,7 +89,10 @@ const contentLoaded = async function () { await mermaid.registerExternalDiagrams([externalExample, zenUml]); - mermaid.registerLayoutLoaders(layouts); + // ELK is bundled with mermaid and registered automatically. Registering the + // standalone package here would override that with a second, self-contained + // copy, so the suite would be exercising the plugin build rather than the + // layout users actually get. mermaid.registerLayoutLoaders(tidyTree); mermaid.initialize(graphObj.mermaid); /** diff --git a/packages/mermaid/src/diagrams/state/dataFetcher.ts b/packages/mermaid/src/diagrams/state/dataFetcher.ts index 76212656207..7e6cfa50a6c 100644 --- a/packages/mermaid/src/diagrams/state/dataFetcher.ts +++ b/packages/mermaid/src/diagrams/state/dataFetcher.ts @@ -320,8 +320,14 @@ export const dataFetcher = ( cssCompiledStyles: [], id: itemId + NOTE_ID + '-' + graphItemCount, domId: stateDomId(itemId, graphItemCount, NOTE), - type: newNode.type, - isGroup: newNode.type === 'group', + // A note is a leaf: it is placed inside the note group below, alongside + // the state it annotates. Inheriting `type`/`isGroup` from that state + // marked the note as a container when annotating a composite state, + // and the renderer then looked for a `note` *cluster* shape, which does + // not exist. dagre only reads `isGroup` for edge hints so it survived; + // the shared paint path uses it to decide cluster-ness and threw. + type: 'node', + isGroup: false, padding: config.flowchart?.padding, look, position: parsedItem.note.position, diff --git a/packages/mermaid/src/diagrams/state/stateNoteNode.spec.js b/packages/mermaid/src/diagrams/state/stateNoteNode.spec.js new file mode 100644 index 00000000000..98c9b861752 --- /dev/null +++ b/packages/mermaid/src/diagrams/state/stateNoteNode.spec.js @@ -0,0 +1,45 @@ +import stateDiagram, { parser } from './parser/stateDiagram.jison'; +import { StateDB } from './stateDb.js'; + +/** + * A note is a leaf placed inside a note group, never a container. It used to + * inherit `type`/`isGroup` from the state it annotates, so annotating a + * composite state marked the note as a group. The shared paint path then looked + * for a `note` *cluster* shape, which does not exist, and the whole diagram + * failed to render. dagre only reads `isGroup` for edge hints, so this stayed + * hidden until ELK became the default for state diagrams. + */ +describe('state diagram note nodes', function () { + const src = ` + stateDiagram-v2 + state Composite { + A --> B + } + note right of Composite : hello + `; + + /** @type {StateDB} */ + let stateDb; + let nodes; + + beforeEach(function () { + stateDb = new StateDB(2); + parser.yy = stateDb; + stateDiagram.parser.yy = stateDb; + stateDiagram.parser.yy.clear(); + parser.parse(src); + nodes = stateDb.getData().nodes; + }); + + it('does not mark a note on a composite state as a group', function () { + const note = nodes.find((n) => n.shape === 'note'); + expect(note, 'a note node should be produced').toBeDefined(); + expect(note.isGroup).toBe(false); + }); + + it('still produces the note group that contains the note', function () { + const noteGroup = nodes.find((n) => n.shape === 'noteGroup'); + expect(noteGroup, 'a noteGroup should still wrap the note').toBeDefined(); + expect(noteGroup.isGroup).toBe(true); + }); +}); diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 748cf88709a..221eacdf7b8 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -4,6 +4,7 @@ import { type CommonLayoutRenderContext, } from '../common/index.js'; import type { LayoutData } from '../../types.js'; +import { setConfig } from '../../../diagram-api/diagramAPI.js'; // @ts-ignore TODO: Investigate D3 issue import { curveLinear } from 'd3'; import ELK from 'elkjs/lib/elk.bundled.js'; @@ -604,6 +605,7 @@ export function prepareLayoutForElk( context: CommonLayoutRenderContext ): ElkPreparedLayout { const elkContext = getElkLayoutContext(context); + syncHostConfig(elkContext); applyElkEdgeRenderData(data4Layout, elkContext); return { algorithm: elkContext.algorithm }; } @@ -665,6 +667,21 @@ export const render = createCommonLayoutRenderer [node.id, node])); From f229f99164f26b867d99fd88ca86d620515fbefe Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 28 Aug 2026 15:56:01 +0200 Subject: [PATCH 10/31] test(elk): pin the host config sync so it cannot be dropped again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `syncHostConfig` looks like a no-op from inside mermaid — the host's config module and the layout's are the same module there, so removing the call changes nothing that any existing test observes. It only matters in the standalone `@mermaid-js/layout-elk` bundle, which carries its own copy of the config module that never sees the host's `initialize()`. That asymmetry is why the call was removed in the first place when ELK moved into mermaid. The spec asserts the CALL rather than the resulting config value, because a value assertion would pass either way in-process and would give false confidence. Both cases fail if the call is removed: that the host's config is handed over, and that it happens before the layout data is read, since `measureLayoutFn` builds the labels after `prepareLayout` returns. --- .../elk/__tests__/hostConfigSync.spec.ts | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts new file mode 100644 index 00000000000..a6eeaa7e6ac --- /dev/null +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts @@ -0,0 +1,75 @@ +import { describe, expect, it, vi, beforeEach } from 'vitest'; +import type * as DiagramApi from '../../../../diagram-api/diagramAPI.js'; + +// Mocked so the assertion is about the CALL, not the resulting value. Compiled +// into mermaid, the host's config module and this one are the same module, so a +// value-level assertion would pass whether or not the sync runs — the whole +// point of `syncHostConfig` is the standalone `@mermaid-js/layout-elk` bundle, +// where they are two copies, and that duplication cannot be reproduced +// in-process. Asserting the call is what actually pins the behaviour. +const setConfigMock = vi.hoisted(() => vi.fn()); +vi.mock('../../../../diagram-api/diagramAPI.js', async (importOriginal) => ({ + ...(await importOriginal()), + setConfig: setConfigMock, +})); + +const { prepareLayoutForElk } = await import('../render.js'); + +const log = { + debug: () => undefined, + error: () => undefined, + info: () => undefined, + warn: () => undefined, +}; + +const HOST_CONFIG = { + htmlLabels: false, + securityLevel: 'sandbox', + arrowMarkerAbsolute: true, + flowchart: { wrappingWidth: 200 }, + curve: undefined, +}; + +const contextWithHostConfig = { + helpers: { + common: { lineBreakRegex: //gi }, + getConfig: () => HOST_CONFIG, + interpolateToCurve: (curve: unknown) => curve, + log, + }, + options: { algorithm: 'elk.layered' }, +} as any; + +describe('prepareLayoutForElk host config sync', () => { + beforeEach(() => { + setConfigMock.mockReset(); + }); + + it("pushes the host's config into this bundle's config module", () => { + // Without this, the plugin bundle reads schema defaults: a host setting + // `htmlLabels: false` as hardening still gets HTML labels, and markers are + // painted without `arrowMarkerAbsolute`. + prepareLayoutForElk({ nodes: [], edges: [] } as any, contextWithHostConfig); + + expect(setConfigMock).toHaveBeenCalledWith(HOST_CONFIG); + }); + + it('syncs before the layout data is read, not after', () => { + // Labels are built by `measureLayoutFn` after `prepareLayout` returns, so a + // sync that ran later would be too late to affect how they are measured. + const order: string[] = []; + setConfigMock.mockImplementation(() => order.push('setConfig')); + const data = { + nodes: [], + edges: [], + get markers() { + order.push('data-read'); + return []; + }, + } as any; + + prepareLayoutForElk(data, contextWithHostConfig); + + expect(order[0]).toBe('setConfig'); + }); +}); From 352cec9c15b3a83913d1b1b98f9f6029640b8f41 Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Mon, 31 Aug 2026 11:14:51 +0200 Subject: [PATCH 11/31] Replaced elk layout to dagre layout --- .../dagre-0-should-render-a-simple-class-diagram.mmd} | 2 +- ...should-render-a-simple-class-diagram-without-htmllabels.mmd} | 2 +- .../dagre-1-should-render-a-simple-class-diagram.mmd} | 2 +- ...d-render-a-simple-class-diagram-with-clickable-callback.mmd} | 2 +- ...s-diagram-with-return-type-on-method-without-htmllabels.mmd} | 2 +- ...ender-a-simple-class-diagram-with-return-type-on-method.mmd} | 2 +- ...ple-class-diagram-with-generic-types-without-htmllabels.mmd} | 2 +- ...should-render-a-simple-class-diagram-with-generic-types.mmd} | 2 +- ...-render-a-simple-class-diagram-with-css-classes-applied.mmd} | 2 +- ...-simple-class-diagram-with-css-classes-applied-directly.mmd} | 2 +- .../dagre-1433-should-render-a-simple-class-with-a-title.mmd} | 2 +- ...s-diagram-with-css-classes-applied-two-multiple-classes.mmd} | 2 +- ...-should-render-a-simple-class-diagram-with-static-field.mmd} | 2 +- ...dagre-16b-should-handle-the-direction-statement-with-tb.mmd} | 2 +- ...dagre-17a-should-handle-the-direction-statement-with-bt.mmd} | 2 +- ...dagre-17b-should-handle-the-direction-statement-with-rl.mmd} | 2 +- ...dagre-18a-should-handle-the-direction-statement-with-lr.mmd} | 2 +- ...gre-18b-should-render-a-simple-class-diagram-with-notes.mmd} | 2 +- ...mple-class-diagrams-with-cardinality-without-htmllabels.mmd} | 2 +- ...nder-a-simple-class-diagram-with-different-visibilities.mmd} | 2 +- ...-diagram-with-different-visibilities-without-htmllabels.mmd} | 2 +- ...-should-render-a-simple-class-diagrams-with-cardinality.mmd} | 2 +- ...re-4-should-render-a-simple-class-diagram-with-comments.mmd} | 2 +- ...e-class-diagram-with-abstract-method-without-htmllabels.mmd} | 2 +- ...ould-render-a-simple-class-diagram-with-abstract-method.mmd} | 2 +- ...ple-class-diagram-with-static-method-without-htmllabels.mmd} | 2 +- ...should-render-a-simple-class-diagram-with-static-method.mmd} | 2 +- ...ple-class-diagram-with-generic-class-without-htmllabels.mmd} | 2 +- ...should-render-a-simple-class-diagram-with-generic-class.mmd} | 2 +- ...a-simple-class-diagram-with-generic-class-and-relations.mmd} | 2 +- ...hould-render-a-simple-class-diagram-with-clickable-link.mmd} | 2 +- .../dagre-should-add-classes-namespaces.mmd} | 2 +- ...render-a-class-with-a-text-label-members-and-annotation.mmd} | 2 +- .../dagre-should-render-a-class-with-text-label.mmd} | 2 +- .../dagre-should-render-a-full-class-diagram-using-elk.mmd} | 2 +- .../dagre-should-render-a-namespace-with-a-custom-label.mmd} | 2 +- ...hould-render-a-simple-class-diagram-with-a-custom-theme.mmd} | 2 +- ...render-a-simple-class-diagram-with-classdef-definitions.mmd} | 2 +- ...diagram-with-classdefs-being-applied-without-htmllabels.mmd} | 2 +- ...der-a-simple-class-diagram-with-classdefs-being-applied.mmd} | 2 +- ...-class-diagram-with-markdown-styling-without-htmllabels.mmd} | 2 +- ...uld-render-a-simple-class-diagram-with-markdown-styling.mmd} | 2 +- ...-a-simple-class-diagram-with-no-attributes-only-methods.mmd} | 2 +- ...agram-with-no-members-if-hideemptymembersbox-is-enabled.mmd} | 2 +- ...re-should-render-a-simple-class-diagram-with-no-members.mmd} | 2 +- ...-a-simple-class-diagram-with-no-methods-only-attributes.mmd} | 2 +- ...-class-diagram-with-style-definition-without-htmllabels.mmd} | 2 +- ...uld-render-a-simple-class-diagram-with-style-definition.mmd} | 2 +- .../dagre-should-render-classes-with-different-text-labels.mmd} | 2 +- ...er-classlabel-if-class-has-already-been-defined-earlier.mmd} | 2 +- ...d-render-compact-mode-with-hierarchicalnamespaces-false.mmd} | 0 ...re-should-render-multiple-classes-with-same-text-labels.mmd} | 2 +- ...dagre-should-render-nested-namespaces-with-dot-notation.mmd} | 2 +- .../dagre-should-render-syntactically-nested-namespaces.mmd} | 2 +- .../dagre-should-render-two-classes-with-text-labels.mmd} | 2 +- ...uld-render-a-full-class-diagram-with-the-handdrawn-look.mmd} | 2 +- ...lass-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd} | 2 +- ...m-with-styles-and-the-handdrawn-look-without-htmllabels.mmd} | 2 +- ...simple-class-diagram-with-styles-and-the-handdrawn-look.mmd} | 2 +- ...d-render-a-simple-class-diagram-with-the-handdrawn-look.mmd} | 2 +- 60 files changed, 59 insertions(+), 59 deletions(-) rename e2e/diagrams/class-diagram/{elk/elk-0-should-render-a-simple-class-diagram.mmd => dagre/dagre-0-should-render-a-simple-class-diagram.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/elk-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd => dagre/dagre-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd} (97%) rename e2e/diagrams/class-diagram/{elk/elk-1-should-render-a-simple-class-diagram.mmd => dagre/dagre-1-should-render-a-simple-class-diagram.mmd} (97%) rename e2e/diagrams/class-diagram/{elk/elk-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd => dagre/dagre-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd => dagre/dagre-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd} (89%) rename e2e/diagrams/class-diagram/{elk/elk-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd => dagre/dagre-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd} (89%) rename e2e/diagrams/class-diagram/{elk/elk-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd => dagre/dagre-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/elk-12-should-render-a-simple-class-diagram-with-generic-types.mmd => dagre/dagre-12-should-render-a-simple-class-diagram-with-generic-types.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/elk-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd => dagre/dagre-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd => dagre/dagre-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/elk-1433-should-render-a-simple-class-with-a-title.mmd => dagre/dagre-1433-should-render-a-simple-class-with-a-title.mmd} (82%) rename e2e/diagrams/class-diagram/{elk/elk-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd => dagre/dagre-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd} (89%) rename e2e/diagrams/class-diagram/{elk/elk-16a-should-render-a-simple-class-diagram-with-static-field.mmd => dagre/dagre-16a-should-render-a-simple-class-diagram-with-static-field.mmd} (85%) rename e2e/diagrams/class-diagram/{elk/elk-16b-should-handle-the-direction-statement-with-tb.mmd => dagre/dagre-16b-should-handle-the-direction-statement-with-tb.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-17a-should-handle-the-direction-statement-with-bt.mmd => dagre/dagre-17a-should-handle-the-direction-statement-with-bt.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-17b-should-handle-the-direction-statement-with-rl.mmd => dagre/dagre-17b-should-handle-the-direction-statement-with-rl.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-18a-should-handle-the-direction-statement-with-lr.mmd => dagre/dagre-18a-should-handle-the-direction-statement-with-lr.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-18b-should-render-a-simple-class-diagram-with-notes.mmd => dagre/dagre-18b-should-render-a-simple-class-diagram-with-notes.mmd} (93%) rename e2e/diagrams/class-diagram/{elk/elk-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd => dagre/dagre-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd} (97%) rename e2e/diagrams/class-diagram/{elk/elk-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd => dagre/dagre-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd => dagre/dagre-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-2-should-render-a-simple-class-diagrams-with-cardinality.mmd => dagre/dagre-2-should-render-a-simple-class-diagrams-with-cardinality.mmd} (97%) rename e2e/diagrams/class-diagram/{elk/elk-4-should-render-a-simple-class-diagram-with-comments.mmd => dagre/dagre-4-should-render-a-simple-class-diagram-with-comments.mmd} (96%) rename e2e/diagrams/class-diagram/{elk/elk-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd => dagre/dagre-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-5-should-render-a-simple-class-diagram-with-abstract-method.mmd => dagre/dagre-5-should-render-a-simple-class-diagram-with-abstract-method.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd => dagre/dagre-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-6-should-render-a-simple-class-diagram-with-static-method.mmd => dagre/dagre-6-should-render-a-simple-class-diagram-with-static-method.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd => dagre/dagre-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-7-should-render-a-simple-class-diagram-with-generic-class.mmd => dagre/dagre-7-should-render-a-simple-class-diagram-with-generic-class.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd => dagre/dagre-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd} (94%) rename e2e/diagrams/class-diagram/{elk/elk-9-should-render-a-simple-class-diagram-with-clickable-link.mmd => dagre/dagre-9-should-render-a-simple-class-diagram-with-clickable-link.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-should-add-classes-namespaces.mmd => dagre/dagre-should-add-classes-namespaces.mmd} (90%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-class-with-a-text-label-members-and-annotation.mmd => dagre/dagre-should-render-a-class-with-a-text-label-members-and-annotation.mmd} (90%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-class-with-text-label.mmd => dagre/dagre-should-render-a-class-with-text-label.mmd} (87%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-full-class-diagram-using-elk.mmd => dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd} (98%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-namespace-with-a-custom-label.mmd => dagre/dagre-should-render-a-namespace-with-a-custom-label.mmd} (93%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-a-custom-theme.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-a-custom-theme.mmd} (98%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-classdef-definitions.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-classdef-definitions.mmd} (90%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-markdown-styling.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd} (86%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-no-members.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-no-members.mmd} (82%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd} (89%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-a-simple-class-diagram-with-style-definition.mmd => dagre/dagre-should-render-a-simple-class-diagram-with-style-definition.mmd} (89%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-classes-with-different-text-labels.mmd => dagre/dagre-should-render-classes-with-different-text-labels.mmd} (96%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd => dagre/dagre-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd} (88%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd => dagre/dagre-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd} (100%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-multiple-classes-with-same-text-labels.mmd => dagre/dagre-should-render-multiple-classes-with-same-text-labels.mmd} (92%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-nested-namespaces-with-dot-notation.mmd => dagre/dagre-should-render-nested-namespaces-with-dot-notation.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-syntactically-nested-namespaces.mmd => dagre/dagre-should-render-syntactically-nested-namespaces.mmd} (95%) rename e2e/diagrams/class-diagram/{elk/elk-should-render-two-classes-with-text-labels.mmd => dagre/dagre-should-render-two-classes-with-text-labels.mmd} (90%) rename e2e/diagrams/class-diagram/{elk/handdrawn/elk-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd => dagre/handdrawn/dagre-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd} (98%) rename e2e/diagrams/class-diagram/{elk/handdrawn/elk-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd => dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd} (98%) rename e2e/diagrams/class-diagram/{elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd => dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd => dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd} (91%) rename e2e/diagrams/class-diagram/{elk/handdrawn/elk-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd => dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd} (85%) diff --git a/e2e/diagrams/class-diagram/elk/elk-0-should-render-a-simple-class-diagram.mmd b/e2e/diagrams/class-diagram/dagre/dagre-0-should-render-a-simple-class-diagram.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/elk-0-should-render-a-simple-class-diagram.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-0-should-render-a-simple-class-diagram.mmd index ea95c4bbf14..bf917afb2a2 100644 --- a/e2e/diagrams/class-diagram/elk/elk-0-should-render-a-simple-class-diagram.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-0-should-render-a-simple-class-diagram.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram diff --git a/e2e/diagrams/class-diagram/elk/elk-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd similarity index 97% rename from e2e/diagrams/class-diagram/elk/elk-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd index db696d6d6d0..f64ad064431 100644 --- a/e2e/diagrams/class-diagram/elk/elk-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-1-1-should-render-a-simple-class-diagram-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-1-should-render-a-simple-class-diagram.mmd b/e2e/diagrams/class-diagram/dagre/dagre-1-should-render-a-simple-class-diagram.mmd similarity index 97% rename from e2e/diagrams/class-diagram/elk/elk-1-should-render-a-simple-class-diagram.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-1-should-render-a-simple-class-diagram.mmd index fbab0f2ccf6..54fecbbdb5c 100644 --- a/e2e/diagrams/class-diagram/elk/elk-1-should-render-a-simple-class-diagram.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-1-should-render-a-simple-class-diagram.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd b/e2e/diagrams/class-diagram/dagre/dagre-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd index ceefb9c94ab..bbd8b0120b0 100644 --- a/e2e/diagrams/class-diagram/elk/elk-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-10-should-render-a-simple-class-diagram-with-clickable-callback.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01~T~ <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd similarity index 89% rename from e2e/diagrams/class-diagram/elk/elk-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd index a6455ef72bd..2df95af731d 100644 --- a/e2e/diagrams/class-diagram/elk/elk-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-11-1-should-render-a-simple-class-diagram-with-return-type-on-method-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class10~T~ { diff --git a/e2e/diagrams/class-diagram/elk/elk-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd b/e2e/diagrams/class-diagram/dagre/dagre-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd similarity index 89% rename from e2e/diagrams/class-diagram/elk/elk-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd index 0fde2fa5dc3..88148c75892 100644 --- a/e2e/diagrams/class-diagram/elk/elk-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-11-should-render-a-simple-class-diagram-with-return-type-on-method.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10~T~ { diff --git a/e2e/diagrams/class-diagram/elk/elk-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/elk-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd index 909753af06c..7537cddb51a 100644 --- a/e2e/diagrams/class-diagram/elk/elk-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-12-1-should-render-a-simple-class-diagram-with-generic-types-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class10~T~ { diff --git a/e2e/diagrams/class-diagram/elk/elk-12-should-render-a-simple-class-diagram-with-generic-types.mmd b/e2e/diagrams/class-diagram/dagre/dagre-12-should-render-a-simple-class-diagram-with-generic-types.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/elk-12-should-render-a-simple-class-diagram-with-generic-types.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-12-should-render-a-simple-class-diagram-with-generic-types.mmd index 2cafe3335cb..482614b9eea 100644 --- a/e2e/diagrams/class-diagram/elk/elk-12-should-render-a-simple-class-diagram-with-generic-types.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-12-should-render-a-simple-class-diagram-with-generic-types.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10~T~ { diff --git a/e2e/diagrams/class-diagram/elk/elk-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd b/e2e/diagrams/class-diagram/dagre/dagre-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd index 2296d1c0331..b424d465e29 100644 --- a/e2e/diagrams/class-diagram/elk/elk-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-13-should-render-a-simple-class-diagram-with-css-classes-applied.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 { diff --git a/e2e/diagrams/class-diagram/elk/elk-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd b/e2e/diagrams/class-diagram/dagre/dagre-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/elk-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd index 6602ec38653..bd55bf307da 100644 --- a/e2e/diagrams/class-diagram/elk/elk-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-14-should-render-a-simple-class-diagram-with-css-classes-applied-directly.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10:::exClass2 { diff --git a/e2e/diagrams/class-diagram/elk/elk-1433-should-render-a-simple-class-with-a-title.mmd b/e2e/diagrams/class-diagram/dagre/dagre-1433-should-render-a-simple-class-with-a-title.mmd similarity index 82% rename from e2e/diagrams/class-diagram/elk/elk-1433-should-render-a-simple-class-with-a-title.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-1433-should-render-a-simple-class-with-a-title.mmd index 3c7586a7757..44e8dc68f65 100644 --- a/e2e/diagrams/class-diagram/elk/elk-1433-should-render-a-simple-class-with-a-title.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-1433-should-render-a-simple-class-with-a-title.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd b/e2e/diagrams/class-diagram/dagre/dagre-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd similarity index 89% rename from e2e/diagrams/class-diagram/elk/elk-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd index 6f5a3a7a55e..8295665f56c 100644 --- a/e2e/diagrams/class-diagram/elk/elk-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-15-should-render-a-simple-class-diagram-with-css-classes-applied-two-multiple-classes.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-16a-should-render-a-simple-class-diagram-with-static-field.mmd b/e2e/diagrams/class-diagram/dagre/dagre-16a-should-render-a-simple-class-diagram-with-static-field.mmd similarity index 85% rename from e2e/diagrams/class-diagram/elk/elk-16a-should-render-a-simple-class-diagram-with-static-field.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-16a-should-render-a-simple-class-diagram-with-static-field.mmd index 9c4a480c0eb..383cbfbdda4 100644 --- a/e2e/diagrams/class-diagram/elk/elk-16a-should-render-a-simple-class-diagram-with-static-field.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-16a-should-render-a-simple-class-diagram-with-static-field.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Foo { diff --git a/e2e/diagrams/class-diagram/elk/elk-16b-should-handle-the-direction-statement-with-tb.mmd b/e2e/diagrams/class-diagram/dagre/dagre-16b-should-handle-the-direction-statement-with-tb.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-16b-should-handle-the-direction-statement-with-tb.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-16b-should-handle-the-direction-statement-with-tb.mmd index b825dea991b..1d5c3fff26d 100644 --- a/e2e/diagrams/class-diagram/elk/elk-16b-should-handle-the-direction-statement-with-tb.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-16b-should-handle-the-direction-statement-with-tb.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram direction TB diff --git a/e2e/diagrams/class-diagram/elk/elk-17a-should-handle-the-direction-statement-with-bt.mmd b/e2e/diagrams/class-diagram/dagre/dagre-17a-should-handle-the-direction-statement-with-bt.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-17a-should-handle-the-direction-statement-with-bt.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-17a-should-handle-the-direction-statement-with-bt.mmd index 7ecad5069f0..2baf8933e01 100644 --- a/e2e/diagrams/class-diagram/elk/elk-17a-should-handle-the-direction-statement-with-bt.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-17a-should-handle-the-direction-statement-with-bt.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram direction BT diff --git a/e2e/diagrams/class-diagram/elk/elk-17b-should-handle-the-direction-statement-with-rl.mmd b/e2e/diagrams/class-diagram/dagre/dagre-17b-should-handle-the-direction-statement-with-rl.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-17b-should-handle-the-direction-statement-with-rl.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-17b-should-handle-the-direction-statement-with-rl.mmd index 718af934eac..97e2ea04eba 100644 --- a/e2e/diagrams/class-diagram/elk/elk-17b-should-handle-the-direction-statement-with-rl.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-17b-should-handle-the-direction-statement-with-rl.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram direction RL diff --git a/e2e/diagrams/class-diagram/elk/elk-18a-should-handle-the-direction-statement-with-lr.mmd b/e2e/diagrams/class-diagram/dagre/dagre-18a-should-handle-the-direction-statement-with-lr.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-18a-should-handle-the-direction-statement-with-lr.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-18a-should-handle-the-direction-statement-with-lr.mmd index 2caa8a01a0a..0e95249e0d0 100644 --- a/e2e/diagrams/class-diagram/elk/elk-18a-should-handle-the-direction-statement-with-lr.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-18a-should-handle-the-direction-statement-with-lr.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram direction LR diff --git a/e2e/diagrams/class-diagram/elk/elk-18b-should-render-a-simple-class-diagram-with-notes.mmd b/e2e/diagrams/class-diagram/dagre/dagre-18b-should-render-a-simple-class-diagram-with-notes.mmd similarity index 93% rename from e2e/diagrams/class-diagram/elk/elk-18b-should-render-a-simple-class-diagram-with-notes.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-18b-should-render-a-simple-class-diagram-with-notes.mmd index 565e741f6f9..b1c775bcbbd 100644 --- a/e2e/diagrams/class-diagram/elk/elk-18b-should-render-a-simple-class-diagram-with-notes.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-18b-should-render-a-simple-class-diagram-with-notes.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram note "I love this diagram! diff --git a/e2e/diagrams/class-diagram/elk/elk-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd similarity index 97% rename from e2e/diagrams/class-diagram/elk/elk-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd index 4334a3d744f..2813c3e83d0 100644 --- a/e2e/diagrams/class-diagram/elk/elk-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-2-1-should-render-a-simple-class-diagrams-with-cardinality-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram Class01 "1" <|--|> "*" AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd b/e2e/diagrams/class-diagram/dagre/dagre-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd index 2cdfcd4450e..9d8e2c8303c 100644 --- a/e2e/diagrams/class-diagram/elk/elk-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-2-2-should-render-a-simple-class-diagram-with-different-visibilities.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd index 5a96bfc40f7..e541244c3f4 100644 --- a/e2e/diagrams/class-diagram/elk/elk-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-2-3-should-render-a-simple-class-diagram-with-different-visibilities-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-2-should-render-a-simple-class-diagrams-with-cardinality.mmd b/e2e/diagrams/class-diagram/dagre/dagre-2-should-render-a-simple-class-diagrams-with-cardinality.mmd similarity index 97% rename from e2e/diagrams/class-diagram/elk/elk-2-should-render-a-simple-class-diagrams-with-cardinality.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-2-should-render-a-simple-class-diagrams-with-cardinality.mmd index 3efa4ab4bcc..1ca36368380 100644 --- a/e2e/diagrams/class-diagram/elk/elk-2-should-render-a-simple-class-diagrams-with-cardinality.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-2-should-render-a-simple-class-diagrams-with-cardinality.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01 "1" <|--|> "*" AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-4-should-render-a-simple-class-diagram-with-comments.mmd b/e2e/diagrams/class-diagram/dagre/dagre-4-should-render-a-simple-class-diagram-with-comments.mmd similarity index 96% rename from e2e/diagrams/class-diagram/elk/elk-4-should-render-a-simple-class-diagram-with-comments.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-4-should-render-a-simple-class-diagram-with-comments.mmd index df5580b7eb6..e254b103ba4 100644 --- a/e2e/diagrams/class-diagram/elk/elk-4-should-render-a-simple-class-diagram-with-comments.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-4-should-render-a-simple-class-diagram-with-comments.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram %% this is a comment diff --git a/e2e/diagrams/class-diagram/elk/elk-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd index 4ee8ed6bae5..3f122a89f8f 100644 --- a/e2e/diagrams/class-diagram/elk/elk-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-5-1-should-render-a-simple-class-diagram-with-abstract-method-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-5-should-render-a-simple-class-diagram-with-abstract-method.mmd b/e2e/diagrams/class-diagram/dagre/dagre-5-should-render-a-simple-class-diagram-with-abstract-method.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-5-should-render-a-simple-class-diagram-with-abstract-method.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-5-should-render-a-simple-class-diagram-with-abstract-method.mmd index 8b174583a09..f0e2c5c4a03 100644 --- a/e2e/diagrams/class-diagram/elk/elk-5-should-render-a-simple-class-diagram-with-abstract-method.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-5-should-render-a-simple-class-diagram-with-abstract-method.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd index 6ecee5ac672..c06c57d0b37 100644 --- a/e2e/diagrams/class-diagram/elk/elk-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-6-1-should-render-a-simple-class-diagram-with-static-method-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-6-should-render-a-simple-class-diagram-with-static-method.mmd b/e2e/diagrams/class-diagram/dagre/dagre-6-should-render-a-simple-class-diagram-with-static-method.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-6-should-render-a-simple-class-diagram-with-static-method.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-6-should-render-a-simple-class-diagram-with-static-method.mmd index 774755eb9dd..ccd325007d8 100644 --- a/e2e/diagrams/class-diagram/elk/elk-6-should-render-a-simple-class-diagram-with-static-method.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-6-should-render-a-simple-class-diagram-with-static-method.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01 <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd index b9de19a685a..8eee9858412 100644 --- a/e2e/diagrams/class-diagram/elk/elk-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-7-1-should-render-a-simple-class-diagram-with-generic-class-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class01~T~ diff --git a/e2e/diagrams/class-diagram/elk/elk-7-should-render-a-simple-class-diagram-with-generic-class.mmd b/e2e/diagrams/class-diagram/dagre/dagre-7-should-render-a-simple-class-diagram-with-generic-class.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-7-should-render-a-simple-class-diagram-with-generic-class.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-7-should-render-a-simple-class-diagram-with-generic-class.mmd index f9f0b4010a7..ee6b341f632 100644 --- a/e2e/diagrams/class-diagram/elk/elk-7-should-render-a-simple-class-diagram-with-generic-class.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-7-should-render-a-simple-class-diagram-with-generic-class.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class01~T~ diff --git a/e2e/diagrams/class-diagram/elk/elk-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd b/e2e/diagrams/class-diagram/dagre/dagre-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd similarity index 94% rename from e2e/diagrams/class-diagram/elk/elk-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd index e52f2363dc2..53833b1fc1e 100644 --- a/e2e/diagrams/class-diagram/elk/elk-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-8-should-render-a-simple-class-diagram-with-generic-class-and-relations.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01~T~ <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-9-should-render-a-simple-class-diagram-with-clickable-link.mmd b/e2e/diagrams/class-diagram/dagre/dagre-9-should-render-a-simple-class-diagram-with-clickable-link.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-9-should-render-a-simple-class-diagram-with-clickable-link.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-9-should-render-a-simple-class-diagram-with-clickable-link.mmd index eba811152d1..18f473c0070 100644 --- a/e2e/diagrams/class-diagram/elk/elk-9-should-render-a-simple-class-diagram-with-clickable-link.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-9-should-render-a-simple-class-diagram-with-clickable-link.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Class01~T~ <|-- AveryLongClass : Cool diff --git a/e2e/diagrams/class-diagram/elk/elk-should-add-classes-namespaces.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-add-classes-namespaces.mmd similarity index 90% rename from e2e/diagrams/class-diagram/elk/elk-should-add-classes-namespaces.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-add-classes-namespaces.mmd index 09fe365f54c..52dafa4bad6 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-add-classes-namespaces.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-add-classes-namespaces.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram namespace Namespace1 { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-a-text-label-members-and-annotation.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-a-text-label-members-and-annotation.mmd similarity index 90% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-a-text-label-members-and-annotation.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-a-text-label-members-and-annotation.mmd index 08c8840ef07..57197520498 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-a-text-label-members-and-annotation.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-a-text-label-members-and-annotation.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class C1["Class 1 with text label"] { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-text-label.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-text-label.mmd similarity index 87% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-text-label.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-text-label.mmd index 3246a61990a..449f9a74fde 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-class-with-text-label.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-class-with-text-label.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class C1["Class 1 with text label"] diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-full-class-diagram-using-elk.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd similarity index 98% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-full-class-diagram-using-elk.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd index 038190ce2f7..fef312710ba 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-full-class-diagram-using-elk.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram note "I love this diagram! diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-namespace-with-a-custom-label.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-namespace-with-a-custom-label.mmd similarity index 93% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-namespace-with-a-custom-label.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-namespace-with-a-custom-label.mmd index f0f7bc8b261..39819f4e737 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-namespace-with-a-custom-label.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-namespace-with-a-custom-label.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram namespace Auth["Authentication Service"] { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-a-custom-theme.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-a-custom-theme.mmd similarity index 98% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-a-custom-theme.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-a-custom-theme.mmd index c17675f652d..debee91a5a4 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-a-custom-theme.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-a-custom-theme.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- %%{ init: { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdef-definitions.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdef-definitions.mmd similarity index 90% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdef-definitions.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdef-definitions.mmd index 1f11dabfde3..7b7ea11e37e 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdef-definitions.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdef-definitions.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd index 0b459238348..f8588cd744c 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class10:::pink diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd index f90089a9802..62072b5428c 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-classdefs-being-applied.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10:::pink diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd index 5bc303b88fe..d6f153fb47f 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class10 { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling.mmd index cfe96a1178a..448e870db66 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-markdown-styling.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-markdown-styling.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd similarity index 86% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd index 6a72e6f3e11..30756627d82 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-attributes-only-methods.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Duck { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd index c54f49ae261..218c6694514 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members-if-hideemptymembersbox-is-enabled.mmd @@ -4,7 +4,7 @@ config: class: htmlLabels: true hideEmptyMembersBox: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members.mmd similarity index 82% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members.mmd index 3c7586a7757..44e8dc68f65 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-members.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-members.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd index d5f5803eedb..ff3cd401060 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-no-methods-only-attributes.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Duck { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd similarity index 89% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd index 1eef670e07f..72b20d48bd3 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition-without-htmllabels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: false - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition.mmd similarity index 89% rename from e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition.mmd index 09359c913a7..571465a59fa 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-a-simple-class-diagram-with-style-definition.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-simple-class-diagram-with-style-definition.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-classes-with-different-text-labels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-classes-with-different-text-labels.mmd similarity index 96% rename from e2e/diagrams/class-diagram/elk/elk-should-render-classes-with-different-text-labels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-classes-with-different-text-labels.mmd index d25543cf356..0da00290c40 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-classes-with-different-text-labels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-classes-with-different-text-labels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class C1["OneWord"] diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd similarity index 88% rename from e2e/diagrams/class-diagram/elk/elk-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd index 8ca9dd69c1f..559dd03ff5e 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-classlabel-if-class-has-already-been-defined-earlier.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram Animal <|-- Duck diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd similarity index 100% rename from e2e/diagrams/class-diagram/elk/elk-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-compact-mode-with-hierarchicalnamespaces-false.mmd diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-multiple-classes-with-same-text-labels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-multiple-classes-with-same-text-labels.mmd similarity index 92% rename from e2e/diagrams/class-diagram/elk/elk-should-render-multiple-classes-with-same-text-labels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-multiple-classes-with-same-text-labels.mmd index c5ab645d0d8..23aca2fff38 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-multiple-classes-with-same-text-labels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-multiple-classes-with-same-text-labels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class C1["Class with text label"] diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-nested-namespaces-with-dot-notation.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-nested-namespaces-with-dot-notation.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-should-render-nested-namespaces-with-dot-notation.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-nested-namespaces-with-dot-notation.mmd index 6f517bfe866..6174cbe2ca3 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-nested-namespaces-with-dot-notation.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-nested-namespaces-with-dot-notation.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram namespace Company.Engineering.Backend { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-syntactically-nested-namespaces.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-syntactically-nested-namespaces.mmd similarity index 95% rename from e2e/diagrams/class-diagram/elk/elk-should-render-syntactically-nested-namespaces.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-syntactically-nested-namespaces.mmd index b1c43d57eec..087a7a2e8b9 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-syntactically-nested-namespaces.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-syntactically-nested-namespaces.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram namespace Platform { diff --git a/e2e/diagrams/class-diagram/elk/elk-should-render-two-classes-with-text-labels.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-two-classes-with-text-labels.mmd similarity index 90% rename from e2e/diagrams/class-diagram/elk/elk-should-render-two-classes-with-text-labels.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-two-classes-with-text-labels.mmd index 763e97e3b91..46498ab3a93 100644 --- a/e2e/diagrams/class-diagram/elk/elk-should-render-two-classes-with-text-labels.mmd +++ b/e2e/diagrams/class-diagram/dagre/dagre-should-render-two-classes-with-text-labels.mmd @@ -2,7 +2,7 @@ config: logLevel: 1 htmlLabels: true - layout: elk + layout: dagre --- classDiagram class C1["Class 1 with text label"] diff --git a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd similarity index 98% rename from e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd rename to e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd index 5f3ff94b1e0..8e6b5c65608 100644 --- a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd +++ b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-full-class-diagram-with-the-handdrawn-look.mmd @@ -3,7 +3,7 @@ config: logLevel: 1 htmlLabels: true look: handDrawn - layout: elk + layout: dagre --- classDiagram note "I love this diagram! diff --git a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd similarity index 98% rename from e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd rename to e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd index 11eecb13af4..209e0b95d55 100644 --- a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd +++ b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-a-custom-theme-and-the-handdrawn-look.mmd @@ -3,7 +3,7 @@ config: logLevel: 1 htmlLabels: true look: handDrawn - layout: elk + layout: dagre --- %%{ init: { diff --git a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd rename to e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd index 3f8f2223314..acdf1296a7f 100644 --- a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd +++ b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look-without-htmllabels.mmd @@ -3,7 +3,7 @@ config: logLevel: 1 htmlLabels: false look: handDrawn - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd similarity index 91% rename from e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd rename to e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd index 44946e4f219..6b7796f5094 100644 --- a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd +++ b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-styles-and-the-handdrawn-look.mmd @@ -3,7 +3,7 @@ config: logLevel: 1 htmlLabels: true look: handDrawn - layout: elk + layout: dagre --- classDiagram class Class10 diff --git a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd similarity index 85% rename from e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd rename to e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd index 8e9f1df2802..fc5fc409e1e 100644 --- a/e2e/diagrams/class-diagram/elk/handdrawn/elk-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd +++ b/e2e/diagrams/class-diagram/dagre/handdrawn/dagre-should-render-a-simple-class-diagram-with-the-handdrawn-look.mmd @@ -3,7 +3,7 @@ config: logLevel: 1 htmlLabels: true look: handDrawn - layout: elk + layout: dagre --- classDiagram class Class10 From fa4ba8af4b36aa213cf3905ec5bedfab4677047b Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Mon, 31 Aug 2026 12:46:44 +0200 Subject: [PATCH 12/31] changed elk-layout to dagre-layout for flowcharts --- ...der-a-titled-flowchart-with-titletopmargin-set-to-0.mmd} | 3 ++- ...der-a-simple-flowchart-with-diagrampadding-set-to-0.mmd} | 3 ++- ...dling-of-different-rendering-direction-in-subgraphs.mmd} | 3 ++- .../2388-dagre-handling-default-in-the-node-name.mmd} | 3 ++- .../2824-dagre-clipping-of-edges.mmd} | 3 ++- ...3-dagre-a-link-with-correct-arrowhead-to-a-subgraph.mmd} | 6 +++++- .../4-dagre-length-of-edges.mmd} | 6 +++++- .../5-dagre-should-render-escaped-without-html-labels.mmd} | 3 ++- .../50-dagre-handle-nested-subgraphs-in-reverse-order.mmd} | 3 ++- .../51-dagre-handle-nested-subgraphs-in-reverse-order.mmd} | 3 ++- .../52-dagre-handle-nested-subgraphs-in-several-levels.mmd} | 3 ++- ...dagre-handle-nested-subgraphs-with-edges-in-and-out.mmd} | 3 ++- ...4-dagre-handle-nested-subgraphs-with-outgoing-links.mmd} | 3 ++- ...dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd} | 3 ++- ...dagre-handle-nested-subgraphs-with-outgoing-links-3.mmd} | 3 ++- ...dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd} | 3 ++- ...dagre-handle-nested-subgraphs-with-outgoing-links-4.mmd} | 3 ++- .../57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd | 3 ++- .../58-dagre-handle-styling-with-style-expressions.mmd} | 3 ++- .../59-dagre-handle-styling-of-subgraphs-and-links.mmd} | 3 ++- .../6-dagre-should-render-non-escaped-with-html-labels.mmd} | 3 ++- .../60-dagre-handle-styling-for-all-node-shapes-v2.mmd} | 3 ++- .../6080-should-handle-diamond-shape-intersections.mmd | 0 .../6088-1-should-handle-diamond-shape-intersections.mmd | 0 .../6088-2-should-handle-diamond-shape-intersections.mmd | 0 .../6088-3-should-handle-diamond-shape-intersections.mmd | 0 .../6088-4-should-handle-diamond-shape-intersections.mmd | 0 .../6088-5-should-handle-diamond-shape-intersections.mmd | 0 .../6088-6-should-handle-diamond-shape-intersections.mmd | 0 .../61-dagre-fontawesome-icons-in-edge-labels.mmd} | 3 ++- .../62-dagre-should-render-styled-subgraphs.mmd} | 3 ++- .../63-dagre-title-on-subgraphs-should-be-themeable.mmd} | 3 ++- .../65-dagre-text-color-from-classes.mmd} | 3 ++- .../66-dagre-more-nested-subgraph-cases-tb.mmd} | 3 ++- ...en-using-dagre-layout-unless-it-would-add-crossings.mmd} | 0 .../67-dagre-more-nested-subgraph-cases-rl.mmd} | 3 ++- .../68-dagre-more-nested-subgraph-cases-bt.mmd} | 3 ++- .../69-dagre-more-nested-subgraph-cases-lr.mmd} | 3 ++- ...bgraph-cases-tb-link-out-and-link-between-subgraphs.mmd} | 3 ++- ...bgraph-cases-rl-link-out-and-link-between-subgraphs.mmd} | 3 ++- ...bgraph-cases-bt-link-out-and-link-between-subgraphs.mmd} | 3 ++- ...uld-render-dagre-edges-with-right-angles-not-curves.mmd} | 0 ...multiple-edges-from-and-to-the-same-couple-of-nodes.mmd} | 3 ++- ...bgraph-cases-rl-link-out-and-link-between-subgraphs.mmd} | 3 ++- ...dle-unicode-encoded-character-with-html-labels-true.mmd} | 3 ++- ...pentrynodeontop-false-keeps-the-default-layout-7827.mmd} | 0 ...-a-subgraph-with-dagre-keepentrynodeontop-true-7827.mmd} | 0 ...ow-recurses-with-dagre-keepentrynodeontop-true-7827.mmd} | 0 ...-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd} | 0 ...within-subgraphs-when-dagre-mergeedges-is-true-7659.mmd} | 0 .../new-line-in-node-and-formatted-edge-label-2.mmd | 3 ++- .../new-line-in-node-and-formatted-edge-label.mmd | 3 ++- .../{elk => dagre}/sub-graphs-and-markdown-strings-2.mmd | 3 ++- .../{elk => dagre}/sub-graphs-and-markdown-strings.mmd | 3 ++- e2e/diagrams/flowchart/{elk => dagre}/sub-graphs.mmd | 0 .../v2-dagre-16-render-stadium-shape.mmd} | 3 ++- .../{elk => dagre}/with-formatting-in-a-node-2.mmd | 3 ++- .../flowchart/{elk => dagre}/with-formatting-in-a-node.mmd | 3 ++- .../flowchart/{elk => dagre}/with-styling-and-classes-2.mmd | 3 ++- .../flowchart/{elk => dagre}/with-styling-and-classes.mmd | 3 ++- .../{elk => dagre}/wrapping-long-text-with-a-new-line-2.mmd | 3 ++- .../{elk => dagre}/wrapping-long-text-with-a-new-line.mmd | 3 ++- 62 files changed, 100 insertions(+), 47 deletions(-) rename e2e/diagrams/flowchart/{elk/1433-elk-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd => dagre/1433-dagre-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd} (67%) rename e2e/diagrams/flowchart/{elk/2-elk-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd => dagre/2-dagre-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd} (88%) rename e2e/diagrams/flowchart/{elk/2050-elk-handling-of-different-rendering-direction-in-subgraphs.mmd => dagre/2050-dagre-handling-of-different-rendering-direction-in-subgraphs.mmd} (90%) rename e2e/diagrams/flowchart/{elk/2388-elk-handling-default-in-the-node-name.mmd => dagre/2388-dagre-handling-default-in-the-node-name.mmd} (84%) rename e2e/diagrams/flowchart/{elk/2824-elk-clipping-of-edges.mmd => dagre/2824-dagre-clipping-of-edges.mmd} (80%) rename e2e/diagrams/flowchart/{elk/3-elk-a-link-with-correct-arrowhead-to-a-subgraph.mmd => dagre/3-dagre-a-link-with-correct-arrowhead-to-a-subgraph.mmd} (69%) rename e2e/diagrams/flowchart/{elk/4-elk-length-of-edges.mmd => dagre/4-dagre-length-of-edges.mmd} (76%) rename e2e/diagrams/flowchart/{elk/5-elk-should-render-escaped-without-html-labels.mmd => dagre/5-dagre-should-render-escaped-without-html-labels.mmd} (78%) rename e2e/diagrams/flowchart/{elk/50-elk-handle-nested-subgraphs-in-reverse-order.mmd => dagre/50-dagre-handle-nested-subgraphs-in-reverse-order.mmd} (83%) rename e2e/diagrams/flowchart/{elk/51-elk-handle-nested-subgraphs-in-reverse-order.mmd => dagre/51-dagre-handle-nested-subgraphs-in-reverse-order.mmd} (83%) rename e2e/diagrams/flowchart/{elk/52-elk-handle-nested-subgraphs-in-several-levels.mmd => dagre/52-dagre-handle-nested-subgraphs-in-several-levels.mmd} (86%) rename e2e/diagrams/flowchart/{elk/53-elk-handle-nested-subgraphs-with-edges-in-and-out.mmd => dagre/53-dagre-handle-nested-subgraphs-with-edges-in-and-out.mmd} (92%) rename e2e/diagrams/flowchart/{elk/54-elk-handle-nested-subgraphs-with-outgoing-links.mmd => dagre/54-dagre-handle-nested-subgraphs-with-outgoing-links.mmd} (88%) rename e2e/diagrams/flowchart/{elk/55-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd => dagre/55-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd} (91%) rename e2e/diagrams/flowchart/{elk/56-elk-handle-nested-subgraphs-with-outgoing-links-3.mmd => dagre/56-dagre-handle-nested-subgraphs-with-outgoing-links-3.mmd} (90%) rename e2e/diagrams/flowchart/{elk/57-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd => dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd} (89%) rename e2e/diagrams/flowchart/{elk/57-elk-handle-nested-subgraphs-with-outgoing-links-4.mmd => dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-4.mmd} (83%) rename e2e/diagrams/flowchart/{elk => dagre}/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd (91%) rename e2e/diagrams/flowchart/{elk/58-elk-handle-styling-with-style-expressions.mmd => dagre/58-dagre-handle-styling-with-style-expressions.mmd} (89%) rename e2e/diagrams/flowchart/{elk/59-elk-handle-styling-of-subgraphs-and-links.mmd => dagre/59-dagre-handle-styling-of-subgraphs-and-links.mmd} (93%) rename e2e/diagrams/flowchart/{elk/6-elk-should-render-non-escaped-with-html-labels.mmd => dagre/6-dagre-should-render-non-escaped-with-html-labels.mmd} (81%) rename e2e/diagrams/flowchart/{elk/60-elk-handle-styling-for-all-node-shapes-v2.mmd => dagre/60-dagre-handle-styling-for-all-node-shapes-v2.mmd} (97%) rename e2e/diagrams/flowchart/{elk => dagre}/6080-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-1-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-2-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-3-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-4-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-5-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk => dagre}/6088-6-should-handle-diamond-shape-intersections.mmd (100%) rename e2e/diagrams/flowchart/{elk/61-elk-fontawesome-icons-in-edge-labels.mmd => dagre/61-dagre-fontawesome-icons-in-edge-labels.mmd} (81%) rename e2e/diagrams/flowchart/{elk/62-elk-should-render-styled-subgraphs.mmd => dagre/62-dagre-should-render-styled-subgraphs.mmd} (93%) rename e2e/diagrams/flowchart/{elk/63-elk-title-on-subgraphs-should-be-themeable.mmd => dagre/63-dagre-title-on-subgraphs-should-be-themeable.mmd} (90%) rename e2e/diagrams/flowchart/{elk/65-elk-text-color-from-classes.mmd => dagre/65-dagre-text-color-from-classes.mmd} (87%) rename e2e/diagrams/flowchart/{elk/66-elk-more-nested-subgraph-cases-tb.mmd => dagre/66-dagre-more-nested-subgraph-cases-tb.mmd} (85%) rename e2e/diagrams/flowchart/{elk/6647-elk-should-keep-node-order-when-using-elk-layout-unless-it-would-add-crossings.mmd => dagre/6647-dagre-should-keep-node-order-when-using-dagre-layout-unless-it-would-add-crossings.mmd} (100%) rename e2e/diagrams/flowchart/{elk/67-elk-more-nested-subgraph-cases-rl.mmd => dagre/67-dagre-more-nested-subgraph-cases-rl.mmd} (85%) rename e2e/diagrams/flowchart/{elk/68-elk-more-nested-subgraph-cases-bt.mmd => dagre/68-dagre-more-nested-subgraph-cases-bt.mmd} (85%) rename e2e/diagrams/flowchart/{elk/69-elk-more-nested-subgraph-cases-lr.mmd => dagre/69-dagre-more-nested-subgraph-cases-lr.mmd} (85%) rename e2e/diagrams/flowchart/{elk/70-elk-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd => dagre/70-dagre-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd} (86%) rename e2e/diagrams/flowchart/{elk/71-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd => dagre/71-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd} (86%) rename e2e/diagrams/flowchart/{elk/72-elk-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd => dagre/72-dagre-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd} (86%) rename e2e/diagrams/flowchart/{elk/7213-should-render-elk-edges-with-right-angles-not-curves.mmd => dagre/7213-should-render-dagre-edges-with-right-angles-not-curves.mmd} (100%) rename e2e/diagrams/flowchart/{elk/74-elk-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd => dagre/74-dagre-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd} (83%) rename e2e/diagrams/flowchart/{elk/74-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd => dagre/74-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd} (86%) rename e2e/diagrams/flowchart/{elk/76-elk-handle-unicode-encoded-character-with-html-labels-true.mmd => dagre/76-dagre-handle-unicode-encoded-character-with-html-labels-true.mmd} (90%) rename e2e/diagrams/flowchart/{elk/elk-recursive-flow-with-elk-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd => dagre/dagre-recursive-flow-with-dagre-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd} (100%) rename e2e/diagrams/flowchart/{elk/elk-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-elk-keepentrynodeontop-true-7827.mmd => dagre/dagre-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-dagre-keepentrynodeontop-true-7827.mmd} (100%) rename e2e/diagrams/flowchart/{elk/elk-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-elk-keepentrynodeontop-true-7827.mmd => dagre/dagre-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-dagre-keepentrynodeontop-true-7827.mmd} (100%) rename e2e/diagrams/flowchart/{elk/elk-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd => dagre/dagre-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd} (100%) rename e2e/diagrams/flowchart/{elk/elk-should-merge-edges-within-subgraphs-when-elk-mergeedges-is-true-7659.mmd => dagre/dagre-should-merge-edges-within-subgraphs-when-dagre-mergeedges-is-true-7659.mmd} (100%) rename e2e/diagrams/flowchart/{elk => dagre}/new-line-in-node-and-formatted-edge-label-2.mmd (85%) rename e2e/diagrams/flowchart/{elk => dagre}/new-line-in-node-and-formatted-edge-label.mmd (84%) rename e2e/diagrams/flowchart/{elk => dagre}/sub-graphs-and-markdown-strings-2.mmd (91%) rename e2e/diagrams/flowchart/{elk => dagre}/sub-graphs-and-markdown-strings.mmd (91%) rename e2e/diagrams/flowchart/{elk => dagre}/sub-graphs.mmd (100%) rename e2e/diagrams/flowchart/{elk/v2-elk-16-render-stadium-shape.mmd => dagre/v2-dagre-16-render-stadium-shape.mmd} (94%) rename e2e/diagrams/flowchart/{elk => dagre}/with-formatting-in-a-node-2.mmd (89%) rename e2e/diagrams/flowchart/{elk => dagre}/with-formatting-in-a-node.mmd (89%) rename e2e/diagrams/flowchart/{elk => dagre}/with-styling-and-classes-2.mmd (92%) rename e2e/diagrams/flowchart/{elk => dagre}/with-styling-and-classes.mmd (92%) rename e2e/diagrams/flowchart/{elk => dagre}/wrapping-long-text-with-a-new-line-2.mmd (94%) rename e2e/diagrams/flowchart/{elk => dagre}/wrapping-long-text-with-a-new-line.mmd (94%) diff --git a/e2e/diagrams/flowchart/elk/1433-elk-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd b/e2e/diagrams/flowchart/dagre/1433-dagre-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd similarity index 67% rename from e2e/diagrams/flowchart/elk/1433-elk-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd rename to e2e/diagrams/flowchart/dagre/1433-dagre-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd index 851d243adce..34f598856c3 100644 --- a/e2e/diagrams/flowchart/elk/1433-elk-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd +++ b/e2e/diagrams/flowchart/dagre/1433-dagre-should-render-a-titled-flowchart-with-titletopmargin-set-to-0.mmd @@ -1,7 +1,8 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- -flowchart-elk TD +flowchart TD A --> B diff --git a/e2e/diagrams/flowchart/elk/2-elk-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd b/e2e/diagrams/flowchart/dagre/2-dagre-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd similarity index 88% rename from e2e/diagrams/flowchart/elk/2-elk-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd rename to e2e/diagrams/flowchart/dagre/2-dagre-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd index be813a11834..ac1b744c09d 100644 --- a/e2e/diagrams/flowchart/elk/2-elk-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd +++ b/e2e/diagrams/flowchart/dagre/2-dagre-should-render-a-simple-flowchart-with-diagrampadding-set-to-0.mmd @@ -1,9 +1,10 @@ --- config: + layout: dagre flowchart: diagramPadding: 0 --- -flowchart-elk TD +flowchart TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} %% this is a comment diff --git a/e2e/diagrams/flowchart/elk/2050-elk-handling-of-different-rendering-direction-in-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/2050-dagre-handling-of-different-rendering-direction-in-subgraphs.mmd similarity index 90% rename from e2e/diagrams/flowchart/elk/2050-elk-handling-of-different-rendering-direction-in-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/2050-dagre-handling-of-different-rendering-direction-in-subgraphs.mmd index 0cabc8c70bd..b85aa217864 100644 --- a/e2e/diagrams/flowchart/elk/2050-elk-handling-of-different-rendering-direction-in-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/2050-dagre-handling-of-different-rendering-direction-in-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR subgraph TOP direction TB diff --git a/e2e/diagrams/flowchart/elk/2388-elk-handling-default-in-the-node-name.mmd b/e2e/diagrams/flowchart/dagre/2388-dagre-handling-default-in-the-node-name.mmd similarity index 84% rename from e2e/diagrams/flowchart/elk/2388-elk-handling-default-in-the-node-name.mmd rename to e2e/diagrams/flowchart/dagre/2388-dagre-handling-default-in-the-node-name.mmd index 821e73e89b9..2b8195ecfe2 100644 --- a/e2e/diagrams/flowchart/elk/2388-elk-handling-default-in-the-node-name.mmd +++ b/e2e/diagrams/flowchart/dagre/2388-dagre-handling-default-in-the-node-name.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR default-index.js --> dot.template.js index.js --> module-utl.js diff --git a/e2e/diagrams/flowchart/elk/2824-elk-clipping-of-edges.mmd b/e2e/diagrams/flowchart/dagre/2824-dagre-clipping-of-edges.mmd similarity index 80% rename from e2e/diagrams/flowchart/elk/2824-elk-clipping-of-edges.mmd rename to e2e/diagrams/flowchart/dagre/2824-dagre-clipping-of-edges.mmd index a1d239637cf..f6b14ebe3a7 100644 --- a/e2e/diagrams/flowchart/elk/2824-elk-clipping-of-edges.mmd +++ b/e2e/diagrams/flowchart/dagre/2824-dagre-clipping-of-edges.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD A --> B A --> C B --> C diff --git a/e2e/diagrams/flowchart/elk/3-elk-a-link-with-correct-arrowhead-to-a-subgraph.mmd b/e2e/diagrams/flowchart/dagre/3-dagre-a-link-with-correct-arrowhead-to-a-subgraph.mmd similarity index 69% rename from e2e/diagrams/flowchart/elk/3-elk-a-link-with-correct-arrowhead-to-a-subgraph.mmd rename to e2e/diagrams/flowchart/dagre/3-dagre-a-link-with-correct-arrowhead-to-a-subgraph.mmd index 2b72b1eae20..4c7a7efb612 100644 --- a/e2e/diagrams/flowchart/elk/3-elk-a-link-with-correct-arrowhead-to-a-subgraph.mmd +++ b/e2e/diagrams/flowchart/dagre/3-dagre-a-link-with-correct-arrowhead-to-a-subgraph.mmd @@ -1,4 +1,8 @@ -flowchart-elk TD +--- +config: + layout: dagre +--- +flowchart TD P1 P1 -->P1.5 subgraph P1.5 diff --git a/e2e/diagrams/flowchart/elk/4-elk-length-of-edges.mmd b/e2e/diagrams/flowchart/dagre/4-dagre-length-of-edges.mmd similarity index 76% rename from e2e/diagrams/flowchart/elk/4-elk-length-of-edges.mmd rename to e2e/diagrams/flowchart/dagre/4-dagre-length-of-edges.mmd index 4636e1efad9..dca7c70aad9 100644 --- a/e2e/diagrams/flowchart/elk/4-elk-length-of-edges.mmd +++ b/e2e/diagrams/flowchart/dagre/4-dagre-length-of-edges.mmd @@ -1,4 +1,8 @@ -flowchart-elk TD +--- +config: + layout: dagre +--- +flowchart TD L1 --- L2 L2 --- C M1 ---> C diff --git a/e2e/diagrams/flowchart/elk/5-elk-should-render-escaped-without-html-labels.mmd b/e2e/diagrams/flowchart/dagre/5-dagre-should-render-escaped-without-html-labels.mmd similarity index 78% rename from e2e/diagrams/flowchart/elk/5-elk-should-render-escaped-without-html-labels.mmd rename to e2e/diagrams/flowchart/dagre/5-dagre-should-render-escaped-without-html-labels.mmd index dd16712cdb9..ce10a715a37 100644 --- a/e2e/diagrams/flowchart/elk/5-elk-should-render-escaped-without-html-labels.mmd +++ b/e2e/diagrams/flowchart/dagre/5-dagre-should-render-escaped-without-html-labels.mmd @@ -1,8 +1,9 @@ --- config: + layout: dagre htmlLabels: false flowchart: htmlLabels: false --- -flowchart-elk TD +flowchart TD a["Haiya"]---->b diff --git a/e2e/diagrams/flowchart/elk/50-elk-handle-nested-subgraphs-in-reverse-order.mmd b/e2e/diagrams/flowchart/dagre/50-dagre-handle-nested-subgraphs-in-reverse-order.mmd similarity index 83% rename from e2e/diagrams/flowchart/elk/50-elk-handle-nested-subgraphs-in-reverse-order.mmd rename to e2e/diagrams/flowchart/dagre/50-dagre-handle-nested-subgraphs-in-reverse-order.mmd index 3ce3ec4068b..3c9a03dda84 100644 --- a/e2e/diagrams/flowchart/elk/50-elk-handle-nested-subgraphs-in-reverse-order.mmd +++ b/e2e/diagrams/flowchart/dagre/50-dagre-handle-nested-subgraphs-in-reverse-order.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR a -->b subgraph A B diff --git a/e2e/diagrams/flowchart/elk/51-elk-handle-nested-subgraphs-in-reverse-order.mmd b/e2e/diagrams/flowchart/dagre/51-dagre-handle-nested-subgraphs-in-reverse-order.mmd similarity index 83% rename from e2e/diagrams/flowchart/elk/51-elk-handle-nested-subgraphs-in-reverse-order.mmd rename to e2e/diagrams/flowchart/dagre/51-dagre-handle-nested-subgraphs-in-reverse-order.mmd index 3ce3ec4068b..3c9a03dda84 100644 --- a/e2e/diagrams/flowchart/elk/51-elk-handle-nested-subgraphs-in-reverse-order.mmd +++ b/e2e/diagrams/flowchart/dagre/51-dagre-handle-nested-subgraphs-in-reverse-order.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR a -->b subgraph A B diff --git a/e2e/diagrams/flowchart/elk/52-elk-handle-nested-subgraphs-in-several-levels.mmd b/e2e/diagrams/flowchart/dagre/52-dagre-handle-nested-subgraphs-in-several-levels.mmd similarity index 86% rename from e2e/diagrams/flowchart/elk/52-elk-handle-nested-subgraphs-in-several-levels.mmd rename to e2e/diagrams/flowchart/dagre/52-dagre-handle-nested-subgraphs-in-several-levels.mmd index 59f88ea2328..d8748b7f519 100644 --- a/e2e/diagrams/flowchart/elk/52-elk-handle-nested-subgraphs-in-several-levels.mmd +++ b/e2e/diagrams/flowchart/dagre/52-dagre-handle-nested-subgraphs-in-several-levels.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB b-->B a-->c subgraph O diff --git a/e2e/diagrams/flowchart/elk/53-elk-handle-nested-subgraphs-with-edges-in-and-out.mmd b/e2e/diagrams/flowchart/dagre/53-dagre-handle-nested-subgraphs-with-edges-in-and-out.mmd similarity index 92% rename from e2e/diagrams/flowchart/elk/53-elk-handle-nested-subgraphs-with-edges-in-and-out.mmd rename to e2e/diagrams/flowchart/dagre/53-dagre-handle-nested-subgraphs-with-edges-in-and-out.mmd index 9eeed695bb3..b1e9339231b 100644 --- a/e2e/diagrams/flowchart/elk/53-elk-handle-nested-subgraphs-with-edges-in-and-out.mmd +++ b/e2e/diagrams/flowchart/dagre/53-dagre-handle-nested-subgraphs-with-edges-in-and-out.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB internet nat router diff --git a/e2e/diagrams/flowchart/elk/54-elk-handle-nested-subgraphs-with-outgoing-links.mmd b/e2e/diagrams/flowchart/dagre/54-dagre-handle-nested-subgraphs-with-outgoing-links.mmd similarity index 88% rename from e2e/diagrams/flowchart/elk/54-elk-handle-nested-subgraphs-with-outgoing-links.mmd rename to e2e/diagrams/flowchart/dagre/54-dagre-handle-nested-subgraphs-with-outgoing-links.mmd index c459cf5b957..54eff4cdeb3 100644 --- a/e2e/diagrams/flowchart/elk/54-elk-handle-nested-subgraphs-with-outgoing-links.mmd +++ b/e2e/diagrams/flowchart/dagre/54-dagre-handle-nested-subgraphs-with-outgoing-links.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD subgraph main subgraph subcontainer subcontainer-child diff --git a/e2e/diagrams/flowchart/elk/55-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd b/e2e/diagrams/flowchart/dagre/55-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd similarity index 91% rename from e2e/diagrams/flowchart/elk/55-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd rename to e2e/diagrams/flowchart/dagre/55-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd index f6cb05c9ede..a13858b22df 100644 --- a/e2e/diagrams/flowchart/elk/55-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd +++ b/e2e/diagrams/flowchart/dagre/55-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD subgraph one[One] subgraph sub_one[Sub One] diff --git a/e2e/diagrams/flowchart/elk/56-elk-handle-nested-subgraphs-with-outgoing-links-3.mmd b/e2e/diagrams/flowchart/dagre/56-dagre-handle-nested-subgraphs-with-outgoing-links-3.mmd similarity index 90% rename from e2e/diagrams/flowchart/elk/56-elk-handle-nested-subgraphs-with-outgoing-links-3.mmd rename to e2e/diagrams/flowchart/dagre/56-dagre-handle-nested-subgraphs-with-outgoing-links-3.mmd index a3c83f8d065..699e42eecb8 100644 --- a/e2e/diagrams/flowchart/elk/56-elk-handle-nested-subgraphs-with-outgoing-links-3.mmd +++ b/e2e/diagrams/flowchart/dagre/56-dagre-handle-nested-subgraphs-with-outgoing-links-3.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB subgraph container_Beta process_C-->Process_D end diff --git a/e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd b/e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd similarity index 89% rename from e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd rename to e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd index 7662a72bb76..981da0034a8 100644 --- a/e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-2.mmd +++ b/e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-2.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB c1-->a2 subgraph one a1-->a2 diff --git a/e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-4.mmd b/e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-4.mmd similarity index 83% rename from e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-4.mmd rename to e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-4.mmd index b33308dfa47..4817b0833eb 100644 --- a/e2e/diagrams/flowchart/elk/57-elk-handle-nested-subgraphs-with-outgoing-links-4.mmd +++ b/e2e/diagrams/flowchart/dagre/57-dagre-handle-nested-subgraphs-with-outgoing-links-4.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR subgraph A a -->b end diff --git a/e2e/diagrams/flowchart/elk/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd b/e2e/diagrams/flowchart/dagre/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd similarity index 91% rename from e2e/diagrams/flowchart/elk/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd rename to e2e/diagrams/flowchart/dagre/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd index 57fc3bf60d0..8cbfd3a9ed1 100644 --- a/e2e/diagrams/flowchart/elk/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd +++ b/e2e/diagrams/flowchart/dagre/57-x-handle-nested-subgraphs-with-outgoing-links-5.mmd @@ -1,12 +1,13 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- %% this does not produce the desired result - flowchart-elk TB + flowchart TB subgraph container_Beta process_C-->Process_D end diff --git a/e2e/diagrams/flowchart/elk/58-elk-handle-styling-with-style-expressions.mmd b/e2e/diagrams/flowchart/dagre/58-dagre-handle-styling-with-style-expressions.mmd similarity index 89% rename from e2e/diagrams/flowchart/elk/58-elk-handle-styling-with-style-expressions.mmd rename to e2e/diagrams/flowchart/dagre/58-dagre-handle-styling-with-style-expressions.mmd index b14011d87e6..5197dc3a0ba 100644 --- a/e2e/diagrams/flowchart/elk/58-elk-handle-styling-with-style-expressions.mmd +++ b/e2e/diagrams/flowchart/dagre/58-dagre-handle-styling-with-style-expressions.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR id1(Start)-->id2(Stop) style id1 fill:#f9f,stroke:#333,stroke-width:4px style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5 diff --git a/e2e/diagrams/flowchart/elk/59-elk-handle-styling-of-subgraphs-and-links.mmd b/e2e/diagrams/flowchart/dagre/59-dagre-handle-styling-of-subgraphs-and-links.mmd similarity index 93% rename from e2e/diagrams/flowchart/elk/59-elk-handle-styling-of-subgraphs-and-links.mmd rename to e2e/diagrams/flowchart/dagre/59-dagre-handle-styling-of-subgraphs-and-links.mmd index 88204af0230..2a25a59b021 100644 --- a/e2e/diagrams/flowchart/elk/59-elk-handle-styling-of-subgraphs-and-links.mmd +++ b/e2e/diagrams/flowchart/dagre/59-dagre-handle-styling-of-subgraphs-and-links.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD A[Christmas] ==> D A[Christmas] -->|Get money| B(Go shopping) A[Christmas] ==> C diff --git a/e2e/diagrams/flowchart/elk/6-elk-should-render-non-escaped-with-html-labels.mmd b/e2e/diagrams/flowchart/dagre/6-dagre-should-render-non-escaped-with-html-labels.mmd similarity index 81% rename from e2e/diagrams/flowchart/elk/6-elk-should-render-non-escaped-with-html-labels.mmd rename to e2e/diagrams/flowchart/dagre/6-dagre-should-render-non-escaped-with-html-labels.mmd index da6c959e097..ac7492aabae 100644 --- a/e2e/diagrams/flowchart/elk/6-elk-should-render-non-escaped-with-html-labels.mmd +++ b/e2e/diagrams/flowchart/dagre/6-dagre-should-render-non-escaped-with-html-labels.mmd @@ -1,9 +1,10 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD a["Haiya"]===>b diff --git a/e2e/diagrams/flowchart/elk/60-elk-handle-styling-for-all-node-shapes-v2.mmd b/e2e/diagrams/flowchart/dagre/60-dagre-handle-styling-for-all-node-shapes-v2.mmd similarity index 97% rename from e2e/diagrams/flowchart/elk/60-elk-handle-styling-for-all-node-shapes-v2.mmd rename to e2e/diagrams/flowchart/dagre/60-dagre-handle-styling-for-all-node-shapes-v2.mmd index 88eb68ba320..e3646f8abcb 100644 --- a/e2e/diagrams/flowchart/elk/60-elk-handle-styling-for-all-node-shapes-v2.mmd +++ b/e2e/diagrams/flowchart/dagre/60-dagre-handle-styling-for-all-node-shapes-v2.mmd @@ -1,12 +1,13 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose logLevel: 2 --- -flowchart-elk LR +flowchart LR A[red text] -->|default style| B(blue text) C([red text]) -->|default style| D[[blue text]] E[(red text)] -->|default style| F((blue text)) diff --git a/e2e/diagrams/flowchart/elk/6080-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6080-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6080-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6080-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-1-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-1-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-1-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-1-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-2-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-2-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-2-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-2-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-3-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-3-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-3-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-3-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-4-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-4-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-4-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-4-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-5-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-5-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-5-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-5-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/6088-6-should-handle-diamond-shape-intersections.mmd b/e2e/diagrams/flowchart/dagre/6088-6-should-handle-diamond-shape-intersections.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6088-6-should-handle-diamond-shape-intersections.mmd rename to e2e/diagrams/flowchart/dagre/6088-6-should-handle-diamond-shape-intersections.mmd diff --git a/e2e/diagrams/flowchart/elk/61-elk-fontawesome-icons-in-edge-labels.mmd b/e2e/diagrams/flowchart/dagre/61-dagre-fontawesome-icons-in-edge-labels.mmd similarity index 81% rename from e2e/diagrams/flowchart/elk/61-elk-fontawesome-icons-in-edge-labels.mmd rename to e2e/diagrams/flowchart/dagre/61-dagre-fontawesome-icons-in-edge-labels.mmd index 25114fe0e87..6466c861d4f 100644 --- a/e2e/diagrams/flowchart/elk/61-elk-fontawesome-icons-in-edge-labels.mmd +++ b/e2e/diagrams/flowchart/dagre/61-dagre-fontawesome-icons-in-edge-labels.mmd @@ -1,9 +1,10 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TD +flowchart TD C -->|fa:fa-car Car| F[fa:fa-car Car] diff --git a/e2e/diagrams/flowchart/elk/62-elk-should-render-styled-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/62-dagre-should-render-styled-subgraphs.mmd similarity index 93% rename from e2e/diagrams/flowchart/elk/62-elk-should-render-styled-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/62-dagre-should-render-styled-subgraphs.mmd index 7994ef06793..44fdc55a9a5 100644 --- a/e2e/diagrams/flowchart/elk/62-elk-should-render-styled-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/62-dagre-should-render-styled-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB A B subgraph foo[Foo SubGraph] diff --git a/e2e/diagrams/flowchart/elk/63-elk-title-on-subgraphs-should-be-themeable.mmd b/e2e/diagrams/flowchart/dagre/63-dagre-title-on-subgraphs-should-be-themeable.mmd similarity index 90% rename from e2e/diagrams/flowchart/elk/63-elk-title-on-subgraphs-should-be-themeable.mmd rename to e2e/diagrams/flowchart/dagre/63-dagre-title-on-subgraphs-should-be-themeable.mmd index 05b7f8d2f44..36475665f78 100644 --- a/e2e/diagrams/flowchart/elk/63-elk-title-on-subgraphs-should-be-themeable.mmd +++ b/e2e/diagrams/flowchart/dagre/63-dagre-title-on-subgraphs-should-be-themeable.mmd @@ -1,12 +1,13 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- %%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%% -flowchart-elk LR +flowchart LR subgraph A a --> b end diff --git a/e2e/diagrams/flowchart/elk/65-elk-text-color-from-classes.mmd b/e2e/diagrams/flowchart/dagre/65-dagre-text-color-from-classes.mmd similarity index 87% rename from e2e/diagrams/flowchart/elk/65-elk-text-color-from-classes.mmd rename to e2e/diagrams/flowchart/dagre/65-dagre-text-color-from-classes.mmd index e715fc00c5e..82ab1bb171c 100644 --- a/e2e/diagrams/flowchart/elk/65-elk-text-color-from-classes.mmd +++ b/e2e/diagrams/flowchart/dagre/65-dagre-text-color-from-classes.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR classDef dark fill:#000,stroke:#000,stroke-width:4px,color:#fff Lorem --> Ipsum --> Dolor class Lorem,Dolor dark diff --git a/e2e/diagrams/flowchart/elk/66-elk-more-nested-subgraph-cases-tb.mmd b/e2e/diagrams/flowchart/dagre/66-dagre-more-nested-subgraph-cases-tb.mmd similarity index 85% rename from e2e/diagrams/flowchart/elk/66-elk-more-nested-subgraph-cases-tb.mmd rename to e2e/diagrams/flowchart/dagre/66-dagre-more-nested-subgraph-cases-tb.mmd index 30ddb1d6dee..a5c70a228c4 100644 --- a/e2e/diagrams/flowchart/elk/66-elk-more-nested-subgraph-cases-tb.mmd +++ b/e2e/diagrams/flowchart/dagre/66-dagre-more-nested-subgraph-cases-tb.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB subgraph two b1 end diff --git a/e2e/diagrams/flowchart/elk/6647-elk-should-keep-node-order-when-using-elk-layout-unless-it-would-add-crossings.mmd b/e2e/diagrams/flowchart/dagre/6647-dagre-should-keep-node-order-when-using-dagre-layout-unless-it-would-add-crossings.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/6647-elk-should-keep-node-order-when-using-elk-layout-unless-it-would-add-crossings.mmd rename to e2e/diagrams/flowchart/dagre/6647-dagre-should-keep-node-order-when-using-dagre-layout-unless-it-would-add-crossings.mmd diff --git a/e2e/diagrams/flowchart/elk/67-elk-more-nested-subgraph-cases-rl.mmd b/e2e/diagrams/flowchart/dagre/67-dagre-more-nested-subgraph-cases-rl.mmd similarity index 85% rename from e2e/diagrams/flowchart/elk/67-elk-more-nested-subgraph-cases-rl.mmd rename to e2e/diagrams/flowchart/dagre/67-dagre-more-nested-subgraph-cases-rl.mmd index d97ae2ca02f..696b12543ad 100644 --- a/e2e/diagrams/flowchart/elk/67-elk-more-nested-subgraph-cases-rl.mmd +++ b/e2e/diagrams/flowchart/dagre/67-dagre-more-nested-subgraph-cases-rl.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk RL +flowchart RL subgraph two b1 end diff --git a/e2e/diagrams/flowchart/elk/68-elk-more-nested-subgraph-cases-bt.mmd b/e2e/diagrams/flowchart/dagre/68-dagre-more-nested-subgraph-cases-bt.mmd similarity index 85% rename from e2e/diagrams/flowchart/elk/68-elk-more-nested-subgraph-cases-bt.mmd rename to e2e/diagrams/flowchart/dagre/68-dagre-more-nested-subgraph-cases-bt.mmd index efa3d8da3c7..722e13eb74b 100644 --- a/e2e/diagrams/flowchart/elk/68-elk-more-nested-subgraph-cases-bt.mmd +++ b/e2e/diagrams/flowchart/dagre/68-dagre-more-nested-subgraph-cases-bt.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk BT +flowchart BT subgraph two b1 end diff --git a/e2e/diagrams/flowchart/elk/69-elk-more-nested-subgraph-cases-lr.mmd b/e2e/diagrams/flowchart/dagre/69-dagre-more-nested-subgraph-cases-lr.mmd similarity index 85% rename from e2e/diagrams/flowchart/elk/69-elk-more-nested-subgraph-cases-lr.mmd rename to e2e/diagrams/flowchart/dagre/69-dagre-more-nested-subgraph-cases-lr.mmd index 2ac1a05c62e..b1636579625 100644 --- a/e2e/diagrams/flowchart/elk/69-elk-more-nested-subgraph-cases-lr.mmd +++ b/e2e/diagrams/flowchart/dagre/69-dagre-more-nested-subgraph-cases-lr.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk LR +flowchart LR subgraph two b1 end diff --git a/e2e/diagrams/flowchart/elk/70-elk-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/70-dagre-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd similarity index 86% rename from e2e/diagrams/flowchart/elk/70-elk-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/70-dagre-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd index 927cdfcc9b6..a650cc723b5 100644 --- a/e2e/diagrams/flowchart/elk/70-elk-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/70-dagre-handle-nested-subgraph-cases-tb-link-out-and-link-between-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB subgraph S1 sub1 -->sub2 end diff --git a/e2e/diagrams/flowchart/elk/71-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/71-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd similarity index 86% rename from e2e/diagrams/flowchart/elk/71-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/71-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd index 67d6bc4d080..da78088b7f8 100644 --- a/e2e/diagrams/flowchart/elk/71-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/71-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk RL +flowchart RL subgraph S1 sub1 -->sub2 end diff --git a/e2e/diagrams/flowchart/elk/72-elk-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/72-dagre-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd similarity index 86% rename from e2e/diagrams/flowchart/elk/72-elk-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/72-dagre-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd index d28bdc9ca81..a8391c670ab 100644 --- a/e2e/diagrams/flowchart/elk/72-elk-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/72-dagre-handle-nested-subgraph-cases-bt-link-out-and-link-between-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk BT +flowchart BT subgraph S1 sub1 -->sub2 end diff --git a/e2e/diagrams/flowchart/elk/7213-should-render-elk-edges-with-right-angles-not-curves.mmd b/e2e/diagrams/flowchart/dagre/7213-should-render-dagre-edges-with-right-angles-not-curves.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/7213-should-render-elk-edges-with-right-angles-not-curves.mmd rename to e2e/diagrams/flowchart/dagre/7213-should-render-dagre-edges-with-right-angles-not-curves.mmd diff --git a/e2e/diagrams/flowchart/elk/74-elk-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd b/e2e/diagrams/flowchart/dagre/74-dagre-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd similarity index 83% rename from e2e/diagrams/flowchart/elk/74-elk-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd rename to e2e/diagrams/flowchart/dagre/74-dagre-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd index 8e6f7bda192..1d8b0eaab0f 100644 --- a/e2e/diagrams/flowchart/elk/74-elk-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd +++ b/e2e/diagrams/flowchart/dagre/74-dagre-handle-labels-for-multiple-edges-from-and-to-the-same-couple-of-nodes.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk RL +flowchart RL subgraph one a1 -- l1 --> a2 a1 -- l2 --> a2 diff --git a/e2e/diagrams/flowchart/elk/74-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd b/e2e/diagrams/flowchart/dagre/74-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd similarity index 86% rename from e2e/diagrams/flowchart/elk/74-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd rename to e2e/diagrams/flowchart/dagre/74-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd index 67d6bc4d080..da78088b7f8 100644 --- a/e2e/diagrams/flowchart/elk/74-elk-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd +++ b/e2e/diagrams/flowchart/dagre/74-dagre-handle-nested-subgraph-cases-rl-link-out-and-link-between-subgraphs.mmd @@ -1,11 +1,12 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk RL +flowchart RL subgraph S1 sub1 -->sub2 end diff --git a/e2e/diagrams/flowchart/elk/76-elk-handle-unicode-encoded-character-with-html-labels-true.mmd b/e2e/diagrams/flowchart/dagre/76-dagre-handle-unicode-encoded-character-with-html-labels-true.mmd similarity index 90% rename from e2e/diagrams/flowchart/elk/76-elk-handle-unicode-encoded-character-with-html-labels-true.mmd rename to e2e/diagrams/flowchart/dagre/76-dagre-handle-unicode-encoded-character-with-html-labels-true.mmd index acd1f2c73d7..7e01dc85320 100644 --- a/e2e/diagrams/flowchart/elk/76-elk-handle-unicode-encoded-character-with-html-labels-true.mmd +++ b/e2e/diagrams/flowchart/dagre/76-dagre-handle-unicode-encoded-character-with-html-labels-true.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre htmlLabels: true flowchart: htmlLabels: true securityLevel: loose --- -flowchart-elk TB +flowchart TB a{{"Lorem 'ipsum' dolor 'sit' amet, 'consectetur' adipiscing 'elit'."}} --> b{{"Lorem #quot;ipsum#quot; dolor #quot;sit#quot; amet,#quot;consectetur#quot; adipiscing #quot;elit#quot;."}} diff --git a/e2e/diagrams/flowchart/elk/elk-recursive-flow-with-elk-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd b/e2e/diagrams/flowchart/dagre/dagre-recursive-flow-with-dagre-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/elk-recursive-flow-with-elk-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd rename to e2e/diagrams/flowchart/dagre/dagre-recursive-flow-with-dagre-keepentrynodeontop-false-keeps-the-default-layout-7827.mmd diff --git a/e2e/diagrams/flowchart/elk/elk-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-elk-keepentrynodeontop-true-7827.mmd b/e2e/diagrams/flowchart/dagre/dagre-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-dagre-keepentrynodeontop-true-7827.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/elk-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-elk-keepentrynodeontop-true-7827.mmd rename to e2e/diagrams/flowchart/dagre/dagre-should-keep-the-entry-node-on-top-of-a-recursive-flow-nested-in-a-subgraph-with-dagre-keepentrynodeontop-true-7827.mmd diff --git a/e2e/diagrams/flowchart/elk/elk-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-elk-keepentrynodeontop-true-7827.mmd b/e2e/diagrams/flowchart/dagre/dagre-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-dagre-keepentrynodeontop-true-7827.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/elk-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-elk-keepentrynodeontop-true-7827.mmd rename to e2e/diagrams/flowchart/dagre/dagre-should-keep-the-entry-node-on-top-when-a-flow-recurses-with-dagre-keepentrynodeontop-true-7827.mmd diff --git a/e2e/diagrams/flowchart/elk/elk-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd b/e2e/diagrams/flowchart/dagre/dagre-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/elk-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd rename to e2e/diagrams/flowchart/dagre/dagre-should-keep-the-true-entry-on-top-when-a-back-edge-feeds-it-79.mmd diff --git a/e2e/diagrams/flowchart/elk/elk-should-merge-edges-within-subgraphs-when-elk-mergeedges-is-true-7659.mmd b/e2e/diagrams/flowchart/dagre/dagre-should-merge-edges-within-subgraphs-when-dagre-mergeedges-is-true-7659.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/elk-should-merge-edges-within-subgraphs-when-elk-mergeedges-is-true-7659.mmd rename to e2e/diagrams/flowchart/dagre/dagre-should-merge-edges-within-subgraphs-when-dagre-mergeedges-is-true-7659.mmd diff --git a/e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label-2.mmd b/e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label-2.mmd similarity index 85% rename from e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label-2.mmd rename to e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label-2.mmd index 1e651ab631b..d778466048b 100644 --- a/e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label-2.mmd +++ b/e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label-2.mmd @@ -1,9 +1,10 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": false}} }%% -flowchart-elk LR +flowchart LR b("`The dog in **the** hog.(1) NL`") --"`1o **bold**`"--> c diff --git a/e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label.mmd b/e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label.mmd similarity index 84% rename from e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label.mmd rename to e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label.mmd index 3ebd0ba48af..1887675d92d 100644 --- a/e2e/diagrams/flowchart/elk/new-line-in-node-and-formatted-edge-label.mmd +++ b/e2e/diagrams/flowchart/dagre/new-line-in-node-and-formatted-edge-label.mmd @@ -1,9 +1,10 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": true}} }%% -flowchart-elk LR +flowchart LR b("`The dog in **the** hog.(1) NL`") --"`1o **bold**`"--> c diff --git a/e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings-2.mmd b/e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings-2.mmd similarity index 91% rename from e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings-2.mmd rename to e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings-2.mmd index 167acbe8240..573292bc316 100644 --- a/e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings-2.mmd +++ b/e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings-2.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": false}} }%% -flowchart-elk LR +flowchart LR subgraph "One" a("`The **cat** in the hat`") -- "1o" --> b{{"`The **dog** in the hog`"}} diff --git a/e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings.mmd b/e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings.mmd similarity index 91% rename from e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings.mmd rename to e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings.mmd index 0c813d6c94e..cb82c556dee 100644 --- a/e2e/diagrams/flowchart/elk/sub-graphs-and-markdown-strings.mmd +++ b/e2e/diagrams/flowchart/dagre/sub-graphs-and-markdown-strings.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": true}} }%% -flowchart-elk LR +flowchart LR subgraph "One" a("`The **cat** in the hat`") -- "1o" --> b{{"`The **dog** in the hog`"}} diff --git a/e2e/diagrams/flowchart/elk/sub-graphs.mmd b/e2e/diagrams/flowchart/dagre/sub-graphs.mmd similarity index 100% rename from e2e/diagrams/flowchart/elk/sub-graphs.mmd rename to e2e/diagrams/flowchart/dagre/sub-graphs.mmd diff --git a/e2e/diagrams/flowchart/elk/v2-elk-16-render-stadium-shape.mmd b/e2e/diagrams/flowchart/dagre/v2-dagre-16-render-stadium-shape.mmd similarity index 94% rename from e2e/diagrams/flowchart/elk/v2-elk-16-render-stadium-shape.mmd rename to e2e/diagrams/flowchart/dagre/v2-dagre-16-render-stadium-shape.mmd index 21c32b60b22..6d4cb9ae69a 100644 --- a/e2e/diagrams/flowchart/elk/v2-elk-16-render-stadium-shape.mmd +++ b/e2e/diagrams/flowchart/dagre/v2-dagre-16-render-stadium-shape.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: htmlLabels: false fontFamily: courier --- -flowchart-elk TD +flowchart TD A([stadium shape test]) A -->|Get money| B([Go shopping]) B --> C([Let me think...
Do I want something for work,
something to spend every free second with,
or something to get around?]) diff --git a/e2e/diagrams/flowchart/elk/with-formatting-in-a-node-2.mmd b/e2e/diagrams/flowchart/dagre/with-formatting-in-a-node-2.mmd similarity index 89% rename from e2e/diagrams/flowchart/elk/with-formatting-in-a-node-2.mmd rename to e2e/diagrams/flowchart/dagre/with-formatting-in-a-node-2.mmd index b0b6a46148a..043042a89c1 100644 --- a/e2e/diagrams/flowchart/elk/with-formatting-in-a-node-2.mmd +++ b/e2e/diagrams/flowchart/dagre/with-formatting-in-a-node-2.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": false}} }%% -flowchart-elk LR +flowchart LR a{"`The **cat** in the hat`"} -- 1o --> b a -- 2o --> c a -- 3o --> d diff --git a/e2e/diagrams/flowchart/elk/with-formatting-in-a-node.mmd b/e2e/diagrams/flowchart/dagre/with-formatting-in-a-node.mmd similarity index 89% rename from e2e/diagrams/flowchart/elk/with-formatting-in-a-node.mmd rename to e2e/diagrams/flowchart/dagre/with-formatting-in-a-node.mmd index b0e6d701981..1552abae161 100644 --- a/e2e/diagrams/flowchart/elk/with-formatting-in-a-node.mmd +++ b/e2e/diagrams/flowchart/dagre/with-formatting-in-a-node.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": true}} }%% -flowchart-elk LR +flowchart LR a{"`The **cat** in the hat`"} -- 1o --> b a -- 2o --> c a -- 3o --> d diff --git a/e2e/diagrams/flowchart/elk/with-styling-and-classes-2.mmd b/e2e/diagrams/flowchart/dagre/with-styling-and-classes-2.mmd similarity index 92% rename from e2e/diagrams/flowchart/elk/with-styling-and-classes-2.mmd rename to e2e/diagrams/flowchart/dagre/with-styling-and-classes-2.mmd index 094bb6c3990..8763cc648ff 100644 --- a/e2e/diagrams/flowchart/elk/with-styling-and-classes-2.mmd +++ b/e2e/diagrams/flowchart/dagre/with-styling-and-classes-2.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": false}} }%% -flowchart-elk LR +flowchart LR A:::someclass --> B["`The **cat** in the hat`"]:::someclass id1(Start)-->id2(Stop) style id1 fill:#f9f,stroke:#333,stroke-width:4px diff --git a/e2e/diagrams/flowchart/elk/with-styling-and-classes.mmd b/e2e/diagrams/flowchart/dagre/with-styling-and-classes.mmd similarity index 92% rename from e2e/diagrams/flowchart/elk/with-styling-and-classes.mmd rename to e2e/diagrams/flowchart/dagre/with-styling-and-classes.mmd index 6bc5d6766b7..7eb973cecae 100644 --- a/e2e/diagrams/flowchart/elk/with-styling-and-classes.mmd +++ b/e2e/diagrams/flowchart/dagre/with-styling-and-classes.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": true}} }%% -flowchart-elk LR +flowchart LR A:::someclass --> B["`The **cat** in the hat`"]:::someclass id1(Start)-->id2(Stop) style id1 fill:#f9f,stroke:#333,stroke-width:4px diff --git a/e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line-2.mmd b/e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line-2.mmd similarity index 94% rename from e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line-2.mmd rename to e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line-2.mmd index afba7852987..f4c36f1803d 100644 --- a/e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line-2.mmd +++ b/e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line-2.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": false}} }%% -flowchart-elk LR +flowchart LR b("`The dog in **the** hog.(1).. a a a a *very long text* about it Word! diff --git a/e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line.mmd b/e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line.mmd similarity index 94% rename from e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line.mmd rename to e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line.mmd index 03a0f775ff3..410958a64ae 100644 --- a/e2e/diagrams/flowchart/elk/wrapping-long-text-with-a-new-line.mmd +++ b/e2e/diagrams/flowchart/dagre/wrapping-long-text-with-a-new-line.mmd @@ -1,10 +1,11 @@ --- config: + layout: dagre flowchart: titleTopMargin: 0 --- %%{init: {"flowchart": {"htmlLabels": true}} }%% -flowchart-elk LR +flowchart LR b("`The dog in **the** hog.(1).. a a a a *very long text* about it Word! From 0e2a507475e4f02c42ad6b3e2ce63ddb774a769b Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Mon, 31 Aug 2026 12:59:27 +0200 Subject: [PATCH 13/31] Changed layout from elk to dagre --- ...phs.mmd => knsv2-06-flowchart-dagre-ogdc-tb-subgraphs.mmd} | 0 ...ubgraphs.mmd => knsv2-07-flowchart-dagre-tb-subgraphs.mmd} | 2 +- ...ubgraphs.mmd => knsv2-08-flowchart-dagre-tb-subgraphs.mmd} | 2 +- ...ubgraphs.mmd => knsv2-09-flowchart-dagre-tb-subgraphs.mmd} | 2 +- ...ubgraphs.mmd => knsv2-12-flowchart-dagre-tb-subgraphs.mmd} | 4 ++-- ...ubgraphs.mmd => knsv2-13-flowchart-dagre-tb-subgraphs.mmd} | 4 ++-- ...4-flowchart-elk-tb.mmd => knsv2-14-flowchart-dagre-tb.mmd} | 2 +- ...k-lr-shapes.mmd => knsv2-15-flowchart-dagre-lr-shapes.mmd} | 2 +- ...k-lr-shapes.mmd => knsv2-17-flowchart-dagre-lr-shapes.mmd} | 2 +- ...k-lr-shapes.mmd => knsv2-18-flowchart-dagre-lr-shapes.mmd} | 2 +- ...k-lr-shapes.mmd => knsv2-19-flowchart-dagre-lr-shapes.mmd} | 2 +- ... => knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd} | 2 +- ...ubgraphs.mmd => knsv2-21-flowchart-dagre-lr-subgraphs.mmd} | 2 +- ...2-flowchart-elk-lr.mmd => knsv2-22-flowchart-dagre-lr.mmd} | 2 +- ...ubgraphs.mmd => knsv2-23-flowchart-dagre-lr-subgraphs.mmd} | 2 +- ...ubgraphs.mmd => knsv2-24-flowchart-dagre-lr-subgraphs.mmd} | 2 +- ...5-flowchart-elk-lr.mmd => knsv2-25-flowchart-dagre-lr.mmd} | 2 +- ...s.mmd => knsv2-26-flowchart-dagre-lr-shapes-subgraphs.mmd} | 2 +- ...ubgraphs.mmd => knsv2-27-flowchart-dagre-lr-subgraphs.mmd} | 2 +- ...8-flowchart-elk-lr.mmd => knsv2-28-flowchart-dagre-lr.mmd} | 2 +- ...ubgraphs.mmd => knsv2-29-flowchart-dagre-lr-subgraphs.mmd} | 2 +- ...k-lr-shapes.mmd => knsv2-30-flowchart-dagre-lr-shapes.mmd} | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) rename e2e/platform/dev-diagrams/knsv/{knsv2-06-flowchart-elk-ogdc-tb-subgraphs.mmd => knsv2-06-flowchart-dagre-ogdc-tb-subgraphs.mmd} (100%) rename e2e/platform/dev-diagrams/knsv/{knsv2-07-flowchart-elk-tb-subgraphs.mmd => knsv2-07-flowchart-dagre-tb-subgraphs.mmd} (93%) rename e2e/platform/dev-diagrams/knsv/{knsv2-08-flowchart-elk-tb-subgraphs.mmd => knsv2-08-flowchart-dagre-tb-subgraphs.mmd} (94%) rename e2e/platform/dev-diagrams/knsv/{knsv2-09-flowchart-elk-tb-subgraphs.mmd => knsv2-09-flowchart-dagre-tb-subgraphs.mmd} (87%) rename e2e/platform/dev-diagrams/knsv/{knsv2-12-flowchart-elk-elk-tb-subgraphs.mmd => knsv2-12-flowchart-dagre-tb-subgraphs.mmd} (85%) rename e2e/platform/dev-diagrams/knsv/{knsv2-13-flowchart-elk-elk-tb-subgraphs.mmd => knsv2-13-flowchart-dagre-tb-subgraphs.mmd} (89%) rename e2e/platform/dev-diagrams/knsv/{knsv2-14-flowchart-elk-tb.mmd => knsv2-14-flowchart-dagre-tb.mmd} (93%) rename e2e/platform/dev-diagrams/knsv/{knsv2-15-flowchart-elk-lr-shapes.mmd => knsv2-15-flowchart-dagre-lr-shapes.mmd} (92%) rename e2e/platform/dev-diagrams/knsv/{knsv2-17-flowchart-elk-lr-shapes.mmd => knsv2-17-flowchart-dagre-lr-shapes.mmd} (90%) rename e2e/platform/dev-diagrams/knsv/{knsv2-18-flowchart-elk-lr-shapes.mmd => knsv2-18-flowchart-dagre-lr-shapes.mmd} (91%) rename e2e/platform/dev-diagrams/knsv/{knsv2-19-flowchart-elk-lr-shapes.mmd => knsv2-19-flowchart-dagre-lr-shapes.mmd} (92%) rename e2e/platform/dev-diagrams/knsv/{knsv2-20-flowchart-elk-lr-shapes-node-placement.mmd => knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd} (93%) rename e2e/platform/dev-diagrams/knsv/{knsv2-21-flowchart-elk-lr-subgraphs.mmd => knsv2-21-flowchart-dagre-lr-subgraphs.mmd} (87%) rename e2e/platform/dev-diagrams/knsv/{knsv2-22-flowchart-elk-lr.mmd => knsv2-22-flowchart-dagre-lr.mmd} (88%) rename e2e/platform/dev-diagrams/knsv/{knsv2-23-flowchart-elk-lr-subgraphs.mmd => knsv2-23-flowchart-dagre-lr-subgraphs.mmd} (93%) rename e2e/platform/dev-diagrams/knsv/{knsv2-24-flowchart-elk-lr-subgraphs.mmd => knsv2-24-flowchart-dagre-lr-subgraphs.mmd} (95%) rename e2e/platform/dev-diagrams/knsv/{knsv2-25-flowchart-elk-lr.mmd => knsv2-25-flowchart-dagre-lr.mmd} (89%) rename e2e/platform/dev-diagrams/knsv/{knsv2-26-flowchart-elk-lr-shapes-subgraphs.mmd => knsv2-26-flowchart-dagre-lr-shapes-subgraphs.mmd} (98%) rename e2e/platform/dev-diagrams/knsv/{knsv2-27-flowchart-elk-lr-subgraphs.mmd => knsv2-27-flowchart-dagre-lr-subgraphs.mmd} (89%) rename e2e/platform/dev-diagrams/knsv/{knsv2-28-flowchart-elk-lr.mmd => knsv2-28-flowchart-dagre-lr.mmd} (75%) rename e2e/platform/dev-diagrams/knsv/{knsv2-29-flowchart-elk-lr-subgraphs.mmd => knsv2-29-flowchart-dagre-lr-subgraphs.mmd} (84%) rename e2e/platform/dev-diagrams/knsv/{knsv2-30-flowchart-elk-lr-shapes.mmd => knsv2-30-flowchart-dagre-lr-shapes.mmd} (94%) diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-06-flowchart-elk-ogdc-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-06-flowchart-dagre-ogdc-tb-subgraphs.mmd similarity index 100% rename from e2e/platform/dev-diagrams/knsv/knsv2-06-flowchart-elk-ogdc-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-06-flowchart-dagre-ogdc-tb-subgraphs.mmd diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-elk-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-dagre-tb-subgraphs.mmd similarity index 93% rename from e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-elk-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-dagre-tb-subgraphs.mmd index b6f02ddf946..4bb6aab88bf 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-elk-tb-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-07-flowchart-dagre-tb-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart TB diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-elk-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-dagre-tb-subgraphs.mmd similarity index 94% rename from e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-elk-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-dagre-tb-subgraphs.mmd index 87a2f1aef34..59867636b0f 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-elk-tb-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-08-flowchart-dagre-tb-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart TB subgraph container_Beta diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-elk-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-dagre-tb-subgraphs.mmd similarity index 87% rename from e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-elk-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-dagre-tb-subgraphs.mmd index 8d14d46cc3d..d0dacc3871a 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-elk-tb-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-09-flowchart-dagre-tb-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart TB subgraph container_Beta diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-elk-elk-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-dagre-tb-subgraphs.mmd similarity index 85% rename from e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-elk-elk-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-dagre-tb-subgraphs.mmd index 06a7b460573..a52b216ad80 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-elk-elk-tb-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-12-flowchart-dagre-tb-subgraphs.mmd @@ -1,8 +1,8 @@ --- config: - layout: elk + layout: dagre --- -flowchart-elk TB +flowchart TB internet nat router diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-elk-elk-tb-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-dagre-tb-subgraphs.mmd similarity index 89% rename from e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-elk-elk-tb-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-dagre-tb-subgraphs.mmd index 606693b8bcc..d984fb88a5b 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-elk-elk-tb-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-13-flowchart-dagre-tb-subgraphs.mmd @@ -1,8 +1,8 @@ --- config: - layout: elk + layout: dagre --- -flowchart-elk TB +flowchart TB internet nat router diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-elk-tb.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd similarity index 93% rename from e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-elk-tb.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd index 2249935c407..ea8cd379ca9 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-elk-tb.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre elk: mergeEdges: false forceNodeModelOrder: false diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-elk-lr-shapes.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-dagre-lr-shapes.mmd similarity index 92% rename from e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-elk-lr-shapes.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-dagre-lr-shapes.mmd index 29f7cd389ff..a4dcbf8c0b9 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-elk-lr-shapes.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-15-flowchart-dagre-lr-shapes.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: curve: rounded --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-elk-lr-shapes.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-dagre-lr-shapes.mmd similarity index 90% rename from e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-elk-lr-shapes.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-dagre-lr-shapes.mmd index e23d22ac244..28f94bfcc30 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-elk-lr-shapes.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-17-flowchart-dagre-lr-shapes.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: curve: linear --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-elk-lr-shapes.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-dagre-lr-shapes.mmd similarity index 91% rename from e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-elk-lr-shapes.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-dagre-lr-shapes.mmd index 23a9b5c27fc..45231cec227 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-elk-lr-shapes.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-18-flowchart-dagre-lr-shapes.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: curve: linear --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-elk-lr-shapes.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-dagre-lr-shapes.mmd similarity index 92% rename from e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-elk-lr-shapes.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-dagre-lr-shapes.mmd index e6d41e7033a..2a8fab707c4 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-elk-lr-shapes.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-19-flowchart-dagre-lr-shapes.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: curve: rounded --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-elk-lr-shapes-node-placement.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd similarity index 93% rename from e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-elk-lr-shapes-node-placement.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd index c23268cecb3..628be4cb992 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-elk-lr-shapes-node-placement.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: curve: rounded elk: diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-elk-lr-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-dagre-lr-subgraphs.mmd similarity index 87% rename from e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-elk-lr-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-dagre-lr-subgraphs.mmd index d7739b6927a..200396197d7 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-elk-lr-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-21-flowchart-dagre-lr-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-elk-lr.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-dagre-lr.mmd similarity index 88% rename from e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-elk-lr.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-dagre-lr.mmd index 291a7a56bbd..8002d412345 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-elk-lr.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-22-flowchart-dagre-lr.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre flowchart: //curve: linear --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-elk-lr-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-dagre-lr-subgraphs.mmd similarity index 93% rename from e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-elk-lr-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-dagre-lr-subgraphs.mmd index c870b87c31d..a7127f241ad 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-elk-lr-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-23-flowchart-dagre-lr-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre theme: default look: classic --- diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-elk-lr-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-dagre-lr-subgraphs.mmd similarity index 95% rename from e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-elk-lr-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-dagre-lr-subgraphs.mmd index cb98091eb35..58c09cf9e50 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-elk-lr-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-24-flowchart-dagre-lr-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR a diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-elk-lr.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-dagre-lr.mmd similarity index 89% rename from e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-elk-lr.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-dagre-lr.mmd index dc3b9fe11c3..7944ef51a12 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-elk-lr.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-25-flowchart-dagre-lr.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR a diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-elk-lr-shapes-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-dagre-lr-shapes-subgraphs.mmd similarity index 98% rename from e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-elk-lr-shapes-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-dagre-lr-shapes-subgraphs.mmd index 4b863e0dcc1..93da06e964f 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-elk-lr-shapes-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-26-flowchart-dagre-lr-shapes-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR subgraph s1["Untitled subgraph"] diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-elk-lr-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-dagre-lr-subgraphs.mmd similarity index 89% rename from e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-elk-lr-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-dagre-lr-subgraphs.mmd index 52cb1a3b213..fbdc39cf6a5 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-elk-lr-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-27-flowchart-dagre-lr-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR subgraph s1["Untitled subgraph"] diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-elk-lr.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-dagre-lr.mmd similarity index 75% rename from e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-elk-lr.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-dagre-lr.mmd index 1b7772b15fe..7de249bb655 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-elk-lr.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-28-flowchart-dagre-lr.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR A{A} --> B & C diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-elk-lr-subgraphs.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-dagre-lr-subgraphs.mmd similarity index 84% rename from e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-elk-lr-subgraphs.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-dagre-lr-subgraphs.mmd index 5dffd4758c5..29076afb0b1 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-elk-lr-subgraphs.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-29-flowchart-dagre-lr-subgraphs.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR A{A} --> B & C diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-elk-lr-shapes.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-dagre-lr-shapes.mmd similarity index 94% rename from e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-elk-lr-shapes.mmd rename to e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-dagre-lr-shapes.mmd index 9d7b8beba87..4d00c269db9 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-elk-lr-shapes.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-30-flowchart-dagre-lr-shapes.mmd @@ -1,6 +1,6 @@ --- config: - layout: elk + layout: dagre --- flowchart LR n2@{ shape: rect} From fefa1a79d47f2e54437f26f887c5d21582e20565 Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Mon, 31 Aug 2026 13:39:56 +0200 Subject: [PATCH 14/31] Changed layout in test from elk to dagre --- .../class/classDiagram-elk-v3.spec.js | 4 +-- ...rt-elk.spec.js => flowchart-dagre.spec.js} | 34 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) rename e2e/rendering/flowchart/{flowchart-elk.spec.js => flowchart-dagre.spec.js} (78%) diff --git a/e2e/rendering/class/classDiagram-elk-v3.spec.js b/e2e/rendering/class/classDiagram-elk-v3.spec.js index 94b8a0b9bed..e9cb9c6ea09 100644 --- a/e2e/rendering/class/classDiagram-elk-v3.spec.js +++ b/e2e/rendering/class/classDiagram-elk-v3.spec.js @@ -1,7 +1,7 @@ import { test } from '@playwright/test'; import { imgSnapshotTest } from '../../helpers/util.ts'; -test.describe('Class diagram V3 ELK', () => { +test.describe('Class diagram V3 Dagre', () => { test('ELK-3: should render multiple class diagrams', async ({ page }, testInfo) => { await imgSnapshotTest( page, @@ -52,7 +52,7 @@ test.describe('Class diagram V3 ELK', () => { } `, ], - { logLevel: 1, htmlLabels: true, layout: 'elk' } + { logLevel: 1, htmlLabels: true, layout: 'dagre' } ); }); }); diff --git a/e2e/rendering/flowchart/flowchart-elk.spec.js b/e2e/rendering/flowchart/flowchart-dagre.spec.js similarity index 78% rename from e2e/rendering/flowchart/flowchart-elk.spec.js rename to e2e/rendering/flowchart/flowchart-dagre.spec.js index 573e9d3ba3c..1af7d8a4c82 100644 --- a/e2e/rendering/flowchart/flowchart-elk.spec.js +++ b/e2e/rendering/flowchart/flowchart-dagre.spec.js @@ -1,19 +1,19 @@ import { test, expect } from '@playwright/test'; import { imgSnapshotTest, renderGraph, verifyNumber } from '../../helpers/util.ts'; -test.describe('Flowchart ELK', () => { - test('1-elk: should render a simple flowchart', async ({ page }, testInfo) => { +test.describe('Flowchart Dagre', () => { + test('1-dagre: should render a simple flowchart', async ({ page }, testInfo) => { await imgSnapshotTest( page, testInfo, - `flowchart-elk TD + `flowchart TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} C -->|One| D[Laptop] C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - {} + { flowchart: { defaultRenderer: 'dagre' } } ); await imgSnapshotTest( page, @@ -25,24 +25,24 @@ test.describe('Flowchart ELK', () => { C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { defaultRenderer: 'elk' } } + { flowchart: { defaultRenderer: 'dagre' } } ); }); - test('7-elk: should render a flowchart when useMaxWidth is true (default)', async ({ + test('7-dagre: should render a flowchart when useMaxWidth is true (default)', async ({ page, }, testInfo) => { await renderGraph( page, testInfo, - `flowchart-elk TD + `flowchart TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} C -->|One| D[Laptop] C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: true } } + { flowchart: { useMaxWidth: true, defaultRenderer: 'dagre' } } ); const svg = page.locator('svg'); await expect(svg).toHaveAttribute('width', '100%'); @@ -51,18 +51,20 @@ test.describe('Flowchart ELK', () => { const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join('')); verifyNumber(maxWidthValue, 380, 15); }); - test('8-elk: should render a flowchart when useMaxWidth is false', async ({ page }, testInfo) => { + test('8-dagre: should render a flowchart when useMaxWidth is false', async ({ + page, + }, testInfo) => { await renderGraph( page, testInfo, - `flowchart-elk TD + `flowchart TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} C -->|One| D[Laptop] C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] `, - { flowchart: { useMaxWidth: false } } + { flowchart: { useMaxWidth: false, defaultRenderer: 'dagre' } } ); const svg = page.locator('svg'); const width = parseFloat((await svg.getAttribute('width')) ?? '0'); @@ -70,14 +72,14 @@ test.describe('Flowchart ELK', () => { await expect(svg).not.toHaveAttribute('style'); }); - test('elk: should include classes on the edges', async ({ page }, testInfo) => { + test('dagre: should include classes on the edges', async ({ page }, testInfo) => { await renderGraph( page, testInfo, - `flowchart-elk TD + `flowchart TD A --> B --> C --> D `, - {} + { flowchart: { defaultRenderer: 'dagre' } } ); await page.locator('svg').evaluate((svg) => { const edges = svg.querySelectorAll('.edges > path'); @@ -102,7 +104,7 @@ test.describe('Title and arrow styling #4813', () => { flowchart LR A-->B A-->C`, - { layout: 'elk' } + { flowchart: { defaultRenderer: 'dagre' } } ); const titleText = await page.locator('svg text').first().textContent(); expect(titleText).toContain(titleString); @@ -118,7 +120,7 @@ test.describe('Title and arrow styling #4813', () => { B-.-oC C==xD D ~~~ A`, - { layout: 'elk' } + { flowchart: { defaultRenderer: 'dagre' } } ); await page.locator('svg').evaluate((svg) => { const edges = svg.querySelectorAll('.edges path'); From 377aade7f4768a33daf6b4d83f105ff6acdee6bd Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Mon, 31 Aug 2026 15:38:36 +0200 Subject: [PATCH 15/31] Corrected test --- scripts/screenshot-sheets.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/screenshot-sheets.spec.ts b/scripts/screenshot-sheets.spec.ts index e0e3079483c..74baa6061aa 100644 --- a/scripts/screenshot-sheets.spec.ts +++ b/scripts/screenshot-sheets.spec.ts @@ -46,7 +46,9 @@ describe('deriveGroupKey', () => { }); it('keeps each spec file in its own group, even within one folder', () => { expect(deriveGroupKey(`${FC_MAIN}/x.png`)).toBe(FC_MAIN); - expect(deriveGroupKey(`${FC}/flowchart-elk.spec.js/y.png`)).toBe(`${FC}/flowchart-elk.spec.js`); + expect(deriveGroupKey(`${FC}/flowchart-dagre.spec.js/y.png`)).toBe( + `${FC}/flowchart-dagre.spec.js` + ); }); it('groups folder-structured mmd snapshots by their diagram folder', () => { // mmd screenshots mirror the fixture path (diagrams//), so they From 6485d923a98c68506ccf739519f937fd10f34de3 Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Tue, 1 Sep 2026 09:01:26 +0200 Subject: [PATCH 16/31] Use fix of failing tsc-check from #8180 --- scripts/tsc-check.ts | 58 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/scripts/tsc-check.ts b/scripts/tsc-check.ts index 0cc9f7ab739..1000297bd52 100644 --- a/scripts/tsc-check.ts +++ b/scripts/tsc-check.ts @@ -8,10 +8,51 @@ import { execFileSync } from 'child_process'; import * as path from 'path'; import { fileURLToPath } from 'url'; import { tmpdir } from 'node:os'; +import { createRequire } from 'node:module'; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory +const require_ = createRequire(import.meta.url); + +/** + * `mermaid`'s emitted `.d.ts` files reference `type-fest` and `@types/d3` directly, so the + * throwaway project has to install them itself. Their versions are not a free choice: the + * check compiles the *published* declarations, and those were built against exactly the + * ranges `packages/mermaid/package.json` declares. + * + * They used to be written as `'*'` and a hardcoded `'^7.4.3'`, which quietly meant "whatever + * the registry serves today". That resolved `type-fest` to a major mermaid has never been + * compiled against and broke this job at random -- 5.9.0 added `Float16Array` to its + * `TypedArray` union, which does not exist under the `es2020` lib below, and `skipLibCheck` + * is deliberately off here so third-party declarations are checked too. Two runs of the same + * commit seconds apart disagreed, depending on what npm resolved. + * + * Reading the ranges from the package under test is what makes this reproducible. It is also + * what the note below the field always asked for. + */ +const MERMAID_PKG = require_('../packages/mermaid/package.json') as { + dependencies?: Record; + devDependencies?: Record; +}; + +/** + * Look in both sections: `type-fest` is a devDependency while `@types/d3` is a runtime one, + * and which section a type package sits in is not something this check should care about. + * Throw rather than emit `undefined` -- npm reads a missing range as "latest", which is the + * exact failure mode being fixed here, and it would come back silently. + */ +const typeDependency = (name: string): string => { + const range = MERMAID_PKG.dependencies?.[name] ?? MERMAID_PKG.devDependencies?.[name]; + if (!range) { + throw new Error( + `tsc-check: packages/mermaid/package.json no longer declares '${name}'. ` + + `Update scripts/tsc-check.ts to match wherever it moved.` + ); + } + return range; +}; + /** * Packages to build and import */ @@ -34,10 +75,15 @@ const SRC = { dependencies: tarballs, scripts: { build: 'tsc -b --verbose' }, devDependencies: { - // these are somewhat-unexpectedly required, and a downstream would need - // to match the real `package.json` values - 'type-fest': '*', - '@types/d3': '^7.4.3', + // these are somewhat-unexpectedly required, and a downstream needs to match the + // real `package.json` values -- see `typeDependency` + 'type-fest': typeDependency('type-fest'), + '@types/d3': typeDependency('@types/d3'), + // Deliberately unpinned: a downstream picks its own compiler, so checking against + // the current release is the signal this job exists to give. Pinning it to the + // repo's own TypeScript additionally needs `"type": "module"` here, or the + // generated `src/index.ts` is treated as CommonJS under `moduleResolution: + // nodenext` and cannot import these ESM-only packages (TS1479). typescript: '*', }, }, @@ -121,7 +167,9 @@ async function main() { for (const argv of COMMANDS) { console.warn('... in', cwd); console.warn('>>>', ...argv); - execFileSync(argv[0], argv.slice(1), { cwd }); + // `stdio: 'inherit'`, or a failure prints the compiler output as `` and + // the actual diagnostic never reaches the log. + execFileSync(argv[0], argv.slice(1), { cwd, stdio: 'inherit' }); } for (const lib of LIB) { From b9939159a1f069faa43d31798da9bd4f7353149c Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 1 Sep 2026 15:07:30 +0200 Subject: [PATCH 17/31] fix(elk): move small nodes onto the routed line instead of bending the edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #8194 fix repointed a degenerately-anchored edge at the small node's centre. But ELK, with nodeFlexibility PORT_POSITION, had already placed the node so its clamped port sat on a straight route — the node was what stood off-centre, not the edge — so the repointing bent straight verticals visibly diagonal in every fixture with an edge between a state dot and a wider node. Replace the drop-the-anchor logic with an alignment pre-pass: before any edge points are built, a node whose terminal anchor sits on a degenerate side (shorter than twice the ports-surrounding margin) is shifted along that side's axis until its centre lands on the anchor line. The edge stays exactly as routed, the appended centre point is collinear with it, and running as a pre-pass keeps every edge's view of the node position consistent regardless of processing order. First anchor wins; the nodeDb entry and the layout node move together so painting and clipping agree. --- .changeset/elk-small-node-vertical-edges.md | 5 + .../elk/__tests__/render.spec.ts | 35 ++++++ .../layout-algorithms/elk/render.ts | 111 ++++++++++++++---- 3 files changed, 131 insertions(+), 20 deletions(-) create mode 100644 .changeset/elk-small-node-vertical-edges.md diff --git a/.changeset/elk-small-node-vertical-edges.md b/.changeset/elk-small-node-vertical-edges.md new file mode 100644 index 00000000000..9bad101d286 --- /dev/null +++ b/.changeset/elk-small-node-vertical-edges.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: keep ELK edges vertical at small nodes — the node now moves onto the routed line instead of the edge bending toward the node's off-centre position diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts index 40a54473ae9..8a8f3770948 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts @@ -644,6 +644,41 @@ describe('small-node edge anchoring', () => { } }); + // ELK routes the edge straight down the big node's port line and, with + // `nodeFlexibility: PORT_POSITION`, has already placed the small node so its + // (degenerately clamped) port sits ON that line — meaning the node is what is + // off-centre, not the edge. Repointing the edge at the node centre bends a + // straight line diagonal. The fix must move the NODE onto the line instead, + // so the edge stays exactly vertical and the node is centred on it. + it('moves a small node onto the routed line instead of bending the edge', async () => { + const data = { + direction: 'TB', + config: { elk: {} }, + nodes: [ + { id: 'start', isGroup: false, width: 14, height: 14, label: 'start', shape: 'stateStart' }, + { id: 'still', isGroup: false, width: 60, height: 40, label: 'Still', shape: 'rect' }, + { id: 'end', isGroup: false, width: 14.013, height: 14, label: 'end', shape: 'stateEnd' }, + ], + edges: [ + { id: 'e1', start: 'start', end: 'still', type: 'arrow_barb' }, + { id: 'e2', start: 'still', end: 'end', type: 'arrow_barb' }, + ], + } as any; + + await runElkLayoutCore(data, elkRenderContext); + + for (const edge of data.edges as any[]) { + const xs = edge.points.map((p: any) => p.x); + for (const x of xs) { + expect(x, `edge ${edge.id} must be exactly vertical`).toBeCloseTo(xs[0], 3); + } + } + const start = data.nodes.find((node: any) => node.id === 'start'); + const end = data.nodes.find((node: any) => node.id === 'end'); + expect(start.x, 'start dot centred on its edge').toBeCloseTo(data.edges[0].points[0].x, 3); + expect(end.x, 'end dot centred on its edge').toBeCloseTo(data.edges[1].points.at(-1).x, 3); + }); + // The drop is side-specific: a fork/join bar is thin but long, and the side // its anchors spread along (the width, for a top/bottom attachment) is well // above the margin threshold. Its anchors carry real information — two diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 2da45260973..3dfebff9c3c 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -146,9 +146,9 @@ const DEFAULT_NODE_PLACEMENT_ALIGNMENT = 'NONE'; /** * Margin reserved at the ends of each side of a node, so that a port cannot be - * placed on a corner. `anchorOnDegenerateSide` treats a side shorter than twice - * this as having no usable anchor span, so the option string below is built - * from it — the two must not be able to disagree. + * placed on a corner. `alignDegenerateNodeToAnchor` treats a side shorter than + * twice this as having no usable anchor span, so the option string below is + * built from it — the two must not be able to disagree. */ const PORTS_SURROUNDING_MARGIN = 12; /** The margin spelled as an ELK margin, because `spacing.portsSurrounding` takes one. */ @@ -1662,6 +1662,44 @@ function applyElkEdgeLayout( // Opt-out rather than opt-in: the step this removes is never intentional. const straightenEdges = data4Layout.config.elk?.straightenEdges !== false; + // Alignment pre-pass: move degenerately-anchored small nodes onto their routed + // lines BEFORE any edge points are built, so every edge — whichever side of the + // node it attaches to, in whatever order the loop visits it — sees the node at + // its final position. See `alignDegenerateNodeToAnchor` for why the node moves + // and the edge does not. + const layoutNodeById = new Map(data4Layout.nodes.map((node) => [node.id, node])); + const alignedNodes = new Set(); + graph.edges?.forEach((edge) => { + if (!edge.sections?.length) { + return; + } + const startNode = layoutState.nodeDb[edge.sources?.[0] ?? edge.start]; + const endNode = layoutState.nodeDb[edge.targets?.[0] ?? edge.end]; + if (!startNode || !endNode) { + return; + } + const sourceId = edge.start ?? edge.sourceId ?? edge.sources?.[0]; + const targetId = edge.end ?? edge.targetId ?? edge.targets?.[0]; + const offset = calcOffset(sourceId, targetId, layoutState.parentLookupDb, layoutState.nodeDb); + const section = edge.sections[0]; + if (startNode.shape !== 'rect33') { + alignDegenerateNodeToAnchor( + startNode, + { x: section.startPoint.x + offset.x, y: section.startPoint.y + offset.y }, + layoutNodeById, + alignedNodes + ); + } + if (endNode.shape !== 'rect33') { + alignDegenerateNodeToAnchor( + endNode, + { x: section.endPoint.x + offset.x, y: section.endPoint.y + offset.y }, + layoutNodeById, + alignedNodes + ); + } + }); + graph.edges?.forEach((edge) => { const layoutEdge = edgeById.get(edge.id); if (!layoutEdge) { @@ -1726,16 +1764,10 @@ function applyElkEdgeLayout( endNode.y = endNode.offset!.posY + endNode.height! / 2; if (startNode.shape !== 'rect33') { - if (points.length > 1 && anchorOnDegenerateSide(startNode, points[0])) { - points.shift(); - } points.unshift({ x: startNode.x, y: startNode.y }); } if (endNode.shape !== 'rect33') { - if (points.length > 1 && anchorOnDegenerateSide(endNode, points[points.length - 1])) { - points.pop(); - } points.push({ x: endNode.x, y: endNode.y }); } @@ -1763,27 +1795,66 @@ function applyElkEdgeLayout( /** * ELK reserves `PORTS_SURROUNDING_MARGIN` at both ends of a node side before * distributing edge anchors along it (see `PORTS_SURROUNDING`). On a side - * shorter than twice that margin the usable span is negative, and ELK's - * clamping parks the anchor off-centre — a 14px start/end state circle got - * its only edge attached 3px off the dot's centre, and no node-level option - * overrides it (the spacing is only read per hierarchy level). Such an anchor - * carries no information, so the caller drops it and lets the edge aim at the - * node centre instead; the border clip then lands it dead centre, the same - * way the dagre pipeline attaches edges. + * shorter than twice that margin the usable span is negative and ELK's clamping + * parks the anchor off-centre — a 14px start/end state circle gets its edge + * attached ~3px off the dot's centre, and no node-level option overrides it + * (the spacing is only read per hierarchy level). + * + * The anchor's position along the side is garbage, but its LINE is not: with + * `nodeFlexibility: PORT_POSITION` ELK has already placed the node so this + * clamped port sits on a straight route — so it is the node that stands + * off-centre, not the edge. An earlier fix repointed the edge at the node's + * centre, which bent ELK's straight verticals visibly diagonal (every fixture + * with `[*] --> SomeState` showed it). Move the NODE instead: shift it along + * the side's axis until its centre sits on the anchor line. The edge stays + * exactly as routed, and the appended centre point is collinear with it. + * + * The shift is at most half the side (≲4px on a state dot), first anchor wins + * (later anchors on a degenerate side land on the same clamped point), and both + * the nodeDb entry and the layout node move so painting and clipping agree. */ -function anchorOnDegenerateSide(node: NodeWithVertex, anchor: P): boolean { +function alignDegenerateNodeToAnchor( + node: NodeWithVertex, + anchor: P, + layoutNodeById: Map, + alignedNodes: Set +): void { const width = node.width ?? 0; const height = node.height ?? 0; const top = node.offset!.posY; const bottom = top + height; // ELK puts the anchor exactly on the border; the slack only absorbs float - // error from the offset arithmetic above. Same tolerance `onBorder` uses. + // error from the offset arithmetic. Same tolerance `onBorder` uses. const tol = 0.5; // An anchor on the top or bottom border spreads along the width; one on the // left or right border spreads along the height. const alongWidth = Math.abs(anchor.y - top) <= tol || Math.abs(anchor.y - bottom) <= tol; - const side = alongWidth ? width : height; - return side < 2 * PORTS_SURROUNDING_MARGIN; + if ((alongWidth ? width : height) >= 2 * PORTS_SURROUNDING_MARGIN) { + return; + } + if (alignedNodes.has(node.id)) { + return; + } + alignedNodes.add(node.id); + + const delta = alongWidth + ? anchor.x - (node.offset!.posX + width / 2) + : anchor.y - (node.offset!.posY + height / 2); + if (Math.abs(delta) < 0.01) { + return; + } + if (alongWidth) { + node.offset!.posX += delta; + node.x = node.offset!.posX + width / 2; + } else { + node.offset!.posY += delta; + node.y = node.offset!.posY + height / 2; + } + const layoutNode = layoutNodeById.get(node.id); + if (layoutNode) { + layoutNode.x = node.offset!.posX + width / 2; + layoutNode.y = node.offset!.posY + height / 2; + } } function createEdgePointsFromSection(section: any, offset: { x: number; y: number }): P[] { From a240b8f9ee9dbdb43d67c10dce1b3c297746851c Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Wed, 2 Sep 2026 10:39:36 +0200 Subject: [PATCH 18/31] Addressed review comments --- ...dagre-should-render-a-full-class-diagram-using-dagre.mmd} | 0 .../dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd | 5 ----- .../knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd | 2 -- 3 files changed, 7 deletions(-) rename e2e/diagrams/class-diagram/dagre/{dagre-should-render-a-full-class-diagram-using-elk.mmd => dagre-should-render-a-full-class-diagram-using-dagre.mmd} (100%) diff --git a/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd b/e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-dagre.mmd similarity index 100% rename from e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-elk.mmd rename to e2e/diagrams/class-diagram/dagre/dagre-should-render-a-full-class-diagram-using-dagre.mmd diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd index ea8cd379ca9..e8280d7f770 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-14-flowchart-dagre-tb.mmd @@ -1,11 +1,6 @@ --- config: layout: dagre - elk: - mergeEdges: false - forceNodeModelOrder: false - considerModelOrder: NONE - --- flowchart TB a --> a1 & a2 & a3 & a4 diff --git a/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd b/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd index 628be4cb992..245c60c9366 100644 --- a/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd +++ b/e2e/platform/dev-diagrams/knsv/knsv2-20-flowchart-dagre-lr-shapes-node-placement.mmd @@ -3,8 +3,6 @@ config: layout: dagre flowchart: curve: rounded - elk: - nodePlacementStrategy: NETWORK_SIMPLEX --- flowchart LR D["Use the editor"] -- Mermaid js --> I["fa:fa-code Text"] From 23a12a9186e4f89ab001352dd544e219048e1279 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2026 12:43:14 +0000 Subject: [PATCH 19/31] [autofix.ci] apply automated fixes --- docs/config/setup/README.md | 17 +++ docs/config/setup/config/README.md | 31 +++++ .../setup/config/functions/addDirective.md | 29 +++++ .../config/setup/config/functions/evaluate.md | 31 +++++ .../setup/config/functions/getConfig.md | 28 +++++ .../functions/getEffectiveHtmlLabels.md | 31 +++++ .../setup/config/functions/getSiteConfig.md | 23 ++++ .../config/functions/getUserDefinedConfig.md | 19 +++ docs/config/setup/config/functions/reset.md | 30 +++++ .../config/setup/config/functions/sanitize.md | 33 +++++ .../functions/saveConfigFromInitialize.md | 25 ++++ .../setup/config/functions/setConfig.md | 36 ++++++ .../config/functions/setDiagramConfigScope.md | 29 +++++ .../setup/config/functions/setSiteConfig.md | 34 +++++ .../config/functions/updateSiteConfig.md | 25 ++++ .../setup/config/variables/defaultConfig.md | 15 +++ docs/config/setup/defaultConfig/README.md | 16 +++ .../defaultConfig/variables/configKeys.md | 15 +++ .../setup/defaultConfig/variables/default.md | 21 ++++ .../mermaid/functions/applyLineJumpsToSvg.md | 2 +- .../functions/clearLayoutRenderState.md | 2 +- .../functions/createCommonLayoutRenderer.md | 2 +- .../mermaid/functions/defaultMeasureLayout.md | 2 +- .../mermaid/functions/paintLayoutData.md | 2 +- .../mermaid/interfaces/AsyncIconLoader.md | 6 +- .../interfaces/CommonLayoutPaintContext.md | 12 +- .../interfaces/CommonLayoutPaintOptions.md | 16 +-- .../interfaces/CommonLayoutRenderContext.md | 10 +- .../CommonLayoutRendererDefinition.md | 14 +-- .../setup/mermaid/interfaces/DetailedError.md | 10 +- .../setup/mermaid/interfaces/EdgeGeom.md | 12 +- .../interfaces/ExternalDiagramDefinition.md | 8 +- .../setup/mermaid/interfaces/LayoutData.md | 10 +- .../interfaces/LayoutLoaderDefinition.md | 8 +- .../mermaid/interfaces/LineJumpConfig.md | 8 +- .../setup/mermaid/interfaces/Mermaid.md | 32 ++--- .../setup/mermaid/interfaces/MermaidConfig.md | 118 +++++++++--------- .../setup/mermaid/interfaces/ParseOptions.md | 4 +- .../setup/mermaid/interfaces/ParseResult.md | 6 +- .../setup/mermaid/interfaces/RenderOptions.md | 4 +- .../setup/mermaid/interfaces/RenderResult.md | 8 +- .../setup/mermaid/interfaces/RunOptions.md | 10 +- .../mermaid/interfaces/SyncIconLoader.md | 6 +- .../mermaid/interfaces/UnknownDiagramError.md | 2 +- .../type-aliases/CommonLayoutMeasure.md | 2 +- .../setup/mermaid/type-aliases/IconLoader.md | 2 +- .../mermaid/type-aliases/InternalHelpers.md | 2 +- .../type-aliases/ParseErrorFunction.md | 2 +- docs/config/setup/mermaid/type-aliases/SVG.md | 2 +- .../setup/mermaid/type-aliases/SVGGroup.md | 2 +- .../config/setup/mermaid/variables/default.md | 2 +- 51 files changed, 652 insertions(+), 164 deletions(-) create mode 100644 docs/config/setup/README.md create mode 100644 docs/config/setup/config/README.md create mode 100644 docs/config/setup/config/functions/addDirective.md create mode 100644 docs/config/setup/config/functions/evaluate.md create mode 100644 docs/config/setup/config/functions/getConfig.md create mode 100644 docs/config/setup/config/functions/getEffectiveHtmlLabels.md create mode 100644 docs/config/setup/config/functions/getSiteConfig.md create mode 100644 docs/config/setup/config/functions/getUserDefinedConfig.md create mode 100644 docs/config/setup/config/functions/reset.md create mode 100644 docs/config/setup/config/functions/sanitize.md create mode 100644 docs/config/setup/config/functions/saveConfigFromInitialize.md create mode 100644 docs/config/setup/config/functions/setConfig.md create mode 100644 docs/config/setup/config/functions/setDiagramConfigScope.md create mode 100644 docs/config/setup/config/functions/setSiteConfig.md create mode 100644 docs/config/setup/config/functions/updateSiteConfig.md create mode 100644 docs/config/setup/config/variables/defaultConfig.md create mode 100644 docs/config/setup/defaultConfig/README.md create mode 100644 docs/config/setup/defaultConfig/variables/configKeys.md create mode 100644 docs/config/setup/defaultConfig/variables/default.md diff --git a/docs/config/setup/README.md b/docs/config/setup/README.md new file mode 100644 index 00000000000..77dadc8847d --- /dev/null +++ b/docs/config/setup/README.md @@ -0,0 +1,17 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/README.md](../../../packages/mermaid/src/docs/config/setup/README.md). + +**mermaid** + +--- + +# mermaid + +## Modules + +- [config](config/README.md) +- [defaultConfig](defaultConfig/README.md) +- [mermaid](mermaid/README.md) diff --git a/docs/config/setup/config/README.md b/docs/config/setup/config/README.md new file mode 100644 index 00000000000..6957ba5dd92 --- /dev/null +++ b/docs/config/setup/config/README.md @@ -0,0 +1,31 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/README.md](../../../../packages/mermaid/src/docs/config/setup/config/README.md). + +[**mermaid**](../README.md) + +--- + +# config + +## Variables + +- [defaultConfig](variables/defaultConfig.md) + +## Functions + +- [addDirective](functions/addDirective.md) +- [evaluate](functions/evaluate.md) +- [getConfig](functions/getConfig.md) +- [getEffectiveHtmlLabels](functions/getEffectiveHtmlLabels.md) +- [getSiteConfig](functions/getSiteConfig.md) +- [getUserDefinedConfig](functions/getUserDefinedConfig.md) +- [reset](functions/reset.md) +- [sanitize](functions/sanitize.md) +- [saveConfigFromInitialize](functions/saveConfigFromInitialize.md) +- [~~setConfig~~](functions/setConfig.md) +- [setDiagramConfigScope](functions/setDiagramConfigScope.md) +- [setSiteConfig](functions/setSiteConfig.md) +- [updateSiteConfig](functions/updateSiteConfig.md) diff --git a/docs/config/setup/config/functions/addDirective.md b/docs/config/setup/config/functions/addDirective.md new file mode 100644 index 00000000000..9b4616db1f7 --- /dev/null +++ b/docs/config/setup/config/functions/addDirective.md @@ -0,0 +1,29 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/addDirective.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/addDirective.md). + +[**mermaid**](../../README.md) + +--- + +# Function: addDirective() + +> **addDirective**(`directive`): `void` + +Defined in: [packages/mermaid/src/config.ts:277](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L277) + +Pushes in a directive to the configuration + +## Parameters + +### directive + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The directive to push in + +## Returns + +`void` diff --git a/docs/config/setup/config/functions/evaluate.md b/docs/config/setup/config/functions/evaluate.md new file mode 100644 index 00000000000..b40b6de8b61 --- /dev/null +++ b/docs/config/setup/config/functions/evaluate.md @@ -0,0 +1,31 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/evaluate.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/evaluate.md). + +[**mermaid**](../../README.md) + +--- + +# Function: evaluate() + +> **evaluate**(`val?`): `boolean` + +Defined in: [packages/mermaid/src/config.ts:62](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L62) + +Converts a string/boolean into a boolean + +## Parameters + +### val? + +String or boolean to convert + +`string` | `boolean` | `null` + +## Returns + +`boolean` + +The result from the input diff --git a/docs/config/setup/config/functions/getConfig.md b/docs/config/setup/config/functions/getConfig.md new file mode 100644 index 00000000000..7bfd5d5add3 --- /dev/null +++ b/docs/config/setup/config/functions/getConfig.md @@ -0,0 +1,28 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/getConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/getConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Function: getConfig() + +> **getConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:224](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L224) + +Returns a copy of the `currentConfig`. + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The currentConfig + +## Remarks + +Avoid calling this function repeatedly. +Instead, store the result in a variable and use it, and pass it down to function calls. diff --git a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md new file mode 100644 index 00000000000..42944fcd919 --- /dev/null +++ b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md @@ -0,0 +1,31 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/getEffectiveHtmlLabels.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/getEffectiveHtmlLabels.md). + +[**mermaid**](../../README.md) + +--- + +# Function: getEffectiveHtmlLabels() + +> **getEffectiveHtmlLabels**(`config`): `boolean` + +Defined in: [packages/mermaid/src/config.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L352) + +Helper function to handle deprecated flowchart.htmlLabels + +## Parameters + +### config + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The configuration object (merged config with defaults) + +## Returns + +`boolean` + +The effective htmlLabels value based on precedence: root flowchart default diff --git a/docs/config/setup/config/functions/getSiteConfig.md b/docs/config/setup/config/functions/getSiteConfig.md new file mode 100644 index 00000000000..ceed814fa5f --- /dev/null +++ b/docs/config/setup/config/functions/getSiteConfig.md @@ -0,0 +1,23 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/getSiteConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/getSiteConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Function: getSiteConfig() + +> **getSiteConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:198](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L198) + +Returns a copy of the current `siteConfig` base configuration. + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The siteConfig diff --git a/docs/config/setup/config/functions/getUserDefinedConfig.md b/docs/config/setup/config/functions/getUserDefinedConfig.md new file mode 100644 index 00000000000..9b3e20f1167 --- /dev/null +++ b/docs/config/setup/config/functions/getUserDefinedConfig.md @@ -0,0 +1,19 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/getUserDefinedConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/getUserDefinedConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Function: getUserDefinedConfig() + +> **getUserDefinedConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L333) + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) diff --git a/docs/config/setup/config/functions/reset.md b/docs/config/setup/config/functions/reset.md new file mode 100644 index 00000000000..6433ae1eb09 --- /dev/null +++ b/docs/config/setup/config/functions/reset.md @@ -0,0 +1,30 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/reset.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/reset.md). + +[**mermaid**](../../README.md) + +--- + +# Function: reset() + +> **reset**(`config`): `void` + +Defined in: [packages/mermaid/src/config.ts:298](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L298) + +Resets the current config and applied directives to the provided config. + +## Parameters + +### config + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) = `siteConfig` + +the value to reset the `currentConfig` to. +Defaults to the current `siteConfig` (e.g the value returned by [getSiteConfig](getSiteConfig.md)). + +## Returns + +`void` diff --git a/docs/config/setup/config/functions/sanitize.md b/docs/config/setup/config/functions/sanitize.md new file mode 100644 index 00000000000..1915ed847bb --- /dev/null +++ b/docs/config/setup/config/functions/sanitize.md @@ -0,0 +1,33 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/sanitize.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/sanitize.md). + +[**mermaid**](../../README.md) + +--- + +# Function: sanitize() + +> **sanitize**(`options`): `void` + +Defined in: [packages/mermaid/src/config.ts:235](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L235) + +Ensures options parameter does not attempt to override `siteConfig` secure keys. + +## Parameters + +### options + +`any` + +The potential `setConfig` parameter + +## Returns + +`void` + +## Remarks + +Modifies options in-place. diff --git a/docs/config/setup/config/functions/saveConfigFromInitialize.md b/docs/config/setup/config/functions/saveConfigFromInitialize.md new file mode 100644 index 00000000000..2595da06f20 --- /dev/null +++ b/docs/config/setup/config/functions/saveConfigFromInitialize.md @@ -0,0 +1,25 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/saveConfigFromInitialize.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/saveConfigFromInitialize.md). + +[**mermaid**](../../README.md) + +--- + +# Function: saveConfigFromInitialize() + +> **saveConfigFromInitialize**(`conf`): `void` + +Defined in: [packages/mermaid/src/config.ts:181](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L181) + +## Parameters + +### conf + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +## Returns + +`void` diff --git a/docs/config/setup/config/functions/setConfig.md b/docs/config/setup/config/functions/setConfig.md new file mode 100644 index 00000000000..4dba1581080 --- /dev/null +++ b/docs/config/setup/config/functions/setConfig.md @@ -0,0 +1,36 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/setConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/setConfig.md). + +[**mermaid**](../../README.md) + +--- + +# ~~Function: setConfig()~~ + +> **setConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:210](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L210) + +Updates the `currentConfig` with the provided `conf` after sanitization. + +## Parameters + +### conf + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The potential currentConfig + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The currentConfig merged with the sanitized conf + +## Deprecated + +Any changes to the `currentConfig` would be overwritten by the +next call to [addDirective](addDirective.md) or [reset](reset.md). diff --git a/docs/config/setup/config/functions/setDiagramConfigScope.md b/docs/config/setup/config/functions/setDiagramConfigScope.md new file mode 100644 index 00000000000..9e3cb4f0610 --- /dev/null +++ b/docs/config/setup/config/functions/setDiagramConfigScope.md @@ -0,0 +1,29 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/setDiagramConfigScope.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/setDiagramConfigScope.md). + +[**mermaid**](../../README.md) + +--- + +# Function: setDiagramConfigScope() + +> **setDiagramConfigScope**(`diagramType?`): `void` + +Defined in: [packages/mermaid/src/config.ts:150](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L150) + +Names the diagram type being parsed or rendered, so its own appearance defaults apply. + +## Parameters + +### diagramType? + +`string` + +The type `detectType` returned, e.g. `flowchart-v2`; `undefined` to leave scope. + +## Returns + +`void` diff --git a/docs/config/setup/config/functions/setSiteConfig.md b/docs/config/setup/config/functions/setSiteConfig.md new file mode 100644 index 00000000000..39c64220614 --- /dev/null +++ b/docs/config/setup/config/functions/setSiteConfig.md @@ -0,0 +1,34 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/setSiteConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/setSiteConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Function: setSiteConfig() + +> **setSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:164](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L164) + +Sets the `siteConfig` to the desired values. + +The `siteConfig` is a protected configuration for repeat use. Calls +to [reset](reset.md) will reset the `currentConfig` to `siteConfig`. + +## Parameters + +### conf + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The config to use as `siteConfig`. This will be merged with the `defaultConfig`. + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +The new siteConfig diff --git a/docs/config/setup/config/functions/updateSiteConfig.md b/docs/config/setup/config/functions/updateSiteConfig.md new file mode 100644 index 00000000000..3ee515e24f9 --- /dev/null +++ b/docs/config/setup/config/functions/updateSiteConfig.md @@ -0,0 +1,25 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/functions/updateSiteConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/functions/updateSiteConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Function: updateSiteConfig() + +> **updateSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:185](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L185) + +## Parameters + +### conf + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +## Returns + +[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) diff --git a/docs/config/setup/config/variables/defaultConfig.md b/docs/config/setup/config/variables/defaultConfig.md new file mode 100644 index 00000000000..c351c83d350 --- /dev/null +++ b/docs/config/setup/config/variables/defaultConfig.md @@ -0,0 +1,15 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/config/variables/defaultConfig.md](../../../../../packages/mermaid/src/docs/config/setup/config/variables/defaultConfig.md). + +[**mermaid**](../../README.md) + +--- + +# Variable: defaultConfig + +> `const` **defaultConfig**: [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) + +Defined in: [packages/mermaid/src/config.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L9) diff --git a/docs/config/setup/defaultConfig/README.md b/docs/config/setup/defaultConfig/README.md new file mode 100644 index 00000000000..8554f8a8c84 --- /dev/null +++ b/docs/config/setup/defaultConfig/README.md @@ -0,0 +1,16 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/defaultConfig/README.md](../../../../packages/mermaid/src/docs/config/setup/defaultConfig/README.md). + +[**mermaid**](../README.md) + +--- + +# defaultConfig + +## Variables + +- [configKeys](variables/configKeys.md) +- [default](variables/default.md) diff --git a/docs/config/setup/defaultConfig/variables/configKeys.md b/docs/config/setup/defaultConfig/variables/configKeys.md new file mode 100644 index 00000000000..49a59f48597 --- /dev/null +++ b/docs/config/setup/defaultConfig/variables/configKeys.md @@ -0,0 +1,15 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/defaultConfig/variables/configKeys.md](../../../../../packages/mermaid/src/docs/config/setup/defaultConfig/variables/configKeys.md). + +[**mermaid**](../../README.md) + +--- + +# Variable: configKeys + +> `const` **configKeys**: `Set`<`string`> + +Defined in: [packages/mermaid/src/defaultConfig.ts:358](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L358) diff --git a/docs/config/setup/defaultConfig/variables/default.md b/docs/config/setup/defaultConfig/variables/default.md new file mode 100644 index 00000000000..ccb6d130231 --- /dev/null +++ b/docs/config/setup/defaultConfig/variables/default.md @@ -0,0 +1,21 @@ +> **Warning** +> +> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. +> +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/setup/defaultConfig/variables/default.md](../../../../../packages/mermaid/src/docs/config/setup/defaultConfig/variables/default.md). + +[**mermaid**](../../README.md) + +--- + +# Variable: default + +> `const` **default**: `RequiredDeep`<[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)> + +Defined in: [packages/mermaid/src/defaultConfig.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L18) + +Default mermaid configuration options. + +Please see the Mermaid config JSON Schema for the default JSON values. +Non-JSON JS default values are listed in this file, e.g. functions, or +`undefined` (explicitly set so that `configKeys` finds them). diff --git a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md index 56750531427..18e5320b618 100644 --- a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md +++ b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md @@ -12,7 +12,7 @@ > **applyLineJumpsToSvg**(`edgePathsGroup`, `edges`, `config`): `void` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L646) Patches the rendered SVG paths in `edgePathsGroup` for any edges that cross. The true geometry is read from each path's `data-points` attribute diff --git a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md index c3894f099c0..4b3074ad135 100644 --- a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md +++ b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md @@ -12,7 +12,7 @@ > **clearLayoutRenderState**(): `void` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L207) ## Returns diff --git a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md index a237aba61c7..196bcc2011c 100644 --- a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md +++ b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md @@ -12,7 +12,7 @@ > **createCommonLayoutRenderer**<`CoreResult`, `PreparedLayout`, `MeasureResult`>(`__namedParameters`): (`data4Layout`, `svg`, `helpers?`, `options?`) => `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L108) ## Type Parameters diff --git a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md index 1f22dcd817a..7b000c68209 100644 --- a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md +++ b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md @@ -12,7 +12,7 @@ > **defaultMeasureLayout**(`data4Layout`, `__namedParameters`, `options?`): `Promise`<{ `graph`: `Graph`; `groups`: { `clusters`: `D3Selection`<`SVGGElement`>; `edgeLabels`: `D3Selection`<`SVGGElement`>; `edgePaths`: `D3Selection`<`SVGGElement`>; `nodes`: `D3Selection`<`SVGGElement`>; `rootGroups`: `D3Selection`<`SVGGElement`>; }; `nodeElements`: `Map`<`string`, `D3Selection`<`SVGElement` | `SVGGElement`>>; }> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L214) ## Parameters diff --git a/docs/config/setup/mermaid/functions/paintLayoutData.md b/docs/config/setup/mermaid/functions/paintLayoutData.md index 968edfed6c6..a530379b9b1 100644 --- a/docs/config/setup/mermaid/functions/paintLayoutData.md +++ b/docs/config/setup/mermaid/functions/paintLayoutData.md @@ -12,7 +12,7 @@ > **paintLayoutData**(`data4Layout`, `context`, `options`): `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L222) ## Parameters diff --git a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md index 6de9e44c956..31912c30c5e 100644 --- a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: AsyncIconLoader -Defined in: packages/mermaid/src/rendering-util/icons.ts:8 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L8) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:8 > **loader**: () => `Promise`<`IconifyJSON`> -Defined in: packages/mermaid/src/rendering-util/icons.ts:10 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:10](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L10) #### Returns @@ -30,4 +30,4 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:10 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/icons.ts:9 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L9) diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md index 98523e59e40..0e8edc39956 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintContext\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L48) ## Extends @@ -32,7 +32,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **element**: `D3Selection`<`SVGElement`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) #### Inherited from @@ -44,7 +44,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **helpers**: `object` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) #### common @@ -491,7 +491,7 @@ The curve factory to use > **measure**: `MeasureResult` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L52) --- @@ -499,7 +499,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) #### Inherited from @@ -511,7 +511,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **preparedLayout**: `PreparedLayout` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) #### Inherited from diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md index 37c6da3d1ed..438318ae983 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintOptions -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L55) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **clusterDb**: `ClusterDb` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L56) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **getEdgeNode**: (`id`, `edge`, `context`) => `object` | `Node` | `undefined` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L61) #### Parameters @@ -52,7 +52,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **getNodes**: (`data4Layout`, `context`) => `Iterable`<`Node`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L57) #### Parameters @@ -74,7 +74,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **isCluster**: (`node`, `context`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L70) #### Parameters @@ -96,7 +96,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipEdge**: (`edge`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L74) #### Parameters @@ -114,7 +114,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipIntersect**: `boolean` | (`edge`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L75) --- @@ -122,7 +122,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipNode**: (`node`, `context`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L66) #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md index ab1ba26bb3e..3116812f52b 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRenderContext\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L41) ## Extended by @@ -28,7 +28,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **element**: `D3Selection`<`SVGElement`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) --- @@ -36,7 +36,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **helpers**: `object` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) #### common @@ -479,7 +479,7 @@ The curve factory to use > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) --- @@ -487,4 +487,4 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **preparedLayout**: `PreparedLayout` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md index 1899d77d4d7..f1b13deb837 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRendererDefinition\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L78) ## Type Parameters @@ -32,7 +32,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **afterPaint**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L100) #### Parameters @@ -58,7 +58,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **measureLayout**: (`data4Layout`, `context`) => `Promise`<`MeasureResult`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L87) #### Parameters @@ -80,7 +80,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **paintLayout**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L95) #### Parameters @@ -106,7 +106,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **paintOptions**: [`CommonLayoutPaintOptions`](CommonLayoutPaintOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L105) --- @@ -114,7 +114,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **prepareLayout**: (`data4Layout`, `context`) => `PreparedLayout` | `Promise`<`PreparedLayout`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L83) #### Parameters @@ -136,7 +136,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **runLayoutCore**: (`data4Layout`, `context`) => `CoreResult` | `Promise`<`CoreResult`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L91) #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/DetailedError.md b/docs/config/setup/mermaid/interfaces/DetailedError.md index 8744001478b..4a34e6534b9 100644 --- a/docs/config/setup/mermaid/interfaces/DetailedError.md +++ b/docs/config/setup/mermaid/interfaces/DetailedError.md @@ -10,7 +10,7 @@ # Interface: DetailedError -Defined in: packages/mermaid/src/utils.ts:782 +Defined in: [packages/mermaid/src/utils.ts:782](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L782) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/utils.ts:782 > `optional` **error**: `any` -Defined in: packages/mermaid/src/utils.ts:787 +Defined in: [packages/mermaid/src/utils.ts:787](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L787) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/utils.ts:787 > **hash**: `any` -Defined in: packages/mermaid/src/utils.ts:785 +Defined in: [packages/mermaid/src/utils.ts:785](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L785) --- @@ -34,7 +34,7 @@ Defined in: packages/mermaid/src/utils.ts:785 > `optional` **message**: `string` -Defined in: packages/mermaid/src/utils.ts:788 +Defined in: [packages/mermaid/src/utils.ts:788](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L788) --- @@ -42,4 +42,4 @@ Defined in: packages/mermaid/src/utils.ts:788 > **str**: `string` -Defined in: packages/mermaid/src/utils.ts:783 +Defined in: [packages/mermaid/src/utils.ts:783](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L783) diff --git a/docs/config/setup/mermaid/interfaces/EdgeGeom.md b/docs/config/setup/mermaid/interfaces/EdgeGeom.md index 00e298c579e..26d14f335bb 100644 --- a/docs/config/setup/mermaid/interfaces/EdgeGeom.md +++ b/docs/config/setup/mermaid/interfaces/EdgeGeom.md @@ -10,7 +10,7 @@ # Interface: EdgeGeom -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L56) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:5 > `optional` **arrowTypeEnd**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L72) Arrow type at the end (last point). @@ -28,7 +28,7 @@ Arrow type at the end (last point). > `optional` **arrowTypeStart**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L70) Arrow type at the start (first point) — used to apply marker offset so the rewritten path's endpoint matches the original rendered geometry and @@ -40,7 +40,7 @@ the arrow marker orients correctly. > `optional` **curve**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L66) Optional curve hint matching `edge.curve` from the rendering layer. When set, line jumps are only applied for orthogonal-friendly curves @@ -54,7 +54,7 @@ corrupting smoothed geometry. > **id**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L57) --- @@ -62,4 +62,4 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:5 > **points**: `Point`\[] -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L58) diff --git a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md index be1dbebcd63..7f9700cd661 100644 --- a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md +++ b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md @@ -10,7 +10,7 @@ # Interface: ExternalDiagramDefinition -Defined in: packages/mermaid/src/diagram-api/types.ts:139 +Defined in: [packages/mermaid/src/diagram-api/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L139) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:139 > **detector**: `DiagramDetector` -Defined in: packages/mermaid/src/diagram-api/types.ts:141 +Defined in: [packages/mermaid/src/diagram-api/types.ts:141](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L141) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:141 > **id**: `string` -Defined in: packages/mermaid/src/diagram-api/types.ts:140 +Defined in: [packages/mermaid/src/diagram-api/types.ts:140](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L140) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:140 > **loader**: `DiagramLoader` -Defined in: packages/mermaid/src/diagram-api/types.ts:142 +Defined in: [packages/mermaid/src/diagram-api/types.ts:142](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L142) diff --git a/docs/config/setup/mermaid/interfaces/LayoutData.md b/docs/config/setup/mermaid/interfaces/LayoutData.md index c86c29f5bf5..246f6c8d7ee 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutData.md +++ b/docs/config/setup/mermaid/interfaces/LayoutData.md @@ -10,7 +10,7 @@ # Interface: LayoutData -Defined in: packages/mermaid/src/rendering-util/types.ts:217 +Defined in: [packages/mermaid/src/rendering-util/types.ts:217](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L217) ## Indexable @@ -22,7 +22,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:217 > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: packages/mermaid/src/rendering-util/types.ts:220 +Defined in: [packages/mermaid/src/rendering-util/types.ts:220](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L220) --- @@ -30,7 +30,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:220 > `optional` **diagramId**: `string` -Defined in: packages/mermaid/src/rendering-util/types.ts:221 +Defined in: [packages/mermaid/src/rendering-util/types.ts:221](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L221) --- @@ -38,7 +38,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:221 > **edges**: `Edge`\[] -Defined in: packages/mermaid/src/rendering-util/types.ts:219 +Defined in: [packages/mermaid/src/rendering-util/types.ts:219](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L219) --- @@ -46,4 +46,4 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:219 > **nodes**: `Node`\[] -Defined in: packages/mermaid/src/rendering-util/types.ts:218 +Defined in: [packages/mermaid/src/rendering-util/types.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L218) diff --git a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md index 977914fb784..e9866171c63 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md +++ b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md @@ -10,7 +10,7 @@ # Interface: LayoutLoaderDefinition -Defined in: packages/mermaid/src/rendering-util/render.ts:25 +Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:25 > `optional` **algorithm**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:28 +Defined in: [packages/mermaid/src/rendering-util/render.ts:28](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L28) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:28 > **loader**: `LayoutLoader` -Defined in: packages/mermaid/src/rendering-util/render.ts:27 +Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L27) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:27 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:26 +Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L26) diff --git a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md index d08ede700da..798fe18338c 100644 --- a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md +++ b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md @@ -10,7 +10,7 @@ # Interface: LineJumpConfig -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L75) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **enabled**: `boolean` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L76) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **jumpRadius**: `number` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L77) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **jumpStyle**: `"arc"` | `"gap"` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L78) diff --git a/docs/config/setup/mermaid/interfaces/Mermaid.md b/docs/config/setup/mermaid/interfaces/Mermaid.md index 3e54b9d6fb1..d6bacb631c3 100644 --- a/docs/config/setup/mermaid/interfaces/Mermaid.md +++ b/docs/config/setup/mermaid/interfaces/Mermaid.md @@ -10,7 +10,7 @@ # Interface: Mermaid -Defined in: packages/mermaid/src/mermaid.ts:451 +Defined in: [packages/mermaid/src/mermaid.ts:451](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L451) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/mermaid.ts:451 > **contentLoaded**: () => `void` -Defined in: packages/mermaid/src/mermaid.ts:469 +Defined in: [packages/mermaid/src/mermaid.ts:469](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L469) \##contentLoaded Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the @@ -34,7 +34,7 @@ page. > **detectType**: (`text`, `config?`) => `string` -Defined in: packages/mermaid/src/mermaid.ts:471 +Defined in: [packages/mermaid/src/mermaid.ts:471](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L471) Detects the type of the graph text. @@ -90,7 +90,7 @@ A graph definition key > **getRegisteredDiagramsMetadata**: () => `Pick`<[`ExternalDiagramDefinition`](ExternalDiagramDefinition.md), `"id"`>\[] -Defined in: packages/mermaid/src/mermaid.ts:473 +Defined in: [packages/mermaid/src/mermaid.ts:473](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L473) Gets the metadata for all registered diagrams. Currently only the id is returned. @@ -107,7 +107,7 @@ An array of objects with the id of the diagram. > **init**: (`config?`, `nodes?`, `callback?`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:464 +Defined in: [packages/mermaid/src/mermaid.ts:464](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L464) ## init @@ -155,7 +155,7 @@ Use [initialize](#initialize) and [run](#run) instead. > **initialize**: (`config`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:468 +Defined in: [packages/mermaid/src/mermaid.ts:468](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L468) Used to set configurations for mermaid. This function should be called before the run function. @@ -178,7 +178,7 @@ Configuration object for mermaid. > **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](MermaidConfig.md); `getConfig`: () => [`MermaidConfig`](MermaidConfig.md); `getDiagramFromText`: (`text`, `metadata`) => `Promise`<`Diagram`>; `getSiteConfig`: () => [`MermaidConfig`](MermaidConfig.md); `globalReset`: () => `void`; `initialize`: (`userOptions`) => `void`; `parse`: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; }; `render`: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)>; `reset`: () => `void`; `setConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); `updateSiteConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); }> -Defined in: packages/mermaid/src/mermaid.ts:458 +Defined in: [packages/mermaid/src/mermaid.ts:458](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L458) **`Internal`** @@ -192,7 +192,7 @@ Use [parse](#parse) and [render](#render) instead. Please [open a discussion](ht > **parse**: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; } -Defined in: packages/mermaid/src/mermaid.ts:459 +Defined in: [packages/mermaid/src/mermaid.ts:459](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L459) #### Call Signature @@ -268,7 +268,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not > `optional` **parseError**: [`ParseErrorFunction`](../type-aliases/ParseErrorFunction.md) -Defined in: packages/mermaid/src/mermaid.ts:453 +Defined in: [packages/mermaid/src/mermaid.ts:453](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L453) --- @@ -276,7 +276,7 @@ Defined in: packages/mermaid/src/mermaid.ts:453 > **registerExternalDiagrams**: (`diagrams`, `opts`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:467 +Defined in: [packages/mermaid/src/mermaid.ts:467](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L467) Used to register external diagram types. @@ -306,7 +306,7 @@ If opts.lazyLoad is false, the diagrams will be loaded immediately. > **registerIconPacks**: (`iconLoaders`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:472 +Defined in: [packages/mermaid/src/mermaid.ts:472](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L472) #### Parameters @@ -324,7 +324,7 @@ Defined in: packages/mermaid/src/mermaid.ts:472 > **registerLayoutLoaders**: (`loaders`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:466 +Defined in: [packages/mermaid/src/mermaid.ts:466](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L466) #### Parameters @@ -342,7 +342,7 @@ Defined in: packages/mermaid/src/mermaid.ts:466 > **render**: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)> -Defined in: packages/mermaid/src/mermaid.ts:460 +Defined in: [packages/mermaid/src/mermaid.ts:460](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L460) Renders the diagram, holding the diagram config scope for exactly as long as the render. Leaving it set would make `getConfig()` report the last diagram's appearance as the @@ -372,7 +372,7 @@ global answer for every caller between renders. > **run**: (`options`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:465 +Defined in: [packages/mermaid/src/mermaid.ts:465](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L465) ## run @@ -416,7 +416,7 @@ Optional runtime configs > **setParseErrorHandler**: (`parseErrorHandler`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:470 +Defined in: [packages/mermaid/src/mermaid.ts:470](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L470) ## setParseErrorHandler Alternative to directly setting parseError using: @@ -447,4 +447,4 @@ New parseError() callback. > **startOnLoad**: `boolean` -Defined in: packages/mermaid/src/mermaid.ts:452 +Defined in: [packages/mermaid/src/mermaid.ts:452](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L452) diff --git a/docs/config/setup/mermaid/interfaces/MermaidConfig.md b/docs/config/setup/mermaid/interfaces/MermaidConfig.md index d2cd22fdf1b..7db03bf3c61 100644 --- a/docs/config/setup/mermaid/interfaces/MermaidConfig.md +++ b/docs/config/setup/mermaid/interfaces/MermaidConfig.md @@ -10,7 +10,7 @@ # Interface: MermaidConfig -Defined in: packages/mermaid/src/config.type.ts:66 +Defined in: [packages/mermaid/src/config.type.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L66) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/config.type.ts:66 > `optional` **agentflow**: `AgentflowDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:325 +Defined in: [packages/mermaid/src/config.type.ts:325](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L325) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/config.type.ts:325 > `optional` **altFontFamily**: `string` -Defined in: packages/mermaid/src/config.type.ts:263 +Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L263) --- @@ -34,7 +34,7 @@ Defined in: packages/mermaid/src/config.type.ts:263 > `optional` **architecture**: `ArchitectureDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:337 +Defined in: [packages/mermaid/src/config.type.ts:337](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L337) --- @@ -42,7 +42,7 @@ Defined in: packages/mermaid/src/config.type.ts:337 > `optional` **arrowMarkerAbsolute**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:282 +Defined in: [packages/mermaid/src/config.type.ts:282](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L282) Controls whether or arrow markers in html code are absolute paths or anchors. This matters if you are using base tag settings. @@ -53,7 +53,7 @@ This matters if you are using base tag settings. > `optional` **block**: `BlockDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:345 +Defined in: [packages/mermaid/src/config.type.ts:345](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L345) --- @@ -61,7 +61,7 @@ Defined in: packages/mermaid/src/config.type.ts:345 > `optional` **c4**: `C4DiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:342 +Defined in: [packages/mermaid/src/config.type.ts:342](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L342) --- @@ -69,7 +69,7 @@ Defined in: packages/mermaid/src/config.type.ts:342 > `optional` **class**: `ClassDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:330 +Defined in: [packages/mermaid/src/config.type.ts:330](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L330) --- @@ -77,7 +77,7 @@ Defined in: packages/mermaid/src/config.type.ts:330 > `optional` **cynefin**: `CynefinDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:352 +Defined in: [packages/mermaid/src/config.type.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L352) --- @@ -85,7 +85,7 @@ Defined in: packages/mermaid/src/config.type.ts:352 > `optional` **darkMode**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:247 +Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247) --- @@ -93,7 +93,7 @@ Defined in: packages/mermaid/src/config.type.ts:247 > `optional` **deterministicIds**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:315 +Defined in: [packages/mermaid/src/config.type.ts:315](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L315) This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed. @@ -109,7 +109,7 @@ should not change unless content is changed. > `optional` **deterministicIDSeed**: `string` -Defined in: packages/mermaid/src/config.type.ts:322 +Defined in: [packages/mermaid/src/config.type.ts:322](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L322) This option is the optional seed for deterministic ids. If set to `undefined` but deterministicIds is `true`, a simple number iterator is used. @@ -121,7 +121,7 @@ You can set this attribute to base the seed on a static string. > `optional` **dompurifyConfig**: `Config` -Defined in: packages/mermaid/src/config.type.ts:354 +Defined in: [packages/mermaid/src/config.type.ts:354](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L354) --- @@ -129,7 +129,7 @@ Defined in: packages/mermaid/src/config.type.ts:354 > `optional` **elk**: `object` -Defined in: packages/mermaid/src/config.type.ts:114 +Defined in: [packages/mermaid/src/config.type.ts:114](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L114) #### considerModelOrder? @@ -268,7 +268,7 @@ port, or would introduce a crossing. > `optional` **er**: `ErDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:332 +Defined in: [packages/mermaid/src/config.type.ts:332](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L332) --- @@ -276,7 +276,7 @@ Defined in: packages/mermaid/src/config.type.ts:332 > `optional` **eventmodeling**: `EventModelingDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:346 +Defined in: [packages/mermaid/src/config.type.ts:346](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L346) --- @@ -284,7 +284,7 @@ Defined in: packages/mermaid/src/config.type.ts:346 > `optional` **flowchart**: `FlowchartDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:323 +Defined in: [packages/mermaid/src/config.type.ts:323](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L323) --- @@ -292,7 +292,7 @@ Defined in: packages/mermaid/src/config.type.ts:323 > `optional` **fontFamily**: `string` -Defined in: packages/mermaid/src/config.type.ts:262 +Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L262) Specifies the font to be used in the rendered diagrams. Can be any possible CSS `font-family`. @@ -304,7 +304,7 @@ See > `optional` **fontSize**: `number` -Defined in: packages/mermaid/src/config.type.ts:356 +Defined in: [packages/mermaid/src/config.type.ts:356](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L356) --- @@ -312,7 +312,7 @@ Defined in: packages/mermaid/src/config.type.ts:356 > `optional` **forceLegacyMathML**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:304 +Defined in: [packages/mermaid/src/config.type.ts:304](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L304) This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS fonts and browser's MathML implementation, this option is recommended if consistent rendering is important. @@ -324,7 +324,7 @@ If set to true, ignores legacyMathML. > `optional` **gantt**: `GanttDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:327 +Defined in: [packages/mermaid/src/config.type.ts:327](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L327) --- @@ -332,7 +332,7 @@ Defined in: packages/mermaid/src/config.type.ts:327 > `optional` **gitGraph**: `GitGraphDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:341 +Defined in: [packages/mermaid/src/config.type.ts:341](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L341) --- @@ -340,7 +340,7 @@ Defined in: packages/mermaid/src/config.type.ts:341 > `optional` **handDrawnSeed**: `number` -Defined in: packages/mermaid/src/config.type.ts:96 +Defined in: [packages/mermaid/src/config.type.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L96) Defines the seed to be used when using handDrawn look. This is important for the automated tests as they will always find differences without the seed. The default value is 0 which gives a random seed. @@ -350,7 +350,7 @@ Defines the seed to be used when using handDrawn look. This is important for the > `optional` **htmlLabels**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:255 +Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255) Flag for setting whether or not a html tag should be used for rendering labels on nodes and edges. **Note:** Diagram-specific `htmlLabels` settings (e.g., `flowchart.htmlLabels`) are deprecated. @@ -363,7 +363,7 @@ over any diagram-specific settings. > `optional` **ishikawa**: `IshikawaDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:339 +Defined in: [packages/mermaid/src/config.type.ts:339](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L339) --- @@ -371,7 +371,7 @@ Defined in: packages/mermaid/src/config.type.ts:339 > `optional` **journey**: `JourneyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:328 +Defined in: [packages/mermaid/src/config.type.ts:328](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L328) --- @@ -379,7 +379,7 @@ Defined in: packages/mermaid/src/config.type.ts:328 > `optional` **kanban**: `KanbanDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:340 +Defined in: [packages/mermaid/src/config.type.ts:340](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L340) --- @@ -387,7 +387,7 @@ Defined in: packages/mermaid/src/config.type.ts:340 > `optional` **layout**: `string` -Defined in: packages/mermaid/src/config.type.ts:104 +Defined in: [packages/mermaid/src/config.type.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L104) Defines which layout algorithm to use for rendering the diagram. @@ -400,7 +400,7 @@ ELK to stay small and falls back to `dagre`. > `optional` **legacyMathML**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:297 +Defined in: [packages/mermaid/src/config.type.ts:297](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L297) This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers without their own MathML implementation. If this option is disabled and MathML is not supported, the math @@ -413,7 +413,7 @@ fall back to legacy rendering for KaTeX. > `optional` **logLevel**: `0` | `2` | `1` | `"trace"` | `"debug"` | `"info"` | `"warn"` | `"error"` | `"fatal"` | `3` | `4` | `5` -Defined in: packages/mermaid/src/config.type.ts:268 +Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L268) This option decides the amount of logging to be used by mermaid. @@ -423,7 +423,7 @@ This option decides the amount of logging to be used by mermaid. > `optional` **look**: `"neo"` | `"classic"` | `"handDrawn"` -Defined in: packages/mermaid/src/config.type.ts:91 +Defined in: [packages/mermaid/src/config.type.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L91) Defines which main look to use for the diagram. @@ -433,7 +433,7 @@ Defines which main look to use for the diagram. > `optional` **markdownAutoWrap**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:357 +Defined in: [packages/mermaid/src/config.type.ts:357](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L357) --- @@ -441,7 +441,7 @@ Defined in: packages/mermaid/src/config.type.ts:357 > `optional` **maxEdges**: `number` -Defined in: packages/mermaid/src/config.type.ts:113 +Defined in: [packages/mermaid/src/config.type.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L113) Defines the maximum number of edges that can be drawn in a graph. @@ -451,7 +451,7 @@ Defines the maximum number of edges that can be drawn in a graph. > `optional` **maxTextSize**: `number` -Defined in: packages/mermaid/src/config.type.ts:108 +Defined in: [packages/mermaid/src/config.type.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L108) The maximum allowed size of the users text diagram @@ -461,7 +461,7 @@ The maximum allowed size of the users text diagram > `optional` **mindmap**: `MindmapDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:338 +Defined in: [packages/mermaid/src/config.type.ts:338](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L338) --- @@ -469,7 +469,7 @@ Defined in: packages/mermaid/src/config.type.ts:338 > `optional` **packet**: `PacketDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:344 +Defined in: [packages/mermaid/src/config.type.ts:344](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L344) --- @@ -477,7 +477,7 @@ Defined in: packages/mermaid/src/config.type.ts:344 > `optional` **pie**: `PieDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:333 +Defined in: [packages/mermaid/src/config.type.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L333) --- @@ -485,7 +485,7 @@ Defined in: packages/mermaid/src/config.type.ts:333 > `optional` **quadrantChart**: `QuadrantChartConfig` -Defined in: packages/mermaid/src/config.type.ts:334 +Defined in: [packages/mermaid/src/config.type.ts:334](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L334) --- @@ -493,7 +493,7 @@ Defined in: packages/mermaid/src/config.type.ts:334 > `optional` **radar**: `RadarDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:348 +Defined in: [packages/mermaid/src/config.type.ts:348](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L348) --- @@ -501,7 +501,7 @@ Defined in: packages/mermaid/src/config.type.ts:348 > `optional` **railroad**: `RailroadDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:353 +Defined in: [packages/mermaid/src/config.type.ts:353](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L353) --- @@ -509,7 +509,7 @@ Defined in: packages/mermaid/src/config.type.ts:353 > `optional` **requirement**: `RequirementDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:336 +Defined in: [packages/mermaid/src/config.type.ts:336](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L336) --- @@ -517,7 +517,7 @@ Defined in: packages/mermaid/src/config.type.ts:336 > `optional` **sankey**: `SankeyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:343 +Defined in: [packages/mermaid/src/config.type.ts:343](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L343) --- @@ -525,7 +525,7 @@ Defined in: packages/mermaid/src/config.type.ts:343 > `optional` **secure**: `string`\[] -Defined in: packages/mermaid/src/config.type.ts:289 +Defined in: [packages/mermaid/src/config.type.ts:289](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L289) This option controls which `currentConfig` keys are considered secure and can only be changed via call to `mermaid.initialize`. @@ -537,7 +537,7 @@ This prevents malicious graph directives from overriding a site's default securi > `optional` **securityLevel**: `"strict"` | `"loose"` | `"antiscript"` | `"sandbox"` -Defined in: packages/mermaid/src/config.type.ts:272 +Defined in: [packages/mermaid/src/config.type.ts:272](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L272) Level of trust for parsed diagram @@ -547,7 +547,7 @@ Level of trust for parsed diagram > `optional` **sequence**: `SequenceDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:326 +Defined in: [packages/mermaid/src/config.type.ts:326](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L326) --- @@ -555,7 +555,7 @@ Defined in: packages/mermaid/src/config.type.ts:326 > `optional` **startOnLoad**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:276 +Defined in: [packages/mermaid/src/config.type.ts:276](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L276) Dictates whether mermaid starts on Page load @@ -565,7 +565,7 @@ Dictates whether mermaid starts on Page load > `optional` **state**: `StateDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:331 +Defined in: [packages/mermaid/src/config.type.ts:331](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L331) --- @@ -573,7 +573,7 @@ Defined in: packages/mermaid/src/config.type.ts:331 > `optional` **suppressErrorRendering**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:363 +Defined in: [packages/mermaid/src/config.type.ts:363](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L363) Suppresses inserting 'Syntax error' diagram in the DOM. This is useful when you want to control how to handle syntax errors in your application. @@ -584,7 +584,7 @@ This is useful when you want to control how to handle syntax errors in your appl > `optional` **swimlane**: `SwimlaneDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:324 +Defined in: [packages/mermaid/src/config.type.ts:324](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L324) --- @@ -592,7 +592,7 @@ Defined in: packages/mermaid/src/config.type.ts:324 > `optional` **theme**: `"default"` | `"base"` | `"dark"` | `"forest"` | `"neutral"` | `"neo"` | `"neo-dark"` | `"redux"` | `"redux-dark"` | `"redux-color"` | `"redux-dark-color"` | `"null"` -Defined in: packages/mermaid/src/config.type.ts:72 +Defined in: [packages/mermaid/src/config.type.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L72) Theme, the CSS style sheet. You may also use `themeCSS` to override this value. @@ -603,7 +603,7 @@ You may also use `themeCSS` to override this value. > `optional` **themeCSS**: `string` -Defined in: packages/mermaid/src/config.type.ts:86 +Defined in: [packages/mermaid/src/config.type.ts:86](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L86) --- @@ -611,7 +611,7 @@ Defined in: packages/mermaid/src/config.type.ts:86 > `optional` **themeVariables**: `any` -Defined in: packages/mermaid/src/config.type.ts:85 +Defined in: [packages/mermaid/src/config.type.ts:85](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L85) --- @@ -619,7 +619,7 @@ Defined in: packages/mermaid/src/config.type.ts:85 > `optional` **timeline**: `TimelineDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:329 +Defined in: [packages/mermaid/src/config.type.ts:329](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L329) --- @@ -627,7 +627,7 @@ Defined in: packages/mermaid/src/config.type.ts:329 > `optional` **treeView**: `TreeViewDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:347 +Defined in: [packages/mermaid/src/config.type.ts:347](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L347) --- @@ -635,7 +635,7 @@ Defined in: packages/mermaid/src/config.type.ts:347 > `optional` **usecase**: `UsecaseDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:349 +Defined in: [packages/mermaid/src/config.type.ts:349](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L349) --- @@ -643,7 +643,7 @@ Defined in: packages/mermaid/src/config.type.ts:349 > `optional` **venn**: `VennDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:350 +Defined in: [packages/mermaid/src/config.type.ts:350](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L350) --- @@ -651,7 +651,7 @@ Defined in: packages/mermaid/src/config.type.ts:350 > `optional` **wardley-beta**: `WardleyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:351 +Defined in: [packages/mermaid/src/config.type.ts:351](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L351) --- @@ -659,7 +659,7 @@ Defined in: packages/mermaid/src/config.type.ts:351 > `optional` **wrap**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:355 +Defined in: [packages/mermaid/src/config.type.ts:355](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L355) --- @@ -667,4 +667,4 @@ Defined in: packages/mermaid/src/config.type.ts:355 > `optional` **xyChart**: `XYChartConfig` -Defined in: packages/mermaid/src/config.type.ts:335 +Defined in: [packages/mermaid/src/config.type.ts:335](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L335) diff --git a/docs/config/setup/mermaid/interfaces/ParseOptions.md b/docs/config/setup/mermaid/interfaces/ParseOptions.md index 55e232f9123..bb4d73b8886 100644 --- a/docs/config/setup/mermaid/interfaces/ParseOptions.md +++ b/docs/config/setup/mermaid/interfaces/ParseOptions.md @@ -10,7 +10,7 @@ # Interface: ParseOptions -Defined in: packages/mermaid/src/types.ts:96 +Defined in: [packages/mermaid/src/types.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L96) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:96 > `optional` **suppressErrors**: `boolean` -Defined in: packages/mermaid/src/types.ts:101 +Defined in: [packages/mermaid/src/types.ts:101](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L101) If `true`, parse will return `false` instead of throwing error when the diagram is invalid. The `parseError` function will not be called. diff --git a/docs/config/setup/mermaid/interfaces/ParseResult.md b/docs/config/setup/mermaid/interfaces/ParseResult.md index 2ace30e874a..f99981e73a3 100644 --- a/docs/config/setup/mermaid/interfaces/ParseResult.md +++ b/docs/config/setup/mermaid/interfaces/ParseResult.md @@ -10,7 +10,7 @@ # Interface: ParseResult -Defined in: packages/mermaid/src/types.ts:104 +Defined in: [packages/mermaid/src/types.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L104) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:104 > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: packages/mermaid/src/types.ts:112 +Defined in: [packages/mermaid/src/types.ts:112](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L112) The config passed as YAML frontmatter or directives @@ -28,6 +28,6 @@ The config passed as YAML frontmatter or directives > **diagramType**: `string` -Defined in: packages/mermaid/src/types.ts:108 +Defined in: [packages/mermaid/src/types.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L108) The diagram type, e.g. 'flowchart', 'sequence', etc. diff --git a/docs/config/setup/mermaid/interfaces/RenderOptions.md b/docs/config/setup/mermaid/interfaces/RenderOptions.md index 13d6cd773f6..61693176702 100644 --- a/docs/config/setup/mermaid/interfaces/RenderOptions.md +++ b/docs/config/setup/mermaid/interfaces/RenderOptions.md @@ -10,7 +10,7 @@ # Interface: RenderOptions -Defined in: packages/mermaid/src/rendering-util/render.ts:11 +Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L11) ## Properties @@ -18,4 +18,4 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:11 > `optional` **algorithm**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:12 +Defined in: [packages/mermaid/src/rendering-util/render.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L12) diff --git a/docs/config/setup/mermaid/interfaces/RenderResult.md b/docs/config/setup/mermaid/interfaces/RenderResult.md index a01b289a348..5829fd09abe 100644 --- a/docs/config/setup/mermaid/interfaces/RenderResult.md +++ b/docs/config/setup/mermaid/interfaces/RenderResult.md @@ -10,7 +10,7 @@ # Interface: RenderResult -Defined in: packages/mermaid/src/types.ts:135 +Defined in: [packages/mermaid/src/types.ts:135](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L135) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:135 > `optional` **bindFunctions**: (`element`) => `void` -Defined in: packages/mermaid/src/types.ts:153 +Defined in: [packages/mermaid/src/types.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L153) Bind function to be called after the svg has been inserted into the DOM. This is necessary for adding event listeners to the elements in the svg. @@ -45,7 +45,7 @@ bindFunctions?.(div); // To call bindFunctions only if it's present. > **diagramType**: `string` -Defined in: packages/mermaid/src/types.ts:143 +Defined in: [packages/mermaid/src/types.ts:143](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L143) The diagram type, e.g. 'flowchart', 'sequence', etc. @@ -55,6 +55,6 @@ The diagram type, e.g. 'flowchart', 'sequence', etc. > **svg**: `string` -Defined in: packages/mermaid/src/types.ts:139 +Defined in: [packages/mermaid/src/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L139) The svg code for the rendered graph. diff --git a/docs/config/setup/mermaid/interfaces/RunOptions.md b/docs/config/setup/mermaid/interfaces/RunOptions.md index 4cafed763a7..5a0eae0610b 100644 --- a/docs/config/setup/mermaid/interfaces/RunOptions.md +++ b/docs/config/setup/mermaid/interfaces/RunOptions.md @@ -10,7 +10,7 @@ # Interface: RunOptions -Defined in: packages/mermaid/src/mermaid.ts:63 +Defined in: [packages/mermaid/src/mermaid.ts:63](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L63) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/mermaid.ts:63 > `optional` **nodes**: `ArrayLike`<`HTMLElement`> -Defined in: packages/mermaid/src/mermaid.ts:71 +Defined in: [packages/mermaid/src/mermaid.ts:71](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L71) The nodes to render. If this is set, `querySelector` will be ignored. @@ -28,7 +28,7 @@ The nodes to render. If this is set, `querySelector` will be ignored. > `optional` **postRenderCallback**: (`id`) => `unknown` -Defined in: packages/mermaid/src/mermaid.ts:75 +Defined in: [packages/mermaid/src/mermaid.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L75) A callback to call after each diagram is rendered. @@ -48,7 +48,7 @@ A callback to call after each diagram is rendered. > `optional` **querySelector**: `string` -Defined in: packages/mermaid/src/mermaid.ts:67 +Defined in: [packages/mermaid/src/mermaid.ts:67](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L67) The query selector to use when finding elements to render. Default: `".mermaid"`. @@ -58,6 +58,6 @@ The query selector to use when finding elements to render. Default: `".mermaid"` > `optional` **suppressErrors**: `boolean` -Defined in: packages/mermaid/src/mermaid.ts:79 +Defined in: [packages/mermaid/src/mermaid.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L79) If `true`, errors will be logged to the console, but not thrown. Default: `false` diff --git a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md index ce9519343e4..bfefe1e6f32 100644 --- a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: SyncIconLoader -Defined in: packages/mermaid/src/rendering-util/icons.ts:13 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:13](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L13) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:13 > **icons**: `IconifyJSON` -Defined in: packages/mermaid/src/rendering-util/icons.ts:15 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L15) --- @@ -26,4 +26,4 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:15 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/icons.ts:14 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:14](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L14) diff --git a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md index 6f280033e22..2415d77eef9 100644 --- a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md +++ b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md @@ -10,7 +10,7 @@ # Interface: UnknownDiagramError -Defined in: packages/mermaid/src/errors.ts:1 +Defined in: [packages/mermaid/src/errors.ts:1](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/errors.ts#L1) ## Extends diff --git a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md index f64c0c608f6..e2b1a1e5ca6 100644 --- a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md +++ b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md @@ -12,4 +12,4 @@ > **CommonLayoutMeasure** = `Awaited`<`ReturnType`<_typeof_ `createGraphWithElements`>> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L26) diff --git a/docs/config/setup/mermaid/type-aliases/IconLoader.md b/docs/config/setup/mermaid/type-aliases/IconLoader.md index 874357a2073..98a312e71c9 100644 --- a/docs/config/setup/mermaid/type-aliases/IconLoader.md +++ b/docs/config/setup/mermaid/type-aliases/IconLoader.md @@ -12,4 +12,4 @@ > **IconLoader** = [`AsyncIconLoader`](../interfaces/AsyncIconLoader.md) | [`SyncIconLoader`](../interfaces/SyncIconLoader.md) -Defined in: packages/mermaid/src/rendering-util/icons.ts:18 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L18) diff --git a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md index 3d4b243d9a7..bfaeabd128f 100644 --- a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md +++ b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md @@ -12,4 +12,4 @@ > **InternalHelpers** = _typeof_ `internalHelpers` -Defined in: packages/mermaid/src/internals.ts:33 +Defined in: [packages/mermaid/src/internals.ts:33](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/internals.ts#L33) diff --git a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md index 54011b6da7c..55c907a8a76 100644 --- a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md +++ b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md @@ -12,7 +12,7 @@ > **ParseErrorFunction** = (`err`, `hash?`) => `void` -Defined in: packages/mermaid/src/Diagram.ts:12 +Defined in: [packages/mermaid/src/Diagram.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/Diagram.ts#L12) ## Parameters diff --git a/docs/config/setup/mermaid/type-aliases/SVG.md b/docs/config/setup/mermaid/type-aliases/SVG.md index 55348b9f565..82884c8a359 100644 --- a/docs/config/setup/mermaid/type-aliases/SVG.md +++ b/docs/config/setup/mermaid/type-aliases/SVG.md @@ -12,4 +12,4 @@ > **SVG** = `d3.Selection`<`SVGSVGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: packages/mermaid/src/diagram-api/types.ts:171 +Defined in: [packages/mermaid/src/diagram-api/types.ts:171](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L171) diff --git a/docs/config/setup/mermaid/type-aliases/SVGGroup.md b/docs/config/setup/mermaid/type-aliases/SVGGroup.md index 9662e8278c0..602dee9760f 100644 --- a/docs/config/setup/mermaid/type-aliases/SVGGroup.md +++ b/docs/config/setup/mermaid/type-aliases/SVGGroup.md @@ -12,4 +12,4 @@ > **SVGGroup** = `d3.Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: packages/mermaid/src/diagram-api/types.ts:173 +Defined in: [packages/mermaid/src/diagram-api/types.ts:173](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L173) diff --git a/docs/config/setup/mermaid/variables/default.md b/docs/config/setup/mermaid/variables/default.md index 645c2325adb..03da9f13855 100644 --- a/docs/config/setup/mermaid/variables/default.md +++ b/docs/config/setup/mermaid/variables/default.md @@ -12,4 +12,4 @@ > `const` **default**: [`Mermaid`](../interfaces/Mermaid.md) -Defined in: packages/mermaid/src/mermaid.ts:476 +Defined in: [packages/mermaid/src/mermaid.ts:476](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L476) From 236a9e6e42cf5bd242203dd407c48c1b4593496a Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 14:55:04 +0200 Subject: [PATCH 20/31] test: adapt develop's layout specs to the elk default Develop added specs assuming dagre is the default layout and that elk is the canonical unregistered algorithm; both premises change on this branch. Expectations follow the elk default, the fallback specs use a genuinely unregistered name, and the stale ships-separately comments are updated. --- .../mermaid/src/config.appearance.spec.ts | 12 +++++----- .../swimlanes/swimlanesDiagram.spec.ts | 2 +- .../src/rendering-util/layoutFallback.spec.ts | 24 +++++++++++-------- packages/mermaid/src/rendering-util/render.ts | 6 ++--- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/mermaid/src/config.appearance.spec.ts b/packages/mermaid/src/config.appearance.spec.ts index 0dcf6fb96d8..166177968d7 100644 --- a/packages/mermaid/src/config.appearance.spec.ts +++ b/packages/mermaid/src/config.appearance.spec.ts @@ -98,9 +98,9 @@ describe('per-diagram appearance defaults', () => { expect(pie.themeVariables.primaryColor).toBe(theme.default.getThemeVariables().primaryColor); }); - it('leaves the layout on dagre except where a diagram type names its own', async () => { - expect((await configFor(REDESIGNED_DIAGRAMS.class)).layout).toBe('dagre'); - expect((await configFor(UNCHANGED_DIAGRAMS.pie)).layout).toBe('dagre'); + it('leaves the layout on elk except where a diagram type names its own', async () => { + expect((await configFor(REDESIGNED_DIAGRAMS.class)).layout).toBe('elk'); + expect((await configFor(UNCHANGED_DIAGRAMS.pie)).layout).toBe('elk'); // The one type that names its own -- see `swimlanesDiagram.spec.ts`. expect((await configFor(REDESIGNED_DIAGRAMS.swimlane)).layout).toBe('swimlane'); }); @@ -138,9 +138,9 @@ describe('per-diagram appearance defaults', () => { }); it('opts a diagram type into a layout', async () => { - mermaidAPI.initialize({ er: { layout: 'elk' } }); - expect((await configFor(REDESIGNED_DIAGRAMS.er)).layout).toBe('elk'); - expect((await configFor(REDESIGNED_DIAGRAMS.class)).layout).toBe('dagre'); + mermaidAPI.initialize({ er: { layout: 'dagre' } }); + expect((await configFor(REDESIGNED_DIAGRAMS.er)).layout).toBe('dagre'); + expect((await configFor(REDESIGNED_DIAGRAMS.class)).layout).toBe('elk'); }); }); diff --git a/packages/mermaid/src/diagrams/swimlanes/swimlanesDiagram.spec.ts b/packages/mermaid/src/diagrams/swimlanes/swimlanesDiagram.spec.ts index 697ade39795..f097557ef45 100644 --- a/packages/mermaid/src/diagrams/swimlanes/swimlanesDiagram.spec.ts +++ b/packages/mermaid/src/diagrams/swimlanes/swimlanesDiagram.spec.ts @@ -43,7 +43,7 @@ describe('swimlanesDiagram', () => { }); it('leaves plain flowcharts on the global default layout', async () => { - expect(await layoutFor(FLOWCHART)).toBe('dagre'); + expect(await layoutFor(FLOWCHART)).toBe('elk'); }); it('keeps an explicit global layout override', async () => { diff --git a/packages/mermaid/src/rendering-util/layoutFallback.spec.ts b/packages/mermaid/src/rendering-util/layoutFallback.spec.ts index 8ed5d53d6ef..2dbd9b8011e 100644 --- a/packages/mermaid/src/rendering-util/layoutFallback.spec.ts +++ b/packages/mermaid/src/rendering-util/layoutFallback.spec.ts @@ -1,7 +1,7 @@ /** - * A diagram type may name a layout as its default, but `elk` ships as a separate package - * and `cose-bilkent` only in large-feature builds, so the resolution every renderer runs - * before `render()` has to terminate at something always registered. + * A diagram type may name a layout as its default, but `elk` and `cose-bilkent` ship only + * in large-feature builds (the tiny build omits them), so the resolution every renderer + * runs before `render()` has to terminate at something always registered. */ import { describe, expect, it, vi, beforeEach } from 'vitest'; import { getRegisteredLayoutAlgorithm, registerLayoutLoaders } from './render.js'; @@ -15,26 +15,30 @@ describe('layout fallback', () => { it('returns a registered layout unchanged', () => { expect(getRegisteredLayoutAlgorithm('dagre')).toBe('dagre'); expect(getRegisteredLayoutAlgorithm('swimlane')).toBe('swimlane'); + // Bundled by default now; only the tiny build omits it. + expect(getRegisteredLayoutAlgorithm('elk')).toBe('elk'); }); it('falls back to dagre for a layout nobody registered', () => { const warn = vi.spyOn(log, 'warn').mockImplementation(() => undefined); - expect(getRegisteredLayoutAlgorithm('elk')).toBe('dagre'); - expect(warn).toHaveBeenCalledWith(expect.stringContaining('elk')); + expect(getRegisteredLayoutAlgorithm('no-such-layout')).toBe('dagre'); + expect(warn).toHaveBeenCalledWith(expect.stringContaining('no-such-layout')); }); it('prefers the caller-supplied fallback when it is registered', () => { vi.spyOn(log, 'warn').mockImplementation(() => undefined); - expect(getRegisteredLayoutAlgorithm('elk', { fallback: 'swimlane' })).toBe('swimlane'); + expect(getRegisteredLayoutAlgorithm('no-such-layout', { fallback: 'swimlane' })).toBe( + 'swimlane' + ); }); it('falls through to dagre when the caller-supplied fallback is absent too', () => { // Mindmap's fallback is `cose-bilkent`, absent from tiny. Before the chain ended at - // dagre this threw, so a `mindmap.layout` of `elk` would have taken tiny down. + // dagre this threw, so an unregistered `mindmap.layout` would have taken tiny down. vi.spyOn(log, 'warn').mockImplementation(() => undefined); - expect(getRegisteredLayoutAlgorithm('elk', { fallback: 'not-registered-either' })).toBe( - 'dagre' - ); + expect( + getRegisteredLayoutAlgorithm('no-such-layout', { fallback: 'not-registered-either' }) + ).toBe('dagre'); }); it.each(['__proto__', 'constructor', 'toString'])( diff --git a/packages/mermaid/src/rendering-util/render.ts b/packages/mermaid/src/rendering-util/render.ts index 079f639fed6..cd28f2a87a0 100644 --- a/packages/mermaid/src/rendering-util/render.ts +++ b/packages/mermaid/src/rendering-util/render.ts @@ -176,9 +176,9 @@ export const render = async (data4Layout: LayoutData, svg: SVG) => { const LAST_RESORT_LAYOUT = 'dagre'; /** - * Get the registered layout algorithm, falling back when it is not available -- `elk` ships - * as a separate package and `cose-bilkent` only in large-feature builds, so a diagram type - * may name either as its default. `fallback` may itself be absent, so `dagre` closes the chain. + * Get the registered layout algorithm, falling back when it is not available -- `elk` and + * `cose-bilkent` ship only in large-feature builds (the tiny build omits them), so a diagram + * type may name either as its default. `fallback` may itself be absent, so `dagre` closes the chain. */ export const getRegisteredLayoutAlgorithm = ( algorithm = '', From 780014f9fdf3861591e4d171bc4570ffa3e0062a Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 15:06:11 +0200 Subject: [PATCH 21/31] address CodeRabbit review: docs accuracy, test assertions, catalogue comment - ER docs: Dagre example actually uses dagre; drop the obsolete 9.4+/lazy-load note - syntax-reference: list every diagram type that supports layout/look selection, with the mindmap cose-bilkent exception - layouts.md: mindmaps default to cose-bilkent, not dagre - render.spec: literal-key form for the dotted flat key; evenGroupFrames suite moved out of clearContainerAlgorithmOptions - hostConfigSync.spec: instrument the property the code actually reads (edges) and assert the sync-before-read ordering both ways - elkOptionCatalogue: the catalogue objects are merged too, so stop calling them inert; all four blocks must ship empty --- docs/config/layouts.md | 2 +- .../setup/config/functions/addDirective.md | 2 +- .../config/setup/config/functions/evaluate.md | 2 +- .../setup/config/functions/getConfig.md | 2 +- .../functions/getEffectiveHtmlLabels.md | 2 +- .../setup/config/functions/getSiteConfig.md | 2 +- .../config/functions/getUserDefinedConfig.md | 2 +- docs/config/setup/config/functions/reset.md | 2 +- .../config/setup/config/functions/sanitize.md | 2 +- .../functions/saveConfigFromInitialize.md | 2 +- .../setup/config/functions/setConfig.md | 2 +- .../config/functions/setDiagramConfigScope.md | 2 +- .../setup/config/functions/setSiteConfig.md | 2 +- .../config/functions/updateSiteConfig.md | 2 +- .../setup/config/variables/defaultConfig.md | 2 +- .../defaultConfig/variables/configKeys.md | 2 +- .../setup/defaultConfig/variables/default.md | 2 +- .../mermaid/functions/applyLineJumpsToSvg.md | 2 +- .../functions/clearLayoutRenderState.md | 2 +- .../functions/createCommonLayoutRenderer.md | 2 +- .../mermaid/functions/defaultMeasureLayout.md | 2 +- .../mermaid/functions/paintLayoutData.md | 2 +- .../mermaid/interfaces/AsyncIconLoader.md | 6 +- .../interfaces/CommonLayoutPaintContext.md | 12 +- .../interfaces/CommonLayoutPaintOptions.md | 16 +- .../interfaces/CommonLayoutRenderContext.md | 10 +- .../CommonLayoutRendererDefinition.md | 14 +- .../setup/mermaid/interfaces/DetailedError.md | 10 +- .../setup/mermaid/interfaces/EdgeGeom.md | 12 +- .../interfaces/ExternalDiagramDefinition.md | 8 +- .../setup/mermaid/interfaces/LayoutData.md | 10 +- .../interfaces/LayoutLoaderDefinition.md | 8 +- .../mermaid/interfaces/LineJumpConfig.md | 8 +- .../setup/mermaid/interfaces/Mermaid.md | 32 +- .../setup/mermaid/interfaces/MermaidConfig.md | 118 ++-- .../setup/mermaid/interfaces/ParseOptions.md | 4 +- .../setup/mermaid/interfaces/ParseResult.md | 6 +- .../setup/mermaid/interfaces/RenderOptions.md | 4 +- .../setup/mermaid/interfaces/RenderResult.md | 8 +- .../setup/mermaid/interfaces/RunOptions.md | 10 +- .../mermaid/interfaces/SyncIconLoader.md | 6 +- .../mermaid/interfaces/UnknownDiagramError.md | 2 +- .../type-aliases/CommonLayoutMeasure.md | 2 +- .../setup/mermaid/type-aliases/IconLoader.md | 2 +- .../mermaid/type-aliases/InternalHelpers.md | 2 +- .../type-aliases/ParseErrorFunction.md | 2 +- docs/config/setup/mermaid/type-aliases/SVG.md | 2 +- .../setup/mermaid/type-aliases/SVGGroup.md | 2 +- .../config/setup/mermaid/variables/default.md | 2 +- docs/intro/syntax-reference.md | 2 +- docs/syntax/entityRelationshipDiagram.md | 7 +- packages/mermaid/src/docs/config/layouts.md | 2 +- .../src/docs/intro/syntax-reference.md | 2 +- .../docs/syntax/entityRelationshipDiagram.md | 6 +- .../elk/__tests__/hostConfigSync.spec.ts | 7 +- .../elk/__tests__/render.spec.ts | 526 +++++++++--------- .../elk/elkOptionCatalogue.ts | 15 +- 57 files changed, 461 insertions(+), 468 deletions(-) diff --git a/docs/config/layouts.md b/docs/config/layouts.md index 25d6139c30d..5a29aa2842f 100644 --- a/docs/config/layouts.md +++ b/docs/config/layouts.md @@ -16,7 +16,7 @@ This page lists the available layout algorithms supported in Mermaid diagrams. - **tidy-tree**: Tidy tree layout for hierarchical diagrams, from the [`@mermaid-js/layout-tidy-tree`](https://www.npmjs.com/package/@mermaid-js/layout-tidy-tree) package [Tidy Tree Configuration](/config/tidy-tree) Mindmaps are the one diagram type not laid out with ELK by default; they use -Dagre unless you ask for something else. +cose-bilkent unless you ask for something else. The **tiny** build omits ELK to stay small, and falls back to Dagre for diagrams that request it. diff --git a/docs/config/setup/config/functions/addDirective.md b/docs/config/setup/config/functions/addDirective.md index 9b4616db1f7..3e9480d2235 100644 --- a/docs/config/setup/config/functions/addDirective.md +++ b/docs/config/setup/config/functions/addDirective.md @@ -12,7 +12,7 @@ > **addDirective**(`directive`): `void` -Defined in: [packages/mermaid/src/config.ts:277](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L277) +Defined in: packages/mermaid/src/config.ts:277 Pushes in a directive to the configuration diff --git a/docs/config/setup/config/functions/evaluate.md b/docs/config/setup/config/functions/evaluate.md index b40b6de8b61..d49e4df9203 100644 --- a/docs/config/setup/config/functions/evaluate.md +++ b/docs/config/setup/config/functions/evaluate.md @@ -12,7 +12,7 @@ > **evaluate**(`val?`): `boolean` -Defined in: [packages/mermaid/src/config.ts:62](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L62) +Defined in: packages/mermaid/src/config.ts:62 Converts a string/boolean into a boolean diff --git a/docs/config/setup/config/functions/getConfig.md b/docs/config/setup/config/functions/getConfig.md index 7bfd5d5add3..061ef29a784 100644 --- a/docs/config/setup/config/functions/getConfig.md +++ b/docs/config/setup/config/functions/getConfig.md @@ -12,7 +12,7 @@ > **getConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:224](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L224) +Defined in: packages/mermaid/src/config.ts:224 Returns a copy of the `currentConfig`. diff --git a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md index 42944fcd919..28be45be93f 100644 --- a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md +++ b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md @@ -12,7 +12,7 @@ > **getEffectiveHtmlLabels**(`config`): `boolean` -Defined in: [packages/mermaid/src/config.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L352) +Defined in: packages/mermaid/src/config.ts:352 Helper function to handle deprecated flowchart.htmlLabels diff --git a/docs/config/setup/config/functions/getSiteConfig.md b/docs/config/setup/config/functions/getSiteConfig.md index ceed814fa5f..58509a4db26 100644 --- a/docs/config/setup/config/functions/getSiteConfig.md +++ b/docs/config/setup/config/functions/getSiteConfig.md @@ -12,7 +12,7 @@ > **getSiteConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:198](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L198) +Defined in: packages/mermaid/src/config.ts:198 Returns a copy of the current `siteConfig` base configuration. diff --git a/docs/config/setup/config/functions/getUserDefinedConfig.md b/docs/config/setup/config/functions/getUserDefinedConfig.md index 9b3e20f1167..159f119a4c2 100644 --- a/docs/config/setup/config/functions/getUserDefinedConfig.md +++ b/docs/config/setup/config/functions/getUserDefinedConfig.md @@ -12,7 +12,7 @@ > **getUserDefinedConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L333) +Defined in: packages/mermaid/src/config.ts:333 ## Returns diff --git a/docs/config/setup/config/functions/reset.md b/docs/config/setup/config/functions/reset.md index 6433ae1eb09..cc69644d4e1 100644 --- a/docs/config/setup/config/functions/reset.md +++ b/docs/config/setup/config/functions/reset.md @@ -12,7 +12,7 @@ > **reset**(`config`): `void` -Defined in: [packages/mermaid/src/config.ts:298](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L298) +Defined in: packages/mermaid/src/config.ts:298 Resets the current config and applied directives to the provided config. diff --git a/docs/config/setup/config/functions/sanitize.md b/docs/config/setup/config/functions/sanitize.md index 1915ed847bb..ba72a7553b5 100644 --- a/docs/config/setup/config/functions/sanitize.md +++ b/docs/config/setup/config/functions/sanitize.md @@ -12,7 +12,7 @@ > **sanitize**(`options`): `void` -Defined in: [packages/mermaid/src/config.ts:235](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L235) +Defined in: packages/mermaid/src/config.ts:235 Ensures options parameter does not attempt to override `siteConfig` secure keys. diff --git a/docs/config/setup/config/functions/saveConfigFromInitialize.md b/docs/config/setup/config/functions/saveConfigFromInitialize.md index 2595da06f20..e4af4963d4b 100644 --- a/docs/config/setup/config/functions/saveConfigFromInitialize.md +++ b/docs/config/setup/config/functions/saveConfigFromInitialize.md @@ -12,7 +12,7 @@ > **saveConfigFromInitialize**(`conf`): `void` -Defined in: [packages/mermaid/src/config.ts:181](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L181) +Defined in: packages/mermaid/src/config.ts:181 ## Parameters diff --git a/docs/config/setup/config/functions/setConfig.md b/docs/config/setup/config/functions/setConfig.md index 4dba1581080..8dd49d3e71e 100644 --- a/docs/config/setup/config/functions/setConfig.md +++ b/docs/config/setup/config/functions/setConfig.md @@ -12,7 +12,7 @@ > **setConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:210](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L210) +Defined in: packages/mermaid/src/config.ts:210 Updates the `currentConfig` with the provided `conf` after sanitization. diff --git a/docs/config/setup/config/functions/setDiagramConfigScope.md b/docs/config/setup/config/functions/setDiagramConfigScope.md index 9e3cb4f0610..660799e631f 100644 --- a/docs/config/setup/config/functions/setDiagramConfigScope.md +++ b/docs/config/setup/config/functions/setDiagramConfigScope.md @@ -12,7 +12,7 @@ > **setDiagramConfigScope**(`diagramType?`): `void` -Defined in: [packages/mermaid/src/config.ts:150](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L150) +Defined in: packages/mermaid/src/config.ts:150 Names the diagram type being parsed or rendered, so its own appearance defaults apply. diff --git a/docs/config/setup/config/functions/setSiteConfig.md b/docs/config/setup/config/functions/setSiteConfig.md index 39c64220614..2147829e6a2 100644 --- a/docs/config/setup/config/functions/setSiteConfig.md +++ b/docs/config/setup/config/functions/setSiteConfig.md @@ -12,7 +12,7 @@ > **setSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:164](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L164) +Defined in: packages/mermaid/src/config.ts:164 Sets the `siteConfig` to the desired values. diff --git a/docs/config/setup/config/functions/updateSiteConfig.md b/docs/config/setup/config/functions/updateSiteConfig.md index 3ee515e24f9..faf42549807 100644 --- a/docs/config/setup/config/functions/updateSiteConfig.md +++ b/docs/config/setup/config/functions/updateSiteConfig.md @@ -12,7 +12,7 @@ > **updateSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:185](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L185) +Defined in: packages/mermaid/src/config.ts:185 ## Parameters diff --git a/docs/config/setup/config/variables/defaultConfig.md b/docs/config/setup/config/variables/defaultConfig.md index c351c83d350..b2e554ac90d 100644 --- a/docs/config/setup/config/variables/defaultConfig.md +++ b/docs/config/setup/config/variables/defaultConfig.md @@ -12,4 +12,4 @@ > `const` **defaultConfig**: [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: [packages/mermaid/src/config.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L9) +Defined in: packages/mermaid/src/config.ts:9 diff --git a/docs/config/setup/defaultConfig/variables/configKeys.md b/docs/config/setup/defaultConfig/variables/configKeys.md index 49a59f48597..4b1b8666aab 100644 --- a/docs/config/setup/defaultConfig/variables/configKeys.md +++ b/docs/config/setup/defaultConfig/variables/configKeys.md @@ -12,4 +12,4 @@ > `const` **configKeys**: `Set`<`string`> -Defined in: [packages/mermaid/src/defaultConfig.ts:358](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L358) +Defined in: packages/mermaid/src/defaultConfig.ts:358 diff --git a/docs/config/setup/defaultConfig/variables/default.md b/docs/config/setup/defaultConfig/variables/default.md index ccb6d130231..dd4f6acae93 100644 --- a/docs/config/setup/defaultConfig/variables/default.md +++ b/docs/config/setup/defaultConfig/variables/default.md @@ -12,7 +12,7 @@ > `const` **default**: `RequiredDeep`<[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)> -Defined in: [packages/mermaid/src/defaultConfig.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L18) +Defined in: packages/mermaid/src/defaultConfig.ts:18 Default mermaid configuration options. diff --git a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md index 18e5320b618..56750531427 100644 --- a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md +++ b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md @@ -12,7 +12,7 @@ > **applyLineJumpsToSvg**(`edgePathsGroup`, `edges`, `config`): `void` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L646) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646 Patches the rendered SVG paths in `edgePathsGroup` for any edges that cross. The true geometry is read from each path's `data-points` attribute diff --git a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md index 4b3074ad135..c3894f099c0 100644 --- a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md +++ b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md @@ -12,7 +12,7 @@ > **clearLayoutRenderState**(): `void` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L207) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207 ## Returns diff --git a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md index 196bcc2011c..a237aba61c7 100644 --- a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md +++ b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md @@ -12,7 +12,7 @@ > **createCommonLayoutRenderer**<`CoreResult`, `PreparedLayout`, `MeasureResult`>(`__namedParameters`): (`data4Layout`, `svg`, `helpers?`, `options?`) => `Promise`<`void`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L108) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108 ## Type Parameters diff --git a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md index 7b000c68209..1f22dcd817a 100644 --- a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md +++ b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md @@ -12,7 +12,7 @@ > **defaultMeasureLayout**(`data4Layout`, `__namedParameters`, `options?`): `Promise`<{ `graph`: `Graph`; `groups`: { `clusters`: `D3Selection`<`SVGGElement`>; `edgeLabels`: `D3Selection`<`SVGGElement`>; `edgePaths`: `D3Selection`<`SVGGElement`>; `nodes`: `D3Selection`<`SVGGElement`>; `rootGroups`: `D3Selection`<`SVGGElement`>; }; `nodeElements`: `Map`<`string`, `D3Selection`<`SVGElement` | `SVGGElement`>>; }> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L214) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214 ## Parameters diff --git a/docs/config/setup/mermaid/functions/paintLayoutData.md b/docs/config/setup/mermaid/functions/paintLayoutData.md index a530379b9b1..968edfed6c6 100644 --- a/docs/config/setup/mermaid/functions/paintLayoutData.md +++ b/docs/config/setup/mermaid/functions/paintLayoutData.md @@ -12,7 +12,7 @@ > **paintLayoutData**(`data4Layout`, `context`, `options`): `Promise`<`void`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L222) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222 ## Parameters diff --git a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md index 31912c30c5e..6de9e44c956 100644 --- a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: AsyncIconLoader -Defined in: [packages/mermaid/src/rendering-util/icons.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L8) +Defined in: packages/mermaid/src/rendering-util/icons.ts:8 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/icons.ts:8](https://github.com/ > **loader**: () => `Promise`<`IconifyJSON`> -Defined in: [packages/mermaid/src/rendering-util/icons.ts:10](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L10) +Defined in: packages/mermaid/src/rendering-util/icons.ts:10 #### Returns @@ -30,4 +30,4 @@ Defined in: [packages/mermaid/src/rendering-util/icons.ts:10](https://github.com > **name**: `string` -Defined in: [packages/mermaid/src/rendering-util/icons.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L9) +Defined in: packages/mermaid/src/rendering-util/icons.ts:9 diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md index 0e8edc39956..98523e59e40 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintContext\ -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L48) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48 ## Extends @@ -32,7 +32,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > **element**: `D3Selection`<`SVGElement`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 #### Inherited from @@ -44,7 +44,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **helpers**: `object` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 #### common @@ -491,7 +491,7 @@ The curve factory to use > **measure**: `MeasureResult` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L52) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52 --- @@ -499,7 +499,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 #### Inherited from @@ -511,7 +511,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **preparedLayout**: `PreparedLayout` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 #### Inherited from diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md index 438318ae983..37c6da3d1ed 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintOptions -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L55) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **clusterDb**: `ClusterDb` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L56) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **getEdgeNode**: (`id`, `edge`, `context`) => `object` | `Node` | `undefined` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L61) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61 #### Parameters @@ -52,7 +52,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **getNodes**: (`data4Layout`, `context`) => `Iterable`<`Node`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L57) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57 #### Parameters @@ -74,7 +74,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **isCluster**: (`node`, `context`) => `boolean` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L70) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70 #### Parameters @@ -96,7 +96,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **skipEdge**: (`edge`) => `boolean` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L74) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74 #### Parameters @@ -114,7 +114,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **skipIntersect**: `boolean` | (`edge`) => `boolean` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L75) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75 --- @@ -122,7 +122,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **skipNode**: (`node`, `context`) => `boolean` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L66) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66 #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md index 3116812f52b..ab1ba26bb3e 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRenderContext\ -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L41) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41 ## Extended by @@ -28,7 +28,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > **element**: `D3Selection`<`SVGElement`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 --- @@ -36,7 +36,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **helpers**: `object` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 #### common @@ -479,7 +479,7 @@ The curve factory to use > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 --- @@ -487,4 +487,4 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **preparedLayout**: `PreparedLayout` -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md index f1b13deb837..1899d77d4d7 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRendererDefinition\ -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L78) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78 ## Type Parameters @@ -32,7 +32,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **afterPaint**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L100) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100 #### Parameters @@ -58,7 +58,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **measureLayout**: (`data4Layout`, `context`) => `Promise`<`MeasureResult`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L87) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87 #### Parameters @@ -80,7 +80,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **paintLayout**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L95) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95 #### Parameters @@ -106,7 +106,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **paintOptions**: [`CommonLayoutPaintOptions`](CommonLayoutPaintOptions.md) -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L105) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105 --- @@ -114,7 +114,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > `optional` **prepareLayout**: (`data4Layout`, `context`) => `PreparedLayout` | `Promise`<`PreparedLayout`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L83) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83 #### Parameters @@ -136,7 +136,7 @@ Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index. > **runLayoutCore**: (`data4Layout`, `context`) => `CoreResult` | `Promise`<`CoreResult`> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L91) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91 #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/DetailedError.md b/docs/config/setup/mermaid/interfaces/DetailedError.md index 4a34e6534b9..8744001478b 100644 --- a/docs/config/setup/mermaid/interfaces/DetailedError.md +++ b/docs/config/setup/mermaid/interfaces/DetailedError.md @@ -10,7 +10,7 @@ # Interface: DetailedError -Defined in: [packages/mermaid/src/utils.ts:782](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L782) +Defined in: packages/mermaid/src/utils.ts:782 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/utils.ts:782](https://github.com/mermaid-js/me > `optional` **error**: `any` -Defined in: [packages/mermaid/src/utils.ts:787](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L787) +Defined in: packages/mermaid/src/utils.ts:787 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/utils.ts:787](https://github.com/mermaid-js/me > **hash**: `any` -Defined in: [packages/mermaid/src/utils.ts:785](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L785) +Defined in: packages/mermaid/src/utils.ts:785 --- @@ -34,7 +34,7 @@ Defined in: [packages/mermaid/src/utils.ts:785](https://github.com/mermaid-js/me > `optional` **message**: `string` -Defined in: [packages/mermaid/src/utils.ts:788](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L788) +Defined in: packages/mermaid/src/utils.ts:788 --- @@ -42,4 +42,4 @@ Defined in: [packages/mermaid/src/utils.ts:788](https://github.com/mermaid-js/me > **str**: `string` -Defined in: [packages/mermaid/src/utils.ts:783](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L783) +Defined in: packages/mermaid/src/utils.ts:783 diff --git a/docs/config/setup/mermaid/interfaces/EdgeGeom.md b/docs/config/setup/mermaid/interfaces/EdgeGeom.md index 26d14f335bb..00e298c579e 100644 --- a/docs/config/setup/mermaid/interfaces/EdgeGeom.md +++ b/docs/config/setup/mermaid/interfaces/EdgeGeom.md @@ -10,7 +10,7 @@ # Interface: EdgeGeom -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L56) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts: > `optional` **arrowTypeEnd**: `string` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L72) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72 Arrow type at the end (last point). @@ -28,7 +28,7 @@ Arrow type at the end (last point). > `optional` **arrowTypeStart**: `string` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L70) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70 Arrow type at the start (first point) — used to apply marker offset so the rewritten path's endpoint matches the original rendered geometry and @@ -40,7 +40,7 @@ the arrow marker orients correctly. > `optional` **curve**: `string` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L66) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66 Optional curve hint matching `edge.curve` from the rendering layer. When set, line jumps are only applied for orthogonal-friendly curves @@ -54,7 +54,7 @@ corrupting smoothed geometry. > **id**: `string` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L57) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57 --- @@ -62,4 +62,4 @@ Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts: > **points**: `Point`\[] -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L58) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58 diff --git a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md index 7f9700cd661..be1dbebcd63 100644 --- a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md +++ b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md @@ -10,7 +10,7 @@ # Interface: ExternalDiagramDefinition -Defined in: [packages/mermaid/src/diagram-api/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L139) +Defined in: packages/mermaid/src/diagram-api/types.ts:139 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/diagram-api/types.ts:139](https://github.com/m > **detector**: `DiagramDetector` -Defined in: [packages/mermaid/src/diagram-api/types.ts:141](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L141) +Defined in: packages/mermaid/src/diagram-api/types.ts:141 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/diagram-api/types.ts:141](https://github.com/m > **id**: `string` -Defined in: [packages/mermaid/src/diagram-api/types.ts:140](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L140) +Defined in: packages/mermaid/src/diagram-api/types.ts:140 --- @@ -34,4 +34,4 @@ Defined in: [packages/mermaid/src/diagram-api/types.ts:140](https://github.com/m > **loader**: `DiagramLoader` -Defined in: [packages/mermaid/src/diagram-api/types.ts:142](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L142) +Defined in: packages/mermaid/src/diagram-api/types.ts:142 diff --git a/docs/config/setup/mermaid/interfaces/LayoutData.md b/docs/config/setup/mermaid/interfaces/LayoutData.md index 246f6c8d7ee..c86c29f5bf5 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutData.md +++ b/docs/config/setup/mermaid/interfaces/LayoutData.md @@ -10,7 +10,7 @@ # Interface: LayoutData -Defined in: [packages/mermaid/src/rendering-util/types.ts:217](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L217) +Defined in: packages/mermaid/src/rendering-util/types.ts:217 ## Indexable @@ -22,7 +22,7 @@ Defined in: [packages/mermaid/src/rendering-util/types.ts:217](https://github.co > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: [packages/mermaid/src/rendering-util/types.ts:220](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L220) +Defined in: packages/mermaid/src/rendering-util/types.ts:220 --- @@ -30,7 +30,7 @@ Defined in: [packages/mermaid/src/rendering-util/types.ts:220](https://github.co > `optional` **diagramId**: `string` -Defined in: [packages/mermaid/src/rendering-util/types.ts:221](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L221) +Defined in: packages/mermaid/src/rendering-util/types.ts:221 --- @@ -38,7 +38,7 @@ Defined in: [packages/mermaid/src/rendering-util/types.ts:221](https://github.co > **edges**: `Edge`\[] -Defined in: [packages/mermaid/src/rendering-util/types.ts:219](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L219) +Defined in: packages/mermaid/src/rendering-util/types.ts:219 --- @@ -46,4 +46,4 @@ Defined in: [packages/mermaid/src/rendering-util/types.ts:219](https://github.co > **nodes**: `Node`\[] -Defined in: [packages/mermaid/src/rendering-util/types.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L218) +Defined in: packages/mermaid/src/rendering-util/types.ts:218 diff --git a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md index e9866171c63..977914fb784 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md +++ b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md @@ -10,7 +10,7 @@ # Interface: LayoutLoaderDefinition -Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25) +Defined in: packages/mermaid/src/rendering-util/render.ts:25 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.co > `optional` **algorithm**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:28](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L28) +Defined in: packages/mermaid/src/rendering-util/render.ts:28 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:28](https://github.co > **loader**: `LayoutLoader` -Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L27) +Defined in: packages/mermaid/src/rendering-util/render.ts:27 --- @@ -34,4 +34,4 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.co > **name**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L26) +Defined in: packages/mermaid/src/rendering-util/render.ts:26 diff --git a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md index 798fe18338c..d08ede700da 100644 --- a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md +++ b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md @@ -10,7 +10,7 @@ # Interface: LineJumpConfig -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L75) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts: > **enabled**: `boolean` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L76) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts: > **jumpRadius**: `number` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L77) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77 --- @@ -34,4 +34,4 @@ Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts: > **jumpStyle**: `"arc"` | `"gap"` -Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L78) +Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78 diff --git a/docs/config/setup/mermaid/interfaces/Mermaid.md b/docs/config/setup/mermaid/interfaces/Mermaid.md index d6bacb631c3..3e54b9d6fb1 100644 --- a/docs/config/setup/mermaid/interfaces/Mermaid.md +++ b/docs/config/setup/mermaid/interfaces/Mermaid.md @@ -10,7 +10,7 @@ # Interface: Mermaid -Defined in: [packages/mermaid/src/mermaid.ts:451](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L451) +Defined in: packages/mermaid/src/mermaid.ts:451 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/mermaid.ts:451](https://github.com/mermaid-js/ > **contentLoaded**: () => `void` -Defined in: [packages/mermaid/src/mermaid.ts:469](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L469) +Defined in: packages/mermaid/src/mermaid.ts:469 \##contentLoaded Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the @@ -34,7 +34,7 @@ page. > **detectType**: (`text`, `config?`) => `string` -Defined in: [packages/mermaid/src/mermaid.ts:471](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L471) +Defined in: packages/mermaid/src/mermaid.ts:471 Detects the type of the graph text. @@ -90,7 +90,7 @@ A graph definition key > **getRegisteredDiagramsMetadata**: () => `Pick`<[`ExternalDiagramDefinition`](ExternalDiagramDefinition.md), `"id"`>\[] -Defined in: [packages/mermaid/src/mermaid.ts:473](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L473) +Defined in: packages/mermaid/src/mermaid.ts:473 Gets the metadata for all registered diagrams. Currently only the id is returned. @@ -107,7 +107,7 @@ An array of objects with the id of the diagram. > **init**: (`config?`, `nodes?`, `callback?`) => `Promise`<`void`> -Defined in: [packages/mermaid/src/mermaid.ts:464](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L464) +Defined in: packages/mermaid/src/mermaid.ts:464 ## init @@ -155,7 +155,7 @@ Use [initialize](#initialize) and [run](#run) instead. > **initialize**: (`config`) => `void` -Defined in: [packages/mermaid/src/mermaid.ts:468](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L468) +Defined in: packages/mermaid/src/mermaid.ts:468 Used to set configurations for mermaid. This function should be called before the run function. @@ -178,7 +178,7 @@ Configuration object for mermaid. > **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](MermaidConfig.md); `getConfig`: () => [`MermaidConfig`](MermaidConfig.md); `getDiagramFromText`: (`text`, `metadata`) => `Promise`<`Diagram`>; `getSiteConfig`: () => [`MermaidConfig`](MermaidConfig.md); `globalReset`: () => `void`; `initialize`: (`userOptions`) => `void`; `parse`: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; }; `render`: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)>; `reset`: () => `void`; `setConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); `updateSiteConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); }> -Defined in: [packages/mermaid/src/mermaid.ts:458](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L458) +Defined in: packages/mermaid/src/mermaid.ts:458 **`Internal`** @@ -192,7 +192,7 @@ Use [parse](#parse) and [render](#render) instead. Please [open a discussion](ht > **parse**: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; } -Defined in: [packages/mermaid/src/mermaid.ts:459](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L459) +Defined in: packages/mermaid/src/mermaid.ts:459 #### Call Signature @@ -268,7 +268,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not > `optional` **parseError**: [`ParseErrorFunction`](../type-aliases/ParseErrorFunction.md) -Defined in: [packages/mermaid/src/mermaid.ts:453](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L453) +Defined in: packages/mermaid/src/mermaid.ts:453 --- @@ -276,7 +276,7 @@ Defined in: [packages/mermaid/src/mermaid.ts:453](https://github.com/mermaid-js/ > **registerExternalDiagrams**: (`diagrams`, `opts`) => `Promise`<`void`> -Defined in: [packages/mermaid/src/mermaid.ts:467](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L467) +Defined in: packages/mermaid/src/mermaid.ts:467 Used to register external diagram types. @@ -306,7 +306,7 @@ If opts.lazyLoad is false, the diagrams will be loaded immediately. > **registerIconPacks**: (`iconLoaders`) => `void` -Defined in: [packages/mermaid/src/mermaid.ts:472](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L472) +Defined in: packages/mermaid/src/mermaid.ts:472 #### Parameters @@ -324,7 +324,7 @@ Defined in: [packages/mermaid/src/mermaid.ts:472](https://github.com/mermaid-js/ > **registerLayoutLoaders**: (`loaders`) => `void` -Defined in: [packages/mermaid/src/mermaid.ts:466](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L466) +Defined in: packages/mermaid/src/mermaid.ts:466 #### Parameters @@ -342,7 +342,7 @@ Defined in: [packages/mermaid/src/mermaid.ts:466](https://github.com/mermaid-js/ > **render**: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)> -Defined in: [packages/mermaid/src/mermaid.ts:460](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L460) +Defined in: packages/mermaid/src/mermaid.ts:460 Renders the diagram, holding the diagram config scope for exactly as long as the render. Leaving it set would make `getConfig()` report the last diagram's appearance as the @@ -372,7 +372,7 @@ global answer for every caller between renders. > **run**: (`options`) => `Promise`<`void`> -Defined in: [packages/mermaid/src/mermaid.ts:465](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L465) +Defined in: packages/mermaid/src/mermaid.ts:465 ## run @@ -416,7 +416,7 @@ Optional runtime configs > **setParseErrorHandler**: (`parseErrorHandler`) => `void` -Defined in: [packages/mermaid/src/mermaid.ts:470](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L470) +Defined in: packages/mermaid/src/mermaid.ts:470 ## setParseErrorHandler Alternative to directly setting parseError using: @@ -447,4 +447,4 @@ New parseError() callback. > **startOnLoad**: `boolean` -Defined in: [packages/mermaid/src/mermaid.ts:452](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L452) +Defined in: packages/mermaid/src/mermaid.ts:452 diff --git a/docs/config/setup/mermaid/interfaces/MermaidConfig.md b/docs/config/setup/mermaid/interfaces/MermaidConfig.md index 7db03bf3c61..d2cd22fdf1b 100644 --- a/docs/config/setup/mermaid/interfaces/MermaidConfig.md +++ b/docs/config/setup/mermaid/interfaces/MermaidConfig.md @@ -10,7 +10,7 @@ # Interface: MermaidConfig -Defined in: [packages/mermaid/src/config.type.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L66) +Defined in: packages/mermaid/src/config.type.ts:66 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/config.type.ts:66](https://github.com/mermaid- > `optional` **agentflow**: `AgentflowDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:325](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L325) +Defined in: packages/mermaid/src/config.type.ts:325 --- @@ -26,7 +26,7 @@ Defined in: [packages/mermaid/src/config.type.ts:325](https://github.com/mermaid > `optional` **altFontFamily**: `string` -Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L263) +Defined in: packages/mermaid/src/config.type.ts:263 --- @@ -34,7 +34,7 @@ Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid > `optional` **architecture**: `ArchitectureDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:337](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L337) +Defined in: packages/mermaid/src/config.type.ts:337 --- @@ -42,7 +42,7 @@ Defined in: [packages/mermaid/src/config.type.ts:337](https://github.com/mermaid > `optional` **arrowMarkerAbsolute**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:282](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L282) +Defined in: packages/mermaid/src/config.type.ts:282 Controls whether or arrow markers in html code are absolute paths or anchors. This matters if you are using base tag settings. @@ -53,7 +53,7 @@ This matters if you are using base tag settings. > `optional` **block**: `BlockDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:345](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L345) +Defined in: packages/mermaid/src/config.type.ts:345 --- @@ -61,7 +61,7 @@ Defined in: [packages/mermaid/src/config.type.ts:345](https://github.com/mermaid > `optional` **c4**: `C4DiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:342](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L342) +Defined in: packages/mermaid/src/config.type.ts:342 --- @@ -69,7 +69,7 @@ Defined in: [packages/mermaid/src/config.type.ts:342](https://github.com/mermaid > `optional` **class**: `ClassDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:330](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L330) +Defined in: packages/mermaid/src/config.type.ts:330 --- @@ -77,7 +77,7 @@ Defined in: [packages/mermaid/src/config.type.ts:330](https://github.com/mermaid > `optional` **cynefin**: `CynefinDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L352) +Defined in: packages/mermaid/src/config.type.ts:352 --- @@ -85,7 +85,7 @@ Defined in: [packages/mermaid/src/config.type.ts:352](https://github.com/mermaid > `optional` **darkMode**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247) +Defined in: packages/mermaid/src/config.type.ts:247 --- @@ -93,7 +93,7 @@ Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid > `optional` **deterministicIds**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:315](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L315) +Defined in: packages/mermaid/src/config.type.ts:315 This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed. @@ -109,7 +109,7 @@ should not change unless content is changed. > `optional` **deterministicIDSeed**: `string` -Defined in: [packages/mermaid/src/config.type.ts:322](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L322) +Defined in: packages/mermaid/src/config.type.ts:322 This option is the optional seed for deterministic ids. If set to `undefined` but deterministicIds is `true`, a simple number iterator is used. @@ -121,7 +121,7 @@ You can set this attribute to base the seed on a static string. > `optional` **dompurifyConfig**: `Config` -Defined in: [packages/mermaid/src/config.type.ts:354](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L354) +Defined in: packages/mermaid/src/config.type.ts:354 --- @@ -129,7 +129,7 @@ Defined in: [packages/mermaid/src/config.type.ts:354](https://github.com/mermaid > `optional` **elk**: `object` -Defined in: [packages/mermaid/src/config.type.ts:114](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L114) +Defined in: packages/mermaid/src/config.type.ts:114 #### considerModelOrder? @@ -268,7 +268,7 @@ port, or would introduce a crossing. > `optional` **er**: `ErDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:332](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L332) +Defined in: packages/mermaid/src/config.type.ts:332 --- @@ -276,7 +276,7 @@ Defined in: [packages/mermaid/src/config.type.ts:332](https://github.com/mermaid > `optional` **eventmodeling**: `EventModelingDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:346](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L346) +Defined in: packages/mermaid/src/config.type.ts:346 --- @@ -284,7 +284,7 @@ Defined in: [packages/mermaid/src/config.type.ts:346](https://github.com/mermaid > `optional` **flowchart**: `FlowchartDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:323](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L323) +Defined in: packages/mermaid/src/config.type.ts:323 --- @@ -292,7 +292,7 @@ Defined in: [packages/mermaid/src/config.type.ts:323](https://github.com/mermaid > `optional` **fontFamily**: `string` -Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L262) +Defined in: packages/mermaid/src/config.type.ts:262 Specifies the font to be used in the rendered diagrams. Can be any possible CSS `font-family`. @@ -304,7 +304,7 @@ See > `optional` **fontSize**: `number` -Defined in: [packages/mermaid/src/config.type.ts:356](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L356) +Defined in: packages/mermaid/src/config.type.ts:356 --- @@ -312,7 +312,7 @@ Defined in: [packages/mermaid/src/config.type.ts:356](https://github.com/mermaid > `optional` **forceLegacyMathML**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:304](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L304) +Defined in: packages/mermaid/src/config.type.ts:304 This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS fonts and browser's MathML implementation, this option is recommended if consistent rendering is important. @@ -324,7 +324,7 @@ If set to true, ignores legacyMathML. > `optional` **gantt**: `GanttDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:327](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L327) +Defined in: packages/mermaid/src/config.type.ts:327 --- @@ -332,7 +332,7 @@ Defined in: [packages/mermaid/src/config.type.ts:327](https://github.com/mermaid > `optional` **gitGraph**: `GitGraphDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:341](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L341) +Defined in: packages/mermaid/src/config.type.ts:341 --- @@ -340,7 +340,7 @@ Defined in: [packages/mermaid/src/config.type.ts:341](https://github.com/mermaid > `optional` **handDrawnSeed**: `number` -Defined in: [packages/mermaid/src/config.type.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L96) +Defined in: packages/mermaid/src/config.type.ts:96 Defines the seed to be used when using handDrawn look. This is important for the automated tests as they will always find differences without the seed. The default value is 0 which gives a random seed. @@ -350,7 +350,7 @@ Defines the seed to be used when using handDrawn look. This is important for the > `optional` **htmlLabels**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255) +Defined in: packages/mermaid/src/config.type.ts:255 Flag for setting whether or not a html tag should be used for rendering labels on nodes and edges. **Note:** Diagram-specific `htmlLabels` settings (e.g., `flowchart.htmlLabels`) are deprecated. @@ -363,7 +363,7 @@ over any diagram-specific settings. > `optional` **ishikawa**: `IshikawaDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:339](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L339) +Defined in: packages/mermaid/src/config.type.ts:339 --- @@ -371,7 +371,7 @@ Defined in: [packages/mermaid/src/config.type.ts:339](https://github.com/mermaid > `optional` **journey**: `JourneyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:328](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L328) +Defined in: packages/mermaid/src/config.type.ts:328 --- @@ -379,7 +379,7 @@ Defined in: [packages/mermaid/src/config.type.ts:328](https://github.com/mermaid > `optional` **kanban**: `KanbanDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:340](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L340) +Defined in: packages/mermaid/src/config.type.ts:340 --- @@ -387,7 +387,7 @@ Defined in: [packages/mermaid/src/config.type.ts:340](https://github.com/mermaid > `optional` **layout**: `string` -Defined in: [packages/mermaid/src/config.type.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L104) +Defined in: packages/mermaid/src/config.type.ts:104 Defines which layout algorithm to use for rendering the diagram. @@ -400,7 +400,7 @@ ELK to stay small and falls back to `dagre`. > `optional` **legacyMathML**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:297](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L297) +Defined in: packages/mermaid/src/config.type.ts:297 This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers without their own MathML implementation. If this option is disabled and MathML is not supported, the math @@ -413,7 +413,7 @@ fall back to legacy rendering for KaTeX. > `optional` **logLevel**: `0` | `2` | `1` | `"trace"` | `"debug"` | `"info"` | `"warn"` | `"error"` | `"fatal"` | `3` | `4` | `5` -Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L268) +Defined in: packages/mermaid/src/config.type.ts:268 This option decides the amount of logging to be used by mermaid. @@ -423,7 +423,7 @@ This option decides the amount of logging to be used by mermaid. > `optional` **look**: `"neo"` | `"classic"` | `"handDrawn"` -Defined in: [packages/mermaid/src/config.type.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L91) +Defined in: packages/mermaid/src/config.type.ts:91 Defines which main look to use for the diagram. @@ -433,7 +433,7 @@ Defines which main look to use for the diagram. > `optional` **markdownAutoWrap**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:357](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L357) +Defined in: packages/mermaid/src/config.type.ts:357 --- @@ -441,7 +441,7 @@ Defined in: [packages/mermaid/src/config.type.ts:357](https://github.com/mermaid > `optional` **maxEdges**: `number` -Defined in: [packages/mermaid/src/config.type.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L113) +Defined in: packages/mermaid/src/config.type.ts:113 Defines the maximum number of edges that can be drawn in a graph. @@ -451,7 +451,7 @@ Defines the maximum number of edges that can be drawn in a graph. > `optional` **maxTextSize**: `number` -Defined in: [packages/mermaid/src/config.type.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L108) +Defined in: packages/mermaid/src/config.type.ts:108 The maximum allowed size of the users text diagram @@ -461,7 +461,7 @@ The maximum allowed size of the users text diagram > `optional` **mindmap**: `MindmapDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:338](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L338) +Defined in: packages/mermaid/src/config.type.ts:338 --- @@ -469,7 +469,7 @@ Defined in: [packages/mermaid/src/config.type.ts:338](https://github.com/mermaid > `optional` **packet**: `PacketDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:344](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L344) +Defined in: packages/mermaid/src/config.type.ts:344 --- @@ -477,7 +477,7 @@ Defined in: [packages/mermaid/src/config.type.ts:344](https://github.com/mermaid > `optional` **pie**: `PieDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L333) +Defined in: packages/mermaid/src/config.type.ts:333 --- @@ -485,7 +485,7 @@ Defined in: [packages/mermaid/src/config.type.ts:333](https://github.com/mermaid > `optional` **quadrantChart**: `QuadrantChartConfig` -Defined in: [packages/mermaid/src/config.type.ts:334](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L334) +Defined in: packages/mermaid/src/config.type.ts:334 --- @@ -493,7 +493,7 @@ Defined in: [packages/mermaid/src/config.type.ts:334](https://github.com/mermaid > `optional` **radar**: `RadarDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:348](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L348) +Defined in: packages/mermaid/src/config.type.ts:348 --- @@ -501,7 +501,7 @@ Defined in: [packages/mermaid/src/config.type.ts:348](https://github.com/mermaid > `optional` **railroad**: `RailroadDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:353](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L353) +Defined in: packages/mermaid/src/config.type.ts:353 --- @@ -509,7 +509,7 @@ Defined in: [packages/mermaid/src/config.type.ts:353](https://github.com/mermaid > `optional` **requirement**: `RequirementDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:336](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L336) +Defined in: packages/mermaid/src/config.type.ts:336 --- @@ -517,7 +517,7 @@ Defined in: [packages/mermaid/src/config.type.ts:336](https://github.com/mermaid > `optional` **sankey**: `SankeyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:343](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L343) +Defined in: packages/mermaid/src/config.type.ts:343 --- @@ -525,7 +525,7 @@ Defined in: [packages/mermaid/src/config.type.ts:343](https://github.com/mermaid > `optional` **secure**: `string`\[] -Defined in: [packages/mermaid/src/config.type.ts:289](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L289) +Defined in: packages/mermaid/src/config.type.ts:289 This option controls which `currentConfig` keys are considered secure and can only be changed via call to `mermaid.initialize`. @@ -537,7 +537,7 @@ This prevents malicious graph directives from overriding a site's default securi > `optional` **securityLevel**: `"strict"` | `"loose"` | `"antiscript"` | `"sandbox"` -Defined in: [packages/mermaid/src/config.type.ts:272](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L272) +Defined in: packages/mermaid/src/config.type.ts:272 Level of trust for parsed diagram @@ -547,7 +547,7 @@ Level of trust for parsed diagram > `optional` **sequence**: `SequenceDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:326](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L326) +Defined in: packages/mermaid/src/config.type.ts:326 --- @@ -555,7 +555,7 @@ Defined in: [packages/mermaid/src/config.type.ts:326](https://github.com/mermaid > `optional` **startOnLoad**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:276](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L276) +Defined in: packages/mermaid/src/config.type.ts:276 Dictates whether mermaid starts on Page load @@ -565,7 +565,7 @@ Dictates whether mermaid starts on Page load > `optional` **state**: `StateDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:331](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L331) +Defined in: packages/mermaid/src/config.type.ts:331 --- @@ -573,7 +573,7 @@ Defined in: [packages/mermaid/src/config.type.ts:331](https://github.com/mermaid > `optional` **suppressErrorRendering**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:363](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L363) +Defined in: packages/mermaid/src/config.type.ts:363 Suppresses inserting 'Syntax error' diagram in the DOM. This is useful when you want to control how to handle syntax errors in your application. @@ -584,7 +584,7 @@ This is useful when you want to control how to handle syntax errors in your appl > `optional` **swimlane**: `SwimlaneDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:324](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L324) +Defined in: packages/mermaid/src/config.type.ts:324 --- @@ -592,7 +592,7 @@ Defined in: [packages/mermaid/src/config.type.ts:324](https://github.com/mermaid > `optional` **theme**: `"default"` | `"base"` | `"dark"` | `"forest"` | `"neutral"` | `"neo"` | `"neo-dark"` | `"redux"` | `"redux-dark"` | `"redux-color"` | `"redux-dark-color"` | `"null"` -Defined in: [packages/mermaid/src/config.type.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L72) +Defined in: packages/mermaid/src/config.type.ts:72 Theme, the CSS style sheet. You may also use `themeCSS` to override this value. @@ -603,7 +603,7 @@ You may also use `themeCSS` to override this value. > `optional` **themeCSS**: `string` -Defined in: [packages/mermaid/src/config.type.ts:86](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L86) +Defined in: packages/mermaid/src/config.type.ts:86 --- @@ -611,7 +611,7 @@ Defined in: [packages/mermaid/src/config.type.ts:86](https://github.com/mermaid- > `optional` **themeVariables**: `any` -Defined in: [packages/mermaid/src/config.type.ts:85](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L85) +Defined in: packages/mermaid/src/config.type.ts:85 --- @@ -619,7 +619,7 @@ Defined in: [packages/mermaid/src/config.type.ts:85](https://github.com/mermaid- > `optional` **timeline**: `TimelineDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:329](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L329) +Defined in: packages/mermaid/src/config.type.ts:329 --- @@ -627,7 +627,7 @@ Defined in: [packages/mermaid/src/config.type.ts:329](https://github.com/mermaid > `optional` **treeView**: `TreeViewDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:347](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L347) +Defined in: packages/mermaid/src/config.type.ts:347 --- @@ -635,7 +635,7 @@ Defined in: [packages/mermaid/src/config.type.ts:347](https://github.com/mermaid > `optional` **usecase**: `UsecaseDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:349](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L349) +Defined in: packages/mermaid/src/config.type.ts:349 --- @@ -643,7 +643,7 @@ Defined in: [packages/mermaid/src/config.type.ts:349](https://github.com/mermaid > `optional` **venn**: `VennDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:350](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L350) +Defined in: packages/mermaid/src/config.type.ts:350 --- @@ -651,7 +651,7 @@ Defined in: [packages/mermaid/src/config.type.ts:350](https://github.com/mermaid > `optional` **wardley-beta**: `WardleyDiagramConfig` -Defined in: [packages/mermaid/src/config.type.ts:351](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L351) +Defined in: packages/mermaid/src/config.type.ts:351 --- @@ -659,7 +659,7 @@ Defined in: [packages/mermaid/src/config.type.ts:351](https://github.com/mermaid > `optional` **wrap**: `boolean` -Defined in: [packages/mermaid/src/config.type.ts:355](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L355) +Defined in: packages/mermaid/src/config.type.ts:355 --- @@ -667,4 +667,4 @@ Defined in: [packages/mermaid/src/config.type.ts:355](https://github.com/mermaid > `optional` **xyChart**: `XYChartConfig` -Defined in: [packages/mermaid/src/config.type.ts:335](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L335) +Defined in: packages/mermaid/src/config.type.ts:335 diff --git a/docs/config/setup/mermaid/interfaces/ParseOptions.md b/docs/config/setup/mermaid/interfaces/ParseOptions.md index bb4d73b8886..55e232f9123 100644 --- a/docs/config/setup/mermaid/interfaces/ParseOptions.md +++ b/docs/config/setup/mermaid/interfaces/ParseOptions.md @@ -10,7 +10,7 @@ # Interface: ParseOptions -Defined in: [packages/mermaid/src/types.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L96) +Defined in: packages/mermaid/src/types.ts:96 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/types.ts:96](https://github.com/mermaid-js/mer > `optional` **suppressErrors**: `boolean` -Defined in: [packages/mermaid/src/types.ts:101](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L101) +Defined in: packages/mermaid/src/types.ts:101 If `true`, parse will return `false` instead of throwing error when the diagram is invalid. The `parseError` function will not be called. diff --git a/docs/config/setup/mermaid/interfaces/ParseResult.md b/docs/config/setup/mermaid/interfaces/ParseResult.md index f99981e73a3..2ace30e874a 100644 --- a/docs/config/setup/mermaid/interfaces/ParseResult.md +++ b/docs/config/setup/mermaid/interfaces/ParseResult.md @@ -10,7 +10,7 @@ # Interface: ParseResult -Defined in: [packages/mermaid/src/types.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L104) +Defined in: packages/mermaid/src/types.ts:104 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/types.ts:104](https://github.com/mermaid-js/me > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: [packages/mermaid/src/types.ts:112](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L112) +Defined in: packages/mermaid/src/types.ts:112 The config passed as YAML frontmatter or directives @@ -28,6 +28,6 @@ The config passed as YAML frontmatter or directives > **diagramType**: `string` -Defined in: [packages/mermaid/src/types.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L108) +Defined in: packages/mermaid/src/types.ts:108 The diagram type, e.g. 'flowchart', 'sequence', etc. diff --git a/docs/config/setup/mermaid/interfaces/RenderOptions.md b/docs/config/setup/mermaid/interfaces/RenderOptions.md index 61693176702..13d6cd773f6 100644 --- a/docs/config/setup/mermaid/interfaces/RenderOptions.md +++ b/docs/config/setup/mermaid/interfaces/RenderOptions.md @@ -10,7 +10,7 @@ # Interface: RenderOptions -Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L11) +Defined in: packages/mermaid/src/rendering-util/render.ts:11 ## Properties @@ -18,4 +18,4 @@ Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.co > `optional` **algorithm**: `string` -Defined in: [packages/mermaid/src/rendering-util/render.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L12) +Defined in: packages/mermaid/src/rendering-util/render.ts:12 diff --git a/docs/config/setup/mermaid/interfaces/RenderResult.md b/docs/config/setup/mermaid/interfaces/RenderResult.md index 5829fd09abe..a01b289a348 100644 --- a/docs/config/setup/mermaid/interfaces/RenderResult.md +++ b/docs/config/setup/mermaid/interfaces/RenderResult.md @@ -10,7 +10,7 @@ # Interface: RenderResult -Defined in: [packages/mermaid/src/types.ts:135](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L135) +Defined in: packages/mermaid/src/types.ts:135 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/types.ts:135](https://github.com/mermaid-js/me > `optional` **bindFunctions**: (`element`) => `void` -Defined in: [packages/mermaid/src/types.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L153) +Defined in: packages/mermaid/src/types.ts:153 Bind function to be called after the svg has been inserted into the DOM. This is necessary for adding event listeners to the elements in the svg. @@ -45,7 +45,7 @@ bindFunctions?.(div); // To call bindFunctions only if it's present. > **diagramType**: `string` -Defined in: [packages/mermaid/src/types.ts:143](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L143) +Defined in: packages/mermaid/src/types.ts:143 The diagram type, e.g. 'flowchart', 'sequence', etc. @@ -55,6 +55,6 @@ The diagram type, e.g. 'flowchart', 'sequence', etc. > **svg**: `string` -Defined in: [packages/mermaid/src/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L139) +Defined in: packages/mermaid/src/types.ts:139 The svg code for the rendered graph. diff --git a/docs/config/setup/mermaid/interfaces/RunOptions.md b/docs/config/setup/mermaid/interfaces/RunOptions.md index 5a0eae0610b..4cafed763a7 100644 --- a/docs/config/setup/mermaid/interfaces/RunOptions.md +++ b/docs/config/setup/mermaid/interfaces/RunOptions.md @@ -10,7 +10,7 @@ # Interface: RunOptions -Defined in: [packages/mermaid/src/mermaid.ts:63](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L63) +Defined in: packages/mermaid/src/mermaid.ts:63 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/mermaid.ts:63](https://github.com/mermaid-js/m > `optional` **nodes**: `ArrayLike`<`HTMLElement`> -Defined in: [packages/mermaid/src/mermaid.ts:71](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L71) +Defined in: packages/mermaid/src/mermaid.ts:71 The nodes to render. If this is set, `querySelector` will be ignored. @@ -28,7 +28,7 @@ The nodes to render. If this is set, `querySelector` will be ignored. > `optional` **postRenderCallback**: (`id`) => `unknown` -Defined in: [packages/mermaid/src/mermaid.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L75) +Defined in: packages/mermaid/src/mermaid.ts:75 A callback to call after each diagram is rendered. @@ -48,7 +48,7 @@ A callback to call after each diagram is rendered. > `optional` **querySelector**: `string` -Defined in: [packages/mermaid/src/mermaid.ts:67](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L67) +Defined in: packages/mermaid/src/mermaid.ts:67 The query selector to use when finding elements to render. Default: `".mermaid"`. @@ -58,6 +58,6 @@ The query selector to use when finding elements to render. Default: `".mermaid"` > `optional` **suppressErrors**: `boolean` -Defined in: [packages/mermaid/src/mermaid.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L79) +Defined in: packages/mermaid/src/mermaid.ts:79 If `true`, errors will be logged to the console, but not thrown. Default: `false` diff --git a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md index bfefe1e6f32..ce9519343e4 100644 --- a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: SyncIconLoader -Defined in: [packages/mermaid/src/rendering-util/icons.ts:13](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L13) +Defined in: packages/mermaid/src/rendering-util/icons.ts:13 ## Properties @@ -18,7 +18,7 @@ Defined in: [packages/mermaid/src/rendering-util/icons.ts:13](https://github.com > **icons**: `IconifyJSON` -Defined in: [packages/mermaid/src/rendering-util/icons.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L15) +Defined in: packages/mermaid/src/rendering-util/icons.ts:15 --- @@ -26,4 +26,4 @@ Defined in: [packages/mermaid/src/rendering-util/icons.ts:15](https://github.com > **name**: `string` -Defined in: [packages/mermaid/src/rendering-util/icons.ts:14](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L14) +Defined in: packages/mermaid/src/rendering-util/icons.ts:14 diff --git a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md index 2415d77eef9..6f280033e22 100644 --- a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md +++ b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md @@ -10,7 +10,7 @@ # Interface: UnknownDiagramError -Defined in: [packages/mermaid/src/errors.ts:1](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/errors.ts#L1) +Defined in: packages/mermaid/src/errors.ts:1 ## Extends diff --git a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md index e2b1a1e5ca6..f64c0c608f6 100644 --- a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md +++ b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md @@ -12,4 +12,4 @@ > **CommonLayoutMeasure** = `Awaited`<`ReturnType`<_typeof_ `createGraphWithElements`>> -Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L26) +Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26 diff --git a/docs/config/setup/mermaid/type-aliases/IconLoader.md b/docs/config/setup/mermaid/type-aliases/IconLoader.md index 98a312e71c9..874357a2073 100644 --- a/docs/config/setup/mermaid/type-aliases/IconLoader.md +++ b/docs/config/setup/mermaid/type-aliases/IconLoader.md @@ -12,4 +12,4 @@ > **IconLoader** = [`AsyncIconLoader`](../interfaces/AsyncIconLoader.md) | [`SyncIconLoader`](../interfaces/SyncIconLoader.md) -Defined in: [packages/mermaid/src/rendering-util/icons.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L18) +Defined in: packages/mermaid/src/rendering-util/icons.ts:18 diff --git a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md index bfaeabd128f..3d4b243d9a7 100644 --- a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md +++ b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md @@ -12,4 +12,4 @@ > **InternalHelpers** = _typeof_ `internalHelpers` -Defined in: [packages/mermaid/src/internals.ts:33](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/internals.ts#L33) +Defined in: packages/mermaid/src/internals.ts:33 diff --git a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md index 55c907a8a76..54011b6da7c 100644 --- a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md +++ b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md @@ -12,7 +12,7 @@ > **ParseErrorFunction** = (`err`, `hash?`) => `void` -Defined in: [packages/mermaid/src/Diagram.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/Diagram.ts#L12) +Defined in: packages/mermaid/src/Diagram.ts:12 ## Parameters diff --git a/docs/config/setup/mermaid/type-aliases/SVG.md b/docs/config/setup/mermaid/type-aliases/SVG.md index 82884c8a359..55348b9f565 100644 --- a/docs/config/setup/mermaid/type-aliases/SVG.md +++ b/docs/config/setup/mermaid/type-aliases/SVG.md @@ -12,4 +12,4 @@ > **SVG** = `d3.Selection`<`SVGSVGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: [packages/mermaid/src/diagram-api/types.ts:171](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L171) +Defined in: packages/mermaid/src/diagram-api/types.ts:171 diff --git a/docs/config/setup/mermaid/type-aliases/SVGGroup.md b/docs/config/setup/mermaid/type-aliases/SVGGroup.md index 602dee9760f..9662e8278c0 100644 --- a/docs/config/setup/mermaid/type-aliases/SVGGroup.md +++ b/docs/config/setup/mermaid/type-aliases/SVGGroup.md @@ -12,4 +12,4 @@ > **SVGGroup** = `d3.Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: [packages/mermaid/src/diagram-api/types.ts:173](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L173) +Defined in: packages/mermaid/src/diagram-api/types.ts:173 diff --git a/docs/config/setup/mermaid/variables/default.md b/docs/config/setup/mermaid/variables/default.md index 03da9f13855..645c2325adb 100644 --- a/docs/config/setup/mermaid/variables/default.md +++ b/docs/config/setup/mermaid/variables/default.md @@ -12,4 +12,4 @@ > `const` **default**: [`Mermaid`](../interfaces/Mermaid.md) -Defined in: [packages/mermaid/src/mermaid.ts:476](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L476) +Defined in: packages/mermaid/src/mermaid.ts:476 diff --git a/docs/intro/syntax-reference.md b/docs/intro/syntax-reference.md index ff82bccde99..32877d30624 100644 --- a/docs/intro/syntax-reference.md +++ b/docs/intro/syntax-reference.md @@ -130,7 +130,7 @@ An application of using Directives to change [Themes](../config/theming.md). `Th ### Layout and look -We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowcharts and state diagrams**, with plans to extend support to all diagram types. +We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowchart, state, class, entity relationship, requirement, use case, and agentflow diagrams**, with plans to extend support to all diagram types. Mindmaps are the exception: they keep their own `cose-bilkent` layout unless a layout is explicitly set (the tiny build, which ships neither ELK nor cose-bilkent, falls back to Dagre). ### Selecting Diagram Looks diff --git a/docs/syntax/entityRelationshipDiagram.md b/docs/syntax/entityRelationshipDiagram.md index 632135f11a4..ccabffba6d4 100644 --- a/docs/syntax/entityRelationshipDiagram.md +++ b/docs/syntax/entityRelationshipDiagram.md @@ -991,7 +991,7 @@ Your Mermaid code should be similar to the following: --- title: Order example config: - layout: elk + layout: dagre --- erDiagram CUSTOMER ||--o{ ORDER : places @@ -1003,7 +1003,7 @@ erDiagram --- title: Order example config: - layout: elk + layout: dagre --- erDiagram CUSTOMER ||--o{ ORDER : places @@ -1011,7 +1011,4 @@ erDiagram CUSTOMER }|..|{ DELIVERY-ADDRESS : uses ``` -> **Note** -> Note that the site needs to use mermaid version 9.4+ for this to work and have this featured enabled in the lazy-loading configuration. - diff --git a/packages/mermaid/src/docs/config/layouts.md b/packages/mermaid/src/docs/config/layouts.md index 73a08c6cc10..afbc9657a22 100644 --- a/packages/mermaid/src/docs/config/layouts.md +++ b/packages/mermaid/src/docs/config/layouts.md @@ -10,7 +10,7 @@ This page lists the available layout algorithms supported in Mermaid diagrams. - **tidy-tree**: Tidy tree layout for hierarchical diagrams, from the [`@mermaid-js/layout-tidy-tree`](https://www.npmjs.com/package/@mermaid-js/layout-tidy-tree) package [Tidy Tree Configuration](/config/tidy-tree) Mindmaps are the one diagram type not laid out with ELK by default; they use -Dagre unless you ask for something else. +cose-bilkent unless you ask for something else. The **tiny** build omits ELK to stay small, and falls back to Dagre for diagrams that request it. diff --git a/packages/mermaid/src/docs/intro/syntax-reference.md b/packages/mermaid/src/docs/intro/syntax-reference.md index 8cb189ad58c..553823b75f2 100644 --- a/packages/mermaid/src/docs/intro/syntax-reference.md +++ b/packages/mermaid/src/docs/intro/syntax-reference.md @@ -96,7 +96,7 @@ An application of using Directives to change [Themes](../config/theming.md). `Th ### Layout and look -We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowcharts and state diagrams**, with plans to extend support to all diagram types. +We've restructured how Mermaid renders diagrams, enabling new features like selecting layout and look. **Currently, this is supported for flowchart, state, class, entity relationship, requirement, use case, and agentflow diagrams**, with plans to extend support to all diagram types. Mindmaps are the exception: they keep their own `cose-bilkent` layout unless a layout is explicitly set (the tiny build, which ships neither ELK nor cose-bilkent, falls back to Dagre). ### Selecting Diagram Looks diff --git a/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md b/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md index e7d9f5e9e57..f0519dd6949 100644 --- a/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md +++ b/packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md @@ -632,7 +632,7 @@ Your Mermaid code should be similar to the following: --- title: Order example config: - layout: elk + layout: dagre --- erDiagram CUSTOMER ||--o{ ORDER : places @@ -640,8 +640,4 @@ erDiagram CUSTOMER }|..|{ DELIVERY-ADDRESS : uses ``` -```note -Note that the site needs to use mermaid version 9.4+ for this to work and have this featured enabled in the lazy-loading configuration. -``` - diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts index a6eeaa7e6ac..429e3f5b4f3 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts @@ -59,10 +59,10 @@ describe('prepareLayoutForElk host config sync', () => { // sync that ran later would be too late to affect how they are measured. const order: string[] = []; setConfigMock.mockImplementation(() => order.push('setConfig')); + // Instrument `edges`, the property `applyElkEdgeRenderData` actually reads. const data = { nodes: [], - edges: [], - get markers() { + get edges() { order.push('data-read'); return []; }, @@ -70,6 +70,7 @@ describe('prepareLayoutForElk host config sync', () => { prepareLayoutForElk(data, contextWithHostConfig); - expect(order[0]).toBe('setConfig'); + expect(order).toContain('data-read'); + expect(order.indexOf('setConfig')).toBeLessThan(order.indexOf('data-read')); }); }); diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts index 8a8f3770948..5f74863d9d0 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts @@ -172,7 +172,9 @@ describe('buildSubgraphLayoutOptions', () => { // `nodePlacementStrategy`. const opts = buildSubgraphLayoutOptions({}, { nodePlacementStrategy: 'SIMPLE' }, 'layered'); - expect(opts).not.toHaveProperty('nodePlacement.strategy'); + // Array form: the flat key contains a dot, which the string form would + // misread as a nested path and pass vacuously. + expect(opts).not.toHaveProperty(['nodePlacement.strategy']); expect(opts['elk.layered.nodePlacement.strategy']).toBe('SIMPLE'); }); @@ -909,297 +911,291 @@ describe('clearContainerAlgorithmOptions', () => { expect(options['elk.layered.nodePlacement.strategy']).toBe('BRANDES_KOEPF'); expect(options['nodeLabels.placement']).toBe('[H_CENTER V_TOP, INSIDE]'); }); +}); - describe('evenGroupFrames', () => { - /** - * Build the two structures the pass reads: the ELK tree (for `isGroup` and - * `children`) and `nodeDb`, whose entries carry the absolute box that - * `applyElkNodePositions` has already written. - */ - function scene(groupBox: { x: number; y: number; w: number; h: number }, kids: number[][]) { - const nodeDb: Record = { - g: { - id: 'g', - isGroup: true, - offset: { posX: groupBox.x, posY: groupBox.y }, - width: groupBox.w, - height: groupBox.h, - }, - }; - const children = kids.map(([x, y, w, h], i) => { - nodeDb[`n${i}`] = { id: `n${i}`, offset: { posX: x, posY: y }, width: w, height: h }; - return { id: `n${i}` }; - }); - const elk = [{ id: 'g', isGroup: true, children, labelData: { width: 0 }, labels: [] }]; - return { elk, nodeDb, layoutState: { nodeDb } as any }; - } - - it('pulls a frame in to even padding when a routing lane inflated one side', () => { - // The reported shape: nodes 100 wide sitting 24 from the left of the frame, - // with the frame running 76 past their right because ELK held a lane there - // for an edge routed back around the outside. - const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 200, h: 148 }, [ - [24, 48, 100, 76], - ]); - - evenGroupFrames(elk, layoutState, new Map()); - - const g = nodeDb.g; - expect(g.offset.posX).toBe(0); - expect(g.width).toBe(148); // 24 + 100 + 24 - // Top is deliberately untouched: it carries the subgraph's title strip. - expect(g.offset.posY).toBe(0); - expect(g.height).toBe(148); // 48 title strip + 76 + 24 +describe('evenGroupFrames', () => { + /** + * Build the two structures the pass reads: the ELK tree (for `isGroup` and + * `children`) and `nodeDb`, whose entries carry the absolute box that + * `applyElkNodePositions` has already written. + */ + function scene(groupBox: { x: number; y: number; w: number; h: number }, kids: number[][]) { + const nodeDb: Record = { + g: { + id: 'g', + isGroup: true, + offset: { posX: groupBox.x, posY: groupBox.y }, + width: groupBox.w, + height: groupBox.h, + }, + }; + const children = kids.map(([x, y, w, h], i) => { + nodeDb[`n${i}`] = { id: `n${i}`, offset: { posX: x, posY: y }, width: w, height: h }; + return { id: `n${i}` }; }); + const elk = [{ id: 'g', isGroup: true, children, labelData: { width: 0 }, labels: [] }]; + return { elk, nodeDb, layoutState: { nodeDb } as any }; + } + + it('pulls a frame in to even padding when a routing lane inflated one side', () => { + // The reported shape: nodes 100 wide sitting 24 from the left of the frame, + // with the frame running 76 past their right because ELK held a lane there + // for an edge routed back around the outside. + const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 200, h: 148 }, [[24, 48, 100, 76]]); + + evenGroupFrames(elk, layoutState, new Map()); + + const g = nodeDb.g; + expect(g.offset.posX).toBe(0); + expect(g.width).toBe(148); // 24 + 100 + 24 + // Top is deliberately untouched: it carries the subgraph's title strip. + expect(g.offset.posY).toBe(0); + expect(g.height).toBe(148); // 48 title strip + 76 + 24 + }); - it('leaves a frame alone when its padding is already even', () => { - const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 148, h: 148 }, [ - [24, 48, 100, 76], - ]); - - evenGroupFrames(elk, layoutState, new Map()); + it('leaves a frame alone when its padding is already even', () => { + const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 148, h: 148 }, [[24, 48, 100, 76]]); - expect(nodeDb.g.width).toBe(148); - expect(nodeDb.g.height).toBe(148); - }); + evenGroupFrames(elk, layoutState, new Map()); - it('never squeezes a frame narrower than its own title', () => { - // A one-node group under a long title. Pulling in to the node would cut - // the title off, so the floor wins it back. - const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 300, h: 148 }, [ - [24, 48, 40, 76], - ]); - elk[0].labelData = { width: 200 }; - - evenGroupFrames(elk, layoutState, new Map()); - - expect(nodeDb.g.width).toBe(200); - // Centring on the node's midpoint at x=44 would want to start at -56, but - // the frame is clamped to what ELK gave. Pulling a frame IN is the only - // thing this pass may do — a title too wide for its own frame is ELK's to - // size, and widening it here would paper over that. - expect(nodeDb.g.offset.posX).toBe(0); - }); + expect(nodeDb.g.width).toBe(148); + expect(nodeDb.g.height).toBe(148); + }); - it('measures a parent against children it has already pulled in', () => { - // Nested groups: the inner frame is inflated by 76 on the right and the - // outer one wraps it. Going deepest-first means the outer frame measures - // the tightened inner box, not the original. - const nodeDb: Record = { - outer: { - id: 'outer', - isGroup: true, - offset: { posX: 0, posY: 0 }, - width: 300, - height: 220, - }, - inner: { - id: 'inner', - isGroup: true, - offset: { posX: 24, posY: 48 }, - width: 200, - height: 148, - }, - leaf: { id: 'leaf', offset: { posX: 48, posY: 96 }, width: 100, height: 76 }, - }; - const elk = [ - { - id: 'outer', - isGroup: true, - labelData: { width: 0 }, - labels: [], - children: [ - { - id: 'inner', - isGroup: true, - labelData: { width: 0 }, - labels: [], - children: [{ id: 'leaf' }], - }, - ], - }, - ]; + it('never squeezes a frame narrower than its own title', () => { + // A one-node group under a long title. Pulling in to the node would cut + // the title off, so the floor wins it back. + const { elk, nodeDb, layoutState } = scene({ x: 0, y: 0, w: 300, h: 148 }, [[24, 48, 40, 76]]); + elk[0].labelData = { width: 200 }; - evenGroupFrames(elk, { nodeDb } as any, new Map()); + evenGroupFrames(elk, layoutState, new Map()); - expect(nodeDb.inner.width).toBe(148); // 24 + 100 + 24 - expect(nodeDb.outer.width).toBe(196); // 24 + 148 + 24 - }); + expect(nodeDb.g.width).toBe(200); + // Centring on the node's midpoint at x=44 would want to start at -56, but + // the frame is clamped to what ELK gave. Pulling a frame IN is the only + // thing this pass may do — a title too wide for its own frame is ELK's to + // size, and widening it here would paper over that. + expect(nodeDb.g.offset.posX).toBe(0); + }); - it("keeps a frame around a lane belonging to the group's own interior", () => { - // The nested case. An edge from inside C to a sibling of C is routed around - // C: that lane is OUTSIDE C, so C is pulled in past it, but it is INSIDE P - // and P must stay drawn around it. Measuring P from child boxes alone left - // the edge running outside a group it never leaves. - const nodeDb: Record = { - P: { id: 'P', isGroup: true, offset: { posX: 0, posY: 0 }, width: 400, height: 220 }, - C: { id: 'C', isGroup: true, offset: { posX: 24, posY: 48 }, width: 200, height: 148 }, - leaf: { id: 'leaf', offset: { posX: 48, posY: 96 }, width: 100, height: 76 }, - sib: { id: 'sib', offset: { posX: 260, posY: 96 }, width: 60, height: 76 }, - }; - const elk = [ - { - id: 'P', - isGroup: true, - labelData: { width: 0 }, - labels: [], - children: [ - { - id: 'C', - isGroup: true, - labelData: { width: 0 }, - labels: [], - children: [{ id: 'leaf' }], - }, - { id: 'sib' }, - ], - }, - ]; - // Routed out of `leaf`, around C at x=350, and back to `sib`. Sections sit - // in P's coordinate space, so `calcOffset` resolves them against P. - const graph = { - edges: [ + it('measures a parent against children it has already pulled in', () => { + // Nested groups: the inner frame is inflated by 76 on the right and the + // outer one wraps it. Going deepest-first means the outer frame measures + // the tightened inner box, not the original. + const nodeDb: Record = { + outer: { + id: 'outer', + isGroup: true, + offset: { posX: 0, posY: 0 }, + width: 300, + height: 220, + }, + inner: { + id: 'inner', + isGroup: true, + offset: { posX: 24, posY: 48 }, + width: 200, + height: 148, + }, + leaf: { id: 'leaf', offset: { posX: 48, posY: 96 }, width: 100, height: 76 }, + }; + const elk = [ + { + id: 'outer', + isGroup: true, + labelData: { width: 0 }, + labels: [], + children: [ { - id: 'e', - sources: ['leaf'], - targets: ['sib'], - sections: [ - { - startPoint: { x: 148, y: 134 }, - bendPoints: [ - { x: 350, y: 134 }, - { x: 350, y: 60 }, - ], - endPoint: { x: 260, y: 134 }, - }, - ], + id: 'inner', + isGroup: true, + labelData: { width: 0 }, + labels: [], + children: [{ id: 'leaf' }], }, ], - }; - const layoutState = { - nodeDb, - parentLookupDb: { parentById: { leaf: 'C', C: 'P', sib: 'P' } }, - }; - - evenGroupFrames(elk, layoutState as any, new Map(), graph as any); - - // C ignores the lane — it leaves C — and pulls in to its one child. - expect(nodeDb.C.width).toBe(148); - // P keeps it: the lane reaches x=350, so the frame runs to 350 + 24. - expect(nodeDb.P.offset.posX + nodeDb.P.width).toBe(374); - }); - - it("leaves ELK's own origin readable after moving a frame", () => { - // Edge sections resolve against the container's ORIGINAL origin, so moving - // a frame must not overwrite it or every edge inside would shift with it. - const nodeDb: Record = { - g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 200, height: 148 }, - n: { id: 'n', offset: { posX: 40, posY: 48 }, width: 100, height: 76 }, - }; - - evenGroupFrames( - [{ id: 'g', isGroup: true, labelData: { width: 0 }, labels: [], children: [{ id: 'n' }] }], - { nodeDb } as any, - new Map() - ); - - expect(nodeDb.g.offset.posX).toBe(16); // frame moved in to 40 - 24 - expect(nodeDb.g.elkOrigin).toEqual({ posX: 0, posY: 0 }); - }); - - it('never grows a frame beyond what ELK sized it to', () => { - // ELK sized the container around everything it put inside, so a measurement - // here that wants MORE room means this pass got something wrong. Clamp - // rather than trust it. - const nodeDb: Record = { - g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 120, height: 148 }, - n: { id: 'n', offset: { posX: 10, posY: 48 }, width: 100, height: 76 }, - }; - - evenGroupFrames( - [{ id: 'g', isGroup: true, labelData: { width: 0 }, labels: [], children: [{ id: 'n' }] }], - { nodeDb } as any, - new Map() - ); + }, + ]; - // 10 - 24 would put the left edge at -14 and 110 + 24 the right at 134; - // both are clamped back to the frame ELK gave. - expect(nodeDb.g.offset.posX).toBe(0); - expect(nodeDb.g.width).toBe(120); - }); + evenGroupFrames(elk, { nodeDb } as any, new Map()); - it('paints the clamped frame, not the wider title, into the layout node', () => { - // Every other test here passes an empty `nodeById`, so the branch that - // writes the node the renderer actually paints from went uncovered — and - // that is where the clamp was being undone. - // - // A 100-wide frame under a 200-wide title. The clamp refuses to widen the - // frame, so the layout node must not report 200 either: `clusters.js` - // sizes the painted rect from `node.width`, so a 200 here paints a frame - // 100 units wider than ELK reserved. - const nodeDb: Record = { - g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 100, height: 148 }, - n: { id: 'n', offset: { posX: 10, posY: 48 }, width: 40, height: 76 }, - }; - const layoutNode = { id: 'g', x: 0, y: 0, width: 0, height: 0 } as any; + expect(nodeDb.inner.width).toBe(148); // 24 + 100 + 24 + expect(nodeDb.outer.width).toBe(196); // 24 + 148 + 24 + }); - evenGroupFrames( - [ + it("keeps a frame around a lane belonging to the group's own interior", () => { + // The nested case. An edge from inside C to a sibling of C is routed around + // C: that lane is OUTSIDE C, so C is pulled in past it, but it is INSIDE P + // and P must stay drawn around it. Measuring P from child boxes alone left + // the edge running outside a group it never leaves. + const nodeDb: Record = { + P: { id: 'P', isGroup: true, offset: { posX: 0, posY: 0 }, width: 400, height: 220 }, + C: { id: 'C', isGroup: true, offset: { posX: 24, posY: 48 }, width: 200, height: 148 }, + leaf: { id: 'leaf', offset: { posX: 48, posY: 96 }, width: 100, height: 76 }, + sib: { id: 'sib', offset: { posX: 260, posY: 96 }, width: 60, height: 76 }, + }; + const elk = [ + { + id: 'P', + isGroup: true, + labelData: { width: 0 }, + labels: [], + children: [ { - id: 'g', + id: 'C', isGroup: true, - labelData: { width: 200 }, + labelData: { width: 0 }, labels: [], - children: [{ id: 'n' }], + children: [{ id: 'leaf' }], }, + { id: 'sib' }, ], - { nodeDb } as any, - new Map([['g', layoutNode]]) - ); + }, + ]; + // Routed out of `leaf`, around C at x=350, and back to `sib`. Sections sit + // in P's coordinate space, so `calcOffset` resolves them against P. + const graph = { + edges: [ + { + id: 'e', + sources: ['leaf'], + targets: ['sib'], + sections: [ + { + startPoint: { x: 148, y: 134 }, + bendPoints: [ + { x: 350, y: 134 }, + { x: 350, y: 60 }, + ], + endPoint: { x: 260, y: 134 }, + }, + ], + }, + ], + }; + const layoutState = { + nodeDb, + parentLookupDb: { parentById: { leaf: 'C', C: 'P', sib: 'P' } }, + }; + + evenGroupFrames(elk, layoutState as any, new Map(), graph as any); + + // C ignores the lane — it leaves C — and pulls in to its one child. + expect(nodeDb.C.width).toBe(148); + // P keeps it: the lane reaches x=350, so the frame runs to 350 + 24. + expect(nodeDb.P.offset.posX + nodeDb.P.width).toBe(374); + }); - expect(nodeDb.g.width).toBe(100); - expect(layoutNode.width).toBe(100); - expect(layoutNode.width).toBe(nodeDb.g.width); - }); + it("leaves ELK's own origin readable after moving a frame", () => { + // Edge sections resolve against the container's ORIGINAL origin, so moving + // a frame must not overwrite it or every edge inside would shift with it. + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 200, height: 148 }, + n: { id: 'n', offset: { posX: 40, posY: 48 }, width: 100, height: 76 }, + }; + + evenGroupFrames( + [{ id: 'g', isGroup: true, labelData: { width: 0 }, labels: [], children: [{ id: 'n' }] }], + { nodeDb } as any, + new Map() + ); - it('still reports the honoured title floor when ELK left room for it', () => { - // The other side of the same branch: here the 200-wide title fits inside - // the 300 ELK gave, so the floor is honoured and the layout node carries - // it. Without this the fix above could pass by always shrinking. - const nodeDb: Record = { - g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 300, height: 148 }, - n: { id: 'n', offset: { posX: 24, posY: 48 }, width: 40, height: 76 }, - }; - const layoutNode = { id: 'g', x: 0, y: 0, width: 0, height: 0 } as any; + expect(nodeDb.g.offset.posX).toBe(16); // frame moved in to 40 - 24 + expect(nodeDb.g.elkOrigin).toEqual({ posX: 0, posY: 0 }); + }); - evenGroupFrames( - [ - { - id: 'g', - isGroup: true, - labelData: { width: 200 }, - labels: [], - children: [{ id: 'n' }], - }, - ], - { nodeDb } as any, - new Map([['g', layoutNode]]) - ); + it('never grows a frame beyond what ELK sized it to', () => { + // ELK sized the container around everything it put inside, so a measurement + // here that wants MORE room means this pass got something wrong. Clamp + // rather than trust it. + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 120, height: 148 }, + n: { id: 'n', offset: { posX: 10, posY: 48 }, width: 100, height: 76 }, + }; + + evenGroupFrames( + [{ id: 'g', isGroup: true, labelData: { width: 0 }, labels: [], children: [{ id: 'n' }] }], + { nodeDb } as any, + new Map() + ); - expect(nodeDb.g.width).toBe(200); - expect(layoutNode.width).toBe(200); - }); + // 10 - 24 would put the left edge at -14 and 110 + 24 the right at 134; + // both are clamped back to the frame ELK gave. + expect(nodeDb.g.offset.posX).toBe(0); + expect(nodeDb.g.width).toBe(120); + }); - it('skips a group with no children rather than collapsing it', () => { - const nodeDb: Record = { - g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 200, height: 100 }, - }; + it('paints the clamped frame, not the wider title, into the layout node', () => { + // Every other test here passes an empty `nodeById`, so the branch that + // writes the node the renderer actually paints from went uncovered — and + // that is where the clamp was being undone. + // + // A 100-wide frame under a 200-wide title. The clamp refuses to widen the + // frame, so the layout node must not report 200 either: `clusters.js` + // sizes the painted rect from `node.width`, so a 200 here paints a frame + // 100 units wider than ELK reserved. + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 100, height: 148 }, + n: { id: 'n', offset: { posX: 10, posY: 48 }, width: 40, height: 76 }, + }; + const layoutNode = { id: 'g', x: 0, y: 0, width: 0, height: 0 } as any; + + evenGroupFrames( + [ + { + id: 'g', + isGroup: true, + labelData: { width: 200 }, + labels: [], + children: [{ id: 'n' }], + }, + ], + { nodeDb } as any, + new Map([['g', layoutNode]]) + ); - evenGroupFrames([{ id: 'g', isGroup: true, children: [] }], { nodeDb } as any, new Map()); + expect(nodeDb.g.width).toBe(100); + expect(layoutNode.width).toBe(100); + expect(layoutNode.width).toBe(nodeDb.g.width); + }); - expect(nodeDb.g.width).toBe(200); - expect(nodeDb.g.height).toBe(100); - }); + it('still reports the honoured title floor when ELK left room for it', () => { + // The other side of the same branch: here the 200-wide title fits inside + // the 300 ELK gave, so the floor is honoured and the layout node carries + // it. Without this the fix above could pass by always shrinking. + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 300, height: 148 }, + n: { id: 'n', offset: { posX: 24, posY: 48 }, width: 40, height: 76 }, + }; + const layoutNode = { id: 'g', x: 0, y: 0, width: 0, height: 0 } as any; + + evenGroupFrames( + [ + { + id: 'g', + isGroup: true, + labelData: { width: 200 }, + labels: [], + children: [{ id: 'n' }], + }, + ], + { nodeDb } as any, + new Map([['g', layoutNode]]) + ); + + expect(nodeDb.g.width).toBe(200); + expect(layoutNode.width).toBe(200); + }); + + it('skips a group with no children rather than collapsing it', () => { + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 200, height: 100 }, + }; + + evenGroupFrames([{ id: 'g', isGroup: true, children: [] }], { nodeDb } as any, new Map()); + + expect(nodeDb.g.width).toBe(200); + expect(nodeDb.g.height).toBe(100); }); }); diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/elkOptionCatalogue.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/elkOptionCatalogue.ts index 954f57b216a..93e58ea1b86 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/elkOptionCatalogue.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/elkOptionCatalogue.ts @@ -232,10 +232,12 @@ export const EDGE_ROUTING_OPTIONS: Record = { /* ──────────────────────────────────────────────────────────────────────────── * THE SWITCH * - * Everything above is reference material — inert, imported by nothing, there to - * be read and copied from. The two objects below are the opposite: they ARE - * imported, and whatever they contain is merged over the shipping layout - * options as the last word. That is the on/off switch. + * Everything above is reference material to read and copy from — but it is not + * inert: `render.ts` imports `PLACEMENT_OPTIONS` and `EDGE_ROUTING_OPTIONS` too + * and merges them over the ROOT graph's layout options, so uncommenting a line + * up there switches it on just as surely. The two objects below are the + * per-scope scratch pads, merged as the last word over the root and subgraph + * options. All four objects together are the on/off switch. * * To try an option: copy its line out of the catalogue above into the matching * object below and uncomment it. To switch back off: re-comment it. Nothing in @@ -243,8 +245,9 @@ export const EDGE_ROUTING_OPTIONS: Record = { * behind as a stray edit in production code — which is how the previous round * of these ended up deleted rather than kept. * - * Both MUST be empty on `develop`. `elkOptionCatalogue.spec.ts` asserts exactly - * that, so an override left switched on fails the build instead of shipping. + * All four MUST be empty on `develop`. `elkOptionCatalogue.spec.ts` asserts + * exactly that, so an override left switched on fails the build instead of + * shipping. * * Which object to use matters more than it looks: options set on the ROOT graph * do NOT reach subgraphs — containers get their own set — so `spacing.*`, From e52879a003c93e71476fddd4a5ef4bc333853083 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2026 13:12:03 +0000 Subject: [PATCH 22/31] [autofix.ci] apply automated fixes --- .../setup/config/functions/addDirective.md | 2 +- .../config/setup/config/functions/evaluate.md | 2 +- .../setup/config/functions/getConfig.md | 2 +- .../functions/getEffectiveHtmlLabels.md | 2 +- .../setup/config/functions/getSiteConfig.md | 2 +- .../config/functions/getUserDefinedConfig.md | 2 +- docs/config/setup/config/functions/reset.md | 2 +- .../config/setup/config/functions/sanitize.md | 2 +- .../functions/saveConfigFromInitialize.md | 2 +- .../setup/config/functions/setConfig.md | 2 +- .../config/functions/setDiagramConfigScope.md | 2 +- .../setup/config/functions/setSiteConfig.md | 2 +- .../config/functions/updateSiteConfig.md | 2 +- .../setup/config/variables/defaultConfig.md | 2 +- .../defaultConfig/variables/configKeys.md | 2 +- .../setup/defaultConfig/variables/default.md | 2 +- .../mermaid/functions/applyLineJumpsToSvg.md | 2 +- .../functions/clearLayoutRenderState.md | 2 +- .../functions/createCommonLayoutRenderer.md | 2 +- .../mermaid/functions/defaultMeasureLayout.md | 2 +- .../mermaid/functions/paintLayoutData.md | 2 +- .../mermaid/interfaces/AsyncIconLoader.md | 6 +- .../interfaces/CommonLayoutPaintContext.md | 12 +- .../interfaces/CommonLayoutPaintOptions.md | 16 +-- .../interfaces/CommonLayoutRenderContext.md | 10 +- .../CommonLayoutRendererDefinition.md | 14 +-- .../setup/mermaid/interfaces/DetailedError.md | 10 +- .../setup/mermaid/interfaces/EdgeGeom.md | 12 +- .../interfaces/ExternalDiagramDefinition.md | 8 +- .../setup/mermaid/interfaces/LayoutData.md | 10 +- .../interfaces/LayoutLoaderDefinition.md | 8 +- .../mermaid/interfaces/LineJumpConfig.md | 8 +- .../setup/mermaid/interfaces/Mermaid.md | 32 ++--- .../setup/mermaid/interfaces/MermaidConfig.md | 118 +++++++++--------- .../setup/mermaid/interfaces/ParseOptions.md | 4 +- .../setup/mermaid/interfaces/ParseResult.md | 6 +- .../setup/mermaid/interfaces/RenderOptions.md | 4 +- .../setup/mermaid/interfaces/RenderResult.md | 8 +- .../setup/mermaid/interfaces/RunOptions.md | 10 +- .../mermaid/interfaces/SyncIconLoader.md | 6 +- .../mermaid/interfaces/UnknownDiagramError.md | 2 +- .../type-aliases/CommonLayoutMeasure.md | 2 +- .../setup/mermaid/type-aliases/IconLoader.md | 2 +- .../mermaid/type-aliases/InternalHelpers.md | 2 +- .../type-aliases/ParseErrorFunction.md | 2 +- docs/config/setup/mermaid/type-aliases/SVG.md | 2 +- .../setup/mermaid/type-aliases/SVGGroup.md | 2 +- .../config/setup/mermaid/variables/default.md | 2 +- 48 files changed, 180 insertions(+), 180 deletions(-) diff --git a/docs/config/setup/config/functions/addDirective.md b/docs/config/setup/config/functions/addDirective.md index 3e9480d2235..9b4616db1f7 100644 --- a/docs/config/setup/config/functions/addDirective.md +++ b/docs/config/setup/config/functions/addDirective.md @@ -12,7 +12,7 @@ > **addDirective**(`directive`): `void` -Defined in: packages/mermaid/src/config.ts:277 +Defined in: [packages/mermaid/src/config.ts:277](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L277) Pushes in a directive to the configuration diff --git a/docs/config/setup/config/functions/evaluate.md b/docs/config/setup/config/functions/evaluate.md index d49e4df9203..b40b6de8b61 100644 --- a/docs/config/setup/config/functions/evaluate.md +++ b/docs/config/setup/config/functions/evaluate.md @@ -12,7 +12,7 @@ > **evaluate**(`val?`): `boolean` -Defined in: packages/mermaid/src/config.ts:62 +Defined in: [packages/mermaid/src/config.ts:62](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L62) Converts a string/boolean into a boolean diff --git a/docs/config/setup/config/functions/getConfig.md b/docs/config/setup/config/functions/getConfig.md index 061ef29a784..7bfd5d5add3 100644 --- a/docs/config/setup/config/functions/getConfig.md +++ b/docs/config/setup/config/functions/getConfig.md @@ -12,7 +12,7 @@ > **getConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:224 +Defined in: [packages/mermaid/src/config.ts:224](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L224) Returns a copy of the `currentConfig`. diff --git a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md index 28be45be93f..42944fcd919 100644 --- a/docs/config/setup/config/functions/getEffectiveHtmlLabels.md +++ b/docs/config/setup/config/functions/getEffectiveHtmlLabels.md @@ -12,7 +12,7 @@ > **getEffectiveHtmlLabels**(`config`): `boolean` -Defined in: packages/mermaid/src/config.ts:352 +Defined in: [packages/mermaid/src/config.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L352) Helper function to handle deprecated flowchart.htmlLabels diff --git a/docs/config/setup/config/functions/getSiteConfig.md b/docs/config/setup/config/functions/getSiteConfig.md index 58509a4db26..ceed814fa5f 100644 --- a/docs/config/setup/config/functions/getSiteConfig.md +++ b/docs/config/setup/config/functions/getSiteConfig.md @@ -12,7 +12,7 @@ > **getSiteConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:198 +Defined in: [packages/mermaid/src/config.ts:198](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L198) Returns a copy of the current `siteConfig` base configuration. diff --git a/docs/config/setup/config/functions/getUserDefinedConfig.md b/docs/config/setup/config/functions/getUserDefinedConfig.md index 159f119a4c2..9b3e20f1167 100644 --- a/docs/config/setup/config/functions/getUserDefinedConfig.md +++ b/docs/config/setup/config/functions/getUserDefinedConfig.md @@ -12,7 +12,7 @@ > **getUserDefinedConfig**(): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:333 +Defined in: [packages/mermaid/src/config.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L333) ## Returns diff --git a/docs/config/setup/config/functions/reset.md b/docs/config/setup/config/functions/reset.md index cc69644d4e1..6433ae1eb09 100644 --- a/docs/config/setup/config/functions/reset.md +++ b/docs/config/setup/config/functions/reset.md @@ -12,7 +12,7 @@ > **reset**(`config`): `void` -Defined in: packages/mermaid/src/config.ts:298 +Defined in: [packages/mermaid/src/config.ts:298](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L298) Resets the current config and applied directives to the provided config. diff --git a/docs/config/setup/config/functions/sanitize.md b/docs/config/setup/config/functions/sanitize.md index ba72a7553b5..1915ed847bb 100644 --- a/docs/config/setup/config/functions/sanitize.md +++ b/docs/config/setup/config/functions/sanitize.md @@ -12,7 +12,7 @@ > **sanitize**(`options`): `void` -Defined in: packages/mermaid/src/config.ts:235 +Defined in: [packages/mermaid/src/config.ts:235](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L235) Ensures options parameter does not attempt to override `siteConfig` secure keys. diff --git a/docs/config/setup/config/functions/saveConfigFromInitialize.md b/docs/config/setup/config/functions/saveConfigFromInitialize.md index e4af4963d4b..2595da06f20 100644 --- a/docs/config/setup/config/functions/saveConfigFromInitialize.md +++ b/docs/config/setup/config/functions/saveConfigFromInitialize.md @@ -12,7 +12,7 @@ > **saveConfigFromInitialize**(`conf`): `void` -Defined in: packages/mermaid/src/config.ts:181 +Defined in: [packages/mermaid/src/config.ts:181](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L181) ## Parameters diff --git a/docs/config/setup/config/functions/setConfig.md b/docs/config/setup/config/functions/setConfig.md index 8dd49d3e71e..4dba1581080 100644 --- a/docs/config/setup/config/functions/setConfig.md +++ b/docs/config/setup/config/functions/setConfig.md @@ -12,7 +12,7 @@ > **setConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:210 +Defined in: [packages/mermaid/src/config.ts:210](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L210) Updates the `currentConfig` with the provided `conf` after sanitization. diff --git a/docs/config/setup/config/functions/setDiagramConfigScope.md b/docs/config/setup/config/functions/setDiagramConfigScope.md index 660799e631f..9e3cb4f0610 100644 --- a/docs/config/setup/config/functions/setDiagramConfigScope.md +++ b/docs/config/setup/config/functions/setDiagramConfigScope.md @@ -12,7 +12,7 @@ > **setDiagramConfigScope**(`diagramType?`): `void` -Defined in: packages/mermaid/src/config.ts:150 +Defined in: [packages/mermaid/src/config.ts:150](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L150) Names the diagram type being parsed or rendered, so its own appearance defaults apply. diff --git a/docs/config/setup/config/functions/setSiteConfig.md b/docs/config/setup/config/functions/setSiteConfig.md index 2147829e6a2..39c64220614 100644 --- a/docs/config/setup/config/functions/setSiteConfig.md +++ b/docs/config/setup/config/functions/setSiteConfig.md @@ -12,7 +12,7 @@ > **setSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:164 +Defined in: [packages/mermaid/src/config.ts:164](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L164) Sets the `siteConfig` to the desired values. diff --git a/docs/config/setup/config/functions/updateSiteConfig.md b/docs/config/setup/config/functions/updateSiteConfig.md index faf42549807..3ee515e24f9 100644 --- a/docs/config/setup/config/functions/updateSiteConfig.md +++ b/docs/config/setup/config/functions/updateSiteConfig.md @@ -12,7 +12,7 @@ > **updateSiteConfig**(`conf`): [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:185 +Defined in: [packages/mermaid/src/config.ts:185](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L185) ## Parameters diff --git a/docs/config/setup/config/variables/defaultConfig.md b/docs/config/setup/config/variables/defaultConfig.md index b2e554ac90d..c351c83d350 100644 --- a/docs/config/setup/config/variables/defaultConfig.md +++ b/docs/config/setup/config/variables/defaultConfig.md @@ -12,4 +12,4 @@ > `const` **defaultConfig**: [`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md) -Defined in: packages/mermaid/src/config.ts:9 +Defined in: [packages/mermaid/src/config.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.ts#L9) diff --git a/docs/config/setup/defaultConfig/variables/configKeys.md b/docs/config/setup/defaultConfig/variables/configKeys.md index 4b1b8666aab..49a59f48597 100644 --- a/docs/config/setup/defaultConfig/variables/configKeys.md +++ b/docs/config/setup/defaultConfig/variables/configKeys.md @@ -12,4 +12,4 @@ > `const` **configKeys**: `Set`<`string`> -Defined in: packages/mermaid/src/defaultConfig.ts:358 +Defined in: [packages/mermaid/src/defaultConfig.ts:358](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L358) diff --git a/docs/config/setup/defaultConfig/variables/default.md b/docs/config/setup/defaultConfig/variables/default.md index dd4f6acae93..ccb6d130231 100644 --- a/docs/config/setup/defaultConfig/variables/default.md +++ b/docs/config/setup/defaultConfig/variables/default.md @@ -12,7 +12,7 @@ > `const` **default**: `RequiredDeep`<[`MermaidConfig`](../../mermaid/interfaces/MermaidConfig.md)> -Defined in: packages/mermaid/src/defaultConfig.ts:18 +Defined in: [packages/mermaid/src/defaultConfig.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L18) Default mermaid configuration options. diff --git a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md index 56750531427..18e5320b618 100644 --- a/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md +++ b/docs/config/setup/mermaid/functions/applyLineJumpsToSvg.md @@ -12,7 +12,7 @@ > **applyLineJumpsToSvg**(`edgePathsGroup`, `edges`, `config`): `void` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:646](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L646) Patches the rendered SVG paths in `edgePathsGroup` for any edges that cross. The true geometry is read from each path's `data-points` attribute diff --git a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md index c3894f099c0..4b3074ad135 100644 --- a/docs/config/setup/mermaid/functions/clearLayoutRenderState.md +++ b/docs/config/setup/mermaid/functions/clearLayoutRenderState.md @@ -12,7 +12,7 @@ > **clearLayoutRenderState**(): `void` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:207](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L207) ## Returns diff --git a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md index a237aba61c7..196bcc2011c 100644 --- a/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md +++ b/docs/config/setup/mermaid/functions/createCommonLayoutRenderer.md @@ -12,7 +12,7 @@ > **createCommonLayoutRenderer**<`CoreResult`, `PreparedLayout`, `MeasureResult`>(`__namedParameters`): (`data4Layout`, `svg`, `helpers?`, `options?`) => `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L108) ## Type Parameters diff --git a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md index 1f22dcd817a..7b000c68209 100644 --- a/docs/config/setup/mermaid/functions/defaultMeasureLayout.md +++ b/docs/config/setup/mermaid/functions/defaultMeasureLayout.md @@ -12,7 +12,7 @@ > **defaultMeasureLayout**(`data4Layout`, `__namedParameters`, `options?`): `Promise`<{ `graph`: `Graph`; `groups`: { `clusters`: `D3Selection`<`SVGGElement`>; `edgeLabels`: `D3Selection`<`SVGGElement`>; `edgePaths`: `D3Selection`<`SVGGElement`>; `nodes`: `D3Selection`<`SVGGElement`>; `rootGroups`: `D3Selection`<`SVGGElement`>; }; `nodeElements`: `Map`<`string`, `D3Selection`<`SVGElement` | `SVGGElement`>>; }> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:214](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L214) ## Parameters diff --git a/docs/config/setup/mermaid/functions/paintLayoutData.md b/docs/config/setup/mermaid/functions/paintLayoutData.md index 968edfed6c6..a530379b9b1 100644 --- a/docs/config/setup/mermaid/functions/paintLayoutData.md +++ b/docs/config/setup/mermaid/functions/paintLayoutData.md @@ -12,7 +12,7 @@ > **paintLayoutData**(`data4Layout`, `context`, `options`): `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:222](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L222) ## Parameters diff --git a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md index 6de9e44c956..31912c30c5e 100644 --- a/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/AsyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: AsyncIconLoader -Defined in: packages/mermaid/src/rendering-util/icons.ts:8 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:8](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L8) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:8 > **loader**: () => `Promise`<`IconifyJSON`> -Defined in: packages/mermaid/src/rendering-util/icons.ts:10 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:10](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L10) #### Returns @@ -30,4 +30,4 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:10 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/icons.ts:9 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:9](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L9) diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md index 98523e59e40..0e8edc39956 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintContext\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:48](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L48) ## Extends @@ -32,7 +32,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **element**: `D3Selection`<`SVGElement`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) #### Inherited from @@ -44,7 +44,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **helpers**: `object` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) #### common @@ -491,7 +491,7 @@ The curve factory to use > **measure**: `MeasureResult` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:52](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L52) --- @@ -499,7 +499,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) #### Inherited from @@ -511,7 +511,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **preparedLayout**: `PreparedLayout` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) #### Inherited from diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md index 37c6da3d1ed..438318ae983 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutPaintOptions.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutPaintOptions -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:55](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L55) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **clusterDb**: `ClusterDb` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L56) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **getEdgeNode**: (`id`, `edge`, `context`) => `object` | `Node` | `undefined` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:61](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L61) #### Parameters @@ -52,7 +52,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **getNodes**: (`data4Layout`, `context`) => `Iterable`<`Node`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L57) #### Parameters @@ -74,7 +74,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **isCluster**: (`node`, `context`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L70) #### Parameters @@ -96,7 +96,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipEdge**: (`edge`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:74](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L74) #### Parameters @@ -114,7 +114,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipIntersect**: `boolean` | (`edge`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L75) --- @@ -122,7 +122,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **skipNode**: (`node`, `context`) => `boolean` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L66) #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md index ab1ba26bb3e..3116812f52b 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRenderContext.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRenderContext\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:41](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L41) ## Extended by @@ -28,7 +28,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **element**: `D3Selection`<`SVGElement`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:42](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L42) --- @@ -36,7 +36,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **helpers**: `object` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:43](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L43) #### common @@ -479,7 +479,7 @@ The curve factory to use > `optional` **options**: [`RenderOptions`](RenderOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L44) --- @@ -487,4 +487,4 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **preparedLayout**: `PreparedLayout` -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:45](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L45) diff --git a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md index 1899d77d4d7..f1b13deb837 100644 --- a/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md +++ b/docs/config/setup/mermaid/interfaces/CommonLayoutRendererDefinition.md @@ -10,7 +10,7 @@ # Interface: CommonLayoutRendererDefinition\ -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L78) ## Type Parameters @@ -32,7 +32,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **afterPaint**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:100](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L100) #### Parameters @@ -58,7 +58,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **measureLayout**: (`data4Layout`, `context`) => `Promise`<`MeasureResult`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:87](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L87) #### Parameters @@ -80,7 +80,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **paintLayout**: (`data4Layout`, `context`, `coreResult`) => `void` | `Promise`<`void`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:95](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L95) #### Parameters @@ -106,7 +106,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **paintOptions**: [`CommonLayoutPaintOptions`](CommonLayoutPaintOptions.md) -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:105](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L105) --- @@ -114,7 +114,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > `optional` **prepareLayout**: (`data4Layout`, `context`) => `PreparedLayout` | `Promise`<`PreparedLayout`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:83](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L83) #### Parameters @@ -136,7 +136,7 @@ Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.t > **runLayoutCore**: (`data4Layout`, `context`) => `CoreResult` | `Promise`<`CoreResult`> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L91) #### Parameters diff --git a/docs/config/setup/mermaid/interfaces/DetailedError.md b/docs/config/setup/mermaid/interfaces/DetailedError.md index 8744001478b..4a34e6534b9 100644 --- a/docs/config/setup/mermaid/interfaces/DetailedError.md +++ b/docs/config/setup/mermaid/interfaces/DetailedError.md @@ -10,7 +10,7 @@ # Interface: DetailedError -Defined in: packages/mermaid/src/utils.ts:782 +Defined in: [packages/mermaid/src/utils.ts:782](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L782) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/utils.ts:782 > `optional` **error**: `any` -Defined in: packages/mermaid/src/utils.ts:787 +Defined in: [packages/mermaid/src/utils.ts:787](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L787) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/utils.ts:787 > **hash**: `any` -Defined in: packages/mermaid/src/utils.ts:785 +Defined in: [packages/mermaid/src/utils.ts:785](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L785) --- @@ -34,7 +34,7 @@ Defined in: packages/mermaid/src/utils.ts:785 > `optional` **message**: `string` -Defined in: packages/mermaid/src/utils.ts:788 +Defined in: [packages/mermaid/src/utils.ts:788](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L788) --- @@ -42,4 +42,4 @@ Defined in: packages/mermaid/src/utils.ts:788 > **str**: `string` -Defined in: packages/mermaid/src/utils.ts:783 +Defined in: [packages/mermaid/src/utils.ts:783](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/utils.ts#L783) diff --git a/docs/config/setup/mermaid/interfaces/EdgeGeom.md b/docs/config/setup/mermaid/interfaces/EdgeGeom.md index 00e298c579e..26d14f335bb 100644 --- a/docs/config/setup/mermaid/interfaces/EdgeGeom.md +++ b/docs/config/setup/mermaid/interfaces/EdgeGeom.md @@ -10,7 +10,7 @@ # Interface: EdgeGeom -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L56) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:5 > `optional` **arrowTypeEnd**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L72) Arrow type at the end (last point). @@ -28,7 +28,7 @@ Arrow type at the end (last point). > `optional` **arrowTypeStart**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:70](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L70) Arrow type at the start (first point) — used to apply marker offset so the rewritten path's endpoint matches the original rendered geometry and @@ -40,7 +40,7 @@ the arrow marker orients correctly. > `optional` **curve**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L66) Optional curve hint matching `edge.curve` from the rendering layer. When set, line jumps are only applied for orthogonal-friendly curves @@ -54,7 +54,7 @@ corrupting smoothed geometry. > **id**: `string` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:57](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L57) --- @@ -62,4 +62,4 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:5 > **points**: `Point`\[] -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:58](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L58) diff --git a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md index be1dbebcd63..7f9700cd661 100644 --- a/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md +++ b/docs/config/setup/mermaid/interfaces/ExternalDiagramDefinition.md @@ -10,7 +10,7 @@ # Interface: ExternalDiagramDefinition -Defined in: packages/mermaid/src/diagram-api/types.ts:139 +Defined in: [packages/mermaid/src/diagram-api/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L139) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:139 > **detector**: `DiagramDetector` -Defined in: packages/mermaid/src/diagram-api/types.ts:141 +Defined in: [packages/mermaid/src/diagram-api/types.ts:141](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L141) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:141 > **id**: `string` -Defined in: packages/mermaid/src/diagram-api/types.ts:140 +Defined in: [packages/mermaid/src/diagram-api/types.ts:140](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L140) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/diagram-api/types.ts:140 > **loader**: `DiagramLoader` -Defined in: packages/mermaid/src/diagram-api/types.ts:142 +Defined in: [packages/mermaid/src/diagram-api/types.ts:142](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L142) diff --git a/docs/config/setup/mermaid/interfaces/LayoutData.md b/docs/config/setup/mermaid/interfaces/LayoutData.md index c86c29f5bf5..246f6c8d7ee 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutData.md +++ b/docs/config/setup/mermaid/interfaces/LayoutData.md @@ -10,7 +10,7 @@ # Interface: LayoutData -Defined in: packages/mermaid/src/rendering-util/types.ts:217 +Defined in: [packages/mermaid/src/rendering-util/types.ts:217](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L217) ## Indexable @@ -22,7 +22,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:217 > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: packages/mermaid/src/rendering-util/types.ts:220 +Defined in: [packages/mermaid/src/rendering-util/types.ts:220](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L220) --- @@ -30,7 +30,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:220 > `optional` **diagramId**: `string` -Defined in: packages/mermaid/src/rendering-util/types.ts:221 +Defined in: [packages/mermaid/src/rendering-util/types.ts:221](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L221) --- @@ -38,7 +38,7 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:221 > **edges**: `Edge`\[] -Defined in: packages/mermaid/src/rendering-util/types.ts:219 +Defined in: [packages/mermaid/src/rendering-util/types.ts:219](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L219) --- @@ -46,4 +46,4 @@ Defined in: packages/mermaid/src/rendering-util/types.ts:219 > **nodes**: `Node`\[] -Defined in: packages/mermaid/src/rendering-util/types.ts:218 +Defined in: [packages/mermaid/src/rendering-util/types.ts:218](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/types.ts#L218) diff --git a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md index 977914fb784..e9866171c63 100644 --- a/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md +++ b/docs/config/setup/mermaid/interfaces/LayoutLoaderDefinition.md @@ -10,7 +10,7 @@ # Interface: LayoutLoaderDefinition -Defined in: packages/mermaid/src/rendering-util/render.ts:25 +Defined in: [packages/mermaid/src/rendering-util/render.ts:25](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L25) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:25 > `optional` **algorithm**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:28 +Defined in: [packages/mermaid/src/rendering-util/render.ts:28](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L28) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:28 > **loader**: `LayoutLoader` -Defined in: packages/mermaid/src/rendering-util/render.ts:27 +Defined in: [packages/mermaid/src/rendering-util/render.ts:27](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L27) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:27 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:26 +Defined in: [packages/mermaid/src/rendering-util/render.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L26) diff --git a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md index d08ede700da..798fe18338c 100644 --- a/docs/config/setup/mermaid/interfaces/LineJumpConfig.md +++ b/docs/config/setup/mermaid/interfaces/LineJumpConfig.md @@ -10,7 +10,7 @@ # Interface: LineJumpConfig -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L75) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **enabled**: `boolean` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:76](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L76) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **jumpRadius**: `number` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:77](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L77) --- @@ -34,4 +34,4 @@ Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:7 > **jumpStyle**: `"arc"` | `"gap"` -Defined in: packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78 +Defined in: [packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts:78](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/rendering-elements/lineJump.ts#L78) diff --git a/docs/config/setup/mermaid/interfaces/Mermaid.md b/docs/config/setup/mermaid/interfaces/Mermaid.md index 3e54b9d6fb1..d6bacb631c3 100644 --- a/docs/config/setup/mermaid/interfaces/Mermaid.md +++ b/docs/config/setup/mermaid/interfaces/Mermaid.md @@ -10,7 +10,7 @@ # Interface: Mermaid -Defined in: packages/mermaid/src/mermaid.ts:451 +Defined in: [packages/mermaid/src/mermaid.ts:451](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L451) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/mermaid.ts:451 > **contentLoaded**: () => `void` -Defined in: packages/mermaid/src/mermaid.ts:469 +Defined in: [packages/mermaid/src/mermaid.ts:469](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L469) \##contentLoaded Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the @@ -34,7 +34,7 @@ page. > **detectType**: (`text`, `config?`) => `string` -Defined in: packages/mermaid/src/mermaid.ts:471 +Defined in: [packages/mermaid/src/mermaid.ts:471](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L471) Detects the type of the graph text. @@ -90,7 +90,7 @@ A graph definition key > **getRegisteredDiagramsMetadata**: () => `Pick`<[`ExternalDiagramDefinition`](ExternalDiagramDefinition.md), `"id"`>\[] -Defined in: packages/mermaid/src/mermaid.ts:473 +Defined in: [packages/mermaid/src/mermaid.ts:473](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L473) Gets the metadata for all registered diagrams. Currently only the id is returned. @@ -107,7 +107,7 @@ An array of objects with the id of the diagram. > **init**: (`config?`, `nodes?`, `callback?`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:464 +Defined in: [packages/mermaid/src/mermaid.ts:464](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L464) ## init @@ -155,7 +155,7 @@ Use [initialize](#initialize) and [run](#run) instead. > **initialize**: (`config`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:468 +Defined in: [packages/mermaid/src/mermaid.ts:468](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L468) Used to set configurations for mermaid. This function should be called before the run function. @@ -178,7 +178,7 @@ Configuration object for mermaid. > **mermaidAPI**: `Readonly`<{ `defaultConfig`: [`MermaidConfig`](MermaidConfig.md); `getConfig`: () => [`MermaidConfig`](MermaidConfig.md); `getDiagramFromText`: (`text`, `metadata`) => `Promise`<`Diagram`>; `getSiteConfig`: () => [`MermaidConfig`](MermaidConfig.md); `globalReset`: () => `void`; `initialize`: (`userOptions`) => `void`; `parse`: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; }; `render`: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)>; `reset`: () => `void`; `setConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); `updateSiteConfig`: (`conf`) => [`MermaidConfig`](MermaidConfig.md); }> -Defined in: packages/mermaid/src/mermaid.ts:458 +Defined in: [packages/mermaid/src/mermaid.ts:458](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L458) **`Internal`** @@ -192,7 +192,7 @@ Use [parse](#parse) and [render](#render) instead. Please [open a discussion](ht > **parse**: {(`text`, `parseOptions`): `Promise`<`false` | [`ParseResult`](ParseResult.md)>; (`text`, `parseOptions?`): `Promise`<[`ParseResult`](ParseResult.md)>; } -Defined in: packages/mermaid/src/mermaid.ts:459 +Defined in: [packages/mermaid/src/mermaid.ts:459](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L459) #### Call Signature @@ -268,7 +268,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not > `optional` **parseError**: [`ParseErrorFunction`](../type-aliases/ParseErrorFunction.md) -Defined in: packages/mermaid/src/mermaid.ts:453 +Defined in: [packages/mermaid/src/mermaid.ts:453](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L453) --- @@ -276,7 +276,7 @@ Defined in: packages/mermaid/src/mermaid.ts:453 > **registerExternalDiagrams**: (`diagrams`, `opts`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:467 +Defined in: [packages/mermaid/src/mermaid.ts:467](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L467) Used to register external diagram types. @@ -306,7 +306,7 @@ If opts.lazyLoad is false, the diagrams will be loaded immediately. > **registerIconPacks**: (`iconLoaders`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:472 +Defined in: [packages/mermaid/src/mermaid.ts:472](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L472) #### Parameters @@ -324,7 +324,7 @@ Defined in: packages/mermaid/src/mermaid.ts:472 > **registerLayoutLoaders**: (`loaders`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:466 +Defined in: [packages/mermaid/src/mermaid.ts:466](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L466) #### Parameters @@ -342,7 +342,7 @@ Defined in: packages/mermaid/src/mermaid.ts:466 > **render**: (`id`, `text`, `svgContainingElement?`) => `Promise`<[`RenderResult`](RenderResult.md)> -Defined in: packages/mermaid/src/mermaid.ts:460 +Defined in: [packages/mermaid/src/mermaid.ts:460](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L460) Renders the diagram, holding the diagram config scope for exactly as long as the render. Leaving it set would make `getConfig()` report the last diagram's appearance as the @@ -372,7 +372,7 @@ global answer for every caller between renders. > **run**: (`options`) => `Promise`<`void`> -Defined in: packages/mermaid/src/mermaid.ts:465 +Defined in: [packages/mermaid/src/mermaid.ts:465](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L465) ## run @@ -416,7 +416,7 @@ Optional runtime configs > **setParseErrorHandler**: (`parseErrorHandler`) => `void` -Defined in: packages/mermaid/src/mermaid.ts:470 +Defined in: [packages/mermaid/src/mermaid.ts:470](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L470) ## setParseErrorHandler Alternative to directly setting parseError using: @@ -447,4 +447,4 @@ New parseError() callback. > **startOnLoad**: `boolean` -Defined in: packages/mermaid/src/mermaid.ts:452 +Defined in: [packages/mermaid/src/mermaid.ts:452](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L452) diff --git a/docs/config/setup/mermaid/interfaces/MermaidConfig.md b/docs/config/setup/mermaid/interfaces/MermaidConfig.md index d2cd22fdf1b..7db03bf3c61 100644 --- a/docs/config/setup/mermaid/interfaces/MermaidConfig.md +++ b/docs/config/setup/mermaid/interfaces/MermaidConfig.md @@ -10,7 +10,7 @@ # Interface: MermaidConfig -Defined in: packages/mermaid/src/config.type.ts:66 +Defined in: [packages/mermaid/src/config.type.ts:66](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L66) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/config.type.ts:66 > `optional` **agentflow**: `AgentflowDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:325 +Defined in: [packages/mermaid/src/config.type.ts:325](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L325) --- @@ -26,7 +26,7 @@ Defined in: packages/mermaid/src/config.type.ts:325 > `optional` **altFontFamily**: `string` -Defined in: packages/mermaid/src/config.type.ts:263 +Defined in: [packages/mermaid/src/config.type.ts:263](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L263) --- @@ -34,7 +34,7 @@ Defined in: packages/mermaid/src/config.type.ts:263 > `optional` **architecture**: `ArchitectureDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:337 +Defined in: [packages/mermaid/src/config.type.ts:337](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L337) --- @@ -42,7 +42,7 @@ Defined in: packages/mermaid/src/config.type.ts:337 > `optional` **arrowMarkerAbsolute**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:282 +Defined in: [packages/mermaid/src/config.type.ts:282](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L282) Controls whether or arrow markers in html code are absolute paths or anchors. This matters if you are using base tag settings. @@ -53,7 +53,7 @@ This matters if you are using base tag settings. > `optional` **block**: `BlockDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:345 +Defined in: [packages/mermaid/src/config.type.ts:345](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L345) --- @@ -61,7 +61,7 @@ Defined in: packages/mermaid/src/config.type.ts:345 > `optional` **c4**: `C4DiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:342 +Defined in: [packages/mermaid/src/config.type.ts:342](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L342) --- @@ -69,7 +69,7 @@ Defined in: packages/mermaid/src/config.type.ts:342 > `optional` **class**: `ClassDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:330 +Defined in: [packages/mermaid/src/config.type.ts:330](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L330) --- @@ -77,7 +77,7 @@ Defined in: packages/mermaid/src/config.type.ts:330 > `optional` **cynefin**: `CynefinDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:352 +Defined in: [packages/mermaid/src/config.type.ts:352](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L352) --- @@ -85,7 +85,7 @@ Defined in: packages/mermaid/src/config.type.ts:352 > `optional` **darkMode**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:247 +Defined in: [packages/mermaid/src/config.type.ts:247](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L247) --- @@ -93,7 +93,7 @@ Defined in: packages/mermaid/src/config.type.ts:247 > `optional` **deterministicIds**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:315 +Defined in: [packages/mermaid/src/config.type.ts:315](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L315) This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed. @@ -109,7 +109,7 @@ should not change unless content is changed. > `optional` **deterministicIDSeed**: `string` -Defined in: packages/mermaid/src/config.type.ts:322 +Defined in: [packages/mermaid/src/config.type.ts:322](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L322) This option is the optional seed for deterministic ids. If set to `undefined` but deterministicIds is `true`, a simple number iterator is used. @@ -121,7 +121,7 @@ You can set this attribute to base the seed on a static string. > `optional` **dompurifyConfig**: `Config` -Defined in: packages/mermaid/src/config.type.ts:354 +Defined in: [packages/mermaid/src/config.type.ts:354](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L354) --- @@ -129,7 +129,7 @@ Defined in: packages/mermaid/src/config.type.ts:354 > `optional` **elk**: `object` -Defined in: packages/mermaid/src/config.type.ts:114 +Defined in: [packages/mermaid/src/config.type.ts:114](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L114) #### considerModelOrder? @@ -268,7 +268,7 @@ port, or would introduce a crossing. > `optional` **er**: `ErDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:332 +Defined in: [packages/mermaid/src/config.type.ts:332](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L332) --- @@ -276,7 +276,7 @@ Defined in: packages/mermaid/src/config.type.ts:332 > `optional` **eventmodeling**: `EventModelingDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:346 +Defined in: [packages/mermaid/src/config.type.ts:346](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L346) --- @@ -284,7 +284,7 @@ Defined in: packages/mermaid/src/config.type.ts:346 > `optional` **flowchart**: `FlowchartDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:323 +Defined in: [packages/mermaid/src/config.type.ts:323](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L323) --- @@ -292,7 +292,7 @@ Defined in: packages/mermaid/src/config.type.ts:323 > `optional` **fontFamily**: `string` -Defined in: packages/mermaid/src/config.type.ts:262 +Defined in: [packages/mermaid/src/config.type.ts:262](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L262) Specifies the font to be used in the rendered diagrams. Can be any possible CSS `font-family`. @@ -304,7 +304,7 @@ See > `optional` **fontSize**: `number` -Defined in: packages/mermaid/src/config.type.ts:356 +Defined in: [packages/mermaid/src/config.type.ts:356](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L356) --- @@ -312,7 +312,7 @@ Defined in: packages/mermaid/src/config.type.ts:356 > `optional` **forceLegacyMathML**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:304 +Defined in: [packages/mermaid/src/config.type.ts:304](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L304) This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS fonts and browser's MathML implementation, this option is recommended if consistent rendering is important. @@ -324,7 +324,7 @@ If set to true, ignores legacyMathML. > `optional` **gantt**: `GanttDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:327 +Defined in: [packages/mermaid/src/config.type.ts:327](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L327) --- @@ -332,7 +332,7 @@ Defined in: packages/mermaid/src/config.type.ts:327 > `optional` **gitGraph**: `GitGraphDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:341 +Defined in: [packages/mermaid/src/config.type.ts:341](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L341) --- @@ -340,7 +340,7 @@ Defined in: packages/mermaid/src/config.type.ts:341 > `optional` **handDrawnSeed**: `number` -Defined in: packages/mermaid/src/config.type.ts:96 +Defined in: [packages/mermaid/src/config.type.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L96) Defines the seed to be used when using handDrawn look. This is important for the automated tests as they will always find differences without the seed. The default value is 0 which gives a random seed. @@ -350,7 +350,7 @@ Defines the seed to be used when using handDrawn look. This is important for the > `optional` **htmlLabels**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:255 +Defined in: [packages/mermaid/src/config.type.ts:255](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L255) Flag for setting whether or not a html tag should be used for rendering labels on nodes and edges. **Note:** Diagram-specific `htmlLabels` settings (e.g., `flowchart.htmlLabels`) are deprecated. @@ -363,7 +363,7 @@ over any diagram-specific settings. > `optional` **ishikawa**: `IshikawaDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:339 +Defined in: [packages/mermaid/src/config.type.ts:339](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L339) --- @@ -371,7 +371,7 @@ Defined in: packages/mermaid/src/config.type.ts:339 > `optional` **journey**: `JourneyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:328 +Defined in: [packages/mermaid/src/config.type.ts:328](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L328) --- @@ -379,7 +379,7 @@ Defined in: packages/mermaid/src/config.type.ts:328 > `optional` **kanban**: `KanbanDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:340 +Defined in: [packages/mermaid/src/config.type.ts:340](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L340) --- @@ -387,7 +387,7 @@ Defined in: packages/mermaid/src/config.type.ts:340 > `optional` **layout**: `string` -Defined in: packages/mermaid/src/config.type.ts:104 +Defined in: [packages/mermaid/src/config.type.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L104) Defines which layout algorithm to use for rendering the diagram. @@ -400,7 +400,7 @@ ELK to stay small and falls back to `dagre`. > `optional` **legacyMathML**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:297 +Defined in: [packages/mermaid/src/config.type.ts:297](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L297) This option specifies if Mermaid can expect the dependent to include KaTeX stylesheets for browsers without their own MathML implementation. If this option is disabled and MathML is not supported, the math @@ -413,7 +413,7 @@ fall back to legacy rendering for KaTeX. > `optional` **logLevel**: `0` | `2` | `1` | `"trace"` | `"debug"` | `"info"` | `"warn"` | `"error"` | `"fatal"` | `3` | `4` | `5` -Defined in: packages/mermaid/src/config.type.ts:268 +Defined in: [packages/mermaid/src/config.type.ts:268](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L268) This option decides the amount of logging to be used by mermaid. @@ -423,7 +423,7 @@ This option decides the amount of logging to be used by mermaid. > `optional` **look**: `"neo"` | `"classic"` | `"handDrawn"` -Defined in: packages/mermaid/src/config.type.ts:91 +Defined in: [packages/mermaid/src/config.type.ts:91](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L91) Defines which main look to use for the diagram. @@ -433,7 +433,7 @@ Defines which main look to use for the diagram. > `optional` **markdownAutoWrap**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:357 +Defined in: [packages/mermaid/src/config.type.ts:357](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L357) --- @@ -441,7 +441,7 @@ Defined in: packages/mermaid/src/config.type.ts:357 > `optional` **maxEdges**: `number` -Defined in: packages/mermaid/src/config.type.ts:113 +Defined in: [packages/mermaid/src/config.type.ts:113](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L113) Defines the maximum number of edges that can be drawn in a graph. @@ -451,7 +451,7 @@ Defines the maximum number of edges that can be drawn in a graph. > `optional` **maxTextSize**: `number` -Defined in: packages/mermaid/src/config.type.ts:108 +Defined in: [packages/mermaid/src/config.type.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L108) The maximum allowed size of the users text diagram @@ -461,7 +461,7 @@ The maximum allowed size of the users text diagram > `optional` **mindmap**: `MindmapDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:338 +Defined in: [packages/mermaid/src/config.type.ts:338](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L338) --- @@ -469,7 +469,7 @@ Defined in: packages/mermaid/src/config.type.ts:338 > `optional` **packet**: `PacketDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:344 +Defined in: [packages/mermaid/src/config.type.ts:344](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L344) --- @@ -477,7 +477,7 @@ Defined in: packages/mermaid/src/config.type.ts:344 > `optional` **pie**: `PieDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:333 +Defined in: [packages/mermaid/src/config.type.ts:333](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L333) --- @@ -485,7 +485,7 @@ Defined in: packages/mermaid/src/config.type.ts:333 > `optional` **quadrantChart**: `QuadrantChartConfig` -Defined in: packages/mermaid/src/config.type.ts:334 +Defined in: [packages/mermaid/src/config.type.ts:334](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L334) --- @@ -493,7 +493,7 @@ Defined in: packages/mermaid/src/config.type.ts:334 > `optional` **radar**: `RadarDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:348 +Defined in: [packages/mermaid/src/config.type.ts:348](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L348) --- @@ -501,7 +501,7 @@ Defined in: packages/mermaid/src/config.type.ts:348 > `optional` **railroad**: `RailroadDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:353 +Defined in: [packages/mermaid/src/config.type.ts:353](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L353) --- @@ -509,7 +509,7 @@ Defined in: packages/mermaid/src/config.type.ts:353 > `optional` **requirement**: `RequirementDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:336 +Defined in: [packages/mermaid/src/config.type.ts:336](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L336) --- @@ -517,7 +517,7 @@ Defined in: packages/mermaid/src/config.type.ts:336 > `optional` **sankey**: `SankeyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:343 +Defined in: [packages/mermaid/src/config.type.ts:343](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L343) --- @@ -525,7 +525,7 @@ Defined in: packages/mermaid/src/config.type.ts:343 > `optional` **secure**: `string`\[] -Defined in: packages/mermaid/src/config.type.ts:289 +Defined in: [packages/mermaid/src/config.type.ts:289](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L289) This option controls which `currentConfig` keys are considered secure and can only be changed via call to `mermaid.initialize`. @@ -537,7 +537,7 @@ This prevents malicious graph directives from overriding a site's default securi > `optional` **securityLevel**: `"strict"` | `"loose"` | `"antiscript"` | `"sandbox"` -Defined in: packages/mermaid/src/config.type.ts:272 +Defined in: [packages/mermaid/src/config.type.ts:272](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L272) Level of trust for parsed diagram @@ -547,7 +547,7 @@ Level of trust for parsed diagram > `optional` **sequence**: `SequenceDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:326 +Defined in: [packages/mermaid/src/config.type.ts:326](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L326) --- @@ -555,7 +555,7 @@ Defined in: packages/mermaid/src/config.type.ts:326 > `optional` **startOnLoad**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:276 +Defined in: [packages/mermaid/src/config.type.ts:276](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L276) Dictates whether mermaid starts on Page load @@ -565,7 +565,7 @@ Dictates whether mermaid starts on Page load > `optional` **state**: `StateDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:331 +Defined in: [packages/mermaid/src/config.type.ts:331](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L331) --- @@ -573,7 +573,7 @@ Defined in: packages/mermaid/src/config.type.ts:331 > `optional` **suppressErrorRendering**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:363 +Defined in: [packages/mermaid/src/config.type.ts:363](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L363) Suppresses inserting 'Syntax error' diagram in the DOM. This is useful when you want to control how to handle syntax errors in your application. @@ -584,7 +584,7 @@ This is useful when you want to control how to handle syntax errors in your appl > `optional` **swimlane**: `SwimlaneDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:324 +Defined in: [packages/mermaid/src/config.type.ts:324](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L324) --- @@ -592,7 +592,7 @@ Defined in: packages/mermaid/src/config.type.ts:324 > `optional` **theme**: `"default"` | `"base"` | `"dark"` | `"forest"` | `"neutral"` | `"neo"` | `"neo-dark"` | `"redux"` | `"redux-dark"` | `"redux-color"` | `"redux-dark-color"` | `"null"` -Defined in: packages/mermaid/src/config.type.ts:72 +Defined in: [packages/mermaid/src/config.type.ts:72](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L72) Theme, the CSS style sheet. You may also use `themeCSS` to override this value. @@ -603,7 +603,7 @@ You may also use `themeCSS` to override this value. > `optional` **themeCSS**: `string` -Defined in: packages/mermaid/src/config.type.ts:86 +Defined in: [packages/mermaid/src/config.type.ts:86](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L86) --- @@ -611,7 +611,7 @@ Defined in: packages/mermaid/src/config.type.ts:86 > `optional` **themeVariables**: `any` -Defined in: packages/mermaid/src/config.type.ts:85 +Defined in: [packages/mermaid/src/config.type.ts:85](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L85) --- @@ -619,7 +619,7 @@ Defined in: packages/mermaid/src/config.type.ts:85 > `optional` **timeline**: `TimelineDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:329 +Defined in: [packages/mermaid/src/config.type.ts:329](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L329) --- @@ -627,7 +627,7 @@ Defined in: packages/mermaid/src/config.type.ts:329 > `optional` **treeView**: `TreeViewDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:347 +Defined in: [packages/mermaid/src/config.type.ts:347](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L347) --- @@ -635,7 +635,7 @@ Defined in: packages/mermaid/src/config.type.ts:347 > `optional` **usecase**: `UsecaseDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:349 +Defined in: [packages/mermaid/src/config.type.ts:349](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L349) --- @@ -643,7 +643,7 @@ Defined in: packages/mermaid/src/config.type.ts:349 > `optional` **venn**: `VennDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:350 +Defined in: [packages/mermaid/src/config.type.ts:350](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L350) --- @@ -651,7 +651,7 @@ Defined in: packages/mermaid/src/config.type.ts:350 > `optional` **wardley-beta**: `WardleyDiagramConfig` -Defined in: packages/mermaid/src/config.type.ts:351 +Defined in: [packages/mermaid/src/config.type.ts:351](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L351) --- @@ -659,7 +659,7 @@ Defined in: packages/mermaid/src/config.type.ts:351 > `optional` **wrap**: `boolean` -Defined in: packages/mermaid/src/config.type.ts:355 +Defined in: [packages/mermaid/src/config.type.ts:355](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L355) --- @@ -667,4 +667,4 @@ Defined in: packages/mermaid/src/config.type.ts:355 > `optional` **xyChart**: `XYChartConfig` -Defined in: packages/mermaid/src/config.type.ts:335 +Defined in: [packages/mermaid/src/config.type.ts:335](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L335) diff --git a/docs/config/setup/mermaid/interfaces/ParseOptions.md b/docs/config/setup/mermaid/interfaces/ParseOptions.md index 55e232f9123..bb4d73b8886 100644 --- a/docs/config/setup/mermaid/interfaces/ParseOptions.md +++ b/docs/config/setup/mermaid/interfaces/ParseOptions.md @@ -10,7 +10,7 @@ # Interface: ParseOptions -Defined in: packages/mermaid/src/types.ts:96 +Defined in: [packages/mermaid/src/types.ts:96](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L96) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:96 > `optional` **suppressErrors**: `boolean` -Defined in: packages/mermaid/src/types.ts:101 +Defined in: [packages/mermaid/src/types.ts:101](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L101) If `true`, parse will return `false` instead of throwing error when the diagram is invalid. The `parseError` function will not be called. diff --git a/docs/config/setup/mermaid/interfaces/ParseResult.md b/docs/config/setup/mermaid/interfaces/ParseResult.md index 2ace30e874a..f99981e73a3 100644 --- a/docs/config/setup/mermaid/interfaces/ParseResult.md +++ b/docs/config/setup/mermaid/interfaces/ParseResult.md @@ -10,7 +10,7 @@ # Interface: ParseResult -Defined in: packages/mermaid/src/types.ts:104 +Defined in: [packages/mermaid/src/types.ts:104](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L104) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:104 > **config**: [`MermaidConfig`](MermaidConfig.md) -Defined in: packages/mermaid/src/types.ts:112 +Defined in: [packages/mermaid/src/types.ts:112](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L112) The config passed as YAML frontmatter or directives @@ -28,6 +28,6 @@ The config passed as YAML frontmatter or directives > **diagramType**: `string` -Defined in: packages/mermaid/src/types.ts:108 +Defined in: [packages/mermaid/src/types.ts:108](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L108) The diagram type, e.g. 'flowchart', 'sequence', etc. diff --git a/docs/config/setup/mermaid/interfaces/RenderOptions.md b/docs/config/setup/mermaid/interfaces/RenderOptions.md index 13d6cd773f6..61693176702 100644 --- a/docs/config/setup/mermaid/interfaces/RenderOptions.md +++ b/docs/config/setup/mermaid/interfaces/RenderOptions.md @@ -10,7 +10,7 @@ # Interface: RenderOptions -Defined in: packages/mermaid/src/rendering-util/render.ts:11 +Defined in: [packages/mermaid/src/rendering-util/render.ts:11](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L11) ## Properties @@ -18,4 +18,4 @@ Defined in: packages/mermaid/src/rendering-util/render.ts:11 > `optional` **algorithm**: `string` -Defined in: packages/mermaid/src/rendering-util/render.ts:12 +Defined in: [packages/mermaid/src/rendering-util/render.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/render.ts#L12) diff --git a/docs/config/setup/mermaid/interfaces/RenderResult.md b/docs/config/setup/mermaid/interfaces/RenderResult.md index a01b289a348..5829fd09abe 100644 --- a/docs/config/setup/mermaid/interfaces/RenderResult.md +++ b/docs/config/setup/mermaid/interfaces/RenderResult.md @@ -10,7 +10,7 @@ # Interface: RenderResult -Defined in: packages/mermaid/src/types.ts:135 +Defined in: [packages/mermaid/src/types.ts:135](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L135) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/types.ts:135 > `optional` **bindFunctions**: (`element`) => `void` -Defined in: packages/mermaid/src/types.ts:153 +Defined in: [packages/mermaid/src/types.ts:153](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L153) Bind function to be called after the svg has been inserted into the DOM. This is necessary for adding event listeners to the elements in the svg. @@ -45,7 +45,7 @@ bindFunctions?.(div); // To call bindFunctions only if it's present. > **diagramType**: `string` -Defined in: packages/mermaid/src/types.ts:143 +Defined in: [packages/mermaid/src/types.ts:143](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L143) The diagram type, e.g. 'flowchart', 'sequence', etc. @@ -55,6 +55,6 @@ The diagram type, e.g. 'flowchart', 'sequence', etc. > **svg**: `string` -Defined in: packages/mermaid/src/types.ts:139 +Defined in: [packages/mermaid/src/types.ts:139](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/types.ts#L139) The svg code for the rendered graph. diff --git a/docs/config/setup/mermaid/interfaces/RunOptions.md b/docs/config/setup/mermaid/interfaces/RunOptions.md index 4cafed763a7..5a0eae0610b 100644 --- a/docs/config/setup/mermaid/interfaces/RunOptions.md +++ b/docs/config/setup/mermaid/interfaces/RunOptions.md @@ -10,7 +10,7 @@ # Interface: RunOptions -Defined in: packages/mermaid/src/mermaid.ts:63 +Defined in: [packages/mermaid/src/mermaid.ts:63](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L63) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/mermaid.ts:63 > `optional` **nodes**: `ArrayLike`<`HTMLElement`> -Defined in: packages/mermaid/src/mermaid.ts:71 +Defined in: [packages/mermaid/src/mermaid.ts:71](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L71) The nodes to render. If this is set, `querySelector` will be ignored. @@ -28,7 +28,7 @@ The nodes to render. If this is set, `querySelector` will be ignored. > `optional` **postRenderCallback**: (`id`) => `unknown` -Defined in: packages/mermaid/src/mermaid.ts:75 +Defined in: [packages/mermaid/src/mermaid.ts:75](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L75) A callback to call after each diagram is rendered. @@ -48,7 +48,7 @@ A callback to call after each diagram is rendered. > `optional` **querySelector**: `string` -Defined in: packages/mermaid/src/mermaid.ts:67 +Defined in: [packages/mermaid/src/mermaid.ts:67](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L67) The query selector to use when finding elements to render. Default: `".mermaid"`. @@ -58,6 +58,6 @@ The query selector to use when finding elements to render. Default: `".mermaid"` > `optional` **suppressErrors**: `boolean` -Defined in: packages/mermaid/src/mermaid.ts:79 +Defined in: [packages/mermaid/src/mermaid.ts:79](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L79) If `true`, errors will be logged to the console, but not thrown. Default: `false` diff --git a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md index ce9519343e4..bfefe1e6f32 100644 --- a/docs/config/setup/mermaid/interfaces/SyncIconLoader.md +++ b/docs/config/setup/mermaid/interfaces/SyncIconLoader.md @@ -10,7 +10,7 @@ # Interface: SyncIconLoader -Defined in: packages/mermaid/src/rendering-util/icons.ts:13 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:13](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L13) ## Properties @@ -18,7 +18,7 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:13 > **icons**: `IconifyJSON` -Defined in: packages/mermaid/src/rendering-util/icons.ts:15 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L15) --- @@ -26,4 +26,4 @@ Defined in: packages/mermaid/src/rendering-util/icons.ts:15 > **name**: `string` -Defined in: packages/mermaid/src/rendering-util/icons.ts:14 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:14](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L14) diff --git a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md index 6f280033e22..2415d77eef9 100644 --- a/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md +++ b/docs/config/setup/mermaid/interfaces/UnknownDiagramError.md @@ -10,7 +10,7 @@ # Interface: UnknownDiagramError -Defined in: packages/mermaid/src/errors.ts:1 +Defined in: [packages/mermaid/src/errors.ts:1](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/errors.ts#L1) ## Extends diff --git a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md index f64c0c608f6..e2b1a1e5ca6 100644 --- a/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md +++ b/docs/config/setup/mermaid/type-aliases/CommonLayoutMeasure.md @@ -12,4 +12,4 @@ > **CommonLayoutMeasure** = `Awaited`<`ReturnType`<_typeof_ `createGraphWithElements`>> -Defined in: packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26 +Defined in: [packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts:26](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/layout-algorithms/common/index.ts#L26) diff --git a/docs/config/setup/mermaid/type-aliases/IconLoader.md b/docs/config/setup/mermaid/type-aliases/IconLoader.md index 874357a2073..98a312e71c9 100644 --- a/docs/config/setup/mermaid/type-aliases/IconLoader.md +++ b/docs/config/setup/mermaid/type-aliases/IconLoader.md @@ -12,4 +12,4 @@ > **IconLoader** = [`AsyncIconLoader`](../interfaces/AsyncIconLoader.md) | [`SyncIconLoader`](../interfaces/SyncIconLoader.md) -Defined in: packages/mermaid/src/rendering-util/icons.ts:18 +Defined in: [packages/mermaid/src/rendering-util/icons.ts:18](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/icons.ts#L18) diff --git a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md index 3d4b243d9a7..bfaeabd128f 100644 --- a/docs/config/setup/mermaid/type-aliases/InternalHelpers.md +++ b/docs/config/setup/mermaid/type-aliases/InternalHelpers.md @@ -12,4 +12,4 @@ > **InternalHelpers** = _typeof_ `internalHelpers` -Defined in: packages/mermaid/src/internals.ts:33 +Defined in: [packages/mermaid/src/internals.ts:33](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/internals.ts#L33) diff --git a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md index 54011b6da7c..55c907a8a76 100644 --- a/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md +++ b/docs/config/setup/mermaid/type-aliases/ParseErrorFunction.md @@ -12,7 +12,7 @@ > **ParseErrorFunction** = (`err`, `hash?`) => `void` -Defined in: packages/mermaid/src/Diagram.ts:12 +Defined in: [packages/mermaid/src/Diagram.ts:12](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/Diagram.ts#L12) ## Parameters diff --git a/docs/config/setup/mermaid/type-aliases/SVG.md b/docs/config/setup/mermaid/type-aliases/SVG.md index 55348b9f565..82884c8a359 100644 --- a/docs/config/setup/mermaid/type-aliases/SVG.md +++ b/docs/config/setup/mermaid/type-aliases/SVG.md @@ -12,4 +12,4 @@ > **SVG** = `d3.Selection`<`SVGSVGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: packages/mermaid/src/diagram-api/types.ts:171 +Defined in: [packages/mermaid/src/diagram-api/types.ts:171](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L171) diff --git a/docs/config/setup/mermaid/type-aliases/SVGGroup.md b/docs/config/setup/mermaid/type-aliases/SVGGroup.md index 9662e8278c0..602dee9760f 100644 --- a/docs/config/setup/mermaid/type-aliases/SVGGroup.md +++ b/docs/config/setup/mermaid/type-aliases/SVGGroup.md @@ -12,4 +12,4 @@ > **SVGGroup** = `d3.Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`> -Defined in: packages/mermaid/src/diagram-api/types.ts:173 +Defined in: [packages/mermaid/src/diagram-api/types.ts:173](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/diagram-api/types.ts#L173) diff --git a/docs/config/setup/mermaid/variables/default.md b/docs/config/setup/mermaid/variables/default.md index 645c2325adb..03da9f13855 100644 --- a/docs/config/setup/mermaid/variables/default.md +++ b/docs/config/setup/mermaid/variables/default.md @@ -12,4 +12,4 @@ > `const` **default**: [`Mermaid`](../interfaces/Mermaid.md) -Defined in: packages/mermaid/src/mermaid.ts:476 +Defined in: [packages/mermaid/src/mermaid.ts:476](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L476) From 8cc330d63a937302ac82d0468c2cd4db9060af5d Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 15:38:48 +0200 Subject: [PATCH 23/31] address remaining review items: declare bundled deps, sanitize caveat, lexer note - @mermaid-js/layout-elk declares dompurify, katex, dayjs and dagre-d3-es, so the npm core build externalizes them (verified in the built chunks: bare imports instead of inlined copies) and they dedupe against the host and appear in audits. The self-contained CDN build is unchanged. - syncHostConfig documents that setConfig sanitizes away the secure keys, and the hostConfigSync fixture no longer asserts a securityLevel propagation that sanitize() prevents. - The elk-default-layout changeset records the mermaid.esm.min.mjs es-module-lexer incompatibility and corrects the mindmap default to cose-bilkent; the layout-elk changeset documents the new dependencies. --- .changeset/elk-default-layout.md | 3 ++- .changeset/layout-elk-built-from-core.md | 2 ++ packages/mermaid-layout-elk/package.json | 6 +++++- .../elk/__tests__/hostConfigSync.spec.ts | 4 +++- .../rendering-util/layout-algorithms/elk/render.ts | 11 ++++++++++- pnpm-lock.yaml | 12 ++++++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.changeset/elk-default-layout.md b/.changeset/elk-default-layout.md index 0ba47d76bcd..59c23a34fd4 100644 --- a/.changeset/elk-default-layout.md +++ b/.changeset/elk-default-layout.md @@ -17,11 +17,12 @@ config: or globally, `mermaid.initialize({ layout: 'dagre' })`. -Mindmap is unchanged: it keeps laying out with dagre unless a layout is explicitly requested. +Mindmap is unchanged: it keeps laying out with cose-bilkent unless a layout is explicitly requested (in the tiny build, which ships neither ELK nor cose-bilkent, it falls back to dagre). Other notes: - ELK is loaded as a separate chunk in the ESM builds, so it is only fetched when a diagram actually uses it. The single-file IIFE build (`mermaid.min.js`) inlines it and grows by roughly 500 kB gzipped. - The **tiny** build deliberately omits ELK to stay small, and falls back to dagre for diagrams that ask for an ELK layout. Its size is unchanged. - `@mermaid-js/layout-elk` is no longer needed on normal builds — existing `mermaid.registerLayoutLoaders(elkLayouts)` calls keep working and can be removed. It is still published, and remains the way to add ELK to the tiny build. +- `dist/mermaid.esm.min.mjs` now contains syntax that `es-module-lexer` (used by Vite) rejects with `content contains invalid JS syntax`. Bundler users are unaffected as long as they import the `mermaid` package specifier, which resolves to the core build; only builds that point Vite directly at that dist file need to switch to the package specifier or the core build. - State diagrams now resolve their layout through the same registration check as every other diagram, so an unavailable layout falls back instead of failing to render. diff --git a/.changeset/layout-elk-built-from-core.md b/.changeset/layout-elk-built-from-core.md index 1d8d2ad3bd0..20239066e8b 100644 --- a/.changeset/layout-elk-built-from-core.md +++ b/.changeset/layout-elk-built-from-core.md @@ -8,4 +8,6 @@ feat: this package is now built from mermaid's own ELK implementation instead of 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. diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index be552f20238..06a252d90c4 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -43,6 +43,10 @@ ], "dependencies": { "d3": "^7.9.0", - "elkjs": "^0.9.3" + "dagre-d3-es": "7.0.14", + "dayjs": "^1.11.21", + "dompurify": "^3.4.12", + "elkjs": "^0.9.3", + "katex": "^0.16.47" } } diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts index 429e3f5b4f3..d252fcd2482 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/hostConfigSync.spec.ts @@ -22,9 +22,11 @@ const log = { warn: () => undefined, }; +// No secure keys (`securityLevel`, `maxTextSize`, ...) in this fixture: the +// real `setConfig` sanitizes them away, so asserting one here would document a +// propagation that does not happen (the mock skips `sanitize()`). const HOST_CONFIG = { htmlLabels: false, - securityLevel: 'sandbox', arrowMarkerAbsolute: true, flowchart: { wrappingWidth: 200 }, curve: undefined, diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 3dfebff9c3c..47f013c6ef8 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -671,7 +671,8 @@ export const render = createCommonLayoutRenderer Date: Wed, 2 Sep 2026 16:58:00 +0200 Subject: [PATCH 24/31] Added dev-diags from findings in Argos --- .../tmp-v12.0.0-faulty-diags/oldShapes.mmd | 4 +++ ...d-render-a-simple-ER-diagram-handdrawn.mmd | 13 ++++++++++ .../should-render-a-simple-ER-diagram.mmd | 12 +++++++++ .../state-diagram.mmd | 26 +++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/oldShapes.mmd create mode 100644 e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram-handdrawn.mmd create mode 100644 e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram.mmd create mode 100644 e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/state-diagram.mmd diff --git a/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/oldShapes.mmd b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/oldShapes.mmd new file mode 100644 index 00000000000..c3530e6a8f3 --- /dev/null +++ b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/oldShapes.mmd @@ -0,0 +1,4 @@ +flowchart LR + C["Text block"]@{ shape: text } + D["Lined rectangle"]@{ shape: fork } + C --> D diff --git a/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram-handdrawn.mmd b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram-handdrawn.mmd new file mode 100644 index 00000000000..2294eed046a --- /dev/null +++ b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram-handdrawn.mmd @@ -0,0 +1,13 @@ +--- +config: + layout: elk + theme: redux-color + look: handDrawn +--- + erDiagram + subgraph customers + CUSTOMER + ORDER + end + + CUSTOMER ||--o{ ORDER : places diff --git a/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram.mmd b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram.mmd new file mode 100644 index 00000000000..d9757420ead --- /dev/null +++ b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/should-render-a-simple-ER-diagram.mmd @@ -0,0 +1,12 @@ +--- +config: + layout: elk + theme: redux-color +--- + erDiagram + subgraph customers + CUSTOMER + ORDER + end + + CUSTOMER ||--o{ ORDER : places diff --git a/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/state-diagram.mmd b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/state-diagram.mmd new file mode 100644 index 00000000000..a47a836535b --- /dev/null +++ b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/state-diagram.mmd @@ -0,0 +1,26 @@ +--- +config: + fontFamily: courier +--- +stateDiagram-v2 + [*]-->TV + + state TV { + [*] --> Off: Off to start with + On --> Off : Turn off + Off --> On : Turn on + } + + TV--> Console + + state Console { + [*] --> Off2: Off to start with + On2--> Off2 : Turn off + Off2 --> On2 : Turn on + On2-->Playing + + state Playing { + Alive --> Dead + Dead-->Alive + } + } \ No newline at end of file From d6a4fcc9841b8348b902e13f8d324e15baf808da Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Wed, 2 Sep 2026 17:35:33 +0200 Subject: [PATCH 25/31] Set default layout to dagre for state diagrams --- packages/mermaid/src/config.type.ts | 5 +++++ packages/mermaid/src/schemas/config.schema.yaml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/packages/mermaid/src/config.type.ts b/packages/mermaid/src/config.type.ts index 78f20d627b2..8c7942983a9 100644 --- a/packages/mermaid/src/config.type.ts +++ b/packages/mermaid/src/config.type.ts @@ -1176,6 +1176,11 @@ export interface StateDiagramConfig extends BaseDiagramConfig { * */ look?: 'classic' | 'handDrawn' | 'neo'; + /** + * Defines which layout algorithm to use for rendering the diagram. + * + */ + layout?: string; /** * Margin top for the text over the diagram */ diff --git a/packages/mermaid/src/schemas/config.schema.yaml b/packages/mermaid/src/schemas/config.schema.yaml index c1fb5feb4d6..12eb0b87d34 100644 --- a/packages/mermaid/src/schemas/config.schema.yaml +++ b/packages/mermaid/src/schemas/config.schema.yaml @@ -1659,6 +1659,9 @@ $defs: # JSON Schema definition (maybe we should move these to a separate file) look: $ref: '#/$defs/BaseDiagramConfig/properties/look' default: 'neo' + layout: + $ref: '#/$defs/BaseDiagramConfig/properties/layout' + default: 'dagre' titleTopMargin: $ref: '#/$defs/GitGraphDiagramConfig/properties/titleTopMargin' default: 25 From cf8d21e4c3351917e43e7c66bee231787a746009 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 17:40:58 +0200 Subject: [PATCH 26/31] fix: orient fork/join bars by flow direction under ELK layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic measure path (used by ELK) passed only node.dir to insertNode, which is set for groups alone, so fork/join bars in LR diagrams were drawn horizontal and edges hit the short side off-center. Resolve the effective direction per node — its own dir, the nearest ancestor group's dir, or the diagram direction — mirroring what dagre's recursive render provides via rankdir. Also treat RL like LR in forkJoin so the bar stays perpendicular to a horizontal flow. --- .../src/rendering-util/createGraph.spec.ts | 67 +++++++++++++++++++ .../mermaid/src/rendering-util/createGraph.ts | 32 ++++++++- .../rendering-elements/shapes/forkJoin.ts | 4 +- 3 files changed, 101 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/rendering-util/createGraph.spec.ts b/packages/mermaid/src/rendering-util/createGraph.spec.ts index b8f21ce420d..9d080a68c8d 100644 --- a/packages/mermaid/src/rendering-util/createGraph.spec.ts +++ b/packages/mermaid/src/rendering-util/createGraph.spec.ts @@ -23,6 +23,14 @@ const labelHelper = vi.hoisted(() => vi.mock('./rendering-elements/shapes/util.js', () => ({ labelHelper })); +const insertNode = vi.hoisted(() => + vi.fn((_parent: unknown, _node: unknown, _renderOptions: { dir?: string }) => + Promise.resolve({ node: () => null }) + ) +); + +vi.mock('./rendering-elements/nodes.js', () => ({ insertNode })); + const { createGraphWithElements } = await import('./createGraph.js'); const { select } = await import('d3'); @@ -73,3 +81,62 @@ describe('createGraphWithElements — cluster label measurement', () => { expect(labelHelper.mock.calls[0][1].width).toBeUndefined(); }); }); + +/** + * Direction-sensitive shapes (fork/join bars) must know the flow direction to + * orient themselves perpendicular to it. The dagre path passes each subgraph's + * rankdir during its recursive render; this generic path resolves the same + * information from the node, its ancestor groups, or the diagram direction. + */ +describe('createGraphWithElements — node direction resolution', () => { + const data = (nodes: object[], direction?: string) => + ({ + nodes, + edges: [], + config: {}, + direction, + type: 'flowchart-v2', + }) as never; + + jsdomIt('falls back to the diagram-level direction', async ({ svg }) => { + insertNode.mockClear(); + await createGraphWithElements(select(svg.node()!) as never, data([{ id: 'a' }], 'LR')); + + expect(insertNode).toHaveBeenCalledTimes(1); + expect(insertNode.mock.calls[0][2].dir).toBe('LR'); + }); + + jsdomIt('prefers the node’s own dir over the diagram direction', async ({ svg }) => { + insertNode.mockClear(); + await createGraphWithElements( + select(svg.node()!) as never, + data([{ id: 'a', dir: 'RL' }], 'TB') + ); + + expect(insertNode.mock.calls[0][2].dir).toBe('RL'); + }); + + jsdomIt('inherits the nearest ancestor group’s dir', async ({ svg }) => { + insertNode.mockClear(); + await createGraphWithElements( + select(svg.node()!) as never, + data( + [ + { id: 'grp', isGroup: true, dir: 'LR', label: '', labelType: 'text' }, + { id: 'a', parentId: 'grp' }, + ], + 'TB' + ) + ); + + expect(insertNode).toHaveBeenCalledTimes(1); + expect(insertNode.mock.calls[0][2].dir).toBe('LR'); + }); + + jsdomIt('leaves dir undefined when nothing declares one', async ({ svg }) => { + insertNode.mockClear(); + await createGraphWithElements(select(svg.node()!) as never, data([{ id: 'a' }])); + + expect(insertNode.mock.calls[0][2].dir).toBeUndefined(); + }); +}); diff --git a/packages/mermaid/src/rendering-util/createGraph.ts b/packages/mermaid/src/rendering-util/createGraph.ts index 519fd40f314..0717bb4f2ac 100644 --- a/packages/mermaid/src/rendering-util/createGraph.ts +++ b/packages/mermaid/src/rendering-util/createGraph.ts @@ -92,6 +92,34 @@ export interface CreateGraphOptions { unwrapGroupLabels?: boolean; } +/** + * Resolves the flow direction that applies to a node: the `dir` of the nearest + * ancestor group that declares one (a subgraph or composite state with its own + * direction), falling back to the diagram-level direction. Direction-sensitive + * shapes (e.g. fork/join bars, which must run perpendicular to the flow) rely + * on this — the dagre path gets the same information via each subgraph's + * `rankdir` during its recursive render. + */ +function resolveNodeDir( + node: NonClusterNode, + nodeById: Map, + diagramDir?: string +): string | undefined { + let current: LayoutData['nodes'][number] | undefined = node; + const seen = new Set(); + while (current) { + if (current.dir) { + return current.dir; + } + if (!current.parentId || seen.has(current.parentId)) { + break; + } + seen.add(current.parentId); + current = nodeById.get(current.parentId); + } + return diagramDir; +} + export async function createGraphWithElements( element: D3Selection, data4Layout: LayoutData, @@ -118,6 +146,8 @@ export async function createGraphWithElements( const { edgeLabels, nodes: nodesGroup } = groups; const nodeElements = new Map>(); + const nodeById = new Map(data4Layout.nodes.map((node) => [node.id, node])); + const diagramDir = (data4Layout as { direction?: string }).direction; // When the container element is detached (no real DOM — e.g. headless unit // tests that exercise the layout engine without rendering), `insertNode` @@ -146,7 +176,7 @@ export async function createGraphWithElements( if (hasDom) { const childNodeEl = await insertMeasuredNode(nodesGroup, node, { config, - dir: node.dir, + dir: resolveNodeDir(node, nodeById, diagramDir), }); nodeElements.set(node.id, childNodeEl); } diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts index 9ae587618e6..b54791e8fab 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts @@ -21,7 +21,9 @@ export function forkJoin( let width = Math.max(70, node?.width ?? 0); let height = Math.max(10, node?.height ?? 0); - if (dir === 'LR') { + // The bar must run perpendicular to the flow: with a horizontal flow the + // long side faces the incoming/outgoing edges, so the bar is drawn vertical. + if (dir === 'LR' || dir === 'RL') { width = Math.max(10, node?.width ?? 0); height = Math.max(70, node?.height ?? 0); } From a378839a0ea97520f6c527080522535ce9814fa5 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 17:41:55 +0200 Subject: [PATCH 27/31] fix(er): stop lowering the edge group under ELK so edges paint above cluster backgrounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ER renderer carried an ELK-specific workaround from the old external ELK renderer: svg.select('.edges').lower(), added because that renderer painted edges above nodes and the crow's-foot markers showed on top of entity boxes. The unified ELK render path already inserts groups in the order clusters < edges < edgeLabels < nodes, so nodes cover marker overlap without any reordering — and the .lower() call now moved the edge group below the clusters group, hiding relationship edges behind subgraph backgrounds (fully hidden with a solid background, peeking through the hachure gaps in the hand-drawn look). Remove the call and leave a comment explaining why it must not return. Verified on the tmp-v12.0.0-faulty-diags ER fixtures (solid + handDrawn), plain ER diagrams under ELK (markers still tucked under entity boxes), nested flowchart subgraphs, edge-to-subgraph, and composite states under ELK. --- packages/mermaid/src/diagrams/er/erRenderer-unified.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/diagrams/er/erRenderer-unified.ts b/packages/mermaid/src/diagrams/er/erRenderer-unified.ts index 0807f230950..17b80c4ecb3 100644 --- a/packages/mermaid/src/diagrams/er/erRenderer-unified.ts +++ b/packages/mermaid/src/diagrams/er/erRenderer-unified.ts @@ -41,10 +41,12 @@ export const draw = async function (text: string, id: string, _version: string, } data4Layout.diagramId = id; await render(data4Layout, svg); - // Elk layout algorithm displays markers above nodes, so move edges to top so they are "painted" over by the nodes. - if (data4Layout.layoutAlgorithm === 'elk') { - svg.select('.edges').lower(); - } + // Note: the layout render inserts the edge group between the cluster and node + // groups (clusters < edges < nodes in paint order), so edge markers are + // covered by the nodes they touch while edges still paint above cluster + // backgrounds. The old external ELK renderer painted edges above nodes and + // needed `svg.select('.edges').lower()` here — that call must not come back: + // lowering the edge group drops edges below cluster backgrounds. // Sets the background nodes to the same position as their original counterparts. // Background nodes are created when the look is handDrawn so the ER diagram markers do not show underneath. From 4e00c5c85b365358e18a688b877cefa52644b69e Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 17:42:16 +0200 Subject: [PATCH 28/31] chore: changeset for ER/ELK edge paint-order fix --- .changeset/er-elk-edges-above-clusters.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/er-elk-edges-above-clusters.md diff --git a/.changeset/er-elk-edges-above-clusters.md b/.changeset/er-elk-edges-above-clusters.md new file mode 100644 index 00000000000..8eb50b6d4be --- /dev/null +++ b/.changeset/er-elk-edges-above-clusters.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: render ER relationship edges above subgraph backgrounds under the ELK layout instead of hiding them behind the cluster rect From a7831c5bb2a461aca7eb10bac387665a4735cbef Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 2 Sep 2026 17:46:40 +0200 Subject: [PATCH 29/31] fix(elk): keep group frames out to edge anchors on the frame border An edge that terminates on a compound node ([*] --> Composite in state diagrams, node --> subgraph in flowcharts) is anchored by ELK on the frame's border. evenGroupFrames could pull the drawn frame in past that anchor, leaving it floating outside the frame; the on-border check in sanitizeElkEdgePoints then missed it and cutter2 re-clipped the edge along a ray to the group's centre, painting a long shallow diagonal that hugged the cluster border instead of entering it cleanly. Feed the terminal point of every group-attached edge into the frame pass's lane measurement so a frame is never pulled past its own edge anchors. Only the point on the group is added - the edge's other points belong to the layout outside the frame and must not hold it open. Adds e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/ elk-legacy-preset-regression.mmd as a manual regression fixture for the legacy-preset (Miro-matched) ELK configuration; verified pixel-identical before and after (104/738560 px). --- .changeset/elk-composite-edge-anchor.md | 5 ++ .../elk-legacy-preset-regression.mmd | 87 +++++++++++++++++++ .../elk/__tests__/render.spec.ts | 47 ++++++++++ .../layout-algorithms/elk/render.ts | 28 ++++-- 4 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 .changeset/elk-composite-edge-anchor.md create mode 100644 e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/elk-legacy-preset-regression.mmd diff --git a/.changeset/elk-composite-edge-anchor.md b/.changeset/elk-composite-edge-anchor.md new file mode 100644 index 00000000000..bf2aff92d68 --- /dev/null +++ b/.changeset/elk-composite-edge-anchor.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: keep ELK subgraph frames out to the border anchor of edges that terminate on the group, so transitions to composite states no longer run along the cluster border diff --git a/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/elk-legacy-preset-regression.mmd b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/elk-legacy-preset-regression.mmd new file mode 100644 index 00000000000..d27c9b8da2e --- /dev/null +++ b/e2e/platform/dev-diagrams/tmp-v12.0.0-faulty-diags/elk-legacy-preset-regression.mmd @@ -0,0 +1,87 @@ +--- +config: + theme: redux-color + look: neo + flowchart: + wrappingWidth: 125 + layout: elk + elk: + preset: legacy +--- +flowchart LR + org["GitHub org: Mermaid Chart"] + subgraph product["Product experience"] + app["mermaid-chart-app\nMain web application"] + editor["editor\nDiagram creation and editing"] + ai["ai-assistant\nPrompting, generation, repair, editing"] + visual["visual-editor\nCanvas and visual diagram controls"] + end + subgraph core["Core diagram engine"] + mermaidjs["mermaid-js / mermaid\nOpen-source rendering engine"] + renderer["renderer-service\nServer-side diagram rendering"] + parser["diagram-parser\nSyntax validation and transformation"] + end + subgraph collaboration["Collaboration and accounts"] + auth["auth-service\nLogin, SSO, workspace access"] + teams["workspace-service\nTeams, permissions, org settings"] + comments["comments-service\nFeedback and review flows"] + sharing["sharing-service\nLinks, embeds, exports"] + end + subgraph content["Content and growth"] + marketing["marketing-site\nNew public website"] + docs["docs\nProduct docs and Mermaid syntax guides"] + templates["templates\nDiagram examples and starter content"] + blog["blog-content\nLaunches, guides, SEO content"] + end + subgraph integrations["Integrations"] + github["github-integration\nRepo, PR, and markdown workflows"] + slack["slack-integration\nSharing and notifications"] + jira["jira-integration\nIssue and workflow diagrams"] + api["public-api\nExternal diagram generation API"] + end + subgraph platform["Platform and infrastructure"] + design["design-system\nUI components, tokens, icons"] + analytics["analytics-pipeline\nProduct usage and funnel events"] + billing["billing-service\nPlans, seats, invoices"] + infra["infrastructure\nIaC, CI/CD, environments"] + end + org --> product + org --> core + org --> collaboration + org --> content + org --> integrations + org --> platform + app --> editor + app --> visual + app --> ai + editor --> mermaidjs + visual --> parser + ai --> parser + renderer --> mermaidjs + sharing --> renderer + docs --> mermaidjs + marketing --> templates + app --> auth + app --> teams + app --> billing + app --> analytics + github --> publicapi["public-api"] + slack --> sharing + jira --> templates + design --> app + design --> marketing + infra --> app + infra --> renderer + infra --> auth + classDef org fill:#111827,color:#ffffff,stroke:#111827 + classDef group fill:#f9fafb,stroke:#d1d5db,color:#111827 + classDef repo fill:#ffffff,stroke:#6b7280,color:#111827 + class org org + class app,editor,ai,visual,mermaidjs,renderer,parser,auth,teams,comments,sharing,marketing,docs,templates,blog,github,slack,jira,api,design,analytics,billing,infra,publicapi repo + style org fill:#111827,color:#ffffff,stroke:#111827 + style product fill:#eeeefb,stroke:#d1d5db,color:#111827 + style core fill:#eeeefb,stroke:#d1d5db,color:#111827 + style collaboration fill:#eeeefb,stroke:#d1d5db,color:#111827 + style content fill:#eeeefb,stroke:#d1d5db,color:#111827 + style integrations fill:#eeeefb,stroke:#d1d5db,color:#111827 + style platform fill:#eeeefb,stroke:#d1d5db,color:#111827 diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts index 5f74863d9d0..b7f6d312714 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts @@ -1086,6 +1086,53 @@ describe('evenGroupFrames', () => { expect(nodeDb.P.offset.posX + nodeDb.P.width).toBe(374); }); + it('never pulls a frame past the anchor of an edge that terminates on the group', () => { + // A state diagram's `[*] --> Composite` (or a flowchart's `a --> subgraph`) + // is anchored by ELK ON the frame's border. Pulling the frame in past that + // anchor leaves it floating outside the drawn frame; the on-border check in + // `sanitizeElkEdgePoints` then fails and `cutter2` re-clips the edge along + // a ray to the group's centre — a long shallow diagonal hugging the frame's + // side, which is the reported defect. + const nodeDb: Record = { + g: { id: 'g', isGroup: true, offset: { posX: 0, posY: 0 }, width: 200, height: 148 }, + n: { id: 'n', offset: { posX: 60, posY: 48 }, width: 100, height: 76 }, + ext: { id: 'ext', offset: { posX: 5, posY: -60 }, width: 14, height: 14 }, + }; + const graph = { + edges: [ + { + id: 'e', + sources: ['ext'], + targets: ['g'], + sections: [ + { + // Only the endpoint sits on the group; the start and the bend + // belong to the layout outside and must NOT hold the frame open. + startPoint: { x: 500, y: -40 }, + bendPoints: [{ x: 500, y: -10 }], + endPoint: { x: 12, y: 0 }, + }, + ], + }, + ], + }; + const layoutState = { nodeDb, parentLookupDb: { parentById: {} } }; + + evenGroupFrames( + [{ id: 'g', isGroup: true, labelData: { width: 0 }, labels: [], children: [{ id: 'n' }] }], + layoutState as any, + new Map(), + graph as any + ); + + // The left border stays where ELK put it — the anchor at x=12 is on the top + // border and pulling the left edge to 60 - 24 = 36 would strand it. + expect(nodeDb.g.offset.posX).toBe(0); + // The right side still evens up to the child (160 + 24): the section's far + // start point at x=500 was ignored, or the frame would have stayed at 200. + expect(nodeDb.g.width).toBe(184); + }); + it("leaves ELK's own origin readable after moving a frame", () => { // Edge sections resolve against the container's ORIGINAL origin, so moving // a frame must not overwrite it or every edge inside would shift with it. diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 47f013c6ef8..39467d3d21c 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -1264,29 +1264,47 @@ export function collectDescendantIds(elkNode: any, into = new Set()): Se /** * Absolute points of every edge ELK routed INSIDE this group — meaning both of - * its endpoints are descendants of the group. + * its endpoints are descendants of the group — plus the attachment point of + * every edge that terminates ON the group itself. * * An edge with one endpoint outside is the case this whole pass exists for: its * lane belongs to the layout around the group, not to the group, so the frame * should not be drawn around it. An edge with both endpoints inside is the * opposite — its lane is part of the group's interior, and a frame pulled in * past it would leave the edge running outside a group it never leaves. + * + * An edge whose endpoint IS the group (a state diagram's `[*] --> Composite`, + * a flowchart's `node --> subgraph`) sits between the two: ELK anchored it on + * the frame's border, so the border must not be pulled past that anchor. When + * it was, the stale anchor ended up floating outside the drawn frame, the + * on-border check in `sanitizeElkEdgePoints` no longer recognised it, and + * `cutter2` re-clipped the edge along a ray to the group's centre — painting a + * long shallow diagonal that hugged the frame's side. Only the terminal point + * on the group is added, never the edge's other points: those belong to the + * layout outside the frame. */ function internalEdgePoints( graph: ElkLayoutResult, descendants: Set, - layoutState: ElkLayoutState + layoutState: ElkLayoutState, + groupId: string ): P[] { const points: P[] = []; for (const edge of graph.edges ?? []) { const source = edge.sources?.[0] ?? edge.start; const target = edge.targets?.[0] ?? edge.end; - if (!descendants.has(source) || !descendants.has(target)) { + const isInternal = descendants.has(source) && descendants.has(target); + const attachesAtStart = source === groupId; + const attachesAtEnd = target === groupId; + if (!isInternal && !attachesAtStart && !attachesAtEnd) { continue; } const offset = calcOffset(source, target, layoutState.parentLookupDb, layoutState.nodeDb); for (const section of edge.sections ?? []) { - for (const p of [section.startPoint, ...(section.bendPoints ?? []), section.endPoint]) { + const sectionPoints = isInternal + ? [section.startPoint, ...(section.bendPoints ?? []), section.endPoint] + : [attachesAtStart ? section.startPoint : null, attachesAtEnd ? section.endPoint : null]; + for (const p of sectionPoints) { if (p) { points.push({ x: p.x + offset.x, y: p.y + offset.y }); } @@ -1317,7 +1335,7 @@ export function evenGroupFrames( continue; } - const lane = internalEdgePoints(graph, collectDescendantIds(elkNode), layoutState); + const lane = internalEdgePoints(graph, collectDescendantIds(elkNode), layoutState, elkNode.id); const xs = [ ...boxes.map((b: NodeWithVertex) => b.offset!.posX), ...boxes.map((b: NodeWithVertex) => b.offset!.posX + b.width!), From 0320406298ac99012b2bf1442316f0db9c4bf1ca Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Thu, 3 Sep 2026 09:39:31 +0200 Subject: [PATCH 30/31] fix(elk): resolve cycle breaking for containers, not just the root graph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A composite state or subgraph containing a loop opened on the wrong node. The start circle shared the first layer with an ordinary state instead of having it to itself, and dagre laid the same diagram out correctly, which is what made it look like an ELK bug rather than a configuration gap. It was a configuration gap. `createRootElkGraph` resolves `elk.layered.cycleBreaking.strategy` from the preset; `buildSubgraphLayoutOptions` never set it at all, so a container laid out on its own fell back to ELK's default, GREEDY. The root and its own containers then reversed different edges of the same cycle. Greedy reverses the edge that turns an ordinary state into a source, and sources sit on the first layer — hence the start circle sharing it. The gap was invisible from config: every value of `elk.preset` and `elk.cycleBreakingStrategy` rendered such a diagram identically, because none of them reached the container. That is also how this was diagnosed — running the root with GREEDY reproduced the container's layout byte for byte. Containers now resolve it exactly as the root does, and the preset is hoisted above the literal so the two functions read alike; they drifted apart in the first place because they did not. Only containers that contain a cycle move — an acyclic subgraph gives a cycle-breaking strategy nothing to do. Verified unchanged on a flat state machine, an acyclic subgraph and the nested-subgraph fixture. `preset: legacy` still reaches containers with GREEDY, so it keeps reproducing the earlier rendering inside frames as well as outside them. The three new unit cases pin the two sides agreeing rather than pinning each side's value separately, which is what allowed the drift. --- .changeset/elk-container-cycle-breaking.md | 19 ++++++++++ ...-with-a-loop-starts-on-its-start-state.mmd | 13 +++++++ .../elk/__tests__/render.spec.ts | 37 +++++++++++++++++++ .../layout-algorithms/elk/render.ts | 14 ++++++- 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 .changeset/elk-container-cycle-breaking.md create mode 100644 e2e/diagrams/state-diagram-v2/composite-with-a-loop-starts-on-its-start-state.mmd diff --git a/.changeset/elk-container-cycle-breaking.md b/.changeset/elk-container-cycle-breaking.md new file mode 100644 index 00000000000..004d607141a --- /dev/null +++ b/.changeset/elk-container-cycle-breaking.md @@ -0,0 +1,19 @@ +--- +'mermaid': patch +--- + +fix(elk): a composite state or subgraph containing a loop now opens on its own start node. + +Cycle breaking was resolved for the root graph but never passed to containers, so a +container laid out on its own fell back to ELK's default, `GREEDY`, while the root ran +whatever `elk.preset` asked for. The two then reversed different edges of the same cycle. + +In a composite state that loops, greedy reverses the edge that turns an ordinary state +into a source, and sources sit on the first layer — so the diagram opened on that state +alongside its start circle instead of on the start circle alone. Dagre reverses the other +edge, which is why the two layout engines disagreed on the same diagram. + +Containers now resolve cycle breaking from the preset exactly as the root does. Only +containers that actually contain a cycle change; an acyclic subgraph gives a cycle-breaking +strategy nothing to do. `preset: legacy` still reaches containers with `GREEDY`, so it keeps +reproducing the earlier rendering inside frames as well as outside them. diff --git a/e2e/diagrams/state-diagram-v2/composite-with-a-loop-starts-on-its-start-state.mmd b/e2e/diagrams/state-diagram-v2/composite-with-a-loop-starts-on-its-start-state.mmd new file mode 100644 index 00000000000..78295e6660f --- /dev/null +++ b/e2e/diagrams/state-diagram-v2/composite-with-a-loop-starts-on-its-start-state.mmd @@ -0,0 +1,13 @@ +--- +config: + layout: elk +--- +stateDiagram-v2 +state apa { + [*] --> Still + Still --> [*] + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +} diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts index b7f6d312714..c00c99bd369 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/__tests__/render.spec.ts @@ -150,6 +150,43 @@ describe('buildSubgraphLayoutOptions', () => { expect(opts['elk.layered.nodePlacement.strategy']).toBe('SIMPLE'); }); + it('takes the cycle breaking strategy from the named preset', () => { + const breaking = (preset?: string) => + buildSubgraphLayoutOptions({}, preset ? { preset } : undefined, 'layered')[ + 'elk.layered.cycleBreaking.strategy' + ]; + + // Containers used to receive no cycle-breaking option at all and silently + // ran ELK's own default, GREEDY, while the root ran the preset's. The two + // sides then broke different edges of the same cycle, so a composite + // containing a loop opened on whichever node greedy promoted to a source. + expect(breaking()).toBe('DEPTH_FIRST'); + expect(breaking('default')).toBe('DEPTH_FIRST'); + expect(breaking('modelOrder')).toBe('GREEDY_MODEL_ORDER'); + // `legacy` reproduces what earlier versions rendered, so it has to keep + // reaching containers with GREEDY rather than inheriting the new default. + expect(breaking('legacy')).toBe('GREEDY'); + }); + + it('lets an explicit cycleBreakingStrategy beat the preset in a container', () => { + const opts = buildSubgraphLayoutOptions( + {}, + { preset: 'legacy', cycleBreakingStrategy: 'MODEL_ORDER' }, + 'layered' + ); + expect(opts['elk.layered.cycleBreaking.strategy']).toBe('MODEL_ORDER'); + }); + + it('resolves container cycle breaking to the same value as the root', () => { + // The bug was the two disagreeing. Pin that they agree rather than pinning + // each side's value separately, which is what let them drift. + for (const preset of ['default', 'legacy', 'modelOrder', 'depthFirst']) { + expect( + buildSubgraphLayoutOptions({}, { preset }, 'layered')['elk.layered.cycleBreaking.strategy'] + ).toBe(resolveElkPreset(preset).cycleBreaking); + } + }); + it('takes the container placement strategy from the named preset', () => { const placement = (preset: string) => buildSubgraphLayoutOptions({}, { preset }, 'layered')['elk.layered.nodePlacement.strategy']; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts index 39467d3d21c..8cef4721680 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts +++ b/packages/mermaid/src/rendering-util/layout-algorithms/elk/render.ts @@ -79,6 +79,7 @@ interface ElkSubgraphConfig { layeringLayerBound?: number; nodePlacementAlignment?: string; nodePlacementStrategy?: string; + cycleBreakingStrategy?: string; } interface ElkPreparedLayout { @@ -322,6 +323,10 @@ export function buildSubgraphLayoutOptions( const pad = node.padding ?? 0; const minWidth = labelW + 2 * pad; const labelH = node.labelData?.height ?? 0; + // Hoisted, as in `createRootElkGraph`: the two functions resolve the same + // preset for the same reasons, and reading alike is most of what keeps them + // from drifting apart again. + const preset = resolveElkPreset(elkConfig?.preset); const layoutOptions: Record = { 'spacing.baseValue': DEFAULT_SUBGRAPH_SPACING_BASE_VALUE, @@ -372,7 +377,14 @@ export function buildSubgraphLayoutOptions( // — as this did — leaves the container holding two values for it with no // say in which wins, and quietly ignores an explicit `nodePlacementStrategy`. 'elk.layered.nodePlacement.strategy': - elkConfig?.nodePlacementStrategy ?? resolveElkPreset(elkConfig?.preset).containerPlacement, + elkConfig?.nodePlacementStrategy ?? preset.containerPlacement, + // Resolved here as well as at the root, because a container laid out on its + // own never sees the root's value and falls back to ELK's default, GREEDY. + // That reverses a different edge than the preset asked for, so a composite + // containing a loop opens on whichever node greedy promoted to a source + // rather than on its own start node. Same key and same resolution as the + // root, so `legacy` reproduces the old rendering inside frames too. + 'elk.layered.cycleBreaking.strategy': elkConfig?.cycleBreakingStrategy ?? preset.cycleBreaking, // PORT_POSITION lets a node shift so an edge can leave straight rather than // bending immediately off the port. 'elk.layered.nodePlacement.networkSimplex.nodeFlexibility': 'PORT_POSITION', From ee33b4b679f2430227879322e6354d87515b1e31 Mon Sep 17 00:00:00 2001 From: Per Brolin Date: Thu, 3 Sep 2026 09:40:46 +0200 Subject: [PATCH 31/31] Set default layout to elk for state diagrams --- packages/mermaid/src/schemas/config.schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/schemas/config.schema.yaml b/packages/mermaid/src/schemas/config.schema.yaml index 12eb0b87d34..ad7cd314cdb 100644 --- a/packages/mermaid/src/schemas/config.schema.yaml +++ b/packages/mermaid/src/schemas/config.schema.yaml @@ -1661,7 +1661,7 @@ $defs: # JSON Schema definition (maybe we should move these to a separate file) default: 'neo' layout: $ref: '#/$defs/BaseDiagramConfig/properties/layout' - default: 'dagre' + default: 'elk' titleTopMargin: $ref: '#/$defs/GitGraphDiagramConfig/properties/titleTopMargin' default: 25