Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
445d720b
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,发现更多精彩内容 >>
提交
445d720b
编写于
5月 15, 2014
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
fc0259da
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
108 addition
and
197 deletion
+108
-197
src/chart/bar.js
src/chart/bar.js
+23
-34
src/chart/calculableBase.js
src/chart/calculableBase.js
+2
-2
src/chart/chord.js
src/chart/chord.js
+5
-9
src/chart/force.js
src/chart/force.js
+3
-2
src/chart/island.js
src/chart/island.js
+2
-2
src/chart/k.js
src/chart/k.js
+4
-15
src/chart/line.js
src/chart/line.js
+19
-29
src/chart/map.js
src/chart/map.js
+30
-45
src/chart/pie.js
src/chart/pie.js
+11
-27
src/chart/radar.js
src/chart/radar.js
+4
-16
src/chart/scatter.js
src/chart/scatter.js
+5
-16
未找到文件。
src/chart/bar.js
浏览文件 @
445d720b
...
...
@@ -28,13 +28,13 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Bar
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
Bar
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Bar
.
prototype
=
{
...
...
@@ -122,9 +122,9 @@ define(function (require) {
_mapData
:
function
(
seriesArray
)
{
var
series
=
this
.
series
;
var
serie
;
// 临时映射变量
var
dataIndex
=
0
;
// 堆
叠
数据所在位置映射
var
stackMap
=
{};
// 堆
叠数据位置映射,堆叠
组在二维中的第几项
var
magicStackKey
=
'
__kener__stack__
'
;
// 堆
叠命名,非堆叠数据安单一堆叠
处理
var
dataIndex
=
0
;
// 堆
积
数据所在位置映射
var
stackMap
=
{};
// 堆
积数据位置映射,堆积
组在二维中的第几项
var
magicStackKey
=
'
__kener__stack__
'
;
// 堆
积命名,非堆积数据安单一堆积
处理
var
stackKey
;
// 临时映射变量
var
serieName
;
// 临时映射变量
var
legend
=
this
.
component
.
legend
;
...
...
@@ -228,9 +228,9 @@ define(function (require) {
var
xMarkMap
=
{};
// 为标注记录一些参数
var
x
;
var
y
;
var
lastYP
;
// 正向堆
叠
处理
var
lastYP
;
// 正向堆
积
处理
var
baseYP
;
var
lastYN
;
// 负向堆
叠
处理
var
lastYN
;
// 负向堆
积
处理
var
baseYN
;
var
barShape
;
var
data
;
...
...
@@ -242,7 +242,7 @@ define(function (require) {
}
x
=
categoryAxis
.
getCoordByIndex
(
i
)
-
gap
/
2
;
for
(
var
j
=
0
,
k
=
locationMap
.
length
;
j
<
k
;
j
++
)
{
// 堆
叠
数据用第一条valueAxis
// 堆
积
数据用第一条valueAxis
yAxisIndex
=
series
[
locationMap
[
j
][
0
]].
yAxisIndex
||
0
;
valueAxis
=
this
.
component
.
yAxis
.
getAxis
(
yAxisIndex
);
baseYP
=
lastYP
=
baseYN
=
lastYN
=
valueAxis
.
getCoord
(
0
);
...
...
@@ -269,12 +269,12 @@ define(function (require) {
}
//y = valueAxis.getCoord(value);
if
(
value
>
0
)
{
// 正向堆
叠
// 正向堆
积
//barHeight = baseYP - y;
barHeight
=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
baseYP
-
valueAxis
.
getCoord
(
value
));
// 非堆
叠
数据最小高度有效
// 非堆
积
数据最小高度有效
if
(
n
==
1
&&
barMinHeightMap
[
seriesIndex
]
>
barHeight
)
{
...
...
@@ -284,12 +284,12 @@ define(function (require) {
y
=
lastYP
;
}
else
if
(
value
<
0
){
// 负向堆
叠
// 负向堆
积
//barHeight = y - baseYN;
barHeight
=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
valueAxis
.
getCoord
(
value
)
-
baseYN
);
// 非堆
叠
数据最小高度有效
// 非堆
积
数据最小高度有效
if
(
n
==
1
&&
barMinHeightMap
[
seriesIndex
]
>
barHeight
)
{
...
...
@@ -434,9 +434,9 @@ define(function (require) {
var
xMarkMap
=
{};
// 为标注记录一个横向偏移
var
x
;
var
y
;
var
lastXP
;
// 正向堆
叠
处理
var
lastXP
;
// 正向堆
积
处理
var
baseXP
;
var
lastXN
;
// 负向堆
叠
处理
var
lastXN
;
// 负向堆
积
处理
var
baseXN
;
var
barShape
;
var
data
;
...
...
@@ -448,7 +448,7 @@ define(function (require) {
}
y
=
categoryAxis
.
getCoordByIndex
(
i
)
+
gap
/
2
;
for
(
var
j
=
0
,
k
=
locationMap
.
length
;
j
<
k
;
j
++
)
{
// 堆
叠
数据用第一条valueAxis
// 堆
积
数据用第一条valueAxis
xAxisIndex
=
series
[
locationMap
[
j
][
0
]].
xAxisIndex
||
0
;
valueAxis
=
this
.
component
.
xAxis
.
getAxis
(
xAxisIndex
);
baseXP
=
lastXP
=
baseXN
=
lastXN
=
valueAxis
.
getCoord
(
0
);
...
...
@@ -475,12 +475,12 @@ define(function (require) {
}
//x = valueAxis.getCoord(value);
if
(
value
>
0
)
{
// 正向堆
叠
// 正向堆
积
//barHeight = x - baseXP;
barHeight
=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
valueAxis
.
getCoord
(
value
)
-
baseXP
);
// 非堆
叠
数据最小高度有效
// 非堆
积
数据最小高度有效
if
(
n
==
1
&&
barMinHeightMap
[
seriesIndex
]
>
barHeight
)
{
...
...
@@ -490,12 +490,12 @@ define(function (require) {
lastXP
+=
barHeight
;
}
else
if
(
value
<
0
){
// 负向堆
叠
// 负向堆
积
//barHeight = baseXN - x;
barHeight
=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
baseXN
-
valueAxis
.
getCoord
(
value
));
// 非堆
叠
数据最小高度有效
// 非堆
积
数据最小高度有效
if
(
n
==
1
&&
barMinHeightMap
[
seriesIndex
]
>
barHeight
)
{
...
...
@@ -636,7 +636,7 @@ define(function (require) {
var
interval
=
1
;
for
(
var
j
=
0
,
k
=
locationMap
.
length
;
j
<
k
;
j
++
)
{
hasFound
=
false
;
// 同一堆
叠
第一个barWidth生效
hasFound
=
false
;
// 同一堆
积
第一个barWidth生效
for
(
var
m
=
0
,
n
=
locationMap
[
j
].
length
;
m
<
n
;
m
++
)
{
seriesIndex
=
locationMap
[
j
][
m
];
queryTarget
=
series
[
seriesIndex
];
...
...
@@ -647,12 +647,12 @@ define(function (require) {
'
barWidth
'
);
if
(
typeof
sBarWidth
!=
'
undefined
'
)
{
// 同一堆
叠
第一个生效barWidth
// 同一堆
积
第一个生效barWidth
barWidthMap
[
seriesIndex
]
=
sBarWidth
;
sBarWidthTotal
+=
sBarWidth
;
sBarWidthCounter
++
;
hasFound
=
true
;
// 复位前面同一堆
叠
但没被定义的
// 复位前面同一堆
积
但没被定义的
for
(
var
ii
=
0
,
ll
=
m
;
ii
<
ll
;
ii
++
)
{
var
pSeriesIndex
=
locationMap
[
j
][
ii
];
barWidthMap
[
pSeriesIndex
]
=
sBarWidth
;
...
...
@@ -917,17 +917,6 @@ define(function (require) {
return
pos
;
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
||
this
.
component
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
src/chart/calculableBase.js
浏览文件 @
445d720b
...
...
@@ -317,13 +317,13 @@ define(function (require) {
if
(
newShape
.
_orient
!=
'
vertical
'
)
{
var
y
=
newShape
.
style
.
pointList
[
0
][
1
];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
newPointList
[
i
]
=
[
newShape
.
style
.
pointList
[
i
][
0
],
y
+
i
];
newPointList
[
i
]
=
[
newShape
.
style
.
pointList
[
i
][
0
],
y
];
};
}
else
{
var
x
=
newShape
.
style
.
pointList
[
0
][
0
];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
newPointList
[
i
]
=
[
x
+
i
,
newShape
.
style
.
pointList
[
i
][
1
]];
newPointList
[
i
]
=
[
x
,
newShape
.
style
.
pointList
[
i
][
1
]];
};
}
if
(
newShape
.
type
==
'
half-smooth-polygon
'
)
{
...
...
src/chart/chord.js
浏览文件 @
445d720b
...
...
@@ -25,11 +25,13 @@ define(function (require) {
var
_devicePixelRatio
=
window
.
devicePixelRatio
||
1
;
function
Chord
(
ecTheme
,
messageCenter
,
zr
,
option
,
component
)
{
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
function
Chord
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
)
{
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Chord
.
prototype
=
{
...
...
@@ -636,12 +638,6 @@ define(function (require) {
return
[
result
,
unitPostfix
];
},
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
;
this
.
refresh
(
newOption
);
},
refresh
:
function
(
newOption
)
{
if
(
newOption
)
{
this
.
option
=
newOption
;
...
...
src/chart/force.js
浏览文件 @
445d720b
...
...
@@ -41,12 +41,13 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Force
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
)
{
function
Force
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
)
{
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
var
component
=
myChart
.
component
;
var
legend
;
var
self
=
this
;
self
.
type
=
ecConfig
.
CHART_TYPE_FORCE
;
...
...
src/chart/island.js
浏览文件 @
445d720b
...
...
@@ -23,9 +23,9 @@ define(function (require) {
* @param {ZRender} zr zrender实例
* @param {Object} option 图表选项
*/
function
Island
(
ecTheme
,
messageCenter
,
zr
)
{
function
Island
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
)
{
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
{}
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
{},
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
...
...
src/chart/k.js
浏览文件 @
445d720b
...
...
@@ -27,13 +27,13 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
K
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
K
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
K
.
prototype
=
{
...
...
@@ -437,17 +437,6 @@ define(function (require) {
];
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
||
this
.
component
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
@@ -456,7 +445,7 @@ define(function (require) {
this
.
option
=
newOption
;
this
.
series
=
newOption
.
series
;
}
// this.clear();
this
.
backupShapeList
();
this
.
_buildShape
();
},
...
...
src/chart/line.js
浏览文件 @
445d720b
...
...
@@ -30,13 +30,13 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Line
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
Line
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Line
.
prototype
=
{
...
...
@@ -48,7 +48,7 @@ define(function (require) {
var
series
=
this
.
series
;
this
.
finalPLMap
=
{};
// 完成的point list(PL)
this
.
_sIndex2ColorMap
=
{};
// series默认颜色索引,seriesIndex索引到color
this
.
_symbol
=
this
.
ecTheme
.
symbolList
;
this
.
_symbol
=
this
.
option
.
symbolList
;
this
.
_sIndex2ShapeMap
=
{};
// series拐点图形类型,seriesIndex索引到shape type
this
.
selectedMap
=
{};
...
...
@@ -137,9 +137,9 @@ define(function (require) {
_mapData
:
function
(
seriesArray
)
{
var
series
=
this
.
series
;
var
serie
;
// 临时映射变量
var
dataIndex
=
0
;
// 堆
叠
数据所在位置映射
var
stackMap
=
{};
// 堆
叠数据位置映射,堆叠
组在二维中的第几项
var
magicStackKey
=
'
__kener__stack__
'
;
// 堆
叠命名,非堆叠数据安单一堆叠
处理
var
dataIndex
=
0
;
// 堆
积
数据所在位置映射
var
stackMap
=
{};
// 堆
积数据位置映射,堆积
组在二维中的第几项
var
magicStackKey
=
'
__kener__stack__
'
;
// 堆
积命名,非堆积数据安单一堆积
处理
var
stackKey
;
// 临时映射变量
var
serieName
;
// 临时映射变量
var
legend
=
this
.
component
.
legend
;
...
...
@@ -232,9 +232,9 @@ define(function (require) {
var
x
;
var
y
;
var
lastYP
;
// 正向堆
叠
处理
var
lastYP
;
// 正向堆
积
处理
var
baseYP
;
var
lastYN
;
// 负向堆
叠
处理
var
lastYN
;
// 负向堆
积
处理
var
baseYN
;
//var this.finalPLMap = {}; // 完成的point list(PL)
var
curPLMap
=
{};
// 正在记录的point list(PL)
...
...
@@ -247,7 +247,7 @@ define(function (require) {
}
x
=
categoryAxis
.
getCoordByIndex
(
i
);
for
(
var
j
=
0
,
k
=
locationMap
.
length
;
j
<
k
;
j
++
)
{
// 堆
叠
数据用第一条valueAxis
// 堆
积
数据用第一条valueAxis
yAxisIndex
=
series
[
locationMap
[
j
][
0
]].
yAxisIndex
||
0
;
valueAxis
=
this
.
component
.
yAxis
.
getAxis
(
yAxisIndex
);
baseYP
=
lastYP
=
baseYN
=
lastYN
=
valueAxis
.
getCoord
(
0
);
...
...
@@ -285,14 +285,14 @@ define(function (require) {
}
//y = valueAxis.getCoord(value);
if
(
value
>=
0
)
{
// 正向堆
叠
// 正向堆
积
lastYP
-=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
baseYP
-
valueAxis
.
getCoord
(
value
));
y
=
lastYP
;
}
else
if
(
value
<
0
){
// 负向堆
叠
// 负向堆
积
lastYN
+=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
valueAxis
.
getCoord
(
value
)
-
baseYN
);
...
...
@@ -405,9 +405,9 @@ define(function (require) {
var
x
;
var
y
;
var
lastXP
;
// 正向堆
叠
处理
var
lastXP
;
// 正向堆
积
处理
var
baseXP
;
var
lastXN
;
// 负向堆
叠
处理
var
lastXN
;
// 负向堆
积
处理
var
baseXN
;
//var this.finalPLMap = {}; // 完成的point list(PL)
var
curPLMap
=
{};
// 正在记录的point list(PL)
...
...
@@ -420,7 +420,7 @@ define(function (require) {
}
y
=
categoryAxis
.
getCoordByIndex
(
i
);
for
(
var
j
=
0
,
k
=
locationMap
.
length
;
j
<
k
;
j
++
)
{
// 堆
叠
数据用第一条valueAxis
// 堆
积
数据用第一条valueAxis
xAxisIndex
=
series
[
locationMap
[
j
][
0
]].
xAxisIndex
||
0
;
valueAxis
=
this
.
component
.
xAxis
.
getAxis
(
xAxisIndex
);
baseXP
=
lastXP
=
baseXN
=
lastXN
=
valueAxis
.
getCoord
(
0
);
...
...
@@ -458,14 +458,14 @@ define(function (require) {
}
//x = valueAxis.getCoord(value);
if
(
value
>=
0
)
{
// 正向堆
叠
// 正向堆
积
lastXP
+=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
valueAxis
.
getCoord
(
value
)
-
baseXP
);
x
=
lastXP
;
}
else
if
(
value
<
0
){
// 负向堆
叠
// 负向堆
积
lastXN
-=
m
>
0
?
valueAxis
.
getCoordSize
(
value
)
:
(
baseXN
-
valueAxis
.
getCoord
(
value
));
...
...
@@ -590,7 +590,7 @@ define(function (require) {
var
isLarge
;
// 堆
叠
层叠需求,反顺序构建
// 堆
积
层叠需求,反顺序构建
var
seriesIndex
;
for
(
var
sIdx
=
seriesArray
.
length
-
1
;
sIdx
>=
0
;
sIdx
--
)
{
seriesIndex
=
seriesArray
[
sIdx
];
...
...
@@ -863,17 +863,6 @@ define(function (require) {
];
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
||
this
.
component
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
@@ -882,6 +871,7 @@ define(function (require) {
this
.
option
=
newOption
;
this
.
series
=
newOption
.
series
;
}
this
.
backupShapeList
();
this
.
_buildShape
();
},
...
...
src/chart/map.js
浏览文件 @
445d720b
...
...
@@ -33,14 +33,12 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Map
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
Map
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
messageCenter
=
messageCenter
;
var
self
=
this
;
self
.
_onmousewheel
=
function
(
param
){
return
self
.
__onmousewheel
(
param
);
...
...
@@ -55,7 +53,33 @@ define(function (require) {
return
self
.
__onmouseup
(
param
);
};
this
.
init
(
option
,
component
);
this
.
_isAlive
=
true
;
// 活着标记
this
.
_selectedMode
=
{};
// 选择模式
this
.
_hoverable
=
{};
// 悬浮高亮模式,索引到图表
this
.
_showLegendSymbol
=
{};
// 显示图例颜色标识
this
.
_selected
=
{};
// 地图选择状态
this
.
_mapTypeMap
=
{};
// 图例类型索引
this
.
_mapDataMap
=
{};
// 根据地图类型索引bbox,transform,path
this
.
_nameMap
=
{};
// 个性化地名
this
.
_specialArea
=
{};
// 特殊
this
.
_refreshDelayTicket
;
// 滚轮缩放时让refresh飞一会
this
.
_mapDataRequireCounter
;
// 异步回调计数器
this
.
_markAnimation
=
false
;
// 漫游相关信息
this
.
_roamMap
=
{};
this
.
_needRoam
;
this
.
_mx
;
this
.
_my
;
this
.
_mousedown
;
this
.
_justMove
;
// 避免移动响应点击
this
.
_curMapType
;
// 当前移动的地图类型
this
.
refresh
(
option
);
if
(
this
.
_needRoam
)
{
this
.
zr
.
on
(
zrConfig
.
EVENT
.
MOUSEWHEEL
,
this
.
_onmousewheel
);
this
.
zr
.
on
(
zrConfig
.
EVENT
.
MOUSEDOWN
,
this
.
_onmousedown
);
}
}
Map
.
prototype
=
{
...
...
@@ -1145,46 +1169,6 @@ define(function (require) {
this
.
zr
.
refresh
();
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
;
this
.
_isAlive
=
true
;
// 活着标记
this
.
_selectedMode
=
{};
// 选择模式
this
.
_hoverable
=
{};
// 悬浮高亮模式,索引到图表
this
.
_showLegendSymbol
=
{};
// 显示图例颜色标识
this
.
_selected
=
{};
// 地图选择状态
this
.
_mapTypeMap
=
{};
// 图例类型索引
this
.
_mapDataMap
=
{};
// 根据地图类型索引bbox,transform,path
this
.
_nameMap
=
{};
// 个性化地名
this
.
_specialArea
=
{};
// 特殊
this
.
_refreshDelayTicket
;
// 滚轮缩放时让refresh飞一会
this
.
_mapDataRequireCounter
;
// 漫游相关信息
this
.
_roamMap
=
{};
this
.
_needRoam
;
this
.
_mx
;
this
.
_my
;
this
.
_mousedown
;
this
.
_justMove
;
// 避免移动响应点击
this
.
_curMapType
;
// 当前移动的地图类型
this
.
_markAnimation
=
false
;
this
.
refresh
(
newOption
);
if
(
this
.
_needRoam
)
{
this
.
zr
.
on
(
zrConfig
.
EVENT
.
MOUSEWHEEL
,
this
.
_onmousewheel
);
this
.
zr
.
on
(
zrConfig
.
EVENT
.
MOUSEDOWN
,
this
.
_onmousedown
);
}
},
/**
* 刷新
*/
...
...
@@ -1193,6 +1177,7 @@ define(function (require) {
this
.
option
=
newOption
;
this
.
series
=
newOption
.
series
;
}
this
.
clear
();
this
.
_buildShape
();
this
.
zr
.
refreshHover
();
...
...
src/chart/pie.js
浏览文件 @
445d720b
...
...
@@ -29,14 +29,12 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Pie
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
Pie
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
messageCenter
=
messageCenter
;
var
self
=
this
;
/**
* 输出动态视觉引导线
...
...
@@ -74,7 +72,7 @@ define(function (require) {
}
};
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Pie
.
prototype
=
{
...
...
@@ -704,17 +702,6 @@ define(function (require) {
return
opt
;
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
||
this
.
component
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
@@ -742,7 +729,7 @@ define(function (require) {
var
sectorMap
=
{};
var
textMap
=
{};
var
lineMap
=
{};
var
backupShapeList
=
zrUtil
.
clone
(
this
.
shapeList
)
;
var
backupShapeList
=
this
.
shapeList
;
this
.
shapeList
=
[];
var
seriesIndex
;
...
...
@@ -792,7 +779,7 @@ define(function (require) {
case
'
text
'
:
textMap
[
key
]
=
this
.
shapeList
[
i
];
break
;
case
'
line
'
:
case
'
broken-
line
'
:
lineMap
[
key
]
=
this
.
shapeList
[
i
];
break
;
}
...
...
@@ -831,11 +818,11 @@ define(function (require) {
400
,
deltaIdxMap
[
seriesIndex
]
<
0
?
{
end
Angle
:
start
Angle
:
backupShapeList
[
i
].
style
.
startAngle
}
:
{
start
Angle
:
end
Angle
:
backupShapeList
[
i
].
style
.
endAngle
}
)
...
...
@@ -843,7 +830,7 @@ define(function (require) {
}
}
else
if
(
backupShapeList
[
i
].
type
==
'
text
'
||
backupShapeList
[
i
].
type
==
'
line
'
||
backupShapeList
[
i
].
type
==
'
broken-
line
'
)
{
if
(
targeSector
==
'
delete
'
)
{
// 删除逻辑一样
...
...
@@ -851,7 +838,7 @@ define(function (require) {
}
else
{
// 懒得新建变量了,借用一下
switch
(
backupShapeList
[
i
].
sha
pe
)
{
switch
(
backupShapeList
[
i
].
ty
pe
)
{
case
'
text
'
:
targeSector
=
textMap
[
key
];
this
.
zr
.
animate
(
backupShapeList
[
i
].
id
,
'
style
'
)
...
...
@@ -864,16 +851,13 @@ define(function (require) {
)
.
start
();
break
;
case
'
line
'
:
case
'
broken-
line
'
:
targeSector
=
lineMap
[
key
];
this
.
zr
.
animate
(
backupShapeList
[
i
].
id
,
'
style
'
)
.
when
(
400
,
{
xStart
:
targeSector
.
style
.
xStart
,
yStart
:
targeSector
.
style
.
yStart
,
xEnd
:
targeSector
.
style
.
xEnd
,
yEnd
:
targeSector
.
style
.
yEnd
pointList
:
targeSector
.
style
.
pointList
}
)
.
start
();
...
...
src/chart/radar.js
浏览文件 @
445d720b
...
...
@@ -27,13 +27,13 @@
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Radar
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
)
{
function
Radar
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
)
{
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Radar
.
prototype
=
{
...
...
@@ -43,7 +43,7 @@
*/
_buildShape
:
function
()
{
this
.
selectedMap
=
{};
this
.
_symbol
=
this
.
ecTheme
.
symbolList
;
this
.
_symbol
=
this
.
option
.
symbolList
;
this
.
_queryTarget
;
this
.
_dropBoxList
=
[];
this
.
_radarDataCounter
=
0
;
...
...
@@ -390,18 +390,6 @@
return
;
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newZr
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
||
this
.
component
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
src/chart/scatter.js
浏览文件 @
445d720b
...
...
@@ -28,13 +28,13 @@ define(function (require) {
* @param {Object} series 数据
* @param {Object} component 组件
*/
function
Scatter
(
ecTheme
,
messageCenter
,
zr
,
option
,
componen
t
){
function
Scatter
(
ecTheme
,
messageCenter
,
zr
,
option
,
myChar
t
){
// 基类
ComponentBase
.
call
(
this
,
ecTheme
,
zr
,
option
);
ComponentBase
.
call
(
this
,
ecTheme
,
messageCenter
,
zr
,
option
,
myChart
);
// 可计算特性装饰
CalculableBase
.
call
(
this
);
this
.
init
(
option
,
component
);
this
.
refresh
(
option
);
}
Scatter
.
prototype
=
{
...
...
@@ -45,7 +45,7 @@ define(function (require) {
_buildShape
:
function
()
{
var
series
=
this
.
series
;
this
.
_sIndex2ColorMap
=
{};
// series默认颜色索引,seriesIndex索引到color
this
.
_symbol
=
ecConfig
.
symbolList
;
this
.
_symbol
=
this
.
option
.
symbolList
;
this
.
_sIndex2ShapeMap
=
{};
// series图形类型,seriesIndex索引到_symbol
this
.
selectedMap
=
{};
...
...
@@ -437,18 +437,6 @@ define(function (require) {
return
pos
;
},
/**
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newZr
* @param {Object} newSeries
* @param {Object} newComponent
*/
init
:
function
(
newOption
,
newComponent
)
{
this
.
component
=
newComponent
;
this
.
refresh
(
newOption
);
},
/**
* 刷新
*/
...
...
@@ -457,6 +445,7 @@ define(function (require) {
this
.
option
=
newOption
;
this
.
series
=
newOption
.
series
;
}
this
.
backupShapeList
();
this
.
_buildShape
();
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录