linghaoSu commented on code in PR #18491:
URL: https://github.com/apache/echarts/pull/18491#discussion_r1241227139
##########
src/chart/tree/TreeView.ts:
##########
@@ -603,28 +603,46 @@ function removeNodeEdge(
data: SeriesData,
group: graphic.Group,
seriesModel: TreeSeriesModel,
- removeAnimationOpt: AnimationOption
+ removeAnimationOpt: AnimationOption,
+ currentSymbol?: TreeSymbol,
+ sourceSymbol?: TreeSymbol
) {
const virtualRoot = data.tree.root;
const { source, sourceLayout } = getSourceNode(virtualRoot, node);
- const symbolEl: TreeSymbol = data.getItemGraphicEl(node.dataIndex) as
TreeSymbol;
+ // use the current symbol when the node is delete immediately
+ const symbolEl: TreeSymbol = data.getItemGraphicEl(node.dataIndex) as
TreeSymbol ?? currentSymbol;
if (!symbolEl) {
return;
}
- const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex) as
TreeSymbol;
- const sourceEdge = sourceSymbolEl.__edge;
+ // use the source symbol when the node is delete immediately
+ const sourceSymbolEl = data.getItemGraphicEl(source.dataIndex) as
TreeSymbol ?? sourceSymbol;
+ const sourceEdge = sourceSymbolEl?.__edge;
+
+
+ const symbolChildren = source.children.map(
+ item => data.getItemGraphicEl(item.dataIndex)
+ ).filter(item => !!item);
+ const notLeaveChildren = symbolChildren.filter(
+ item => !item?.animators?.length || item?.animators?.find(animator =>
animator.scope !== 'leave')
Review Comment:
fixed, use animationModel to check animation state
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]