[Style] Allow [all] style for JSON object

0 votes
asked Oct 1, 2022 in Wanted features by The-Lu (65,240 points)

Hello PlantUML team,

Plus il y en a,
Plus on en demande...
wink
[untranslatable]

  • Could you allow style for JSON object?

Especially 'MaximumWidth' and 'MinimumWidth'  (for map also!) to fix:

Here are an examples:

@startuml
<style>
json {
  MaximumWidth 200
  MinimumWidth 100
  BackGroundColor aliceblue
  LineColor blue
  LineThickness 2.0
  FontColor blue
  FontSize 15
  FontStyle italic
  Margin 50
  Padding 100
}
map {
  MaximumWidth 200
  MinimumWidth 100
  BackGroundColor pink
  LineColor green
  LineThickness 1.0
  FontColor red
  FontSize 11
  FontStyle bold
  Margin 50
  Padding 100
}
</style>

json JSON {
  "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
  "name": "component c1",
  "color": ["normal", "green", "red"],
  "visible": true,
  "user" : { "age": 23, "name": "John", "array": [1, 2, 3]}
}

map CapitalCity {
 UK => London
 USA => Washington
 Germany => Berlin
 Placeholder Text => Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
}
@enduml


Thanks a lot for the new improvement...
wink
Regards,
Th.

1 Answer

0 votes
answered Oct 6, 2022 by plantuml (295,000 points)
selected Jan 11, 2023 by The-Lu
 
Best answer
Thanks for the report! This is somehow fixed in last snapshot and last online version.

Please tell us if you find other issues!
commented Oct 9, 2022 by The-Lu (65,240 points)

Hello PlantUML team, 

This is somehow fixed in last snapshot and last online version.

Does You confirm that is not fully fixed?

That seems OK for  'MaximumWidth' and 'MinimumWidth', but not for the rest...

Then:

  •  Could you allow all style for JSON object?
  •  or is it still necessary to use map style instead?

Here is an example:

@startuml
<style>
json {
  BackGroundColor aliceblue
  LineColor blue
  LineThickness 2.0
  FontColor blue
  FontSize 15
  FontStyle italic
  Margin 50
  Padding 100
}
</style>

json JSON {
  "text": "Lorem ipsum dolor sit amet, ...",
  "name": "component c1",
  "color": ["normal", "green", "red"],
  "visible": true,
  "user" : { "age": 23, "name": "John", "array": [1, 2, 3]},
  "version": "<b>%version()"
}
@enduml

Regards.

commented Oct 9, 2022 by The-Lu (65,240 points)
edited Jan 11, 2023 by The-Lu

Hello PlantUML,

  • Could you also manage `MinimumWidth`?

Here is an example:

@startuml
<style>
json {
  MaximumWidth 200
  MinimumWidth 200
}
</style>
json JSON {
  "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
}
json JSON1 {
  "text": "a min. test"
}
@enduml

Regards.

commented Jan 11, 2023 by The-Lu (65,240 points)

All are fixed with last version v1.2023.0.

Thanks to PlantUML team. yes

...