mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Update packages/mermaid/src/dagre-wrapper/index.js
The code setting the `ranksep` and `nodesep` to subgraphs was made cleaner and more legible while maintaining the intended functionality of subgraph spacing Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
parent
82c405289d
commit
0ce33cb160
@ -56,7 +56,12 @@ const recursiveRender = async (_elem, graph, diagramtype, id, parentCluster, sit
|
||||
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 });
|
||||
const { ranksep, nodesep } = graph.graph();
|
||||
node.graph.setGraph({
|
||||
...node.graph.graph(),
|
||||
ranksep,
|
||||
nodesep,
|
||||
});
|
||||
const o = await recursiveRender(
|
||||
nodes,
|
||||
node.graph,
|
||||
|
Loading…
x
Reference in New Issue
Block a user