elk icon indicating copy to clipboard operation
elk copied to clipboard

Default values in JSON as in elkt

Open Eddykasp opened this issue 9 months ago • 1 comments

The elkt format uses default values for things such as node widths and heights to make writing the format easy but still providing a sensible layout result. In the JSON format no such defaults are assumed (except for layout options, which use the defined defaults) and everything has to be precisely specified.

When using the format converter on elk-live this can lead to confusion such as here.

Moving forward there are three options for how to deal with this:

  1. keep everything as it is to maintain compatibility and the conversions consistent
  2. add the same defaults to the JSON format as to the elkt format potentially breaking old JSON graphs
  3. add the elkt defaults to the JSON during conversion. This would result in the translation back and forth being inconsistent though

Eddykasp avatar Mar 19 '25 13:03 Eddykasp

How about option 2, but also expose the default size to the user in a setting called defaultLeafSize or something like that.

Then anyone who was broken by this change could be instructed to simply set defaultLeafSize=0x0 in order to recover the old behavior.

If necessary, there could be separate settings, json.defaultLeafSize and elkt.defaultLeafSize.

skieffer avatar Mar 21 '25 10:03 skieffer