[FEATURE]: minimum autorange window
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 42/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- javascript
- Domaine
- data-visualization
Piste de recherche
Commencez par suivre le traitement existant de yaxis.autorangeoptions, en particulier clipmin, clipmax, minallowed et maxallowed, et examinez comment Plotly.extendTraces et Plotly.relayout affectent le comportement de autorange lors du streaming. Définissez l'API et vérifiez que autorange conserve la fenêtre minimale configurée lorsque les données restent à l'intérieur de celle-ci, tout en s'élargissant suffisamment pour inclure les valeurs aberrantes et les règles de padding existantes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Feature request: “minimum autorange window” (default range, expand only when data exceed bounds) for live graphs
Problem / Motivation
We are building a live (streaming) graph with Plotly.js. When using autorange: true, the y-axis can become too tightly zoomed around very small values. This makes it hard to follow the signal comfortably because the scale constantly re-adjusts to tiny changes.
At the same time, we need to see outliers immediately: if a value suddenly exceeds a threshold, the plot should expand so the outlier is visible and operators can react.
So we want a y-axis behavior like:
- Default to a “stable” range (e.g.
[-10, 10]) while data stay inside it (prevents over-zooming). - If any new data point goes below -10 or above 10, automatically expand the axis beyond that window (so outliers are visible).
- In other words: do not shrink inside the window, but do expand outside of it.
Why current options don’t solve it
layout.yaxis.autorangeoptions.clipmin/clipmaxcap the autorange result.
They prevent the axis from expanding beyond the clip values, which is the opposite of what we need (we want expansion beyond the threshold).autorangeoptions.minallowed/maxallowed(and axis-level allowed options) are hard limits / exact values and also do not provide “minimum window but expandable”.- The current workaround is to compute data min/max and call
Plotly.relayout()repeatedly, but this creates boilerplate, can fight user interactions, and is easy to get wrong for multi-axis / overlay cases.
Proposed feature
Add an autorange option that enforces a minimum visible window while still allowing expansion when data exceed the window.
Possible API (one of these, open to better naming):
yaxis.autorangeoptions.minwindow: [-10, 10]yaxis.autorangeoptions.minrange: 20(minimum span)- or similar
Proposed semantics
When autorange: true:
- Compute normal autorange
[amin, amax]from data (with existing padding rules). - Enforce: the final range must include the data, and must be at least the configured minimum window/span.
- If data are within the minimum window, use the minimum window exactly (stable view).
- If data exceed the window, expand as needed to include the data (outliers become visible).
Examples
Given minwindow: [-10, 10]:
- data in
[-3, 5]-> range should be[-10, 10] - data in
[-12, 5]-> range should expand to include-12(e.g.[-12, 10]plus padding if applicable) - data in
[-3, 22]-> range should expand to include22
Minimal reproduction / demonstration
Current behavior with autorange: true in a streaming graph:
- when values are close to 0, the axis zooms too tightly and keeps changing scale, making the chart hard to read.
Desired behavior:
- keep a stable default range (e.g.
[-10, 10]) until thresholds are exceeded, then expand.
(If maintainers want, I can provide a CodePen reproducing the streaming case using Plotly.extendTraces.)
Additional notes
This feature would be especially valuable for:
- live monitoring dashboards
- industrial / IoT telemetry
- finance signals with mostly small fluctuations but occasional spikes
It’s conceptually related to clipmin/clipmax, but with inverse behavior:
clip*= “don’t expand past these limits”minwindow= “don’t shrink inside these limits, but expand past them when necessary”- or you can add more values in autorangeoptions:
include
- Langage dominant
- JavaScript
- Étoiles
- 18.3k
- Forks
- 2k
- Merge moyen
- 1 j 21 h
- PR mergées (30 j)
- 21
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de plotly/plotly.js
-
chore P3 plotly-internal size: 3 task
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
chore P1 plotly-internal size: 1 task
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
chore P3 plotly-internal size: 1 task
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
plotly/plotly.js#7648 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
bug infrastructure P2
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de plotly/plotly.js
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
solana-foundation/solana-com#2202 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
yegor256/copyrights-action#216 ·
-
[BUG] onScroll never refreshes the window container's height after a vertical-only viewport resizeOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
juliangarnier/anime#1192 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
PedestrianDynamics/pyFDS-Evac#226 ·
Les mainteneurs répondent en général sous 1 jour