[bokeh] Better precision for HoverTool tooltip

Andrew,

You can do this with standard python formatting, e.g. in the Texas example replace the following code:

hover.tooltips = [
    ("Name", "@name"),
    ("Unemployment rate)", "@rate%"),
    ("(Long, Lat)", "($x, $y)"),
]
···

with:

hover.tooltips = [
(“Name”, “@name”),
(“Unemployment rate)”, “@rate{0.000000}%”),
(“(Long, Lat)”, “($x, $y)”),
]

If you’re not already aware of it, a good place to search for tips like this is the Bokeh forum here.

Regards,

Marcus.

On Wed, Jun 7, 2017 at 10:53 PM, Andrew Foltz-Morrison [email protected] wrote:

Right now the HoverTool only displays 3 decimal places of precision for float values.

(for these purposes, the default Texas example is illustrative)

http://bokeh.pydata.org/en/latest/docs/gallery/texas.html

It doesn’t seem like there’s a way using HTML to control the number of decimal places displayed, and I can’t find any examples of the functionality being extended to cover greater precision. Any help is much appreciated.

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/901c28e7-57e7-427e-b975-3e49994a2c1b%40continuum.io.

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

Please also see the expanded formatting options in the upcoming release:

  http://bokeh.pydata.org/en/dev/docs/user_guide/tools.html#formatting-tooltip-fields

Note: That link goes to "dev" docs, until the next (imminent) release, you would need to install from source or install a "dev build" to get this new feature.

Thanks,

Bryan

···

On Jun 8, 2017, at 05:16, Marcus Donnelly <[email protected]> wrote:

Andrew,

You can do this with standard python formatting, e.g. in the Texas example replace the following code:

hover.tooltips = [

("Name", "@name"),

("Unemployment rate)", "@rate%"),

("(Long, Lat)", "($x, $y)"),
]
with:

hover.tooltips = [
    ("Name", "@name"),
    ("Unemployment rate)", "@rate{0.000000}%"),
    ("(Long, Lat)", "($x, $y)"),
]

If you're not already aware of it, a good place to search for tips like this is the Bokeh forum here.

Regards,
Marcus.

On Wed, Jun 7, 2017 at 10:53 PM, Andrew Foltz-Morrison <[email protected]> wrote:
Right now the HoverTool only displays 3 decimal places of precision for float values.

(for these purposes, the default Texas example is illustrative)

http://bokeh.pydata.org/en/latest/docs/gallery/texas.html

It doesn't seem like there's a way using HTML to control the number of decimal places displayed, and I can't find any examples of the functionality being extended to cover greater precision. Any help is much appreciated.

--
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/901c28e7-57e7-427e-b975-3e49994a2c1b%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/CAFQ%3D5eGBzHkKn6iWxTcFissxGH%3DH0_J7XkLrd-aoYkdfybwJ3g%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.