rectangle at fixed location

The following used to work in an earlier version and would give a fixed rectangle, irrespective of pan/zoom.

How can this be done in the latest release? I think x_units and y_units cannot be set to “screen” any longer.

from bokeh.plotting import *

output_file(“rect.html”, title=“rect.py example”)

p2 = figure(title=‘Test3’, tools=“pan,wheel_zoom”, plot_width=400, plot_height=400)

p2.rect([150], [150], 50, 30, x_units=‘screen’, y_units=‘screen’, width_units=‘screen’, height_units=‘screen’,color=“blue”)

show(p2)

``

Hi Waqar,

Yes, the ability to absolutely position glyphs had to be removed. Basically it made the hit-testing and selection code unmanageably complicated and bloated, trying to deal with mixed screen/data coordinate systems, and in fact many of the combinations of it were not tested well and found to be broken. Since it had been observed that usually when absolutely positioning in screen space it is some kind of annotation (and not a "data glyph", per se) the plan is to add some new Annotation classes that can be positioned absolutely, but that won't participated in or complicate the normal glyph hit-testing code paths. So for now if you require this functionality I will have to suggest remaining on 0.8.2 for the time being. This would be nice feature for someone to get involved with Bokeh dev, so if you have any interest at all in working on a PR to add some simple Annotations, please let me know and we will definitely help discuss it an get you started. Otherwise it will probably be a in dev-build after the upcoming 0.9.1 release.

Bryan

···

On Jun 19, 2015, at 1:20 AM, Waqar Malik <[email protected]> wrote:

The following used to work in an earlier version and would give a fixed rectangle, irrespective of pan/zoom.

How can this be done in the latest release? I think x_units and y_units cannot be set to "screen" any longer.

from bokeh.plotting import *

output_file("rect.html", title="rect.py example")

p2 = figure(title='Test3', tools="pan,wheel_zoom", plot_width=400, plot_height=400)
p2.rect([150], [150], 50, 30, x_units='screen', y_units='screen', width_units='screen', height_units='screen',color="blue")

show(p2)

--
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/9cae6beb-25e9-412a-bc2e-dc4a2c3a75bf%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

To elaborate further, the properties for glyphs were split into a more fine grained taxonomy. Distances (like radius, width, height) can still be given in screen units. But Positions (like x, y, etc.) only be given in data units. Additionally an Angle type was added that can accept radians/degrees units and convert accordingly.

Bryan

···

On Jun 19, 2015, at 8:35 AM, Bryan Van de Ven <[email protected]> wrote:

Hi Waqar,

Yes, the ability to absolutely position glyphs had to be removed. Basically it made the hit-testing and selection code unmanageably complicated and bloated, trying to deal with mixed screen/data coordinate systems, and in fact many of the combinations of it were not tested well and found to be broken. Since it had been observed that usually when absolutely positioning in screen space it is some kind of annotation (and not a "data glyph", per se) the plan is to add some new Annotation classes that can be positioned absolutely, but that won't participated in or complicate the normal glyph hit-testing code paths. So for now if you require this functionality I will have to suggest remaining on 0.8.2 for the time being. This would be nice feature for someone to get involved with Bokeh dev, so if you have any interest at all in working on a PR to add some simple Annotations, please let me know and we will definitely help discuss it an get you started. Otherwise it will probably be a in dev-build after the upcoming 0.9.1 release.

Bryan

On Jun 19, 2015, at 1:20 AM, Waqar Malik <[email protected]> wrote:

The following used to work in an earlier version and would give a fixed rectangle, irrespective of pan/zoom.

How can this be done in the latest release? I think x_units and y_units cannot be set to "screen" any longer.

from bokeh.plotting import *

output_file("rect.html", title="rect.py example")

p2 = figure(title='Test3', tools="pan,wheel_zoom", plot_width=400, plot_height=400)
p2.rect([150], [150], 50, 30, x_units='screen', y_units='screen', width_units='screen', height_units='screen',color="blue")

show(p2)

--
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/9cae6beb-25e9-412a-bc2e-dc4a2c3a75bf%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Is it possible to access units through DataSpec? I saw one of your discussion with Hugo regarding this…

Would the work involved with creating a annotation classes involve copying the text classes and changing the units to ‘screen’?

···

On Friday, June 19, 2015 at 12:37:55 AM UTC-7, Bryan Van de ven wrote:

To elaborate further, the properties for glyphs were split into a more fine grained taxonomy. Distances (like radius, width, height) can still be given in screen units. But Positions (like x, y, etc.) only be given in data units. Additionally an Angle type was added that can accept radians/degrees units and convert accordingly.

