How do I set all mindmap leaf nodes to boxless?

0 votes
asked Jul 15 in Wanted features by Mr. Lefebvre
I would like to set all mindmap leaf nodes to boxless.  I know I can do that with "_", but I'd like to do that within the <style> framework. If I change my mindmap, or move nodes around, I'd like them to automatically assume a boxless or non-boxless style, depending on where they end up in the mindmap.

Also, it would be nice to specify that anything of depth(3) or greater should be boxless.  I'd like to do this to highlight the top levels of the mindmap.  Having the lower levels be boxless will also take up less room.

1 Answer

0 votes
answered Jul 15 by The-Lu (48,920 points)

Hello M.,

Here is a proposal, using `style`:

@startmindmap
<style>
node {
  LineColor transparent
  BackGroundColor transparent
  Padding 2
}
:depth(0) {
  LineColor #181818
  BackGroundColor #f1f1f1
  Padding 10
  Margin 10
}
:depth(1) {
  LineColor #181818
  BackGroundColor #f1f1f1
  Padding 10
  Margin 10
}
:depth(2) {
  LineColor #181818
  BackGroundColor #f1f1f1
  Padding 10
  Margin 10
}
</style>
* r0
** a
*** a1
**** a11
*** a2
**** a21
***** a211
** b
*** b1
**** b11
**** b12
*** b2
** c
@endmindmap

Enjoy...
See also doc. on `style` or `mindmap` on the plantuml web site.

Regards.

commented Jul 15 by Mr. Lefebvre

Thanks!  This does mostly what I need.

I was hoping for something a little cleaner, but this works by reversing the premise... make all nodes boxless, and then explicitly set the top levels to not be boxless.

Something like this would be easier to write and understand, but it doesn't interpret the * in the same way as " .my-style * " does with the <<my-style>> feature.  It would be nice if it did.

' All nodes at depth 3 and greater have the following format.
node {
   :depth(3) * {
      linecolor transparent
      backgroundcolor transparent
      padding 0
      margin 0
   }
}
commented Jul 16 by The-Lu (48,920 points)

Yes, you have right...

Then see the corresponding wanted feature here:

Regards.
...