@visactor/vtable 1.0.4-alpha.0 → 1.0.4-alpha.1

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/vtable.js CHANGED
@@ -3181,10 +3181,10 @@
3181
3181
  !function (AnimateStepType) {
3182
3182
  AnimateStepType.wait = "wait", AnimateStepType.from = "from", AnimateStepType.to = "to", AnimateStepType.customAnimate = "customAnimate";
3183
3183
  }(AnimateStepType || (AnimateStepType = {}));
3184
- var Direction$1;
3184
+ var Direction;
3185
3185
  !function (Direction) {
3186
3186
  Direction[Direction.ROW = 1] = "ROW", Direction[Direction.COLUMN = 2] = "COLUMN";
3187
- }(Direction$1 || (Direction$1 = {}));
3187
+ }(Direction || (Direction = {}));
3188
3188
  var CurveTypeEnum;
3189
3189
  !function (CurveTypeEnum) {
3190
3190
  CurveTypeEnum[CurveTypeEnum.CubicBezierCurve = 0] = "CubicBezierCurve", CurveTypeEnum[CurveTypeEnum.QuadraticBezierCurve = 1] = "QuadraticBezierCurve", CurveTypeEnum[CurveTypeEnum.ArcCurve = 2] = "ArcCurve", CurveTypeEnum[CurveTypeEnum.LineCurve = 3] = "LineCurve", CurveTypeEnum[CurveTypeEnum.EllipseCurve = 4] = "EllipseCurve", CurveTypeEnum[CurveTypeEnum.MoveCurve = 5] = "MoveCurve";
@@ -3354,7 +3354,7 @@
3354
3354
  return this._validPoint() ? cubicLength(this.p0, this.p1, this.p2, this.p3) : 60;
3355
3355
  }
3356
3356
  calcProjLength(direction) {
3357
- return direction === Direction$1.ROW ? abs(this.p0.x - this.p3.x) : direction === Direction$1.COLUMN ? abs(this.p0.y - this.p3.y) : 0;
3357
+ return direction === Direction.ROW ? abs(this.p0.x - this.p3.x) : direction === Direction.COLUMN ? abs(this.p0.y - this.p3.y) : 0;
3358
3358
  }
3359
3359
  getAngleAt(t) {
3360
3360
  const minT = max(t - .01, 0),
@@ -3391,7 +3391,7 @@
3391
3391
  return this._validPoint() ? PointService.distancePP(this.p0, this.p1) : 60;
3392
3392
  }
3393
3393
  calcProjLength(direction) {
3394
- return direction === Direction$1.ROW ? abs(this.p0.x - this.p1.x) : direction === Direction$1.COLUMN ? abs(this.p0.y - this.p1.y) : 0;
3394
+ return direction === Direction.ROW ? abs(this.p0.x - this.p1.x) : direction === Direction.COLUMN ? abs(this.p0.y - this.p1.y) : 0;
3395
3395
  }
3396
3396
  }
3397
3397
 
@@ -3448,14 +3448,14 @@
3448
3448
  }
3449
3449
  getLength(direction) {
3450
3450
  var _a, _b;
3451
- if (direction === Direction$1.COLUMN) {
3451
+ if (direction === Direction.COLUMN) {
3452
3452
  if (!this.curves.length) return 0;
3453
3453
  const sc = this.curves[0],
3454
3454
  ec = this.curves[this.curves.length - 1],
3455
3455
  endP = null !== (_a = ec.p3) && void 0 !== _a ? _a : ec.p1;
3456
3456
  return abs(sc.p0.y - endP.y);
3457
3457
  }
3458
- if (direction === Direction$1.ROW) {
3458
+ if (direction === Direction.ROW) {
3459
3459
  if (!this.curves.length) return 0;
3460
3460
  const sc = this.curves[0],
3461
3461
  ec = this.curves[this.curves.length - 1],
@@ -3485,7 +3485,7 @@
3485
3485
  for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
3486
3486
  }
3487
3487
  function genSegContext(curveType, direction, points) {
3488
- const curveDirection = null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction$1.ROW : Direction$1.COLUMN;
3488
+ const curveDirection = null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction.ROW : Direction.COLUMN;
3489
3489
  return "monotoneY" === curveType ? new ReflectSegContext(curveType, curveDirection) : new SegContext(curveType, curveDirection);
3490
3490
  }
3491
3491
 
@@ -3747,7 +3747,7 @@
3747
3747
  startPoint: startPoint
3748
3748
  } = params;
3749
3749
  if (points.length < 2 - Number(!!startPoint)) return null;
3750
- const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction$1.ROW : Direction$1.COLUMN);
3750
+ const segContext = new SegContext("step", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? Direction.ROW : Direction.COLUMN);
3751
3751
  return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
3752
3752
  }
