-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "Cannot read properties of undefined (reading '0')" when trying to link selections between a probability density histogram and a scatterplot #9390
Comments
If it helps, the stacktrace in React:
Per the debugger, this comes from the following anonymous function, which I assume is
Let me know if a separate issue in |
Here's a slightly simpler version where the issue still occurs; I've removed the calculation to rename "value" to the name of the field in the density plot. I wanted the signal to include the name of the field being brushed over because my application listens to signals & saves brush values externally, but this issues still occurs without the calculation. I've also noticed that removing the |
Bug Description
I've been attempting to create a visualization in
react-vega
that links a histogram to a scatterplot with an interval selection brush and accepts default values for the brush. I've noticed that, when a default value is provided to the scatterplot, the histogram generates an errorCannot read properties of undefined (reading '0')
(no error is generated for two linked scatterplots). In react, this manifests as no lines rendering in the histogram. In the vega editor, the histogram instead does not update when the selection is cleared (the pink line should only appear when a selection is active): Open the Chart in the Vega Editor. This vega chart appears perfectly correct when you load it but clicking the scatterplot once immediately creates the bug.You'll note that, when dragging a new selection, the histogram bugs out with tons of errors:
Cannot read properties of undefined (reading 'marktype')
. This appears to be caused byencoding.color
on the histogram. Before entirely narrowing down this minimal example, I produced this error on this chart without themarktype
error. The only difference isencoding.color
on the histogram, which is set to an object related to my dataset that shouldn't work as well in the vega editor, but somehow works better. In this example, no selection line is displayed on the second histogram due to the color being incorrect, but it does produce the titular error message with no additional errors. I'm not sure whether this difference in behavior between the two is a second bug that deserves its own issue.Checklist
The text was updated successfully, but these errors were encountered: