MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / createOverallStageTask

Function createOverallStageTask

libs/echarts/echarts.simple.js:25881–25953  ·  view source on GitHub ↗
(scheduler, stageHandler, stageHandlerRecord, ecModel, api)

Source from the content-addressed store, hash-verified

25879}
25880
25881function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) {
25882 var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask
25883 // For overall task, the function only be called on reset stage.
25884 || createTask({reset: overallTaskReset});
25885
25886 overallTask.context = {
25887 ecModel: ecModel,
25888 api: api,
25889 overallReset: stageHandler.overallReset,
25890 scheduler: scheduler
25891 };
25892
25893 // Reuse orignal stubs.
25894 var agentStubMap = overallTask.agentStubMap = overallTask.agentStubMap || createHashMap();
25895
25896 var seriesType = stageHandler.seriesType;
25897 var getTargetSeries = stageHandler.getTargetSeries;
25898 var overallProgress = true;
25899 var modifyOutputEnd = stageHandler.modifyOutputEnd;
25900
25901 // An overall task with seriesType detected or has `getTargetSeries`, we add
25902 // stub in each pipelines, it will set the overall task dirty when the pipeline
25903 // progress. Moreover, to avoid call the overall task each frame (too frequent),
25904 // we set the pipeline block.
25905 if (seriesType) {
25906 ecModel.eachRawSeriesByType(seriesType, createStub);
25907 }
25908 else if (getTargetSeries) {
25909 getTargetSeries(ecModel, api).each(createStub);
25910 }
25911 // Otherwise, (usually it is legancy case), the overall task will only be
25912 // executed when upstream dirty. Otherwise the progressive rendering of all
25913 // pipelines will be disabled unexpectedly. But it still needs stubs to receive
25914 // dirty info from upsteam.
25915 else {
25916 overallProgress = false;
25917 each$1(ecModel.getSeries(), createStub);
25918 }
25919
25920 function createStub(seriesModel) {
25921 var pipelineId = seriesModel.uid;
25922 var stub = agentStubMap.get(pipelineId);
25923 if (!stub) {
25924 stub = agentStubMap.set(pipelineId, createTask(
25925 {reset: stubReset, onDirty: stubOnDirty}
25926 ));
25927 // When the result of `getTargetSeries` changed, the overallTask
25928 // should be set as dirty and re-performed.
25929 overallTask.dirty();
25930 }
25931 stub.context = {
25932 model: seriesModel,
25933 overallProgress: overallProgress,
25934 modifyOutputEnd: modifyOutputEnd
25935 };
25936 stub.agent = overallTask;
25937 stub.__block = overallProgress;
25938

Callers 1

echarts.simple.jsFile · 0.70

Calls 5

createTaskFunction · 0.70
createHashMapFunction · 0.70
each$1Function · 0.70
getMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected