@visactor/vchart 1.1.0-beta.5 → 1.1.0-beta.6

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 (60) hide show
  1. package/README.md +8 -8
  2. package/build/index.js +69 -9
  3. package/build/index.min.js +2 -2
  4. package/cjs/component/brush/brush.d.ts +8 -0
  5. package/cjs/component/brush/brush.js +19 -3
  6. package/cjs/component/brush/brush.js.map +1 -1
  7. package/cjs/component/brush/interface.d.ts +8 -0
  8. package/cjs/component/brush/interface.js +7 -1
  9. package/cjs/component/brush/interface.js.map +1 -1
  10. package/cjs/component/tooltip/handler/base.js +1 -3
  11. package/cjs/component/tooltip/handler/base.js.map +1 -1
  12. package/cjs/component/tooltip/handler/dom/interface.d.ts +0 -2
  13. package/cjs/component/tooltip/handler/dom/interface.js.map +1 -1
  14. package/cjs/component/tooltip/handler/dom/util.js +1 -3
  15. package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
  16. package/cjs/component/tooltip/handler/interface/style.d.ts +0 -2
  17. package/cjs/component/tooltip/handler/interface/style.js.map +1 -1
  18. package/cjs/component/tooltip/interface/spec.d.ts +1 -3
  19. package/cjs/component/tooltip/interface/spec.js.map +1 -1
  20. package/cjs/component/tooltip/interface/theme.d.ts +0 -2
  21. package/cjs/component/tooltip/interface/theme.js.map +1 -1
  22. package/cjs/constant/event.d.ts +2 -0
  23. package/cjs/constant/event.js +4 -3
  24. package/cjs/constant/event.js.map +1 -1
  25. package/cjs/constant/scatter.js +2 -1
  26. package/cjs/core/factory.js +1 -2
  27. package/cjs/core/index.d.ts +1 -1
  28. package/cjs/core/index.js +1 -1
  29. package/cjs/core/index.js.map +1 -1
  30. package/cjs/series/range-column/rangeColumn.js +5 -5
  31. package/cjs/series/range-column/rangeColumn.js.map +1 -1
  32. package/esm/component/brush/brush.d.ts +8 -0
  33. package/esm/component/brush/brush.js +19 -3
  34. package/esm/component/brush/brush.js.map +1 -1
  35. package/esm/component/brush/interface.d.ts +8 -0
  36. package/esm/component/brush/interface.js +7 -1
  37. package/esm/component/brush/interface.js.map +1 -1
  38. package/esm/component/tooltip/handler/base.js +1 -3
  39. package/esm/component/tooltip/handler/base.js.map +1 -1
  40. package/esm/component/tooltip/handler/dom/interface.d.ts +0 -2
  41. package/esm/component/tooltip/handler/dom/interface.js.map +1 -1
  42. package/esm/component/tooltip/handler/dom/util.js +1 -3
  43. package/esm/component/tooltip/handler/dom/util.js.map +1 -1
  44. package/esm/component/tooltip/handler/interface/style.d.ts +0 -2
  45. package/esm/component/tooltip/handler/interface/style.js.map +1 -1
  46. package/esm/component/tooltip/interface/spec.d.ts +1 -3
  47. package/esm/component/tooltip/interface/spec.js.map +1 -1
  48. package/esm/component/tooltip/interface/theme.d.ts +0 -2
  49. package/esm/component/tooltip/interface/theme.js.map +1 -1
  50. package/esm/constant/event.d.ts +2 -0
  51. package/esm/constant/event.js +4 -3
  52. package/esm/constant/event.js.map +1 -1
  53. package/esm/constant/scatter.js +2 -1
  54. package/esm/core/factory.js +1 -2
  55. package/esm/core/index.d.ts +1 -1
  56. package/esm/core/index.js +1 -1
  57. package/esm/core/index.js.map +1 -1
  58. package/esm/series/range-column/rangeColumn.js +5 -5
  59. package/esm/series/range-column/rangeColumn.js.map +1 -1
  60. package/package.json +1 -1
package/README.md CHANGED
@@ -77,12 +77,12 @@ $ rush run -p @visactor/vchart -s test
77
77
 
78
78
  ## 🔗 Related Links
79
79
 
