@visactor/vchart 2.0.13-alpha.3 → 2.0.13-alpha.5

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 (54) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +735 -693
  3. package/build/index.js +735 -693
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/component/brush/brush.d.ts +1 -0
  7. package/cjs/component/brush/brush.js +10 -0
  8. package/cjs/component/brush/brush.js.map +1 -1
  9. package/cjs/component/brush/interface.d.ts +1 -0
  10. package/cjs/component/brush/interface.js.map +1 -1
  11. package/cjs/component/crosshair/interface/spec.d.ts +1 -0
  12. package/cjs/component/crosshair/interface/spec.js.map +1 -1
  13. package/cjs/component/tooltip/interface/common.d.ts +1 -0
  14. package/cjs/component/tooltip/interface/common.js.map +1 -1
  15. package/cjs/component/tooltip/processor/base.js +1 -1
  16. package/cjs/component/tooltip/processor/base.js.map +1 -1
  17. package/cjs/component/tooltip/tooltip.d.ts +1 -0
  18. package/cjs/component/tooltip/tooltip.js +3 -2
  19. package/cjs/component/tooltip/tooltip.js.map +1 -1
  20. package/cjs/core/interface.d.ts +9 -1
  21. package/cjs/core/interface.js.map +1 -1
  22. package/cjs/core/vchart.d.ts +3 -0
  23. package/cjs/core/vchart.js +10 -1
  24. package/cjs/core/vchart.js.map +1 -1
  25. package/cjs/event/event.js +1 -1
  26. package/cjs/event/event.js.map +1 -1
  27. package/cjs/event/events/dimension/dimension-hover.d.ts +2 -0
  28. package/cjs/event/events/dimension/dimension-hover.js +6 -3
  29. package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
  30. package/esm/component/brush/brush.d.ts +1 -0
  31. package/esm/component/brush/brush.js +10 -0
  32. package/esm/component/brush/brush.js.map +1 -1
  33. package/esm/component/brush/interface.d.ts +1 -0
  34. package/esm/component/brush/interface.js.map +1 -1
  35. package/esm/component/crosshair/interface/spec.d.ts +1 -0
  36. package/esm/component/crosshair/interface/spec.js.map +1 -1
  37. package/esm/component/tooltip/interface/common.d.ts +1 -0
  38. package/esm/component/tooltip/interface/common.js.map +1 -1
  39. package/esm/component/tooltip/processor/base.js +1 -1
  40. package/esm/component/tooltip/processor/base.js.map +1 -1
  41. package/esm/component/tooltip/tooltip.d.ts +1 -0
  42. package/esm/component/tooltip/tooltip.js +3 -2
  43. package/esm/component/tooltip/tooltip.js.map +1 -1
  44. package/esm/core/interface.d.ts +9 -1
  45. package/esm/core/interface.js.map +1 -1
  46. package/esm/core/vchart.d.ts +3 -0
  47. package/esm/core/vchart.js +11 -0
  48. package/esm/core/vchart.js.map +1 -1
  49. package/esm/event/event.js +1 -1
  50. package/esm/event/event.js.map +1 -1
  51. package/esm/event/events/dimension/dimension-hover.d.ts +2 -0
  52. package/esm/event/events/dimension/dimension-hover.js +7 -2
  53. package/esm/event/events/dimension/dimension-hover.js.map +1 -1
  54. package/package.json +4 -4
