@visactor/vchart 1.9.3 → 1.9.4-alpha.0

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 (43) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +66 -64
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/component/axis/cartesian/log-axis.js +2 -1
  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 +9 -17
  10. package/cjs/component/axis/polar/axis.js.map +1 -1
  11. package/cjs/component/axis/polar/util/common.d.ts +5 -1
  12. package/cjs/component/axis/polar/util/common.js +8 -4
  13. package/cjs/component/axis/polar/util/common.js.map +1 -1
  14. package/cjs/constant/hierarchy.js +1 -2
  15. package/cjs/constant/scroll-bar.js +2 -1
  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 +2 -0
  20. package/cjs/data/transforms/dimension-statistics.js +1 -1
  21. package/cjs/data/transforms/dimension-statistics.js.map +1 -1
  22. package/cjs/series/cartesian/cartesian.js +19 -22
  23. package/cjs/series/cartesian/cartesian.js.map +1 -1
  24. package/esm/component/axis/cartesian/log-axis.js +2 -1
  25. package/esm/component/axis/cartesian/log-axis.js.map +1 -1
  26. package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
  27. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  28. package/esm/component/axis/polar/axis.js +9 -18
  29. package/esm/component/axis/polar/axis.js.map +1 -1
  30. package/esm/component/axis/polar/util/common.d.ts +5 -1
  31. package/esm/component/axis/polar/util/common.js +12 -4
  32. package/esm/component/axis/polar/util/common.js.map +1 -1
  33. package/esm/constant/hierarchy.js +1 -2
  34. package/esm/constant/scroll-bar.js +2 -1
  35. package/esm/core/index.d.ts +1 -1
  36. package/esm/core/index.js +1 -1
  37. package/esm/core/index.js.map +1 -1
  38. package/esm/data/transforms/dimension-statistics.d.ts +2 -0
  39. package/esm/data/transforms/dimension-statistics.js +1 -1
  40. package/esm/data/transforms/dimension-statistics.js.map +1 -1
  41. package/esm/series/cartesian/cartesian.js +18 -22
  42. package/esm/series/cartesian/cartesian.js.map +1 -1
  43. 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 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;
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;
25245
25245
  }
25246
25246
  clamp(_, f, slience) {
25247
- return arguments.length ? (this._clamp = f || (_ ? void 0 : identity), this.rescale(slience)) : this._clamp !== identity;
25247
+ return arguments.length ? (f ? (this._autoClamp = !1, this._clamp = f) : (this._autoClamp = !!_, this._clamp = _ ? 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.3";
58835
+ const version = "1.9.4-alpha.0";
58836
58836
 
58837
58837
  const addVChartProperty = (data, op) => {
58838
58838
  const context = op.beforeCall();
@@ -59116,6 +59116,9 @@ 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
+ }
59119
59122
  operations.forEach(op => {
59120
59123
  if (f.customize) {
59121
59124
  result[key][op] = f.customize;
@@ -60659,44 +60662,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60659
60662
  return this._sortDataByAxis;
60660
60663
  }
60661
60664
  getStatisticFields() {
60662
- var _a, _b, _c;
60663
60665
  const fields = [];
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
- }
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
+ });
60700
60701
  if (this.getStack()) {
60701
60702
  fields.push({
60702
60703
  key: this.getStackValueField(),
@@ -82147,9 +82148,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82147
82148
  return this.valueToPosition(values[0]);
82148
82149
  }
82149
82150
  valueToPosition(value) {
82150
- if (this._spec.type === 'log' && !isNil$1(value) && (value === 0 || value[0] === 0)) {
82151
- return this._scale.range()[0];
82152
- }
82153
82151
  return this._scale.scale(value);
82154
82152
  }
82155
82153
  computeLinearDomain(data) {
@@ -82705,6 +82703,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82705
82703
  var _a;
82706
82704
  super.initScales();
82707
82705
  this._scale.base((_a = this._spec.base) !== null && _a !== void 0 ? _a : 10);
82706
+ this._scale.clamp(true, null, false);
82708
82707
  }
82709
82708
  transformScaleDomain() {
82710
82709
  }
@@ -82740,11 +82739,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82740
82739
  Factory.registerComponent(CartesianSymlogAxis.type, CartesianSymlogAxis);
82741
82740
  };
82742
82741
 
82743
- const getPolarAxisInfo = (spec) => {
82744
- var _a;
82742
+ const getPolarAxisInfo = (spec, chartSpec) => {
82743
+ var _a, _b, _c, _d, _e, _f;
82745
82744
  const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : (spec.orient === 'angle' ? 'band' : 'linear');
82746
82745
  const componentName = `${ComponentTypeEnum.polarAxis}-${axisType}`;
82747
- return { axisType, componentName };
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
+ };
82748
82756
  };
82749
82757
 
82750
82758
  class PolarAxis extends AxisComponent {
@@ -82764,7 +82772,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82764
82772
  return this._groupScales;
82765
82773
  }
82766
82774
  static getSpecInfo(chartSpec) {
82767
- var _a, _b;
82768
82775
  const axesSpec = chartSpec[this.specKey];
82769
82776
  if (!axesSpec) {
82770
82777
  return null;
@@ -82773,11 +82780,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82773
82780
  if (!isValidPolarAxis(axesSpec)) {
82774
82781
  return null;
82775
82782
  }
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);
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;
82781
82788
  axesSpec.type = axisType;
82782
82789
  return [
82783
82790
  {
@@ -82792,15 +82799,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82792
82799
  let angleAxisIndex;
82793
82800
  const radiusAxisSpecInfos = [];
82794
82801
  axesSpec.forEach((s, i) => {
82795
- var _a, _b, _c, _d, _e;
82796
82802
  if (!isValidPolarAxis(s)) {
82797
82803
  return;
82798
82804
  }
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;
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;
82804
82810
  s.type = axisType;
82805
82811
  const info = {
82806
82812
  spec: s,
@@ -82869,7 +82875,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82869
82875
  this._coordinateType = 'polar';
82870
82876
  }
82871
82877
  setAttrFromSpec() {
82872
- var _a, _b;
82873
82878
  super.setAttrFromSpec();
82874
82879
  if (this.visible) {
82875
82880
  this._axisStyle = this._getAxisAttributes();
@@ -82878,11 +82883,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
82878
82883
  this._tick = this._spec.tick;
82879
82884
  this._orient = this._spec.orient === 'angle' ? 'angle' : 'radius';
82880
82885
  this._center = this._spec.center;
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));
82886
+ this._startAngle = degreeToRadian(this._spec.startAngle);
82887
+ this._endAngle = degreeToRadian(this._spec.endAngle);
82886
82888
  this._inverse = this._spec.inverse;
82887
82889
  }
82888
82890
  onLayoutEnd(ctx) {