Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
09608e50
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,发现更多精彩内容 >>
提交
09608e50
编写于
11月 10, 2015
作者:
P
pah100
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remvoe factory layout. change: component hash by id, not uid.
上级
e098693d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
40 addition
and
75 deletion
+40
-75
src/chart/treemap/TreemapView.js
src/chart/treemap/TreemapView.js
+3
-3
src/chart/treemap/helper.js
src/chart/treemap/helper.js
+3
-3
src/chart/treemap/treemapLayout.js
src/chart/treemap/treemapLayout.js
+2
-3
src/component/dataRange/ContinuousView.js
src/component/dataRange/ContinuousView.js
+1
-1
src/component/dataRange/PiecewiseView.js
src/component/dataRange/PiecewiseView.js
+1
-1
src/component/dataZoom/DataZoomView.js
src/component/dataZoom/DataZoomView.js
+1
-1
src/echarts.js
src/echarts.js
+6
-38
src/model/Component.js
src/model/Component.js
+17
-1
src/model/Global.js
src/model/Global.js
+6
-13
src/util/component.js
src/util/component.js
+0
-11
未找到文件。
src/chart/treemap/TreemapView.js
浏览文件 @
09608e50
...
...
@@ -535,7 +535,7 @@
this
.
api
.
dispatch
({
type
:
'
treemapMove
'
,
from
:
this
.
uid
,
series
UID
:
this
.
seriesModel
.
uid
,
series
Id
:
this
.
seriesModel
.
getId
()
,
rootRect
:
{
x
:
rootLayout
.
x
+
dx
,
y
:
rootLayout
.
y
+
dy
,
width
:
rootLayout
.
width
,
height
:
rootLayout
.
height
...
...
@@ -582,7 +582,7 @@
this
.
api
.
dispatch
({
type
:
'
treemapRender
'
,
from
:
this
.
uid
,
series
UID
:
this
.
seriesModel
.
uid
,
series
Id
:
this
.
seriesModel
.
getId
()
,
rootRect
:
{
x
:
rect
.
x
,
y
:
rect
.
y
,
width
:
rect
.
width
,
height
:
rect
.
height
...
...
@@ -659,7 +659,7 @@
this
.
api
.
dispatch
({
type
:
'
treemapZoomToNode
'
,
from
:
this
.
uid
,
series
UID
:
this
.
seriesModel
.
uid
,
series
Id
:
this
.
seriesModel
.
getId
()
,
targetNode
:
targetInfo
.
node
});
},
...
...
src/chart/treemap/helper.js
浏览文件 @
09608e50
...
...
@@ -3,12 +3,12 @@ define(function (require) {
var
helper
=
{
irrelevant
:
function
(
payload
,
seriesModel
)
{
// It is irrelavant only when series
U
ID or seriesName is
// It is irrelavant only when seriesID or seriesName is
// specified and not equals to seriesModel's.
return
payload
&&
(
payload
.
series
UID
!=
null
?
seriesModel
.
uid
!==
payload
.
seriesUID
payload
.
series
Id
!=
null
?
seriesModel
.
getId
()
!==
payload
.
seriesId
:
payload
.
seriesName
!=
null
// FIXME
// seriesModel.getId() ???
...
...
src/chart/treemap/treemapLayout.js
浏览文件 @
09608e50
...
...
@@ -13,7 +13,7 @@ define(function (require) {
/**
* @public
*/
function
layout
(
ecModel
,
api
,
payload
)
{
function
update
(
ecModel
,
api
,
payload
)
{
// Layout result in each node:
// {x, y, width, height, area, borderWidth}
ecModel
.
eachSeriesByType
(
'
treemap
'
,
function
(
seriesModel
)
{
...
...
@@ -505,6 +505,5 @@ define(function (require) {
}
}
return
layout
;
return
update
;
});
\ No newline at end of file
src/component/dataRange/ContinuousView.js
浏览文件 @
09608e50
...
...
@@ -249,7 +249,7 @@ define(function(require) {
this
.
api
.
dispatch
({
type
:
'
selectDataRange
'
,
from
:
this
.
uid
,
dataRangeModelId
:
this
.
dataRangeModel
.
uid
,
dataRangeModelId
:
this
.
dataRangeModel
.
getId
()
,
selected
:
this
.
_dataInterval
.
slice
()
});
},
...
...
src/component/dataRange/PiecewiseView.js
浏览文件 @
09608e50
...
...
@@ -162,7 +162,7 @@ define(function(require) {
this
.
api
.
dispatch
({
type
:
'
selectDataRange
'
,
from
:
this
.
uid
,
dataRangeModelId
:
this
.
dataRangeModel
.
uid
,
dataRangeModelId
:
this
.
dataRangeModel
.
getId
()
,
selected
:
selected
});
}
...
...
src/component/dataZoom/DataZoomView.js
浏览文件 @
09608e50
...
...
@@ -605,7 +605,7 @@ define(function (require) {
this
.
api
.
dispatch
({
type
:
'
dataZoom
'
,
from
:
this
.
uid
,
dataZoomModelId
:
this
.
dataZoomModel
.
uid
,
dataZoomModelId
:
this
.
dataZoomModel
.
getId
()
,
dataZoomRange
:
this
.
_range
.
slice
()
});
},
...
...
src/echarts.js
浏览文件 @
09608e50
...
...
@@ -91,15 +91,6 @@ define(function (require) {
* @private
*/
this
.
_coordinateSystem
=
new
CoordinateSystemManager
();
/**
* Layout instances
* @type {Array}
* @private
*/
this
.
_layouts
=
zrUtil
.
map
(
layoutClasses
,
function
(
Layout
)
{
return
new
Layout
();
});
};
var
echartsProto
=
ECharts
.
prototype
;
...
...
@@ -282,8 +273,7 @@ define(function (require) {
// Upate all charts
ecModel
.
eachSeries
(
function
(
seriesModel
,
idx
)
{
var
id
=
getViewId
(
seriesModel
);
var
chart
=
this
.
_chartsMap
[
id
];
var
chart
=
this
.
_chartsMap
[
seriesModel
.
getId
()];
chart
[
methodName
](
seriesModel
,
ecModel
,
api
,
payload
);
updateZ
(
seriesModel
,
chart
);
...
...
@@ -302,7 +292,7 @@ define(function (require) {
}
ecModel
.
eachSeries
(
function
(
seriesModel
,
idx
)
{
var
id
=
getViewId
(
seriesModel
);
var
id
=
seriesModel
.
getId
(
);
var
chart
=
chartsMap
[
id
];
if
(
!
chart
)
{
...
...
@@ -353,7 +343,7 @@ define(function (require) {
return
;
}
var
id
=
getViewId
(
componentModel
);
var
id
=
componentModel
.
getId
(
);
var
component
=
componentsMap
[
id
];
if
(
!
component
)
{
// Create and add component
...
...
@@ -472,8 +462,7 @@ define(function (require) {
// Render all charts
ecModel
.
eachSeries
(
function
(
seriesModel
,
idx
)
{
var
id
=
getViewId
(
seriesModel
);
var
chart
=
this
.
_chartsMap
[
id
];
var
chart
=
this
.
_chartsMap
[
seriesModel
.
getId
()];
chart
.
__keepAlive
=
true
;
chart
.
render
(
seriesModel
,
ecModel
,
api
,
payload
);
...
...
@@ -499,14 +488,6 @@ define(function (require) {
this
.
zr
.
dispose
();
};
/**
* @param {module:echarts/model/Series|module:echarts/model/Component} model
* @return {string}
*/
function
getViewId
(
model
)
{
return
model
.
name
+
'
_
'
+
model
.
type
;
}
/**
* @param {module:echarts/model/Series|module:echarts/model/Component} model
* @param {module:echarts/view/Component|module:echarts/view/Chart} view
...
...
@@ -527,12 +508,6 @@ define(function (require) {
*/
var
actions
=
[];
/**
* @type {Array.<Function>}
* @inner
*/
var
layoutClasses
=
[];
/**
* @type {Array.<Function>}
* @inner
...
...
@@ -634,15 +609,8 @@ define(function (require) {
*/
echarts
.
registerLayout
=
function
(
layout
,
isFactory
)
{
// PENDING All functions ?
if
(
isFactory
)
{
if
(
zrUtil
.
indexOf
(
layoutClasses
,
layout
)
<
0
)
{
layoutClasses
.
push
(
layout
);
}
}
else
{
if
(
zrUtil
.
indexOf
(
layoutFuncs
,
layout
)
<
0
)
{
layoutFuncs
.
push
(
layout
);
}
if
(
zrUtil
.
indexOf
(
layoutFuncs
,
layout
)
<
0
)
{
layoutFuncs
.
push
(
layout
);
}
};
...
...
src/model/Component.js
浏览文件 @
09608e50
...
...
@@ -78,6 +78,19 @@ define(function(require) {
this
.
__defaultOption
=
defaultOption
;
}
return
this
.
__defaultOption
;
},
/**
* Two ids are different if and only if their component types
* or names are different. We use this id to hash component models
* and view instances in echarts. When setOption are called in
* no-merge mode, new models are able to replace old model, and
* view instances are able to mapped to previous.
* @public
* @return {string} id
*/
getId
:
function
()
{
return
this
.
name
+
'
__
'
+
this
.
type
;
}
});
...
...
@@ -88,13 +101,16 @@ define(function(require) {
function
(
option
,
parentModel
,
ecModel
,
dependentModels
,
index
)
{
this
.
ecModel
=
ecModel
;
this
.
dependentModels
=
dependentModels
;
this
.
uid
=
componentUtil
.
getUID
(
'
componentModel
'
);
// FIXME
// 如果name重复,要进行提示。
var
componentName
=
option
.
name
;
if
(
componentName
==
null
)
{
componentName
=
this
.
type
+
''
+
index
;
}
this
.
name
=
componentName
+
''
;
this
.
uid
=
componentUtil
.
getUID
(
'
componentModel
'
);
}
);
...
...
src/model/Global.js
浏览文件 @
09608e50
...
...
@@ -35,13 +35,7 @@ define(function (require) {
this
.
option
=
{};
/**
* @type {Array.<module:echarts/model/Model}
* @private
*/
this
.
_components
=
[];
/**
* @type {Object.<string, module:echarts/model/Model>}
* @type {Object.<string, Array.<module:echarts/model/Model>>}
* @private
*/
this
.
_componentsMap
=
{};
...
...
@@ -140,7 +134,7 @@ define(function (require) {
var
newCptOption
=
newCptOptionList
[
i
];
var
subType
=
this
.
_determineSubType
(
componentType
,
newCptOption
,
existComponents
[
i
]
componentType
,
newCptOption
,
componentModel
);
var
ComponentModelClass
=
ComponentModel
.
getClass
(
componentType
,
subType
,
true
...
...
@@ -158,8 +152,7 @@ define(function (require) {
componentsMap
[
componentType
][
i
]
=
componentModel
;
// Merge option is incremental
this
.
_components
.
push
(
componentModel
);
this
.
_componentsIdMap
[
componentModel
.
uid
]
=
componentModel
;
this
.
_componentsIdMap
[
componentModel
.
getId
()]
=
componentModel
;
}
}
}
...
...
@@ -237,11 +230,11 @@ define(function (require) {
},
/**
* @param {string}
u
id
* @param {string} id
* @return {module:echarts/model/Component}
*/
getComponentById
:
function
(
u
id
)
{
return
this
.
_componentsIdMap
[
u
id
];
getComponentById
:
function
(
id
)
{
return
this
.
_componentsIdMap
[
id
];
},
/**
...
...
src/util/component.js
浏览文件 @
09608e50
...
...
@@ -20,17 +20,6 @@ define(function(require) {
return
[(
type
||
''
),
base
++
,
Math
.
random
()].
join
(
DELIMITER
);
};
/**
* @public
* @param {string} uid
* @return {string} Type
*/
util
.
getUIDType
=
function
(
uid
)
{
if
(
uid
)
{
return
uid
.
split
(
DELIMITER
)[
0
];
}
};
/**
* @public
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录