MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / updateDirectly

Function updateDirectly

libs/echarts/echarts-en.simple.js:28167–28206  ·  view source on GitHub ↗

* @private

(ecIns, method, payload, mainType, subType)

Source from the content-addressed store, hash-verified

28165 * @private
28166 */
28167function updateDirectly(ecIns, method, payload, mainType, subType) {
28168 var ecModel = ecIns._model;
28169
28170 // broadcast
28171 if (!mainType) {
28172 // FIXME
28173 // Chart will not be update directly here, except set dirty.
28174 // But there is no such scenario now.
28175 each(ecIns._componentsViews.concat(ecIns._chartsViews), callView);
28176 return;
28177 }
28178
28179 var query = {};
28180 query[mainType + 'Id'] = payload[mainType + 'Id'];
28181 query[mainType + 'Index'] = payload[mainType + 'Index'];
28182 query[mainType + 'Name'] = payload[mainType + 'Name'];
28183
28184 var condition = {mainType: mainType, query: query};
28185 subType && (condition.subType = subType); // subType may be '' by parseClassType;
28186
28187 var excludeSeriesId = payload.excludeSeriesId;
28188 if (excludeSeriesId != null) {
28189 excludeSeriesId = createHashMap(normalizeToArray(excludeSeriesId));
28190 }
28191
28192 // If dispatchAction before setOption, do nothing.
28193 ecModel && ecModel.eachComponent(condition, function (model) {
28194 if (!excludeSeriesId || excludeSeriesId.get(model.id) == null) {
28195 callView(ecIns[
28196 mainType === 'series' ? '_chartsMap' : '_componentsMap'
28197 ][model.__viewId]);
28198 }
28199 }, ecIns);
28200
28201 function callView(view) {
28202 view && view.__alive && view[method] && view[method](
28203 view.__model, ecModel, ecIns._api, payload
28204 );
28205 }
28206}
28207
28208/**
28209 * Resize the chart

Callers 1

doDispatchActionFunction · 0.70

Calls 5

eachFunction · 0.85
createHashMapFunction · 0.70
normalizeToArrayFunction · 0.70
callViewFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected