Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

json content tooltip on sequence diagram

0 votes

Hi,

I'd like to show a json content tooltip (including braces "{" and "}")  on the sequence diagram. It looks like [[http://www.yahoo.com {{"firstName":"Bob", "lastName":"Smith"}} add a tooltip]] does not work.

Any thought?

Thanks,

Hong

asked Oct 30, 2015 by anonymous

1 Answer

0 votes
This has been fixed in V8032.

You can now have:

@startuml
Alice -> Bob : [[http://www.yahoo.com{Jason: {"firstName":"Bob", "lastName":"Smith"}}]] hello
@enduml

Is this what you are looking for ?
answered Nov 1, 2015 by plantuml (122,630 points)
It works with version 3082 now. Thanks a lot.
It looks like the following json tooltip is not working with the latest version 8032. The json content has multiple layers which means it has multiple "{}" in its contents.
@startuml
Alice -> Bob : [[http://www.yahoo.com{{"Jason": {"firstName":"Bob", "lastName":"Smith"},\n "Carl": {"firstName":"Alice", "lastName":"Brown"}}}]] Hello
@enduml


Thanks
PlantUML uses regular expression to parse text diagrams, and it's difficult/impossible to completely support balanced parenthesis/bracket with regular expressions.
(except with some extensions that are not available in Java).
See:
http://stackoverflow.com/questions/133601/can-regular-expressions-be-used-to-match-nested-patterns
http://stackoverflow.com/questions/14952113/how-can-i-match-nested-brackets-using-regex

However, the good news is that is possible to support brackets with a *finite* limit of nested brackets.

With the last beta, we set the imbrication limit to 3, hoping that it will be ok:

https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Tell us if it's enough for you.

Thanks
Thanks a lot for your quick reply!
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...