@visactor/vchart 1.9.4-alpha.0 → 1.9.4-alpha.2

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 (47) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +67 -68
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/component/axis/cartesian/log-axis.js +1 -2
  6. package/cjs/component/axis/cartesian/log-axis.js.map +1 -1
  7. package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
  8. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  9. package/cjs/component/axis/polar/axis.js +17 -9
  10. package/cjs/component/axis/polar/axis.js.map +1 -1
  11. package/cjs/component/axis/polar/util/common.d.ts +1 -5
  12. package/cjs/component/axis/polar/util/common.js +4 -8
  13. package/cjs/component/axis/polar/util/common.js.map +1 -1
  14. package/cjs/constant/hierarchy.js +2 -1
  15. package/cjs/constant/scroll-bar.js +1 -2
  16. package/cjs/core/index.d.ts +1 -1
  17. package/cjs/core/index.js +1 -1
  18. package/cjs/core/index.js.map +1 -1
  19. package/cjs/data/transforms/dimension-statistics.d.ts +0 -2
  20. package/cjs/data/transforms/dimension-statistics.js +1 -1
  21. package/cjs/data/transforms/dimension-statistics.js.map +1 -1
  22. package/cjs/plugin/components/tooltip-handler/base.js +3 -3
  23. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  24. package/cjs/series/cartesian/cartesian.js +22 -19
  25. package/cjs/series/cartesian/cartesian.js.map +1 -1
  26. package/esm/component/axis/cartesian/log-axis.js +1 -2
  27. package/esm/component/axis/cartesian/log-axis.js.map +1 -1
  28. package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
  29. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  30. package/esm/component/axis/polar/axis.js +18 -9
  31. package/esm/component/axis/polar/axis.js.map +1 -1
  32. package/esm/component/axis/polar/util/common.d.ts +1 -5
  33. package/esm/component/axis/polar/util/common.js +4 -12
  34. package/esm/component/axis/polar/util/common.js.map +1 -1
  35. package/esm/constant/hierarchy.js +2 -1
  36. package/esm/constant/scroll-bar.js +1 -2
  37. package/esm/core/index.d.ts +1 -1
  38. package/esm/core/index.js +1 -1
  39. package/esm/core/index.js.map +1 -1
  40. package/esm/data/transforms/dimension-statistics.d.ts +0 -2
  41. package/esm/data/transforms/dimension-statistics.js +1 -1
  42. package/esm/data/transforms/dimension-statistics.js.map +1 -1
  43. package/esm/plugin/components/tooltip-handler/base.js +3 -3
  44. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  45. package/esm/series/cartesian/cartesian.js +22 -18
  46. package/esm/series/cartesian/cartesian.js.map +1 -1
  47. package/package.json +7 -7
package/build/index.js CHANGED
@@ -25241,10 +25241,10 @@
25241
25241
  for (let i = 1; i <= deltaStep; i++) domain[domainLength - 2 + i] = last - delta * (deltaStep - i);
25242
25242
  n = rangeLength;
25243
25243
  }
25244
- return this._autoClamp && (this._clamp = clamper(domain[0], domain[n - 1])), this._piecewise = n > 2 ? polymap : bimap, this._output = this._input = null, this._wholeRange = null, this.generateFishEyeTransform(), this;
25244
+ return void 0 === this._clamp && (this._clamp = clamper(domain[0], domain[n - 1])), this._piecewise = n > 2 ? polymap : bimap, this._output = this._input = null, this._wholeRange = null, this.generateFishEyeTransform(), this;
25245
25245
  }
25246
25246
  clamp(_, f, slience) {
25247
- return arguments.length ? (f ? (this._autoClamp = !1, this._clamp = f) : (this._autoClamp = !!_, this._clamp = _ ? void 0 : identity), this.rescale(slience)) : this._clamp !== identity;
25247
+ return arguments.length ? (this._clamp = f || (_ ? void 0 : identity), this.rescale(slience)) : this._clamp !== identity;
25248
25248
  }
