Is there a way to style JSON and/or YAML input (i.e. startjson, startyaml)?

0 votes
asked Feb 14, 2021 in Question / help by Brett
The JSON/YAML feature is great, but I was wondering if there was a way to use skinparam or new styling to style the output from JSON/YAML? For example, if I wanted a different border color or thickness.

Thanks!

2 Answers

0 votes
answered Feb 14, 2021 by plantuml (295,000 points)
Thanks for the suggestion.

It's not possible yet, but we might add style to change the output from JSON/YAML. This would mean that there will be some <style> tag after @startjson / @startyaml.

Is this what you are looking for ?
commented Feb 15, 2021 by anonymous
Yep, exactly. Ideally for font, border, and background, but I would be happy with just border for now :)

Thanks!
commented Feb 15, 2021 by Martin (8,360 points)
HorizontalAlignment is another popular style request for JSON/YAML.
Do you see a need to control style of name/key text separately from value text?
0 votes
answered Feb 16, 2021 by plantuml (295,000 points)
commented Feb 16, 2021 by anonymous
Awesome, that looks great...thank you!
commented Feb 16, 2021 by The-Lu (64,340 points)

Hello PlantUML team,

yes, always more...

Sorry to adding more wanted feature...

  • Is it plan to manage local style (as on mindmap)?
MindmapYAML/JSON...
Code
@startmindmap
<style>
root {
  Margin 3
}
mindmapDiagram {
  node {
    BackGroundColor lightblue
    LineColor navy
    separator {
        LineColor navy
    }
  }
}
</style>
* //root//
** 0
*** name: Mark McGwire
***  hr:   65
*** avg:  0.278
<style>
mindmapDiagram {
  node {
    BackGroundColor pink
    LineColor red
    separator {
        LineColor red
    }
  }
}
</style>
** 1
*** name: Sammy Sosa
*** hr:   63
*** avg:  0.288
@endmindmap
@startyaml
<style>
yamlDiagram {
  node {
    BackGroundColor lightblue
    LineColor navy
    separator {
        LineColor navy
    }
  }
}
</style>
  -
    name: Mark McGwire
    hr:   65
    avg:  0.278
<style>
yamlDiagram {
  node {
    BackGroundColor pink
    LineColor red
    separator {
        LineColor red
    }
  }
}
</style>
  -
    name: Sammy Sosa
    hr:   63
    avg:  0.288
@endyaml
Output

See my remark/request/wanted feature:

Thanks for the enhancements,
Regards,
Th.

commented Feb 16, 2021 by Martin (8,360 points)
Nice work.
Note: Because the defaults for JSON/YAML have been changed, the plantuml.com pages will need to be refreshed so the examples look correct.
commented Feb 16, 2021 by plantuml (295,000 points)

Is it plan to manage local style (as on mindmap)?

Unfortunately, it's really difficult to implement local style for Json/Yaml. So we do not plan to support it. Sorry about that !

commented Mar 14, 2021 by eddieg (100 points)
edited Mar 14, 2021 by eddieg
...