Skip to content
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

Calculate unique values for ordinal scales #90

Merged
merged 9 commits into from Jul 10, 2022
Merged

Calculate unique values for ordinal scales #90

merged 9 commits into from Jul 10, 2022

Conversation

mhkeller
Copy link
Owner

@mhkeller mhkeller commented Jul 9, 2022

Solves #27

@mhkeller
Copy link
Owner Author

mhkeller commented Jul 9, 2022

The only weird thing in this is I modified the flatten function to pass string keys on arrays onto the child object. This could cause issues such as key globbering or other object distortions and I may not include it. The reasoning for this for the moment is there is no other way to detect series names when using a wide data structure in stack layouts. This way, it copies the key field from the stack group array onto each child array, which is what is passed to the calcUniques function with flatData as the argument.

@mhkeller
Copy link
Owner Author

I got rid of the weird stuff in flatten. In all of those stacked examples, you compute the domain list manually anyway so there's no extra work except setting it as a prop. if the user wanted to, they could loop through the stacked data and add their own value on the z key

@mhkeller mhkeller merged commit ceafda7 into main Jul 10, 2022
@mhkeller mhkeller deleted the unique-calc branch November 21, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant