Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flowchart: Apply nodeSpacing/rankSpacing config to subgraphs #5183

Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
beb308c
Resolved issue with subgraph configuration
rowanfr Jan 7, 2024
3bbd8fe
Removed unnecessary function
rowanfr Jan 8, 2024
65fd3a3
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 11, 2024
36c84b3
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 12, 2024
565f154
Update demos/flowchart.html
rowanfr Jan 14, 2024
a5ecc7a
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 15, 2024
f693084
Fixed configuration override on subgraphs
rowanfr Jan 16, 2024
0c7e2e2
Fixed linting error
rowanfr Jan 16, 2024
3fad11e
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 18, 2024
ff5240c
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 19, 2024
6a1a38b
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
sidharthv96 Jan 19, 2024
fa201ad
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 20, 2024
140645b
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 23, 2024
82c4052
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Jan 28, 2024
0ce33cb
Update packages/mermaid/src/dagre-wrapper/index.js
rowanfr Feb 28, 2024
5935e27
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Feb 28, 2024
3602191
Added E2E testing for spacing
rowanfr Feb 28, 2024
0cb365c
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Feb 29, 2024
8862d63
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
aloisklink Feb 29, 2024
5ccdb6f
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 5, 2024
ae29dd1
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 6, 2024
424d988
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 8, 2024
de4ad76
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 8, 2024
77ba19c
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 9, 2024
4feb2e6
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 12, 2024
d0a0085
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
rowanfr Mar 23, 2024
3f556fa
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
sidharthv96 Mar 23, 2024
b78f16e
Merge branch 'develop' into origin/3258_Flowchart_nodeSpacing_Subgraph
sidharthv96 Mar 23, 2024
dbb69ad
Add extra test
sidharthv96 Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions demos/flowchart.html
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,33 @@ <h3>flowchart</h3>
</pre>
<hr />

<pre class="mermaid">
---
title: Subgraph nodeSpacing and rankSpacing example
config:
flowchart:
nodeSpacing: 1
rankSpacing: 1
---

flowchart LR

X --> Y

subgraph X
direction LR
A
C
end

subgraph Y
direction LR
B
D
end
rowanfr marked this conversation as resolved.
Show resolved Hide resolved
</pre>
<hr />

<h1 id="link-clicked">Anchor for "link-clicked" test</h1>

<script type="module">
Expand Down
3 changes: 3 additions & 0 deletions packages/mermaid/src/dagre-wrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const recursiveRender = async (_elem, graph, diagramtype, id, parentCluster, sit
if (node && node.clusterNode) {
// const children = graph.children(v);
log.info('Cluster identified', v, node.width, graph.node(v));
// node.graph.setGraph applies the graph configurations such as nodeSpacing to subgraphs as without this the default values would be used
// We override the `rankdir` variable to allow for the subgraph's direction to override the graphs direction in the subgraph
node.graph.setGraph({ ...graph.graph(), rankdir: node.graph.graph().rankdir });
rowanfr marked this conversation as resolved.
Show resolved Hide resolved
const o = await recursiveRender(
nodes,
node.graph,
Expand Down
Loading