enable tonexty without fallback to tozeroy
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
In our use case, we are plotting quantiles of a data set, with lower and upper bound as well as the median. For convenience, we need to fill in the area between the upper and lower bound shown.
The way we have solved this is by setting fill_type=tonexty on all traces and fill_color=gray on the top four traces, but fill_color=None on the bottom trace.
It looks like this:

The problem is if a user disables the bottom trace, the tonexty fill of the second-to-last trace falls back to tozeroy:

This makes no sense in our case. The expected/intended behavior is:

We have tried/considered several methods:
- Creating a stackgroup; this does allow a fill 'inside' the group only, but requires the trace values to be stacked, which they fundamentally aren't; hiding a trace in that case moves the traces above, which is incorrect.
- Disabling the trace toggle; this hides the problem of course, but it also disables a useful feature
- Dynamically changing the
fill_colors when a trace is hidden; this might work, but I can't find an event to hook into, and since we are using Dash, doing this kind of hacking between Python and clientside callbacks is nontrivial at best.
The best solution would be a fill_type that fills to next but falls back to no fill.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das im Issue beschriebene Quantil-Trace-Beispiel zu reproduzieren, und untersuche, wie sich fill_type=tonexty verhält, wenn der vorhergehende Trace ausgeblendet ist. Überprüfe das bestehende Fill-Verhalten von Plotly.js und bestimme, wie ein Fallback ohne Füllung dargestellt werden sollte; als erledigt gilt die Aufgabe, wenn der Fall mit ausgeblendetem Trace den Bereich zwischen den verbleibenden Grenzen beibehält, ohne auf tozeroy zurückzufallen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100