-
Notifications
You must be signed in to change notification settings - Fork 287
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
Add band/point invertExtent. #64
base: main
Are you sure you want to change the base?
Conversation
I’d like the documentation to be clearer. Given this representation of bands: Some questions: Is a band included if [r0, r1] has a non-empty intersection with the band, or does [r0, r1] have to completely cover the band? And are r0 and r1 both treated as inclusive bounds? Is a point scale treated as zero-width bands? If [r0, r1] falls within the padding between bands, does it return an empty array? It’d be helpful to have tests which explicitly state the expected outcome for these cases. |
|
was there any update on merging this or whether there would be |
@williaster If it is useful to you, we have an updated version of band/point scales included in the vega-scale repo. It includes an invert function in addition to modifications to improve layout consistency. We'd be happy to have those merged here if there is interest. |
I’ve implemented a demo of ordinal brushing here: https://observablehq.com/@d3/ordinal-brushing I used bisectRight as in this PR. One point of awkwardness is |
After a little more thought, I switched my demo to use a point scale. I think it makes sense for the point scale to consider something selected only if the point is inside the interval, while the band scale would consider something selected if the band intersects the interval, as implemented here. So, I’m down with this approach—I just need to think through the API a little more. |
Any update on this? It'll be really useful to have an invert function for band scales. |
Adds invertExtent method for band and point scales, which can be useful for brushing and linking over ordinal domains. Separated from earlier PR #60.