Skip to content
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(tree): fix tree unexpected expand #16548

Merged
merged 3 commits into from
Jun 7, 2022

Conversation

linghaoSu
Copy link
Contributor

@linghaoSu linghaoSu commented Feb 20, 2022

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

fix tree unexpected expand

Fixed issues

Details

Before: What was the problem?

when edgeShape is 'curve', the edge is grow from the current node to the parent node. and then when edgeShape is polyline, the edge is grow from the current node to the all children node.
so, when edgeShape is 'curve' and the node is collapsed, all children nodes will be removed, and the edge in these nodes will be removed too.
but when the edgeShape is 'polyline' and the node is collapsed, all children nodes will be removed, but the edge in the node still exists.

After: How is it fixed in this PR?

so we should filter the node that is collapsed when the edgeShape is polyline.

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

test/tree-polyline.html

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

@echarts-bot
Copy link

echarts-bot bot commented Feb 20, 2022

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

src/chart/tree/TreeView.ts Outdated Show resolved Hide resolved
@plainheart
Copy link
Member

ping @pissang It seems this bug has existed for a long time and many developers have raised similar issues. It would be better if we push forward with this fix.

@plainheart plainheart added this to the 5.3.3 milestone Jun 7, 2022
@pissang pissang merged commit 3ece5c0 into apache:master Jun 7, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jun 7, 2022

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

jiawulin001 pushed a commit to jiawulin001/echarts that referenced this pull request Jun 13, 2022
* fix(tree): fix tree unexpected expand

* [fix] remove redunant format code

* style: tweak code to be more clear

Co-authored-by: pissang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment