@visactor/vchart 1.12.5 → 1.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +2 -2
- package/build/index.js +1424 -1192
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +17 -11
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/chart-meta/data.d.ts +1 -2
- package/cjs/chart/chart-meta/data.js +11 -11
- package/cjs/chart/chart-meta/data.js.map +1 -1
- package/cjs/chart/mosaic/mosaic.d.ts +0 -1
- package/cjs/chart/mosaic/mosaic.js +0 -3
- package/cjs/chart/mosaic/mosaic.js.map +1 -1
- package/cjs/chart/pie/interface.d.ts +2 -2
- package/cjs/chart/pie/interface.js.map +1 -1
- package/cjs/chart/polar/interface.d.ts +2 -0
- package/cjs/chart/polar/interface.js.map +1 -1
- package/cjs/compile/compilable-base.js +2 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -1
- package/cjs/compile/mark/compilable-mark.js +4 -4
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/compile/mark/interface.d.ts +1 -0
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/compile/util.js +1 -2
- package/cjs/component/axis/base-axis.d.ts +1 -2
- package/cjs/component/axis/base-axis.js +0 -3
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +5 -3
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +0 -1
- package/cjs/component/axis/polar/axis.js +4 -20
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/interface/spec.d.ts +3 -1
- package/cjs/component/axis/polar/interface/spec.js.map +1 -1
- package/cjs/component/base/base-component.js +1 -3
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +0 -1
- package/cjs/component/custom-mark/custom-mark.js +1 -12
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +10 -7
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/util.js +11 -3
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +1 -2
- package/cjs/component/label/base-label.js +0 -3
- package/cjs/component/label/base-label.js.map +1 -1
- package/cjs/component/label/label.d.ts +0 -1
- package/cjs/component/label/label.js +2 -12
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/total-label.d.ts +1 -1
- package/cjs/component/label/total-label.js +5 -12
- package/cjs/component/label/total-label.js.map +1 -1
- package/cjs/component/label/util.d.ts +1 -1
- package/cjs/component/label/util.js +12 -7
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/util.d.ts +2 -2
- package/cjs/constant/correlation.js +1 -2
- package/cjs/constant/layout.js +2 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +1 -1
- package/cjs/core/vchart.js +22 -25
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.d.ts +1 -2
- package/cjs/data/initialize.js +5 -5
- package/cjs/data/initialize.js.map +1 -1
- package/cjs/plugin/chart/media-query/media-query.d.ts +1 -0
- package/cjs/plugin/chart/media-query/media-query.js +3 -1
- package/cjs/plugin/chart/media-query/media-query.js.map +1 -1
- package/cjs/plugin/chart/plugin-service.d.ts +2 -0
- package/cjs/plugin/chart/plugin-service.js +5 -0
- package/cjs/plugin/chart/plugin-service.js.map +1 -1
- package/cjs/region/region.js +2 -3
- package/cjs/region/region.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +6 -5
- package/cjs/series/base/base-series.js +25 -15
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/base/constant.js +1 -0
- package/cjs/series/base/constant.js.map +1 -1
- package/cjs/series/funnel/funnel.d.ts +1 -0
- package/cjs/series/funnel/funnel.js +7 -6
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/funnel/interface.d.ts +3 -1
- package/cjs/series/funnel/interface.js.map +1 -1
- package/cjs/series/gauge/interface.d.ts +1 -1
- package/cjs/series/gauge/interface.js.map +1 -1
- package/cjs/series/polar/animation.d.ts +8 -11
- package/cjs/series/polar/animation.js +18 -23
- package/cjs/series/polar/animation.js.map +1 -1
- package/cjs/series/radar/animation.d.ts +0 -3
- package/cjs/series/radar/animation.js +4 -4
- package/cjs/series/radar/animation.js.map +1 -1
- package/cjs/series/radar/radar.js +10 -7
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/theme/builtin/common/series/linear-progress.js +4 -1
- package/cjs/theme/builtin/common/series/linear-progress.js.map +1 -1
- package/cjs/theme/builtin/dark/color-scheme.js +2 -1
- package/cjs/theme/builtin/dark/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/light/color-scheme.js +2 -1
- package/cjs/theme/builtin/light/color-scheme.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +5 -2
- package/cjs/typings/spec/common.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +18 -12
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/chart-meta/data.d.ts +1 -2
- package/esm/chart/chart-meta/data.js +12 -10
- package/esm/chart/chart-meta/data.js.map +1 -1
- package/esm/chart/mosaic/mosaic.d.ts +0 -1
- package/esm/chart/mosaic/mosaic.js +0 -3
- package/esm/chart/mosaic/mosaic.js.map +1 -1
- package/esm/chart/pie/interface.d.ts +2 -2
- package/esm/chart/pie/interface.js.map +1 -1
- package/esm/chart/polar/interface.d.ts +2 -0
- package/esm/chart/polar/interface.js.map +1 -1
- package/esm/compile/compilable-base.js +2 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -1
- package/esm/compile/mark/compilable-mark.js +5 -4
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/compile/mark/interface.d.ts +1 -0
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/compile/util.js +1 -2
- package/esm/component/axis/base-axis.d.ts +1 -2
- package/esm/component/axis/base-axis.js +0 -3
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +6 -4
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +0 -1
- package/esm/component/axis/polar/axis.js +4 -22
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/interface/spec.d.ts +3 -1
- package/esm/component/axis/polar/interface/spec.js.map +1 -1
- package/esm/component/base/base-component.js +1 -3
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +0 -1
- package/esm/component/custom-mark/custom-mark.js +0 -13
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +7 -6
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/util.js +11 -2
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/label/base-label.d.ts +1 -2
- package/esm/component/label/base-label.js +0 -3
- package/esm/component/label/base-label.js.map +1 -1
- package/esm/component/label/label.d.ts +0 -1
- package/esm/component/label/label.js +1 -13
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/total-label.d.ts +1 -1
- package/esm/component/label/total-label.js +4 -13
- package/esm/component/label/total-label.js.map +1 -1
- package/esm/component/label/util.d.ts +1 -1
- package/esm/component/label/util.js +12 -7
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/util.d.ts +2 -2
- package/esm/constant/correlation.js +1 -2
- package/esm/constant/layout.js +2 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +1 -1
- package/esm/core/vchart.js +24 -27
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.d.ts +1 -2
- package/esm/data/initialize.js +6 -7
- package/esm/data/initialize.js.map +1 -1
- package/esm/plugin/chart/media-query/media-query.d.ts +1 -0
- package/esm/plugin/chart/media-query/media-query.js +3 -1
- package/esm/plugin/chart/media-query/media-query.js.map +1 -1
- package/esm/plugin/chart/plugin-service.d.ts +2 -0
- package/esm/plugin/chart/plugin-service.js +5 -0
- package/esm/plugin/chart/plugin-service.js.map +1 -1
- package/esm/region/region.js +2 -3
- package/esm/region/region.js.map +1 -1
- package/esm/series/base/base-series.d.ts +6 -5
- package/esm/series/base/base-series.js +23 -14
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/base/constant.js +1 -0
- package/esm/series/base/constant.js.map +1 -1
- package/esm/series/funnel/funnel.d.ts +1 -0
- package/esm/series/funnel/funnel.js +7 -6
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/funnel/interface.d.ts +3 -1
- package/esm/series/funnel/interface.js.map +1 -1
- package/esm/series/gauge/interface.d.ts +1 -1
- package/esm/series/gauge/interface.js.map +1 -1
- package/esm/series/polar/animation.d.ts +8 -11
- package/esm/series/polar/animation.js +17 -24
- package/esm/series/polar/animation.js.map +1 -1
- package/esm/series/radar/animation.d.ts +0 -3
- package/esm/series/radar/animation.js +4 -4
- package/esm/series/radar/animation.js.map +1 -1
- package/esm/series/radar/radar.js +10 -7
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/theme/builtin/common/series/linear-progress.js +4 -1
- package/esm/theme/builtin/common/series/linear-progress.js.map +1 -1
- package/esm/theme/builtin/dark/color-scheme.js +2 -1
- package/esm/theme/builtin/dark/color-scheme.js.map +1 -1
- package/esm/theme/builtin/light/color-scheme.js +2 -1
- package/esm/theme/builtin/light/color-scheme.js.map +1 -1
- package/esm/typings/spec/common.d.ts +5 -2
- package/esm/typings/spec/common.js.map +1 -1
- package/package.json +18 -18
package/esm/core/vchart.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare class VChart implements IVChart {
|
|
|
74
74
|
private _context;
|
|
75
75
|
private _isReleased;
|
|
76
76
|
private _chartPlugin?;
|
|
77
|
+
private _onResize?;
|
|
77
78
|
constructor(spec: ISpec, options: IInitOption);
|
|
78
79
|
private _setNewSpec;
|
|
79
80
|
private _getSpecFromOriginalSpec;
|
|
@@ -89,7 +90,6 @@ export declare class VChart implements IVChart {
|
|
|
89
90
|
height: number;
|
|
90
91
|
};
|
|
91
92
|
private _doResize;
|
|
92
|
-
private _onResize;
|
|
93
93
|
private _initDataSet;
|
|
94
94
|
updateCustomConfigAndRerender(updateSpecResult: IUpdateSpecResult | (() => IUpdateSpecResult), sync?: boolean, option?: IVChartRenderOption): IVChart | Promise<IVChart>;
|
|
95
95
|
protected _updateCustomConfigAndRecompile(updateSpecResult: IUpdateSpecResult, option?: IVChartRenderOption): boolean;
|
package/esm/core/vchart.js
CHANGED
|
@@ -42,7 +42,7 @@ import { DataSet, dataViewParser, DataView } from "@visactor/vdataset";
|
|
|
42
42
|
|
|
43
43
|
import { vglobal } from "@visactor/vrender-core";
|
|
44
44
|
|
|
45
|
-
import { isString, isValid, isNil, array,
|
|
45
|
+
import { isString, isValid, isNil, array, specTransform, functionTransform } from "../util";
|
|
46
46
|
|
|
47
47
|
import { createID } from "../util/id";
|
|
48
48
|
|
|
@@ -82,7 +82,7 @@ import { ChartEvent, VGRAMMAR_HOOK_EVENT } from "../constant/event";
|
|
|
82
82
|
|
|
83
83
|
import { DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH } from "../constant/base";
|
|
84
84
|
|
|
85
|
-
import { isArray, isEmpty, Logger, merge as mergeOrigin, isFunction, LoggerLevel, isEqual, get, cloneDeep, isObject } from "@visactor/vutils";
|
|
85
|
+
import { isArray, isEmpty, Logger, merge as mergeOrigin, isFunction, LoggerLevel, isEqual, get, cloneDeep, isObject, throttle } from "@visactor/vutils";
|
|
86
86
|
|
|
87
87
|
import { InstanceManager } from "./instance-manager";
|
|
88
88
|
|
|
@@ -181,7 +181,7 @@ export class VChart {
|
|
|
181
181
|
return this._dataSet;
|
|
182
182
|
}
|
|
183
183
|
constructor(spec, options) {
|
|
184
|
-
var _a, _b, _c, _d, _e, _f;
|
|
184
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
185
185
|
this.id = createID(), this._userEvents = [], this._autoSize = !0, this._option = {
|
|
186
186
|
mode: RenderModeEnum["desktop-browser"],
|
|
187
187
|
onError: msg => {
|
|
@@ -190,9 +190,13 @@ export class VChart {
|
|
|
190
190
|
optimize: {
|
|
191
191
|
disableCheckGraphicWidthOutRange: !0
|
|
192
192
|
}
|
|
193
|
-
}, this._observer = null, this._context = {}, this.
|
|
194
|
-
this.
|
|
195
|
-
|
|
193
|
+
}, this._observer = null, this._context = {}, this._doResize = () => {
|
|
194
|
+
const {width: width, height: height} = this.getCurrentSize();
|
|
195
|
+
this._currentSize.width === width && this._currentSize.height === height || (this._currentSize = {
|
|
196
|
+
width: width,
|
|
197
|
+
height: height
|
|
198
|
+
}, this.resizeSync(width, height));
|
|
199
|
+
}, this._renderSync = (option = {}) => {
|
|
196
200
|
var _a;
|
|
197
201
|
const self = this;
|
|
198
202
|
return this._beforeRender(option) ? (null === (_a = this._compiler) || void 0 === _a || _a.render(option.morphConfig),
|
|
@@ -200,6 +204,7 @@ export class VChart {
|
|
|
200
204
|
}, this._updateSpec = (spec, forceMerge = !1, userUpdateOptions) => {
|
|
201
205
|
var _a, _b;
|
|
202
206
|
const lastSpec = this._spec, result = {
|
|
207
|
+
changeBackground: !1,
|
|
203
208
|
reTransformSpec: !1,
|
|
204
209
|
change: !1,
|
|
205
210
|
reMake: !1,
|
|
@@ -214,13 +219,13 @@ export class VChart {
|
|
|
214
219
|
if (result.reSize = reSize, null === (_b = null === (_a = this._compiler) || void 0 === _a ? void 0 : _a.getVGrammarView()) || void 0 === _b || _b.updateLayoutTag(),
|
|
215
220
|
this._spec.type !== lastSpec.type) return result.reMake = !0, result.reTransformSpec = !0,
|
|
216
221
|
result.change = !0, result.changeTheme = !0, result;
|
|
217
|
-
this._initChartSpec(this._spec, "
|
|
222
|
+
this._initChartSpec(this._spec, "updateSpec");
|
|
218
223
|
const res = mergeUpdateResult(this._chart.updateSpec(this._spec), result);
|
|
219
224
|
return userUpdateOptions ? Object.assign(Object.assign({}, res), userUpdateOptions) : res;
|
|
220
225
|
}, this._option = mergeOrigin(this._option, {
|
|
221
226
|
animation: !1 !== spec.animation
|
|
222
227
|
}, options), this._onError = null === (_a = this._option) || void 0 === _a ? void 0 : _a.onError;
|
|
223
|
-
const
|
|
228
|
+
const _j = this._option, {dom: dom, renderCanvas: renderCanvas, mode: mode, stage: stage, poptip: poptip} = _j, restOptions = __rest(_j, [ "dom", "renderCanvas", "mode", "stage", "poptip" ]), isTrueBrowseEnv = isTrueBrowser(mode);
|
|
224
229
|
isTrueBrowseEnv ? registerBrowserEnv() : "node" === mode && registerNodeEnv(), isTrueBrowseEnv && dom && (this._container = isString(dom) ? vglobal.getElementById(dom) : dom),
|
|
225
230
|
renderCanvas && (this._canvas = renderCanvas), stage && (this._stage = stage), "node" === mode || this._container || this._canvas || this._stage ? (this._viewBox = this._option.viewBox,
|
|
226
231
|
this._currentThemeName = ThemeManager.getCurrentThemeName(), this._setNewSpec(spec),
|
|
@@ -239,7 +244,7 @@ export class VChart {
|
|
|
239
244
|
this._compiler.initView(), this._setFontFamilyTheme(null === (_d = this._currentTheme) || void 0 === _d ? void 0 : _d.fontFamily),
|
|
240
245
|
this._initDataSet(this._option.dataSet), this._autoSize = !!isTrueBrowseEnv && (null === (_f = null !== (_e = spec.autoFit) && void 0 !== _e ? _e : this._option.autoFit) || void 0 === _f || _f),
|
|
241
246
|
this._bindResizeEvent(), this._bindVGrammarViewEvent(), this._initChartPlugin(),
|
|
242
|
-
InstanceManager.registerInstance(this)) : null === (_b = this._option) || void 0 === _b || _b.onError("please specify container or renderCanvas!");
|
|
247
|
+
InstanceManager.registerInstance(this), null === (_h = null === (_g = this._option.performanceHook) || void 0 === _g ? void 0 : _g.afterCreateVChart) || void 0 === _h || _h.call(_g, this)) : null === (_b = this._option) || void 0 === _b || _b.onError("please specify container or renderCanvas!");
|
|
243
248
|
}
|
|
244
249
|
_setNewSpec(spec, forceMerge) {
|
|
245
250
|
return !!spec && (isString(spec) && (spec = JSON.parse(spec)), forceMerge && this._originalSpec && (spec = mergeSpec({}, this._originalSpec, spec)),
|
|
@@ -291,12 +296,13 @@ export class VChart {
|
|
|
291
296
|
})));
|
|
292
297
|
}
|
|
293
298
|
_bindResizeEvent() {
|
|
294
|
-
var _a;
|
|
299
|
+
var _a, _b;
|
|
295
300
|
if (this._autoSize) {
|
|
296
|
-
if (this.
|
|
301
|
+
if (this._onResize = throttle(this._doResize, null !== (_a = this._option.resizeDelay) && void 0 !== _a ? _a : 100),
|
|
302
|
+
this._container) {
|
|
297
303
|
const ResizeObserverWindow = window.ResizeObserver;
|
|
298
304
|
ResizeObserverWindow && (this._observer = new ResizeObserverWindow(this._onResize),
|
|
299
|
-
null === (
|
|
305
|
+
null === (_b = this._observer) || void 0 === _b || _b.observe(this._container));
|
|
300
306
|
}
|
|
301
307
|
window.addEventListener("resize", this._onResize);
|
|
302
308
|
}
|
|
@@ -317,13 +323,6 @@ export class VChart {
|
|
|
317
323
|
height: null !== (_d = null === (_c = this._currentSize) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : DEFAULT_CHART_HEIGHT
|
|
318
324
|
});
|
|
319
325
|
}
|
|
320
|
-
_doResize() {
|
|
321
|
-
const {width: width, height: height} = this.getCurrentSize();
|
|
322
|
-
this._currentSize.width === width && this._currentSize.height === height || (this._currentSize = {
|
|
323
|
-
width: width,
|
|
324
|
-
height: height
|
|
325
|
-
}, this.resizeSync(width, height));
|
|
326
|
-
}
|
|
327
326
|
_initDataSet(dataSet) {
|
|
328
327
|
this._dataSet = dataSet instanceof DataSet ? dataSet : new DataSet, registerDataSetInstanceParser(this._dataSet, "dataview", dataViewParser),
|
|
329
328
|
registerDataSetInstanceParser(this._dataSet, "array", arrayParser), registerDataSetInstanceTransform(this._dataSet, "copyDataView", copyDataView);
|
|
@@ -339,7 +338,7 @@ export class VChart {
|
|
|
339
338
|
return !!updateSpecResult && (this._reCompile(updateSpecResult), this._beforeRender(option));
|
|
340
339
|
}
|
|
341
340
|
_reCompile(updateResult, morphConfig) {
|
|
342
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
341
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
343
342
|
if (updateResult.reMake) this._releaseData(), this._initDataSet(), this._chartSpecTransformer = null,
|
|
344
343
|
null === (_a = this._chart) || void 0 === _a || _a.release(), this._chart = null,
|
|
345
344
|
updateResult.changeTheme ? (this._setCurrentTheme(), this._setFontFamilyTheme(null === (_b = this._currentTheme) || void 0 === _b ? void 0 : _b.fontFamily)) : updateResult.changeBackground && (null === (_c = this._compiler) || void 0 === _c || _c.setBackground(this._getBackground())),
|
|
@@ -352,7 +351,8 @@ export class VChart {
|
|
|
352
351
|
updateResult.reCompile && (null === (_j = this._compiler) || void 0 === _j || _j.clear({
|
|
353
352
|
chart: this._chart,
|
|
354
353
|
vChart: this
|
|
355
|
-
}, !this._option
|
|
354
|
+
}, !1 === (null === (_k = this._option) || void 0 === _k ? void 0 : _k.animation) || !1 === (null === (_l = this._spec) || void 0 === _l ? void 0 : _l.animation)),
|
|
355
|
+
null === (_m = this._compiler) || void 0 === _m || _m.compile({
|
|
356
356
|
chart: this._chart,
|
|
357
357
|
vChart: this
|
|
358
358
|
}, {})), updateResult.reSize) {
|
|
@@ -366,8 +366,8 @@ export class VChart {
|
|
|
366
366
|
if (this._chart) return !0;
|
|
367
367
|
const {transformSpec: transformSpec, actionSource: actionSource} = option;
|
|
368
368
|
return transformSpec && this._initChartSpec(this._spec, "render"), this._chartPluginApply("onBeforeInitChart", this._spec, actionSource),
|
|
369
|
-
null === (_b = null === (_a = this._option.performanceHook) || void 0 === _a ? void 0 : _a.beforeInitializeChart) || void 0 === _b || _b.call(_a),
|
|
370
|
-
this._initChart(this._spec), null === (_d = null === (_c = this._option.performanceHook) || void 0 === _c ? void 0 : _c.afterInitializeChart) || void 0 === _d || _d.call(_c),
|
|
369
|
+
null === (_b = null === (_a = this._option.performanceHook) || void 0 === _a ? void 0 : _a.beforeInitializeChart) || void 0 === _b || _b.call(_a, this),
|
|
370
|
+
this._initChart(this._spec), null === (_d = null === (_c = this._option.performanceHook) || void 0 === _c ? void 0 : _c.afterInitializeChart) || void 0 === _d || _d.call(_c, this),
|
|
371
371
|
!(!this._chart || !this._compiler) && (null === (_f = null === (_e = this._option.performanceHook) || void 0 === _e ? void 0 : _e.beforeCompileToVGrammar) || void 0 === _f || _f.call(_e),
|
|
372
372
|
this._compiler.compile({
|
|
373
373
|
chart: this._chart,
|
|
@@ -464,13 +464,10 @@ export class VChart {
|
|
|
464
464
|
this;
|
|
465
465
|
const prevData = array(this._spec.data);
|
|
466
466
|
return array(data).forEach((d => {
|
|
467
|
-
var _a;
|
|
468
467
|
const {id: id, values: values, parser: parser, fields: fields} = d, preDV = prevData.find((dv => dv.name === id));
|
|
469
468
|
if (preDV) preDV instanceof DataView ? (preDV.setFields(cloneDeep(fields)), preDV.parse(values, cloneDeep(parser))) : (preDV.values = values,
|
|
470
469
|
isValid(parser) && (preDV.parser = parser), isValid(fields) && (preDV.fields = fields)); else {
|
|
471
|
-
const dataView = dataToDataView(d, this._dataSet, prevData
|
|
472
|
-
onError: null === (_a = this._option) || void 0 === _a ? void 0 : _a.onError
|
|
473
|
-
});
|
|
470
|
+
const dataView = dataToDataView(d, this._dataSet, prevData);
|
|
474
471
|
isArray(this._spec.data) && this._spec.data.push(dataView);
|
|
475
472
|
}
|
|
476
473
|
})), this;
|