Description
Problem
Currently, the tooltip of dcc.RangeSlider
can be used to display the value
property of the slider. It would be nice if it could display an arbitrary string. E.g. using a dictionary, where keys are the value
s of the slider and values are the strings to be displayed in the tooltip.
Solution(?)
Apparently, such functionality is present in the react slider.
http://react-component.github.io/slider/?path=/story/rc-slider–handle
<div style={wrapperStyle}>
<p>Range with custom tooltip</p>
<Range min={0} max={20} defaultValue={[3, 10]} tipFormatter={value => `${value}%`} />
</div>
See the tipFormatter
property. Could this property be added to dcc.RangeSlider
?
Example use-case
Imagine that your slider value
s are actually indexes of a list of the real values. You want to present the real values to the user instead of the indexes. You cannot use the marks
property of the slider because there are too many values and it would look messy. Thus, you want to use the tooltip to display something else than the value
property of the slider.
Activity