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(treemap): label.show=false will throw error #15141
Conversation
Thanks for your contribution! The pull request is marked to be |
src/chart/treemap/TreemapView.ts
Outdated
@@ -979,6 +979,9 @@ function renderNode( | |||
} | |||
); | |||
|
|||
if (!isShow) { |
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.
textEl is also needed when label is set emphasis.show = true
. Perhaps we can check if textEl
is null in the next line instead of check if show on normal state.
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.
Right, I missed that.
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.
@pissang The reason is in labelStyle
, a text element needs to be create should consider all four state, but in treemap
, it only consider normal
state.
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.
@susiwen8 Year we need to check all four states. But it has been done in setLabelStyle
. text element will be created if any state is set show: true
. So I think we only need to check if rectEl.getTextContent()
exists.
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.
@pissang Thx, You are right.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
If treemap label is set to not show, then just return it
Fixed issues
Close #15140 15140
Details
Before: What was the problem?
After: How is it fixed in this PR?
Misc
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information