Wheel Zoom change center point

Hi,
I use WheelZoomTool to zoom on y-axis (dimensions=[“height”]).

The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?

Thank you for your time.

There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

···

On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, [email protected] wrote:

Hi,
I use WheelZoomTool to zoom on y-axis (dimensions=[“height”]).

The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?

Thank you for your time.

Thank you for your quick reply Bryan.
I am working on extending Bokeh as you suggested and I would like to ask you if there is a function which takes the coordinates of a point (values on axis) and returns the coordinates on the plot (such as the mouse coordinates)

Thanks,

Michalis

···

On Thursday, August 25, 2016 at 8:15:37 PM UTC+3, Bryan Van de ven wrote:

There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, [email protected] wrote:

Hi,
I use WheelZoomTool to zoom on y-axis (dimensions=[“height”]).

The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?

Thank you for your time.

Hi,

Yes, on the plot.frame there are mappers, and the mappers have "map_from_target" which take "view" coordinates and map them back to data space. Note that coordinated (by convention: vx, vy, etc) are y-flipped (i.e. they are pixel coordinates but start with (0,0) in the lower left).

Check out these few lines:

  https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23

Thanks,

Bryan

···

On Aug 26, 2016, at 10:13 AM, [email protected] wrote:

Thank you for your quick reply Bryan.
I am working on extending Bokeh as you suggested and I would like to ask you if there is a function which takes the coordinates of a point (values on axis) and returns the coordinates on the plot (such as the mouse coordinates)

Thanks,
Michalis

On Thursday, August 25, 2016 at 8:15:37 PM UTC+3, Bryan Van de ven wrote:
There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, psal...@gmail.com wrote:
Hi,
I use WheelZoomTool to zoom on y-axis (dimensions=["height"]).
The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?
Thank you for your time.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c563bfde-e475-41ae-bc14-59e3b4ca889e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

I have made it. Thanks again for your time and all your help!

Thanks,

Michalis

···

On Friday, August 26, 2016 at 6:27:31 PM UTC+3, Bryan Van de ven wrote:

Hi,

Yes, on the plot.frame there are mappers, and the mappers have “map_from_target” which take “view” coordinates and map them back to data space. Note that coordinated (by convention: vx, vy, etc) are y-flipped (i.e. they are pixel coordinates but start with (0,0) in the lower left).

Check out these few lines:

    [https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23](https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23)

Thanks,

Bryan

On Aug 26, 2016, at 10:13 AM, [email protected] wrote:

Thank you for your quick reply Bryan.

I am working on extending Bokeh as you suggested and I would like to ask you if there is a function which takes the coordinates of a point (values on axis) and returns the coordinates on the plot (such as the mouse coordinates)

Thanks,

Michalis

On Thursday, August 25, 2016 at 8:15:37 PM UTC+3, Bryan Van de ven wrote:

There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, [email protected] wrote:

Hi,

I use WheelZoomTool to zoom on y-axis (dimensions=[“height”]).

The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?

Thank you for your time.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c563bfde-e475-41ae-bc14-59e3b4ca889e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Michalis,

That's great to hear, is it possible fo ryou to share how you did it here so that others might benefit as well?

Thanks,

Bryan

···

On Aug 26, 2016, at 3:17 PM, [email protected] wrote:

Hi Bryan,

I have made it. Thanks again for your time and all your help!

Thanks,
Michalis

On Friday, August 26, 2016 at 6:27:31 PM UTC+3, Bryan Van de ven wrote:
Hi,

Yes, on the plot.frame there are mappers, and the mappers have "map_from_target" which take "view" coordinates and map them back to data space. Note that coordinated (by convention: vx, vy, etc) are y-flipped (i.e. they are pixel coordinates but start with (0,0) in the lower left).

Check out these few lines:

        https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23

Thanks,

Bryan

> On Aug 26, 2016, at 10:13 AM, psal...@gmail.com wrote:
>
> Thank you for your quick reply Bryan.
> I am working on extending Bokeh as you suggested and I would like to ask you if there is a function which takes the coordinates of a point (values on axis) and returns the coordinates on the plot (such as the mouse coordinates)
>
> Thanks,
> Michalis
>
> On Thursday, August 25, 2016 at 8:15:37 PM UTC+3, Bryan Van de ven wrote:
> There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html
>
> Thanks,
>
> Bryan
>
> On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, psal...@gmail.com wrote:
> Hi,
> I use WheelZoomTool to zoom on y-axis (dimensions=["height"]).
> The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?
> Thank you for your time.
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c563bfde-e475-41ae-bc14-59e3b4ca889e%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/83153f3f-ac96-4d26-8da2-b1509b1532ba%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Sure, I would be glad to help others.

I created a new tool using Wheel Zoom Tool source code https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/wheel_zoom_tool.coffee

As you said, (vx, vy) store the coordinates on the data space. So, in order to zoom along the x axis (y=0) I changed vy as below:

vy = @plot_view.frame.get(‘y_mappers’).default.map_to_target(0)

Respectively, someone can change vx value

···

On Saturday, August 27, 2016 at 6:10:18 PM UTC+3, Bryan Van de ven wrote:

Thanks Michalis,

That’s great to hear, is it possible fo ryou to share how you did it here so that others might benefit as well?

Thanks,

Bryan

On Aug 26, 2016, at 3:17 PM, [email protected] wrote:

Hi Bryan,

I have made it. Thanks again for your time and all your help!

Thanks,

Michalis

On Friday, August 26, 2016 at 6:27:31 PM UTC+3, Bryan Van de ven wrote:

Hi,

Yes, on the plot.frame there are mappers, and the mappers have “map_from_target” which take “view” coordinates and map them back to data space. Note that coordinated (by convention: vx, vy, etc) are y-flipped (i.e. they are pixel coordinates but start with (0,0) in the lower left).

Check out these few lines:

    [https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23](https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/tools/gestures/select_tool.coffee#L19-L23)

Thanks,

Bryan

On Aug 26, 2016, at 10:13 AM, [email protected] wrote:

Thank you for your quick reply Bryan.
I am working on extending Bokeh as you suggested and I would like to ask you if there is a function which takes the coordinates of a point (values on axis) and returns the coordinates on the plot (such as the mouse coordinates)

Thanks,
Michalis

On Thursday, August 25, 2016 at 8:15:37 PM UTC+3, Bryan Van de ven wrote:
There is no built-in support for this mode of operation, but you could write a custom extension tool that could do this. For examples and details of extending Bokeh, see http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

On Thursday, August 25, 2016 at 9:09:24 AM UTC-5, [email protected] wrote:
Hi,
I use WheelZoomTool to zoom on y-axis (dimensions=[“height”]).
The zoom works in respect of the position of the mouse. Is there a way to zoom in respect of a fixed point (e.g. y=0), regardless mouse location?
Thank you for your time.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c563bfde-e475-41ae-bc14-59e3b4ca889e%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/83153f3f-ac96-4d26-8da2-b1509b1532ba%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.