Comments (13)
Tools like "xpan" and "ypan" and "xwheel_zoom" and "ywheel_zoom" have been added to constrain panning and zooming to a single axis.
from bokeh.
@paddymul we had talked about this.. is it implemented, or can you give Julia some pointers?
from bokeh.
it's not implemented, do you think we should do it on the mousewheel zoom, or make this a Box zoom thing? most of the implementation would need to be in the bokehjs repo, under tools.coffee, so you can have a look there, then we would also have to modify the python to output the necessary json
from bokeh.
@jvns ignore my last comment, I was confused.
To implement single-axis scrolling you are going to need to modify https://github.com/ContinuumIO/Bokeh/blob/master/subtree/bokehjs/static/coffee/tools.coffee
As the simplest thing possible, I would implement a class that is a peer to PanToolView that only works on a single axis. Maybe name it XPanToolView , you will need to create the related models also. That should show you how the PanTool works. That will also be enough if you want plots to always only be pannable on a single axis.
I think in the end we are going to want a "panned_axis" attribute on the PanTool model, the PanToolView should check the axis flag of its model and pan appropriately. Maybe it would be easier for you to implement it that way?
from bokeh.
I think constraining pan to a single axis should be an attribute on the PanTool, since its unconstrained behavior is just a superposition (or simple composition) of panning on each axis independently. Making a separate PanTool that only works in X or Y will probably lead to needless code duplication.
For box vs. range zoom (and selection), I think it's more of a toss-up. Creating separate RangeZoom/RangeSelect and BoxZoom/BoxSelect makes sense in that case, since rendering behavior is somewhat different.
Hugo, we need to have constrained mousewheel zoom as well.
from bokeh.
@pzwang, you mean X only or Y only mousewheel zoom? if so, then that would probably be the easiest place for @jvns to get started, add a property to the zoom tool model, which dictates which dimensions it's zooming in, modify the view to respect that, and modify the python api to pass that parameter in
at the moment, zoom/select tools don't have any rendering on it's own. the zoom sets the datarange, and then the plot renders on it's own. the select tool doesn't actually render anything visually, the scatter renderer knows how to render selected data, and there is a box select overlay that renders the rectangular selection region.
should we move the the box select overlay and put that functionality into the tool? I can't think of any scenarios where you would not want to display the box on box select tools.
from bokeh.
When I have done this in the past I decoupled it this way:
I had a generic box selection tool that drew a box selection area (options for corner or center control points, axis fixing, aspect preserving or not, etc). This tool reported the selections to a call back it was configured with so that it could be resused for zooming or selection or whatever. Ultimately, selections went to a selection manager, that performed selection/hit testing against the renderers. The renderers were separately configured with a policy on what to do with (un)selected data (enlarge the glyph, desaturate unselected points, cover the glyph with a transparent outline, whatever) For zooming the call back just adjusted the plot out bounds accordingly.
from bokeh.
Thought I'd chime in, though I'm new to this project. Very promising. As for this topic, I have implemented independent x- and y-axis zoom in my D3 graphs by adding a "zoom" box over the axes themselves. That way zoom would be x AND y for inside the graph region and x OR y if the mouse was over the individual axes. I really liked this and others did too.
from bokeh.
Oh, that's an interesting idea... Do you have a demo of what the overlay looks like, maybe in a jsfiddle or hosted somewhere? If we're going to show any kind of visual indicator over the axes during an interaction, I'd like to make sure it's minimally intrusive.
from bokeh.
Just made a jsfiddle example at
Unfortunately I do not currently have access to the code base where I have a nice cleaned up version of the javascript code, this is based off some older code.
from bokeh.
Ah with a scroll zoom. That does seem very nice! Can you add an issue for an enhancement to the Bokeh GitHub repo, including this jsfiddle in the ticket? I think this would be a nice (configurable) addition. However, just to note the upcoming 0.4 release in January already has much work to put in, so this would probably happen after 0.4.
Thanks,
Bryan
On Dec 3, 2013, at 10:53 AM, jgbos [email protected] wrote:
Just made a jsfiddle example at
Unfortunately I do not currently have access to the code base where I have a nice cleaned up version of the javascript code, this is based off some older code.
—
Reply to this email directly or view it on GitHub.
from bokeh.
Here is the jsfiddle: http://jsfiddle.net/6RQpP/6/
from bokeh.
Awesome! Looking forward to playing with it.
On Wednesday, April 9, 2014, Bryan Van de Ven [email protected]
wrote:
Reply to this email directly or view it on GitHubhttps://github.com//issues/17
.
from bokeh.
Related Issues (20)
- [BUG] Documentation Missing space character in the command to enable jupyter server extension in jupyterLab docs.
- Problems initializing Models using BokehJS without Python HOT 3
- Typo in the documentation related to writing tests in the Contribute section HOT 2
- App README links are all old / bad
- [BUG] Documentation: TypeScript in Custom Extensions section fails to compile HOT 4
- VBox is not working in 3.4.0rc1 HOT 14
- [FEATURE] Tab labels are fitted to the width of the page
- [FEATURE] Coloring of active tabs HOT 1
- [BUG] Button does not updated when property is changed
- `Tooltip` node positioning is wrong when the target is offset
- [BUG] Figures break inside Scrollbox if using frame_height or followed by div using stretch_width HOT 1
- `webgl` backend doesn't support non-visual overrides
- [BUG] Visualization of large(r) dataset fails to load even if amount of data being rendered remains the same HOT 12
- Missing release notes
- [BUG] Dropdown doesnt update properly when .menu changed in 3.4
- [BUG] TimePicker widget not displaying correct time as set by `value` HOT 2
- [FEATURE] More documentation for (bundling) custom extensions HOT 2
- GMap example not showing glyphs HOT 1
- Remove twitter icon link from docs and other properties HOT 2
- Add support toggleable `CustomAction` tool buttons HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bokeh.