-
Notifications
You must be signed in to change notification settings - Fork 185
Add select transforms. #190
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
Conversation
b14f9a9
to
43d353f
Compare
I thought about naming these Plot.selectFirst, Plot.selectLast, Plot.selectMinX etc. Let me know if you prefer that additional verbosity. |
I guess Plot.selectFirst etc. might help discoverability. |
Okay, I adopted the longer names. |
f3d5635
to
3a3adb0
Compare
I’m feeling pretty good about this and will merge but let me know if you have any objections or suggestions! Thanks. |
It's working great, and I like the way it anticipates multiple values. To test this out and make it more extensible I've tried to export Plot.select. Then for example, I can select a few values to label a line chart:
the null and {} are unfortunate in this case (since I don't need any channel to work with), so maybe we could make the third argument optional. I could also detect n local maxima, etc., by adding my own functions. If we do export it, the function should probably be called differently, to avoid confusion with d3.select. Note that it's a filter (#138), in a somewhat raw form. A signature like |
Introduces new transforms for pulling out individual values from the data, while being z- and facet-aware.