Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
85ce49b7
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,发现更多精彩内容 >>
提交
85ce49b7
编写于
12月 23, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
$superCall, $superApply, fix legend availableNames
上级
d5fd7da6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
45 addition
and
44 deletion
+45
-44
src/chart/funnel/FunnelSeries.js
src/chart/funnel/FunnelSeries.js
+2
-5
src/chart/graph/GraphSeries.js
src/chart/graph/GraphSeries.js
+4
-7
src/chart/pie/PieSeries.js
src/chart/pie/PieSeries.js
+4
-7
src/component/legend/LegendModel.js
src/component/legend/LegendModel.js
+22
-11
src/component/timeline/SliderTimelineModel.js
src/component/timeline/SliderTimelineModel.js
+1
-1
src/component/timeline/TimelineView.js
src/component/timeline/TimelineView.js
+0
-12
src/util/clazz.js
src/util/clazz.js
+12
-1
未找到文件。
src/chart/funnel/FunnelSeries.js
浏览文件 @
85ce49b7
...
...
@@ -3,15 +3,14 @@ define(function(require) {
'
use strict
'
;
var
List
=
require
(
'
../../data/List
'
);
var
SeriesModel
=
require
(
'
../../model/Series
'
);
var
modelUtil
=
require
(
'
../../util/model
'
);
var
FunnelSeries
=
SeriesModel
.
extend
({
require
(
'
../../echarts
'
).
extendSeriesModel
({
type
:
'
series.funnel
'
,
init
:
function
(
option
)
{
SeriesModel
.
prototype
.
init
.
apply
(
this
,
arguments
);
this
.
$superApply
(
'
init
'
,
arguments
);
// Enable legend selection for each data item
// Use a function instead of direct access because data reference may changed
...
...
@@ -96,6 +95,4 @@ define(function(require) {
}
}
});
return
FunnelSeries
;
});
\ No newline at end of file
src/chart/graph/GraphSeries.js
浏览文件 @
85ce49b7
...
...
@@ -2,20 +2,17 @@ define(function (require) {
'
use strict
'
;
var
SeriesModel
=
require
(
'
../../model/Series
'
);
var
List
=
require
(
'
../../data/List
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
createGraphFromNodeEdge
=
require
(
'
../helper/createGraphFromNodeEdge
'
);
var
seriesModelProto
=
SeriesModel
.
prototype
;
return
SeriesModel
.
extend
({
return
require
(
'
../../echarts
'
).
extendSeriesModel
({
type
:
'
series.graph
'
,
init
:
function
(
option
)
{
seriesModelProto
.
init
.
apply
(
this
,
arguments
);
this
.
$superApply
(
'
init
'
,
arguments
);
// Provide data for legend select
this
.
legendDataProvider
=
function
()
{
...
...
@@ -26,7 +23,7 @@ define(function (require) {
},
mergeOption
:
function
(
option
)
{
seriesModelProto
.
mergeOption
.
apply
(
this
,
arguments
);
this
.
$superApply
(
'
mergeOption
'
,
arguments
);
this
.
_updateCategoriesData
();
},
...
...
@@ -41,7 +38,7 @@ define(function (require) {
},
restoreData
:
function
()
{
seriesModelProto
.
restoreData
.
apply
(
this
,
arguments
);
this
.
$superApply
(
'
restoreData
'
,
arguments
);
this
.
getGraph
().
restoreData
();
},
...
...
src/chart/pie/PieSeries.js
浏览文件 @
85ce49b7
...
...
@@ -3,21 +3,18 @@ define(function(require) {
'
use strict
'
;
var
List
=
require
(
'
../../data/List
'
);
var
SeriesModel
=
require
(
'
../../model/Series
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
modelUtil
=
require
(
'
../../util/model
'
);
var
dataSelectableMixin
=
require
(
'
../helper/dataSelectableMixin
'
);
var
seriesModelProto
=
SeriesModel
.
prototype
;
var
PieSeries
=
SeriesModel
.
extend
({
var
PieSeries
=
require
(
'
../../echarts
'
).
extendSeriesModel
({
type
:
'
series.pie
'
,
// Overwrite
init
:
function
(
option
)
{
seriesModelProto
.
init
.
apply
(
this
,
arguments
);
this
.
$superApply
(
'
init
'
,
arguments
);
// Enable legend selection for each data item
// Use a function instead of direct access because data reference may changed
...
...
@@ -32,7 +29,7 @@ define(function(require) {
// Overwrite
mergeOption
:
function
(
newOption
)
{
seriesModelProto
.
mergeOption
.
call
(
this
,
newOption
);
this
.
$superCall
(
'
mergeOption
'
,
newOption
);
this
.
updateSelectedMap
();
},
...
...
@@ -45,7 +42,7 @@ define(function(require) {
// Overwrite
getDataParams
:
function
(
dataIndex
)
{
var
data
=
this
.
_data
;
var
params
=
seriesModelProto
.
getDataParams
.
call
(
this
,
dataIndex
);
var
params
=
this
.
$superCall
(
'
getDataParams
'
,
dataIndex
);
// FIXME toFixed?
params
.
percent
=
+
(
data
.
get
(
'
value
'
,
dataIndex
)
/
data
.
getSum
(
'
value
'
)
*
100
).
toFixed
(
2
);
...
...
src/component/legend/LegendModel.js
浏览文件 @
85ce49b7
...
...
@@ -26,6 +26,28 @@ define(function(require) {
},
this
);
this
.
_data
=
legendData
;
this
.
_updateAvailableNames
(
ecModel
);
// If has any selected in option.selected
var
selectedMap
=
this
.
option
.
selected
;
var
hasSelected
=
false
;
for
(
var
name
in
selectedMap
)
{
if
(
selectedMap
[
name
])
{
legendData
[
0
]
&&
this
.
select
(
name
);
hasSelected
=
true
;
}
}
// Try select the first if selectedMode is single
!
hasSelected
&&
legendData
[
0
]
&&
this
.
select
(
legendData
[
0
].
get
(
'
name
'
));
},
mergeOption
:
function
(
option
)
{
this
.
$superCall
(
'
mergeOption
'
,
option
);
this
.
_updateAvailableNames
(
this
.
ecModel
);
},
_updateAvailableNames
:
function
(
ecModel
)
{
var
availableNames
=
zrUtil
.
map
(
ecModel
.
getSeries
(),
function
(
series
)
{
return
series
.
name
;
});
...
...
@@ -41,17 +63,6 @@ define(function(require) {
*/
this
.
_availableNames
=
availableNames
;
// If has any selected in option.selected
var
selectedMap
=
this
.
option
.
selected
;
var
hasSelected
=
false
;
for
(
var
name
in
selectedMap
)
{
if
(
selectedMap
[
name
])
{
legendData
[
0
]
&&
this
.
select
(
name
);
hasSelected
=
true
;
}
}
// Try select the first if selectedMode is single
!
hasSelected
&&
legendData
[
0
]
&&
this
.
select
(
legendData
[
0
].
get
(
'
name
'
));
},
/**
...
...
src/component/timeline/SliderTimelineModel.js
浏览文件 @
85ce49b7
...
...
@@ -67,7 +67,7 @@ define(function(require) {
borderColor
:
'
rgba(194,53,49, 0.5)
'
,
animation
:
true
,
animationDuration
:
300
,
animationEasing
:
'
cubic
Out
'
animationEasing
:
'
quinticIn
Out
'
},
controlStyle
:
{
...
...
src/component/timeline/TimelineView.js
浏览文件 @
85ce49b7
...
...
@@ -6,18 +6,6 @@ define(function (require) {
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
graphic
=
require
(
'
../../util/graphic
'
);
var
ComponentView
=
require
(
'
../../view/Component
'
);
var
Rect
=
graphic
.
Rect
;
var
numberUtil
=
require
(
'
../../util/number
'
);
var
linearMap
=
numberUtil
.
linearMap
;
var
sliderMove
=
require
(
'
../helper/sliderMove
'
);
var
retrieveValue
=
zrUtil
.
retrieve
;
var
parsePercent
=
numberUtil
.
parsePercent
;
var
asc
=
numberUtil
.
asc
;
var
bind
=
zrUtil
.
bind
;
var
mathRound
=
Math
.
round
;
var
mathMax
=
Math
.
max
;
var
each
=
zrUtil
.
each
;
// Constants
return
ComponentView
.
extend
({
...
...
src/util/clazz.js
浏览文件 @
85ce49b7
...
...
@@ -28,7 +28,18 @@ define(function (require) {
RootClass
.
apply
(
this
,
arguments
);
};
zrUtil
.
extend
(
ExtendedClass
.
prototype
,
proto
);
var
superProto
=
this
.
prototype
;
zrUtil
.
extend
(
ExtendedClass
.
prototype
,
zrUtil
.
extend
({
$superCall
:
function
(
methodName
)
{
var
args
=
zrUtil
.
slice
(
arguments
,
1
);
return
superProto
[
methodName
].
apply
(
this
,
args
);
},
$superApply
:
function
(
methodName
,
args
)
{
return
superProto
[
methodName
].
apply
(
this
,
args
);
}
},
proto
));
ExtendedClass
.
extend
=
this
.
extend
;
zrUtil
.
inherits
(
ExtendedClass
,
this
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录