-
Notifications
You must be signed in to change notification settings - Fork 525
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
Data accessors not evaluated independently #451
Data accessors not evaluated independently #451
Comments
@Zerim Thanks for this issue. I've been thinking for a while that Victory should use a more careful internal namespace for the x and y values it actually plots. Something like |
@boygirl No problem, glad it was helpful. Maybe you could prefix whatever the new variables names are with underscores, to add an extra level of clarity that these are for internal use. |
I came across this issue while attempting to reverse the axis for the chart shown here.
The VictoryBar can have it's axis reversed by setting the VictoryGroup
horizontal
prop to true. The VictoryVoronoi, however, needs to manually modified by switching it's x and y accessors.As you can see from opening up the console on this fiddle, the x accessor is actually mutating the input to the y accessor. The behavior is quite confusing upon first encounter.
The workaround, as shown here, is to create an intermediate value in the data set, using a key that does not have special meaning such as 'x' or 'y'.
I imagine this was done for performance reasons. At the very least it seems worth documenting, as I'm sure others may get tripped up on this as well.
Thanks for the great library!
The text was updated successfully, but these errors were encountered: