cartoframes icon indicating copy to clipboard operation
cartoframes copied to clipboard

Improve zoom and scroll user experience

Open makella opened this issue 5 years ago • 26 comments

Context

While working in a notebook, I'm noticing that the issue of scroll for page navigation vs. map zoom in/out, is an issue.

To do

To be defined

makella avatar Apr 30 '19 15:04 makella

Or will notebook savy ppl not encounter this?

makella avatar Apr 30 '19 15:04 makella

I think we should allow the user to activate / deactivate the zoom controls when creating the map, and decide the default behaviour (if we want it activated or deactivated by default)

elenatorro avatar Apr 30 '19 15:04 elenatorro

The interactions are the same as on a webpage, so people will find it kind of annoying, especially if it's posted as a webpage (which is common: https://nbviewer.jupyter.org/gist/andy-esch/eba5f8b645b1ae99467f478fdd44d2ac)

As interaction defaults, adding zoom controls (plus home!), and disabling scroll wheel zoom feels good to me. A common pattern for exposing extra options like these is as kwargs. matplotlib is the most common one to follow this pattern. It's a way to stuff in advanced or lesser known options without making the function signature huge.

andy-esch avatar Apr 30 '19 15:04 andy-esch

The interactions are the same as on a webpage, so people will find it kind of annoying

Yes, I am one of them :) and cool demo!

Totally in agreement with the options (also like the idea of "home").

Sounds like we all agree on: scroll disabled and zoom controls by default with the options to change. Is that right?

Since we are in the process of the map/legend/widget design, I can respond in the other ticket asking for zoom controls to be considered in the mocks as well.

makella avatar Apr 30 '19 16:04 makella

I'm starting to reconsider the scrollwheel zoom. One way it's great is that if you want to zoom to a fractional level to get a specific view of the data that integer zooms wouldn't be as good for. I also love how I have more control on the zooming and centering with the scrollwheel and I don't want to enable it every time I create a map. So.. I think I want it enabled by default now 😝

andy-esch avatar May 02 '19 18:05 andy-esch

In that case, we could leave the scrolling enabled by default and show the "Home" icon as soon as the map is scrolled (?). So if someone accidentally scrolls the map while navigating there is a short way back to the original position.

newLadyAga avatar May 03 '19 12:05 newLadyAga

@Lady-Aga I like that idea and think that makes a lot of sense. @andy-esch take your point, my preference is still no scroll wheel but if you think that will make the experience better, then ok :)

makella avatar May 03 '19 13:05 makella

I don’t like it either but think it’s the best experience. I really wish that if a user was really scrolling on a page then the map wouldn’t zoom.

On Fri, May 3, 2019 at 9:44 AM Mamata Akella [email protected] wrote:

@Lady-Aga https://github.com/Lady-Aga I like that idea and think that makes a lot of sense. @andy-esch https://github.com/andy-esch take your point, my preference is still no scroll wheel but if you think that will make the experience better, then ok :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CartoDB/cartoframes/issues/634#issuecomment-489100242, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH6FIHQHLBGLM5R76EDMXDPTQ6UJANCNFSM4HJMYQBQ .

-- Andy Eschbacher Data Scientist @MrEPhysics

CARTO Made in NYC, Madrid, and DC

andy-esch avatar May 03 '19 14:05 andy-esch

Hi. I have tested the scroll behavior and I think it is really nice as is.

  • If you start scrolling out of a map you enter in scroll mode although you pass over a map
  • If you stand for a while over the map, without scrolling, you enter in zoom mode inside the map
  • There is plenty of space around the notebook to scroll it (left or right)
  • The "home" button is the same as running the cell again. However, we can include it as an option.

Jesus89 avatar May 22 '19 08:05 Jesus89

IMO, I think we can close this issue, what do you think?

elenatorro avatar Aug 27 '19 13:08 elenatorro

Agree.

I have checked it with some data scientists and they all see it as a pain (I also hate it) but there is not an easy solution to detect whether the user wants to scroll the page or to zoom the map.

cmongut avatar Aug 27 '19 14:08 cmongut

Let's close it for now then, and we can reopen it once we have it clearer :)

elenatorro avatar Aug 27 '19 15:08 elenatorro