package/build/index.js CHANGED
@@ -53874,7 +53874,7 @@
53874
53874
  if (ComposedEventCtor) {
53875
53875
  const composedEvent = new ComposedEventCtor(this._eventDispatcher, this._mode);
53876
53876
  composedEvent.register(eType, handler);
53877
- this._composedEventMap.set(callback, {
53877
+ this._composedEventMap.set(handler.callback, {
53878
53878
  eventType: eType,
53879
53879
  event: composedEvent
53880
53880
  });
@@ -60286,6 +60286,609 @@
60286
60286
  }
60287
60287
  }
60288
60288
 
60289
+ function getComponentThemeFromOption(type, getTheme) {
60290
+ return getTheme('component', type);
60291
+ }
60292
+ function getFormatFunction(formatMethod, formatter, text, datum) {
60293
+ if (formatMethod) {
60294
+ return { formatFunc: formatMethod, args: [text, datum] };
60295
+ }
60296
+ const formatterImpl = Factory.getFormatter();
60297
+ if (formatter && formatterImpl) {
60298
+ return { formatFunc: formatterImpl, args: [text, datum, formatter] };
60299
+ }
60300
+ return {};
60301
+ }
60302
+ const getSpecInfo = (chartSpec, specKey, compType, filter) => {
60303
+ if (isNil$1(chartSpec[specKey])) {
60304
+ return undefined;
60305
+ }
60306
+ const isArraySpec = isArray$1(chartSpec[specKey]);
60307
+ const spec = isArraySpec ? chartSpec[specKey] : [chartSpec[specKey]];
60308
+ const specInfos = [];
60309
+ spec.forEach((s, i) => {
60310
+ if (s && (!filter || filter(s))) {
60311
+ specInfos.push({
60312
+ spec: s,
60313
+ specPath: isArraySpec ? [specKey, i] : [specKey],
60314
+ specInfoPath: ['component', specKey, i],
60315
+ type: compType
60316
+ });
60317
+ }
60318
+ });
60319
+ return specInfos;
60320
+ };
60321
+
60322
+ function isXAxis(orient) {
60323
+ return orient === 'bottom' || orient === 'top';
60324
+ }
60325
+ function isYAxis(orient) {
60326
+ return orient === 'left' || orient === 'right';
60327
+ }
60328
+ function isZAxis(orient) {
60329
+ return orient === 'z';
60330
+ }
60331
+ function autoAxisType(orient, isHorizontal) {
60332
+ if (isHorizontal) {
60333
+ return isXAxis(orient) ? 'linear' : 'band';
60334
+ }
60335
+ return isXAxis(orient) ? 'band' : 'linear';
60336
+ }
60337
+ function getOrient(spec, whiteList) {
60338
+ return isValidOrient(spec.orient) || (whiteList && whiteList.includes(spec.orient)) ? spec.orient : 'left';
60339
+ }
60340
+ function getDirectionByOrient(orient) {
60341
+ return orient === 'top' || orient === 'bottom' ? "horizontal" : "vertical";
60342
+ }
60343
+ function transformInverse(spec, isHorizontal) {
60344
+ let inverse = spec.inverse;
60345
+ if (isHorizontal && !isXAxis(spec.orient)) {
60346
+ inverse = isValid$1(spec.inverse) ? !spec.inverse : true;
60347
+ }
60348
+ return inverse;
60349
+ }
60350
+ function getCartesianAxisInfo(spec, isHorizontal) {
60351
+ var _a;
60352
+ const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : autoAxisType(spec.orient, isHorizontal);
60353
+ const componentName = `${ComponentTypeEnum.cartesianAxis}-${axisType}`;
60354
+ return { axisType, componentName };
60355
+ }
60356
+ const getCartesianAxisTheme = (orient, type, getTheme) => {
60357
+ var _a;
60358
+ const axisTypeTheme = (_a = (type === 'band'
60359
+ ? getComponentThemeFromOption('axisBand', getTheme)
60360
+ : ['linear', 'log', 'symlog'].includes(type)
60361
+ ? getComponentThemeFromOption('axisLinear', getTheme)
60362
+ : {})) !== null && _a !== void 0 ? _a : {};
60363
+ const axisTheme = isXAxis(orient)
60364
+ ? getComponentThemeFromOption('axisX', getTheme)
60365
+ : isYAxis(orient)
60366
+ ? getComponentThemeFromOption('axisY', getTheme)
60367
+ : getComponentThemeFromOption('axisZ', getTheme);
60368
+ return mergeSpec({}, getComponentThemeFromOption('axis', getTheme), axisTypeTheme, axisTheme);
60369
+ };
60370
+
60371
+ class DimensionEvent {
60372
+ constructor(eventDispatcher, mode) {
60373
+ this._eventDispatcher = eventDispatcher;
60374
+ this._mode = mode;
60375
+ }
60376
+ get chart() {
60377
+ var _a, _b;
60378
+ if (!this._chart) {
60379
+ this._chart = (_b = (_a = this._eventDispatcher.globalInstance).getChart) === null || _b === void 0 ? void 0 : _b.call(_a);
60380
+ }
60381
+ return this._chart;
60382
+ }
60383
+ register(eType, handler) {
60384
+ var _a, _b;
60385
+ ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOption().onError) !== null && _b !== void 0 ? _b : error)('Method not implemented.');
60386
+ }
60387
+ unregister() {
60388
+ var _a, _b;
60389
+ ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOption().onError) !== null && _b !== void 0 ? _b : error)('Method not implemented.');
60390
+ }
60391
+ getTargetDimensionInfo(x, y) {
60392
+ var _a, _b, _c;
60393
+ const dimensionInfo = (_c = (_b = (_a = this.chart.getModelOption()).getDimensionInfo) === null || _b === void 0 ? void 0 : _b.call(_a, this.chart, { x, y })) !== null && _c !== void 0 ? _c : [];
60394
+ if (dimensionInfo.length === 0) {
60395
+ return null;
60396
+ }
60397
+ return dimensionInfo;
60398
+ }
60399
+ dispatch(v, opt) {
60400
+ var _a, _b;
60401
+ const axes = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getAllComponents().filter(c => {
60402
+ if (c.specKey !== 'axes') {
60403
+ return false;
60404
+ }
60405
+ if (opt === null || opt === void 0 ? void 0 : opt.filter) {
60406
+ return opt.filter(c);
60407
+ }
60408
+ return true;
60409
+ });
60410
+ const discreteAxes = axes.filter(axis => {
60411
+ const scale = axis.getScale();
60412
+ return isDiscrete(scale.type);
60413
+ });
60414
+ const dimAxes = discreteAxes.length
60415
+ ? discreteAxes
60416
+ : axes.filter(axis => {
60417
+ const orient = axis.getOrient();
60418
+ return isXAxis(orient) || orient === 'angle';
60419
+ });
60420
+ const dimensionInfo = [];
60421
+ const getDimensionInfoByValue = (_b = this.chart) === null || _b === void 0 ? void 0 : _b.getModelOption().getDimensionInfoByValue;
60422
+ if (getDimensionInfoByValue) {
60423
+ dimAxes.forEach(a => {
60424
+ const info = getDimensionInfoByValue(a, v);
60425
+ if (info) {
60426
+ dimensionInfo.push(info);
60427
+ }
60428
+ });
60429
+ }
60430
+ this._callback.call(null, {
60431
+ action: 'enter',
60432
+ dimensionInfo
60433
+ });
60434
+ return dimensionInfo;
60435
+ }
60436
+ }
60437
+
60438
+ class DimensionClickEvent extends DimensionEvent {
60439
+ constructor() {
60440
+ super(...arguments);
60441
+ this.onClick = (params) => {
60442
+ if (!params) {
60443
+ return;
60444
+ }
60445
+ const x = params.event.viewX;
60446
+ const y = params.event.viewY;
60447
+ const targetDimensionInfo = this.getTargetDimensionInfo(x, y);
60448
+ if (!targetDimensionInfo) {
60449
+ return;
60450
+ }
60451
+ this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'click', dimensionInfo: targetDimensionInfo.slice() }));
60452
+ };
60453
+ }
60454
+ register(eType, handler) {
60455
+ this._callback = handler.callback;
60456
+ this._eventDispatcher.register('pointertap', {
60457
+ query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
60458
+ callback: this.onClick
60459
+ });
60460
+ }
60461
+ unregister() {
60462
+ this._eventDispatcher.unregister('pointertap', {
60463
+ query: null,
60464
+ callback: this.onClick
60465
+ });
60466
+ }
60467
+ }
60468
+
60469
+ const isInBound = (pos, min, max) => pos.x >= min.x && pos.x <= max.x && pos.y >= min.y && pos.y <= max.y;
60470
+ const isInRegionBound = (chart, axis, pos) => {
60471
+ const regionList = chart.getRegionsInIds(array(axis.layout.layoutBindRegionID));
60472
+ return regionList === null || regionList === void 0 ? void 0 : regionList.some(region => {
60473
+ const rect = region.getLayoutRect();
60474
+ const startPoint = region.getLayoutStartPoint();
60475
+ return isInBound(pos, { x: startPoint.x, y: startPoint.y }, { x: rect.width + startPoint.x, y: rect.height + startPoint.y });
60476
+ });
60477
+ };
60478
+ const isSameDimensionInfo = (a, b) => {
60479
+ var _a, _b;
60480
+ if (a === b) {
60481
+ return true;
60482
+ }
60483
+ if (isNil$1(a) || isNil$1(b)) {
60484
+ return false;
60485
+ }
60486
+ if (a.value !== b.value) {
60487
+ return false;
60488
+ }
60489
+ if (((_a = a.axis) === null || _a === void 0 ? void 0 : _a.id) !== ((_b = b.axis) === null || _b === void 0 ? void 0 : _b.id)) {
60490
+ return false;
60491
+ }
60492
+ return true;
60493
+ };
60494
+ const resolveTooltipFilterRange = (spec, scale) => {
60495
+ const range = spec.tooltipFilterRange;
60496
+ const rangeValue = typeof range === 'function' ? range({ scale }) : range;
60497
+ const rangeArr = (isValidNumber$1(rangeValue) ? [-rangeValue, rangeValue] : rangeValue);
60498
+ return rangeArr;
60499
+ };
60500
+ const getDimensionData = (value, axis, coordinate, getDimensionField) => {
60501
+ var _a;
60502
+ const scale = axis.getScale();
60503
+ const isDiscreteAxis = isDiscrete(scale.type);
60504
+ const data = [];
60505
+ const seriesList = axis.getOption().getChart().getSeriesInIndex(axis.getSpecInfo().seriesIndexes);
60506
+ for (const series of seriesList) {
60507
+ if (series.coordinate === coordinate) {
60508
+ const dimensionField = array(getDimensionField(series));
60509
+ const viewData = (_a = series.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData;
60510
+ if (dimensionField && viewData) {
60511
+ if (isDiscreteAxis) {
60512
+ const datums = [];
60513
+ const datumIdList = [];
60514
+ viewData.forEach((datum, i) => {
60515
+ var _a;
60516
+ if (((_a = datum[dimensionField[0]]) === null || _a === void 0 ? void 0 : _a.toString()) === (value === null || value === void 0 ? void 0 : value.toString())) {
60517
+ datums.push(datum);
60518
+ datumIdList.push(i);
60519
+ }
60520
+ });
60521
+ data.push({
60522
+ series,
60523
+ datum: datums,
60524
+ key: getDimensionDataKey(series, datumIdList)
60525
+ });
60526
+ }
60527
+ else {
60528
+ if (isValid$1(dimensionField[1])) {
60529
+ const datums = [];
60530
+ const datumIdList = [];
60531
+ viewData.forEach((datum, i) => {
60532
+ var _a;
60533
+ if (((_a = datum[dimensionField[0]]) === null || _a === void 0 ? void 0 : _a.toString()) === (value === null || value === void 0 ? void 0 : value.toString()) ||
60534
+ (isValid$1(datum[dimensionField[0]]) &&
60535
+ isValid$1(datum[dimensionField[1]]) &&
60536
+ value >= datum[dimensionField[0]] &&
60537
+ value < datum[dimensionField[1]])) {
60538
+ datums.push(datum);
60539
+ datumIdList.push(i);
60540
+ }
60541
+ });
60542
+ data.push({
60543
+ series,
60544
+ datum: datums,
60545
+ key: getDimensionDataKey(series, datumIdList)
60546
+ });
60547
+ }
60548
+ else {
60549
+ const spec = axis.getSpec();
60550
+ const rangeArr = resolveTooltipFilterRange(spec, scale);
60551
+ let datums = [];
60552
+ let datumIdList = [];
60553
+ if (rangeArr) {
60554
+ viewData.forEach((datum, i) => {
60555
+ if (isValid$1(datum[dimensionField[0]])) {
60556
+ const delta = datum[dimensionField[0]] - value;
60557
+ if (delta >= rangeArr[0] && delta <= rangeArr[1]) {
60558
+ datums.push(datum);
60559
+ datumIdList.push(i);
60560
+ }
60561
+ }
60562
+ });
60563
+ }
60564
+ else {
60565
+ let minDelta = Infinity;
60566
+ let deltaSign = 0;
60567
+ viewData.forEach((datum, i) => {
60568
+ if (isValid$1(datum[dimensionField[0]])) {
60569
+ const delta = Math.abs(datum[dimensionField[0]] - value);
60570
+ const sign = Math.sign(datum[dimensionField[0]] - value);
60571
+ if (delta < minDelta) {
60572
+ minDelta = delta;
60573
+ datums = [datum];
60574
+ datumIdList = [i];
60575
+ deltaSign = sign;
60576
+ }
60577
+ else if (delta === minDelta && sign === deltaSign) {
60578
+ datums.push(datum);
60579
+ datumIdList.push(i);
60580
+ }
60581
+ }
60582
+ });
60583
+ }
60584
+ data.push({
60585
+ series,
60586
+ datum: datums,
60587
+ key: getDimensionDataKey(series, datumIdList)
60588
+ });
60589
+ }
60590
+ }
60591
+ }
60592
+ }
60593
+ }
60594
+ return data;
60595
+ };
60596
+ const getDimensionDataKey = (series, datumIdList) => `${series.id}_${datumIdList.join('_')}`;
60597
+ const getAxis = (chart, filter, pos) => {
60598
+ const axesComponents = chart
60599
+ .getAllComponents()
60600
+ .filter(c => c.specKey === 'axes' && filter(c) && isInRegionBound(chart, c, pos));
60601
+ if (!axesComponents.length) {
60602
+ return null;
60603
+ }
60604
+ return axesComponents;
60605
+ };
60606
+
60607
+ class DimensionHoverEvent extends DimensionEvent {
60608
+ constructor() {
60609
+ super(...arguments);
60610
+ this._cacheDimensionInfo = null;
60611
+ this.onMouseMove = (params) => {
60612
+ if (!params || DimensionHoverEvent._disableDimensionEvent) {
60613
+ return;
60614
+ }
60615
+ const x = params.event.viewX;
60616
+ const y = params.event.viewY;
60617
+ const targetDimensionInfo = this.getTargetDimensionInfo(x, y);
60618
+ if (targetDimensionInfo === null && this._cacheDimensionInfo !== null) {
60619
+ this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo.slice() }));
60620
+ this._cacheDimensionInfo = targetDimensionInfo;
60621
+ }
60622
+ else if (targetDimensionInfo !== null &&
60623
+ (this._cacheDimensionInfo === null ||
60624
+ targetDimensionInfo.length !== this._cacheDimensionInfo.length ||
60625
+ targetDimensionInfo.some((info, i) => !isSameDimensionInfo(info, this._cacheDimensionInfo[i])))) {
60626
+ this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'enter', dimensionInfo: targetDimensionInfo.slice() }));
60627
+ this._cacheDimensionInfo = targetDimensionInfo;
60628
+ }
60629
+ else if (targetDimensionInfo !== null) {
60630
+ this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'move', dimensionInfo: targetDimensionInfo.slice() }));
60631
+ }
60632
+ };
60633
+ this.onMouseOut = (params) => {
60634
+ if (!params || DimensionHoverEvent._disableDimensionEvent) {
60635
+ return;
60636
+ }
60637
+ this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
60638
+ this._cacheDimensionInfo = null;
60639
+ };
60640
+ }
60641
+ static disableDimensionEvent(value) {
60642
+ this._disableDimensionEvent = value;
60643
+ }
60644
+ register(eType, handler) {
60645
+ this._callback = handler.callback;
60646
+ this._eventDispatcher.register('pointermove', {
60647
+ query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
60648
+ callback: this.onMouseMove
60649
+ });
60650
+ this._eventDispatcher.register('pointerout', {
60651
+ query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.canvas }),
60652
+ callback: this.onMouseOut
60653
+ });
60654
+ if (isMobileLikeMode(this._mode)) {
60655
+ this._eventDispatcher.register('pointerdown', {
60656
+ query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
60657
+ callback: this.onMouseMove
60658
+ });
60659
+ }
60660
+ }
60661
+ unregister() {
60662
+ this._eventDispatcher.unregister('pointermove', {
60663
+ query: null,
60664
+ callback: this.onMouseMove
60665
+ });
60666
+ if (isMobileLikeMode(this._mode)) {
60667
+ this._eventDispatcher.unregister('pointerdown', {
60668
+ query: null,
60669
+ callback: this.onMouseMove
60670
+ });
60671
+ }
60672
+ }
60673
+ }
60674
+ DimensionHoverEvent._disableDimensionEvent = false;
60675
+
60676
+ exports.DimensionEventEnum = void 0;
60677
+ (function (DimensionEventEnum) {
60678
+ DimensionEventEnum["dimensionHover"] = "dimensionHover";
60679
+ DimensionEventEnum["dimensionClick"] = "dimensionClick";
60680
+ })(exports.DimensionEventEnum || (exports.DimensionEventEnum = {}));
60681
+
60682
+ const registerDimensionEvents = () => {
60683
+ Factory.registerComposedEvent(exports.DimensionEventEnum.dimensionHover, DimensionHoverEvent);
60684
+ Factory.registerComposedEvent(exports.DimensionEventEnum.dimensionClick, DimensionClickEvent);
60685
+ };
60686
+
60687
+ const discreteXAxisGetDimensionField = (series) => series.fieldX[0];
60688
+ const discreteYAxisGetDimensionField = (series) => series.fieldY[0];
60689
+ const continuousXAxisGetDimensionField = (series) => {
60690
+ var _a;
60691
+ return [
60692
+ series.fieldX[0],
60693
+ (_a = series.fieldX2) !== null && _a !== void 0 ? _a : series.fieldX[1]
60694
+ ];
60695
+ };
60696
+ const continuousYAxisGetDimensionField = (series) => {
60697
+ var _a;
60698
+ return [
60699
+ series.fieldY[0],
60700
+ (_a = series.fieldY2) !== null && _a !== void 0 ? _a : series.fieldY[1]
60701
+ ];
60702
+ };
60703
+ const getDimensionFieldFunc = (isXAxis, isDiscreteAxis) => isXAxis
60704
+ ? isDiscreteAxis
60705
+ ? discreteXAxisGetDimensionField
60706
+ : continuousXAxisGetDimensionField
60707
+ : isDiscreteAxis
60708
+ ? discreteYAxisGetDimensionField
60709
+ : continuousYAxisGetDimensionField;
60710
+ const getCartesianDimensionInfo = (chart, pos, isTooltip) => {
60711
+ var _a, _b;
60712
+ if (!chart) {
60713
+ return null;
60714
+ }
60715
+ const { x, y } = pos;
60716
+ const xAxisList = (_a = getAxis(chart, (cmp) => isXAxis(cmp.getOrient()), pos)) !== null && _a !== void 0 ? _a : [];
60717
+ const yAxisList = (_b = getAxis(chart, (cmp) => isYAxis(cmp.getOrient()), pos)) !== null && _b !== void 0 ? _b : [];
60718
+ if (!xAxisList.length && !yAxisList.length) {
60719
+ return null;
60720
+ }
60721
+ const bandAxisSet = new Set();
60722
+ const linearAxisSet = new Set();
60723
+ const forceAxisSet = new Set();
60724
+ [xAxisList, yAxisList].forEach(axisList => axisList.forEach(axis => {
60725
+ const isDiscreteAxis = isDiscrete(axis.getScale().type);
60726
+ if (isDiscreteAxis) {
60727
+ bandAxisSet.add(axis);
60728
+ }
60729
+ else {
60730
+ linearAxisSet.add(axis);
60731
+ }
60732
+ if (isTooltip && axis.getSpec().hasDimensionTooltip) {
60733
+ forceAxisSet.add(axis);
60734
+ }
60735
+ }));
60736
+ const targetAxisInfo = [];
60737
+ const addAxisDimensionInfo = (orient) => {
60738
+ const isXAxis = orient === 'x';
60739
+ const posValue = isXAxis ? x : y;
60740
+ const axisList = isXAxis ? xAxisList : yAxisList;
60741
+ axisList.forEach(axis => {
60742
+ if (forceAxisSet.size > 0) {
60743
+ if (forceAxisSet.has(axis)) {
60744
+ const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, isDiscrete(axis.getScale().type)));
60745
+ info && targetAxisInfo.push(info);
60746
+ }
60747
+ }
60748
+ else {
60749
+ const hasDiscreteAxis = bandAxisSet.size > 0;
60750
+ if ((hasDiscreteAxis ? bandAxisSet : linearAxisSet).has(axis)) {
60751
+ const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, hasDiscreteAxis));
60752
+ info && targetAxisInfo.push(info);
60753
+ }
60754
+ }
60755
+ });
60756
+ };
60757
+ if (chart.getSpec().direction === "horizontal") {
60758
+ addAxisDimensionInfo('y');
60759
+ if (targetAxisInfo.length === 0) {
60760
+ addAxisDimensionInfo('x');
60761
+ }
60762
+ }
60763
+ else {
60764
+ addAxisDimensionInfo('x');
60765
+ if (targetAxisInfo.length === 0) {
60766
+ addAxisDimensionInfo('y');
60767
+ }
60768
+ }
60769
+ if (!targetAxisInfo.length) {
60770
+ return null;
60771
+ }
60772
+ return targetAxisInfo;
60773
+ };
60774
+ const getDimensionInfoByPosition = (axis, posValue, getDimensionField) => {
60775
+ const value = axis.positionToData(posValue, true);
60776
+ return isNil$1(value) ? null : getDimensionInfoByValue(axis, value, getDimensionField);
60777
+ };
60778
+ const getDimensionInfoByValue = (axis, value, getDimensionField) => {
60779
+ const scale = axis.getScale();
60780
+ if (isNil$1(value)) {
60781
+ return null;
60782
+ }
60783
+ const domain = scale.domain();
60784
+ let index = domain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
60785
+ if (index < 0) {
60786
+ index = undefined;
60787
+ }
60788
+ const data = getDimensionData(value, axis, 'cartesian', getDimensionField !== null && getDimensionField !== void 0 ? getDimensionField : (isXAxis(axis.getOrient()) ? discreteXAxisGetDimensionField : discreteYAxisGetDimensionField));
60789
+ return { index, value, position: scale.scale(value), axis, data };
60790
+ };
60791
+
60792
+ const angleStandardize = (angle, range) => {
60793
+ const unit = Math.PI * 2;
60794
+ const min = minInArray(range);
60795
+ const max = maxInArray(range);
60796
+ if (angle < min) {
60797
+ angle += Math.ceil((min - angle) / unit) * unit;
60798
+ }
60799
+ else if (angle > max) {
60800
+ angle -= Math.ceil((angle - max) / unit) * unit;
60801
+ }
60802
+ return angle;
60803
+ };
60804
+ const getPolarDimensionInfo = (chart, pos) => {
60805
+ if (!chart) {
60806
+ return null;
60807
+ }
60808
+ const angleAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'angle', pos);
60809
+ const radiusAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'radius', pos);
60810
+ if ((!angleAxisList || !angleAxisList.length) && (!radiusAxisList || !radiusAxisList.length)) {
60811
+ return null;
60812
+ }
60813
+ const targetAxisInfo = [];
60814
+ const getDimensionField = (series) => series.getDimensionField()[0];
60815
+ const { x, y } = pos;
60816
+ if (angleAxisList) {
60817
+ angleAxisList.forEach(axis => {
60818
+ var _a;
60819
+ const angleScale = axis.getScale();
60820
+ if (angleScale && isDiscrete(angleScale.type)) {
60821
+ const angleDomain = angleScale.domain();
60822
+ const angleRange = angleScale.range();
60823
+ const center = axis.getCenter();
60824
+ const vector = {
60825
+ x: x - axis.getLayoutStartPoint().x - center.x,
60826
+ y: y - axis.getLayoutStartPoint().y - center.y
60827
+ };
60828
+ let angle = vectorAngle({ x: 1, y: 0 }, vector);
60829
+ angle = angleStandardize(angle, angleRange);
60830
+ const radius = distance(vector);
60831
+ const radiusScale = (_a = radiusAxisList[0]) === null || _a === void 0 ? void 0 : _a.getScale();
60832
+ const radiusRange = radiusScale === null || radiusScale === void 0 ? void 0 : radiusScale.range();
60833
+ if ((angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[0])) * (angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[1])) > 0 ||
60834
+ (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[0])) * (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[1])) > 0) {
60835
+ return;
60836
+ }
60837
+ const value = axis.invert(angle);
60838
+ if (isNil$1(value)) {
60839
+ return;
60840
+ }
60841
+ let index = angleDomain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
60842
+ if (index < 0) {
60843
+ index = undefined;
60844
+ }
60845
+ const data = getDimensionData(value, axis, 'polar', getDimensionField);
60846
+ targetAxisInfo.push({ index, value, position: angleScale.scale(value), axis, data });
60847
+ }
60848
+ });
60849
+ }
60850
+ if (radiusAxisList) {
60851
+ radiusAxisList.forEach(axis => {
60852
+ var _a;
60853
+ const radiusScale = axis.getScale();
60854
+ const radiusRange = radiusScale === null || radiusScale === void 0 ? void 0 : radiusScale.range();
60855
+ if (radiusScale && isDiscrete(radiusScale.type)) {
60856
+ const center = axis.getCenter();
60857
+ const vector = {
60858
+ x: x - axis.getLayoutStartPoint().x - center.x,
60859
+ y: y - axis.getLayoutStartPoint().y - center.y
60860
+ };
60861
+ let angle = vectorAngle({ x: 1, y: 0 }, vector);
60862
+ if (angle < -Math.PI / 2) {
60863
+ angle = Math.PI * 2 + angle;
60864
+ }
60865
+ const radius = distance(vector);
60866
+ const angleScale = (_a = angleAxisList[0]) === null || _a === void 0 ? void 0 : _a.getScale();
60867
+ const angleRange = angleScale === null || angleScale === void 0 ? void 0 : angleScale.range();
60868
+ if ((angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[0])) * (angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[1])) > 0 ||
60869
+ (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[0])) * (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[1])) > 0) {
60870
+ return;
60871
+ }
60872
+ const value = radiusScale.invert(radius);
60873
+ if (isNil$1(value)) {
60874
+ return;
60875
+ }
60876
+ const domain = radiusScale.domain();
60877
+ let index = domain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
60878
+ if (index < 0) {
60879
+ index = undefined;
60880
+ }
60881
+ const data = getDimensionData(value, axis, 'polar', getDimensionField);
60882
+ targetAxisInfo.push({ index, value, position: radiusScale.scale(value), axis, data });
60883
+ }
60884
+ });
60885
+ }
60886
+ if (!targetAxisInfo.length) {
60887
+ return null;
60888
+ }
60889
+ return targetAxisInfo;
60890
+ };
60891
+
60289
60892
  class VChart {
60290
60893
  static useRegisters(comps) {
60291
60894
  comps.forEach((fn) => {
@@ -60534,7 +61137,7 @@
60534
61137
  this._compiler.updateLayoutTag();
60535
61138
  this._setFontFamilyTheme(this.getTheme('fontFamily'));
60536
61139
  this._initDataSet(this._option.dataSet);
60537
- this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
61140
+ this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
60538
61141
  this._bindResizeEvent();
60539
61142
  this._bindViewEvent();
60540
61143
  this._initChartPlugin();
@@ -61187,7 +61790,7 @@
61187
61790
  resize = true;
61188
61791
  }
61189
61792
  const lasAutoSize = this._autoSize;
61190
- 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;
61793
+ 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;
61191
61794
  if (this._autoSize !== lasAutoSize) {
61192
61795
  resize = true;
61193
61796
  }
@@ -61428,6 +62031,19 @@
61428
62031
  var _a;
61429
62032
  return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
61430
62033
  }
62034
+ disableDimensionHoverEvent(value = true) {
62035
+ DimensionHoverEvent.disableDimensionEvent(value);
62036
+ }
62037
+ disableCrossHair(value = true) {
62038
+ this.getChart()
62039
+ .getComponentsByKey('crosshair')
62040
+ .forEach(crosshair => (crosshair.enable = !value));
62041
+ }
62042
+ disableTooltip(value = true) {
62043
+ this.getChart()
62044
+ .getComponentsByKey('tooltip')
62045
+ .forEach(tooltip => (tooltip.enable = !value));
62046
+ }
61431
62047
  showCrosshair(cb) {
61432
62048
  var _a;
61433
62049
  (_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
@@ -61670,39 +62286,6 @@
61670
62286
  Direction["horizontal"] = "horizontal";
61671
62287
  })(exports.Direction || (exports.Direction = {}));
61672
62288
 
61673
- function getComponentThemeFromOption(type, getTheme) {
61674
- return getTheme('component', type);
61675
- }
61676
- function getFormatFunction(formatMethod, formatter, text, datum) {
61677
- if (formatMethod) {
61678
- return { formatFunc: formatMethod, args: [text, datum] };
61679
- }
61680
- const formatterImpl = Factory.getFormatter();
61681
- if (formatter && formatterImpl) {
61682
- return { formatFunc: formatterImpl, args: [text, datum, formatter] };
61683
- }
61684
- return {};
61685
- }
61686
- const getSpecInfo = (chartSpec, specKey, compType, filter) => {
61687
- if (isNil$1(chartSpec[specKey])) {
61688
- return undefined;
61689
- }
61690
- const isArraySpec = isArray$1(chartSpec[specKey]);
61691
- const spec = isArraySpec ? chartSpec[specKey] : [chartSpec[specKey]];
61692
- const specInfos = [];
61693
- spec.forEach((s, i) => {
61694
- if (s && (!filter || filter(s))) {
61695
- specInfos.push({
61696
- spec: s,
61697
- specPath: isArraySpec ? [specKey, i] : [specKey],
61698
- specInfoPath: ['component', specKey, i],
61699
- type: compType
61700
- });
61701
- }
61702
- });
61703
- return specInfos;
61704
- };
61705
-
61706
62289
  const lookup = (data, opt) => {
61707
62290
  if (!opt.from || !opt.from()) {
61708
62291
  return data;
@@ -64049,471 +64632,115 @@
64049
64632
  }
64050
64633
  positionToData(p) {
64051
64634
  if (!p) {
64052
- return null;
64053
- }
64054
- return {
64055
- x: this.positionToDataX(p.x),
64056
- y: this.positionToDataY(p.y)
64057
- };
64058
- }
64059
- positionToDataX(xPos) {
64060
- if (!this._scaleX) {
64061
- return null;
64062
- }
64063
- return this._scaleX.invert(xPos);
64064
- }
64065
- positionToDataY(yPos) {
64066
- if (!this._scaleY) {
64067
- return null;
64068
- }
64069
- return this._scaleY.invert(yPos);
64070
- }
64071
- getRegionRectLeft() {
64072
- if (!this._xAxisHelper) {
64073
- return Number.NaN;
64074
- }
64075
- const { getScale } = this._xAxisHelper;
64076
- return getScale(0).range()[0];
64077
- }
64078
- getRegionRectRight() {
64079
- if (!this._xAxisHelper) {
64080
- return Number.NaN;
64081
- }
64082
- const { getScale } = this._xAxisHelper;
64083
- return getScale(0).range()[1];
64084
- }
64085
- afterInitMark() {
64086
- super.afterInitMark();
64087
- this.setFieldX(this._fieldX);
64088
- this.setFieldY(this._fieldY);
64089
- this._buildScaleConfig();
64090
- }
64091
- getDimensionField() {
64092
- if (this._direction === "horizontal") {
64093
- return this._specYField;
64094
- }
64095
- return this._specXField;
64096
- }
64097
- getDimensionContinuousField() {
64098
- if (this._direction === "horizontal") {
64099
- return [this.fieldY[0], this.fieldY2];
64100
- }
64101
- return [this.fieldX[0], this.fieldX2];
64102
- }
64103
- getMeasureField() {
64104
- if (this._direction === "horizontal") {
64105
- return this._specXField;
64106
- }
64107
- return this._specYField;
64108
- }
64109
- initEvent() {
64110
- super.initEvent();
64111
- if (this.sortDataByAxis) {
64112
- this.event.on(exports.ChartEvent.scaleDomainUpdate, {
64113
- filter: param => {
64114
- var _a;
64115
- return param.model.id ===
64116
- ((_a = (this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper)) === null || _a === void 0 ? void 0 : _a.getAxisId());
64117
- }
64118
- }, () => {
64119
- this._sortDataInAxisDomain();
64120
- });
64121
- }
64122
- }
64123
- _sortDataInAxisDomain() {
64124
- var _a, _b, _c;
64125
- if ((_b = (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b.length) {
64126
- sortDataInAxisHelper(this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper, this._direction === "horizontal" ? this._fieldY[0] : this._fieldX[0], this.getViewData().latestData);
64127
- (_c = this._data) === null || _c === void 0 ? void 0 : _c.updateData(true);
64128
- }
64129
- }
64130
- getInvalidCheckFields() {
64131
- const fields = [];
64132
- if (this._xAxisHelper &&
64133
- this._xAxisHelper.isContinuous &&
64134
- this._xAxisHelper.getAxisType() !== ComponentTypeEnum.geoCoordinate) {
64135
- const xFields = this._xAxisHelper.getFields ? this._xAxisHelper.getFields() : this._specXField;
64136
- xFields.forEach(f => {
64137
- fields.push(f);
64138
- });
64139
- }
64140
- if (this._yAxisHelper &&
64141
- this._yAxisHelper.isContinuous &&
64142
- this._yAxisHelper.getAxisType() !== ComponentTypeEnum.geoCoordinate) {
64143
- const yFields = this._yAxisHelper.getFields ? this._yAxisHelper.getFields() : this._specYField;
64144
- yFields.forEach(f => {
64145
- fields.push(f);
64146
- });
64147
- }
64148
- return fields;
64149
- }
64150
- reInit(spec) {
64151
- if (this._positionXEncoder) {
64152
- this._positionXEncoder = null;
64153
- }
64154
- if (this._positionYEncoder) {
64155
- this._positionYEncoder = null;
64156
- }
64157
- super.reInit(spec);
64158
- }
64159
- }
64160
-
64161
- function isXAxis(orient) {
64162
- return orient === 'bottom' || orient === 'top';
64163
- }
64164
- function isYAxis(orient) {
64165
- return orient === 'left' || orient === 'right';
64166
- }
64167
- function isZAxis(orient) {
64168
- return orient === 'z';
64169
- }
64170
- function autoAxisType(orient, isHorizontal) {
64171
- if (isHorizontal) {
64172
- return isXAxis(orient) ? 'linear' : 'band';
64173
- }
64174
- return isXAxis(orient) ? 'band' : 'linear';
64175
- }
64176
- function getOrient(spec, whiteList) {
64177
- return isValidOrient(spec.orient) || (whiteList && whiteList.includes(spec.orient)) ? spec.orient : 'left';
64178
- }
64179
- function getDirectionByOrient(orient) {
64180
- return orient === 'top' || orient === 'bottom' ? "horizontal" : "vertical";
64181
- }
64182
- function transformInverse(spec, isHorizontal) {
64183
- let inverse = spec.inverse;
64184
- if (isHorizontal && !isXAxis(spec.orient)) {
64185
- inverse = isValid$1(spec.inverse) ? !spec.inverse : true;
64186
- }
64187
- return inverse;
64188
- }
64189
- function getCartesianAxisInfo(spec, isHorizontal) {
64190
- var _a;
64191
- const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : autoAxisType(spec.orient, isHorizontal);
64192
- const componentName = `${ComponentTypeEnum.cartesianAxis}-${axisType}`;
64193
- return { axisType, componentName };
64194
- }
64195
- const getCartesianAxisTheme = (orient, type, getTheme) => {
64196
- var _a;
64197
- const axisTypeTheme = (_a = (type === 'band'
64198
- ? getComponentThemeFromOption('axisBand', getTheme)
64199
- : ['linear', 'log', 'symlog'].includes(type)
64200
- ? getComponentThemeFromOption('axisLinear', getTheme)
64201
- : {})) !== null && _a !== void 0 ? _a : {};
64202
- const axisTheme = isXAxis(orient)
64203
- ? getComponentThemeFromOption('axisX', getTheme)
64204
- : isYAxis(orient)
64205
- ? getComponentThemeFromOption('axisY', getTheme)
64206
- : getComponentThemeFromOption('axisZ', getTheme);
64207
- return mergeSpec({}, getComponentThemeFromOption('axis', getTheme), axisTypeTheme, axisTheme);
64208
- };
64209
-
64210
- class DimensionEvent {
64211
- constructor(eventDispatcher, mode) {
64212
- this._eventDispatcher = eventDispatcher;
64213
- this._mode = mode;
64214
- }
64215
- get chart() {
64216
- var _a, _b;
64217
- if (!this._chart) {
64218
- this._chart = (_b = (_a = this._eventDispatcher.globalInstance).getChart) === null || _b === void 0 ? void 0 : _b.call(_a);
64219
- }
64220
- return this._chart;
64221
- }
64222
- register(eType, handler) {
64223
- var _a, _b;
64224
- ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOption().onError) !== null && _b !== void 0 ? _b : error)('Method not implemented.');
64225
- }
64226
- unregister() {
64227
- var _a, _b;
64228
- ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getOption().onError) !== null && _b !== void 0 ? _b : error)('Method not implemented.');
64229
- }
64230
- getTargetDimensionInfo(x, y) {
64231
- var _a, _b, _c;
64232
- const dimensionInfo = (_c = (_b = (_a = this.chart.getModelOption()).getDimensionInfo) === null || _b === void 0 ? void 0 : _b.call(_a, this.chart, { x, y })) !== null && _c !== void 0 ? _c : [];
64233
- if (dimensionInfo.length === 0) {
64234
- return null;
64235
- }
64236
- return dimensionInfo;
64237
- }
64238
- dispatch(v, opt) {
64239
- var _a, _b;
64240
- const axes = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.getAllComponents().filter(c => {
64241
- if (c.specKey !== 'axes') {
64242
- return false;
64243
- }
64244
- if (opt === null || opt === void 0 ? void 0 : opt.filter) {
64245
- return opt.filter(c);
64246
- }
64247
- return true;
64248
- });
64249
- const discreteAxes = axes.filter(axis => {
64250
- const scale = axis.getScale();
64251
- return isDiscrete(scale.type);
64252
- });
64253
- const dimAxes = discreteAxes.length
64254
- ? discreteAxes
64255
- : axes.filter(axis => {
64256
- const orient = axis.getOrient();
64257
- return isXAxis(orient) || orient === 'angle';
64258
- });
64259
- const dimensionInfo = [];
64260
- const getDimensionInfoByValue = (_b = this.chart) === null || _b === void 0 ? void 0 : _b.getModelOption().getDimensionInfoByValue;
64261
- if (getDimensionInfoByValue) {
64262
- dimAxes.forEach(a => {
64263
- const info = getDimensionInfoByValue(a, v);
64264
- if (info) {
64265
- dimensionInfo.push(info);
64266
- }
64267
- });
64268
- }
64269
- this._callback.call(null, {
64270
- action: 'enter',
64271
- dimensionInfo
64272
- });
64273
- return dimensionInfo;
64274
- }
64275
- }
64276
-
64277
- class DimensionClickEvent extends DimensionEvent {
64278
- constructor() {
64279
- super(...arguments);
64280
- this.onClick = (params) => {
64281
- if (!params) {
64282
- return;
64283
- }
64284
- const x = params.event.viewX;
64285
- const y = params.event.viewY;
64286
- const targetDimensionInfo = this.getTargetDimensionInfo(x, y);
64287
- if (!targetDimensionInfo) {
64288
- return;
64289
- }
64290
- this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'click', dimensionInfo: targetDimensionInfo.slice() }));
64291
- };
64292
- }
64293
- register(eType, handler) {
64294
- this._callback = handler.callback;
64295
- this._eventDispatcher.register('pointertap', {
64296
- query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
64297
- callback: this.onClick
64298
- });
64635
+ return null;
64636
+ }
64637
+ return {
64638
+ x: this.positionToDataX(p.x),
64639
+ y: this.positionToDataY(p.y)
64640
+ };
64299
64641
  }
