0

Any suggestions on how to plot a data.tree vertically by node instead of spread below the node?

Current Method - data.tree child nodes are spread from left to right...

Current Method

Desired Method.... Group the nodes from top to bottom below parent node.

Desired Method

int64
  • 81
  • 4

1 Answers1

0

I found some references for this type of plot. I have included an R script for reference.

library(DiagrammeR)
#render_graph(ToDiagrammeRGraph(acme))


grViz("

graph ProductBasedPlanning
{
  node [shape='box'];
  rankdir = 'TB';
  splines=false

  xm1 [shape='point']
  xm2 [shape='point']
  xm3 [shape='point']

  'MEVDA' -- 'xm2' 

  {
    rank='same'
    'xm1' -- 'xm2' -- 'xm3' [constraint=false]
  }

  'xm1' -- 'Functionality 1'
  'xm2' -- 'Functionality 2'
  'xm3' -- 'Functionality 3'

  'Functionality 1' -- 'x1a' -- 'x1b' -- 'x1c'
  'Functionality 2' -- 'x2a' -- 'x2b' -- 'x2c'
  'Functionality 3' -- 'x3a' -- 'x3b' -- 'x3c'

  {
    rank='same'
    'x1a' [shape='point']
    'x1a' -- 'Functionality 1a' 
  }
  {
    rank='same'
    'x1b' [shape='point']
    'x1b' -- 'Functionality 1b'
  }
  {
    rank='same'
    'x1c' [shape='point']
    'x1c' -- 'Functionality 1c'
  }

  {
    rank='same'
    'x2a' [shape='point']
    'x2a' -- 'Functionality 2a'
  }
  {
    rank='same'
    'x2b' [shape='point']
    'x2b' -- 'Functionality 2b' 
  }
  {
    rank='same'
    'x2c' [shape='point']
    'x2c' -- 'Functionality 2c'
  }

  {
    rank='same'
    'x3a' [shape='point']
    'x3a' -- 'Functionality 3a'
  }
  {
    rank='same'
    'x3b' [shape='point']
    'x3b' -- 'Functionality 3b'
  }
  {
    rank='same'
    'x3c' [shape='point']
    'x3c' -- 'Functionality 3c' 
  }
}
")

The resulting image: enter image description here

Good Luck :)

int64
  • 81
  • 4