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

Function registerExternalTransform

src/data/helper/transform.ts:333–361  ·  view source on GitHub ↗
(
    externalTransform: ExternalDataTransform
)

Source from the content-addressed store, hash-verified

331const externalTransformMap = createHashMap<ExternalDataTransform, string>();
332
333export function registerExternalTransform(
334 externalTransform: ExternalDataTransform
335): void {
336 externalTransform = clone(externalTransform);
337 let type = externalTransform.type;
338 let errMsg = '';
339 if (!type) {
340 if (__DEV__) {
341 errMsg = 'Must have a `type` when `registerTransform`.';
342 }
343 throwError(errMsg);
344 }
345 const typeParsed = type.split(':');
346 if (typeParsed.length !== 2) {
347 if (__DEV__) {
348 errMsg = 'Name must include namespace like "ns:regression".';
349 }
350 throwError(errMsg);
351 }
352 // Namespace 'echarts:xxx' is official namespace, where the transforms should
353 // be called directly via 'xxx' rather than 'echarts:xxx'.
354 let isBuiltIn = false;
355 if (typeParsed[0] === 'echarts') {
356 type = typeParsed[1];
357 isBuiltIn = true;
358 }
359 externalTransform.__isBuiltIn = isBuiltIn;
360 externalTransformMap.set(type, externalTransform);
361}
362
363export function applyDataTransform(
364 rawTransOption: DataTransformOption | PipedDataTransformOption,

Callers

nothing calls this directly

Calls 2

throwErrorFunction · 0.90
cloneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…