80
- - [Homepage](https://visactor.io/vchart)
81
- - [VCharts Gallery](todo)
82
- - [VChart Tutorials](todo)
83
- - [VChart Options](todo)
84
- - [VChart API](todo)
85
- - [VGrammar](https://visactor.io/vgrammar)
86
- - [VRender](https://visactor.io/vrender)
87
- - [FAQ](todo)
80
+ - [Homepage](https://www.visactor.io/vchart)
81
+ - [VCharts Gallery](https://www.visactor.io/vchart/example)
82
+ - [VChart Tutorials](https://www.visactor.io/vchart/guide/tutorial_docs/VChart_Website_Guide)
83
+ - [VChart Options](https://www.visactor.io/vchart/option/)
84
+ - [VChart API](https://www.visactor.io/vchart/api/API/vchart)
85
+ - [VGrammar](https://www.visactor.io/vgrammar)
86
+ - [VRender](https://www.visactor.io/vrender)
87
+ - [FAQ](https://www.visactor.io/vchart/guide/tutorial_docs/FAQ)
88
88
  - [CodeSandbox Template](https://codesandbox.io/s/the-template-of-visactor-vchart-vl84ww?file=/src/index.ts) for bug reports
package/build/index.js CHANGED
@@ -6845,12 +6845,33 @@
6845
6845
  l.target.addListener(event, callAd);
6846
6846
  }), this._callMap.set(call, callAd);
6847
6847
  }
6848
+ allDataViewAddListener(event, call) {
6849
+ this.multipleDataViewAddListener(Object.values(this.dataViewMap), event, call);
6850
+ }
6848
6851
  multipleDataViewRemoveListener(list, event, call) {
6849
6852
  const callAd = this._callMap.get(call);
6850
6853
  callAd && list.forEach(l => {
6851
6854
  l.target.removeListener(event, callAd);
6852
6855
  }), this._callMap.delete(call);
6853
6856
  }
6857
+ multipleDataViewUpdateInParse(newData) {
6858
+ newData.forEach(d => {
6859
+ var _a;
6860
+ return null === (_a = this.getDataView(d.name)) || void 0 === _a ? void 0 : _a.markRunning();
6861
+ }), newData.forEach(d => {
6862
+ var _a;
6863
+ return null === (_a = this.getDataView(d.name)) || void 0 === _a ? void 0 : _a.parseNewData(d.data, d.options);
6864
+ });
6865
+ }
6866
+ multipleDataViewUpdateInRawData(newData) {
6867
+ newData.forEach(d => {
6868
+ var _a;
6869
+ return null === (_a = this.getDataView(d.name)) || void 0 === _a ? void 0 : _a.markRunning();
6870
+ }), newData.forEach(d => {
6871
+ var _a;
6872
+ return null === (_a = this.getDataView(d.name)) || void 0 === _a ? void 0 : _a.updateRawData(d.data, d.options);
6873
+ });
6874
+ }
6854
6875
  destroy() {
6855
6876
  this.transformMap = null, this.parserMap = null, this.dataViewMap = null, this._callMap = null, this.target.removeAllListeners();
6856
6877
  }
@@ -47918,7 +47939,9 @@
47918
47939
  ChartEvent["playerForward"] = "playerForward";
47919
47940
  ChartEvent["playerBackward"] = "playerBackward";
47920
47941
  ChartEvent["scrollBarChange"] = "scrollBarChange";
47942
+ ChartEvent["brushStart"] = "brushStart";
47921
47943
  ChartEvent["brushChange"] = "brushChange";
47944
+ ChartEvent["brushEnd"] = "brushEnd";
47922
47945
  ChartEvent["legendSelectedDataChange"] = "legendSelectedDataChange";
47923
47946
  ChartEvent["legendFilter"] = "legendFilter";
47924
47947
  ChartEvent["legendItemClick"] = "legendItemClick";
@@ -54131,7 +54154,7 @@
54131
54154
  VChart.useMark([ComponentMark, GroupMark]);
54132
54155
  Factory.registerRegion('region', Region);
54133
54156
  Factory.registerLayout('base', Layout);
54134
- const version = "1.1.0-beta.5";
54157
+ const version = "1.1.0-beta.6";
54135
54158
 
54136
54159
  var SeriesMarkNameEnum;
54137
54160
  (function (SeriesMarkNameEnum) {
@@ -60390,7 +60413,7 @@
60390
60413
  label: labelPosition === PositionEnum.bothEnd ? undefined : merge$1({}, this._spec.label),
60391
60414
  isSeriesMark: true
60392
60415
  });
60393
- if (labelPosition === PositionEnum.bothEnd) {
60416
+ if (this._spec.label?.visible !== false && labelPosition === PositionEnum.bothEnd) {
60394
60417
  if (this._spec.label?.minLabel?.visible !== false) {
60395
60418
  this._minLabelMark = this._createMark(RangeColumnSeries.mark.minLabel, {
60396
60419
  markSpec: this._spec.label?.minLabel
@@ -76697,6 +76720,22 @@
76697
76720
  this._bindLinkedSeries();
76698
76721
  this._initNeedOperatedItem();
76699
76722
  }
76723
+ _extendDataInBrush(elementsMap) {
76724
+ const data = [];
76725
+ for (const brushName in elementsMap) {
76726
+ for (const elementKey in elementsMap[brushName]) {
76727
+ data.push(elementsMap[brushName][elementKey].data[0]);
76728
+ }
76729
+ }
76730
+ return data;
76731
+ }
76732
+ _extendDatumOutOfBrush(elementsMap) {
76733
+ const data = [];
76734
+ for (const elementKey in elementsMap) {
76735
+ data.push(elementsMap[elementKey].data[0]);
76736
+ }
76737
+ return data;
76738
+ }
76700
76739
  _createBrushComponent(region, componentIndex) {
76701
76740
  const seriesRegionStartX = region.getLayoutStartPoint().x;
76702
76741
  const seriesRegionEndX = seriesRegionStartX + region.getLayoutRect().width;
@@ -76725,11 +76764,25 @@
76725
76764
  }
76726
76765
  this._reconfigItem(operateMask, region);
76727
76766
  this._reconfigLinkedItem(operateMask, region);
76728
- this.event.emit(ChartEvent.brushChange, {
76767
+ let eventType = ChartEvent.brushChange;
76768
+ if (operateType === 'brushStart' || operateType === 'brushDown') {
76769
+ eventType = ChartEvent.brushStart;
76770
+ }
76771
+ else if (operateType === 'brushEnd' || operateType === 'brushMaskUp') {
76772
+ eventType = ChartEvent.brushEnd;
76773
+ }
76774
+ else {
76775
+ eventType = ChartEvent.brushChange;
76776
+ }
76777
+ this.event.emit(eventType, {
76729
76778
  model: this,
76730
76779
  value: {
76731
76780
  operateType,
76732
76781
  operateRegion: region,
76782
+ inBrushData: this._extendDataInBrush(this._inBrushElementsMap),
76783
+ outOfBrushData: this._extendDatumOutOfBrush(this._outOfBrushElementsMap),
76784
+ linkInBrushData: this._extendDataInBrush(this._linkedInBrushElementsMap),
76785
+ linkOutOfBrushData: this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),
76733
76786
  inBrushElementsMap: this._inBrushElementsMap,
76734
76787
  outOfBrushElementsMap: this._outOfBrushElementsMap,
76735
76788
  linkedInBrushElementsMap: this._linkedInBrushElementsMap,
@@ -76780,6 +76833,7 @@
76780
76833
  graphicItem.removeState('inBrush');
76781
76834
  graphicItem.addState('outOfBrush');
76782
76835
  this._outOfBrushElementsMap[el.key] = el;
76836
+ delete this._inBrushElementsMap[operateMask.name][el.key];
76783
76837
  }
76784
76838
  });
76785
76839
  });
@@ -76951,6 +77005,16 @@
76951
77005
  }
76952
77006
  }
76953
77007
 
77008
+ var IOperateType;
77009
+ (function (IOperateType) {
77010
+ IOperateType["brushStart"] = "brushStart";
77011
+ IOperateType["brushEnd"] = "brushEnd";
77012
+ IOperateType["brushMaskUp"] = "brushMaskUp";
77013
+ IOperateType["brushing"] = "brushing";
77014
+ IOperateType["brushMaskDown"] = "brushMaskDown";
77015
+ IOperateType["brushMaskMove"] = "brushMaskMove";
77016
+ })(IOperateType || (IOperateType = {}));
77017
+
76954
77018
  function overlap$1(a, b, sep = 0) {
76955
77019
  return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
76956
77020
  }
@@ -84615,7 +84679,7 @@
84615
84679
  }
84616
84680
  _getStyle() {
84617
84681
  const tooltipSpec = this._component.getSpec();
84618
- const { style = {}, maxWidth, minWidth, enterable, transitionDuration } = tooltipSpec;
84682
+ const { style = {}, enterable, transitionDuration } = tooltipSpec;
84619
84683
  const { panel: { backgroundColor, border, shadow, padding }, titleLabel, shape, keyLabel, valueLabel, spaceRow } = style;
84620
84684
  const panelStyle = {
84621
84685
  lineWidth: border?.width ?? 0,
@@ -84650,8 +84714,6 @@
84650
84714
  key: getTextAttributes(keyLabel, globalTheme),
84651
84715
  value: getTextAttributes(valueLabel, globalTheme),
84652
84716
  padding,
84653
- minWidth,
84654
- maxWidth,
84655
84717
  spaceRow,
84656
84718
  enterable,
84657
84719
  transitionDuration
@@ -84687,7 +84749,7 @@
84687
84749
  return defaultStr ?? 'initial';
84688
84750
  };
84689
84751
  function getDomStyles(style, attributeCache) {
84690
- const { panel: { fill: fillColor, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, shadowSpread, cornerRadius, stroke: strokeColor, lineWidth = 0 }, padding, key, value, title, shape, maxWidth, minWidth, enterable, spaceRow, transitionDuration } = style;
84752
+ const { panel: { fill: fillColor, shadow, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, shadowSpread, cornerRadius, stroke: strokeColor, lineWidth = 0 }, padding, key, value, title, shape, enterable, spaceRow, transitionDuration } = style;
84691
84753
  const backgroundColor = fillColor;
84692
84754
  const styles = {
84693
84755
  panel: {
@@ -84704,8 +84766,6 @@
84704
84766
  boxShadow: shadow
84705
84767
  ? `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}`
84706
84768
  : 'initial',
84707
- maxWidth: getPixelPropertyStr(maxWidth),
84708
- minWidth: getPixelPropertyStr(minWidth),
84709
84769
  pointerEvents: enterable ? 'auto' : 'none',
84710
84770
  transitionDuration: transitionDuration ? `${transitionDuration}ms` : 'initial',
84711
84771
  transitionProperty: transitionDuration ? 'transform' : 'initial',