@visactor/vchart 2.0.8-alpha.5 → 2.0.9

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.
Files changed (156) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +908 -583
  3. package/build/index.js +908 -583
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/config.d.ts +1 -0
  7. package/cjs/animation/config.js +13 -1
  8. package/cjs/animation/config.js.map +1 -1
  9. package/cjs/chart/base/base-chart.d.ts +0 -2
  10. package/cjs/chart/base/base-chart.js +2 -16
  11. package/cjs/chart/base/base-chart.js.map +1 -1
  12. package/cjs/chart/interface/chart.d.ts +0 -2
  13. package/cjs/chart/interface/chart.js.map +1 -1
  14. package/cjs/compile/compiler.d.ts +5 -0
  15. package/cjs/compile/compiler.js +42 -4
  16. package/cjs/compile/compiler.js.map +1 -1
  17. package/cjs/compile/interface/compilable-item.d.ts +2 -0
  18. package/cjs/compile/interface/compilable-item.js.map +1 -1
  19. package/cjs/component/axis/base-axis.d.ts +1 -1
  20. package/cjs/component/axis/base-axis.js +1 -1
  21. package/cjs/component/axis/base-axis.js.map +1 -1
  22. package/cjs/component/axis/cartesian/axis.d.ts +1 -1
  23. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  24. package/cjs/component/axis/cartesian/band-axis.d.ts +1 -1
  25. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  26. package/cjs/component/axis/interface/common.d.ts +1 -0
  27. package/cjs/component/axis/interface/common.js.map +1 -1
  28. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  29. package/cjs/component/axis/mixin/band-axis-mixin.js +10 -4
  30. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  31. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
  32. package/cjs/component/axis/mixin/linear-axis-mixin.js +15 -1
  33. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  34. package/cjs/component/axis/polar/axis.d.ts +1 -1
  35. package/cjs/component/axis/polar/axis.js.map +1 -1
  36. package/cjs/component/axis/polar/band-axis.d.ts +1 -1
  37. package/cjs/component/axis/polar/band-axis.js.map +1 -1
  38. package/cjs/component/brush/brush.js +6 -5
  39. package/cjs/component/brush/brush.js.map +1 -1
  40. package/cjs/component/data-zoom/data-filter-base-component.d.ts +31 -52
  41. package/cjs/component/data-zoom/data-filter-base-component.js +164 -240
  42. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  43. package/cjs/component/data-zoom/data-filter-event.d.ts +53 -0
  44. package/cjs/component/data-zoom/data-filter-event.js +112 -0
  45. package/cjs/component/data-zoom/data-filter-event.js.map +1 -0
  46. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
  47. package/cjs/component/data-zoom/data-zoom/data-zoom.js +129 -84
  48. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  49. package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
  50. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +35 -36
  51. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  52. package/cjs/component/data-zoom/util.d.ts +14 -0
  53. package/cjs/component/data-zoom/util.js +81 -7
  54. package/cjs/component/data-zoom/util.js.map +1 -1
  55. package/cjs/constant/event.d.ts +1 -0
  56. package/cjs/constant/event.js +8 -8
  57. package/cjs/constant/event.js.map +1 -1
  58. package/cjs/core/index.d.ts +1 -1
  59. package/cjs/core/index.js +1 -1
  60. package/cjs/core/index.js.map +1 -1
  61. package/cjs/core/vchart.d.ts +0 -2
  62. package/cjs/core/vchart.js +0 -4
  63. package/cjs/core/vchart.js.map +1 -1
  64. package/cjs/mark/base/base-mark.d.ts +2 -1
  65. package/cjs/mark/base/base-mark.js +7 -3
  66. package/cjs/mark/base/base-mark.js.map +1 -1
  67. package/cjs/mark/interface/common.d.ts +1 -0
  68. package/cjs/mark/interface/common.js.map +1 -1
  69. package/cjs/plugin/other.js +2 -1
  70. package/cjs/plugin/other.js.map +1 -1
  71. package/cjs/series/bar/bar.js +1 -1
  72. package/cjs/series/bar/bar.js.map +1 -1
  73. package/cjs/series/base/base-series.d.ts +1 -0
  74. package/cjs/series/base/base-series.js +7 -2
  75. package/cjs/series/base/base-series.js.map +1 -1
  76. package/cjs/series/dot/dot.js +6 -2
  77. package/cjs/series/dot/dot.js.map +1 -1
  78. package/cjs/series/util/stack.js +1 -1
  79. package/cjs/series/util/stack.js.map +1 -1
  80. package/cjs/typings/spec/common.js.map +1 -1
  81. package/esm/animation/config.d.ts +1 -0
  82. package/esm/animation/config.js +8 -1
  83. package/esm/animation/config.js.map +1 -1
  84. package/esm/chart/base/base-chart.d.ts +0 -2
  85. package/esm/chart/base/base-chart.js +2 -15
  86. package/esm/chart/base/base-chart.js.map +1 -1
  87. package/esm/chart/interface/chart.d.ts +0 -2
  88. package/esm/chart/interface/chart.js.map +1 -1
  89. package/esm/compile/compiler.d.ts +5 -0
  90. package/esm/compile/compiler.js +44 -4
  91. package/esm/compile/compiler.js.map +1 -1
  92. package/esm/compile/interface/compilable-item.d.ts +2 -0
  93. package/esm/compile/interface/compilable-item.js.map +1 -1
  94. package/esm/component/axis/base-axis.d.ts +1 -1
  95. package/esm/component/axis/base-axis.js +1 -1
  96. package/esm/component/axis/base-axis.js.map +1 -1
  97. package/esm/component/axis/cartesian/axis.d.ts +1 -1
  98. package/esm/component/axis/cartesian/axis.js.map +1 -1
  99. package/esm/component/axis/cartesian/band-axis.d.ts +1 -1
  100. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  101. package/esm/component/axis/interface/common.d.ts +1 -0
  102. package/esm/component/axis/interface/common.js.map +1 -1
  103. package/esm/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  104. package/esm/component/axis/mixin/band-axis-mixin.js +10 -4
  105. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  106. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
  107. package/esm/component/axis/mixin/linear-axis-mixin.js +15 -1
  108. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  109. package/esm/component/axis/polar/axis.d.ts +1 -1
  110. package/esm/component/axis/polar/axis.js.map +1 -1
  111. package/esm/component/axis/polar/band-axis.d.ts +1 -1
  112. package/esm/component/axis/polar/band-axis.js.map +1 -1
  113. package/esm/component/brush/brush.js +6 -4
  114. package/esm/component/brush/brush.js.map +1 -1
  115. package/esm/component/data-zoom/data-filter-base-component.d.ts +31 -52
  116. package/esm/component/data-zoom/data-filter-base-component.js +155 -232
  117. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  118. package/esm/component/data-zoom/data-filter-event.d.ts +53 -0
  119. package/esm/component/data-zoom/data-filter-event.js +108 -0
  120. package/esm/component/data-zoom/data-filter-event.js.map +1 -0
  121. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
  122. package/esm/component/data-zoom/data-zoom/data-zoom.js +125 -82
  123. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  124. package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
  125. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +36 -36
  126. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  127. package/esm/component/data-zoom/util.d.ts +14 -0
  128. package/esm/component/data-zoom/util.js +63 -7
  129. package/esm/component/data-zoom/util.js.map +1 -1
  130. package/esm/constant/event.d.ts +1 -0
  131. package/esm/constant/event.js +8 -8
  132. package/esm/constant/event.js.map +1 -1
  133. package/esm/core/index.d.ts +1 -1
  134. package/esm/core/index.js +1 -1
  135. package/esm/core/index.js.map +1 -1
  136. package/esm/core/vchart.d.ts +0 -2
  137. package/esm/core/vchart.js +0 -4
  138. package/esm/core/vchart.js.map +1 -1
  139. package/esm/mark/base/base-mark.d.ts +2 -1
  140. package/esm/mark/base/base-mark.js +7 -3
  141. package/esm/mark/base/base-mark.js.map +1 -1
  142. package/esm/mark/interface/common.d.ts +1 -0
  143. package/esm/mark/interface/common.js.map +1 -1
  144. package/esm/plugin/other.js +2 -2
  145. package/esm/plugin/other.js.map +1 -1
  146. package/esm/series/bar/bar.js +2 -2
  147. package/esm/series/bar/bar.js.map +1 -1
  148. package/esm/series/base/base-series.d.ts +1 -0
  149. package/esm/series/base/base-series.js +6 -2
  150. package/esm/series/base/base-series.js.map +1 -1
  151. package/esm/series/dot/dot.js +6 -2
  152. package/esm/series/dot/dot.js.map +1 -1
  153. package/esm/series/util/stack.js +2 -2
  154. package/esm/series/util/stack.js.map +1 -1
  155. package/esm/typings/spec/common.js.map +1 -1
  156. package/package.json +8 -8
