rawgraphs / rawgraphs-charts

A curated selection of charts provided through RAWGraphs interface
https://rawgraphs.io/
Apache License 2.0
92 stars 43 forks source link

Sankey - uneven node spacing #130

Closed dgebel closed 1 year ago

dgebel commented 1 year ago

In which chart does the bug happen?

RAWGraphs Version 2.0 - the current web version

Web browser and version Edge 112.0.1722.34 Chrome 112.0.5615.138

Operating System Windows 10 Enterprise

Steps to reproduce this

  1. Generate a Sankey chart from the sample data
  2. Turn on Show node values option (optional)
  3. Increase height and/or padding to make labels more readable

Project file Energy Flows in UK

Additional context The default spacing of the input nodes is uneven. There is a lot of unnecessary and unsightly vertical space between some input nodes and not enough between others (it seems worse depending on the line value).

Increasing the chart height and adding padding changes the vertical spacing so it's more readable (especially with thin lines and large labels), but the spacing results can get very weird and random looking.

image

image

image

mikima commented 1 year ago

Thanks. Sankey diagram auto-layout is always problematic, since the positions are defined iteratively. The padding if i remember well is the minimum value, not a fixed one. Probably we should explicit it in the dimension name ("minimum padding"). It doesn't solve the issue though, but at the moment I don't see any simple solution that doesn't require manual editing of the nodes