mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.04k stars 6.54k forks source link

Enhancement or new diagram - see comments #4242

Open jgreywolf opened 1 year ago

jgreywolf commented 1 year ago

this isn't just for genealogies - my use case is an ERD type where i wanted to show the relationship between several groups of objects - something like this -- at the moment you can't make the outer boxes at the same height, they get bumped up/down based on the perceived relative row they should be on. image

flowchart TB

subgraph A
  a1-->a2-->a3-->a4-->a5
end

subgraph B
  b1-->b2-->b3-->b4-->b5
end

subgraph C
  c1-->c2-->c3-->c4-->c5
end

a1-.->b2
a3-.->b1
b1-.->c2
b2-.->c4
b3-.->c4
a5-.->b4

gives

image

which has the order c,b,a and has A substantially raised - there is no way to coerce it to be like the first picture that i'm aware of.

trying to force it with LR results in flowchart LR

subgraph A
  direction TB
  a1-->a2-->a3-->a4-->a5
end

subgraph B
  direction TB
  b1-->b2-->b3-->b4-->b5
end

subgraph C
  direction TB
  c1-->c2-->c3-->c4-->c5
end

a1-.->b2
a3-.->b1
b1-.->c2
b2-.->c4
b3-.->c4
a5-.->b4

image

Originally posted by @AartBluestoke in https://github.com/mermaid-js/mermaid/issues/1747#issuecomment-1472913046

jgreywolf commented 1 year ago

@knsv Is this something that would be possible with block diagrams?