Add new %encode() function

0 votes
asked Jun 17, 2021 in Wanted features by kirchsth (2,270 points)

If I want to add an (dynamic defined) arrow style to the legend then I need a correct encoded url like in https://forum.plantuml.net/11603/how-to-add-arrows-to-a-legend-or-a-table.

@startuml
left to right direction
[B]-[dotted]-> [D]

legend
   | ""-[dotted]->"" | <img:http://www.plantuml.com/plantuml/png/LSsn3i8m30JGFLzXiJFa1r3_0p5SQmCLYOri8twVPAEwwTuDjqJ2yzDRYTUkRpWwnHDitrqVT4SB-LisEA_cBBvPCoSrbJAHJYC8GZtKjHPKEb_PCeLlbmcBA8-_7m00> | blah3 |
endlegend
@enduml

and "LSsn3i8m30JGFLzXiJFa1r3_0p5SQmCLYOri8twVPAEwwTuDjqJ2yzDRYTUkRpWwnHDitrqVT4SB-LisEA_cBBvPCoSrbJAHJYC8GZtKjHPKEb_PCeLlbmcBA8-_7m00" itself is an encoded plantuml source

@startuml
skinparam shadowing false
skinparam cardbordercolor none
card " " as a1
card " " as b1
a1 -[dotted]> b1
@enduml

 The new function %encode("skinparam shadowing false\nskinparam cardbordercolor none\ncard "" "" as a1\n ....")  should calculate the corresponding counterpart of the source "LSsn3i8m30....mcBA8-_7m00".
(I think "@startuml and @enduml" should be obsolete or optional; \n defines a linebreak, " escaped with "" or some other logic term)

And with that the legend could be defined like

legend
   | ""-[dotted]->"" | <img:http://www.plantuml.com/plantuml/png/%encode("........")> | blah3 |
endlegend

Thank you and best regards
Helmut

commented Jun 17, 2021 by The-Lu (37,800 points)

Hello K, and PlantUML team,

Another wanted feature will be just to allow sub-diagram ('{{''}}') on table.
Especially to be more generic and also manage vectorial SVG output...
But I do not know with which syntax?

With not another builtin functions: %subdiagram()?

legend
   | ""-[dotted]->"" | %subdiagram("...")> | blah3 |
endlegend
legend
   | ""-[dotted]->"" | %subdiagram("a1 -[dotted]> b1")> | blah3 |
endlegend

That is only a proposal... to discuss.

Regards,
Th.

commented Jun 17, 2021 by kirchsth (2,270 points)

Yes, %subdiagram() could be the better solution. But I wouldn’t limit it to tables.
If this is supported then it should reuse "outer definitions". E.g. if variables or skinparams are defined then it should be possible to reuse them in the sub diagrams (e.g. legends) too.

@startuml
skinparam arrowColor<<backup>> darkgray;text:darkgray;line.dashed

[api] -RIGHT->> [archive] <<backup>> : **Writes**\n//<size:12>[messages]</size>//

legend

| %subdiagram("[from] -RIGHT->> [to] <<backup>>")> | blah3 |
endlegend

@enduml

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...