Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
0c2d8486
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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,发现更多精彩内容 >>
提交
0c2d8486
编写于
11月 18, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak
上级
0f99c5eb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
54 deletion
+45
-54
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+11
-12
src/chart/helper/Symbol.js
src/chart/helper/Symbol.js
+2
-0
src/chart/line/LineView.js
src/chart/line/LineView.js
+29
-40
src/data/List.js
src/data/List.js
+3
-2
未找到文件。
src/chart/bar/BarView.js
浏览文件 @
0c2d8486
...
...
@@ -55,9 +55,9 @@ define(function (require) {
var
animateTarget
=
{};
rectShape
[
animateProperty
]
=
0
;
animateTarget
[
animateProperty
]
=
layout
[
animateProperty
];
rect
.
animateTo
(
{
api
.
initGraphicEl
(
rect
,
{
shape
:
animateTarget
}
,
1000
,
300
*
dataIndex
/
data
.
count
(),
'
cubicOut
'
);
});
}
})
.
update
(
function
(
newIndex
,
oldIndex
)
{
...
...
@@ -78,15 +78,15 @@ define(function (require) {
group
.
add
(
rect
);
})
.
remove
(
function
(
idx
)
{
var
el
=
oldData
.
getItemGraphicEl
(
idx
);
el
.
style
.
text
=
''
;
el
.
animateTo
({
var
rect
=
oldData
.
getItemGraphicEl
(
idx
);
// Not show text when animating
rect
.
style
.
text
=
''
;
api
.
updateGraphicEl
(
rect
,
{
shape
:
{
width
:
0
}
},
300
,
'
cubicOut
'
,
function
()
{
group
.
remove
(
el
);
},
function
()
{
group
.
remove
(
rect
);
});
})
.
execute
();
...
...
@@ -150,19 +150,18 @@ define(function (require) {
});
},
remove
:
function
(
ecModel
)
{
remove
:
function
(
ecModel
,
api
)
{
var
group
=
this
.
group
;
if
(
ecModel
.
get
(
'
animation
'
))
{
if
(
this
.
_data
)
{
this
.
_data
.
eachItemGraphicEl
(
function
(
el
)
{
// Not show text when animating
el
.
style
.
text
=
''
;
el
.
animateTo
(
{
api
.
updateGraphicEl
(
el
,
{
shape
:
{
width
:
0
}
},
300
,
'
cubicOut
'
,
function
()
{
},
function
()
{
group
.
remove
(
el
);
});
});
...
...
src/chart/helper/Symbol.js
浏览文件 @
0c2d8486
...
...
@@ -120,6 +120,8 @@ define(function (require) {
symbolProto
.
fadeOut
=
function
(
cb
,
api
)
{
var
symbolPath
=
this
.
childAt
(
0
);
// Not show text when animating
symbolPath
.
style
.
text
=
''
;
api
.
updateGraphicEl
(
symbolPath
,
{
scale
:
[
0
,
0
]
},
cb
);
...
...
src/chart/line/LineView.js
浏览文件 @
0c2d8486
...
...
@@ -83,9 +83,14 @@ define(function(require) {
type
:
'
line
'
,
init
:
function
()
{
var
lineGroup
=
new
graphic
.
Group
();
var
symbolDraw
=
new
SymbolDraw
();
this
.
group
.
add
(
symbolDraw
.
group
);
this
.
group
.
add
(
lineGroup
);
this
.
_symbolDraw
=
symbolDraw
;
this
.
_lineGroup
=
lineGroup
;
},
render
:
function
(
seriesModel
,
ecModel
,
api
)
{
...
...
@@ -104,12 +109,13 @@ define(function(require) {
var
polyline
=
this
.
_polyline
;
var
polygon
=
this
.
_polygon
;
var
lineGroup
=
this
.
_lineGroup
;
var
hasAnimation
=
ecModel
.
get
(
'
animation
'
);
var
isAreaChart
=
!
areaStyleModel
.
isEmpty
();
var
stackedOnPoints
=
getStackedOnPoints
(
coordSys
,
data
);
var
isSymbolIgnore
=
!
isCoordSysPolar
&&
!
seriesModel
.
get
(
'
showAllSymbol
'
)
&&
this
.
_getSymbolIgnoreFunc
(
data
,
coordSys
);
...
...
@@ -127,16 +133,15 @@ define(function(require) {
coordSys
,
hasAnimation
);
}
lineGroup
.
setClipPath
(
this
.
_createClipShape
(
coordSys
,
true
,
api
)
);
}
else
{
// Update clipPath
// FIXME Clip path used by more than one elements
if
(
hasAnimation
)
{
polyline
.
setClipPath
(
this
.
_createClipShape
(
coordSys
)
);
polygon
&&
polygon
.
setClipPath
(
this
.
_createClipShape
(
coordSys
)
lineGroup
.
setClipPath
(
this
.
_createClipShape
(
coordSys
,
false
,
api
)
);
}
...
...
@@ -163,8 +168,7 @@ define(function(require) {
}
}
// Add back
group
.
add
(
polyline
);
group
.
add
(
polygon
);
group
.
add
(
lineGroup
);
}
polyline
.
setStyle
(
zrUtil
.
defaults
(
...
...
@@ -213,11 +217,9 @@ define(function(require) {
/**
* @param {module:zrender/container/Group} group
* @param {Array.<Array.<number>>} points
* @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys
* @param {boolean} hasAnimation
* @private
*/
_newPolyline
:
function
(
group
,
points
,
coordSys
,
hasAnimation
)
{
_newPolyline
:
function
(
group
,
points
)
{
var
polyline
=
this
.
_polyline
;
// Remove previous created polyline
if
(
polyline
)
{
...
...
@@ -232,12 +234,7 @@ define(function(require) {
z2
:
10
});
if
(
hasAnimation
)
{
var
clipPath
=
this
.
_createClipShape
(
coordSys
,
true
);
polyline
.
setClipPath
(
clipPath
);
}
group
.
add
(
polyline
);
this
.
_lineGroup
.
add
(
polyline
);
this
.
_polyline
=
polyline
;
...
...
@@ -248,11 +245,9 @@ define(function(require) {
* @param {module:zrender/container/Group} group
* @param {Array.<Array.<number>>} stackedOnPoints
* @param {Array.<Array.<number>>} points
* @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys
* @param {boolean} hasAnimation
* @private
*/
_newPolygon
:
function
(
group
,
points
,
stackedOnPoints
,
coordSys
,
hasAnimation
)
{
_newPolygon
:
function
(
group
,
points
,
stackedOnPoints
)
{
var
polygon
=
this
.
_polygon
;
// Remove previous created polygon
if
(
polygon
)
{
...
...
@@ -267,12 +262,7 @@ define(function(require) {
silent
:
true
});
if
(
hasAnimation
)
{
var
clipPath
=
this
.
_createClipShape
(
coordSys
,
true
);
polygon
.
setClipPath
(
clipPath
);
}
group
.
add
(
polygon
);
this
.
_lineGroup
.
add
(
polygon
);
this
.
_polygon
=
polygon
;
return
polygon
;
...
...
@@ -358,13 +348,13 @@ define(function(require) {
}
},
_createClipShape
:
function
(
coordSys
,
hasAnimation
)
{
_createClipShape
:
function
(
coordSys
,
hasAnimation
,
api
)
{
return
coordSys
.
type
===
'
polar
'
?
this
.
_createPolarClipShape
(
coordSys
,
hasAnimation
)
:
this
.
_createGridClipShape
(
coordSys
,
hasAnimation
);
?
this
.
_createPolarClipShape
(
coordSys
,
hasAnimation
,
api
)
:
this
.
_createGridClipShape
(
coordSys
,
hasAnimation
,
api
);
},
_createGridClipShape
:
function
(
cartesian
,
animation
)
{
_createGridClipShape
:
function
(
cartesian
,
hasAnimation
,
api
)
{
var
xExtent
=
getAxisExtentWithGap
(
cartesian
.
getAxis
(
'
x
'
));
var
yExtent
=
getAxisExtentWithGap
(
cartesian
.
getAxis
(
'
y
'
));
...
...
@@ -377,20 +367,20 @@ define(function(require) {
}
});
if
(
a
nimation
)
{
if
(
hasA
nimation
)
{
clipPath
.
shape
[
cartesian
.
getBaseAxis
().
isHorizontal
()
?
'
width
'
:
'
height
'
]
=
0
;
clipPath
.
animateTo
(
{
api
.
initGraphicEl
(
clipPath
,
{
shape
:
{
width
:
xExtent
[
1
]
-
xExtent
[
0
],
height
:
yExtent
[
1
]
-
yExtent
[
0
]
}
}
,
1000
);
});
}
return
clipPath
;
},
_createPolarClipShape
:
function
(
polar
,
animation
)
{
_createPolarClipShape
:
function
(
polar
,
hasAnimation
,
api
)
{
var
angleAxis
=
polar
.
getAngleAxis
();
var
radiusAxis
=
polar
.
getRadiusAxis
();
...
...
@@ -411,13 +401,13 @@ define(function(require) {
}
});
if
(
a
nimation
)
{
if
(
hasA
nimation
)
{
clipPath
.
shape
.
endAngle
=
-
angleExtent
[
0
]
*
RADIAN
;
clipPath
.
animateTo
(
{
api
.
initGraphicEl
(
clipPath
,
{
shape
:
{
endAngle
:
-
angleExtent
[
1
]
*
RADIAN
}
}
,
1500
,
animation
);
});
}
return
clipPath
;
...
...
@@ -425,8 +415,7 @@ define(function(require) {
remove
:
function
(
ecModel
,
api
)
{
var
group
=
this
.
group
;
group
.
remove
(
this
.
_polyline
);
group
.
remove
(
this
.
_polygon
);
group
.
remove
(
this
.
_lineGroup
);
this
.
_symbolDraw
.
remove
(
api
,
true
);
}
});
...
...
src/data/List.js
浏览文件 @
0c2d8486
...
...
@@ -374,7 +374,9 @@ define(function (require) {
*/
listProto
.
getDataExtent
=
function
(
dim
,
stack
)
{
var
dimData
=
this
.
_storage
[
dim
];
var
dimExtent
=
(
this
.
_extent
||
(
this
.
_extent
=
{}))[
dim
+
stack
];
var
dimInfo
=
this
.
getDimensionInfo
(
dim
);
stack
=
(
dimInfo
&&
dimInfo
.
stackable
)
&&
stack
;
var
dimExtent
=
(
this
.
_extent
||
(
this
.
_extent
=
{}))[
dim
+
(
!!
stack
)];
var
value
;
if
(
dimExtent
)
{
return
dimExtent
;
...
...
@@ -569,7 +571,6 @@ define(function (require) {
for
(
var
i
=
0
;
i
<
indices
.
length
;
i
++
)
{
if
(
dimSize
===
0
)
{
// FIXME Pass value as parameter ?
cb
.
call
(
context
,
i
);
}
// Simple optimization
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录