Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
a5d7645d
E
echarts
项目概览
alon@wen
/
echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a5d7645d
编写于
11月 10, 2020
作者:
Y
Yi Shen
提交者:
GitHub
11月 10, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13587 from apache/fix-tree-remove-animation
fix(tree): make same animation config in update and remove.
上级
8d5ea087
ccb01662
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
22 deletion
+43
-22
src/chart/tree/TreeView.ts
src/chart/tree/TreeView.ts
+22
-7
src/util/graphic.ts
src/util/graphic.ts
+21
-15
未找到文件。
src/chart/tree/TreeView.ts
浏览文件 @
a5d7645d
...
...
@@ -613,12 +613,21 @@ function removeNode(
source
=
source
.
parentNode
===
virtualRoot
?
source
:
source
.
parentNode
||
source
;
}
// Use same duration and easing with update to have more consistent animation.
const
removeAnimationOpt
=
{
duration
:
seriesModel
.
get
(
'
animationDurationUpdate
'
)
as
number
,
easing
:
seriesModel
.
get
(
'
animationEasingUpdate
'
)
};
graphic
.
removeElement
(
symbolEl
,
{
x
:
sourceLayout
.
x
+
1
,
y
:
sourceLayout
.
y
+
1
},
seriesModel
,
function
()
{
group
.
remove
(
symbolEl
);
data
.
setItemGraphicEl
(
dataIndex
,
null
);
},
seriesModel
,
{
cb
()
{
group
.
remove
(
symbolEl
);
data
.
setItemGraphicEl
(
dataIndex
,
null
);
},
removeOpt
:
removeAnimationOpt
});
symbolEl
.
fadeOut
(
null
,
{
keepLabel
:
true
});
...
...
@@ -651,8 +660,11 @@ function removeNode(
style
:
{
opacity
:
0
}
},
seriesModel
,
function
()
{
group
.
remove
(
edge
);
},
seriesModel
,
{
cb
()
{
group
.
remove
(
edge
);
},
removeOpt
:
removeAnimationOpt
});
}
else
if
(
edgeShape
===
'
polyline
'
&&
seriesModel
.
get
(
'
layout
'
)
===
'
orthogonal
'
)
{
...
...
@@ -664,8 +676,11 @@ function removeNode(
style
:
{
opacity
:
0
}
},
seriesModel
,
function
()
{
group
.
remove
(
edge
);
},
seriesModel
,
{
cb
()
{
group
.
remove
(
edge
);
},
removeOpt
:
removeAnimationOpt
});
}
}
...
...
src/util/graphic.ts
浏览文件 @
a5d7645d
...
...
@@ -52,14 +52,16 @@ import {
AnimationDelayCallbackParam
,
ZRRectLike
,
ZRStyleProps
,
PayloadAnimationPart
PayloadAnimationPart
,
AnimationOption
}
from
'
./types
'
;
import
{
extend
,
isArrayLike
,
map
,
defaults
,
isObject
isObject
,
retrieve2
}
from
'
zrender/src/core/util
'
;
import
{
AnimationEasing
}
from
'
zrender/src/animation/easing
'
;
import
{
getECData
}
from
'
./innerStore
'
;
...
...
@@ -292,6 +294,7 @@ type AnimateOrSetPropsOption = {
dataIndex
?:
number
;
cb
?:
()
=>
void
;
during
?:
(
percent
:
number
)
=>
void
;
removeOpt
?:
AnimationOption
isFrom
?:
boolean
;
};
...
...
@@ -307,6 +310,7 @@ function animateOrSetProps<Props>(
during
?:
AnimateOrSetPropsOption
[
'
during
'
]
)
{
let
isFrom
=
false
;
let
removeOpt
:
AnimationOption
;
if
(
typeof
dataIndex
===
'
function
'
)
{
during
=
cb
;
cb
=
dataIndex
;
...
...
@@ -316,6 +320,7 @@ function animateOrSetProps<Props>(
cb
=
dataIndex
.
cb
;
during
=
dataIndex
.
during
;
isFrom
=
dataIndex
.
isFrom
;
removeOpt
=
dataIndex
.
removeOpt
;
dataIndex
=
dataIndex
.
dataIndex
;
}
const
isUpdate
=
animationType
===
'
update
'
;
...
...
@@ -346,8 +351,9 @@ function animateOrSetProps<Props>(
animationDelay
=
animationPayload
.
delay
||
0
;
}
else
if
(
isRemove
)
{
duration
=
200
;
animationEasing
=
'
cubicOut
'
;
removeOpt
=
removeOpt
||
{};
duration
=
retrieve2
(
removeOpt
.
duration
,
200
);
animationEasing
=
retrieve2
(
removeOpt
.
easing
,
'
cubicOut
'
);
animationDelay
=
0
;
}
else
{
...
...
@@ -360,17 +366,17 @@ function animateOrSetProps<Props>(
animationDelay
=
animatableModel
.
getShallow
(
isUpdate
?
'
animationDelayUpdate
'
:
'
animationDelay
'
);
if
(
typeof
animationDelay
===
'
function
'
)
{
animationDelay
=
animationDelay
(
dataIndex
as
number
,
animatableModel
.
getAnimationDelayParams
?
animatableModel
.
getAnimationDelayParams
(
el
,
dataIndex
as
number
)
:
null
);
}
if
(
typeof
duration
===
'
function
'
)
{
duration
=
duration
(
dataIndex
as
number
);
}
}
if
(
typeof
animationDelay
===
'
function
'
)
{
animationDelay
=
animationDelay
(
dataIndex
as
number
,
animatableModel
.
getAnimationDelayParams
?
animatableModel
.
getAnimationDelayParams
(
el
,
dataIndex
as
number
)
:
null
);
}
if
(
typeof
duration
===
'
function
'
)
{
duration
=
duration
(
dataIndex
as
number
);
}
duration
>
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录