butiran

layers with nodes

intro

We can use Mermaid, a simple Markdown-like script language for generating charts from text via JavaScript (Mallin, 2018), to draw layers with nodes, where the diagram element used is circle and the feature of subgraph. But this would not be the main purpose of Mermaid, but we can use for it.

model

O
G
H
I
w11
w12
w13
w21
w22
w23
w31
w32
w33
w41
w42
w43
v11
v12
v13
v14
v21
v22
v23
v24
v31
v32
v33
v34
u11
u12
u13
u21
u22
u23
1
2
1
2
3
1
2
3
4
1
2
3

mermaid

flowchart RL
  i1--"w11"-->h1;i2--"w12"-->h1;i3--"w13"-->h1;
  i1--"w21"-->h2;i2--"w22"-->h2;i3--"w23"-->h2;
  i1--"w31"-->h3;i2--"w32"-->h3;i3--"w33"-->h3;
  i1--"w41"-->h4;i2--"w42"-->h4;i3--"w43"-->h4;
  
  h1--"v11"-->g1;h2--"v12"-->g1;h3--"v13"-->g1;h4--"v14"-->g1;
  h1--"v21"-->g2;h2--"v22"-->g2;h3--"v23"-->g2;h4--"v24"-->g2;
  h1--"v31"-->g3;h2--"v32"-->g3;h3--"v33"-->g3;h4--"v34"-->g3;
  
  g1--"u11"-->o1;g2--"u12"-->o1;g3--"u13"-->o1;
  g1--"u21"-->o2;g2--"u22"-->o2;g3--"u23"-->o2;
  
  subgraph I
    i1(("1"))
    i2(("2"))
    i3(("3"));
  end
  
  subgraph H
    h1(("1"))
    h2(("2"))
    h3(("3"))
    h4(("4"));
  end
  
  subgraph G
    g1(("1"))
    g2(("2"))
    g3(("3"))
  end
  
  subgraph O
    o1(("1"))
    o2(("2"))
  end
  
  classDef nodes fill:transparent, color:inherit
  classDef layers fill:none, color:inherit
  
  class i1,i2,i3 nodes
  class h1,h2,h3,h4 nodes
  class g1,g2,g3 nodes
  class o1,o2 nodes
  class I,H,G,O layers
  
  linkStyle default stroke:#8a8

notes

refs