Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
b02066d0
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b02066d0
编写于
7月 14, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'next' into state
上级
9b4cb83f
3769757b
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
109 addition
and
38 deletion
+109
-38
src/chart/line/LineView.ts
src/chart/line/LineView.ts
+6
-0
src/chart/parallel/ParallelView.ts
src/chart/parallel/ParallelView.ts
+3
-5
src/component/axis/ParallelAxisView.ts
src/component/axis/ParallelAxisView.ts
+1
-2
src/component/axis/parallelAxisAction.ts
src/component/axis/parallelAxisAction.ts
+0
-2
src/component/dataZoom/SliderZoomView.ts
src/component/dataZoom/SliderZoomView.ts
+4
-0
src/component/dataZoom/roams.ts
src/component/dataZoom/roams.ts
+4
-0
src/component/parallel.ts
src/component/parallel.ts
+3
-1
src/echarts.ts
src/echarts.ts
+17
-1
src/model/Global.ts
src/model/Global.ts
+13
-0
src/util/graphic.ts
src/util/graphic.ts
+50
-27
src/util/types.ts
src/util/types.ts
+8
-0
未找到文件。
src/chart/line/LineView.ts
浏览文件 @
b02066d0
...
...
@@ -810,6 +810,7 @@ class LineView extends ChartView {
if
(
polygon
)
{
polygon
.
setShape
({
// Reuse the points with polyline.
points
:
current
,
stackedOnPoints
:
stackedOnCurrent
});
...
...
@@ -819,7 +820,12 @@ class LineView extends ChartView {
stackedOnPoints
:
stackedOnNext
}
},
seriesModel
);
// If use attr directly in updateProps.
if
(
polyline
.
shape
.
points
!==
polygon
.
shape
.
points
)
{
polygon
.
shape
.
points
=
polyline
.
shape
.
points
;
}
}
const
updatedDataInfo
:
{
el
:
SymbolExtended
,
...
...
src/chart/parallel/ParallelView.ts
浏览文件 @
b02066d0
...
...
@@ -54,9 +54,7 @@ class ParallelView extends ChartView {
seriesModel
:
ParallelSeriesModel
,
ecModel
:
GlobalModel
,
api
:
ExtensionAPI
,
payload
:
Payload
&
{
animation
?:
boolean
}
payload
:
Payload
)
{
const
dataGroup
=
this
.
_dataGroup
;
const
data
=
seriesModel
.
getData
();
...
...
@@ -81,8 +79,8 @@ class ParallelView extends ChartView {
const
points
=
createLinePoints
(
data
,
newDataIndex
,
dimensions
,
coordSys
);
data
.
setItemGraphicEl
(
newDataIndex
,
line
);
const
animationModel
=
(
payload
&&
payload
.
animation
===
false
)
?
null
:
seriesModel
;
graphic
.
updateProps
(
line
,
{
shape
:
{
points
:
points
}},
animation
Model
,
newDataIndex
);
graphic
.
updateProps
(
line
,
{
shape
:
{
points
:
points
}},
series
Model
,
newDataIndex
);
updateElCommon
(
line
,
data
,
newDataIndex
,
seriesScope
);
}
...
...
src/component/axis/ParallelAxisView.ts
浏览文件 @
b02066d0
...
...
@@ -103,8 +103,7 @@ class ParallelAxisView extends ComponentView {
builderOpt
,
areaSelectStyle
,
axisModel
,
coordSysModel
,
areaWidth
,
api
);
const
animationModel
=
(
payload
&&
payload
.
animation
===
false
)
?
null
:
axisModel
;
graphic
.
groupTransition
(
oldAxisGroup
,
this
.
_axisGroup
,
animationModel
);
graphic
.
groupTransition
(
oldAxisGroup
,
this
.
_axisGroup
,
axisModel
);
}
// /**
...
...
src/component/axis/parallelAxisAction.ts
浏览文件 @
b02066d0
...
...
@@ -46,8 +46,6 @@ echarts.registerAction(actionInfo, function (payload: ParallelAxisAreaSelectPayl
export
interface
ParallelAxisExpandPayload
extends
Payload
{
axisExpandWindow
?:
number
[];
// Jumping uses animation, and sliding suppresses animation.
animation
?:
boolean
;
}
/**
...
...
src/component/dataZoom/SliderZoomView.ts
浏览文件 @
b02066d0
...
...
@@ -752,6 +752,10 @@ class SliderZoomView extends DataZoomView {
type
:
'
dataZoom
'
,
from
:
this
.
uid
,
dataZoomId
:
this
.
dataZoomModel
.
id
,
animation
:
{
easing
:
'
cubicOut
'
,
duration
:
100
},
start
:
range
[
0
],
end
:
range
[
1
]
});
...
...
src/component/dataZoom/roams.ts
浏览文件 @
b02066d0
...
...
@@ -181,6 +181,10 @@ function cleanStore(store: Store) {
function
dispatchAction
(
api
:
ExtensionAPI
,
batch
:
DataZoomPayloadBatchItem
[])
{
api
.
dispatchAction
({
type
:
'
dataZoom
'
,
animation
:
{
easing
:
'
cubicOut
'
,
duration
:
100
},
batch
:
batch
});
}
...
...
src/component/parallel.ts
浏览文件 @
b02066d0
...
...
@@ -157,7 +157,9 @@ const handlers: Partial<Record<ElementEventName, ElementEventHandler>> = {
:
{
axisExpandWindow
:
result
.
axisExpandWindow
,
// Jumping uses animation, and sliding suppresses animation.
animation
:
behavior
===
'
jump
'
?
null
:
false
animation
:
behavior
===
'
jump
'
?
null
:
{
duration
:
0
// Disable animation.
}
}
);
}
...
...
src/echarts.ts
浏览文件 @
b02066d0
...
...
@@ -1017,7 +1017,13 @@ class ECharts extends Eventful {
this
[
IN_MAIN_PROCESS_KEY
]
=
true
;
optionChanged
&&
prepare
(
this
);
updateMethods
.
update
.
call
(
this
);
updateMethods
.
update
.
call
(
this
,
{
type
:
'
resize
'
,
animation
:
{
// Disable animation
duration
:
0
}
});
this
[
IN_MAIN_PROCESS_KEY
]
=
false
;
...
...
@@ -1280,6 +1286,8 @@ class ECharts extends Eventful {
):
void
{
const
ecModel
=
ecIns
.
_model
;
ecModel
.
setUpdatePayload
(
payload
);
// broadcast
if
(
!
mainType
)
{
// FIXME
...
...
@@ -1377,6 +1385,8 @@ class ECharts extends Eventful {
return
;
}
ecModel
.
setUpdatePayload
(
payload
);
scheduler
.
restoreData
(
ecModel
,
payload
);
scheduler
.
performSeriesTasks
(
ecModel
);
...
...
@@ -1442,6 +1452,8 @@ class ECharts extends Eventful {
return
;
}
ecModel
.
setUpdatePayload
(
payload
);
// ChartView.markUpdateMethod(payload, 'updateTransform');
const
componentDirtyList
=
[];
...
...
@@ -1492,6 +1504,8 @@ class ECharts extends Eventful {
return
;
}
ecModel
.
setUpdatePayload
(
payload
);
ChartView
.
markUpdateMethod
(
payload
,
'
updateView
'
);
clearColorPalette
(
ecModel
);
...
...
@@ -1514,6 +1528,8 @@ class ECharts extends Eventful {
return
;
}
ecModel
.
setUpdatePayload
(
payload
);
// clear all visual
ecModel
.
eachSeries
(
function
(
seriesModel
)
{
seriesModel
.
getData
().
clearAllVisual
();
...
...
src/model/Global.ts
浏览文件 @
b02066d0
...
...
@@ -86,6 +86,11 @@ class GlobalModel extends Model<ECUnitOption> {
*/
private
_seriesIndicesMap
:
HashMap
<
any
>
;
/**
* Model for store update payload
*/
private
_payload
:
Payload
;
// Injectable properties:
scheduler
:
Scheduler
;
...
...
@@ -318,6 +323,14 @@ class GlobalModel extends Model<ECUnitOption> {
return
this
.
_theme
;
}
setUpdatePayload
(
payload
:
Payload
)
{
this
.
_payload
=
payload
;
}
getUpdatePayload
():
Payload
{
return
this
.
_payload
;
}
/**
* @param idx 0 by default
*/
...
...
src/util/graphic.ts
浏览文件 @
b02066d0
...
...
@@ -58,7 +58,9 @@ import {
ZRStyleProps
,
ParsedValue
,
BlurScope
,
InnerFocus
}
from
'
./types
'
;
InnerFocus
,
AnimationPayload
}
from
'
./types
'
;
import
{
makeInner
}
from
'
./model
'
;
import
{
extend
,
...
...
@@ -72,6 +74,7 @@ import SeriesModel from '../model/Series';
import
{
interpolateNumber
}
from
'
zrender/src/animation/Animator
'
;
import
List
from
'
../data/List
'
;
import
{
getLabelText
}
from
'
../label/labelStyle
'
;
import
{
AnimationEasing
}
from
'
zrender/src/animation/easing
'
;
const
mathMax
=
Math
.
max
;
...
...
@@ -353,20 +356,39 @@ function animateOrSetProps<Props>(
}
const
isUpdate
=
animationType
===
'
update
'
;
const
isRemove
=
animationType
===
'
remove
'
;
// Do not check 'animation' property directly here. Consider this case:
// animation model is an `itemModel`, whose does not have `isAnimationEnabled`
// but its parent model (`seriesModel`) does.
let
animationPayload
:
AnimationPayload
;
// Check if there is global animation configuration from dataZoom/resize can override the config in option.
// If animation is enabled. Will use this animation config in payload.
// If animation is disabled. Just ignore it.
if
(
animatableModel
&&
animatableModel
.
ecModel
)
{
const
updatePayload
=
animatableModel
.
ecModel
.
getUpdatePayload
();
animationPayload
=
(
updatePayload
&&
updatePayload
.
animation
)
as
AnimationPayload
;
}
const
animationEnabled
=
animatableModel
&&
animatableModel
.
isAnimationEnabled
();
if
(
animationEnabled
)
{
// TODO Configurable
let
duration
=
isRemove
?
200
:
animatableModel
.
getShallow
(
let
duration
:
number
|
Function
;
let
animationEasing
:
AnimationEasing
;
let
animationDelay
:
number
|
Function
;
if
(
animationPayload
)
{
duration
=
animationPayload
.
duration
||
0
;
animationEasing
=
animationPayload
.
easing
||
'
cubicOut
'
;
animationDelay
=
animationPayload
.
delay
||
0
;
}
else
if
(
isRemove
)
{
duration
=
200
;
animationEasing
=
'
cubicOut
'
;
animationDelay
=
0
;
}
else
{
duration
=
animatableModel
.
getShallow
(
isUpdate
?
'
animationDurationUpdate
'
:
'
animationDuration
'
);
const
animationEasing
=
isRemove
?
'
cubicOut
'
:
animatableModel
.
getShallow
(
animationEasing
=
animatableModel
.
getShallow
(
isUpdate
?
'
animationEasingUpdate
'
:
'
animationEasing
'
);
let
animationDelay
=
isRemove
?
0
:
animatableModel
.
getShallow
(
animationDelay
=
animatableModel
.
getShallow
(
isUpdate
?
'
animationDelayUpdate
'
:
'
animationDelay
'
);
if
(
typeof
animationDelay
===
'
function
'
)
{
...
...
@@ -380,6 +402,7 @@ function animateOrSetProps<Props>(
if
(
typeof
duration
===
'
function
'
)
{
duration
=
duration
(
dataIndex
as
number
);
}
}
if
(
!
isRemove
)
{
// Must stop the remove animation.
...
...
@@ -390,8 +413,8 @@ function animateOrSetProps<Props>(
?
(
isFrom
?
el
.
animateFrom
(
props
,
{
duration
,
delay
:
animationDelay
||
0
,
duration
:
duration
as
number
,
delay
:
animationDelay
as
number
||
0
,
easing
:
animationEasing
,
done
:
cb
,
force
:
!!
cb
||
!!
during
,
...
...
@@ -399,8 +422,8 @@ function animateOrSetProps<Props>(
during
:
during
})
:
el
.
animateTo
(
props
,
{
duration
,
delay
:
animationDelay
||
0
,
duration
:
duration
as
number
,
delay
:
animationDelay
as
number
||
0
,
easing
:
animationEasing
,
done
:
cb
,
force
:
!!
cb
||
!!
during
,
...
...
src/util/types.ts
浏览文件 @
b02066d0
...
...
@@ -131,6 +131,7 @@ export interface DataModel extends DataHost, DataFormatMixin {}
interface
PayloadItem
{
excludeSeriesId
?:
string
|
string
[];
animation
?:
AnimationPayload
[
other
:
string
]:
any
;
}
...
...
@@ -140,6 +141,13 @@ export interface Payload extends PayloadItem {
batch
?:
PayloadItem
[];
}
// Payload includes override anmation info
export
interface
AnimationPayload
{
duration
?:
number
easing
?:
AnimationEasing
delay
?:
number
}
export
interface
ViewRootGroup
extends
Group
{
__ecComponentInfo
?:
{
mainType
:
string
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录