From 5d1b50cb653ec59d03888d1204f12a8b71dc0105 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 25 Aug 2024 01:47:48 +0530 Subject: [PATCH 1/4] docs: Add argos in readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d5eebfeb..1788901ee 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Try Live Editor previews of future releases: @@ -82,6 +82,10 @@ You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include- For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](https://mermaid.js.org/intro/getting-started.html), [Usage](https://mermaid.js.org/config/usage.html) and [Tutorials](https://mermaid.js.org/ecosystem/tutorials.html). +Our PR Visual Regression Testing is powered by [Argos](https://argos-ci.com/?utm_source=mermaid&utm_campaign=oss) with their generous Open Source plan. It makes the process of reviewing PRs with visual changes a breeze. + +[![Covered by Argos Visual Testing](https://argos-ci.com/badge-large.svg)](https://argos-ci.com?utm_source=mermaid&utm_campaign=oss) + In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests. From 755394ac9a9db07bdc96bbaacce408d53941cec4 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 25 Aug 2024 09:36:50 +0530 Subject: [PATCH 2/4] docs: Add argos in intro --- docs/intro/index.md | 4 ++++ packages/mermaid/src/docs/intro/index.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/intro/index.md b/docs/intro/index.md index fda36f1da..5a71b45a4 100644 --- a/docs/intro/index.md +++ b/docs/intro/index.md @@ -55,6 +55,10 @@ For a more detailed introduction to Mermaid and some of its more basic uses, loo **Thanks to all involved, people committing pull requests, people answering questions and special thanks to Tyler Long who is helping me maintain the project 🙏** +Our PR Visual Regression Testing is powered by [Argos](https://argos-ci.com/?utm_source=mermaid&utm_campaign=oss) with their generous Open Source plan. It makes the process of reviewing PRs with visual changes a breeze. + +[![Covered by Argos Visual Testing](https://argos-ci.com/badge-large.svg)](https://argos-ci.com?utm_source=mermaid&utm_campaign=oss) + In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests. diff --git a/packages/mermaid/src/docs/intro/index.md b/packages/mermaid/src/docs/intro/index.md index ed2df32dc..627efdaa1 100644 --- a/packages/mermaid/src/docs/intro/index.md +++ b/packages/mermaid/src/docs/intro/index.md @@ -50,6 +50,10 @@ For a more detailed introduction to Mermaid and some of its more basic uses, loo **Thanks to all involved, people committing pull requests, people answering questions and special thanks to Tyler Long who is helping me maintain the project 🙏** +Our PR Visual Regression Testing is powered by [Argos](https://argos-ci.com/?utm_source=mermaid&utm_campaign=oss) with their generous Open Source plan. It makes the process of reviewing PRs with visual changes a breeze. + +[![Covered by Argos Visual Testing](https://argos-ci.com/badge-large.svg)](https://argos-ci.com?utm_source=mermaid&utm_campaign=oss) + In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests. From 011c036350a9763ffcb77c9bdf37506b188e2e88 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 28 Aug 2024 13:07:11 +0200 Subject: [PATCH 3/4] #5782 fix: adding backwards compatability for defaultRenderer directive --- .../mermaid/src/diagrams/flowchart/flowDetector-v2.ts | 9 +++++---- .../src/rendering-util/layout-algorithms/dagre/index.js | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts b/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts index b66afe4bf..df3f57e47 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 c9c1926da..307242675 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); } } From 28bd07fdeb4fc981107d21317ec6160b31f80116 Mon Sep 17 00:00:00 2001 From: Ashish Jain Date: Wed, 28 Aug 2024 14:07:29 +0200 Subject: [PATCH 4/4] added changeset for recent PR --- .changeset/famous-bananas-join.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/famous-bananas-join.md diff --git a/.changeset/famous-bananas-join.md b/.changeset/famous-bananas-join.md new file mode 100644 index 000000000..48c29a8ad --- /dev/null +++ b/.changeset/famous-bananas-join.md @@ -0,0 +1,6 @@ +--- +'mermaid': patch +--- + +Fix for self loops in cluster +Supporting legacy defaultRenderer directive