Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
d3d79b9f
I
incubator-echarts
项目概览
missman
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
d3d79b9f
编写于
10月 19, 2015
作者:
P
pah100
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update and registeraction: support updateView
上级
22477f6f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
38 deletion
+43
-38
src/component/dataRange/dataRangeAction.js
src/component/dataRange/dataRangeAction.js
+7
-1
src/echarts.js
src/echarts.js
+36
-37
未找到文件。
src/component/dataRange/dataRangeAction.js
浏览文件 @
d3d79b9f
...
...
@@ -7,7 +7,13 @@ define(function(require) {
var
echarts
=
require
(
'
../../echarts
'
);
// var modelUtil = require('../../util/model');
echarts
.
registerAction
(
'
selectDataRange
'
,
'
dataRangeSelected
'
,
function
(
event
,
ecModel
)
{
var
actionInfo
=
{
type
:
'
selectDataRange
'
,
event
:
'
dataRangeSelected
'
,
update
:
'
updateView
'
};
echarts
.
registerAction
(
actionInfo
,
function
(
event
,
ecModel
)
{
var
fromDataRangeModel
=
ecModel
.
getComponentById
(
event
.
dataRangeModelId
);
...
...
src/echarts.js
浏览文件 @
d3d79b9f
...
...
@@ -94,18 +94,6 @@ define(function (require) {
this
.
_layouts
=
zrUtil
.
map
(
layoutClasses
,
function
(
Layout
)
{
return
new
Layout
();
});
/**
* @type {boolean}
* @private
*/
this
.
_needsUpdate
=
false
;
this
.
_zr
.
animation
.
on
(
'
frame
'
,
function
()
{
if
(
this
.
_needsUpdate
)
{
this
.
updateImmediately
();
}
},
this
);
};
ECharts
.
prototype
=
{
...
...
@@ -136,7 +124,7 @@ define(function (require) {
this
.
_prepareCharts
(
ecModel
);
this
.
update
Immediately
();
this
.
update
();
},
setTheme
:
function
(
theme
)
{
...
...
@@ -157,11 +145,7 @@ define(function (require) {
return
this
.
_zr
.
getHeight
();
},
update
:
function
()
{
this
.
_needsUpdate
=
true
;
},
updateImmediately
:
function
(
event
)
{
update
:
function
(
payload
)
{
console
.
time
(
'
update
'
);
var
ecModel
=
this
.
_model
;
...
...
@@ -178,13 +162,11 @@ define(function (require) {
this
.
_coordinateSystem
.
update
(
ecModel
,
this
.
_extensionAPI
);
this
.
_doLayout
(
ecModel
,
event
);
this
.
_doLayout
(
ecModel
,
payload
);
this
.
_doVisualCoding
(
ecModel
);
this
.
_doRender
(
ecModel
,
event
);
this
.
_needsUpdate
=
false
;
this
.
_doRender
(
ecModel
,
payload
);
// Set background
this
.
_dom
.
style
.
backgroundColor
=
ecModel
.
get
(
'
backgroundColor
'
);
...
...
@@ -192,6 +174,16 @@ define(function (require) {
console
.
timeEnd
(
'
update
'
);
},
updateView
:
function
(
payload
)
{
var
ecModel
=
this
.
_model
;
this
.
_doLayout
(
ecModel
,
payload
);
this
.
_doVisualCoding
(
ecModel
);
this
.
_doRender
(
ecModel
,
payload
);
},
resize
:
function
()
{
// var ecModel = this._model;
...
...
@@ -203,20 +195,20 @@ define(function (require) {
// this._doRender(ecModel);
this
.
update
Immediately
();
this
.
update
();
},
/**
* @pubilc
* @param {Object} payload
* @param {string} [payload.type]
Event
type
* @param {string} [payload.type]
Action
type
* @param {number} [payload.from] From uid
*/
dispatch
:
function
(
payload
)
{
var
action
=
actions
[
payload
.
type
];
if
(
action
)
{
action
(
payload
,
this
.
_model
);
this
.
updateImmediately
(
payload
);
var
action
Wrap
=
actions
[
payload
.
type
];
if
(
action
Wrap
)
{
action
Wrap
.
action
(
payload
,
this
.
_model
);
this
[
actionWrap
.
update
||
'
update
'
]
(
payload
);
}
},
...
...
@@ -503,19 +495,26 @@ define(function (require) {
* Usage:
* registerAction('someAction', 'someEvent', function () { ... });
* registerAction('someAction', function () { ... });
* registerAction(
* {type: 'someAction', event: 'someEvent', update: 'updateView'},
* function () { ... }
* );
*
* @param {string} actionName
* @param {string=} eventName Can be ignored
* @param {(string|Object)} actionInfo
* @param {string} actionInfo.type
* @param {string=} actionInfo.event
* @param {string=} actionInfo.update
* @param {Function=} action
*/
registerAction
:
function
(
action
Name
,
eventName
,
action
)
{
if
(
typeof
eventName
===
'
function
'
)
{
action
=
eventName
;
eventName
=
null
;
}
if
(
!
actions
[
action
Nam
e
])
{
actions
[
action
Name
]
=
action
;
registerAction
:
function
(
action
Info
,
action
)
{
var
actionType
=
zrUtil
.
isObject
(
actionInfo
)
?
actionInfo
.
type
:
([
actionInfo
,
actionInfo
=
{}][
0
])
;
if
(
!
actions
[
action
Typ
e
])
{
actions
[
action
Type
]
=
{
action
:
action
,
actionInfo
:
actionInfo
}
;
}
// TODO
// event
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录