@visactor/vchart 2.0.17 → 2.0.18
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 +1 -1
- package/build/index.es.js +129 -36
- package/build/index.js +129 -36
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.js +2 -1
- package/cjs/animation/index.js +1 -2
- package/cjs/component/base/base-component.js +1 -1
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +9 -0
- package/cjs/component/data-zoom/data-filter-base-component.js +41 -5
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/player/player.d.ts +2 -0
- package/cjs/component/player/player.js +10 -5
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/util.js +2 -1
- package/cjs/constant/polar.js +1 -2
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +2 -2
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/instance-manager.js +1 -1
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -2
- package/cjs/mark/base/base-mark.js +2 -1
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/series/heatmap/heatmap.js +2 -1
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/theme/builtin/common/series/heatmap.js +5 -0
- package/cjs/theme/builtin/common/series/heatmap.js.map +1 -1
- package/esm/animation/callback-disappear.js +2 -1
- package/esm/animation/index.js +1 -2
- package/esm/component/base/base-component.js +1 -1
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +9 -0
- package/esm/component/data-zoom/data-filter-base-component.js +41 -6
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/player/player.d.ts +2 -0
- package/esm/component/player/player.js +9 -5
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/util.js +2 -1
- package/esm/constant/polar.js +1 -2
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +2 -2
- package/esm/core/index.js.map +1 -1
- package/esm/core/instance-manager.js +1 -1
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -2
- package/esm/mark/base/base-mark.js +2 -1
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/series/heatmap/heatmap.js +2 -1
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/theme/builtin/common/series/heatmap.js +5 -0
- package/esm/theme/builtin/common/series/heatmap.js.map +1 -1
- package/package.json +7 -7
package/build/index.es.js
CHANGED
|
@@ -9665,28 +9665,59 @@ class EventListenerManager {
|
|
|
9665
9665
|
}
|
|
9666
9666
|
addEventListener(type, listener, options) {
|
|
9667
9667
|
if (!listener) return;
|
|
9668
|
+
const capture = this._resolveCapture(options),
|
|
9669
|
+
once = this._resolveOnce(options),
|
|
9670
|
+
listenerTypeMap = this._getOrCreateListenerTypeMap(type),
|
|
9671
|
+
wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
|
|
9672
|
+
if (wrappedMap.has(capture)) return;
|
|
9668
9673
|
const wrappedListener = event => {
|
|
9669
9674
|
const transformedEvent = this._eventListenerTransformer(event);
|
|
9670
|
-
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
|
|
9675
|
+
"function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
|
|
9671
9676
|
};
|
|
9672
|
-
|
|
9677
|
+
wrappedMap.set(capture, {
|
|
9678
|
+
wrappedListener: wrappedListener,
|
|
9679
|
+
options: options
|
|
9680
|
+
}), this._nativeAddEventListener(type, wrappedListener, options);
|
|
9673
9681
|
}
|
|
9674
9682
|
removeEventListener(type, listener, options) {
|
|
9675
|
-
var _a;
|
|
9683
|
+
var _a, _b;
|
|
9676
9684
|
if (!listener) return;
|
|
9677
|
-
const
|
|
9678
|
-
|
|
9685
|
+
const capture = this._resolveCapture(options),
|
|
9686
|
+
wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
|
|
9687
|
+
wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
|
|
9679
9688
|
}
|
|
9680
9689
|
dispatchEvent(event) {
|
|
9681
9690
|
return this._nativeDispatchEvent(event);
|
|
9682
9691
|
}
|
|
9683
9692
|
clearAllEventListeners() {
|
|
9684
|
-
this._listenerMap.forEach((
|
|
9685
|
-
|
|
9686
|
-
|
|
9693
|
+
this._listenerMap.forEach((listenerMap, type) => {
|
|
9694
|
+
listenerMap.forEach(wrappedMap => {
|
|
9695
|
+
wrappedMap.forEach((wrappedRecord, capture) => {
|
|
9696
|
+
this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
|
|
9697
|
+
});
|
|
9687
9698
|
});
|
|
9688
9699
|
}), this._listenerMap.clear();
|
|
9689
9700
|
}
|
|
9701
|
+
_resolveCapture(options) {
|
|
9702
|
+
return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
|
|
9703
|
+
}
|
|
9704
|
+
_resolveOnce(options) {
|
|
9705
|
+
return "object" == typeof options && !!(null == options ? void 0 : options.once);
|
|
9706
|
+
}
|
|
9707
|
+
_getOrCreateListenerTypeMap(type) {
|
|
9708
|
+
let listenerTypeMap = this._listenerMap.get(type);
|
|
9709
|
+
return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
|
|
9710
|
+
}
|
|
9711
|
+
_getOrCreateWrappedMap(listenerTypeMap, listener) {
|
|
9712
|
+
let wrappedMap = listenerTypeMap.get(listener);
|
|
9713
|
+
return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
|
|
9714
|
+
}
|
|
9715
|
+
_deleteListenerRecord(type, listener, capture) {
|
|
9716
|
+
const listenerTypeMap = this._listenerMap.get(type);
|
|
9717
|
+
if (!listenerTypeMap) return;
|
|
9718
|
+
const wrappedMap = listenerTypeMap.get(listener);
|
|
9719
|
+
wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
|
|
9720
|
+
}
|
|
9690
9721
|
_nativeAddEventListener(type, listener, options) {
|
|
9691
9722
|
throw new Error("_nativeAddEventListener must be implemented by derived classes");
|
|
9692
9723
|
}
|
|
@@ -14031,7 +14062,9 @@ class EventManager {
|
|
|
14031
14062
|
var _a;
|
|
14032
14063
|
if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
|
|
14033
14064
|
const constructor = event.constructor;
|
|
14034
|
-
this.eventPool.has(constructor) || this.eventPool.
|
|
14065
|
+
this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
|
|
14066
|
+
e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
|
|
14067
|
+
}), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
|
|
14035
14068
|
}
|
|
14036
14069
|
notifyListeners(e, type) {
|
|
14037
14070
|
const listeners = e.currentTarget._events[type];
|
|
@@ -16673,7 +16706,7 @@ class Graphic extends Node {
|
|
|
16673
16706
|
});
|
|
16674
16707
|
}
|
|
16675
16708
|
release() {
|
|
16676
|
-
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
|
|
16709
|
+
this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
|
|
16677
16710
|
}
|
|
16678
16711
|
_emitCustomEvent(type, context) {
|
|
16679
16712
|
var _a, _b;
|
|
@@ -24336,12 +24369,12 @@ class Stage extends Group$1 {
|
|
|
24336
24369
|
throw new Error("暂不支持");
|
|
24337
24370
|
}
|
|
24338
24371
|
release() {
|
|
24339
|
-
var _a, _b;
|
|
24372
|
+
var _a, _b, _d;
|
|
24340
24373
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
24341
24374
|
layer.release();
|
|
24342
24375
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
24343
24376
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
24344
|
-
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
24377
|
+
}), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
|
|
24345
24378
|
}
|
|
24346
24379
|
setStage(stage) {}
|
|
24347
24380
|
dirty(b, matrix) {
|
|
@@ -31666,7 +31699,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31666
31699
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
31667
31700
|
}
|
|
31668
31701
|
release(all) {
|
|
31669
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
31702
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
31670
31703
|
passive: !1
|
|
31671
31704
|
}), this._clearDragEvents();
|
|
31672
31705
|
}
|
|
@@ -33871,17 +33904,21 @@ class AxisBase extends AnimateComponent {
|
|
|
33871
33904
|
} = this.attribute.label;
|
|
33872
33905
|
textStyle = isFunction$1(textStyle) ? merge$1({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
33873
33906
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
33874
|
-
|
|
33907
|
+
textStyle = merge$1(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
|
|
33875
33908
|
label: tickDatum.label,
|
|
33876
33909
|
value: tickDatum.rawValue,
|
|
33877
33910
|
index: tickDatum.index,
|
|
33878
33911
|
layer: layer
|
|
33879
|
-
}))
|
|
33912
|
+
}));
|
|
33913
|
+
let reactStyle = textStyle.react;
|
|
33914
|
+
return isFunction$1(reactStyle) && (reactStyle = reactStyle(tickDatum, index, tickData, layer)), Object.assign(Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
|
|
33880
33915
|
text: null != text ? text : textContent,
|
|
33881
33916
|
_originText: tickDatum.label,
|
|
33882
33917
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
|
|
33883
33918
|
type: type
|
|
33884
|
-
}), textStyle)
|
|
33919
|
+
}), textStyle), {
|
|
33920
|
+
react: reactStyle
|
|
33921
|
+
});
|
|
33885
33922
|
}
|
|
33886
33923
|
getLabelPosition(point, vector, text, style) {
|
|
33887
33924
|
return point;
|
|
@@ -34910,6 +34947,8 @@ class DefaultTicker extends EventEmitter {
|
|
|
34910
34947
|
this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
|
|
34911
34948
|
timeline.tick(delta);
|
|
34912
34949
|
}), this.emit("tick", delta));
|
|
34950
|
+
}, this._handleGraphTick = () => {
|
|
34951
|
+
this.initHandler(!1);
|
|
34913
34952
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.stage = stage, this.autoStop = !0, this.interval = 16, this.computeTimeOffsetAndJitter();
|
|
34914
34953
|
}
|
|
34915
34954
|
bindStage(stage) {
|
|
@@ -34919,9 +34958,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
34919
34958
|
this.timeOffset = Math.floor(Math.random() * this.interval), this._jitter = Math.min(Math.max(.2 * this.interval, 6), .7 * this.interval);
|
|
34920
34959
|
}
|
|
34921
34960
|
init() {
|
|
34922
|
-
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker",
|
|
34923
|
-
this.initHandler(!1);
|
|
34924
|
-
}), application.global.env && this.initHandler(!1);
|
|
34961
|
+
this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", this._handleGraphTick), application.global.env && this.initHandler(!1);
|
|
34925
34962
|
}
|
|
34926
34963
|
addTimeline(timeline) {
|
|
34927
34964
|
this.timelines.push(timeline);
|
|
@@ -34994,7 +35031,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
34994
35031
|
}
|
|
34995
35032
|
release() {
|
|
34996
35033
|
var _a;
|
|
34997
|
-
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
35034
|
+
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
34998
35035
|
}
|
|
34999
35036
|
checkSkip(delta) {
|
|
35000
35037
|
var _a, _b, _c;
|
|
@@ -46115,7 +46152,7 @@ class DataZoomInteraction extends EventEmitter {
|
|
|
46115
46152
|
});
|
|
46116
46153
|
}
|
|
46117
46154
|
clearVGlobalEvents() {
|
|
46118
|
-
("browser" === vglobal.env ? vglobal : this.stage).
|
|
46155
|
+
("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
46119
46156
|
passive: !1
|
|
46120
46157
|
});
|
|
46121
46158
|
}
|
|
@@ -49819,7 +49856,7 @@ class Slider extends AbstractComponent {
|
|
|
49819
49856
|
};
|
|
49820
49857
|
}
|
|
49821
49858
|
release(all) {
|
|
49822
|
-
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).
|
|
49859
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
|
|
49823
49860
|
passive: !1
|
|
49824
49861
|
}), this._clearAllDragEvents();
|
|
49825
49862
|
}
|
|
@@ -50866,6 +50903,9 @@ class BasePlayer extends AbstractComponent {
|
|
|
50866
50903
|
value: this._data[dataIndex]
|
|
50867
50904
|
});
|
|
50868
50905
|
}
|
|
50906
|
+
release(all) {
|
|
50907
|
+
this._sliderVisible || this._slider.release(all), super.release(all);
|
|
50908
|
+
}
|
|
50869
50909
|
}
|
|
50870
50910
|
BasePlayer.defaultAttributes = {
|
|
50871
50911
|
visible: !0,
|
|
@@ -58997,7 +59037,7 @@ class BaseMark extends GrammarItem {
|
|
|
58997
59037
|
_runApplyGraphic(graphics) {
|
|
58998
59038
|
const hasAnimation = this.hasAnimation();
|
|
58999
59039
|
graphics.forEach((g, index) => {
|
|
59000
|
-
var _a, _b;
|
|
59040
|
+
var _a, _b, _c;
|
|
59001
59041
|
const finalAttrs = g.context.finalAttrs;
|
|
59002
59042
|
const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
59003
59043
|
if (!g.setAttributes) {
|
|
@@ -59036,6 +59076,9 @@ class BaseMark extends GrammarItem {
|
|
|
59036
59076
|
else if (!hasStateAnimation) {
|
|
59037
59077
|
hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs);
|
|
59038
59078
|
}
|
|
59079
|
+
if (!((_c = this.renderContext) === null || _c === void 0 ? void 0 : _c.progressive) && this._product && g.parent !== this._product) {
|
|
59080
|
+
this._product.appendChild(g);
|
|
59081
|
+
}
|
|
59039
59082
|
if (hasAnimation) {
|
|
59040
59083
|
g.setFinalAttributes(finalAttrs);
|
|
59041
59084
|
}
|
|
@@ -60568,7 +60611,7 @@ class VChart {
|
|
|
60568
60611
|
this._compiler.updateLayoutTag();
|
|
60569
60612
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60570
60613
|
this._initDataSet(this._option.dataSet);
|
|
60571
|
-
this._autoSize = isTrueBrowseEnv ? (
|
|
60614
|
+
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60572
60615
|
this._bindResizeEvent();
|
|
60573
60616
|
this._bindViewEvent();
|
|
60574
60617
|
this._initChartPlugin();
|
|
@@ -61221,7 +61264,7 @@ class VChart {
|
|
|
61221
61264
|
resize = true;
|
|
61222
61265
|
}
|
|
61223
61266
|
const lasAutoSize = this._autoSize;
|
|
61224
|
-
this._autoSize = isTrueBrowser(this._option.mode) ? (
|
|
61267
|
+
this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
|
|
61225
61268
|
if (this._autoSize !== lasAutoSize) {
|
|
61226
61269
|
resize = true;
|
|
61227
61270
|
}
|
|
@@ -61806,7 +61849,7 @@ const lookup = (data, opt) => {
|
|
|
61806
61849
|
});
|
|
61807
61850
|
};
|
|
61808
61851
|
|
|
61809
|
-
const version = "2.0.
|
|
61852
|
+
const version = "2.0.18";
|
|
61810
61853
|
|
|
61811
61854
|
const addVChartProperty = (data, op) => {
|
|
61812
61855
|
const context = op.beforeCall();
|
|
@@ -65921,6 +65964,7 @@ class BaseComponent extends LayoutModel {
|
|
|
65921
65964
|
components.forEach(c => {
|
|
65922
65965
|
var _a;
|
|
65923
65966
|
if (c) {
|
|
65967
|
+
c.release(true);
|
|
65924
65968
|
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
|
|
65925
65969
|
c = null;
|
|
65926
65970
|
}
|
|
@@ -91256,6 +91300,11 @@ const heatmap = {
|
|
|
91256
91300
|
},
|
|
91257
91301
|
cellBackground: {
|
|
91258
91302
|
visible: false
|
|
91303
|
+
},
|
|
91304
|
+
label: {
|
|
91305
|
+
style: {
|
|
91306
|
+
lineWidth: 2
|
|
91307
|
+
}
|
|
91259
91308
|
}
|
|
91260
91309
|
};
|
|
91261
91310
|
|
|
@@ -91290,11 +91339,12 @@ class HeatmapSeries extends CartesianSeries {
|
|
|
91290
91339
|
this.initCellBackgroundMarkStyle();
|
|
91291
91340
|
}
|
|
91292
91341
|
initLabelMarkStyle(textMark) {
|
|
91342
|
+
var _a, _b, _c;
|
|
91293
91343
|
if (!textMark) {
|
|
91294
91344
|
return;
|
|
91295
91345
|
}
|
|
91296
91346
|
this.setMarkStyle(textMark, {
|
|
91297
|
-
fill: this.getColorAttribute(),
|
|
91347
|
+
fill: (_c = (_b = (_a = this._spec.cell) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.getColorAttribute(),
|
|
91298
91348
|
text: (datum) => {
|
|
91299
91349
|
return datum[this.getMeasureField()[0]];
|
|
91300
91350
|
}
|
|
@@ -98364,6 +98414,7 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98364
98414
|
this._hasInitStateScale = false;
|
|
98365
98415
|
this._shouldChange = true;
|
|
98366
98416
|
this._stateField = 'x';
|
|
98417
|
+
this._currentDataCollection = [];
|
|
98367
98418
|
this._handleStateChange = (startValue, endValue, tag) => {
|
|
98368
98419
|
var _a, _b;
|
|
98369
98420
|
this._startValue = startValue;
|
|
@@ -98420,6 +98471,7 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98420
98471
|
}, () => this._regions, (() => this._option).bind(this), () => this.event);
|
|
98421
98472
|
}
|
|
98422
98473
|
created() {
|
|
98474
|
+
this._handleDataCollectionChangeBound = this._handleDataCollectionChange.bind(this);
|
|
98423
98475
|
super.created();
|
|
98424
98476
|
this._setAxisFromSpec();
|
|
98425
98477
|
this._setRegionsFromSpec();
|
|
@@ -98574,7 +98626,7 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98574
98626
|
}
|
|
98575
98627
|
return;
|
|
98576
98628
|
}
|
|
98577
|
-
|
|
98629
|
+
_collectDataInfo() {
|
|
98578
98630
|
const dataCollection = [];
|
|
98579
98631
|
const seriesCollection = [];
|
|
98580
98632
|
const stateFields = [];
|
|
@@ -98650,6 +98702,10 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98650
98702
|
specIndex: this._seriesIndex
|
|
98651
98703
|
});
|
|
98652
98704
|
}
|
|
98705
|
+
return { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState };
|
|
98706
|
+
}
|
|
98707
|
+
_initData() {
|
|
98708
|
+
const { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState } = this._collectDataInfo();
|
|
98653
98709
|
const { dataSet } = this._option;
|
|
98654
98710
|
registerDataSetInstanceParser(dataSet, 'dataview', dataViewParser);
|
|
98655
98711
|
registerDataSetInstanceTransform(dataSet, 'dataFilterComputeDomain', dataFilterComputeDomain);
|
|
@@ -98672,7 +98728,8 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98672
98728
|
}, false);
|
|
98673
98729
|
this._data = new CompilableData(this._option, data);
|
|
98674
98730
|
data.reRunAllTransform();
|
|
98675
|
-
|
|
98731
|
+
this._currentDataCollection = dataCollection;
|
|
98732
|
+
dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChangeBound);
|
|
98676
98733
|
}
|
|
98677
98734
|
_addTransformToSeries() {
|
|
98678
98735
|
if (!this._relatedAxisComponent || this._filterMode !== 'axis') {
|
|
@@ -98714,8 +98771,39 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
98714
98771
|
}
|
|
98715
98772
|
onDataUpdate() {
|
|
98716
98773
|
var _a;
|
|
98774
|
+
const { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState } = this._collectDataInfo();
|
|
98775
|
+
if (this._currentDataCollection.length !== dataCollection.length ||
|
|
98776
|
+
this._currentDataCollection.some((dv, i) => dv !== dataCollection[i])) {
|
|
98777
|
+
this._currentDataCollection.forEach(dv => {
|
|
98778
|
+
var _a;
|
|
98779
|
+
(_a = dv === null || dv === void 0 ? void 0 : dv.target) === null || _a === void 0 ? void 0 : _a.removeListener('change', this._handleDataCollectionChangeBound);
|
|
98780
|
+
});
|
|
98781
|
+
this._currentDataCollection = dataCollection;
|
|
98782
|
+
const { dataSet } = this._option;
|
|
98783
|
+
dataSet.multipleDataViewAddListener(this._currentDataCollection, 'change', this._handleDataCollectionChangeBound);
|
|
98784
|
+
}
|
|
98785
|
+
this._data.getDataView().transform({
|
|
98786
|
+
type: 'dataFilterComputeDomain',
|
|
98787
|
+
options: {
|
|
98788
|
+
input: {
|
|
98789
|
+
dataCollection: dataCollection,
|
|
98790
|
+
seriesCollection,
|
|
98791
|
+
stateFields,
|
|
98792
|
+
valueFields,
|
|
98793
|
+
isCategoryState
|
|
98794
|
+
},
|
|
98795
|
+
output: {
|
|
98796
|
+
stateField: this._stateField,
|
|
98797
|
+
valueField: this._valueField
|
|
98798
|
+
}
|
|
98799
|
+
}
|
|
98800
|
+
}, false);
|
|
98801
|
+
this._data.getDataView().reRunAllTransform();
|
|
98717
98802
|
const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
|
|
98718
98803
|
this._stateScale.domain(domain, false);
|
|
98804
|
+
if (isValid$1(this._spec.start) || isValid$1(this._spec.end)) {
|
|
98805
|
+
this._setStateFromSpec();
|
|
98806
|
+
}
|
|
98719
98807
|
this._handleChange(this._start, this._end, true);
|
|
98720
98808
|
if (this._spec.auto && !isEqual(this._domainCache, domain)) {
|
|
98721
98809
|
this._domainCache = domain;
|
|
@@ -102076,17 +102164,19 @@ class Player extends BaseComponent {
|
|
|
102076
102164
|
}
|
|
102077
102165
|
return 0;
|
|
102078
102166
|
};
|
|
102167
|
+
this.autoPlayCallback = () => {
|
|
102168
|
+
var _a;
|
|
102169
|
+
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.auto) {
|
|
102170
|
+
this._playerComponent.pause();
|
|
102171
|
+
this._playerComponent.play();
|
|
102172
|
+
}
|
|
102173
|
+
};
|
|
102079
102174
|
this._initEvent = () => {
|
|
102080
102175
|
if (this._option.disableTriggerEvent) {
|
|
102081
102176
|
return;
|
|
102082
102177
|
}
|
|
102083
|
-
this._option.globalInstance.
|
|
102084
|
-
|
|
102085
|
-
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.auto) {
|
|
102086
|
-
this._playerComponent.pause();
|
|
102087
|
-
this._playerComponent.play();
|
|
102088
|
-
}
|
|
102089
|
-
});
|
|
102178
|
+
this._option.globalInstance.off(ChartEvent.rendered, this.autoPlayCallback);
|
|
102179
|
+
this._option.globalInstance.on(ChartEvent.rendered, this.autoPlayCallback);
|
|
102090
102180
|
this._playerComponent.addEventListener(PlayerEventEnum.end, () => {
|
|
102091
102181
|
var _a;
|
|
102092
102182
|
this.event.emit(ChartEvent.playerEnd, { model: this });
|
|
@@ -102271,6 +102361,9 @@ class Player extends BaseComponent {
|
|
|
102271
102361
|
}
|
|
102272
102362
|
});
|
|
102273
102363
|
}
|
|
102364
|
+
release() {
|
|
102365
|
+
this._option.globalInstance.off(ChartEvent.rendered, this.autoPlayCallback);
|
|
102366
|
+
}
|
|
102274
102367
|
}
|
|
102275
102368
|
Player.builtInTheme = {
|
|
102276
102369
|
player
|