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

Method modify

src/data/SeriesData.ts:1037–1067  ·  view source on GitHub ↗
(
        dims: ItrParamDims,
        cb: MapCb<Ctx>,
        ctx?: Ctx,
        ctxCompat?: Ctx
    )

Source from the content-addressed store, hash-verified

1035 modify<Ctx>(dims: [DimensionLoose], cb: MapCb1<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
1036 modify<Ctx>(dims: [DimensionLoose, DimensionLoose], cb: MapCb2<Ctx>, ctx?: Ctx, ctxCompat?: Ctx): void;
1037 modify<Ctx>(
1038 dims: ItrParamDims,
1039 cb: MapCb<Ctx>,
1040 ctx?: Ctx,
1041 ctxCompat?: Ctx
1042 ): void {
1043 // ctxCompat just for compat echarts3
1044 const fCtx = (ctx || ctxCompat || this) as CtxOrList<Ctx>;
1045
1046 if (__DEV__) {
1047 zrUtil.each(normalizeDimensions(dims), dim => {
1048 const dimInfo = this.getDimensionInfo(dim);
1049 if (!dimInfo.isCalculationCoord) {
1050 console.error('Danger: only stack dimension can be modified');
1051 }
1052 });
1053 }
1054
1055 const dimIndices = map(
1056 normalizeDimensions(dims), this._getStoreDimIndex, this
1057 );
1058
1059 // If do shallow clone here, if there are too many stacked series,
1060 // it still cost lots of memory, because `_store.dimensions` are not shared.
1061 // We should consider there probably be shallow clone happen in each series
1062 // in consequent filter/map.
1063 this._store.modify(
1064 dimIndices,
1065 fCtx ? zrUtil.bind(cb, fCtx) : cb
1066 );
1067 }
1068
1069 /**
1070 * Large data down sampling on given dimension

Callers

nothing calls this directly

Calls 2

getDimensionInfoMethod · 0.95
eachMethod · 0.45

Tested by

no test coverage detected