Charts parameter change when react component are updated
AlasDiablo opened this issue · 0 comments
Hello, i encounter a problem with the update of the chart with react.
When i change some parameter dynamically i have some parameter set back to default.
For my part i have debug my code and i have found this
- When parameter update the react props are valid (all parameter are set to the right values)
- When parameter update my Vega-lite builder output the right charts
- But when the react display are updated some parameter are change to the default value, from my default model.
Project specification:
I work on Lodex an open source project from the CNRS-inist and my mission is to convert old charts make with Recharts to Vega-lite and Vega.
My code structure at my level is:
-
Models: JSON with my default charts write in Vega lite
-
Builder: Update the models with new parameter (color, order by, and more.)
-
View (React component): Call the Builder (with react props contenting the models parameter) and create the display charts
-
dependencies:
- react: 16.12.0
- react-vega: 7.3.0
- redux: 3.7.2
- react-redux: 5.1.1
- vega: 5.13.0
- vega-lite: 4.13.1
I give the most important dependencies because my project have more that 140 dependencies...
Example (change order by from -x to x) :