plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

MindMap Diagram Support! #43

Closed aadrian closed 1 year ago

aadrian commented 7 years ago

Hi,

Please add MindMap Diagram Support too :) .

Something compact like FreePlane https://sourceforge.net/projects/freeplane/ is producing: http://freeplane.sourceforge.net/wiki/index.php/File:FreeplaneWiki.jpg would be very useful.

Thanks in advance.

ghost commented 6 years ago

I second this request. It would be a valuable edition for early inception of customer requirements.

rezarahimi commented 6 years ago

I find this feature very useful and valuable.

chen56 commented 5 years ago

plan?

HabibMAALEM commented 5 years ago

+1

EtienneK commented 5 years ago

+1

balancin commented 5 years ago

+1 !

everdom commented 5 years ago

+1

fcu-d0449763 commented 5 years ago

+1

arunkhattri commented 5 years ago

+1

olkobg commented 5 years ago

+1

dinosaurkfb commented 5 years ago

+1

alexjorgef commented 5 years ago

+1

novoid commented 5 years ago

Please can we stop adding pointless "+1" comments here that spam all people who are watching this issue?

Add a +1 emoji to the topmost comment instead to express your support. This also prevents "information fragmentation" among comments and emoji reactions.

arnaudroques commented 5 years ago

Ok, since this is very popular, we have created a page here http://wiki.plantuml.net/site/mindmap On this page, we expect people to propose a simple syntax and some images. Once the design will be fixed, we will see how implement it.

pinage404 commented 5 years ago

As a first step, i would like to have a very simple syntax (more options could be added later), something like this :

* root node
    * some first level node
        * second level node
        * another second level node
    * another first level node

That would generate something like this :

14795e60316f11e98b7eb99c51ab8a47 map

(Done with MindMup)

novoid commented 5 years ago

As a first step, i would like to have a very simple syntax (more options could be added later), something like this [...]

Thanks for the first syntax proposal.

Instead of introducing a new syntax (at least I do think this is not some common markup language syntax), I'd suggest to use any given syntax. I personally do have preference for Org mode syntax.

With this, your example would look like:

* root node
** some first level node
**** second level node
**** another second level node
** another first level node

The advantage of Org mode would also be that there is the possibility to add links between the nodes and a ton of cool stuff later on, if necessary: https://orgmode.org/worg/dev/org-syntax.html

pinage404 commented 5 years ago

My syntax proposition is compatible with Markdown nested lists

I don't know the Org Mode syntax, yet ; but it seems simple too =)

I'm really impatient to have this feature

arnaudroques commented 5 years ago

Ok, thanks for all your suggestions. This is more an alpha version, but with last beta http://beta.plantuml.net/plantuml.jar you can have

@startmindmap
* root node
** some first level node
*** second level node
*** another second level node
** another first level node
@endmindmap

The drawing is far from perfect (no link, only basic layout...) but we are working hard on it. After all this time, we just want to let you know that we have started something !

swmatisa commented 5 years ago

Thanks for this first step. The png is one pixel too narrow and one pixel not high enough.

It is OK with svg

arnaudroques commented 5 years ago

We have added links drawing in last beta http://beta.plantuml.net/plantuml.jar There are still some pixels error, we will fix them in the incoming days. We have updated http://wiki.plantuml.net/site/mindmap page with some other syntaxes that are all working with current beta. The idea is to let people play with different syntaxes to let new ideas emerge... You can post your suggestions either in this post or in the wiki. Thanks for your help!

pinage404 commented 5 years ago

EDIT i tried with the jar downloaded at 20h30 GMT

Great work ! @arnaudroques

Same problème as @swmatisa, the png is a bit cropped

The SVG seems good

I wrote a ~~ugly~~ _simple_ Python 3 script to help me generate some cases ```python=3 #!/usr/bin/env python3 import sys def deep(width, depth, previous_level_star='*', previous_level_label=''): if depth < 0: return for index in range(1, width + 1): level_star = previous_level_star + '*' level_label = previous_level_label + str(index) print('%s %s' % (level_star, level_label)) deep(width, depth - 1, level_star, level_label) def generate_mindmap(width, depth): print('@startmindmap') print('* root') deep(width, depth) print('@endmindmap') try: width = int(sys.argv[1]) depth = int(sys.argv[2]) generate_mindmap(width, depth) except (ValueError, IndexError): print('USAGE: %s WIDTH DEPTH' % sys.argv[0]) ```

