From dd36046e23ccbc7e415d2c31b429f36aa4e68014 Mon Sep 17 00:00:00 2001 From: darshanr0107 Date: Mon, 11 Aug 2025 14:22:08 +0530 Subject: [PATCH] docs: update tidy-tree Readme on-behalf-of: @Mermaid-Chart --- packages/mermaid-layout-tidy-tree/README.md | 30 +++++++++---------- .../mermaid/src/rendering-util/createGraph.ts | 4 --- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/packages/mermaid-layout-tidy-tree/README.md b/packages/mermaid-layout-tidy-tree/README.md index 47cf82d94..e8ae05f4c 100644 --- a/packages/mermaid-layout-tidy-tree/README.md +++ b/packages/mermaid-layout-tidy-tree/README.md @@ -8,44 +8,42 @@ This package provides a bidirectional tidy tree layout engine for Mermaid based ## Usage -flowchart-tidy-tree TD -A --> B -A --> C - +``` --- - config: -layout: tidy-tree - + layout: tidy-tree --- - -flowchart TD -A --> B -A --> C +mindmap +root((mindmap)) + A + B +``` ### With bundlers -sh +```sh npm install @mermaid-js/layout-tidy-tree +``` -ts +```ts import mermaid from 'mermaid'; import tidyTreeLayouts from '@mermaid-js/layout-tidy-tree'; mermaid.registerLayoutLoaders(tidyTreeLayouts); +``` ### With CDN -html - +```html +``` -## Supported layouts +## Tidy Tree Layout Overview tidy-tree: The bidirectional tidy tree layout diff --git a/packages/mermaid/src/rendering-util/createGraph.ts b/packages/mermaid/src/rendering-util/createGraph.ts index 3cd3c9de0..b08a3aae0 100644 --- a/packages/mermaid/src/rendering-util/createGraph.ts +++ b/packages/mermaid/src/rendering-util/createGraph.ts @@ -65,10 +65,6 @@ export async function createGraphWithElements( node.width = boundingBox.width; node.height = boundingBox.height; graph.setNode(node.id, { ...node }); - if (node.parentId) { - // Optionally store the parent relationship (Graphology doesn't have a native parent-child concept) - // e.g., you could update the node attributes or handle it as needed. - } } }) );