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

Method doConvertPixelImpl

src/core/echarts.ts:2105–2136  ·  view source on GitHub ↗
(
            ecIns: ECharts,
            methodName: 'convertFromPixel' | 'convertToPixel' | 'convertToLayout',
            finder: ModelFinder,
            value: number | number[] | CoordinateSystemDataCoord,
            opt: unknown
        )

Source from the content-addressed store, hash-verified

2103 opt: unknown
2104 ): CoordinateSystemDataLayout;
2105 function doConvertPixelImpl(
2106 ecIns: ECharts,
2107 methodName: 'convertFromPixel' | 'convertToPixel' | 'convertToLayout',
2108 finder: ModelFinder,
2109 value: number | number[] | CoordinateSystemDataCoord,
2110 opt: unknown
2111 ) {
2112 if (ecIns._disposed) {
2113 disposedWarning(ecIns.id);
2114 return;
2115 }
2116 const ecModel = ecIns._model;
2117 const coordSysList = ecIns._coordSysMgr.getCoordinateSystems();
2118 let result;
2119
2120 const parsedFinder = modelUtil.parseFinder(ecModel, finder);
2121
2122 for (let i = 0; i < coordSysList.length; i++) {
2123 const coordSys = coordSysList[i];
2124 if (coordSys[methodName]
2125 && (result = coordSys[methodName](ecModel, parsedFinder, value as any, opt)) != null
2126 ) {
2127 return result;
2128 }
2129 }
2130
2131 if (__DEV__) {
2132 warn(
2133 'No coordinate system that supports ' + methodName + ' found by the given finder.'
2134 );
2135 }
2136 };
2137 doConvertPixel = doConvertPixelImpl;
2138
2139 updateStreamModes = function (ecIns: ECharts, ecModel: GlobalModel): void {

Callers

nothing calls this directly

Calls 3

warnFunction · 0.90
disposedWarningFunction · 0.85
getCoordinateSystemsMethod · 0.45

Tested by

no test coverage detected