Here is all my tests, i hope that can help you


This one gave me error42 :warning:

./deep.py 2 2 > map.puml
@startmindmap
* root
** 1
*** 11
**** 111
**** 112
*** 12
**** 121
**** 122
** 2
*** 21
**** 211
**** 212
*** 22
**** 221
**** 222
@endmindmap

Multiroot displayed the last root with his branch (:warning: i don't know how it should behave)

@startmindmap
* First Root
** With some branch
* Second Root
** With another branch
@endmindmap

Option worked :ok_hand:

@startmindmap
scale 2

* Option
@endmindmap

Comment worked :ok_hand:

@startmindmap
* Root
' * Comment
@endmindmap

Deep map worked :ok_hand:

./deep.py 1 100 > map.puml

No root gave me a Syntax Error? :ok_hand:

@startmindmap
@endmindmap

Empty node gave me a Syntax Error? :ok_hand:

@startmindmap
* Root
* 
@endmindmap

Missing level gave me a Syntax Error? :ok_hand:

@startmindmap
* first
*** third
@endmindmap

Two branches with the same name gave me two branches with the same name :ok_hand:

@startmindmap
* root
** two branches with the same name
** two branches with the same name
@endmindmap
arnaudroques commented 5 years ago

Many thanks for your tests : it really helps ! png should be ok with last beta http://beta.plantuml.net/plantuml.jar (beta12) Few other things are working better also, but there are still some work to be done.

pinage404 commented 5 years ago

I don't find recent commits related to the MindMap https://github.com/plantuml/plantuml/commits/master

pinage404 commented 5 years ago

Tested with beta version download at 22:57:00 GMT

Now, there is links between nodes, it's great \o/


No node gave me Empty description :warning: i think this is not the most explicit error

@startmindmap
@endmindmap

No node with description generate nothing :warning:

@startmindmap "no empty description"
@endmindmap

Missing branch gave me error42 :warning:

@startmindmap
0 root
1> 1
3> 3
@endmindmap

Missing branch with other syntax gave me error42 :warning: (same issue as above)

@startmindmap
* root
*> 1
*>>> 3
@endmindmap

Previously, this didn't work ; now, it works :ok_hand:

./deep.py 2 2 > map.puml
@startmindmap
* root
** 1
*** 11
**** 111
**** 112
*** 12
**** 121
**** 122
** 2
*** 21
**** 211
**** 212
*** 22
**** 221
**** 222
@endmindmap

Multiroot display an appropriate message :ok_hand:

@startmindmap
* First Root
** With some branch
* Second Root
** With another branch
@endmindmap

Mixing the syntaxes works :ok_hand:

@startmindmap
0 root
** 1
2> 2
**** 3
*>>>> 4
@endmindmap
arnaudroques commented 5 years ago

With last beta http://beta.plantuml.net/plantuml.jar you can remove the box drawing:

@startmindmap
0 root node
1> some first level node
2>_ second level node
2>_ another second level node
2>_ foo
2>_ bar
2>_ foobar
1> another first level node
@endmindmap

We have also slightly enhanced the link drawing. All these will be integrated in next official release beginning of March.

pinage404 commented 5 years ago

Nice !

OrgMode syntax with dash doesn't work Syntax Error? :warning:

@startmindmap
0 root node
**_ bar
1>_ foo
*>_ foobar
@endmindmap
pinage404 commented 5 years ago

Empty mindmap generate a file with the given name (not an empty description.png in this case) but with the error Empty description :warning: the help message message is wrong

@startmindmap "not an empty description"
@endmindmap
pinage404 commented 5 years ago

header and footer are not generated :warning:

@startmindmap
* root

header
My super header
endheader

center footer My super footer
@endmindmap

Same problem for title :warning:

@startmindmap
* root

title My super title
@endmindmap

Same for caption :warning:

@startmindmap
* root

caption figure 1
@endmindmap

Idem for legend :warning:

@startmindmap
* root

legend top left
  Short
  legend
endlegend

legend right
  Short
  legend
endlegend
@endmindmap

Skin Param seems to doesn't work too :warning:

@startmindmap
skinparam monochrome true

* root
** first
** second
@endmindmap
@startmindmap
skinparam monochrome reverse

* root
** first
** second
@endmindmap
@startmindmap
skinparam backgroundColor #EEEBDC
skinparam handwritten true

* root
** first
** second
@endmindmap

Links work :ok_hand:

@startmindmap
* root
** first
** [[http://plantuml.com PlantUML is cool]]
@endmindmap
pinage404 commented 5 years ago

Opinion :

I don't like number syntax because it's more difficult to understand / visualize by simply reading the text file

@startmindmap "number syntax"
0 Linux
1> NixOS
1> Debian
2> Ubuntu
3> Linux Mint
3> Kubuntu
3> Lubuntu
3> KDE Neon
2> LMDE
2> SolydXK
2> SteamOS
2> Raspbian
3> <s>Raspmbc</s> => OSMC
3> <s>Raspyfi</s> => Volumio
@endmindmap

I prefer the OrgMode syntax, it's more verbose but easier to see the levels

@startmindmap "OrgMode"
* Linux
** NixOS
** Debian
*** Ubuntu
**** Linux Mint
**** Kubuntu
**** Lubuntu
**** KDE Neon
*** LMDE
*** SolydXK
*** SteamOS
*** Raspbian
**** <s>Raspmbc</s> => OSMC
**** <s>Raspyfi</s> => Volumio
@endmindmap

Or better yet, the Markdown syntax (which is not implemented yet) which is really easy to read and understand the levels

@startmindmap "Markdown"
* Linux
    * NixOS
    * Debian
        * Ubuntu
            * Linux Mint
            * Kubuntu
            * Lubuntu
            * KDE Neon
        * LMDE
        * SolydXK
        * SteamOS
        * Raspbian
            * <s>Raspmbc</s> => OSMC
            * <s>Raspyfi</s> => Volumio
@endmindmap
arnaudroques commented 5 years ago

With last beta http://beta.plantuml.net/plantuml.jar you can now have:

@startmindmap
caption figure 1
title My super title

* count
*< 100
*<< 101
*<< 102
*< 200
*> A
*>> AA
*>> AB
*> B

header
My super header
endheader

center footer My super footer
@endmindmap

and

@startmindmap
* root node
    * some first level node
        * second level node
        * another second level node
    * another first level node
@endmindmap

and

@startmindmap
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam monochrome true

* root
** first
** second
@endmindmap

Still interested in feedback :-)

swmatisa commented 5 years ago

Thanks for the news. I do some tests:

Different syntaxes:

Proposal: Add [] or{} to OrgMode and markdown syntax to:

Conclusion:

arnaudroques commented 5 years ago

We've just published the first official release with mindmap support. The doc is really minimal http://plantuml.com/en/mindmap-diagram You can contribute here http://wiki.plantuml.net/site/mindmap-diagram

The syntax is not stable yet, we are going to work on @swmatisa suggestion. We are also going to implement Work Breakdown Structure diagram (see http://forum.plantuml.net/9060/wbs-diagrams ) Somehow, there are connection between Mindmap diagram and WBS diagram...

pinage404 commented 5 years ago

Awesome !!!


I have this mindmap with buble that overlap other bubble :warning:

@startmindmap "weird"
* root
    * Lorem ipsum dolor sit amet
        * Lorem ipsum dolor sit amet
        * Lorem ipsum dolor sit amet
        * Lorem ipsum dolor sit amet
        * Lorem ipsum dolor sit amet
    * Lorem ipsu dolor sit amet
        * ---
            * ---
@endmindmap

weird

pinage404 commented 5 years ago

*<: nice, but only the first level need the direction. If we change the first level all (error42L if not coherent).

I agree with @swmatisa

Currently we can write this :

@startmindmap "tmp/current"
* middle
    *< middle left
        *<< left
    *> middle right
        *>> right
@endmindmap

Which looks like this :

current

I would like to have something like this (not sure how it could evolve) :

@startmindmap "tmp/wanted"
* middle
    *< middle left
        * left
    *> middle right
        * right
@endmindmap

currently, that give an error42L

arnaudroques commented 5 years ago

@pinage404 Thanks for your last "bubble" report. It's fixed in last beta http://beta.plantuml.net/plantuml.jar

arnaudroques commented 5 years ago

In last beta http://beta.plantuml.net/plantuml.jar we have removed support for "number" and bracket "<" ">". It was indeed too cryptic. Do you agree ? The trade-off between compacity and readability is not easy to find.

To choose between left and right you can now have:

@startmindmap
* count
** 100
*** 101
*** 102
** 200

left side

** A
*** AA
*** AB
** B
@endmindmap

Note that you can also use right side to update the right side. Actually any sentence containing left/right will do the job. In the final version, we'd like to have a unique sentence. But we are out of inspiration here so your ideas are welcome :-)

mlopezgva commented 5 years ago

You can "borrow" the activity syntax here, just to make it feel like part of the PlantUML syntax family. :smile:

@startmindmap

* count
** Init
*** More
*** even more

split left
** Another
*** Branch
*** Here

split right[ again]
** Second thoughts
*** Keep dreaming

split left[again]
**** Time to end daydreaming
**** And start minding

@endmindmap

Comments: using split doesn't mean sub-levels are granted, it would be mostly used to set up branch (or box) direction.

pinage404 commented 5 years ago

The trade-off between compacity and readability is not easy to find.

I will always prefer readability to compacity.

Currently, octets are cheaper than my salary, so the time I spend reading and understanding the code is more expensive than the cost of using more octets.

So I prefer, by far, the readability

TarasMazepa commented 4 years ago

Any chance to get ability to mark some mind map items with colors? So result will look like this? Screen Shot 2019-06-10 at 5 08 33 PM

arnaudroques commented 4 years ago

The most difficult part is to find a nice syntax. Any suggestion ? Thanks!

1kakarot commented 4 years ago

How about org-mode syntax but using a positioning (left or right) indicator at the end of line?

@startmindmap "OrgMode"
* Linux
** NixOS -R
** Debian -L
*** Ubuntu
@endmindmap

Perhaps one could use a level indicator 1, 2, ..., n that would declare the order like this:

@startmindmap "OrgMode"
* Linux
** NixOS -R
** Debian -2L
** Ubuntu -1L
@endmindmap

in order to make "Ubuntu" show above "Debian" without manual rearrangement of the text.

TarasMazepa commented 4 years ago
@startmindmap

BackgroundColor<< RedType >> Red

* Pill
**[#blue] Blue part
**<< RedType >> Red part

@endmindmap

Either [#blue] or BackgroundColor<< RedType >> Red with << RedType >> will work for me. But I haven't done much plantuml stuff, so do not know if there is better options available in other diagrams. [#blue] will work on the spot and will do the trick but it would not be best choice as it will only apply to the background, but some people can think it could be applied to other parts (text color or link color or border color. BackgroundColor<< RedType >> Red with << RedType >> will allow to add support of styling other parts in the future, so this could be the ultimate option.

So from my POV having support for skinparam in mindmaps will be the best thing to do, as people more or less already familiar with it. And it provides quite flexible way of styling mindmaps

arnaudroques commented 4 years ago

Ok, so with last beta http://beta.plantuml.net/plantuml.jar you can now have :

@startmindmap

skinparam backgroundColor #EEEBDC
skinparam monochrome true
skinparam handwritten true
skinparam shadowing false
skinparam dpi 300

* root
** first
**[#AAA] second

@endmindmap

The support for skinparam is partial : there are no specific setting for MindMap for color, fonts... The idea of using << stereotype >> is good : we'll keep it for latter when skinparam will be fully supported.

Right now, we are out-of-inspiration for naming mindmap setting for skinparam, so your ideas are welcome :-)

cenggel commented 4 years ago

@arnaudroques

Ok, so with last beta http://beta.plantuml.net/plantuml.jar you can now have :

@startmindmap

skinparam backgroundColor #EEEBDC
skinparam monochrome true
skinparam handwritten true
skinparam shadowing false
skinparam dpi 300

* root
** first
**[#AAA] second

@endmindmap

The support for skinparam is partial : there are no specific setting for MindMap for color, fonts... The idea of using << stereotype >> is good : we'll keep it for latter when skinparam will be fully supported.

Right now, we are out-of-inspiration for naming mindmap setting for skinparam, so your ideas are welcome :-)

How to change the text color ?

pinage404 commented 4 years ago

Hi =)

sometimes i have node in wich i want to write a long text this results in really huge diagram

of course, i can explicit split with a \n new line

but it could be cool if PlantUML was able to split long lines, maybe with an option who specify the maximum width of a node

long lines

@startmindmap "long lines"
* Hi =)
    * sometimes i have node in wich i want to write a long text
        * this results in really huge diagram
            * of course, i can explicit split with a\nnew line
            * but it could be cool if PlantUML was able to split long lines, maybe with an option who specify the maximum width of a node
@endmindmap
arnaudroques commented 4 years ago

Good idea ! Independently of your request, there is an ongoing process to enhance PlantUML thought styles (see http://wiki.plantuml.net/site/style-evolution ) MindMap diagram have been selected as testing area for this new style evolution, so we have integrated your request there. So with last beta http://beta.plantuml.net/plantuml.jar you can have for example :

@startmindmap

style mindmapDiagram && node {
    Padding 12
    Margin 3
    HorizontalAlignment center
    LineColor blue
    LineThickness 3.0
    BackgroundColor gold
    RoundCorner 40
    WrapWidth 100
}

style mindmapDiagram && firstNode {
    LineStyle 8.0;3.0
    LineColor red
    BackgroundColor white
    LineThickness 1.0
    RoundCorner 0
    Shadowing 0.0
}

style mindmapDiagram && leafNode {
    LineColor gold
    RoundCorner 0
    Padding 3
}

style mindmapDiagram && arrow {
    LineStyle 4
    LineThickness 0.5
    LineColor green
}

* Hi =)
    * sometimes i have node in wich i want to write a long text
        * this results in really huge diagram
            * of course, i can explicit split with a\nnew line
            * but it could be cool if PlantUML was able to split long lines, maybe with an option who specify the maximum width of a node

@endmindmap

Is this what you were looking for ? You can also join the discussion here

pinage404 commented 4 years ago
style mindmapDiagram && node {
    WrapWidth 100
}

this is what was looking for ! =)


With this version, the link are default in red instead of blue in the previous version

lindoman commented 4 years ago

I know this might be diverting from the essence of mind mapping, but is there any way a "merge" might be able to be modelled? Here is a mockup of what I mean

image

Guessing the syntax might be acheved something like this, seeing you removed the support for ">" brackets, which look more like merges to me... ;)

@startmindmap
* 1
** 2.1
** 2.2
>* 3
@endmindmap
pinage404 commented 4 years ago

It could be interesting (but not a real mindmap anymore)

What should be the behavior / render for this :

Multiple merged "leaves"

@startmindmap
* 1
** 2.1
** 2.2
** 2.3
** 2.4
>* 3
@endmindmap

Leaf in another level of the merge

@startmindmap
* 1
** 2.1
** 2.2
*** 2.2.1
>* 3
@endmindmap

Branches merge ?

@startmindmap
* 1
** 2.1
*** 2.1.1
** 2.2
*** 2.2.1
>* 3
@endmindmap

Leaves merge ? (there is two * in the last line)

@startmindmap
* 1
** 2.1
*** 2.1.1
** 2.2
*** 2.2.1
>** 3
@endmindmap
lindoman commented 4 years ago
@startmindmap
* 1
** 2.1
** 2.2
** 2.3
** 2.4
>* 3
@endmindmap

Your first example above is the only one that I think would work...

image

Otherwise, the merges become impossible to render.

I am suggesting that the same "rules" already in position for travelling "outward" to form new branches simply work in reverse - so the only way I can see it working is if a merge flows back to only one "node" (if that is the correct term), and that it is to the level immediately "below" the current level.

Therefore, all the other examples you gave would break this "tree in reverse" rule. The breaking of the "tree in reverse" rule would render the same problem as this, which you already account for:

@startmindmap
* 1
** 2.1
** 2.2
**** 4
@endmindmap

which yields the error image

As an alternative to your second example, a similar rendition, which does not break the rules, would be like this:

@startmindmap
* 1
** 2.1
** 2.2
>*3
** 2.2.1
@endmindmap

image