Bryan

On Jun 19, 2015, at 8:35 AM, Bryan Van de Ven [email protected] wrote:

Hi Waqar,

Yes, the ability to absolutely position glyphs had to be removed. Basically it made the hit-testing and selection code unmanageably complicated and bloated, trying to deal with mixed screen/data coordinate systems, and in fact many of the combinations of it were not tested well and found to be broken. Since it had been observed that usually when absolutely positioning in screen space it is some kind of annotation (and not a “data glyph”, per se) the plan is to add some new Annotation classes that can be positioned absolutely, but that won’t participated in or complicate the normal glyph hit-testing code paths. So for now if you require this functionality I will have to suggest remaining on 0.8.2 for the time being. This would be nice feature for someone to get involved with Bokeh dev, so if you have any interest at all in working on a PR to add some simple Annotations, please let me know and we will definitely help discuss it an get you started. Otherwise it will probably be a in dev-build after the upcoming 0.9.1 release.

Bryan

On Jun 19, 2015, at 1:20 AM, Waqar Malik [email protected] wrote:

The following used to work in an earlier version and would give a fixed rectangle, irrespective of pan/zoom.

How can this be done in the latest release? I think x_units and y_units cannot be set to “screen” any longer.

from bokeh.plotting import *

output_file(“rect.html”, title=“rect.py example”)

p2 = figure(title=‘Test3’, tools=“pan,wheel_zoom”, plot_width=400, plot_height=400)

p2.rect([150], [150], 50, 30, x_units=‘screen’, y_units=‘screen’, width_units=‘screen’, height_units=‘screen’,color=“blue”)

show(p2)


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/9cae6beb-25e9-412a-bc2e-dc4a2c3a75bf%40continuum.io.

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

Waqar,

No, the x and y properties are no longer "DataSpec", they are "NumberSpec" which does not have any units property associated with it at all. To an annotation class that supports absolutely positioning rects, we would definitely want to try and re-euse whatever code we can from the existing rect glyph, but I can't speculate what that refactoring might involve offhand.

Bryan

···

On Jun 19, 2015, at 5:04 PM, Waqar Malik <[email protected]> wrote:

Is it possible to access units through DataSpec? I saw one of your discussion with Hugo regarding this....

Would the work involved with creating a annotation classes involve copying the text classes and changing the units to 'screen'?

On Friday, June 19, 2015 at 12:37:55 AM UTC-7, Bryan Van de ven wrote:
To elaborate further, the properties for glyphs were split into a more fine grained taxonomy. Distances (like radius, width, height) can still be given in screen units. But Positions (like x, y, etc.) only be given in data units. Additionally an Angle type was added that can accept radians/degrees units and convert accordingly.

Bryan

> On Jun 19, 2015, at 8:35 AM, Bryan Van de Ven <[email protected]> wrote:
>
> Hi Waqar,
>
> Yes, the ability to absolutely position glyphs had to be removed. Basically it made the hit-testing and selection code unmanageably complicated and bloated, trying to deal with mixed screen/data coordinate systems, and in fact many of the combinations of it were not tested well and found to be broken. Since it had been observed that usually when absolutely positioning in screen space it is some kind of annotation (and not a "data glyph", per se) the plan is to add some new Annotation classes that can be positioned absolutely, but that won't participated in or complicate the normal glyph hit-testing code paths. So for now if you require this functionality I will have to suggest remaining on 0.8.2 for the time being. This would be nice feature for someone to get involved with Bokeh dev, so if you have any interest at all in working on a PR to add some simple Annotations, please let me know and we will definitely help discuss it an get you started. Otherwise it will probably be a in dev-build after the upcoming 0.9.1 release.
>
> Bryan
>
>> On Jun 19, 2015, at 1:20 AM, Waqar Malik <[email protected]> wrote:
>>
>> The following used to work in an earlier version and would give a fixed rectangle, irrespective of pan/zoom.
>>
>> How can this be done in the latest release? I think x_units and y_units cannot be set to "screen" any longer.
>>
>> from bokeh.plotting import *
>>
>> output_file("rect.html", title="rect.py example")
>>
>> p2 = figure(title='Test3', tools="pan,wheel_zoom", plot_width=400, plot_height=400)
>> p2.rect([150], [150], 50, 30, x_units='screen', y_units='screen', width_units='screen', height_units='screen',color="blue")
>>
>> show(p2)
>>
>>
>>
>> --
>> 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/9cae6beb-25e9-412a-bc2e-dc4a2c3a75bf%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/417c95a0-c46c-4c76-892a-30305ed7bd36%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.