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

Function visitComponent

libs/echarts/echarts.simple.js:21373–21457  ·  view source on GitHub ↗
(mainType, dependencies)

Source from the content-addressed store, hash-verified

21371 );
21372
21373 function visitComponent(mainType, dependencies) {
21374
21375 var newCptOptionList = normalizeToArray(newOption[mainType]);
21376
21377 var mapResult = mappingToExists(
21378 componentsMap.get(mainType), newCptOptionList
21379 );
21380
21381 makeIdAndName(mapResult);
21382
21383 // Set mainType and complete subType.
21384 each$1(mapResult, function (item, index) {
21385 var opt = item.option;
21386 if (isObject$1(opt)) {
21387 item.keyInfo.mainType = mainType;
21388 item.keyInfo.subType = determineSubType(mainType, opt, item.exist);
21389 }
21390 });
21391
21392 var dependentModels = getComponentsByTypes(
21393 componentsMap, dependencies
21394 );
21395
21396 option[mainType] = [];
21397 componentsMap.set(mainType, []);
21398
21399 each$1(mapResult, function (resultItem, index) {
21400 var componentModel = resultItem.exist;
21401 var newCptOption = resultItem.option;
21402
21403 assert$1(
21404 isObject$1(newCptOption) || componentModel,
21405 'Empty component definition'
21406 );
21407
21408 // Consider where is no new option and should be merged using {},
21409 // see removeEdgeAndAdd in topologicalTravel and
21410 // ComponentModel.getAllClassMainTypes.
21411 if (!newCptOption) {
21412 componentModel.mergeOption({}, this);
21413 componentModel.optionUpdated({}, false);
21414 }
21415 else {
21416 var ComponentModelClass = ComponentModel.getClass(
21417 mainType, resultItem.keyInfo.subType, true
21418 );
21419
21420 if (componentModel && componentModel.constructor === ComponentModelClass) {
21421 componentModel.name = resultItem.keyInfo.name;
21422 // componentModel.settingTask && componentModel.settingTask.dirty();
21423 componentModel.mergeOption(newCptOption, this);
21424 componentModel.optionUpdated(newCptOption, false);
21425 }
21426 else {
21427 // PENDING Global as parent ?
21428 var extraOpt = extend(
21429 {
21430 dependentModels: dependentModels,

Callers

nothing calls this directly

Calls 13

normalizeToArrayFunction · 0.70
mappingToExistsFunction · 0.70
makeIdAndNameFunction · 0.70
each$1Function · 0.70
isObject$1Function · 0.70
determineSubTypeFunction · 0.70
getComponentsByTypesFunction · 0.70
assert$1Function · 0.70
extendFunction · 0.70
createSeriesIndicesFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected