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 values 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 values 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.
Problem
Currently, the tooltip of
dcc.RangeSlidercan be used to display thevalueproperty of the slider. It would be nice if it could display an arbitrary string. E.g. using a dictionary, where keys are thevalues 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
See the
tipFormatterproperty. Could this property be added todcc.RangeSlider?Example use-case
Imagine that your slider
values 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 themarksproperty 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 thevalueproperty of the slider.