Glyphs disappearing when updating plots

Hi folks, I’m having an issue creating glyphs that I can update on the bokeh server. The provided animation examples work for me, but when I try to create my own, the glyphs disappear when I update. I’ve tried using the high level plotting syntax:

import bokeh.plotting as bp

import bokeh.objects as bo

bp.output_server(‘test’)

bp.figure(title=‘Test’)

bp.hold()

bp.wedge([0.5], [0.5],

     radius=0.04, radius_units='data',

     start_angle=[7*np.pi/8],

     end_angle=[9*np.pi/8],

     fill_color='black',

     fill_alpha=1.0)

renderers = [r for r in bp.curplot().renderers if isinstance(r, bo.Glyph)]

ds = renderers[0].data_source

ds.data[‘x’] = 0.6

bp.cursession().store_objects(ds)

If I omit the last line, I get a wedge in the original position. If I try to update the server-side object, the axes update to the new position of the glyph, but the wedge disappears. I’ve also tried building up the plot myself from a ColumnDataSource and Plot / Wedge objects, with the same result. Can anyone point out where I’m going wrong here?

Cheers,

Chris.

Hi Chris,

Bokeh glyphs are "vectorized" over sequences of data. I believe this may be your problem:

ds.data['x'] = 0.6

If you are updating the data in the ColumnDataSource like that, you need to specify a sequence of points (even if there is only one). Try

  ds.data['x'] = [0.6]

Bryan

···

On Nov 8, 2014, at 8:28 PM, Christopher Nolan <[email protected]> wrote:

Hi folks, I'm having an issue creating glyphs that I can update on the bokeh server. The provided animation examples work for me, but when I try to create my own, the glyphs disappear when I update. I've tried using the high level plotting syntax:

import bokeh.plotting as bp
import bokeh.objects as bo

bp.output_server('test')

bp.figure(title='Test')
bp.hold()
bp.wedge([0.5], [0.5],
         radius=0.04, radius_units='data',
         start_angle=[7*np.pi/8],
         end_angle=[9*np.pi/8],
         fill_color='black',
         fill_alpha=1.0)
renderers = [r for r in bp.curplot().renderers if isinstance(r, bo.Glyph)]
ds = renderers[0].data_source

ds.data['x'] = 0.6

bp.cursession().store_objects(ds)

If I omit the last line, I get a wedge in the original position. If I try to update the server-side object, the axes update to the new position of the glyph, but the wedge disappears. I've also tried building up the plot myself from a ColumnDataSource and Plot / Wedge objects, with the same result. Can anyone point out where I'm going wrong here?

Cheers,
Chris.

--
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/e47e7ca1-e9cf-494e-bf16-438948bcc689%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks Bryan, I’m not quite sure how I missed that one! All working.

Cheers,

Chris.

···

On Mon, Nov 10, 2014 at 2:01 AM, Bryan Van de Ven [email protected] wrote:

Hi Chris,

Bokeh glyphs are “vectorized” over sequences of data. I believe this may be your problem:

ds.data[‘x’] = 0.6

If you are updating the data in the ColumnDataSource like that, you need to specify a sequence of points (even if there is only one). Try

    ds.data['x'] = [0.6]

Bryan

On Nov 8, 2014, at 8:28 PM, Christopher Nolan [email protected] wrote:

Hi folks, I’m having an issue creating glyphs that I can update on the bokeh server. The provided animation examples work for me, but when I try to create my own, the glyphs disappear when I update. I’ve tried using the high level plotting syntax:

import bokeh.plotting as bp

import bokeh.objects as bo

bp.output_server(‘test’)

bp.figure(title=‘Test’)

bp.hold()

bp.wedge([0.5], [0.5],

     radius=0.04, radius_units='data',
     start_angle=[7*np.pi/8],
     end_angle=[9*np.pi/8],
     fill_color='black',
     fill_alpha=1.0)

renderers = [r for r in bp.curplot().renderers if isinstance(r, bo.Glyph)]

ds = renderers[0].data_source

ds.data[‘x’] = 0.6

bp.cursession().store_objects(ds)

If I omit the last line, I get a wedge in the original position. If I try to update the server-side object, the axes update to the new position of the glyph, but the wedge disappears. I’ve also tried building up the plot myself from a ColumnDataSource and Plot / Wedge objects, with the same result. Can anyone point out where I’m going wrong here?

Cheers,

Chris.

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/e47e7ca1-e9cf-494e-bf16-438948bcc689%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/UkrI-ZQ6Yzo/unsubscribe.

To unsubscribe from this group and all its topics, 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/4907B03D-CF0A-4A2C-8982-6A464C111D96%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Great I am glad to hear that worked! We could probably add a check to make code like you originally had work by converting to a singleton list for convenience, it might be worth looking into for the future.

Bryan

···

On Nov 9, 2014, at 3:42 PM, Christopher Nolan <[email protected]> wrote:

Thanks Bryan, I'm not quite sure how I missed that one! All working.

Cheers,
Chris.

On Mon, Nov 10, 2014 at 2:01 AM, Bryan Van de Ven <[email protected]> wrote:
Hi Chris,

Bokeh glyphs are "vectorized" over sequences of data. I believe this may be your problem:

> ds.data['x'] = 0.6

If you are updating the data in the ColumnDataSource like that, you need to specify a sequence of points (even if there is only one). Try

        ds.data['x'] = [0.6]

Bryan

> On Nov 8, 2014, at 8:28 PM, Christopher Nolan <[email protected]> wrote:
>
> Hi folks, I'm having an issue creating glyphs that I can update on the bokeh server. The provided animation examples work for me, but when I try to create my own, the glyphs disappear when I update. I've tried using the high level plotting syntax:
>
> import bokeh.plotting as bp
> import bokeh.objects as bo
>
> bp.output_server('test')
>
> bp.figure(title='Test')
> bp.hold()
> bp.wedge([0.5], [0.5],
> radius=0.04, radius_units='data',
> start_angle=[7*np.pi/8],
> end_angle=[9*np.pi/8],
> fill_color='black',
> fill_alpha=1.0)
> renderers = [r for r in bp.curplot().renderers if isinstance(r, bo.Glyph)]
> ds = renderers[0].data_source
>
> ds.data['x'] = 0.6
>
> bp.cursession().store_objects(ds)
>
> If I omit the last line, I get a wedge in the original position. If I try to update the server-side object, the axes update to the new position of the glyph, but the wedge disappears. I've also tried building up the plot myself from a ColumnDataSource and Plot / Wedge objects, with the same result. Can anyone point out where I'm going wrong here?
>
> Cheers,
> Chris.
>
>
> --
> 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/e47e7ca1-e9cf-494e-bf16-438948bcc689%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/UkrI-ZQ6Yzo/unsubscribe\.
To unsubscribe from this group and all its topics, 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/4907B03D-CF0A-4A2C-8982-6A464C111D96%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/CAL81BhKfZsrvKu9Dbn11SNWPHgyH7sTQk2A0FhYssMcXMKYDrA%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

We could probably add a check to make code like you originally had work by converting to a singleton list for convenience, it might be worth looking into for the future.

Yep, at least an advice would be very helpful… we saw this kind of issues before, so a check seems reasonable and needed.

···

On Sun, Nov 9, 2014 at 8:37 PM, Bryan Van de Ven [email protected] wrote:

Great I am glad to hear that worked! We could probably add a check to make code like you originally had work by converting to a singleton list for convenience, it might be worth looking into for the future.

Bryan

On Nov 9, 2014, at 3:42 PM, Christopher Nolan [email protected] wrote:

Thanks Bryan, I’m not quite sure how I missed that one! All working.

Cheers,

Chris.

On Mon, Nov 10, 2014 at 2:01 AM, Bryan Van de Ven [email protected] wrote:

Hi Chris,

Bokeh glyphs are “vectorized” over sequences of data. I believe this may be your problem:

ds.data[‘x’] = 0.6

If you are updating the data in the ColumnDataSource like that, you need to specify a sequence of points (even if there is only one). Try

    ds.data['x'] = [0.6]

Bryan

On Nov 8, 2014, at 8:28 PM, Christopher Nolan [email protected] wrote:

Hi folks, I’m having an issue creating glyphs that I can update on the bokeh server. The provided animation examples work for me, but when I try to create my own, the glyphs disappear when I update. I’ve tried using the high level plotting syntax:

import bokeh.plotting as bp

import bokeh.objects as bo

bp.output_server(‘test’)

bp.figure(title=‘Test’)

bp.hold()

bp.wedge([0.5], [0.5],

     radius=0.04, radius_units='data',
     start_angle=[7*np.pi/8],
     end_angle=[9*np.pi/8],
     fill_color='black',
     fill_alpha=1.0)

renderers = [r for r in bp.curplot().renderers if isinstance(r, bo.Glyph)]

ds = renderers[0].data_source

ds.data[‘x’] = 0.6

bp.cursession().store_objects(ds)

If I omit the last line, I get a wedge in the original position. If I try to update the server-side object, the axes update to the new position of the glyph, but the wedge disappears. I’ve also tried building up the plot myself from a ColumnDataSource and Plot / Wedge objects, with the same result. Can anyone point out where I’m going wrong here?

Cheers,

Chris.

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/e47e7ca1-e9cf-494e-bf16-438948bcc689%40continuum.io.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/UkrI-ZQ6Yzo/unsubscribe.

To unsubscribe from this group and all its topics, 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/4907B03D-CF0A-4A2C-8982-6A464C111D96%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/CAL81BhKfZsrvKu9Dbn11SNWPHgyH7sTQk2A0FhYssMcXMKYDrA%40mail.gmail.com.

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/FDB1076E-5028-4672-A99C-3CB86A295687%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.