Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z1593
incubator-echarts
提交
9a5995ed
I
incubator-echarts
项目概览
z1593
/
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,发现更多精彩内容 >>
提交
9a5995ed
编写于
9月 21, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Model#getShallow for optimization
上级
043244eb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
4 deletion
+26
-4
src/model/Model.js
src/model/Model.js
+19
-3
src/model/mixin/makeStyleMapper.js
src/model/mixin/makeStyleMapper.js
+2
-1
src/util/graphic.js
src/util/graphic.js
+5
-0
未找到文件。
src/model/Model.js
浏览文件 @
9a5995ed
...
@@ -49,7 +49,7 @@ define(function (require) {
...
@@ -49,7 +49,7 @@ define(function (require) {
* @return {*}
* @return {*}
*/
*/
get
:
function
(
path
,
ignoreParent
)
{
get
:
function
(
path
,
ignoreParent
)
{
if
(
!
path
)
{
if
(
!
path
)
{
return
this
.
option
;
return
this
.
option
;
}
}
...
@@ -58,18 +58,34 @@ define(function (require) {
...
@@ -58,18 +58,34 @@ define(function (require) {
}
}
var
obj
=
this
.
option
;
var
obj
=
this
.
option
;
var
parentModel
=
this
.
parentModel
;
for
(
var
i
=
0
;
i
<
path
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
path
.
length
;
i
++
)
{
obj
=
obj
&&
obj
[
path
[
i
]];
obj
=
obj
&&
obj
[
path
[
i
]];
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
break
;
break
;
}
}
}
}
if
(
obj
==
null
&&
this
.
parentModel
&&
!
ignoreParent
)
{
if
(
obj
==
null
&&
parentModel
&&
!
ignoreParent
)
{
return
this
.
parentModel
.
get
(
path
);
obj
=
parentModel
.
get
(
path
);
}
}
return
obj
;
return
obj
;
},
},
/**
* @param {string} key
* @param {boolean} [ignoreParent=false]
* @return {*}
*/
getShallow
:
function
(
key
,
ignoreParent
)
{
var
option
=
this
.
option
;
var
val
=
option
&&
option
[
key
];
var
parentModel
=
this
.
parentModel
;
if
(
val
==
null
&&
parentModel
&&
!
ignoreParent
)
{
val
=
parentModel
.
getShallow
(
key
);
}
return
val
;
},
/**
/**
* @param {string} path
* @param {string} path
* @return {module:echarts/model/Model}
* @return {module:echarts/model/Model}
...
...
src/model/mixin/makeStyleMapper.js
浏览文件 @
9a5995ed
// TODO Parse shadow style
// TODO Parse shadow style
// TODO Only shallow path support
define
(
function
(
require
)
{
define
(
function
(
require
)
{
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
...
@@ -16,7 +17,7 @@ define(function (require) {
...
@@ -16,7 +17,7 @@ define(function (require) {
if
(
excludes
&&
zrUtil
.
indexOf
(
excludes
,
propName
)
>=
0
)
{
if
(
excludes
&&
zrUtil
.
indexOf
(
excludes
,
propName
)
>=
0
)
{
continue
;
continue
;
}
}
var
val
=
this
.
get
(
propName
);
var
val
=
this
.
get
Shallow
(
propName
);
if
(
val
!=
null
)
{
if
(
val
!=
null
)
{
style
[
properties
[
i
][
0
]]
=
val
;
style
[
properties
[
i
][
0
]]
=
val
;
}
}
...
...
src/util/graphic.js
浏览文件 @
9a5995ed
...
@@ -157,6 +157,11 @@ define(function(require) {
...
@@ -157,6 +157,11 @@ define(function(require) {
:
(
doubledPosition
+
(
positiveOrNegative
?
1
:
-
1
))
/
2
;
:
(
doubledPosition
+
(
positiveOrNegative
?
1
:
-
1
))
/
2
;
},
},
/**
* Set hover style of element
* @param {module:zrender/graphic/Displayable} el
* @param {Object} hoverStyle
*/
setHoverStyle
:
function
(
el
,
hoverStyle
)
{
setHoverStyle
:
function
(
el
,
hoverStyle
)
{
var
stroke
=
el
.
style
.
stroke
;
var
stroke
=
el
.
style
.
stroke
;
var
fill
=
el
.
style
.
fill
;
var
fill
=
el
.
style
.
fill
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录