You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Again thank you for a fantastic performant graph package.
I'm using uPlot with the uPlot react wrapper (skalinichev/uplot-wrappers#32)
I have a need for adding/deleting series to a graph dynamically, and in real time adding data to one of the series, and I'm wondering what the best approach would be.
I can update the data and option props on the component which seems to re-render the graph, but it also resets things like graph selection in the legend, and often i get uPlot errors "cannot read .. of undefined" which seems to be related to axis generation, see this issue . The wrapped uPlot may be very sensitive to what is added first; series og data, or maybe these errors is related to some other problem down the pipe.
I'm looking at the sample "stream-data.html". Here the series are predefined in options, and data added using u.setData. I need to avoid complete recreation of the chart so I guess this is the only option compared to updating a React data state used as property to the chart!
And same with series, here I need to call add/del series methods, and I really miss an updateSeries method or a way to connect series with data by "key" instead of indexed which makes managing a dynamic array of series/data really a pain. Or is there a better approach to these requirements?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I added a new issues related to the exceptions I have seen. So this "issue" is now more a question about "best practice".
FYI: I struggled hard to get a implementation in place using the API methods, but it got really messy because of the indexing management, and lack of a way to update/delete by a key which can be mapped to React state values.
So I gave up on this mode, and went back to using props.
Hi
Again thank you for a fantastic performant graph package.
I'm using uPlot with the uPlot react wrapper (skalinichev/uplot-wrappers#32)
I have a need for adding/deleting series to a graph dynamically, and in real time adding data to one of the series, and I'm wondering what the best approach would be.
I can update the data and option props on the component which seems to re-render the graph, but it also resets things like graph selection in the legend, and often i get uPlot errors "cannot read .. of undefined" which seems to be related to axis generation, see this issue . The wrapped uPlot may be very sensitive to what is added first; series og data, or maybe these errors is related to some other problem down the pipe.
I'm looking at the sample "stream-data.html". Here the series are predefined in options, and data added using u.setData. I need to avoid complete recreation of the chart so I guess this is the only option compared to updating a React data state used as property to the chart!
And same with series, here I need to call add/del series methods, and I really miss an updateSeries method or a way to connect series with data by "key" instead of indexed which makes managing a dynamic array of series/data really a pain. Or is there a better approach to these requirements?
Thanks in advance.
The text was updated successfully, but these errors were encountered: