-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix stacked area hide show bug #7668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/traces/scatter/plot.js
Outdated
| // Clear any existing fill element references to ensure clean state | ||
| // This prevents stale references when fill configuration changes | ||
| trace._ownFill = null; | ||
| trace._nextFill = null; | ||
|
|
||
| var fillData = []; | ||
| if(trace._ownfill) fillData.push('_ownFill'); | ||
| if(trace._nexttrace) fillData.push('_nextFill'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're making _ownFill and _nextFill null, the if checks will always fail. So, let's delete them.
| // Clear any existing fill element references to ensure clean state | |
| // This prevents stale references when fill configuration changes | |
| trace._ownFill = null; | |
| trace._nextFill = null; | |
| var fillData = []; | |
| if(trace._ownfill) fillData.push('_ownFill'); | |
| if(trace._nexttrace) fillData.push('_nextFill'); | |
| // Clear any existing fill element references to ensure clean state | |
| // This prevents stale references when fill configuration changes | |
| trace._ownFill = null; | |
| trace._nextFill = null; | |
| var fillData = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@camdecoster Tragically, _ownFill and _ownfill, as well as _nextFill and _nexttrace, are separate variables. 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough. I have words about this, but I won't include them here publicly.
bcd7e49 to
44bc554
Compare
|
Thank you @emilykl for the fix. |
…ide/show operations in legend
44bc554 to
ebbbe38
Compare
|
@camdecoster I feel more confident about this fix now. After reviewing the code, I'm satisfied that I think that lines 94-96 in the "before" code were intended to reset these to null as part of the D3 |
Closes #7660
Fixes issue where some traces in stacked area charts were not rendering their fill correctly after certain sequences of hide/show operations in the legend.
Steps to test
Reproduce existing issue
Confirm that this PR fixes the issue
srcwith the build for this branch from the CI: https://output.circle-artifacts.com/output/job/c4caeb45-0a0b-4e23-97b6-ebb26b8561c8/artifacts/0/dist/plotly.js