64300
- unregister() {
64301
- this._eventDispatcher.unregister('pointertap', {
64302
- query: null,
64303
- callback: this.onClick
64304
- });
64642
+ positionToDataX(xPos) {
64643
+ if (!this._scaleX) {
64644
+ return null;
64645
+ }
64646
+ return this._scaleX.invert(xPos);
64305
64647
  }
64306
- }
64307
-
64308
- const isInBound = (pos, min, max) => pos.x >= min.x && pos.x <= max.x && pos.y >= min.y && pos.y <= max.y;
64309
- const isInRegionBound = (chart, axis, pos) => {
64310
- const regionList = chart.getRegionsInIds(array(axis.layout.layoutBindRegionID));
64311
- return regionList === null || regionList === void 0 ? void 0 : regionList.some(region => {
64312
- const rect = region.getLayoutRect();
64313
- const startPoint = region.getLayoutStartPoint();
64314
- return isInBound(pos, { x: startPoint.x, y: startPoint.y }, { x: rect.width + startPoint.x, y: rect.height + startPoint.y });
64315
- });
64316
- };
64317
- const isSameDimensionInfo = (a, b) => {
64318
- var _a, _b;
64319
- if (a === b) {
64320
- return true;
64648
+ positionToDataY(yPos) {
64649
+ if (!this._scaleY) {
64650
+ return null;
64651
+ }
64652
+ return this._scaleY.invert(yPos);
64321
64653
  }
64322
- if (isNil$1(a) || isNil$1(b)) {
64323
- return false;
64654
+ getRegionRectLeft() {
64655
+ if (!this._xAxisHelper) {
64656
+ return Number.NaN;
64657
+ }
64658
+ const { getScale } = this._xAxisHelper;
64659
+ return getScale(0).range()[0];
64324
64660
  }
64325
- if (a.value !== b.value) {
64326
- return false;
64661
+ getRegionRectRight() {
64662
+ if (!this._xAxisHelper) {
64663
+ return Number.NaN;
64664
+ }
64665
+ const { getScale } = this._xAxisHelper;
64666
+ return getScale(0).range()[1];
64327
64667
  }
64328
- if (((_a = a.axis) === null || _a === void 0 ? void 0 : _a.id) !== ((_b = b.axis) === null || _b === void 0 ? void 0 : _b.id)) {
64329
- return false;
64668
+ afterInitMark() {
64669
+ super.afterInitMark();
64670
+ this.setFieldX(this._fieldX);
64671
+ this.setFieldY(this._fieldY);
64672
+ this._buildScaleConfig();
64330
64673
  }
64331
- return true;
64332
- };
64333
- const resolveTooltipFilterRange = (spec, scale) => {
64334
- const range = spec.tooltipFilterRange;
64335
- const rangeValue = typeof range === 'function' ? range({ scale }) : range;
64336
- const rangeArr = (isValidNumber$1(rangeValue) ? [-rangeValue, rangeValue] : rangeValue);
64337
- return rangeArr;
64338
- };
64339
- const getDimensionData = (value, axis, coordinate, getDimensionField) => {
64340
- var _a;
64341
- const scale = axis.getScale();
64342
- const isDiscreteAxis = isDiscrete(scale.type);
64343
- const data = [];
64344
- const seriesList = axis.getOption().getChart().getSeriesInIndex(axis.getSpecInfo().seriesIndexes);
64345
- for (const series of seriesList) {
64346
- if (series.coordinate === coordinate) {
64347
- const dimensionField = array(getDimensionField(series));
64348
- const viewData = (_a = series.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData;
64349
- if (dimensionField && viewData) {
64350
- if (isDiscreteAxis) {
64351
- const datums = [];
64352
- const datumIdList = [];
64353
- viewData.forEach((datum, i) => {
64354
- var _a;
64355
- if (((_a = datum[dimensionField[0]]) === null || _a === void 0 ? void 0 : _a.toString()) === (value === null || value === void 0 ? void 0 : value.toString())) {
64356
- datums.push(datum);
64357
- datumIdList.push(i);
64358
- }
64359
- });
64360
- data.push({
64361
- series,
64362
- datum: datums,
64363
- key: getDimensionDataKey(series, datumIdList)
64364
- });
64365
- }
64366
- else {
64367
- if (isValid$1(dimensionField[1])) {
64368
- const datums = [];
64369
- const datumIdList = [];
64370
- viewData.forEach((datum, i) => {
64371
- var _a;
64372
- if (((_a = datum[dimensionField[0]]) === null || _a === void 0 ? void 0 : _a.toString()) === (value === null || value === void 0 ? void 0 : value.toString()) ||
64373
- (isValid$1(datum[dimensionField[0]]) &&
64374
- isValid$1(datum[dimensionField[1]]) &&
64375
- value >= datum[dimensionField[0]] &&
64376
- value < datum[dimensionField[1]])) {
64377
- datums.push(datum);
64378
- datumIdList.push(i);
64379
- }
64380
- });
64381
- data.push({
64382
- series,
64383
- datum: datums,
64384
- key: getDimensionDataKey(series, datumIdList)
64385
- });
64386
- }
64387
- else {
64388
- const spec = axis.getSpec();
64389
- const rangeArr = resolveTooltipFilterRange(spec, scale);
64390
- let datums = [];
64391
- let datumIdList = [];
64392
- if (rangeArr) {
64393
- viewData.forEach((datum, i) => {
64394
- if (isValid$1(datum[dimensionField[0]])) {
64395
- const delta = datum[dimensionField[0]] - value;
64396
- if (delta >= rangeArr[0] && delta <= rangeArr[1]) {
64397
- datums.push(datum);
64398
- datumIdList.push(i);
64399
- }
64400
- }
64401
- });
64402
- }
64403
- else {
64404
- let minDelta = Infinity;
64405
- let deltaSign = 0;
64406
- viewData.forEach((datum, i) => {
64407
- if (isValid$1(datum[dimensionField[0]])) {
64408
- const delta = Math.abs(datum[dimensionField[0]] - value);
64409
- const sign = Math.sign(datum[dimensionField[0]] - value);
64410
- if (delta < minDelta) {
64411
- minDelta = delta;
64412
- datums = [datum];
64413
- datumIdList = [i];
64414
- deltaSign = sign;
64415
- }
64416
- else if (delta === minDelta && sign === deltaSign) {
64417
- datums.push(datum);
64418
- datumIdList.push(i);
64419
- }
64420
- }
64421
- });
64422
- }
64423
- data.push({
64424
- series,
64425
- datum: datums,
64426
- key: getDimensionDataKey(series, datumIdList)
64427
- });
64428
- }
64429
- }
64430
- }
64674
+ getDimensionField() {
64675
+ if (this._direction === "horizontal") {
64676
+ return this._specYField;
64431
64677
  }
64678
+ return this._specXField;
64432
64679
  }
64433
- return data;
64434
- };
64435
- const getDimensionDataKey = (series, datumIdList) => `${series.id}_${datumIdList.join('_')}`;
64436
- const getAxis = (chart, filter, pos) => {
64437
- const axesComponents = chart
64438
- .getAllComponents()
64439
- .filter(c => c.specKey === 'axes' && filter(c) && isInRegionBound(chart, c, pos));
64440
- if (!axesComponents.length) {
64441
- return null;
64680
+ getDimensionContinuousField() {
64681
+ if (this._direction === "horizontal") {
64682
+ return [this.fieldY[0], this.fieldY2];
64683
+ }
64684
+ return [this.fieldX[0], this.fieldX2];
64442
64685
  }
64443
- return axesComponents;
64444
- };
64445
-
64446
- class DimensionHoverEvent extends DimensionEvent {
64447
- constructor() {
64448
- super(...arguments);
64449
- this._cacheDimensionInfo = null;
64450
- this.onMouseMove = (params) => {
64451
- if (!params) {
64452
- return;
64453
- }
64454
- const x = params.event.viewX;
64455
- const y = params.event.viewY;
64456
- const targetDimensionInfo = this.getTargetDimensionInfo(x, y);
64457
- if (targetDimensionInfo === null && this._cacheDimensionInfo !== null) {
64458
- this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo.slice() }));
64459
- this._cacheDimensionInfo = targetDimensionInfo;
64460
- }
64461
- else if (targetDimensionInfo !== null &&
64462
- (this._cacheDimensionInfo === null ||
64463
- targetDimensionInfo.length !== this._cacheDimensionInfo.length ||
64464
- targetDimensionInfo.some((info, i) => !isSameDimensionInfo(info, this._cacheDimensionInfo[i])))) {
64465
- this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'enter', dimensionInfo: targetDimensionInfo.slice() }));
64466
- this._cacheDimensionInfo = targetDimensionInfo;
64467
- }
64468
- else if (targetDimensionInfo !== null) {
64469
- this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'move', dimensionInfo: targetDimensionInfo.slice() }));
64470
- }
64471
- };
64472
- this.onMouseOut = (params) => {
64473
- if (!params) {
64474
- return;
64475
- }
64476
- this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
64477
- this._cacheDimensionInfo = null;
64478
- };
64686
+ getMeasureField() {
64687
+ if (this._direction === "horizontal") {
64688
+ return this._specXField;
64689
+ }
64690
+ return this._specYField;
64479
64691
  }
64480
- register(eType, handler) {
64481
- this._callback = handler.callback;
64482
- this._eventDispatcher.register('pointermove', {
64483
- query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
64484
- callback: this.onMouseMove
64485
- });
64486
- this._eventDispatcher.register('pointerout', {
64487
- query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.canvas }),
64488
- callback: this.onMouseOut
64489
- });
64490
- if (isMobileLikeMode(this._mode)) {
64491
- this._eventDispatcher.register('pointerdown', {
64492
- query: Object.assign(Object.assign({}, handler.query), { source: Event_Source_Type.chart }),
64493
- callback: this.onMouseMove
64692
+ initEvent() {
64693
+ super.initEvent();
64694
+ if (this.sortDataByAxis) {
64695
+ this.event.on(exports.ChartEvent.scaleDomainUpdate, {
64696
+ filter: param => {
64697
+ var _a;
64698
+ return param.model.id ===
64699
+ ((_a = (this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper)) === null || _a === void 0 ? void 0 : _a.getAxisId());
64700
+ }
64701
+ }, () => {
64702
+ this._sortDataInAxisDomain();
64494
64703
  });
64495
64704
  }
64496
64705
  }
64497
- unregister() {
64498
- this._eventDispatcher.unregister('pointermove', {
64499
- query: null,
64500
- callback: this.onMouseMove
64501
- });
64502
- if (isMobileLikeMode(this._mode)) {
64503
- this._eventDispatcher.unregister('pointerdown', {
64504
- query: null,
64505
- callback: this.onMouseMove
64706
+ _sortDataInAxisDomain() {
64707
+ var _a, _b, _c;
64708
+ if ((_b = (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b.length) {
64709
+ sortDataInAxisHelper(this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper, this._direction === "horizontal" ? this._fieldY[0] : this._fieldX[0], this.getViewData().latestData);
64710
+ (_c = this._data) === null || _c === void 0 ? void 0 : _c.updateData(true);
64711
+ }
64712
+ }
64713
+ getInvalidCheckFields() {
64714
+ const fields = [];
64715
+ if (this._xAxisHelper &&
64716
+ this._xAxisHelper.isContinuous &&
64717
+ this._xAxisHelper.getAxisType() !== ComponentTypeEnum.geoCoordinate) {
64718
+ const xFields = this._xAxisHelper.getFields ? this._xAxisHelper.getFields() : this._specXField;
64719
+ xFields.forEach(f => {
64720
+ fields.push(f);
64721
+ });
64722
+ }
64723
+ if (this._yAxisHelper &&
64724
+ this._yAxisHelper.isContinuous &&
64725
+ this._yAxisHelper.getAxisType() !== ComponentTypeEnum.geoCoordinate) {
64726
+ const yFields = this._yAxisHelper.getFields ? this._yAxisHelper.getFields() : this._specYField;
64727
+ yFields.forEach(f => {
64728
+ fields.push(f);
64506
64729
  });
64507
64730
  }
64731
+ return fields;
64732
+ }
64733
+ reInit(spec) {
64734
+ if (this._positionXEncoder) {
64735
+ this._positionXEncoder = null;
64736
+ }
64737
+ if (this._positionYEncoder) {
64738
+ this._positionYEncoder = null;
64739
+ }
64740
+ super.reInit(spec);
64508
64741
  }
64509
64742
  }
64510
64743
 
64511
- exports.DimensionEventEnum = void 0;
64512
- (function (DimensionEventEnum) {
64513
- DimensionEventEnum["dimensionHover"] = "dimensionHover";
64514
- DimensionEventEnum["dimensionClick"] = "dimensionClick";
64515
- })(exports.DimensionEventEnum || (exports.DimensionEventEnum = {}));
64516
-
64517
64744
  const lineLikeSeriesMark = {
64518
64745
  ["point"]: { name: "point", type: "symbol" },
64519
64746
  ["line"]: { name: "line", type: "line" }
@@ -71213,116 +71440,6 @@
71213
71440
  Factory.registerInteractionTrigger(DimensionHover.type, DimensionHover);
71214
71441
  };
71215
71442
 
71216
- const registerDimensionEvents = () => {
71217
- Factory.registerComposedEvent(exports.DimensionEventEnum.dimensionHover, DimensionHoverEvent);
71218
- Factory.registerComposedEvent(exports.DimensionEventEnum.dimensionClick, DimensionClickEvent);
71219
- };
71220
-
71221
- const discreteXAxisGetDimensionField = (series) => series.fieldX[0];
71222
- const discreteYAxisGetDimensionField = (series) => series.fieldY[0];
71223
- const continuousXAxisGetDimensionField = (series) => {
71224
- var _a;
71225
- return [
71226
- series.fieldX[0],
71227
- (_a = series.fieldX2) !== null && _a !== void 0 ? _a : series.fieldX[1]
71228
- ];
71229
- };
71230
- const continuousYAxisGetDimensionField = (series) => {
71231
- var _a;
71232
- return [
71233
- series.fieldY[0],
71234
- (_a = series.fieldY2) !== null && _a !== void 0 ? _a : series.fieldY[1]
71235
- ];
71236
- };
71237
- const getDimensionFieldFunc = (isXAxis, isDiscreteAxis) => isXAxis
71238
- ? isDiscreteAxis
71239
- ? discreteXAxisGetDimensionField
71240
- : continuousXAxisGetDimensionField
71241
- : isDiscreteAxis
71242
- ? discreteYAxisGetDimensionField
71243
- : continuousYAxisGetDimensionField;
71244
- const getCartesianDimensionInfo = (chart, pos, isTooltip) => {
71245
- var _a, _b;
71246
- if (!chart) {
71247
- return null;
71248
- }
71249
- const { x, y } = pos;
71250
- const xAxisList = (_a = getAxis(chart, (cmp) => isXAxis(cmp.getOrient()), pos)) !== null && _a !== void 0 ? _a : [];
71251
- const yAxisList = (_b = getAxis(chart, (cmp) => isYAxis(cmp.getOrient()), pos)) !== null && _b !== void 0 ? _b : [];
71252
- if (!xAxisList.length && !yAxisList.length) {
71253
- return null;
71254
- }
71255
- const bandAxisSet = new Set();
71256
- const linearAxisSet = new Set();
71257
- const forceAxisSet = new Set();
71258
- [xAxisList, yAxisList].forEach(axisList => axisList.forEach(axis => {
71259
- const isDiscreteAxis = isDiscrete(axis.getScale().type);
71260
- if (isDiscreteAxis) {
71261
- bandAxisSet.add(axis);
71262
- }
71263
- else {
71264
- linearAxisSet.add(axis);
71265
- }
71266
- if (isTooltip && axis.getSpec().hasDimensionTooltip) {
71267
- forceAxisSet.add(axis);
71268
- }
71269
- }));
71270
- const targetAxisInfo = [];
71271
- const addAxisDimensionInfo = (orient) => {
71272
- const isXAxis = orient === 'x';
71273
- const posValue = isXAxis ? x : y;
71274
- const axisList = isXAxis ? xAxisList : yAxisList;
71275
- axisList.forEach(axis => {
71276
- if (forceAxisSet.size > 0) {
71277
- if (forceAxisSet.has(axis)) {
71278
- const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, isDiscrete(axis.getScale().type)));
71279
- info && targetAxisInfo.push(info);
71280
- }
71281
- }
71282
- else {
71283
- const hasDiscreteAxis = bandAxisSet.size > 0;
71284
- if ((hasDiscreteAxis ? bandAxisSet : linearAxisSet).has(axis)) {
71285
- const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, hasDiscreteAxis));
71286
- info && targetAxisInfo.push(info);
71287
- }
71288
- }
71289
- });
71290
- };
71291
- if (chart.getSpec().direction === "horizontal") {
71292
- addAxisDimensionInfo('y');
71293
- if (targetAxisInfo.length === 0) {
71294
- addAxisDimensionInfo('x');
71295
- }
71296
- }
71297
- else {
71298
- addAxisDimensionInfo('x');
71299
- if (targetAxisInfo.length === 0) {
71300
- addAxisDimensionInfo('y');
71301
- }
71302
- }
71303
- if (!targetAxisInfo.length) {
71304
- return null;
71305
- }
71306
- return targetAxisInfo;
71307
- };
71308
- const getDimensionInfoByPosition = (axis, posValue, getDimensionField) => {
71309
- const value = axis.positionToData(posValue, true);
71310
- return isNil$1(value) ? null : getDimensionInfoByValue(axis, value, getDimensionField);
71311
- };
71312
- const getDimensionInfoByValue = (axis, value, getDimensionField) => {
71313
- const scale = axis.getScale();
71314
- if (isNil$1(value)) {
71315
- return null;
71316
- }
71317
- const domain = scale.domain();
71318
- let index = domain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
71319
- if (index < 0) {
71320
- index = undefined;
71321
- }
71322
- const data = getDimensionData(value, axis, 'cartesian', getDimensionField !== null && getDimensionField !== void 0 ? getDimensionField : (isXAxis(axis.getOrient()) ? discreteXAxisGetDimensionField : discreteYAxisGetDimensionField));
71323
- return { index, value, position: scale.scale(value), axis, data };
71324
- };
71325
-
71326
71443
  const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain = false) => {
71327
71444
  if (!layoutStartPoint) {
71328
71445
  layoutStartPoint = { x: 0, y: 0 };
@@ -71768,6 +71885,9 @@
71768
71885
  }
71769
71886
  shouldHandleTooltip(params, info) {
71770
71887
  var _a, _b;
71888
+ if (!this.component.enable) {
71889
+ return false;
71890
+ }
71771
71891
  if (isNil$1(info)) {
71772
71892
  return false;
71773
71893
  }
@@ -93078,106 +93198,6 @@
93078
93198
  }
93079
93199
  }
93080
93200
 
93081
- const angleStandardize = (angle, range) => {
93082
- const unit = Math.PI * 2;
93083
- const min = minInArray(range);
93084
- const max = maxInArray(range);
93085
- if (angle < min) {
93086
- angle += Math.ceil((min - angle) / unit) * unit;
93087
- }
93088
- else if (angle > max) {
93089
- angle -= Math.ceil((angle - max) / unit) * unit;
93090
- }
93091
- return angle;
93092
- };
93093
- const getPolarDimensionInfo = (chart, pos) => {
93094
- if (!chart) {
93095
- return null;
93096
- }
93097
- const angleAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'angle', pos);
93098
- const radiusAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'radius', pos);
93099
- if ((!angleAxisList || !angleAxisList.length) && (!radiusAxisList || !radiusAxisList.length)) {
93100
- return null;
93101
- }
93102
- const targetAxisInfo = [];
93103
- const getDimensionField = (series) => series.getDimensionField()[0];
93104
- const { x, y } = pos;
93105
- if (angleAxisList) {
93106
- angleAxisList.forEach(axis => {
93107
- var _a;
93108
- const angleScale = axis.getScale();
93109
- if (angleScale && isDiscrete(angleScale.type)) {
93110
- const angleDomain = angleScale.domain();
93111
- const angleRange = angleScale.range();
93112
- const center = axis.getCenter();
93113
- const vector = {
93114
- x: x - axis.getLayoutStartPoint().x - center.x,
93115
- y: y - axis.getLayoutStartPoint().y - center.y
93116
- };
93117
- let angle = vectorAngle({ x: 1, y: 0 }, vector);
93118
- angle = angleStandardize(angle, angleRange);
93119
- const radius = distance(vector);
93120
- const radiusScale = (_a = radiusAxisList[0]) === null || _a === void 0 ? void 0 : _a.getScale();
93121
- const radiusRange = radiusScale === null || radiusScale === void 0 ? void 0 : radiusScale.range();
93122
- if ((angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[0])) * (angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[1])) > 0 ||
93123
- (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[0])) * (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[1])) > 0) {
93124
- return;
93125
- }
93126
- const value = axis.invert(angle);
93127
- if (isNil$1(value)) {
93128
- return;
93129
- }
93130
- let index = angleDomain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
93131
- if (index < 0) {
93132
- index = undefined;
93133
- }
93134
- const data = getDimensionData(value, axis, 'polar', getDimensionField);
93135
- targetAxisInfo.push({ index, value, position: angleScale.scale(value), axis, data });
93136
- }
93137
- });
93138
- }
93139
- if (radiusAxisList) {
93140
- radiusAxisList.forEach(axis => {
93141
- var _a;
93142
- const radiusScale = axis.getScale();
93143
- const radiusRange = radiusScale === null || radiusScale === void 0 ? void 0 : radiusScale.range();
93144
- if (radiusScale && isDiscrete(radiusScale.type)) {
93145
- const center = axis.getCenter();
93146
- const vector = {
93147
- x: x - axis.getLayoutStartPoint().x - center.x,
93148
- y: y - axis.getLayoutStartPoint().y - center.y
93149
- };
93150
- let angle = vectorAngle({ x: 1, y: 0 }, vector);
93151
- if (angle < -Math.PI / 2) {
93152
- angle = Math.PI * 2 + angle;
93153
- }
93154
- const radius = distance(vector);
93155
- const angleScale = (_a = angleAxisList[0]) === null || _a === void 0 ? void 0 : _a.getScale();
93156
- const angleRange = angleScale === null || angleScale === void 0 ? void 0 : angleScale.range();
93157
- if ((angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[0])) * (angle - (angleRange === null || angleRange === void 0 ? void 0 : angleRange[1])) > 0 ||
93158
- (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[0])) * (radius - (radiusRange === null || radiusRange === void 0 ? void 0 : radiusRange[1])) > 0) {
93159
- return;
93160
- }
93161
- const value = radiusScale.invert(radius);
93162
- if (isNil$1(value)) {
93163
- return;
93164
- }
93165
- const domain = radiusScale.domain();
93166
- let index = domain.findIndex((v) => (v === null || v === void 0 ? void 0 : v.toString()) === value.toString());
93167
- if (index < 0) {
93168
- index = undefined;
93169
- }
93170
- const data = getDimensionData(value, axis, 'polar', getDimensionField);
93171
- targetAxisInfo.push({ index, value, position: radiusScale.scale(value), axis, data });
93172
- }
93173
- });
93174
- }
93175
- if (!targetAxisInfo.length) {
93176
- return null;
93177
- }
93178
- return targetAxisInfo;
93179
- };
93180
-
93181
93201
  class RoseChart extends BaseChart {
93182
93202
  constructor() {
93183
93203
  super(...arguments);
@@ -96065,6 +96085,7 @@
96065
96085
  this.specKey = 'tooltip';
96066
96086
  this.layoutType = 'none';
96067
96087
  this._isReleased = false;
96088
+ this.enable = true;
96068
96089
  this._alwaysShow = false;
96069
96090
  this._eventList = [];
96070
96091
  this._isTooltipShown = false;
@@ -103236,10 +103257,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103236
103257
  this._emitEvent(exports.ChartEvent.brushActive, region, e);
103237
103258
  });
