Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
alon@wen
echarts
提交
85fbe498
E
echarts
项目概览
alon@wen
/
echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
85fbe498
编写于
9月 02, 2015
作者:
P
pah100
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change model inherits
上级
5c830d44
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
48 addition
and
40 deletion
+48
-40
src/model/Component.js
src/model/Component.js
+37
-6
src/model/Global.js
src/model/Global.js
+0
-11
src/model/Model.js
src/model/Model.js
+11
-23
未找到文件。
src/model/Component.js
浏览文件 @
85fbe498
...
@@ -41,8 +41,22 @@ define(function(require) {
...
@@ -41,8 +41,22 @@ define(function(require) {
*/
*/
defaultOption
:
null
,
defaultOption
:
null
,
init
:
function
(
option
,
parentModel
,
ecModel
)
{
/**
this
.
mergeDefaultAndTheme
(
option
,
ecModel
);
* @type {Object}
* @readOnly
*/
ecModel
:
null
,
/**
* key: componentType
* value: Component model list, can not be null.
* @type {Object.<string, Array.<module:echarts/model/Model>>}
* @readOnly
*/
dependentModel
:
null
,
init
:
function
()
{
this
.
mergeDefaultAndTheme
(
this
.
option
,
this
.
ecModel
);
},
},
mergeDefaultAndTheme
:
function
(
option
,
ecModel
)
{
mergeDefaultAndTheme
:
function
(
option
,
ecModel
)
{
...
@@ -52,10 +66,27 @@ define(function(require) {
...
@@ -52,10 +66,27 @@ define(function(require) {
});
});
ComponentModel
.
extend
=
function
(
opts
)
{
ComponentModel
.
extend
=
function
(
proto
)
{
var
SubComponentModel
=
Model
.
extend
.
call
(
this
,
opts
);
var
SubComponentModel
=
function
(
option
,
parentModel
,
ecModel
,
dependentModels
)
{
var
componentType
=
opts
.
type
;
this
.
ecModel
=
ecModel
;
this
.
dependentModels
=
dependentModels
;
ComponentModel
.
apply
(
this
,
arguments
);
};
for
(
var
name
in
proto
)
{
if
(
proto
.
hasOwnProperty
(
name
))
{
SubComponentModel
.
prototype
[
name
]
=
proto
[
name
];
}
}
var
Super
=
this
;
SubComponentModel
.
extend
=
Super
.
extend
;
zrUtil
.
inherits
(
SubComponentModel
,
Super
);
return
registerComponentClass
(
SubComponentModel
,
proto
.
type
);
};
function
registerComponentClass
(
SubComponentModel
,
componentType
)
{
if
(
componentType
)
{
if
(
componentType
)
{
componentType
=
ComponentModel
.
parseComponentType
(
componentType
);
componentType
=
ComponentModel
.
parseComponentType
(
componentType
);
...
@@ -71,7 +102,7 @@ define(function(require) {
...
@@ -71,7 +102,7 @@ define(function(require) {
}
}
}
}
return
SubComponentModel
;
return
SubComponentModel
;
}
;
}
ComponentModel
.
getComponentModelClass
=
function
(
componentType
,
option
)
{
ComponentModel
.
getComponentModelClass
=
function
(
componentType
,
option
)
{
var
fullComponentType
=
componentType
;
var
fullComponentType
=
componentType
;
...
...
src/model/Global.js
浏览文件 @
85fbe498
...
@@ -136,17 +136,6 @@ define(function (require) {
...
@@ -136,17 +136,6 @@ define(function (require) {
componentsMap
[
componentType
][
i
]
=
componentModel
;
componentsMap
[
componentType
][
i
]
=
componentModel
;
components
.
push
(
componentModel
);
components
.
push
(
componentModel
);
}
}
if
(
componentModel
)
{
// 同步 Option
if
(
zrUtil
.
isArray
(
componentOption
))
{
option
[
componentType
]
=
option
[
componentType
]
||
[];
option
[
componentType
][
i
]
=
componentModel
.
option
;
}
else
{
option
[
componentType
]
=
componentModel
.
option
;
}
}
}
}
},
this
);
},
this
);
...
...
src/model/Model.js
浏览文件 @
85fbe498
...
@@ -10,7 +10,7 @@ define(function (require) {
...
@@ -10,7 +10,7 @@ define(function (require) {
* @alias module:echarts/model/Model
* @alias module:echarts/model/Model
* @constructor
* @constructor
*/
*/
function
Model
(
option
,
parentModel
,
ecModel
,
dependentModels
)
{
function
Model
(
option
,
parentModel
)
{
/**
/**
* @type {module:echarts/model/Model}
* @type {module:echarts/model/Model}
...
@@ -24,20 +24,6 @@ define(function (require) {
...
@@ -24,20 +24,6 @@ define(function (require) {
*/
*/
this
.
option
=
option
;
this
.
option
=
option
;
/**
* @type {Object}
* @protected
*/
this
.
ecModel
=
ecModel
;
/**
* key: componentType
* value: Array.<Object> Component model list, can not be null.
* @type {Object}
* @readOnly
*/
this
.
dependentModels
=
dependentModels
;
/**
/**
* @type {string}
* @type {string}
* @public
* @public
...
@@ -77,7 +63,7 @@ define(function (require) {
...
@@ -77,7 +63,7 @@ define(function (require) {
* @return {*}
* @return {*}
*/
*/
get
:
function
(
path
,
parentModel
)
{
get
:
function
(
path
,
parentModel
)
{
if
(
typeof
path
==
'
string
'
)
{
if
(
typeof
path
==
=
'
string
'
)
{
// path = this._prefix + path;
// path = this._prefix + path;
path
=
path
.
split
(
'
.
'
);
path
=
path
.
split
(
'
.
'
);
}
}
...
@@ -133,8 +119,10 @@ define(function (require) {
...
@@ -133,8 +119,10 @@ define(function (require) {
setVisual
:
function
(
key
,
val
)
{
setVisual
:
function
(
key
,
val
)
{
if
(
typeof
(
key
)
===
'
object
'
)
{
if
(
typeof
(
key
)
===
'
object
'
)
{
for
(
var
name
in
key
)
{
for
(
var
name
in
key
)
{
if
(
key
.
hasOwnProperty
(
name
))
{
this
.
setVisual
(
name
,
key
[
name
]);
this
.
setVisual
(
name
,
key
[
name
]);
}
}
}
return
;
return
;
}
}
this
.
_visual
=
this
.
_visual
||
{};
this
.
_visual
=
this
.
_visual
||
{};
...
@@ -151,22 +139,22 @@ define(function (require) {
...
@@ -151,22 +139,22 @@ define(function (require) {
};
};
Model
.
extend
=
function
(
proto
)
{
Model
.
extend
=
function
(
proto
)
{
var
Super
=
this
;
var
ExtendedModel
=
function
()
{
var
ExtendedModel
=
function
()
{
Super
.
apply
(
this
,
arguments
);
Model
.
apply
(
this
,
arguments
);
};
};
for
(
var
name
in
proto
)
{
for
(
var
name
in
proto
)
{
if
(
proto
.
hasOwnProperty
(
name
))
{
ExtendedModel
.
prototype
[
name
]
=
proto
[
name
];
ExtendedModel
.
prototype
[
name
]
=
proto
[
name
];
}
}
}
var
Super
=
this
;
ExtendedModel
.
extend
=
Super
.
extend
;
ExtendedModel
.
extend
=
Super
.
extend
;
zrUtil
.
inherits
(
ExtendedModel
,
Super
);
zrUtil
.
inherits
(
ExtendedModel
,
Super
);
return
ExtendedModel
;
return
ExtendedModel
;
}
}
;
return
Model
;
return
Model
;
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录