@@ -4,49 +4,50 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.DataFilterBaseComponent = void 0;
6
6
 
7
- const model_1 = require("../../util/model"), base_component_1 = require("../base/base-component"), interface_1 = require("../interface"), util_1 = require("./util"), register_1 = require("../../data/register"), vscale_1 = require("@visactor/vscale"), common_1 = require("../axis/cartesian/util/common"), vutils_1 = require("@visactor/vutils"), vdataset_1 = require("@visactor/vdataset"), compilable_data_1 = require("../../compile/data/compilable-data"), zoomable_1 = require("../../interaction/zoom/zoomable"), initialize_1 = require("../../data/initialize"), attribute_1 = require("../../constant/attribute");
7
+ const model_1 = require("../../util/model"), base_component_1 = require("../base/base-component"), interface_1 = require("../interface"), util_1 = require("./util"), register_1 = require("../../data/register"), vscale_1 = require("@visactor/vscale"), common_1 = require("../axis/cartesian/util/common"), vutils_1 = require("@visactor/vutils"), vdataset_1 = require("@visactor/vdataset"), compilable_data_1 = require("../../compile/data/compilable-data"), zoomable_1 = require("../../interaction/zoom/zoomable"), initialize_1 = require("../../data/initialize"), attribute_1 = require("../../constant/attribute"), data_filter_event_1 = require("./data-filter-event"), event_1 = require("../../constant/event");
8
8
 
