Remove dataset iteration for PlotLegendRow #539
Unanswered
defunctzombie
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
PlotLegendRow iterates the dataset to find the "current value" for each series.
https://github.com/foxglove/studio/blob/main/packages/studio-base/src/panels/Plot/PlotLegendRow.tsx#L138
This is an expensive operation for large datasets since it happens on every tick. Rather than iterating the dataset, we should provide the current value to the PlotLegendRow from its parent container where we are receiving the value as the data source plays.
For hover values, we should leverage the existing logic that powers the hover tooltip display (which already figures out the value) and also pass that to the PlotLegendRow. The PlotLegendRow should avoid doings its own dataset iteration.
Beta Was this translation helpful? Give feedback.
All reactions