Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Fast horizontal scrolling #384

Closed
GluedToTheScreen opened this issue Oct 15, 2014 · 11 comments
Closed

Fast horizontal scrolling #384

GluedToTheScreen opened this issue Oct 15, 2014 · 11 comments

Comments

@GluedToTheScreen
Copy link

Maybe I missed an option, but the old chap/links timeline had a nice feature where SHIFT-mousewheel scrolled the timeline horizontally... fast.

With vis, it seems you get zoom with or without the shift key +wheel

Is there a way to re-enable that functionality?

thanks again.

@josdejong
Copy link
Contributor

Thanks, good idea to add these kind of shortcut keys again. We too need a key+scroll combination to scroll vertically (see #152 (comment))

@GluedToTheScreen
Copy link
Author

I seem to be close but no joy...

In vis.js around 7935, I found the Range.prototype._onMouseWheel function and wrapped a hack around one line:

    if (event.shiftKey) {
        this.move(delta);
    }
    else {
        this.zoom(scale, pointerDate, delta);  //ORIGINAL LINE
    }

This SEEMS to move INVISIBLY move the timeline. No movement of elements is seen... no pan left/right.. BUT, when you do any little thing to manually move the timeline, the "moved" timeline and elements will instantly appear.

While the horizontal scroll seems to work under the surface, you cannot see it happen.

I tried this.redraw() but that didn't help.

Any suggestions?

thanks

@josdejong
Copy link
Contributor

I see the methods Range.move and Range.moveTo are not used in the library, maybe some leftover of an earlier version. Like with Range.zoom, these methods should call Range.setRange(start, end) in the end to actually apply the new start and end. This method Range.setRange validates the new start and end, and emits the rangechange and rangechanged events, which will trigger a redraw of the Timeline. Note that this rangechanged event should not be fired repeatedly when moving the Timeline, so that needs to be adressed too (see also #397)

@mdxs
Copy link
Contributor

mdxs commented Dec 3, 2014

+1 for improved navigation options for the end-user

I'm not sure about any "standards" for this, but [1] SHIFT+mousewheel could work for horizontol scrolling (like you would have with http://www.simile-widgets.org/timeline/ ... which actually always scrolls horizontally); [2] CTRL+mousewheel might not be correct to change... as it is the browser zoom in Chrome, IE, and FF; so it feels more natural to keep it as current, zooming like mousewheel does; or pass on to browser zooming [3] perhaps ALT+mousewheel for vertical scrolling (see #152 (comment))

At the moment, it seems that [1], [2], [3] are all intercepted in v3.7.1 when the user is on the timeline; they all map to zooming in and out. This is a good start ;-)

Outside of the timeline, [1] might bring the user back (or forward) in browser navigation; [2] appears to be a browser zoom across browsers; [3] might behave like [2] on Linux (using FF) but seems unused elsewhere.

Note however that I'm no expert...

@mdxs
Copy link
Contributor

mdxs commented Dec 3, 2014

Related to #283

@AlexDM0
Copy link
Contributor

AlexDM0 commented Jan 9, 2015

Hi,

Over the last year a lot of feature requests have been made. We have just introduced our new website which has a list of the requested features. We have placed this request on that list.

The list can be found here:
http://visjs.org/featureRequests.html

An explaination of the new system can be found here:
http://visjs.org/blog.html#New\ website\ for\ vis.js!

I would like to stress that this does not mean we abandon this request. Discussion here will continue if needed on this feature but we will close it to keep our Github issue page more of a bug-todo list.

Future feature requests will still be made here and then added to the website by us.

Regards,

Alex

@AlexDM0 AlexDM0 closed this as completed Jan 9, 2015
@mojoaxel mojoaxel changed the title fast horizontal scrolling Fast horizontal scrolling Oct 24, 2016
@mojoaxel
Copy link
Member

Reopening as Feature-Request issue (see #2114).
Everybody: Please feel free to implement this!

@mojoaxel mojoaxel reopened this Oct 24, 2016
@yotamberk
Copy link
Contributor

@mojoaxel I've implemented a verticalScroll option, so I think this can be closed. It doesn't have a ctrlKey but that's another feature. No?

@yotamberk yotamberk reopened this Oct 24, 2016
@mojoaxel
Copy link
Member

I've implemented a verticalScroll option, so I think this can be closed.

You are write! This is implemented!

@yotamberk
Copy link
Contributor

@mojoaxel I'm rereading this feature request and I think we can still improve what is in the develop branch. I should add horizontalScrollKey and verticalScrollKey and maybe scrollSpeed could be cool. Anyways, lots of additions can be added to this

@mojoaxel
Copy link
Member

I should add horizontalScrollKey and verticalScrollKey and maybe scrollSpeed could be cool. Anyways, lots of additions can be added to this

👍 Feel free to reopen and add additional functionality!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants