diff --git a/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts b/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts index b66afe4bf7..df3f57e47a 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts @@ -7,13 +7,14 @@ import type { const id = 'flowchart-v2'; const detector: DiagramDetector = (txt, config) => { - if ( - config?.flowchart?.defaultRenderer === 'dagre-d3' || - config?.flowchart?.defaultRenderer === 'elk' - ) { + if (config?.flowchart?.defaultRenderer === 'dagre-d3') { return false; } + if (config?.flowchart?.defaultRenderer === 'elk') { + config.layout = 'elk'; + } + // If we have configured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram if (/^\s*graph/.test(txt) && config?.flowchart?.defaultRenderer === 'dagre-wrapper') { return true; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js index c9c1926da2..307242675a 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js +++ b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js @@ -111,7 +111,7 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit if (graph.children(v).length > 0) { // This is a cluster but not to be rendered recursively // Render as before - log.info( + log.trace( 'Cluster - the non recursive path XBX', v, node.id, @@ -120,11 +120,11 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit 'Graph:', graph ); - log.info(findNonClusterChild(node.id, graph)); + log.trace(findNonClusterChild(node.id, graph)); clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph), node }); // insertCluster(clusters, graph.node(v)); } else { - log.warn('Node - the non recursive path XAX', v, nodes, graph.node(v), dir); + log.trace('Node - the non recursive path XAX', v, nodes, graph.node(v), dir); await insertNode(nodes, graph.node(v), dir); } }