25249
25249
  interpolate(_, slience) {
25250
25250
  return arguments.length ? (this._interpolate = _, this.rescale(slience)) : this._interpolate;
@@ -58832,7 +58832,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58832
58832
  registerChartPlugin(MediaQuery);
58833
58833
  };
58834
58834
 
58835
- const version = "1.9.4-alpha.0";
58835
+ const version = "1.9.4-alpha.2";
58836
58836
 
58837
58837
  const addVChartProperty = (data, op) => {
58838
58838
  const context = op.beforeCall();
@@ -59116,9 +59116,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59116
59116
  else {
59117
59117
  fValues = fValues.filter((entry) => entry !== undefined);
59118
59118
  }
59119
- if (f.filter) {
59120
- fValues = fValues.filter(f.filter);
59121
- }
59122
59119
  operations.forEach(op => {
59123
59120
  if (f.customize) {
59124
59121
  result[key][op] = f.customize;
@@ -60662,42 +60659,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60662
60659
  return this._sortDataByAxis;
60663
60660
  }
60664
60661
  getStatisticFields() {
60662
+ var _a, _b, _c;
60665
60663
  const fields = [];
60666
- const axes = [
60667
- {
60668
- axisHelper: this.getXAxisHelper(),
60669
- fields: this._fieldX2 ? [...this._fieldX, this._fieldX2] : this._fieldX
60670
- },
60671
- {
60672
- axisHelper: this.getYAxisHelper(),
60673
- fields: this._fieldY2 ? [...this._fieldY, this._fieldY2] : this._fieldY
60674
- },
60675
- {
60676
- axisHelper: this.getZAxisHelper(),
60677
- fields: this._fieldZ
60678
- }
60679
- ];
60680
- axes.forEach(axisOption => {
60681
- if (axisOption.axisHelper && axisOption.axisHelper.getScale && axisOption.fields) {
60682
- axisOption.fields.forEach(f => {
60683
- const result = {
60684
- key: f,
60685
- operations: []
60686
- };
60687
- const scale = axisOption.axisHelper.getScale(0);
60688
- if (isContinuous(scale.type)) {
60689
- result.operations = ['max', 'min'];
60690
- if (scale.type === 'log') {
60691
- result.filter = (fv) => fv > 0;
60692
- }
60693
- }
60694
- else {
60695
- result.operations = ['values'];
60696
- }
60697
- fields.push(result);
60698
- });
60699
- }
60700
- });
60664
+ if ((_a = this.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.getScale) {
60665
+ (this._fieldX2 ? [...this._fieldX, this._fieldX2] : this._fieldX).forEach(f => {
60666
+ const result = { key: f, operations: [] };
60667
+ if (isContinuous(this.getXAxisHelper().getScale(0).type)) {
60668
+ result.operations = ['max', 'min'];
60669
+ }
60670
+ else {
60671
+ result.operations = ['values'];
60672
+ }
60673
+ fields.push(result);
60674
+ });
60675
+ }
60676
+ if ((_b = this.getYAxisHelper()) === null || _b === void 0 ? void 0 : _b.getScale) {
60677
+ (this._fieldY2 ? [...this._fieldY, this._fieldY2] : this._fieldY).forEach(f => {
60678
+ const result = { key: f, operations: [] };
60679
+ if (isContinuous(this.getYAxisHelper().getScale(0).type)) {
60680
+ result.operations = ['max', 'min'];
60681
+ }
60682
+ else {
60683
+ result.operations = ['values'];
60684
+ }
60685
+ fields.push(result);
60686
+ });
60687
+ }
60688
+ if (this._fieldZ && ((_c = this.getZAxisHelper()) === null || _c === void 0 ? void 0 : _c.getScale)) {
60689
+ this._fieldZ.forEach(f => {
60690
+ const result = { key: f, operations: [] };
60691
+ if (isContinuous(this.getZAxisHelper().getScale(0).type)) {
60692
+ result.operations = ['max', 'min'];
60693
+ }
60694
+ else {
60695
+ result.operations = ['values'];
60696
+ }
60697
+ fields.push(result);
60698
+ });
60699
+ }
60701
60700
  if (this.getStack()) {
60702
60701
  fields.push({
60703
60702
  key: this.getStackValueField(),
@@ -82148,6 +82147,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82148
82147
  return this.valueToPosition(values[0]);
82149
82148
  }
82150
82149
  valueToPosition(value) {
82150
+ if (this._spec.type === 'log' && !isNil$1(value) && (value === 0 || value[0] === 0)) {
82151
+ return this._scale.range()[0];
82152
+ }
82151
82153
  return this._scale.scale(value);
82152
82154
  }
82153
82155
  computeLinearDomain(data) {
@@ -82703,7 +82705,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82703
82705
  var _a;
82704
82706
  super.initScales();
82705
82707
  this._scale.base((_a = this._spec.base) !== null && _a !== void 0 ? _a : 10);
82706
- this._scale.clamp(true, null, false);
82707
82708
  }
82708
82709
  transformScaleDomain() {
82709
82710
  }
@@ -82739,20 +82740,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82739
82740
  Factory.registerComponent(CartesianSymlogAxis.type, CartesianSymlogAxis);
82740
82741
  };
82741
82742
 
82742
- const getPolarAxisInfo = (spec, chartSpec) => {
82743
- var _a, _b, _c, _d, _e, _f;
82743
+ const getPolarAxisInfo = (spec) => {
82744
+ var _a;
82744
82745
  const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : (spec.orient === 'angle' ? 'band' : 'linear');
82745
82746
  const componentName = `${ComponentTypeEnum.polarAxis}-${axisType}`;
82746
- const startAngleFromSpec = (_b = spec.startAngle) !== null && _b !== void 0 ? _b : chartSpec.startAngle;
82747
- const endAngleFromSpec = (_c = spec.endAngle) !== null && _c !== void 0 ? _c : chartSpec.endAngle;
82748
- return {
82749
- axisType,
82750
- componentName,
82751
- startAngle: startAngleFromSpec !== null && startAngleFromSpec !== void 0 ? startAngleFromSpec : POLAR_START_ANGLE$1,
82752
- endAngle: endAngleFromSpec !== null && endAngleFromSpec !== void 0 ? endAngleFromSpec : (isValid$1(startAngleFromSpec) ? startAngleFromSpec + 360 : POLAR_END_ANGLE$1),
82753
- center: chartSpec.center,
82754
- outerRadius: (_f = (_e = (_d = spec.radius) !== null && _d !== void 0 ? _d : chartSpec.outerRadius) !== null && _e !== void 0 ? _e : chartSpec.radius) !== null && _f !== void 0 ? _f : POLAR_DEFAULT_RADIUS
82755
- };
82747
+ return { axisType, componentName };
82756
82748
  };
82757
82749
 
82758
82750
  class PolarAxis extends AxisComponent {
@@ -82772,6 +82764,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82772
82764
  return this._groupScales;
82773
82765
  }
82774
82766
  static getSpecInfo(chartSpec) {
82767
+ var _a, _b;
82775
82768
  const axesSpec = chartSpec[this.specKey];
82776
82769
  if (!axesSpec) {
82777
82770
  return null;
@@ -82780,11 +82773,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82780
82773
  if (!isValidPolarAxis(axesSpec)) {
82781
82774
  return null;
82782
82775
  }
82783
- const { axisType, componentName, startAngle, endAngle, center, outerRadius } = getPolarAxisInfo(axesSpec, chartSpec);
82784
- axesSpec.center = center;
82785
- axesSpec.startAngle = startAngle;
82786
- axesSpec.endAngle = endAngle;
82787
- axesSpec.outerRadius = outerRadius;
82776
+ const { axisType, componentName } = getPolarAxisInfo(axesSpec);
82777
+ axesSpec.center = chartSpec.center;
82778
+ axesSpec.startAngle = (_a = chartSpec.startAngle) !== null && _a !== void 0 ? _a : POLAR_START_ANGLE$1;
82779
+ axesSpec.endAngle =
82780
+ (_b = chartSpec.endAngle) !== null && _b !== void 0 ? _b : (isValid$1(chartSpec.startAngle) ? chartSpec.startAngle + 360 : POLAR_END_ANGLE$1);
82788
82781
  axesSpec.type = axisType;
82789
82782
  return [
82790
82783
  {
@@ -82799,14 +82792,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82799
82792
  let angleAxisIndex;
82800
82793
  const radiusAxisSpecInfos = [];
82801
82794
  axesSpec.forEach((s, i) => {
82795
+ var _a, _b, _c, _d, _e;
82802
82796
  if (!isValidPolarAxis(s)) {
82803
82797
  return;
82804
82798
  }
82805
- const { axisType, componentName, startAngle, endAngle, center, outerRadius } = getPolarAxisInfo(s, chartSpec);
82806
- s.center = center;
82807
- s.startAngle = startAngle;
82808
- s.endAngle = endAngle;
82809
- s.outerRadius = outerRadius;
82799
+ const { axisType, componentName } = getPolarAxisInfo(s);
82800
+ s.center = chartSpec.center;
82801
+ s.startAngle = (_a = chartSpec.startAngle) !== null && _a !== void 0 ? _a : POLAR_START_ANGLE$1;
82802
+ s.endAngle = (_b = chartSpec.endAngle) !== null && _b !== void 0 ? _b : (isValid$1(chartSpec.startAngle) ? chartSpec.startAngle + 360 : POLAR_END_ANGLE$1);
82803
+ s.outerRadius = (_e = (_d = (_c = s.radius) !== null && _c !== void 0 ? _c : chartSpec.outerRadius) !== null && _d !== void 0 ? _d : chartSpec.radius) !== null && _e !== void 0 ? _e : POLAR_DEFAULT_RADIUS;
82810
82804
  s.type = axisType;
82811
82805
  const info = {
82812
82806
  spec: s,
@@ -82875,6 +82869,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82875
82869
  this._coordinateType = 'polar';
82876
82870
  }
82877
82871
  setAttrFromSpec() {
82872
+ var _a, _b;
82878
82873
  super.setAttrFromSpec();
82879
82874
  if (this.visible) {
82880
82875
  this._axisStyle = this._getAxisAttributes();
@@ -82883,8 +82878,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82883
82878
  this._tick = this._spec.tick;
82884
82879
  this._orient = this._spec.orient === 'angle' ? 'angle' : 'radius';
82885
82880
  this._center = this._spec.center;
82886
- this._startAngle = degreeToRadian(this._spec.startAngle);
82887
- this._endAngle = degreeToRadian(this._spec.endAngle);
82881
+ const chartSpec = this.getChart().getSpec();
82882
+ const startAngle = (_a = this._spec.startAngle) !== null && _a !== void 0 ? _a : chartSpec.startAngle;
82883
+ const endAngle = (_b = this._spec.endAngle) !== null && _b !== void 0 ? _b : chartSpec.endAngle;
82884
+ this._startAngle = degreeToRadian(startAngle !== null && startAngle !== void 0 ? startAngle : POLAR_START_ANGLE$1);
82885
+ this._endAngle = degreeToRadian(endAngle !== null && endAngle !== void 0 ? endAngle : (isValid$1(startAngle) ? startAngle + 360 : POLAR_END_ANGLE$1));
82888
82886
  this._inverse = this._spec.inverse;
82889
82887
  }
82890
82888
  onLayoutEnd(ctx) {
@@ -92796,9 +92794,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92796
92794
  this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);
92797
92795
  }
92798
92796
  const { panel, panelDomHeight } = (_c = this._attributes) !== null && _c !== void 0 ? _c : {};
92797
+ const isCanvas = this._component.getSpec().renderMode === 'canvas';
92799
92798
  return {
92800
- width: panel === null || panel === void 0 ? void 0 : panel.width,
92801
- height: panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height
92799
+ width: (panel === null || panel === void 0 ? void 0 : panel.width) + (isCanvas ? panel.lineWidth : 0),
92800
+ height: (panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height) + (isCanvas ? panel.lineWidth : 0)
92802
92801
  };
92803
92802
  }
92804
92803
  _getPointerPositionRelativeToTooltipParent(params) {