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

Method appendValues

src/data/DataStore.ts:345–379  ·  view source on GitHub ↗
(values: any[][], minFillLen?: number)

Source from the content-addressed store, hash-verified

343 }
344
345 appendValues(values: any[][], minFillLen?: number): { start: number; end: number } {
346 const chunks = this._chunks;
347 const dimensions = this._dimensions;
348 const dimLen = dimensions.length;
349 const rawExtent = this._rawExtent;
350
351 const start = this.count();
352 const end = start + Math.max(values.length, minFillLen || 0);
353
354 for (let i = 0; i < dimLen; i++) {
355 const dim = dimensions[i];
356 prepareStore(chunks, i, dim.type, end, true);
357 }
358
359 const emptyDataItem: number[] = [];
360 for (let idx = start; idx < end; idx++) {
361 const sourceIdx = idx - start;
362 // Store the data by dimensions
363 for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
364 const dim = dimensions[dimIdx];
365 const val = defaultDimValueGetters.arrayRows.call(
366 this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx
367 ) as ParsedValueNumeric;
368 (chunks[dimIdx] as any)[idx] = val;
369
370 const dimRawExtent = rawExtent[dimIdx];
371 val < dimRawExtent[0] && (dimRawExtent[0] = val);
372 val > dimRawExtent[1] && (dimRawExtent[1] = val);
373 }
374 }
375
376 this._rawCount = this._count = end;
377
378 return {start, end};
379 }
380
381 private _initDataFromProvider(
382 start: number,

Callers 1

SeriesData.test.tsFile · 0.45

Calls 2

countMethod · 0.95
prepareStoreFunction · 0.85

Tested by

no test coverage detected