diff --git a/.changeset/smart-humans-cover.md b/.changeset/smart-humans-cover.md new file mode 100644 index 000000000..4408e0a9c --- /dev/null +++ b/.changeset/smart-humans-cover.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: Update flowchart direction TD's behavior to be the same as TB diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.ts b/packages/mermaid/src/diagrams/flowchart/flowDb.ts index 65f8c4a05..303ad0e66 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.ts @@ -403,7 +403,8 @@ You have to call mermaid.initialize.` * */ public setDirection(dir: string) { - this.direction = dir; + this.direction = dir.trim(); + if (/.*