Drawing trees within notes or using Salt

0 votes
asked Jan 18, 2017 in Wanted features by agillesp (600 points)

I have been trying to draw a directory tree with a comment column against each line, with the comments vertically aligned. Hopefully a couple of examples will explain:

First using notes:

    @startuml
    skinparam noteFontName Courier
    note as N1
      top_level                                 <color:red>Top level comment
      |_ second_level                           <color:blue>Second level comment
        |_ even_lower_third_level               <color:green>Third level comment
    end note
    @enduml
 
And also using Salt:
 
    @startuml
    salt
    {
      {T
         +      top_level                       <color:red>Top level comment
         ++       second_level                  <color:blue>Second level comment
         +++        even_lower_third_level      <color:green>Third level comment
      }
    }
    @enduml
 
As you can see, the comment columns are not aligned. I have tried changing to a monospaced font but that doesn't help (in the note case at least - it doesn't seem to be possible to change the font used by Salt)
 
Is there any way to achieve this?
 
Thanks
--Alan Gillespie
 
 
commented Jan 18, 2017 by agillesp (600 points)
EDIT: Just found the tree table feature in Salt which seems to do what I need.

1 Answer

0 votes
answered Jan 24, 2017 by shumov (160 points)
Use pipes
 
    @startuml
    salt
    {
      {T
         +      top_level                      | <color:red>Top level comment
         ++       second_level                 | <color:blue>Second level comment
         +++        even_lower_third_level     | <color:green>Third level comment
      }
    }
    @enduml
...