reopening this because there have been many people expressing that when maps are embedded in something like a blog post, that having the scroll wheel zoom enabled by default is not an ideal user experience...

now that we are interacting with the maps in other places (outside of the notebook), this is becoming more of an issue.

for example: https://carto.com/blog/retail-revenue-prediction-data-science/

Once you get "stuck" on a map it can get zoomed all the way out as you are attempting to scroll the page and finding your way back to the original extent of the map once that's done is nearly impossible.

can we revisit the idea of setting this as a true/false option? please :)

thanks!

makella avatar Sep 26 '19 16:09 makella

Thanks @makella for bringing this back! In addition, this is going to be needed to embed (as you mention) the notebook in the developer center (the examples section includes embedded notebooks)

I'd name this parameter scroll_zoom to be set false by default.

Do you think we should include + - zoom controls to the viz then?

elenatorro avatar Sep 27 '19 12:09 elenatorro

good idea! would the zoom controls be a true/false option too? i am thinking for things like the Layout, if zoom controls aren't wanted... but not sure if that is relevant!

makella avatar Sep 27 '19 13:09 makella

Yep! We can do the following:

If scroll_zoom=False, then zoom_controls=True and the other way round, if scroll_zoom=True, then zoom_controls=False. However, you could overwrite zoom_controls if, for example, you want to activate or deactivate both features. How does it sound? Too complex, maybe?

elenatorro avatar Sep 27 '19 14:09 elenatorro

totally! that's what i was thinking exactly... love it and don't think it is too complex!

makella avatar Sep 27 '19 15:09 makella

Thumbs up for scroll_zoom and other zoom control options!

andy-esch avatar Sep 27 '19 16:09 andy-esch

Nice! We already know this is a problem and this seems a more or less fast solution. The reason we didn't tackle this before was because users told us "I want to be able scroll the page without zooming the map but I don't want to lose the zooming experience when zooming". Thoughts?

cmongut avatar Sep 30 '19 08:09 cmongut

@cmongut so I'm guessing the user comment comes from the notebook? The problem is that how the scrolling can "stick" on the map outside of the notebook context where you lose the extent and can't scroll the page.

How many users was this? I've had 5 people at least tell me the opposite. Also, we are dealing with maps outside of the notebook context when published too so we have to think of both use cases. In a notebook you can select the cell a map is in and have control vs. on a webpage or in our documentation that isn't possible.

The user will not lose the zooming in/out experience, they will just have to set it to true or false. So all of the behaviour will remain, it is just a matter of turning it on or off.

makella avatar Sep 30 '19 13:09 makella

Yeap, I was just thinking about other solution to the zoom controls. Like clicking on one component to enable/disable zoom.

cmongut avatar Sep 30 '19 14:09 cmongut

so more of a button?

makella avatar Sep 30 '19 14:09 makella

i'm not sure if in the blog we can get focus on a map by selecting it... also not sure if that would work in our doc but i see not a button, similar to how it is in the notebook, is that right?

makella avatar Sep 30 '19 14:09 makella

Yesterday I was talking with @makella about this. My proposal was to see if it makes sense to implement something like this:

Captura de pantalla 2019-09-30 a las 19 14 26

I was trying to give the same zoom experience to users when they enable it. @makella told me that some maps use the gear icon to hide additional functionality. At the same time, she told me that what we have already implemented are the zoom controls so it seems the way to go :)

cmongut avatar Oct 01 '19 08:10 cmongut

  • Add option Map to disable mouse zoom (+ add zoom buttons)

Jesus89 avatar Dec 16 '19 10:12 Jesus89

this is great!!

since we've discussed in this ticket before, would there be an opportunity with this enhancement to also add some sort of home button/action to recenter the map to its original extent? after using CF more, it makes a lot of sense for both notebook and published maps (especially in the cases where scroll zoom is set to true)

having the option to disable zoom will make a huge difference so the likelihood of getting "lost" on a map will decrease, but that need to go back where you started requires that you either rerun a cell in the notebook and/or refresh the page on a published map.

i know we don't have a design for this right now, but maybe it doesn't have to be anything fancy and can be an addition to the zoom in/out controls (?)

makella avatar Dec 18 '19 03:12 makella