MCPcopy Index your code
hub / github.com/apache/echarts / _innerGetDataStore

Method _innerGetDataStore

src/data/helper/sourceManager.ts:386–423  ·  view source on GitHub ↗
(
        storeDims: DataStoreDimensionDefine[],
        seriesSource: Source,
        sourceReadKey: string
    )

Source from the content-addressed store, hash-verified

384 }
385
386 private _innerGetDataStore(
387 storeDims: DataStoreDimensionDefine[],
388 seriesSource: Source,
389 sourceReadKey: string
390 ): DataStore | undefined {
391 // TODO Can use other sourceIndex?
392 const sourceIndex = 0;
393
394 const storeList = this._storeList;
395
396 let cachedStoreMap = storeList[sourceIndex];
397
398 if (!cachedStoreMap) {
399 cachedStoreMap = storeList[sourceIndex] = {};
400 }
401
402 let cachedStore = cachedStoreMap[sourceReadKey];
403 if (!cachedStore) {
404 const upSourceMgr = this._getUpstreamSourceManagers()[0];
405
406 if (isSeries(this._sourceHost) && upSourceMgr) {
407 cachedStore = upSourceMgr._innerGetDataStore(
408 storeDims, seriesSource, sourceReadKey
409 );
410 }
411 else {
412 cachedStore = new DataStore();
413 // Always create store from source of series.
414 cachedStore.initData(
415 new DefaultDataProvider(seriesSource, storeDims.length),
416 storeDims
417 );
418 }
419 cachedStoreMap[sourceReadKey] = cachedStore;
420 }
421
422 return cachedStore;
423 }
424
425 /**
426 * PENDING: Is it fast enough?

Callers 1

getSharedDataStoreMethod · 0.95

Calls 3

isSeriesFunction · 0.85
initDataMethod · 0.45

Tested by

no test coverage detected