Skip to content

[Feature Request] dcc.RangeSlider tooltip - allow displaying something else than value #1846

Closed

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions