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

Mapbox select doesn't update with scrollzoom #2343

Closed
jackparmer opened this issue Feb 7, 2018 · 3 comments
Closed

Mapbox select doesn't update with scrollzoom #2343

jackparmer opened this issue Feb 7, 2018 · 3 comments
Labels
bug something broken

Comments

@jackparmer
Copy link
Contributor

If you scrollzoom on a Mapbox map with a selection, the selection box (or lasso) does not update its size after zooming:

image

@jackparmer jackparmer added the bug something broken label Feb 7, 2018
@etpinard
Copy link
Contributor

etpinard commented Feb 7, 2018

Same goes for all subplot types.

Maybe we should just clear the selection region on scroll (not the selected points of course).

@etpinard
Copy link
Contributor

etpinard commented Feb 7, 2018

Ok this is actually a little different for cartesian subplots. My mistake.

Starting from https://codepen.io/etpinard/pen/xYRqOj?editors=0010 we get:

peek 2018-02-07 11-45

that is the select box does not clear on scroll zoom (just like on mapbox subplots) but does clear on scroll end. The cartesian behavior is little bit better but still not right.

I still think clearing the select box on scroll start for all subplot types would be the cleanest way to fix this bug. But thinking about #1851, we might have to come up with something more powerful. We can't just describe select box and lasso path in data coordinates (e.g. like data-ref annotations) because on non-cartesian subplot select box and lasso paths are allowed to extend pass the subplot's plot area e.g. for polar:

peek 2018-02-07 11-52

@alexcjohnson
Copy link
Collaborator

I still think clearing the select box on scroll start for all subplot types would be the cleanest way to fix this bug.

👍

But thinking about #1851, we might have to come up with something more powerful. We can't just describe select box and lasso path in data coordinates (e.g. like data-ref annotations) because on non-cartesian subplot select box and lasso paths are allowed to extend pass the subplot's plot area

As part of #1851 we could consider making the selection outline persist through scroll/zoom for cartesian subplots but I don't feel like that's a particularly valuable addition, and as you point out it won't work for other subplot types. Extending past the plot area is one issue, though in principle we could sort that out by using the natural extension of the data<->px mapping. But a bigger problem is that for some subplot types - polar and geo at least - a rectangle is no longer necessarily a rectangle after you zoom, straight lines are no longer straight. So even if you were able to properly transform the selection region into one with curved boundaries, we wouldn't be able to use the same UI to modify the region afterward.

etpinard added a commit that referenced this issue Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants