Skip to content

[BUG]: Text labels are drawn in the range slider #8118

Open

Description

@camdecoster

Description

A scatter trace whose mode includes text draws its labels in the range slider as well as in the main plot.

Screenshots/Video

Image

Steps to reproduce

  • Open Plotly devtools and paste the following into the browser devtools console:
Plotly.newPlot(gd, {
    data: [
        {
            mode: 'lines+markers+text',
            textposition: 'top center',
            x: [1, 2, 3, 4, 5, 6, 7, 8],
            y: [3, 5, 2, 6, 4, 7, 3, 5],
            text: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
        }
    ],
    layout: {
        width: 700,
        height: 400,
        showlegend: false,
        xaxis: { rangeslider: { visible: true } }
    }
});
  • Note that the text labels from the plot are visible in the range slider

Notes

  • The labels in the slider are compressed and don't seem to add much value
  • Nothing in the slider's code handles text, and no test or baseline covers it
  • The labels appear because Cartesian.rangePlot runs each trace module's full plot routine, including rendering the text labels
  • In the event that the plot only includes the text labels (mode: 'text'), how should the text labels be handled?
    • Without including them in the slider, the slider would be blank
    • I think we should keep the labels in this case
  • This was discovered when working on Add auto text positioning for scatter traces #8065. The auto labels that get added in that PR branch will be omitted from the slider.

Activity

  1. self-assigned this
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2considered for next cyclebugsomething brokensize: 1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions