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

Function doPrepare

libs/echarts/echarts.simple.js:28555–28584  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

28553 : ecModel.eachSeries(doPrepare);
28554
28555 function doPrepare(model) {
28556 // Consider: id same and type changed.
28557 var viewId = '_ec_' + model.id + '_' + model.type;
28558 var view = viewMap[viewId];
28559 if (!view) {
28560 var classType = parseClassType(model.type);
28561 var Clazz = isComponent
28562 ? Component.getClass(classType.main, classType.sub)
28563 : Chart.getClass(classType.sub);
28564
28565 if (__DEV__) {
28566 assert(Clazz, classType.sub + ' does not exist.');
28567 }
28568
28569 view = new Clazz();
28570 view.init(ecModel, api);
28571 viewMap[viewId] = view;
28572 viewList.push(view);
28573 zr.add(view.group);
28574 }
28575
28576 model.__viewId = view.__id = viewId;
28577 view.__alive = true;
28578 view.__model = model;
28579 view.group.__ecComponentInfo = {
28580 mainType: model.mainType,
28581 index: model.componentIndex
28582 };
28583 !isComponent && scheduler.prepareView(view, model, ecModel, api);
28584 }
28585
28586 for (var i = 0; i < viewList.length;) {
28587 var view = viewList[i];

Callers 1

prepareViewFunction · 0.70

Calls 3

pushMethod · 0.80
initMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected