[bokeh] Bokeh neophyte - 2 specific things I can't figure out

Hi,

The bars are in fact zooming, it's just that you have made them 1 millisecond wide, and until you zoom *very* far in, you are only seeing the "outline" portion of the vbars. You can try something like width = 24*2600*1000 for a full day's width, or any fraction of that if you'd like them a little less wide).

Regarding hover tools, have you seen the documentation for adding hover tooltips?

  https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool

If so, can you elaborate on what you have tried and where you are getting stuck?

Bryan

···

On Jan 7, 2018, at 09:52, Michael Campbell <[email protected]> wrote:

Hello all,

Just started with Bokeh and after spending the better part of a day on it, there are 2 things I haven't been able to crack.

Runnable code demonstrating my issues here: https://gist.github.com/mcampbell/6c6073dcf2068b9e57cc12ada96f9917 (Apologies for the huge data dump; you can scroll to the bottom for the Bokeh bits)

The x axis is datetime, since my data is "per day". The issue is, after setting the x_axis_type to 'datetime', and converting all my data to "<yy-mm-dd> 00:00:00" in ms, the bar width won't budge after zooming. That is to say, when I zoom down into my data, the bar seems to only ever represent that instant in time (midnight), rather than the whole day. I'd like the bars to become wider and "fill" the whole day as I zoom in where there are fewer days visible left to right.

The reason I used datetime is the nifty auto-scaling of x-axis ticks - if I use categorical data here (eg "2018-01-05"), the dates all jumble over each other, making none of the readable. But I'm open to other means to get that to work, also.

Unzoomed image: http://imageshack.com/i/poxBPc1ep
Zoomed image: http://imageshack.com/i/po6YldS3p

I cannot, for the life of me, figure out how to configure a hover tool. My use case is pretty simple; when I hover over a bar (or anywhere in a "day"), I'd like a hover of "<date> - <population>" to appear somewhere. Not even sure where to start, here. The default "plotly" interface already does this.

Any pointers welcome.

--
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/8da61319-f64e-4823-b327-d12c1c1e9b51%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Edit: that should be 24 * 360 * 1000 for the width (a full day, in milliseconds)

···

On Jan 9, 2018, at 07:53, Bryan Van de ven <[email protected]> wrote:

Hi,

The bars are in fact zooming, it's just that you have made them 1 millisecond wide, and until you zoom *very* far in, you are only seeing the "outline" portion of the vbars. You can try something like width = 24*2600*1000 for a full day's width, or any fraction of that if you'd like them a little less wide).

Regarding hover tools, have you seen the documentation for adding hover tooltips?

  https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool

If so, can you elaborate on what you have tried and where you are getting stuck?

Bryan

On Jan 7, 2018, at 09:52, Michael Campbell <[email protected]> wrote:

Hello all,

Just started with Bokeh and after spending the better part of a day on it, there are 2 things I haven't been able to crack.

Runnable code demonstrating my issues here: https://gist.github.com/mcampbell/6c6073dcf2068b9e57cc12ada96f9917 (Apologies for the huge data dump; you can scroll to the bottom for the Bokeh bits)

The x axis is datetime, since my data is "per day". The issue is, after setting the x_axis_type to 'datetime', and converting all my data to "<yy-mm-dd> 00:00:00" in ms, the bar width won't budge after zooming. That is to say, when I zoom down into my data, the bar seems to only ever represent that instant in time (midnight), rather than the whole day. I'd like the bars to become wider and "fill" the whole day as I zoom in where there are fewer days visible left to right.

The reason I used datetime is the nifty auto-scaling of x-axis ticks - if I use categorical data here (eg "2018-01-05"), the dates all jumble over each other, making none of the readable. But I'm open to other means to get that to work, also.

Unzoomed image: http://imageshack.com/i/poxBPc1ep
Zoomed image: http://imageshack.com/i/po6YldS3p

I cannot, for the life of me, figure out how to configure a hover tool. My use case is pretty simple; when I hover over a bar (or anywhere in a "day"), I'd like a hover of "<date> - <population>" to appear somewhere. Not even sure where to start, here. The default "plotly" interface already does this.

Any pointers welcome.

--
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/8da61319-f64e-4823-b327-d12c1c1e9b51%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Bryan, this was helpful.

I guess I was confused about the width parameter. But now that’s working, and the hover works too; I suppose that because my previous bars were so absurdly thin, the cursor never registered as having been over one. It’s the default format of data still, but I will futz with that to see if I can get it to what I want.

Thanks again.

···

On Tue, Jan 9, 2018 at 8:53 AM, Bryan Van de ven [email protected] wrote:

Edit: that should be 24 * 360 * 1000 for the width (a full day, in milliseconds)

On Jan 9, 2018, at 07:53, Bryan Van de ven [email protected] wrote:

Hi,

The bars are in fact zooming, it’s just that you have made them 1 millisecond wide, and until you zoom very far in, you are only seeing the “outline” portion of the vbars. You can try something like width = 2426001000 for a full day’s width, or any fraction of that if you’d like them a little less wide).

Regarding hover tools, have you seen the documentation for adding hover tooltips?

  [https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool](https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool)

If so, can you elaborate on what you have tried and where you are getting stuck?

Bryan

On Jan 7, 2018, at 09:52, Michael Campbell [email protected] wrote:

Hello all,

Just started with Bokeh and after spending the better part of a day on it, there are 2 things I haven’t been able to crack.

Runnable code demonstrating my issues here: https://gist.github.com/mcampbell/6c6073dcf2068b9e57cc12ada96f9917 (Apologies for the huge data dump; you can scroll to the bottom for the Bokeh bits)

The x axis is datetime, since my data is “per day”. The issue is, after setting the x_axis_type to ‘datetime’, and converting all my data to " 00:00:00" in ms, the bar width won’t budge after zooming. That is to say, when I zoom down into my data, the bar seems to only ever represent that instant in time (midnight), rather than the whole day. I’d like the bars to become wider and “fill” the whole day as I zoom in where there are fewer days visible left to right.

The reason I used datetime is the nifty auto-scaling of x-axis ticks - if I use categorical data here (eg “2018-01-05”), the dates all jumble over each other, making none of the readable. But I’m open to other means to get that to work, also.

Unzoomed image: http://imageshack.com/i/poxBPc1ep

Zoomed image: http://imageshack.com/i/po6YldS3p

I cannot, for the life of me, figure out how to configure a hover tool. My use case is pretty simple; when I hover over a bar (or anywhere in a “day”), I’d like a hover of " - " to appear somewhere. Not even sure where to start, here. The default “plotly” interface already does this.

Any pointers welcome.

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/8da61319-f64e-4823-b327-d12c1c1e9b51%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/6911B087-586E-41BE-9D39-D4936B312A1B%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.