103238
103259
  brush.addEventListener(IOperateType.drawStart, (e) => {
103260
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103261
+ this._option.globalInstance.disableDimensionHoverEvent(true);
103262
+ }
103239
103263
  this._setRegionMarkPickable(region, true);
103240
103264
  this._emitEvent(exports.ChartEvent.brushStart, region, e);
103241
103265
  });
103242
103266
  brush.addEventListener(IOperateType.moveStart, (e) => {
103267
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103268
+ this._option.globalInstance.disableDimensionHoverEvent(true);
103269
+ }
103243
103270
  this._setRegionMarkPickable(region, true);
103244
103271
  this._emitEvent(exports.ChartEvent.brushStart, region, e);
103245
103272
  });
@@ -103254,12 +103281,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103254
103281
  this._emitEvent(exports.ChartEvent.brushChange, region, e);
103255
103282
  });
103256
103283
  brush.addEventListener(IOperateType.brushClear, (e) => {
103284
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103285
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103286
+ }
103257
103287
  this._setRegionMarkPickable(region, true);
103258
103288
  this._initMarkBrushState(componentIndex, '');
103259
103289
  this._emitEvent(exports.ChartEvent.brushClear, region, e);
103260
103290
  });
103261
103291
  brush.addEventListener(IOperateType.drawEnd, (e) => {
103262
103292
  var _a;
103293
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103294
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103295
+ }
103263
103296
  this._setRegionMarkPickable(region, true);
103264
103297
  const { operateMask } = e.detail;
103265
103298
  const { updateElementsState = true } = this._spec;
@@ -103283,6 +103316,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103283
103316
  }
103284
103317
  });
103285
103318
  brush.addEventListener(IOperateType.moveEnd, (e) => {
103319
+ if (this._spec.disableDimensionHoverWhenBrushing) {
103320
+ this._option.globalInstance.disableDimensionHoverEvent(false);
103321
+ }
103286
103322
  this._setRegionMarkPickable(region, true);
103287
103323
  const { operateMask } = e.detail;
103288
103324
  const { updateElementsState = true } = this._spec;
@@ -103628,6 +103664,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
103628
103664
  this._brushComponents = null;
103629
103665
  }
103630
103666
  }
103667
+ clearBrushStateAndMask() {
103668
+ this._relativeRegions.forEach((region, componentIndex) => {
103669
+ this._initMarkBrushState(componentIndex, '');
103670
+ this._brushComponents[componentIndex].children[0].removeAllChild();
103671
+ });
103672
+ }
103631
103673
  }
103632
103674
  Brush.type = ComponentTypeEnum.brush;
103633
103675
  Brush.builtInTheme = {