Spinner widget significant digits

ENVIRONMENT: bokeh 2.2.3 on Mac OS X and latest version of Google Chrome, i.e. Version 89.0.4389.90 (Official Build) (x86_64)

ISSUE: There is an inconsistency between the configured step size and the displayed value’s significant digits in some use cases. This can be demonstrated by simply using the up/down controls of the widget (i.e. without manually editing the value).

It would be ideal if the Spinner automatically enforced the step-size constraint and its display.

MINIMAL REPRODUCIBLE EXAMPLE: See below. Several clicks up or down from the initial value show the behavior.

from bokeh.models import Spinner
from bokeh.io import show


s = Spinner(
            value=55.000,
            low=0.000,
            high=59.999,
            step=0.001,
            width=100,
            height=50,
            margin=(-5,5,5,5),
            title='Seconds')

show(s)

So there have been lots of different but related problems with spinners over the years, with different underlying spinner implementations, and for different (mostly tedious) reasons. At this point I am pretty much ready to throw in the towel on trying to make things work automatically nicely for floating point increments. Specifically I think I would just offer an optional property to specify a desired formatter manually, and call it a day. Please feel free to open a GitHub Issue to propose this!

1 Like

Will ultimately get around to proposing a GitHub issue.

For now, confirmed I can handle this efficiently in a client-side CustomJS callback when the value is changed.

1 Like