Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Differing behaviors with sliders for Number parameters between parambokeh and paramnb #35

Open
Dr-Irv opened this issue Jan 19, 2018 · 0 comments

Comments

@Dr-Irv
Copy link

Dr-Irv commented Jan 19, 2018

I'm doing the tutorial at pyviz on the notebook 12_Parameters_and_Widgets and noticed the following, based on this experiment:

import holoviews as hv
import param
import paramnb
import parambokeh

class NumOptions(hv.streams.Stream):
    intdef = param.Number(default=1, bounds=(0,10))
    fourdig = param.Number(default=1.1234, bounds=(0,10))
    
bokopts = NumOptions(name='parambokeh')
nbopts = NumOptions(name='paramnb')
parambokeh.Widgets(bokopts),  paramnb.Widgets(nbopts)

What happens here is that for parambokeh, the precision of the slider is dependent on the number of significant digits of the initial value. So the slider for intdef has integer values, and the slider for fourdig has values to 4 places after the decimal point.

In the case of paramnb, the precision is 2 digits, independent of the initial value.

I'm not sure what the actual behavior should be, but the inconsistent behavior can be confusing.

Maybe, for both cases, there should be a way to specify the precision of the slider as it is moved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant