Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
84df0036
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,发现更多精彩内容 >>
提交
84df0036
编写于
5月 16, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
8dbebc9a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
64 deletion
+55
-64
src/chart/island.js
src/chart/island.js
+0
-8
src/component/base.js
src/component/base.js
+1
-3
src/component/dataZoom.js
src/component/dataZoom.js
+0
-1
src/component/toolbox.js
src/component/toolbox.js
+43
-38
src/echarts.js
src/echarts.js
+11
-14
未找到文件。
src/chart/island.js
浏览文件 @
84df0036
...
...
@@ -111,14 +111,6 @@ define(function (require) {
}
},
render
:
function
(
newOption
)
{
this
.
refresh
(
newOption
);
for
(
var
i
=
0
,
l
=
this
.
shapeList
.
length
;
i
<
l
;
i
++
)
{
this
.
zr
.
addShape
(
this
.
shapeList
[
i
]);
}
},
getOption
:
function
()
{
return
this
.
option
;
},
...
...
src/component/base.js
浏览文件 @
84df0036
...
...
@@ -1218,9 +1218,7 @@ define(function (require) {
*/
clear
:
function
()
{
this
.
clearAnimationShape
();
if
(
this
.
zr
)
{
this
.
zr
.
delShape
(
this
.
shapeList
);
}
this
.
zr
&&
this
.
zr
.
delShape
(
this
.
shapeList
);
this
.
shapeList
=
[];
},
...
...
src/component/dataZoom.js
浏览文件 @
84df0036
...
...
@@ -896,7 +896,6 @@ define(function (require) {
this
.
_zoom
.
start2
=
param
.
start2
;
//this.zoomOption.end2 =
this
.
_zoom
.
end2
=
param
.
end2
;
console
.
log
(
this
.
_zoom
,
1111
)
this
.
_syncShape
();
this
.
_syncData
(
true
);
return
;
...
...
src/component/toolbox.js
浏览文件 @
84df0036
...
...
@@ -54,6 +54,7 @@ define(function (require) {
// this._zoomShape;
// this._zoomQueue;
// this._dataView;
this
.
_markShapeList
=
[];
var
self
=
this
;
self
.
_onmousemove
=
function
(
param
)
{
if
(
self
.
_marking
)
{
...
...
@@ -138,7 +139,7 @@ define(function (require) {
}
if
(
self
.
_marking
)
{
self
.
_marking
=
false
;
self
.
s
hapeList
.
push
(
self
.
_markShape
);
self
.
_markS
hapeList
.
push
(
self
.
_markShape
);
self
.
_iconEnable
(
self
.
_iconShapeMap
[
'
markUndo
'
]);
self
.
_iconEnable
(
self
.
_iconShapeMap
[
'
markClear
'
]);
self
.
zr
.
addShape
(
self
.
_markShape
);
...
...
@@ -580,16 +581,16 @@ define(function (require) {
if
(
this
.
_marking
)
{
this
.
_marking
=
false
;
}
else
{
var
len
=
this
.
shapeList
.
length
-
1
;
// 有一个是背景shape
if
(
this
.
_iconList
.
length
==
len
-
1
)
{
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markUndo
'
]);
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markClear
'
]);
}
if
(
this
.
_iconList
.
length
<
len
)
{
var
target
=
this
.
shapeList
[
this
.
shapeList
.
length
-
1
];
var
len
=
this
.
_markShapeList
.
length
;
if
(
len
>=
1
)
{
var
target
=
this
.
_markShapeList
[
len
-
1
];
this
.
zr
.
delShape
(
target
.
id
);
this
.
zr
.
refresh
();
this
.
shapeList
.
pop
();
this
.
_markShapeList
.
pop
();
if
(
len
==
1
)
{
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markUndo
'
]);
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markClear
'
]);
}
}
}
return
true
;
...
...
@@ -599,14 +600,11 @@ define(function (require) {
if
(
this
.
_marking
)
{
this
.
_marking
=
false
;
}
// 有一个是背景shape
var
len
=
this
.
shapeList
.
length
-
this
.
_iconList
.
length
-
1
;
var
hasClear
=
false
;
while
(
len
--
)
{
this
.
zr
.
delShape
(
this
.
shapeList
.
pop
().
id
);
hasClear
=
true
;
}
if
(
hasClear
)
{
var
len
=
this
.
_markShapeList
.
length
;
if
(
len
>
0
)
{
while
(
len
--
)
{
this
.
zr
.
delShape
(
this
.
_markShapeList
.
pop
().
id
);
}
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markUndo
'
]);
this
.
_iconDisable
(
this
.
_iconShapeMap
[
'
markClear
'
]);
this
.
zr
.
refresh
();
...
...
@@ -870,7 +868,9 @@ define(function (require) {
},
// 重置备份还原状态等
reset
:
function
(
newOption
)
{
reset
:
function
(
newOption
,
needClear
)
{
needClear
&&
this
.
clear
();
if
(
this
.
query
(
newOption
,
'
toolbox.show
'
)
&&
this
.
query
(
newOption
,
'
toolbox.feature.magicType.show
'
)
)
{
...
...
@@ -998,25 +998,6 @@ define(function (require) {
this
.
_isSilence
=
s
;
},
render
:
function
(
newOption
){
this
.
_resetMark
();
this
.
_resetZoom
();
newOption
.
toolbox
=
this
.
reformOption
(
newOption
.
toolbox
);
// 补全padding属性
newOption
.
toolbox
.
padding
=
this
.
reformCssArray
(
newOption
.
toolbox
.
padding
);
this
.
option
=
newOption
||
this
.
option
;
this
.
clear
();
if
(
newOption
.
toolbox
.
show
)
{
this
.
_buildShape
();
}
this
.
hideDataView
();
},
resize
:
function
()
{
this
.
_resetMark
();
this
.
clear
();
...
...
@@ -1033,7 +1014,19 @@ define(function (require) {
this
.
_dataView
.
hide
();
}
},
clear
:
function
(
notMark
)
{
if
(
this
.
zr
)
{
this
.
zr
.
delShape
(
this
.
shapeList
);
this
.
shapeList
=
[];
if
(
!
notMark
)
{
this
.
zr
.
delShape
(
this
.
_markShapeList
);
this
.
_markShapeList
=
[];
}
}
},
/**
* 释放后实例不可用
*/
...
...
@@ -1044,6 +1037,7 @@ define(function (require) {
}
this
.
clear
();
this
.
shapeList
=
null
;
this
.
_markShapeList
=
null
;
},
/**
...
...
@@ -1051,12 +1045,23 @@ define(function (require) {
*/
refresh
:
function
(
newOption
)
{
if
(
newOption
)
{
this
.
_resetMark
();
this
.
_resetZoom
();
newOption
.
toolbox
=
this
.
reformOption
(
newOption
.
toolbox
);
// 补全padding属性
newOption
.
toolbox
.
padding
=
this
.
reformCssArray
(
newOption
.
toolbox
.
padding
);
this
.
option
=
newOption
;
this
.
clear
(
true
);
if
(
newOption
.
toolbox
.
show
)
{
this
.
_buildShape
();
}
this
.
hideDataView
();
}
}
};
...
...
src/echarts.js
浏览文件 @
84df0036
...
...
@@ -680,16 +680,12 @@ define(function (require) {
}
}
this
.
_island
.
render
(
magicOption
);
this
.
_toolbox
.
render
(
magicOption
);
this
.
_island
.
refresh
(
magicOption
);
this
.
_toolbox
.
refresh
(
magicOption
);
if
(
magicOption
.
animation
&&
!
magicOption
.
renderAsImage
)
{
this
.
_zr
.
refresh
();
}
else
{
this
.
_zr
.
render
();
}
magicOption
.
animation
&&
!
magicOption
.
renderAsImage
?
this
.
_zr
.
refresh
()
:
this
.
_zr
.
render
()
var
imgId
=
'
IMG
'
+
this
.
id
;
var
img
=
document
.
getElementById
(
imgId
);
...
...
@@ -727,8 +723,9 @@ define(function (require) {
*/
restore
:
function
()
{
this
.
_option
=
zrUtil
.
clone
(
this
.
_optionRestore
);
this
.
_disposeChartList
();
this
.
_island
.
clear
();
this
.
_toolbox
.
reset
(
this
.
_option
);
this
.
_toolbox
.
reset
(
this
.
_option
,
true
);
this
.
_render
(
this
.
_option
);
},
...
...
@@ -748,10 +745,12 @@ define(function (require) {
magicOption
=
this
.
getOption
();
zrUtil
.
merge
(
magicOption
,
param
.
option
,
true
);
zrUtil
.
merge
(
this
.
_optionRestore
,
param
.
option
,
true
);
this
.
_island
.
refresh
(
magicOption
);
this
.
_toolbox
.
refresh
(
magicOption
);
this
.
_toolbox
.
reset
(
magicOption
);
}
this
.
_island
.
refresh
(
magicOption
);
this
.
_toolbox
.
refresh
(
magicOption
);
// 停止动画
this
.
_zr
.
clearAnimation
();
// 先来后到,安顺序刷新各种图表,图表内部refresh优化检查magicOption,无需更新则不更新~
...
...
@@ -1084,8 +1083,6 @@ define(function (require) {
}
// dataZoom同步数据
this
.
component
.
dataZoom
&&
this
.
component
.
dataZoom
.
syncOption
(
magicOption
);
this
.
_island
.
refresh
(
magicOption
);
this
.
_toolbox
.
refresh
(
magicOption
);
this
.
_option
=
magicOption
;
var
self
=
this
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录