tvcharts 0.5.88 → 0.5.90

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.
package/dist/echarts.js CHANGED
@@ -27573,6 +27573,12 @@ var LogScale = class extends Scale_default {
27573
27573
  val = scale3(val, this._extent);
27574
27574
  return mathPow2(this.base, val);
27575
27575
  }
27576
+ restoreLogValue(value) {
27577
+ return value < 0 ? -mathPow2(this.base, -value) : mathPow2(this.base, value);
27578
+ }
27579
+ parseLogValue(val) {
27580
+ return val < 0 ? -mathLog(-val) / mathLog(this.base) : mathLog(val) / mathLog(this.base);
27581
+ }
27576
27582
  };
27577
27583
  LogScale.type = "log";
27578
27584
  var proto = LogScale.prototype;
@@ -27621,7 +27627,6 @@ var PercentageScale = class extends Scale_default {
27621
27627
  setExtent(start2, end2) {
27622
27628
  start2 = this.parsePercentageValue(start2);
27623
27629
  end2 = this.parsePercentageValue(end2);
27624
- console.log("%c [ start ]-101", "font-size:13px; background:pink; color:#bf2c9f;", start2, end2);
27625
27630
  intervalScaleProto2.setExtent.call(this, start2, end2);
27626
27631
  }
27627
27632
  parsePercentageValue(value) {
@@ -60966,6 +60971,20 @@ function findEffectedDataZooms(ecModel, payload) {
60966
60971
  }
60967
60972
  return effectedModels;
60968
60973
  }
60974
+ function findLockRatioDataZooms(ecModel, payload) {
60975
+ const effectedModels = [];
60976
+ const effectedModelMap = createHashMap();
60977
+ ecModel.eachComponent({mainType: "dataZoom"}, function(dataZoomModel) {
60978
+ if (dataZoomModel.get("lockRatio") && dataZoomModel.get("useValueRange") && !effectedModelMap.get(dataZoomModel.uid)) {
60979
+ addToEffected(dataZoomModel);
60980
+ }
60981
+ });
60982
+ function addToEffected(dataZoom) {
60983
+ effectedModelMap.set(dataZoom.uid, true);
60984
+ effectedModels.push(dataZoom);
60985
+ }
60986
+ return effectedModels;
60987
+ }
60969
60988
  function collectReferCoordSysModelInfo(dataZoomModel) {
60970
60989
  const ecModel = dataZoomModel.ecModel;
60971
60990
  const coordSysInfoWrap = {
@@ -61475,7 +61494,6 @@ var AxisProxy = class {
61475
61494
  ];
61476
61495
  this._percentWindow = [void 0, void 0];
61477
61496
  this._setAxisModel();
61478
- console.log("%c [ this._valueWindow ]-314", "font-size:13px; background:pink; color:#bf2c9f;", this._valueWindow);
61479
61497
  return;
61480
61498
  }
61481
61499
  const dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);
@@ -61678,6 +61696,18 @@ function installDataZoomAction(registers) {
61678
61696
  const effectedModels = findEffectedDataZooms(ecModel, payload);
61679
61697
  each(effectedModels, function(dataZoomModel) {
61680
61698
  const isLocalDataZoom = payload.uid === dataZoomModel.uid;
61699
+ if (payload.scale && dataZoomModel.get("yAxisIndex") === void 0) {
61700
+ const modalList = findLockRatioDataZooms(ecModel, payload);
61701
+ each(modalList, function(modal) {
61702
+ const startValue = modal.get("startValue");
61703
+ const endValue = modal.get("endValue");
61704
+ const diff = (endValue - startValue) * payload.scale;
61705
+ modal.setRawRange({
61706
+ startValue: startValue + diff,
61707
+ endValue: endValue - diff
61708
+ });
61709
+ });
61710
+ }
61681
61711
  if (isLocalDataZoom) {
61682
61712
  return;
61683
61713
  }
@@ -68646,6 +68676,7 @@ function createCoordSysRecord(api2, coordSysModel) {
68646
68676
  uid: dzInfo.model.uid,
68647
68677
  barSpace: range[0],
68648
68678
  lastBarRightSideDiffBarCount: range[1],
68679
+ scale: 2 + event.scale * -1,
68649
68680
  event
68650
68681
  });
68651
68682
  } else if (useValueRange) {
@@ -68857,6 +68888,15 @@ function makeMover(getPercentDelta) {
68857
68888
  return;
68858
68889
  }
68859
68890
  const diff = (valueRange[1] - valueRange[0]) * percent;
68891
+ const axis = axisModel.axis;
68892
+ if (axis.type === "log") {
68893
+ const scale4 = axis.scale;
68894
+ const logExtent = [scale4.parseLogValue(valueRange[0]), scale4.parseLogValue(valueRange[1])];
68895
+ const logDiff = (logExtent[1] - logExtent[0]) * percent;
68896
+ valueRange[0] = scale4.restoreLogValue(logExtent[0] + logDiff);
68897
+ valueRange[1] = scale4.restoreLogValue(logExtent[1] + logDiff);
68898
+ return valueRange;
68899
+ }
68860
68900
  valueRange[0] = valueRange[0] + diff;
68861
68901
  valueRange[1] = valueRange[1] + diff;
68862
68902
  return valueRange;