3753
3753
  function genStepTypeSegments(path, points) {
@@ -3868,7 +3868,7 @@
3868
3868
  } = line.attribute;
3869
3869
  if (!points) return;
3870
3870
  const cache = calcLineCache$1(points, curveType);
3871
- "x" === clipRangeByDimension ? this.direction = Direction$1.ROW : "y" === clipRangeByDimension ? this.direction = Direction$1.COLUMN : "auto" === clipRangeByDimension && (this.direction = cache.direction), this.curves = cache.curves;
3871
+ "x" === clipRangeByDimension ? this.direction = Direction.ROW : "y" === clipRangeByDimension ? this.direction = Direction.COLUMN : "auto" === clipRangeByDimension && (this.direction = cache.direction), this.curves = cache.curves;
3872
3872
  }
3873
3873
  fromCustomPath2D(path, x, y, sX, sY) {
3874
3874
  return this.clear(), this._runCommandList(path.commandList, x, y, sX, sY), this._updateBounds(), this;
@@ -4030,13 +4030,13 @@
4030
4030
  this.commandList = [], this._boundsContext = null, this._ctx = null;
4031
4031
  }
4032
4032
  getLength() {
4033
- if (this.direction === Direction$1.COLUMN) {
4033
+ if (this.direction === Direction.COLUMN) {
4034
4034
  if (!this.curves.length) return 0;
4035
4035
  const sc = this.curves[0],
4036
4036
  ec = this.curves[this.curves.length - 1];
4037
4037
  return abs(sc.p0.y - ec.p1.y);
4038
4038
  }
4039
- if (this.direction === Direction$1.ROW) {
4039
+ if (this.direction === Direction.ROW) {
4040
4040
  if (!this.curves.length) return 0;
4041
4041
  const sc = this.curves[0],
4042
4042
  ec = this.curves[this.curves.length - 1];
@@ -13786,7 +13786,7 @@
13786
13786
  }
13787
13787
  if (percent <= 0) return;
13788
13788
  let direction;
13789
- "x" === clipRangeByDimension ? direction = Direction$1.ROW : "y" === clipRangeByDimension ? direction = Direction$1.COLUMN : "auto" === clipRangeByDimension && (direction = segPath.direction);
13789
+ "x" === clipRangeByDimension ? direction = Direction.ROW : "y" === clipRangeByDimension ? direction = Direction.COLUMN : "auto" === clipRangeByDimension && (direction = segPath.direction);
13790
13790
  const totalDrawLength = percent * segPath.tryUpdateLength(direction);
13791
13791
  let drawedLengthUntilLast = 0,
13792
13792
  defined0 = !0,
@@ -14073,8 +14073,8 @@
14073
14073
  endP = null !== (_a = topCurves[topCurves.length - 1].p3) && void 0 !== _a ? _a : topCurves[topCurves.length - 1].p1,
14074
14074
  xTotalLength = abs(endP.x - topCurves[0].p0.x),
14075
14075
  yTotalLength = abs(endP.y - topCurves[0].p0.y);
14076
- direction = null != direction ? direction : xTotalLength > yTotalLength ? Direction$1.ROW : Direction$1.COLUMN, Number.isFinite(xTotalLength) || (direction = Direction$1.COLUMN), Number.isFinite(yTotalLength) || (direction = Direction$1.ROW);
14077
- const totalDrawLength = percent * (direction === Direction$1.ROW ? xTotalLength : yTotalLength);
14076
+ direction = null != direction ? direction : xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN, Number.isFinite(xTotalLength) || (direction = Direction.COLUMN), Number.isFinite(yTotalLength) || (direction = Direction.ROW);
14077
+ const totalDrawLength = percent * (direction === Direction.ROW ? xTotalLength : yTotalLength);
14078
14078
  let drawedLengthUntilLast = 0,
14079
14079
  lastDefined = !0;
14080
14080
  const topList = [],
@@ -14365,14 +14365,14 @@
14365
14365
  } = area.attribute;
14366
14366
  let endP,
14367
14367
  startP,
14368
- direction = Direction$1.ROW;
14368
+ direction = Direction.ROW;
14369
14369
  if (segments) {
14370
14370
  const endSeg = segments[segments.length - 1];
14371
14371
  startP = segments[0].points[0], endP = endSeg.points[endSeg.points.length - 1];
14372
14372
  } else startP = points[0], endP = points[points.length - 1];
14373
14373
  const xTotalLength = abs(endP.x - startP.x),
14374
14374
  yTotalLength = abs(endP.y - startP.y);
14375
- direction = Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? Direction$1.ROW : Direction$1.COLUMN : Direction$1.ROW, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
14375
+ direction = Number.isFinite(xTotalLength + yTotalLength) ? xTotalLength > yTotalLength ? Direction.ROW : Direction.COLUMN : Direction.ROW, drawAreaSegments(context.camera ? context : context.nativeContext, cache, clipRange, {
14376
14376
  offsetX: offsetX,
14377
14377
  offsetY: offsetY,
14378
14378
  offsetZ: offsetZ,
@@ -14394,7 +14394,7 @@
14394
14394
  const {
14395
14395
  stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
14396
14396
  } = attribute;
14397
- isArray$3(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
14397
+ isArray$3(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction.ROW ? "x" : "y", {
14398
14398
  offsetX: offsetX,
14399
14399
  offsetY: offsetY,
14400
14400
  offsetZ: offsetZ,
@@ -30756,7 +30756,7 @@
30756
30756
  };
30757
30757
  }
30758
30758
 
30759
- function isXAxis$1(orient) {
30759
+ function isXAxis(orient) {
30760
30760
  return orient === 'bottom' || orient === 'top';
30761
30761
  }
30762
30762
  function isYAxis(orient) {
@@ -32900,7 +32900,7 @@
32900
32900
  }
32901
32901
  function labelFlush(axisLabels, axis) {
32902
32902
  const { width, height } = axis.getLayoutRect();
32903
- const isX = isXAxis$1(axis.orient);
32903
+ const isX = isXAxis(axis.orient);
32904
32904
  const isInverse = axis.option.inverse === true;
32905
32905
  const first = axisLabels[0];
32906
32906
  const last$1 = last(axisLabels);
@@ -33126,7 +33126,7 @@
33126
33126
  this.table.tableNoFrameHeight;
33127
33127
  this.table.tableNoFrameWidth;
33128
33128
  const { width, height } = this.getLayoutRect();
33129
- const isX = isXAxis$1(this.orient);
33129
+ const isX = isXAxis(this.orient);
33130
33130
  const isY = isYAxis(this.orient);
33131
33131
  let end = { x: 0, y: 0 };
33132
33132
  let axisLength = 0;
@@ -33174,7 +33174,7 @@
33174
33174
  const { width, height } = this.getLayoutRect();
33175
33175
  const inverse = this.option.inverse || false;
33176
33176
  let newRange = [0, 0];
33177
- if (isXAxis$1(this.orient)) {
33177
+ if (isXAxis(this.orient)) {
33178
33178
  if (isValidNumber$1(width)) {
33179
33179
  newRange = inverse ? [width - right, left] : [left, width - right];
33180
33180
  }
@@ -40092,7 +40092,11 @@
40092
40092
  }
40093
40093
  const spec = layout.getRawChartSpec(col + 1, row);
40094
40094
  return merge({
40095
- domain: chartType === 'scatter' ? undefined : Array.from(domain),
40095
+ domain: chartType === 'scatter'
40096
+ ? undefined
40097
+ : spec?.series?.length >= 1
40098
+ ? Array.from(domain)
40099
+ : Array.from(domain).reverse(),
40096
40100
  range: chartType === 'scatter' ? domain : undefined,
40097
40101
  title: {
40098
40102
  autoRotate: true
@@ -40100,8 +40104,7 @@
40100
40104
  }, axisOption, {
40101
40105
  orient: 'left',
40102
40106
  type: chartType === 'scatter' ? axisOption?.type ?? 'linear' : 'band',
40103
- __vtableChartTheme: theme,
40104
- inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal")
40107
+ __vtableChartTheme: theme
40105
40108
  });
40106
40109
  }
40107
40110
  }
@@ -40458,21 +40461,6 @@
40458
40461
  }
40459
40462
  return false;
40460
40463
  }
40461
- var Direction;
40462
- (function (Direction) {
40463
- Direction["vertical"] = "vertical";
40464
- Direction["horizontal"] = "horizontal";
40465
- })(Direction || (Direction = {}));
40466
- function transformInverse(spec, isHorizontal) {
40467
- let inverse = spec?.inverse;
40468
- if (isHorizontal && !isXAxis(spec?.orient)) {
40469
- inverse = isValid$3(spec?.inverse) ? !spec?.inverse : true;
40470
- }
40471
- return inverse;
40472
- }
40473
- function isXAxis(orient) {
40474
- return orient === 'bottom' || orient === 'top';
40475
- }
40476
40464
 
40477
40465
  function computeAxisComponentWidth(config, table) {
40478
40466
  const attribute = merge({}, commonAxis, config);
@@ -59145,7 +59133,7 @@
59145
59133
  return TABLE_EVENT_TYPE;
59146
59134
  }
59147
59135
  options;
59148
- version = "1.0.4-alpha.0";
59136
+ version = "1.0.4-alpha.1";
59149
59137
  pagination;
59150
59138
  id = `VTable${Date.now()}`;
59151
59139
  headerStyleCache;
@@ -71490,15 +71478,17 @@
71490
71478
  const dataConfig = { isPivotChart: true };
71491
71479
  let columnDimensionTree;
71492
71480
  let rowDimensionTree;
71481
+ let columnTree;
71482
+ let rowTree;
71493
71483
  if (options.columnTree) {
71494
71484
  if (options.indicatorsAsCol !== false) {
71495
- supplementIndicatorNodesForCustomTree(options.columnTree, options.indicators);
71485
+ columnTree = supplementIndicatorNodesForCustomTree(options.columnTree, options.indicators);
71496
71486
  }
71497
71487
  columnDimensionTree = new DimensionTree(options.columnTree ?? [], layoutNodeId);
71498
71488
  }
71499
71489
  if (options.rowTree) {
71500
71490
  if (options.indicatorsAsCol === false) {
71501
- supplementIndicatorNodesForCustomTree(options.rowTree, options.indicators);
71491
+ rowTree = supplementIndicatorNodesForCustomTree(options.rowTree, options.indicators);
71502
71492
  }
71503
71493
  rowDimensionTree = new DimensionTree(options.rowTree ?? [], layoutNodeId);
71504
71494
  }
@@ -71535,7 +71525,7 @@
71535
71525
  }, []) ?? [];
71536
71526
  dataConfig.collectValuesBy = _generateCollectValuesConfig(options, columnKeys, rowKeys);
71537
71527
  dataConfig.aggregationRules = _generateAggregationRules(options);
71538
- const dataset = new Dataset(dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, undefined, options.columnTree, options.rowTree, true);
71528
+ const dataset = new Dataset(dataConfig, rowKeys, columnKeys, indicatorKeys, options.indicators, options.indicatorsAsCol ?? true, options.records, undefined, columnTree || options.columnTree, rowTree || options.rowTree, true);
71539
71529
  return { dataset, columnDimensionTree, rowDimensionTree, layoutNodeId };
71540
71530
  }
71541
71531
  function _generateCollectValuesConfig(option, columnKeys, rowKeys) {
@@ -71782,7 +71772,7 @@
71782
71772
  }
71783
71773
 
71784
71774
  registerForVrender();
71785
- const version = "1.0.4-alpha.0";
71775
+ const version = "1.0.4-alpha.1";
71786
71776
  function getIcons() {
71787
71777
  return get$2();
71788
71778
  }