Mermaid: Mix horizontal and vertical graph

Created on 20 Dec 2014  Â·  5Comments  Â·  Source: mermaid-js/mermaid

Hi!
I am tying to make a graph like this:
linreg-graph
Is it possible?
And if not - is there some alternative way to do that?

P.S.
Thank you very much for a fantastic project!!

Other

Most helpful comment

hi @knsv fantastic project! (sorry just had to say that) ... i believe subgraphs still cannot have their own topology and inherit it from the parent. is this feature planned to be added? will add great flexibility to mermaid.

All 5 comments

Thanks for the kind words!

Unfortunately I cant think of a good way to do what you are trying to do.

I am new to this project, and so haven't looked at the code in detail yet, but I was interested in doing something similar, and wondered if it might be possible to extend layout support (TD,LR, etc.) to subgraphs. If that could be done, then the above could be represented as:

graph TD
  ts(Training Set) --> la(Learning Algorithm)
  subgraph hypothesis LR
  sh(Size Of House) --> h(Hypothesis) --> ep(Estimated Price)
  end
  la --> h

The "LR" in the subgraph defininition would specify a horizontal left-to-right layout for subgraph elements, creating the inverted T structure desired above. Is this feasible to implement in the current architecture?

Hello Andrew!

Subgraphs are actually supported with very similar syntax to the one you proposed.

The only difference is that in the current implementation the subgraphs inherit the layout from the main chart.

Chains are however not supported:
h(Size Of House) --> h(Hypothesis) --> ep(Estimated Price)

would take two rows:

h(Size Of House) --> h(Hypothesis)
h(Hypothesis) --> ep(Estimated Price)

so correct syntax for the subgraph would be:
subgraph hypothesis
sh(Size Of House) --> h(Hypothesis)
h(Hypothesis) --> ep(Estimated Price)
end

I hope this help!
/Knut

On Tuesday 7 April 2015 at 02:40, Andrew Hart wrote:

I am new to this project, and so haven't looked at the code in detail yet, but I was interested in doing something similar, and wondered if it might be possible to extend layout support (TD,LR, etc.) to subgraphs. If that could be done, then the above could be represented as:
graph TD ts(Training Set) --> lr(Learning Algorithm) subgraph hypothesis LR sh(Size Of House) --> h(Hypothesis) --> ep(Estimated Price) end lr --> h
The "LR" in the subgraph defininition would specify a horizontal left-to-right layout for subgraph elements, creating the inverted T structure desired above. Is this feasible to implement in the current architecture?

—
Reply to this email directly or view it on GitHub (https://github.com/knsv/mermaid/issues/68#issuecomment-90298086).

I am going through issues and see this one as closed. Let me know if you feel differently.

hi @knsv fantastic project! (sorry just had to say that) ... i believe subgraphs still cannot have their own topology and inherit it from the parent. is this feature planned to be added? will add great flexibility to mermaid.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PaoloneM picture PaoloneM  Â·  4Comments

init-dcat-ap-de picture init-dcat-ap-de  Â·  3Comments

mestaritonttu picture mestaritonttu  Â·  3Comments

lwalker-kforce picture lwalker-kforce  Â·  3Comments

erelling picture erelling  Â·  3Comments