This PR simplifies and improves the logic in createGraphPath and furthermore fixes some small bugs, where the graph might be empty or (almost)flat lines are kinda "wobbly".
Graphs with very few data points
Graphs with very few data points look way smoother now. Before, it might have occurred that lines weren't flat when they should be and vice versa weren't cubic but instead cut-off.
Graphs with range applied
It is now possible to also draw graphs, where the range is smaller then the provided dataset. This could be useful, e.g. if you have data for each day of one year and you only want to show a month without having to reformat data.
There's not a lot that changed for the eye, but behind the back logic around the range prop has improved a lot too.
⚠️ Warning ⚠️
The smoothing prop on the LineGraph component got removed. With the new createGraphPath logic, it is not necessary to change the smoothing manually. This will not break anything, but you can safely remove it from your codebase.
This PR simplifies and improves the logic in
createGraphPath
and furthermore fixes some small bugs, where the graph might be empty or (almost)flat lines are kinda "wobbly".Graphs with very few data points
Graphs with very few data points look way smoother now. Before, it might have occurred that lines weren't flat when they should be and vice versa weren't cubic but instead cut-off.
Graphs with range applied
It is now possible to also draw graphs, where the range is smaller then the provided dataset. This could be useful, e.g. if you have data for each day of one year and you only want to show a month without having to reformat data.
There's not a lot that changed for the eye, but behind the back logic around the
range
prop has improved a lot too.⚠️ Warning ⚠️
The
smoothing
prop on theLineGraph
component got removed. With the newcreateGraphPath
logic, it is not necessary to change the smoothing manually. This will not break anything, but you can safely remove it from your codebase.