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

Method getComponent

src/model/Global.ts:572–587  ·  view source on GitHub ↗

* @param idx If not specified, return the first one.

(mainType: ComponentMainType, idx?: number)

Source from the content-addressed store, hash-verified

570 * @param idx If not specified, return the first one.
571 */
572 getComponent(mainType: ComponentMainType, idx?: number): ComponentModel {
573 const list = this._componentsMap.get(mainType);
574 if (list) {
575 const cmpt = list[idx || 0];
576 if (cmpt) {
577 return cmpt;
578 }
579 else if (idx == null) {
580 for (let i = 0; i < list.length; i++) {
581 if (list[i]) {
582 return list[i];
583 }
584 }
585 }
586 }
587 }
588
589 /**
590 * @return Never be null/undefined.

Callers 15

getViewGroupFunction · 0.80
interval.test.tsFile · 0.80
setOption.test.tsFile · 0.80
getVisualFunction · 0.80
helper.test.tsFile · 0.80
getSeriesFunction · 0.80
getLegendOptionFunction · 0.80
getTimelineComponentFunction · 0.80
getSeriesFunction · 0.80
getModelFunction · 0.80
renderMethod · 0.80
mapSymbolLayoutFunction · 0.80

Calls 1

getMethod · 0.45

Tested by 6

getVisualFunction · 0.64
getSeriesFunction · 0.64
getLegendOptionFunction · 0.64
getTimelineComponentFunction · 0.64
getSeriesFunction · 0.64
getModelFunction · 0.64