MCPcopy
hub / github.com/apache/echarts / eachComponent

Method eachComponent

src/model/Global.ts:718–748  ·  view source on GitHub ↗
(
        mainType: string | QueryConditionKindA | EachComponentAllCallback,
        cb?: EachComponentInMainTypeCallback | T,
        context?: T
    )

Source from the content-addressed store, hash-verified

716 context?: T
717 ): void;
718 eachComponent<T>(
719 mainType: string | QueryConditionKindA | EachComponentAllCallback,
720 cb?: EachComponentInMainTypeCallback | T,
721 context?: T
722 ) {
723 const componentsMap = this._componentsMap;
724
725 if (isFunction(mainType)) {
726 const ctxForAll = cb as T;
727 const cbForAll = mainType as EachComponentAllCallback;
728 componentsMap.each(function (cmpts, componentType) {
729 for (let i = 0; cmpts && i < cmpts.length; i++) {
730 const cmpt = cmpts[i];
731 cmpt && cbForAll.call(ctxForAll, componentType, cmpt, cmpt.componentIndex);
732 }
733 });
734 }
735 else {
736 const cmpts = isString(mainType)
737 ? componentsMap.get(mainType)
738 : isObject(mainType)
739 ? this.findComponents(mainType)
740 : null;
741 for (let i = 0; cmpts && i < cmpts.length; i++) {
742 const cmpt = cmpts[i];
743 cmpt && (cb as EachComponentInMainTypeCallback).call(
744 context, cmpt, cmpt.componentIndex
745 );
746 }
747 }
748 }
749
750 /**
751 * Get series list before filtered by name.

Callers 15

renderMethod · 0.80
installSunburstActionFunction · 0.80
installFunction · 0.80
installFunction · 0.80
installTreeActionFunction · 0.80
installTreemapActionFunction · 0.80
getSeriesIndicesFunction · 0.80
visualEncoding.tsFile · 0.80
visualMapActionHanderFunction · 0.80

Calls 5

findComponentsMethod · 0.95
isFunctionFunction · 0.50
isObjectFunction · 0.50
eachMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected