Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
fa633989
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,发现更多精彩内容 >>
提交
fa633989
编写于
12月 21, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix updateTransform.
tweak task.
上级
3cbd28d0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
132 deletion
+54
-132
src/echarts.js
src/echarts.js
+29
-29
src/model/Series.js
src/model/Series.js
+0
-5
src/stream/Scheduler.js
src/stream/Scheduler.js
+5
-11
src/stream/task.js
src/stream/task.js
+16
-34
src/view/Chart.js
src/view/Chart.js
+4
-4
src/visual/symbol.js
src/visual/symbol.js
+0
-49
未找到文件。
src/echarts.js
浏览文件 @
fa633989
...
...
@@ -781,7 +781,7 @@ var updateMethods = {
clearColorPalette
(
ecModel
);
scheduler
.
performStageTasks
(
visualFuncs
,
ecModel
,
payload
);
render
(
this
,
ecModel
,
api
,
payload
,
true
);
render
(
this
,
ecModel
,
api
,
payload
);
// Set background
var
backgroundColor
=
ecModel
.
get
(
'
backgroundColor
'
)
||
'
transparent
'
;
...
...
@@ -864,7 +864,7 @@ var updateMethods = {
visualFuncs
,
ecModel
,
payload
,
{
setDirty
:
true
,
seriesModels
:
seriesModels
}
);
render
(
this
,
ecModel
,
this
.
_api
,
payload
,
true
,
seriesModels
);
render
Series
(
this
,
ecModel
,
this
.
_api
,
payload
,
seriesModels
);
performPostUpdateFuncs
(
ecModel
,
this
.
_api
);
},
...
...
@@ -888,7 +888,7 @@ var updateMethods = {
// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
this
.
_scheduler
.
performStageTasks
(
visualFuncs
,
ecModel
,
payload
,
{
setDirty
:
true
});
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
,
true
);
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
);
performPostUpdateFuncs
(
ecModel
,
this
.
_api
);
},
...
...
@@ -912,7 +912,7 @@ var updateMethods = {
// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.
this
.
_scheduler
.
performStageTasks
(
visualFuncs
,
ecModel
,
payload
,
{
visualType
:
'
visual
'
,
setDirty
:
true
});
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
,
true
);
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
);
performPostUpdateFuncs
(
ecModel
,
this
.
_api
);
},
...
...
@@ -935,7 +935,7 @@ var updateMethods = {
// this._scheduler.performStageTasks(visualFuncs, ecModel, payload, 'layout', true);
this
.
_scheduler
.
performStageTasks
(
visualFuncs
,
ecModel
,
payload
,
{
setDirty
:
true
});
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
,
true
);
render
(
this
,
this
.
_model
,
this
.
_api
,
payload
);
performPostUpdateFuncs
(
ecModel
,
this
.
_api
);
}
...
...
@@ -1362,25 +1362,34 @@ function clearColorPalette(ecModel) {
});
}
function
render
(
ecIns
,
ecModel
,
api
,
payload
)
{
// Render all components
each
(
ecIns
.
_componentsViews
,
function
(
componentView
)
{
var
componentModel
=
componentView
.
__model
;
componentView
.
render
(
componentModel
,
ecModel
,
api
,
payload
);
updateZ
(
componentModel
,
componentView
);
});
each
(
ecIns
.
_chartsViews
,
function
(
chart
)
{
chart
.
__alive
=
false
;
});
renderSeries
(
ecIns
,
ecModel
,
api
,
payload
);
// Remove groups of unrendered charts
each
(
ecIns
.
_chartsViews
,
function
(
chart
)
{
if
(
!
chart
.
__alive
)
{
chart
.
remove
(
ecModel
,
api
);
}
});
}
/**
* Render each chart and component
* @private
*/
function
render
(
ecIns
,
ecModel
,
api
,
payload
,
isReset
,
seriesModels
)
{
if
(
isReset
)
{
// Render all components
each
(
ecIns
.
_componentsViews
,
function
(
componentView
)
{
var
componentModel
=
componentView
.
__model
;
componentView
.
render
(
componentModel
,
ecModel
,
api
,
payload
);
updateZ
(
componentModel
,
componentView
);
});
each
(
ecIns
.
_chartsViews
,
function
(
chart
)
{
chart
.
__alive
=
false
;
});
}
function
renderSeries
(
ecIns
,
ecModel
,
api
,
payload
,
seriesModels
)
{
// Render all charts
var
scheduler
=
ecIns
.
_scheduler
;
var
unfinished
;
...
...
@@ -1406,15 +1415,6 @@ function render(ecIns, ecModel, api, payload, isReset, seriesModels) {
// If use hover layer
// ??? updateHoverLayerStatus(this._zr, ecModel);
if
(
isReset
)
{
// Remove groups of unrendered charts
each
(
ecIns
.
_chartsViews
,
function
(
chart
)
{
if
(
!
chart
.
__alive
)
{
chart
.
remove
(
ecModel
,
api
);
}
});
}
}
function
performPostUpdateFuncs
(
ecModel
,
api
)
{
...
...
src/model/Series.js
浏览文件 @
fa633989
...
...
@@ -67,7 +67,6 @@ var SeriesModel = ComponentModel.extend({
// this.settingTask = createTask();
this
.
initTask
=
createTask
({
reset
:
initTaskReset
,
count
:
initTaskCount
},
{
model
:
this
});
...
...
@@ -384,8 +383,4 @@ function initTaskCount(context) {
return
context
.
model
.
getRawData
().
getProvider
().
count
();
}
function
initTaskReset
(
context
)
{
return
{
noProgress
:
true
};
}
export
default
SeriesModel
;
\ No newline at end of file
src/stream/Scheduler.js
浏览文件 @
fa633989
...
...
@@ -203,7 +203,6 @@ function createSeriesStageTask(scheduler, stageHandler, stageHandlerRecord, ecMo
if
(
!
task
)
{
task
=
createTask
({
reset
:
seriesTaskReset
,
progress
:
seriesTaskProgress
,
count
:
seriesTaskCount
},
{
model
:
seriesModel
,
...
...
@@ -243,7 +242,7 @@ function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecM
// Moreover, it is not necessary to add stub to pipeline in the case.
var
seriesType
=
stageHandler
.
seriesType
;
seriesType
&&
ecModel
.
eachRawSeriesByType
(
seriesType
,
function
(
seriesModel
)
{
var
stub
=
stubs
[
stubIndex
]
=
stubs
[
stubIndex
]
||
createTask
(
{
reset
:
emptyTaskReset
}
);
var
stub
=
stubs
[
stubIndex
]
=
stubs
[
stubIndex
]
||
createTask
();
stubIndex
++
;
stub
.
agent
=
overallTask
;
stub
.
__block
=
true
;
...
...
@@ -254,13 +253,8 @@ function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecM
stubs
.
length
=
stubIndex
;
}
function
emptyTaskReset
()
{
return
{
noProgress
:
true
};
}
function
overallTaskReset
(
context
)
{
context
.
overallReset
(
context
.
ecModel
,
context
.
api
,
context
.
payload
);
return
{
noProgress
:
true
};
}
function
seriesTaskReset
(
context
)
{
...
...
@@ -270,11 +264,11 @@ function seriesTaskReset(context) {
var
resetDefine
=
context
.
reset
(
context
.
model
,
context
.
ecModel
,
context
.
api
,
context
.
payload
);
if
(
!
resetDefine
)
{
return
{
noProgress
:
true
};
if
(
resetDefine
)
{
context
.
dataEach
=
resetDefine
.
dataEach
;
context
.
progress
=
resetDefine
.
progress
;
return
seriesTaskProgress
;
}
context
.
dataEach
=
resetDefine
.
dataEach
;
context
.
progress
=
resetDefine
.
progress
;
}
function
seriesTaskProgress
(
params
,
context
)
{
...
...
src/stream/task.js
浏览文件 @
fa633989
import
{
assert
,
extend
,
each
}
from
'
zrender/src/core/util
'
;
import
{
assert
,
each
}
from
'
zrender/src/core/util
'
;
import
{
__DEV__
}
from
'
../config
'
;
/**
...
...
@@ -13,7 +12,6 @@ export function createTask(define, context) {
/**
* @constructor
* @param {Object} define
* @param {Function} define.progress Custom progress
* @param {Function} define.reset Custom reset
* @param {Function} [define.count] count is used to determin data task.
* @param {Object} [context]
...
...
@@ -21,7 +19,6 @@ export function createTask(define, context) {
function
Task
(
define
,
context
)
{
define
=
define
||
{};
this
.
_progress
=
define
.
progress
;
this
.
_reset
=
define
.
reset
;
this
.
_count
=
define
.
count
;
...
...
@@ -45,30 +42,26 @@ taskProto.perform = function (performArgs) {
var
step
=
performArgs
&&
performArgs
.
step
;
// This should always be performed so it can be passed to downstream.
var
upTask
=
this
.
_upstream
;
if
(
upTask
)
{
var
progressInfo
=
upTask
.
getProgressInfo
();
if
(
__DEV__
)
{
assert
(
progressInfo
.
outputDueEnd
!=
null
);
assert
(
upTask
.
_
outputDueEnd
!=
null
);
}
this
.
_dueEnd
=
Math
.
max
(
progressInfo
.
outputDueEnd
,
this
.
_dueEnd
);
}
// If noProgress, pass index from upstream to downstream each time plan called.
if
(
this
.
_noProgress
)
{
this
.
_dueIndex
=
this
.
_outputDueEnd
=
this
.
_dueEnd
=
count
(
this
);
this
.
_dueEnd
=
Math
.
max
(
upTask
.
_outputDueEnd
,
this
.
_dueEnd
);
}
else
{
if
(
__DEV__
)
{
assert
(
upTask
||
this
.
_count
);
assert
(
!
this
.
_progress
||
this
.
_count
);
}
this
.
_dueEnd
=
this
.
_count
?
this
.
_count
(
this
.
context
)
:
Infinity
;
}
// If no progress, pass index from upstream to downstream each time plan called.
if
(
this
.
_progress
)
{
var
start
=
this
.
_dueIndex
;
var
end
=
Math
.
min
(
step
!=
null
?
this
.
_dueIndex
+
step
:
Infinity
,
upTask
?
this
.
_dueEnd
:
Infinity
,
this
.
_count
?
this
.
_count
(
this
.
context
)
:
Infinity
this
.
_dueEnd
);
var
outputDueEnd
;
...
...
@@ -88,6 +81,10 @@ taskProto.perform = function (performArgs) {
}
this
.
_outputDueEnd
=
outputDueEnd
;
}
else
{
// This should always be performed so it can be passed to downstream.
this
.
_dueIndex
=
this
.
_outputDueEnd
=
this
.
_dueEnd
;
}
// Initialized in scheduler.
each
(
this
.
agentStubs
,
function
(
agentStub
)
{
...
...
@@ -109,35 +106,20 @@ taskProto.dirty = function () {
* @param {Object} [params]
*/
function
reset
(
taskIns
)
{
taskIns
.
_dueIndex
=
taskIns
.
_outputDueEnd
=
0
;
taskIns
.
_dueEnd
=
count
(
taskIns
);
taskIns
.
_dueIndex
=
taskIns
.
_outputDueEnd
=
taskIns
.
_dueEnd
=
0
;
var
result
=
taskIns
.
_reset
&&
taskIns
.
_reset
(
taskIns
.
context
)
||
{};
taskIns
.
_noProgress
=
result
.
noProgress
;
taskIns
.
_progress
=
taskIns
.
_reset
&&
taskIns
.
_reset
(
taskIns
.
context
);
taskIns
.
_downstream
&&
taskIns
.
_downstream
.
dirty
();
// FIXME
taskIns
.
agent
&&
taskIns
.
agent
.
dirty
();
}
function
count
(
taskIns
)
{
return
taskIns
.
_count
?
taskIns
.
_count
(
taskIns
.
context
)
:
0
;
}
taskProto
.
getProgressInfo
=
function
()
{
return
{
dueIndex
:
this
.
_dueIndex
,
dueEnd
:
this
.
_dueEnd
,
outputDueEnd
:
this
.
_outputDueEnd
};
};
/**
* @return {boolean}
*/
taskProto
.
unfinished
=
function
()
{
return
!
this
.
_noP
rogress
&&
this
.
_dueIndex
<
this
.
_dueEnd
;
return
this
.
_p
rogress
&&
this
.
_dueIndex
<
this
.
_dueEnd
;
};
/**
...
...
src/view/Chart.js
浏览文件 @
fa633989
...
...
@@ -22,8 +22,7 @@ function Chart() {
this
.
uid
=
componentUtil
.
getUID
(
'
viewChart
'
);
this
.
renderTask
=
createTask
({
reset
:
renderTaskReset
,
progress
:
renderTaskProgress
reset
:
renderTaskReset
},
{
view
:
this
});
}
...
...
@@ -200,8 +199,9 @@ function renderTaskReset(context) {
?
updateMethod
:
'
render
'
);
return
view
[
methodName
](
seriesModel
,
ecModel
,
api
,
payload
)
||
(
!
incremental
&&
{
noProgress
:
true
});
view
[
methodName
](
seriesModel
,
ecModel
,
api
,
payload
);
return
incremental
?
renderTaskProgress
:
null
;
}
function
renderTaskProgress
(
params
,
context
)
{
...
...
src/visual/symbol.js
浏览文件 @
fa633989
...
...
@@ -50,52 +50,3 @@ export default function (seriesType, defaultSymbolType, legendSymbol) {
}
};
}
// export default function (seriesType, defaultSymbolType, legendSymbol, ecModel) {
// // Encoding visual for all series include which is filtered for legend drawing
// ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {
// seriesModel.pipeTask(
// createTask(seriesModel, defaultSymbolType, legendSymbol, ecModel),
// 'visual'
// );
// });
// }
// function createTask(seriesModel, defaultSymbolType, legendSymbol, ecModel) {
// var data = seriesModel.getData();
// var symbolType = seriesModel.get('symbol') || defaultSymbolType;
// var symbolSize = seriesModel.get('symbolSize');
// data.setVisual({
// legendSymbol: legendSymbol || symbolType,
// symbol: symbolType,
// symbolSize: symbolSize
// });
// // Only visible series has each data be visual encoded
// if (ecModel.isSeriesFiltered(seriesModel)) {
// return;
// }
// return data.createEachTask(function (idx) {
// if (typeof symbolSize === 'function') {
// var rawValue = seriesModel.getRawValue(idx);
// // FIXME
// var params = seriesModel.getDataParams(idx);
// data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
// }
// var itemModel = data.getItemModel(idx);
// var itemSymbolType = itemModel.getShallow('symbol', true);
// var itemSymbolSize = itemModel.getShallow('symbolSize', true);
// // If has item symbol
// if (itemSymbolType != null) {
// data.setItemVisual(idx, 'symbol', itemSymbolType);
// }
// if (itemSymbolSize != null) {
// // PENDING Transform symbolSize ?
// data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
// }
// });
// }
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录