9
9
  class DataFilterBaseComponent extends base_component_1.BaseComponent {
10
+ get isHorizontal() {
11
+ return this._isHorizontal;
12
+ }
13
+ get stateScale() {
14
+ return this._stateScale;
15
+ }
10
16
  get relatedAxisComponent() {
11
17
  return this._relatedAxisComponent;
12
18
  }
13
19
  setStartAndEnd(start, end, rangeMode = [ "percent", "percent" ]) {
14
- const [startMode = "percent", endMode = "percent"] = rangeMode, startPercent = "percent" === startMode ? start : this.dataToStatePoint(start), endPercent = "percent" === endMode ? end : this.dataToStatePoint(end);
20
+ const [startMode = "percent", endMode = "percent"] = rangeMode, startPercent = "percent" === startMode ? start : (0,
21
+ util_1.dataToStatePoint)(start, this._stateScale, this._isHorizontal), endPercent = "percent" === endMode ? end : (0,
22
+ util_1.dataToStatePoint)(end, this._stateScale, this._isHorizontal);
15
23
  this._handleChange(startPercent, endPercent, !0);
16
24
  }
17
25
  enableInteraction() {
18
- this._activeRoam = !0;
26
+ this._dataFilterEvent.enableInteraction();
19
27
  }
20
28
  disableInteraction() {
21
- this._activeRoam = !1;
29
+ this._dataFilterEvent.disableInteraction();
22
30
  }
23
31
  zoomIn(location) {
24
- this._handleChartZoom({
25
- zoomDelta: 1.2,
26
- zoomX: null == location ? void 0 : location.x,
27
- zoomY: null == location ? void 0 : location.y
28
- });
32
+ this._dataFilterEvent.zoomIn(location);
29
33
  }
30
34
  zoomOut(location) {
31
- this._handleChartZoom({
32
- zoomDelta: .8,
33
- zoomX: null == location ? void 0 : location.x,
34
- zoomY: null == location ? void 0 : location.y
35
- });
35
+ this._dataFilterEvent.zoomOut(location);
36
+ }
37
+ _initEvent() {
38
+ var _a;
39
+ this._dataFilterEvent.initZoomEvent(), null === (_a = this._relatedAxisComponent) || void 0 === _a || _a.event.on(event_1.ChartEvent.scaleRawDomainUpdate, (({model: model}) => {
40
+ console.log("scaleRawDomainUpdate", model.getRawDomain());
41
+ }));
36
42
  }
37
43
  _handleChange(start, end, updateComponent) {
38
44
  var _a, _b;
39
45
  null !== (_b = null === (_a = this._spec) || void 0 === _a ? void 0 : _a.zoomLock) && void 0 !== _b && _b || end - start !== this._spanCache && (end - start < this._minSpan || end - start > this._maxSpan) ? this._shouldChange = !1 : (this._shouldChange = !0,
40
46
  this._spanCache = end - start);
41
47
  }
42
- _isReverse() {
43
- const axis = this._relatedAxisComponent;
44
- if (!axis) return !1;
45
- const axisScale = axis.getScale();
46
- return axisScale.range()[0] > axisScale.range()[1] && (!axis.getInverse() || this._isHorizontal);
47
- }
48
48
  _updateRangeFactor(tag) {
49
- const axis = this._relatedAxisComponent, axisScale = axis.getScale(), reverse = this._isReverse(), newRangeFactor = reverse ? [ 1 - this._end, 1 - this._start ] : [ this._start, this._end ];
49
+ const axis = this._relatedAxisComponent, axisScale = axis.getScale(), reverse = (0,
50
+ util_1.isReverse)(axis, this._isHorizontal), newRangeFactor = reverse ? [ 1 - this._end, 1 - this._start ] : [ this._start, this._end ];
50
51
  if (reverse) switch (tag) {
51
52
  case "startHandler":
52
53
  axis.scaleRangeFactorEnd(newRangeFactor[1]);
@@ -79,26 +80,20 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
79
80
  }
80
81
  constructor(spec, options) {
81
82
  super(spec, options), this.layoutType = "none", this._orient = "left", this._cacheVisibility = void 0,
82
- this._dataUpdating = !1, this._shouldChange = !0, this._stateField = "x", this._activeRoam = !0,
83
- this._zoomAttr = {
84
- enable: !0,
85
- rate: 1,
86
- focus: !0
87
- }, this._dragAttr = {
88
- enable: !0,
89
- rate: 1,
90
- reverse: !0
91
- }, this._scrollAttr = {
92
- enable: !0,
93
- rate: 1,
94
- reverse: !0
83
+ this._dataUpdating = !1, this._hasInitStateScale = !1, this._shouldChange = !0,
84
+ this._stateField = "x", this._handleStateChange = (startValue, endValue, tag) => {
85
+ var _a, _b;
86
+ return this._startValue = startValue, this._endValue = endValue, this._newDomain = (0,
87
+ util_1.parseDomainFromState)(this._startValue, this._endValue, this._stateScale),
88
+ null === (_b = (_a = this.effect).onZoomChange) || void 0 === _b || _b.call(_a, tag),
89
+ !0;
95
90
  }, this.effect = {
96
91
  onZoomChange: tag => {
97
92
  var _a, _b;
98
93
  const axis = this._relatedAxisComponent;
99
94
  if (axis && "axis" === this._filterMode) {
100
95
  const axisScale = axis.getScale(), axisSpec = axis.getSpec();
101
- this._auto && this._getAxisBandSize(axisSpec) && this._spec.ignoreBandSize && (axisScale.bandwidth("auto"),
96
+ this._auto && (0, util_1.getAxisBandSize)(axisSpec) && this._spec.ignoreBandSize && (axisScale.bandwidth("auto"),
102
97
  axisScale.maxBandwidth("auto"), axisScale.minBandwidth("auto")), this._updateRangeFactor(tag),
103
98
  this._auto && (null === (_b = null === (_a = this._component) || void 0 === _a ? void 0 : _a.setStartAndEnd) || void 0 === _b || _b.call(_a, this._start, this._end)),
104
99
  axis.effect.scaleUpdate({
@@ -117,55 +112,11 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
117
112
  specIndex: this._seriesIndex
118
113
  });
119
114
  }
120
- }, this._visible = !0, this._handleStateChange = (startValue, endValue, tag) => {
121
- var _a, _b;
122
- return this._startValue = startValue, this._endValue = endValue, this._newDomain = this._parseDomainFromState(this._startValue, this._endValue),
123
- null === (_b = (_a = this.effect).onZoomChange) || void 0 === _b || _b.call(_a, tag),
124
- !0;
125
- }, this._handleChartZoom = (params, e) => {
126
- var _a, _b;
127
- if (!this._activeRoam || this._zoomAttr.filter && !this._zoomAttr.filter(params, e)) return;
128
- const {zoomDelta: zoomDelta, zoomX: zoomX, zoomY: zoomY} = params, {x: x, y: y} = this._regions[0].getLayoutStartPoint(), {width: width, height: height} = this._regions[0].getLayoutRect(), delta = Math.abs(this._start - this._end), zoomRate = null !== (_b = null === (_a = this._spec.roamZoom) || void 0 === _a ? void 0 : _a.rate) && void 0 !== _b ? _b : 1;
129
- if (delta >= 1 && zoomDelta < 1) return;
130
- if (delta <= .01 && zoomDelta > 1) return;
131
- const focusLoc = this._isHorizontal ? zoomX : zoomY, totalValue = delta * (zoomDelta - 1) * zoomRate;
132
- let startValue = totalValue / 2, endValue = totalValue / 2;
133
- if (focusLoc) {
134
- const startLoc = this._isHorizontal ? x : y, endLoc = this._isHorizontal ? width : height;
135
- startValue = Math.abs(startLoc - focusLoc) / Math.abs(endLoc - startLoc) * totalValue,
136
- endValue = Math.abs(endLoc - focusLoc) / Math.abs(endLoc - startLoc) * totalValue;
137
- }
138
- const start = (0, vutils_1.clamp)(this._start + startValue, 0, 1), end = (0, vutils_1.clamp)(this._end - endValue, 0, 1);
139
- this._handleChange(Math.min(start, end), Math.max(start, end), !0);
140
- }, this._handleChartScroll = (params, e) => {
141
- var _a;
142
- if (!this._activeRoam || this._scrollAttr.filter && !this._scrollAttr.filter(params, e)) return !1;
143
- const {scrollX: scrollX, scrollY: scrollY} = params;
144
- let value = this._isHorizontal ? scrollX : scrollY;
145
- const active = this._isHorizontal ? (0, vutils_1.abs)(scrollX / scrollY) >= .5 : (0,
146
- vutils_1.abs)(scrollY / scrollX) >= .5;
147
- this._scrollAttr.reverse || (value = -value), active && this._handleChartMove(value, null !== (_a = this._scrollAttr.rate) && void 0 !== _a ? _a : 1);
148
- const hasChange = 0 !== this._start && 1 !== this._end;
149
- return active && hasChange;
150
- }, this._handleChartDrag = (delta, e) => {
151
- var _a, _b;
152
- if (!this._activeRoam || this._dragAttr.filter && !this._dragAttr.filter(delta, e)) return;
153
- (null === (_a = this._spec.roamDrag) || void 0 === _a ? void 0 : _a.autoVisible) && this.show();
154
- const [dx, dy] = delta;
155
- let value = this._isHorizontal ? dx : dy;
156
- this._dragAttr.reverse && (value = -value), this._handleChartMove(value, null !== (_b = this._dragAttr.rate) && void 0 !== _b ? _b : 1);
157
- }, this._handleChartMove = (value, rate) => {
158
- const totalValue = this._isHorizontal ? this.getLayoutRect().width : this.getLayoutRect().height;
159
- if (Math.abs(value) >= 1e-6) if (value > 0 && this._end < 1) {
160
- const moveDelta = Math.min(1 - this._end, value / totalValue) * rate;
161
- this._handleChange(this._start + moveDelta, this._end + moveDelta, !0);
162
- } else if (value < 0 && this._start > 0) {
163
- const moveDelta = Math.max(-this._start, value / totalValue) * rate;
164
- this._handleChange(this._start + moveDelta, this._end + moveDelta, !0);
165
- }
166
- return !1;
167
- }, this._orient = (0, common_1.getOrient)(spec), this._isHorizontal = "horizontal" === (0,
168
- common_1.getDirectionByOrient)(this._orient);
115
+ }, this._visible = !0, this._orient = (0, common_1.getOrient)(spec), this._isHorizontal = "horizontal" === (0,
116
+ common_1.getDirectionByOrient)(this._orient), this._dataFilterEvent = new data_filter_event_1.DataFilterEvent(this.type, this._spec, this._handleChange.bind(this), this.getLayoutRect.bind(this), (() => ({
117
+ start: this._start,
118
+ end: this._end
119
+ })), (() => this._regions), (() => this._option).bind(this), (() => this.event));
169
120
  }
170
121
  created() {
171
122
  super.created(), this._setAxisFromSpec(), this._setRegionsFromSpec(), this._initEvent(),
@@ -174,11 +125,64 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
174
125
  initLayout() {
175
126
  super.initLayout(), this._layout && (this._layout.layoutOrient = this._orient);
176
127
  }
128
+ init(option) {
129
+ super.init(option), this._addTransformToSeries(), 0 === this._start && 1 === this._end || this.effect.onZoomChange();
130
+ }
131
+ _compareSpec(spec, prevSpec) {
132
+ const result = super._compareSpec(spec, prevSpec);
133
+ return result.reMake || (0, vutils_1.isEqual)(prevSpec, spec) || (result.reRender = !0,
134
+ result.reMake = !0), result;
135
+ }
136
+ reInit(spec) {
137
+ super.reInit(spec), this._marks.forEach((g => {
138
+ g.getMarks().forEach((m => {
139
+ this.initMarkStyleWithSpec(m, this._spec[m.name]);
140
+ }));
141
+ }));
142
+ }
143
+ onLayoutStart(layoutRect, viewRect) {
144
+ super.onLayoutStart(layoutRect, viewRect);
145
+ const isShown = this._autoUpdate(layoutRect);
146
+ this._autoVisible(isShown), this._dataUpdating = !1;
147
+ }
148
+ updateLayoutAttribute() {
149
+ this._visible && this._createOrUpdateComponent(), this._hasInitStateScale || (0 === this._start && 1 === this._end || (this._newDomain = (0,
150
+ util_1.parseDomainFromStateAndValue)(this._spec.start, this._startValue, this._spec.end, this._endValue, this._stateScale),
151
+ this.effect.onZoomChange()), this._hasInitStateScale = !0);
152
+ }
153
+ _initAfterLayout() {
154
+ this._stateScale = null, this._initStateScale(), this._updateScaleRange(), this._setStateFromAxis();
155
+ }
156
+ _beforeLayoutEnd() {
157
+ this._hasInitStateScale ? this._updateScaleRange() : this._initAfterLayout();
158
+ }
159
+ onLayoutEnd() {
160
+ var _a;
161
+ this._beforeLayoutEnd();
162
+ const isShown = !(0 === this._start && 1 === this._end);
163
+ this._autoVisible(isShown), super.onLayoutEnd(), null === (_a = this._relatedAxisComponent) || void 0 === _a || _a.updateScaleRange();
164
+ }
165
+ getBoundsInRect(rect) {
166
+ const result = {
167
+ x1: this.getLayoutStartPoint().x,
168
+ y1: this.getLayoutStartPoint().y,
169
+ x2: 0,
170
+ y2: 0
171
+ };
172
+ return this._isHorizontal ? (result.y2 = result.y1 + this._height, result.x2 = result.x1 + rect.width) : (result.x2 = result.x1 + this._width,
173
+ result.y2 = result.y1 + rect.height), result;
174
+ }
175
+ setAttrFromSpec() {
176
+ var _a;
177
+ super.setAttrFromSpec(), this._dataFilterEvent.setEventAttrFromSpec(), this._field = this._spec.field,
178
+ this._width = this._computeWidth(), this._height = this._computeHeight(), this._visible = null === (_a = this._spec.visible) || void 0 === _a || _a;
179
+ }
177
180
  _setAxisFromSpec() {
178
181
  if ((0, vutils_1.isValid)(this._spec.axisId) ? this._relatedAxisComponent = this._option.getComponentByUserId(this._spec.axisId) : (0,
179
182
  vutils_1.isValid)(this._spec.axisIndex) && (this._relatedAxisComponent = this._option.getComponentByIndex("axes", this._spec.axisIndex)),
180
183
  (0, vutils_1.isNil)(this._spec.field) && !this._relatedAxisComponent) {
181
- const axes = this._option.getComponentsByKey("axes"), sameOrientAxis = axes.find((cm => cm._orient === this._orient));
184
+ const axes = this._option.getComponentsByKey("axes"), sameOrientAxis = axes.find((cm => (0,
185
+ common_1.getDirectionByOrient)(cm._orient) === (0, common_1.getDirectionByOrient)(this._orient)));
182
186
  if (sameOrientAxis) this._relatedAxisComponent = sameOrientAxis; else {
183
187
  const bandAxis = axes.find((cm => !(0, vscale_1.isContinuous)(cm.getScale().type)));
184
188
  this._relatedAxisComponent = bandAxis;
@@ -208,27 +212,8 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
208
212
  this._regions = ids.length ? this._regions.filter((r => ids.includes(r.id))) : [];
209
213
  } else ;
210
214
  }
211
- onDataUpdate() {
212
- var _a;
213
- const domain = this._computeDomainOfStateScale((0, vscale_1.isContinuous)(this._stateScale.type));
214
- this._stateScale.domain(domain, !1), this._handleChange(this._start, this._end, !0),
215
- this._spec.auto && !(0, vutils_1.isEqual)(this._domainCache, domain) && (this._domainCache = domain,
216
- this._dataUpdating = !0, null === (_a = this.getChart()) || void 0 === _a || _a.setLayoutTag(!0, null, !1));
217
- }
218
- _computeDomainOfStateScale(isContinuous) {
219
- if (this._spec.customDomain) return this._spec.customDomain;
220
- const domain = this._data.getLatestData().map((d => d[this._stateField]));
221
- if (isContinuous) {
222
- const domainNum = domain.map((n => 1 * n));
223
- return domain.length ? [ (0, vutils_1.minInArray)(domainNum), (0, vutils_1.maxInArray)(domainNum) ] : [ -1 / 0, 1 / 0 ];
224
- }
225
- return domain;
226
- }
227
- _initEvent() {
228
- this._initCommonEvent();
229
- }
230
215
  _initData() {
231
- const dataCollection = [], stateFields = [], valueFields = [];
216
+ const dataCollection = [], seriesCollection = [], stateFields = [], valueFields = [];
232
217
  let isCategoryState;
233
218
  if (this._relatedAxisComponent) {
234
219
  const originalStateFields = {};
@@ -236,24 +221,26 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
236
221
  var _a, _b;
237
222
  const xAxisHelper = "cartesian" === s.coordinate ? s.getXAxisHelper() : "polar" === s.coordinate ? s.angleAxisHelper : null, yAxisHelper = "cartesian" === s.coordinate ? s.getYAxisHelper() : "polar" === s.coordinate ? s.radiusAxisHelper : null;
238
223
  if (!xAxisHelper || !yAxisHelper) return;
239
- const stateAxisHelper = xAxisHelper.getAxisId() === this._relatedAxisComponent.id ? xAxisHelper : yAxisHelper.getAxisId() === this._relatedAxisComponent.id ? yAxisHelper : this._isHorizontal ? xAxisHelper : yAxisHelper, valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
224
+ const stateAxisHelper = xAxisHelper.getAxisId() === this._relatedAxisComponent.id ? xAxisHelper : yAxisHelper.getAxisId() === this._relatedAxisComponent.id ? yAxisHelper : this._isHorizontal ? xAxisHelper : yAxisHelper, valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper, isValidateValueAxis = (0,
225
+ vscale_1.isContinuous)(valueAxisHelper.getScale(0).type), isValidateStateAxis = (0,
226
+ vscale_1.isContinuous)(stateAxisHelper.getScale(0).type);
240
227
  dataCollection.push(s.getRawData());
241
228
  const seriesSpec = s.getSpec(), xField = "cartesian" === s.coordinate ? (0, vutils_1.array)(seriesSpec.xField) : (0,
242
229
  vutils_1.array)(null !== (_a = seriesSpec.angleField) && void 0 !== _a ? _a : seriesSpec.categoryField), yField = "cartesian" === s.coordinate ? (0,
243
230
  vutils_1.array)(seriesSpec.yField) : (0, vutils_1.array)(null !== (_b = seriesSpec.radiusField) && void 0 !== _b ? _b : seriesSpec.valueField);
244
231
  if (originalStateFields[s.id] = "link" === s.type ? [ "from_xField" ] : stateAxisHelper === xAxisHelper ? xField : yField,
245
- (0, vscale_1.isContinuous)(stateAxisHelper.getScale(0).type) ? (isCategoryState = !1,
246
- stateFields.push(originalStateFields[s.id])) : stateFields.push(originalStateFields[s.id][0]),
247
- this._valueField) {
232
+ isValidateStateAxis ? (isCategoryState = !1, stateFields.push(originalStateFields[s.id])) : (isCategoryState = !0,
233
+ stateFields.push(originalStateFields[s.id][0])), this._valueField) {
248
234
  const valueField = "link" === s.type ? [ "from_yField" ] : valueAxisHelper === xAxisHelper ? xField : yField;
249
- (0, vscale_1.isContinuous)(valueAxisHelper.getScale(0).type) && valueFields.push(...valueField);
235
+ isValidateValueAxis && valueFields.push(...valueField);
250
236
  }
251
237
  }), {
252
238
  userId: this._seriesUserId,
253
239
  specIndex: this._seriesIndex
254
240
  }), this._originalStateFields = originalStateFields;
255
241
  } else (0, model_1.eachSeries)(this._regions, (s => {
256
- dataCollection.push(s.getRawData()), stateFields.push(this._field), this._valueField && valueFields.push(this._spec.valueField);
242
+ dataCollection.push(s.getRawData()), seriesCollection.push(s), stateFields.push(this._field),
243
+ this._valueField && valueFields.push(this._spec.valueField);
257
244
  }), {
258
245
  userId: this._seriesUserId,
259
246
  specIndex: this._seriesIndex
@@ -269,6 +256,7 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
269
256
  options: {
270
257
  input: {
271
258
  dataCollection: dataCollection,
259
+ seriesCollection: seriesCollection,
272
260
  stateFields: stateFields,
273
261
  valueFields: valueFields,
274
262
  isCategoryState: isCategoryState
@@ -281,71 +269,6 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
281
269
  }, !1), this._data = new compilable_data_1.CompilableData(this._option, data), data.reRunAllTransform(),
282
270
  dataSet.multipleDataViewAddListener(dataCollection, "change", this._handleDataCollectionChange.bind(this));
283
271
  }
284
- setAttrFromSpec() {
285
- var _a;
286
- super.setAttrFromSpec(), !0 === this._spec.roamZoom || this._spec.roamZoom ? this._zoomAttr = (0,
287
- vutils_1.merge)({}, this._zoomAttr, this._spec.roamZoom) : this._zoomAttr.enable = !1,
288
- !0 === this._spec.roamDrag || this._spec.roamDrag ? this._dragAttr = (0, vutils_1.merge)({}, this._dragAttr, this._spec.roamDrag) : this._dragAttr.enable = !1,
289
- !0 === this._spec.roamScroll || this._spec.roamScroll ? this._scrollAttr = (0, vutils_1.merge)({}, this._scrollAttr, this._spec.roamScroll) : this._scrollAttr.enable = !1,
290
- this._field = this._spec.field, this._width = this._computeWidth(), this._height = this._computeHeight(),
291
- this._visible = null === (_a = this._spec.visible) || void 0 === _a || _a;
292
- }
293
- statePointToData(state) {
294
- const scale = this._stateScale, domain = scale.domain();
295
- if ((0, vscale_1.isContinuous)(scale.type)) return this._isReverse() ? domain[0] + ((0,
296
- vutils_1.last)(domain) - domain[0]) * (1 - state) : domain[0] + ((0, vutils_1.last)(domain) - domain[0]) * state;
297
- let range = scale.range();
298
- this._isReverse() && (range = range.slice().reverse());
299
- const posInRange = range[0] + ((0, vutils_1.last)(range) - range[0]) * state;
300
- return scale.invert(posInRange);
301
- }
302
- dataToStatePoint(data) {
303
- const scale = this._stateScale, pos = scale.scale(data);
304
- let range = scale.range();
305
- return !this._isHorizontal && (0, vscale_1.isContinuous)(scale.type) && (range = range.slice().reverse()),
306
- (pos - range[0]) / ((0, vutils_1.last)(range) - range[0]);
307
- }
308
- _modeCheck(statePoint, mode) {
309
- return "start" === statePoint ? "percent" === mode && (0, vutils_1.isValid)(this._spec.start) || "value" === mode && (0,
310
- vutils_1.isValid)(this._spec.startValue) : "percent" === mode && (0, vutils_1.isValid)(this._spec.end) || "value" === mode && (0,
311
- vutils_1.isValid)(this._spec.endValue);
312
- }
313
- _setStateFromSpec() {
314
- var _a, _b;
315
- let start, end;
316
- if (this._auto = !!this._spec.auto, this._spec.rangeMode) {
317
- const [startMode, endMode] = this._spec.rangeMode;
318
- this._modeCheck("start", startMode) && this._modeCheck("end", endMode) && (start = "percent" === startMode ? this._spec.start : this.dataToStatePoint(this._spec.startValue),
319
- end = "percent" === endMode ? this._spec.end : this.dataToStatePoint(this._spec.endValue));
320
- } else start = this._spec.start ? this._spec.start : this._spec.startValue ? this.dataToStatePoint(this._spec.startValue) : 0,
321
- end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
322
- this._startValue = this.statePointToData(start), this._endValue = this.statePointToData(end),
323
- this._start = start, this._end = end, this._minSpan = null !== (_a = this._spec.minSpan) && void 0 !== _a ? _a : 0,
324
- this._maxSpan = null !== (_b = this._spec.maxSpan) && void 0 !== _b ? _b : 1, (0,
325
- vscale_1.isContinuous)(this._stateScale.type) && this._stateScale.domain()[0] !== (0,
326
- vutils_1.last)(this._stateScale.domain()) && (this._spec.minValueSpan && (this._minSpan = this._spec.minValueSpan / ((0,
327
- vutils_1.last)(this._stateScale.domain()) - this._stateScale.domain()[0])), this._spec.maxValueSpan && (this._maxSpan = this._spec.maxValueSpan / ((0,
328
- vutils_1.last)(this._stateScale.domain()) - this._stateScale.domain()[0]))), this._minSpan = Math.max(0, this._minSpan),
329
- this._maxSpan = Math.min(this._maxSpan, 1), this._relatedAxisComponent && "axis" === this._filterMode || 0 === this._start && 1 === this._end || (this._newDomain = this._parseDomainFromState(this._startValue, this._endValue));
330
- }
331
- _parseFieldOfSeries(s) {
332
- var _a;
333
- return null === (_a = this._originalStateFields) || void 0 === _a ? void 0 : _a[s.id];
334
- }
335
- _initStateScale() {
336
- const defaultRange = [ 0, 1 ];
337
- if (this._relatedAxisComponent) {
338
- const scale = this._relatedAxisComponent.getScale(), isContinuousScale = (0, vscale_1.isContinuous)(scale.type), domain = this._computeDomainOfStateScale(isContinuousScale);
339
- if (this._stateScale = scale.clone(), isContinuousScale) {
340
- const domainNum = domain.map((n => 1 * n));
341
- this._stateScale.domain(domain.length ? [ (0, vutils_1.minInArray)(domainNum), (0,
342
- vutils_1.maxInArray)(domainNum) ] : [ 0, 1 ], !0).range(defaultRange);
343
- } else this._stateScale.domain(domain, !0).range(defaultRange);
344
- } else this._stateScale = new vscale_1.BandScale, this._stateScale.domain(this._computeDomainOfStateScale(), !0).range(defaultRange);
345
- }
346
- init(option) {
347
- super.init(option), this._addTransformToSeries(), 0 === this._start && 1 === this._end || this.effect.onZoomChange();
348
- }
349
272
  _addTransformToSeries() {
350
273
  this._relatedAxisComponent && "axis" === this._filterMode || ((0, register_1.registerDataSetInstanceTransform)(this._option.dataSet, "dataFilterWithNewDomain", util_1.dataFilterWithNewDomain),
351
274
  (0, register_1.registerDataSetInstanceTransform)(this._option.dataSet, "lockStatisticsFilter", util_1.lockStatisticsFilter),
@@ -379,43 +302,73 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
379
302
  specIndex: this._seriesIndex
380
303
  }));
381
304
  }
382
- _compareSpec(spec, prevSpec) {
383
- const result = super._compareSpec(spec, prevSpec);
384
- return result.reMake || (0, vutils_1.isEqual)(prevSpec, spec) || (result.reRender = !0,
385
- result.reMake = !0), result;
305
+ onDataUpdate() {
306
+ var _a;
307
+ const domain = this._computeDomainOfStateScale((0, vscale_1.isContinuous)(this._stateScale.type));
308
+ this._stateScale.domain(domain, !1), this._handleChange(this._start, this._end, !0),
309
+ this._spec.auto && !(0, vutils_1.isEqual)(this._domainCache, domain) && (this._domainCache = domain,
310
+ this._dataUpdating = !0, null === (_a = this.getChart()) || void 0 === _a || _a.setLayoutTag(!0, null, !1));
386
311
  }
387
- reInit(spec) {
388
- super.reInit(spec), this._marks.forEach((g => {
389
- g.getMarks().forEach((m => {
390
- this.initMarkStyleWithSpec(m, this._spec[m.name]);
391
- }));
392
- }));
312
+ _parseFieldOfSeries(s) {
313
+ var _a;
314
+ return null === (_a = this._originalStateFields) || void 0 === _a ? void 0 : _a[s.id];
393
315
  }
394
- _parseDomainFromState(startValue, endValue) {
395
- if ((0, vscale_1.isContinuous)(this._stateScale.type)) return [ Math.min(endValue, startValue), Math.max(endValue, startValue) ];
396
- const allDomain = this._stateScale.domain(), startIndex = allDomain.indexOf(startValue), endIndex = allDomain.indexOf(endValue);
397
- return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
398
- }
399
- _initCommonEvent() {
400
- var _a, _b, _c, _d, _e, _f, _g, _h;
401
- const option = {
402
- delayType: null !== (_b = null === (_a = this._spec) || void 0 === _a ? void 0 : _a.delayType) && void 0 !== _b ? _b : "throttle",
403
- delayTime: (0, vutils_1.isValid)(null === (_c = this._spec) || void 0 === _c ? void 0 : _c.delayType) ? null !== (_e = null === (_d = this._spec) || void 0 === _d ? void 0 : _d.delayTime) && void 0 !== _e ? _e : 30 : 0,
404
- realTime: null === (_g = null === (_f = this._spec) || void 0 === _f ? void 0 : _f.realTime) || void 0 === _g || _g,
405
- allowComponentZoom: !0
406
- };
407
- if (this._zoomAttr.enable && this.initZoomEventOfRegions(this._regions, null, this._handleChartZoom, option),
408
- this._scrollAttr.enable && this.initScrollEventOfRegions(this._regions, null, this._handleChartScroll, option),
409
- this._dragAttr.enable && this.initDragEventOfRegions(this._regions, null, this._handleChartDrag, option),
410
- null === (_h = this._spec.roamDrag) || void 0 === _h ? void 0 : _h.autoVisible) {
411
- const dragEnd = "panend";
412
- this._throttledHide = (0, vutils_1.throttle)((() => this.hide()), 300), this.event.on(dragEnd, (() => {
413
- this._throttledHide();
414
- }));
316
+ _setStateFromSpec() {
317
+ let start, end;
318
+ if (this._auto = !!this._spec.auto, this._spec.rangeMode) {
319
+ const [startMode, endMode] = this._spec.rangeMode;
320
+ (0, util_1.modeCheck)("start", startMode, this._spec) && (0, util_1.modeCheck)("end", endMode, this._spec) && (start = "percent" === startMode ? this._spec.start : (0,
321
+ util_1.dataToStatePoint)(this._spec.startValue, this._stateScale, this._isHorizontal),
322
+ end = "percent" === endMode ? this._spec.end : (0, util_1.dataToStatePoint)(this._spec.endValue, this._stateScale, this._isHorizontal));
323
+ } else start = this._spec.start ? this._spec.start : this._spec.startValue ? (0,
324
+ util_1.dataToStatePoint)(this._spec.startValue, this._stateScale, this._isHorizontal) : 0,
325
+ end = this._spec.end ? this._spec.end : this._spec.endValue ? (0, util_1.dataToStatePoint)(this._spec.endValue, this._stateScale, this._isHorizontal) : 1;
326
+ this._start = Math.max(0, Math.min(1, start)), this._end = Math.max(0, Math.min(1, end));
327
+ }
328
+ _setStateFromAxis() {
329
+ var _a, _b;
330
+ this._setStateFromSpec();
331
+ const axis = this._relatedAxisComponent;
332
+ this._startValue = (0, util_1.statePointToData)(this._start, this._stateScale, (0,
333
+ util_1.isReverse)(axis, this._isHorizontal)), this._endValue = (0, util_1.statePointToData)(this._end, this._stateScale, (0,
334
+ util_1.isReverse)(axis, this._isHorizontal)), this._minSpan = null !== (_a = this._spec.minSpan) && void 0 !== _a ? _a : 0,
335
+ this._maxSpan = null !== (_b = this._spec.maxSpan) && void 0 !== _b ? _b : 1, (0,
336
+ vscale_1.isContinuous)(this._stateScale.type) && this._stateScale.domain()[0] !== (0,
337
+ vutils_1.last)(this._stateScale.domain()) && (this._spec.minValueSpan && (this._minSpan = this._spec.minValueSpan / ((0,
338
+ vutils_1.last)(this._stateScale.domain()) - this._stateScale.domain()[0])), this._spec.maxValueSpan && (this._maxSpan = this._spec.maxValueSpan / ((0,
339
+ vutils_1.last)(this._stateScale.domain()) - this._stateScale.domain()[0]))), this._minSpan = Math.max(0, this._minSpan),
340
+ this._maxSpan = Math.min(this._maxSpan, 1), axis && (axis && "axis" === this._filterMode || 0 === this._start && 1 === this._end || (this._newDomain = (0,
341
+ util_1.parseDomainFromState)(this._startValue, this._endValue, this._stateScale)));
342
+ }
343
+ _initStateScale() {
344
+ var _a, _b, _c, _d, _e, _f;
345
+ const defaultRange = [ 0, 1 ];
346
+ if (this._relatedAxisComponent) {
347
+ const scale = this._relatedAxisComponent.getScale().clone();
348
+ this._stateScale = scale, null === (_b = (_a = scale).maxBandwidth) || void 0 === _b || _b.call(_a, "auto", !0),
349
+ null === (_d = (_c = scale).minBandwidth) || void 0 === _d || _d.call(_c, "auto", !0),
350
+ null === (_f = (_e = scale).bandwidth) || void 0 === _f || _f.call(_e, "auto", !0),
351
+ scale.rangeFactor(defaultRange, !0).range(defaultRange);
352
+ } else {
353
+ let fieldLinear = !0;
354
+ this._field && (0, model_1.eachSeries)(this._regions, (s => {
355
+ const stats = s.getRawDataStatisticsByField(this._field);
356
+ (0, vutils_1.isValidNumber)(null == stats ? void 0 : stats.min) && (0, vutils_1.isValidNumber)(null == stats ? void 0 : stats.max) || (fieldLinear = !1);
357
+ }), {
358
+ userId: this._seriesUserId,
359
+ specIndex: this._seriesIndex
360
+ }), this._stateScale = fieldLinear ? new vscale_1.LinearScale : new vscale_1.BandScale,
361
+ this._stateScale.domain(this._computeDomainOfStateScale(fieldLinear), !0).range(defaultRange);
415
362
  }
416
363
  }
417
- updateLayoutAttribute() {
418
- this._visible && this._createOrUpdateComponent(), super.updateLayoutAttribute();
364
+ _computeDomainOfStateScale(isContinuous) {
365
+ if (this._spec.customDomain) return this._spec.customDomain;
366
+ const domain = this._data.getLatestData().map((d => d[this._stateField]));
367
+ if (isContinuous) {
368
+ const domainNum = domain.map((n => 1 * n));
369
+ return domain.length ? [ (0, vutils_1.minInArray)(domainNum), (0, vutils_1.maxInArray)(domainNum) ] : [ -1 / 0, 1 / 0 ];
370
+ }
371
+ return domain;
419
372
  }
420
373
  _autoVisible(isShown) {
421
374
  if (!this._auto) return;
@@ -427,25 +380,6 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
427
380
  [sizeKey]: attribute_1.AttributeLevel.Built_In
428
381
  });
429
382
  }
430
- onLayoutStart(layoutRect, viewRect) {
431
- super.onLayoutStart(layoutRect, viewRect);
432
- const isShown = this._autoUpdate(layoutRect);
433
- this._autoVisible(isShown), this._dataUpdating = !1;
434
- }
435
- onLayoutEnd() {
436
- const isShown = !(0 === this._start && 1 === this._end);
437
- this._autoVisible(isShown), super.onLayoutEnd();
438
- }
439
- getBoundsInRect(rect) {
440
- const result = {
441
- x1: this.getLayoutStartPoint().x,
442
- y1: this.getLayoutStartPoint().y,
443
- x2: 0,
444
- y2: 0
445
- };
446
- return this._isHorizontal ? (result.y2 = result.y1 + this._height, result.x2 = result.x1 + rect.width) : (result.x2 = result.x1 + this._width,
447
- result.y2 = result.y1 + rect.height), result;
448
- }
449
383
  hide() {
450
384
  var _a;
451
385
  null === (_a = this._component) || void 0 === _a || _a.hideAll();
@@ -454,18 +388,11 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
454
388
  var _a;
455
389
  null === (_a = this._component) || void 0 === _a || _a.showAll();
456
390
  }
457
- _getAxisBandSize(axisSpec) {
458
- const bandSize = null == axisSpec ? void 0 : axisSpec.bandSize, maxBandSize = null == axisSpec ? void 0 : axisSpec.maxBandSize, minBandSize = null == axisSpec ? void 0 : axisSpec.minBandSize;
459
- if (bandSize || minBandSize || maxBandSize) return {
460
- bandSize: bandSize,
461
- maxBandSize: maxBandSize,
462
- minBandSize: minBandSize
463
- };
464
- }
465
391
  _autoUpdate(rect) {
466
392
  var _a, _b, _c, _d, _e, _f;
467
393
  if (!this._auto) return this._cacheVisibility = void 0, !0;
468
- const axis = this._relatedAxisComponent, axisSpec = null == axis ? void 0 : axis.getSpec(), axisScale = null == axis ? void 0 : axis.getScale(), bandSizeResult = this._getAxisBandSize(axisSpec);
394
+ const axis = this._relatedAxisComponent, axisSpec = null == axis ? void 0 : axis.getSpec(), axisScale = null == axis ? void 0 : axis.getScale(), bandSizeResult = (0,
395
+ util_1.getAxisBandSize)(axisSpec);
469
396
  if (!this._dataUpdating && (0, vscale_1.isDiscrete)(axisScale.type) && (null == rect ? void 0 : rect.height) === (null === (_a = this._cacheRect) || void 0 === _a ? void 0 : _a.height) && (null == rect ? void 0 : rect.width) === (null === (_b = this._cacheRect) || void 0 === _b ? void 0 : _b.width) && this._fixedBandSize === (null == bandSizeResult ? void 0 : bandSizeResult.bandSize)) return this._cacheVisibility;
470
397
  let isShown = !0;
471
398
  if (this._isHorizontal && (null == rect ? void 0 : rect.width) !== (null === (_c = this._cacheRect) || void 0 === _c ? void 0 : _c.width) ? axisScale.range(axis.getInverse() ? [ rect.width, 0 ] : [ 0, rect.width ]) : (null == rect ? void 0 : rect.height) !== (null === (_d = this._cacheRect) || void 0 === _d ? void 0 : _d.height) && axisScale.range(axis.getInverse() ? [ 0, rect.height ] : [ rect.height, 0 ]),
@@ -488,9 +415,6 @@ class DataFilterBaseComponent extends base_component_1.BaseComponent {
488
415
  _getNeedClearVRenderComponents() {
489
416
  return [ this._component ];
490
417
  }
491
- clear() {
492
- this._throttledHide = null;
493
- }
494
418
  }
495
419
 
496
420
  exports.DataFilterBaseComponent = DataFilterBaseComponent, (0, vutils_1.mixin)(DataFilterBaseComponent, zoomable_1.Zoomable);