-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix for tweaking visible attribute of treemap pathbar #4516
Conversation
- add test to show/hide pathbar using react
src/traces/treemap/plot.js
Outdated
@@ -103,6 +103,10 @@ function plotOne(gd, cd, element, transitionOpts) { | |||
return; | |||
} | |||
|
|||
if(!trace.pathbar.visible) { | |||
selAncestors.remove(); | |||
} |
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.
It's probably cleaner to move this below from
plotly.js/src/traces/treemap/plot.js
Lines 615 to 634 in 326cb04
if(trace.pathbar.visible) { | |
drawAncestors(gd, cd, entry, selAncestors, { | |
barDifY: barDifY, | |
width: barW, | |
height: barH, | |
viewX: viewBarX, | |
viewY: viewBarY, | |
pathSlice: pathAncestor, | |
toMoveInsideSlice: toMoveInsideSlice, | |
makeUpdateSliceInterpolator: makeUpdateSliceInterpolator, | |
makeUpdateTextInterpolator: makeUpdateTextInterpolator, | |
handleSlicesExit: handleSlicesExit, | |
hasTransition: hasTransition, | |
strTransform: strTransform | |
}); | |
} |
as
if(trace.pathbar.visible) {
// ...
} else {
selAncestors.remove();
}
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.
Good call. Done in 838d1c3.
💃 - thanks! |
Fixes #4515
@nicolaskruchten
@alexcjohnson
cc: @plotly/plotly_js