You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Panel widgets are tied to a specific Python datatype (int, float, etc.) and various modes of interaction (slider, text box, etc.), but not all combinations are covered by existing widgets (with missing ones indicated with a ?):
slider
input
player
rangeslider
rangeinput
int
IntSlider
IntInput
Player
Intrangeslider
IntrangeInput?
float
FloatSlider
FloatInput
Options for Player?
Rangeslider
FloatrangeInput?
date
Dateslider
DateInput?
Options for Player?
Daterangeslider
DaterangeInput?
datetime
Datetimeslider?
Datetimeinput
Options for Player?
Datetimerangeslider?
Daterangetimeinput
categorical
DiscreteSlider
(Autocompleteinput)
DiscretePlayer
(Multiselect)
N/A?
My immediate use case is for a Datetimeslider, so that I can scroll through a point in time the same way I can scroll through a floating-point value. Any workaround I can think of seems very painful: Floatslider with a formatter to show as a date (awkward to work with, imprecise), DatePicker plus a time-of-day slider (hard to lay out, requires resetting time slider each midnight), DateSlider plus a time-of-day slider (requires resetting time slider each midnight).
Other missing widgets also seem useful, though the workarounds seem better in those cases: you can use two IntInputs or FloatInputs as an IntrangeInput or FloatrangeInput (though without inherent validation for ordering), you can use a Multiselect to select a range of discrete values (though without enforcing it to be a contiguous range necessarily), etc.
Would it be possible to simply dispense with having all these combinations and have a type argument for the widget instead? E.g. single Slider, Input, Player, RangeSlider, and RangeInput widget classes that can be configured as int, float, date, or datetime? Even better, they could deduce their type from the initial value, if not specified, which would leave things quite a bit cleaner in user code. Seems like this approach would also make it easier to find stuff in the reference guides (easily landing on the page about sliders if I want a slider).
[Not sure if Discrete fits into this categorization, really; Discrete isn't a datatype per se (though it's an assumption that allows you to be independent of datatype by accepting "List of x" for any x), and arguably range sliders and inputs are already covered for the discrete case by MultiSelect and similar widgets and by Autocompleteinput. But I figured I'd include that row in the table here just in case it resonated somehow. ETA: Renamed Categorical, and it does fit!]
The text was updated successfully, but these errors were encountered:
@jlstevens made a couple of useful observations here verbally today:
The last row is really about categorical or nominal variables, rather than discreteness per se, because an integer value is also discrete but is already covered; what that row covers is selecting from a set that is not necessarily even ordered, just as for a categorical axis in Bokeh.
Really there's a third dimension to the above table, as at least the first four rows can be split by whether they are continuous or discrete, with int and float being discrete or continuous numerical values and date and datetime being discrete or continuous temporal values. Yet more structure that we're not really acknowledging!
Panel widgets are tied to a specific Python datatype (int, float, etc.) and various modes of interaction (slider, text box, etc.), but not all combinations are covered by existing widgets (with missing ones indicated with a
?
):My immediate use case is for a Datetimeslider, so that I can scroll through a point in time the same way I can scroll through a floating-point value. Any workaround I can think of seems very painful: Floatslider with a formatter to show as a date (awkward to work with, imprecise), DatePicker plus a time-of-day slider (hard to lay out, requires resetting time slider each midnight), DateSlider plus a time-of-day slider (requires resetting time slider each midnight).
Other missing widgets also seem useful, though the workarounds seem better in those cases: you can use two IntInputs or FloatInputs as an IntrangeInput or FloatrangeInput (though without inherent validation for ordering), you can use a Multiselect to select a range of discrete values (though without enforcing it to be a contiguous range necessarily), etc.
Would it be possible to simply dispense with having all these combinations and have a type argument for the widget instead? E.g. single Slider, Input, Player, RangeSlider, and RangeInput widget classes that can be configured as int, float, date, or datetime? Even better, they could deduce their type from the initial value, if not specified, which would leave things quite a bit cleaner in user code. Seems like this approach would also make it easier to find stuff in the reference guides (easily landing on the page about sliders if I want a slider).
[Not sure if Discrete fits into this categorization, really; Discrete isn't a datatype per se (though it's an assumption that allows you to be independent of datatype by accepting "List of x" for any x), and arguably range sliders and inputs are already covered for the discrete case by MultiSelect and similar widgets and by Autocompleteinput. But I figured I'd include that row in the table here just in case it resonated somehow. ETA: Renamed Categorical, and it does fit!]
The text was updated successfully, but these errors were encountered: