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

Function cloneRawData

src/data/helper/transform.ts:276–304  ·  view source on GitHub ↗
(upstream: Source)

Source from the content-addressed store, hash-verified

274}
275
276function cloneRawData(upstream: Source): Source['data'] {
277 const sourceFormat = upstream.sourceFormat;
278 const data = upstream.data;
279
280 if (!isSupportedSourceFormat(sourceFormat)) {
281 let errMsg = '';
282 if (__DEV__) {
283 errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;
284 }
285 throwError(errMsg);
286 }
287
288 if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {
289 const result = [];
290 for (let i = 0, len = data.length; i < len; i++) {
291 // Not strictly clone for performance
292 result.push((data as OptionSourceDataArrayRows)[i].slice());
293 }
294 return result;
295 }
296 else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {
297 const result = [];
298 for (let i = 0, len = data.length; i < len; i++) {
299 // Not strictly clone for performance
300 result.push(extend({}, (data as OptionSourceDataObjectRows)[i]));
301 }
302 return result;
303 }
304}
305
306function getDimensionInfo(
307 dimensions: ExternalDimensionDefinition[],

Callers

nothing calls this directly

Calls 3

throwErrorFunction · 0.90
isSupportedSourceFormatFunction · 0.85
extendFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…