@antv/g-lite 1.2.15 → 1.2.16

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/index.js CHANGED
@@ -8188,17 +8188,23 @@ var PolylineUpdater = /** @class */ (function () {
8188
8188
  function PolylineUpdater() {
8189
8189
  }
8190
8190
  PolylineUpdater.prototype.update = function (parsedStyle) {
8191
- var points = parsedStyle.points.points;
8192
- // FIXME: account for miter lineJoin
8193
- var minX = Math.min.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[0]; })), false));
8194
- var maxX = Math.max.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[0]; })), false));
8195
- var minY = Math.min.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[1]; })), false));
8196
- var maxY = Math.max.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[1]; })), false));
8197
- var width = maxX - minX;
8198
- var height = maxY - minY;
8191
+ if (parsedStyle.points && util.isArray(parsedStyle.points.points)) {
8192
+ var points = parsedStyle.points.points;
8193
+ // FIXME: account for miter lineJoin
8194
+ var minX = Math.min.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[0]; })), false));
8195
+ var maxX = Math.max.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[0]; })), false));
8196
+ var minY = Math.min.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[1]; })), false));
8197
+ var maxY = Math.max.apply(Math, tslib.__spreadArray([], tslib.__read(points.map(function (point) { return point[1]; })), false));
8198
+ var width = maxX - minX;
8199
+ var height = maxY - minY;
8200
+ return {
8201
+ width: width,
8202
+ height: height,
8203
+ };
8204
+ }
8199
8205
  return {
8200
- width: width,
8201
- height: height,
8206
+ width: 0,
8207
+ height: 0,
8202
8208
  };
8203
8209
  };
8204
8210
  return PolylineUpdater;
@@ -13650,9 +13656,10 @@ var Polygon = /** @class */ (function (_super) {
13650
13656
  }
13651
13657
  };
13652
13658
  Polygon.prototype.transformMarker = function (isStart) {
13653
- var _a = this.parsedStyle, markerStart = _a.markerStart, markerEnd = _a.markerEnd, markerStartOffset = _a.markerStartOffset, markerEndOffset = _a.markerEndOffset, points = _a.points.points, defX = _a.defX, defY = _a.defY;
13659
+ var _a = this.parsedStyle, markerStart = _a.markerStart, markerEnd = _a.markerEnd, markerStartOffset = _a.markerStartOffset, markerEndOffset = _a.markerEndOffset, P = _a.points, defX = _a.defX, defY = _a.defY;
13660
+ var points = (P || {}).points;
13654
13661
  var marker = isStart ? markerStart : markerEnd;
13655
- if (!marker || !isDisplayObject(marker)) {
13662
+ if (!marker || !isDisplayObject(marker) || !points) {
13656
13663
  return;
13657
13664
  }
13658
13665
  var rad = 0;
@@ -13691,13 +13698,14 @@ var Polygon = /** @class */ (function (_super) {
13691
13698
  marker.setLocalPosition(ox + Math.cos(rad) * offset, oy + Math.sin(rad) * offset);
13692
13699
  };
13693
13700
  Polygon.prototype.placeMarkerMid = function (marker) {
13694
- var _a = this.parsedStyle, points = _a.points.points, defX = _a.defX, defY = _a.defY;
13701
+ var _a = this.parsedStyle, P = _a.points, defX = _a.defX, defY = _a.defY;
13702
+ var points = (P || {}).points;
13695
13703
  // clear all existed markers
13696
13704
  this.markerMidList.forEach(function (marker) {
13697
13705
  marker.remove();
13698
13706
  });
13699
13707
  this.markerMidList = [];
13700
- if (marker && isDisplayObject(marker)) {
13708
+ if (marker && isDisplayObject(marker) && points) {
13701
13709
  for (var i = 1; i < (this.parsedStyle.isClosed ? points.length : points.length - 1); i++) {
13702
13710
  var ox = points[i][0] - defX;
13703
13711
  var oy = points[i][1] - defY;