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/Alluvial - Incorrect node precision etc. #134

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 or Alluvial chart from the sample data
  2. Turn on Show node values option.

Project file Energy Flows in UK

Additional context When turning on "Node Values", the node labels and values are displayed. However:

  1. Main issue: the precision is about a trillion times too high on a random assortment of the values. Every stage of the diagram has at least one label generated incorrected. For those who can't use a decent SVG editor, the diagram cannot be used as generated. Even if you can, you'll have to re-edit everything every time you need to update the chart.

The precision should be rounded from the float to no more decimal places than the data. Nice to have: manual setting to over-ride of the number of decimal places, if the automatic value is not desired.

For example, Thermal Generation has 3 inputs summing to 1 185.610 000 000 000 1 instead of the correct value of 1 185.61

image

  1. Very minor, but the node label and the node value appear to be directly concatenated. I found a workaround of adding a blank at the end of all the input labels, resulting in the value being listed under the node. However, that may not be an option/user not realize it is an option. There should be some kind of separator, such as a space, colon, pipe, equals, resulting in the value being on the same or optionally, on the next line. Nice to have would be choosing the separator. Via a small text input box perhaps.

image

  1. Another nice to have - culture formatting of the digits option.

  2. Another nice to have - choice of the label on the left or right of the node.

mikima commented 1 year ago

This is a common issue in all the charts. Seems to be related to a know js issue, should be solved in rawgraphs-core. @bianchimro do you have ideas?

mikima commented 1 year ago

duplicate of #19