enable tonexty without fallback to tozeroy
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the quantile-trace example described in the issue and inspect how fill_type=tonexty behaves when the preceding trace is hidden. Review the existing Plotly.js fill behavior and determine how a no-fill fallback should be represented; done means the hidden-trace case preserves the area between the remaining bounds without falling back to tozeroy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100