Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

retain x, y, attributes in data for user convenience #188

Merged
merged 1 commit into from Jan 14, 2017

Conversation

boygirl
Copy link
Contributor

@boygirl boygirl commented Jan 14, 2017

The formatted data now uses "_x" and "_y" to represent data for calculating values / positions etc. This PR adds "x" and "y" properties back, but in such a way that they will be overridden by "x" and "y" values if they exist in the data. This will cause fewer breaking changes for users working with data accessors, but also relying on functional props like size={(d) => d.y > 2}. So, formatted data will always have "x", "_x", "y", and "_y" where "_x" and "_y" are guaranteed to be in a format that Victory expects when working with x, y, data. "x" and "y" will be identical to "_x" and "_y" except in cases where "x" and "y" already exist in user data. In this case, user "x" and "y" will remain unchanged, allowing users to make assertions like size={(d) => d.x === "cats"} (_x will have been mapped to an integer corresponding to a string map)

@boygirl boygirl merged commit 5c7c3f1 into master Jan 14, 2017
@boygirl boygirl deleted the improvement/convenient-data-format branch January 14, 2017 22:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant