@visactor/vrender 0.17.8 → 0.17.10

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
@@ -2728,6 +2728,63 @@
2728
2728
  out.a = scaleX * a1, out.b = scaleX * b1, out.c = scaleY * c1, out.d = scaleY * d1, out.e = oe + oa * rotateCenterX + oc * rotateCenterY - a1 * offsetX - c1 * offsetY, out.f = of + ob * rotateCenterX + od * rotateCenterY - b1 * offsetX - d1 * offsetY;
2729
2729
  }
2730
2730
 
2731
+ var LRU = /*#__PURE__*/function () {
2732
+ function LRU() {
2733
+ _classCallCheck(this, LRU);
2734
+ this.CLEAN_THRESHOLD = 1e3, this.L_TIME = 1e3, this.R_COUNT = 1, this.R_TIMESTAMP_MAX_SIZE = 20;
2735
+ }
2736
+ _createClass(LRU, [{
2737
+ key: "clearCache",
2738
+ value: function clearCache(cache, params) {
2739
+ var _params$CLEAN_THRESHO = params.CLEAN_THRESHOLD,
2740
+ CLEAN_THRESHOLD = _params$CLEAN_THRESHO === void 0 ? this.CLEAN_THRESHOLD : _params$CLEAN_THRESHO,
2741
+ _params$L_TIME = params.L_TIME,
2742
+ L_TIME = _params$L_TIME === void 0 ? this.L_TIME : _params$L_TIME,
2743
+ _params$R_COUNT = params.R_COUNT,
2744
+ R_COUNT = _params$R_COUNT === void 0 ? this.R_COUNT : _params$R_COUNT;
2745
+ if (cache.size < CLEAN_THRESHOLD) return 0;
2746
+ var clearNum = 0;
2747
+ var clear = function clear(key) {
2748
+ clearNum++, cache["delete"](key);
2749
+ },
2750
+ now = Date.now();
2751
+ return cache.forEach(function (item, key) {
2752
+ if (item.timestamp.length < R_COUNT) return clear(key);
2753
+ var useCount = 0;
2754
+ for (; now - item.timestamp[item.timestamp.length - 1 - useCount] < L_TIME && (useCount++, !(useCount >= R_COUNT)););
2755
+ if (useCount < R_COUNT) return clear(key);
2756
+ for (; now - item.timestamp[0] > L_TIME;) item.timestamp.shift();
2757
+ }), clearNum;
2758
+ }
2759
+ }, {
2760
+ key: "addLimitedTimestamp",
2761
+ value: function addLimitedTimestamp(cacheItem, t, params) {
2762
+ var _params$R_TIMESTAMP_M = params.R_TIMESTAMP_MAX_SIZE,
2763
+ R_TIMESTAMP_MAX_SIZE = _params$R_TIMESTAMP_M === void 0 ? this.R_TIMESTAMP_MAX_SIZE : _params$R_TIMESTAMP_M;
2764
+ cacheItem.timestamp.length > R_TIMESTAMP_MAX_SIZE && cacheItem.timestamp.shift(), cacheItem.timestamp.push(t);
2765
+ }
2766
+ }, {
2767
+ key: "clearTimeStamp",
2768
+ value: function clearTimeStamp(cache, params) {
2769
+ var _params$L_TIME2 = params.L_TIME,
2770
+ L_TIME = _params$L_TIME2 === void 0 ? this.L_TIME : _params$L_TIME2,
2771
+ now = Date.now();
2772
+ cache.forEach(function (item) {
2773
+ for (; now - item.timestamp[0] > L_TIME;) item.timestamp.shift();
2774
+ });
2775
+ }
2776
+ }, {
2777
+ key: "clearItemTimestamp",
2778
+ value: function clearItemTimestamp(cacheItem, params) {
2779
+ var _params$L_TIME3 = params.L_TIME,
2780
+ L_TIME = _params$L_TIME3 === void 0 ? this.L_TIME : _params$L_TIME3,
2781
+ now = Date.now();
2782
+ for (; now - cacheItem.timestamp[0] > L_TIME;) cacheItem.timestamp.shift();
2783
+ }
2784
+ }]);
2785
+ return LRU;
2786
+ }();
2787
+
2731
2788
  function hslToRgb(h, s, l) {
2732
2789
  s /= 100, l /= 100;
2733
2790
  var c = (1 - Math.abs(2 * l - 1)) * s,
@@ -4221,6 +4278,10 @@
4221
4278
  var defined0 = !1;
4222
4279
  for (var i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
4223
4280
  }
4281
+ function genSegContext(curveType, direction, points) {
4282
+ var curveDirection = null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN;
4283
+ return "monotoneY" === curveType ? new ReflectSegContext(curveType, curveDirection) : new SegContext(curveType, curveDirection);
4284
+ }
4224
4285
 
4225
4286
  var Linear = /*#__PURE__*/function () {
4226
4287
  function Linear(context, startPoint) {
@@ -4276,7 +4337,7 @@
4276
4337
  var direction = params.direction,
4277
4338
  startPoint = params.startPoint;
4278
4339
  if (points.length < 2 - Number(!!startPoint)) return null;
4279
- var segContext = new SegContext("linear", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4340
+ var segContext = genSegContext("linear", direction, points);
4280
4341
  return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
4281
4342
  }
4282
4343
  function genLinearTypeSegments(path, points) {
@@ -4346,7 +4407,7 @@
4346
4407
  startPoint = params.startPoint;
4347
4408
  if (points.length < 2 - Number(!!startPoint)) return null;
4348
4409
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4349
- var segContext = new SegContext("basis", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4410
+ var segContext = genSegContext("basis", direction, points);
4350
4411
  return genBasisTypeSegments(new Basis(segContext, startPoint), points), segContext;
4351
4412
  }
4352
4413
 
@@ -4453,7 +4514,7 @@
4453
4514
  }]);
4454
4515
  return MonotoneY;
4455
4516
  }(MonotoneX);
4456
- function genMonotpneXTypeSegments(path, points) {
4517
+ function genMonotoneXTypeSegments(path, points) {
4457
4518
  return genCurveSegments(path, points);
4458
4519
  }
4459
4520
  function genMonotoneXSegments(points) {
@@ -4462,10 +4523,10 @@
4462
4523
  startPoint = params.startPoint;
4463
4524
  if (points.length < 2 - Number(!!startPoint)) return null;
4464
4525
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4465
- var segContext = new SegContext("monotoneX", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4466
- return genMonotpneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
4526
+ var segContext = genSegContext("monotoneX", direction, points);
4527
+ return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
4467
4528
  }
4468
- function genMonotpneYTypeSegments(path, points) {
4529
+ function genMonotoneYTypeSegments(path, points) {
4469
4530
  return genCurveSegments(path, points);
4470
4531
  }
4471
4532
  function genMonotoneYSegments(points) {
@@ -4474,8 +4535,8 @@
4474
4535
  startPoint = params.startPoint;
4475
4536
  if (points.length < 2 - Number(!!startPoint)) return null;
4476
4537
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
4477
- var segContext = new ReflectSegContext("monotoneY", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4478
- return genMonotpneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
4538
+ var segContext = genSegContext("monotoneY", direction, points);
4539
+ return genMonotoneYTypeSegments(new MonotoneY(segContext, startPoint), points), segContext;
4479
4540
  }
4480
4541
 
4481
4542
  var Step$1 = /*#__PURE__*/function () {
@@ -4544,61 +4605,27 @@
4544
4605
  return genCurveSegments(path, points);
4545
4606
  }
4546
4607
 
4547
- var LinearClosed = /*#__PURE__*/function () {
4548
- function LinearClosed(context, startPoint) {
4608
+ var LinearClosed = /*#__PURE__*/function (_Linear) {
4609
+ _inherits(LinearClosed, _Linear);
4610
+ var _super = _createSuper(LinearClosed);
4611
+ function LinearClosed() {
4549
4612
  _classCallCheck(this, LinearClosed);
4550
- this.context = context, startPoint && (this.startPoint = startPoint);
4613
+ return _super.apply(this, arguments);
4551
4614
  }
4552
4615
  _createClass(LinearClosed, [{
4553
- key: "areaStart",
4554
- value: function areaStart() {
4555
- this._line = 0;
4556
- }
4557
- }, {
4558
- key: "areaEnd",
4559
- value: function areaEnd() {
4560
- this._line = NaN;
4561
- }
4562
- }, {
4563
- key: "lineStart",
4564
- value: function lineStart() {
4565
- this._point = 0, this.startPoint && this.point(this.startPoint);
4566
- }
4567
- }, {
4568
4616
  key: "lineEnd",
4569
4617
  value: function lineEnd() {
4570
4618
  this.context.closePath();
4571
4619
  }
4572
- }, {
4573
- key: "point",
4574
- value: function point(p) {
4575
- var x = p.x,
4576
- y = p.y;
4577
- switch (this._point) {
4578
- case 0:
4579
- this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p) : this.context.moveTo(x, y, p);
4580
- break;
4581
- case 1:
4582
- this._point = 2;
4583
- default:
4584
- this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);
4585
- }
4586
- this._lastDefined = p.defined;
4587
- }
4588
- }, {
4589
- key: "tryUpdateLength",
4590
- value: function tryUpdateLength() {
4591
- return this.context.tryUpdateLength();
4592
- }
4593
4620
  }]);
4594
4621
  return LinearClosed;
4595
- }();
4622
+ }(Linear);
4596
4623
  function genLinearClosedSegments(points) {
4597
4624
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4598
4625
  var direction = params.direction,
4599
4626
  startPoint = params.startPoint;
4600
4627
  if (points.length < 2 - Number(!!startPoint)) return null;
4601
- var segContext = new SegContext("linear", null != direction ? direction : abs(points[points.length - 1].x - points[0].x) > abs(points[points.length - 1].y - points[0].y) ? exports.Direction.ROW : exports.Direction.COLUMN);
4628
+ var segContext = genSegContext("linear", direction, points);
4602
4629
  return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
4603
4630
  }
4604
4631
  function genLinearClosedTypeSegments(path, points) {
@@ -5153,6 +5180,8 @@
5153
5180
  strokeSeg: null,
5154
5181
  pickable: !0,
5155
5182
  childrenPickable: !0,
5183
+ fillPickable: !0,
5184
+ strokePickable: !0,
5156
5185
  visible: !0,
5157
5186
  zIndex: 0,
5158
5187
  layout: null,
@@ -13351,19 +13380,27 @@
13351
13380
  }]);
13352
13381
  return ConicalCanvas;
13353
13382
  }();
13354
- var ColorInterpolate = /*#__PURE__*/function () {
13383
+ var ColorInterpolate = /*#__PURE__*/function (_LRU) {
13384
+ _inherits(ColorInterpolate, _LRU);
13385
+ var _super = _createSuper(ColorInterpolate);
13355
13386
  function ColorInterpolate() {
13387
+ var _this;
13356
13388
  var stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
13357
13389
  var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
13358
13390
  _classCallCheck(this, ColorInterpolate);
13391
+ _this = _super.call(this), _this.cacheParams = {
13392
+ CLEAN_THRESHOLD: 100,
13393
+ L_TIME: 1e3
13394
+ }, _this.dataMap = new Map();
13359
13395
  var canvas = ConicalCanvas.GetCanvas(),
13360
13396
  conicalCtx = ConicalCanvas.GetCtx();
13361
- if (canvas.width = precision, canvas.height = 1, !conicalCtx) return;
13397
+ if (canvas.width = precision, canvas.height = 1, !conicalCtx) return _possibleConstructorReturn(_this);
13362
13398
  if (conicalCtx.translate(0, 0), !conicalCtx) throw new Error("获取ctx发生错误");
13363
13399
  var gradient = conicalCtx.createLinearGradient(0, 0, precision, 0);
13364
13400
  stops.forEach(function (stop) {
13365
13401
  gradient.addColorStop(stop[0], stop[1]);
13366
- }), conicalCtx.fillStyle = gradient, conicalCtx.fillRect(0, 0, precision, 1), this.rgbaSet = conicalCtx.getImageData(0, 0, precision, 1).data;
13402
+ }), conicalCtx.fillStyle = gradient, conicalCtx.fillRect(0, 0, precision, 1), _this.rgbaSet = conicalCtx.getImageData(0, 0, precision, 1).data;
13403
+ return _this;
13367
13404
  }
13368
13405
  _createClass(ColorInterpolate, [{
13369
13406
  key: "getColor",
@@ -13371,32 +13408,32 @@
13371
13408
  var rgba = this.rgbaSet.slice(4 * offset, 4 * offset + 4);
13372
13409
  return "rgba(".concat(rgba[0], ", ").concat(rgba[1], ", ").concat(rgba[2], ", ").concat(rgba[3] / 255, ")");
13373
13410
  }
13374
- }], [{
13411
+ }, {
13375
13412
  key: "GetOrCreate",
13376
- value: function GetOrCreate() {
13377
- var stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
13378
- var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
13379
- var str = "";
13413
+ value: function GetOrCreate(x, y, w, h) {
13414
+ var stops = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
13415
+ var precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 100;
13416
+ var str = "".concat(x).concat(y).concat(w).concat(h);
13380
13417
  stops.forEach(function (item) {
13381
13418
  return str += item.join();
13382
13419
  }), str += precision;
13383
- var colorInter = ColorInterpolate.dataMap.get(str);
13384
- return colorInter || (colorInter = new ColorInterpolate(stops, precision), ColorInterpolate.dataMap.set(str, colorInter)), colorInter;
13385
- }
13386
- }, {
13387
- key: "SetColorInterpolateInstance",
13388
- value: function SetColorInterpolateInstance(stops, ins) {
13389
- ColorInterpolate.dataMap.set(stops, ins);
13420
+ var colorInter = this.dataMap.get(str);
13421
+ if (!colorInter) {
13422
+ colorInter = {
13423
+ data: new ColorInterpolate(stops, precision),
13424
+ timestamp: []
13425
+ }, this.addLimitedTimestamp(colorInter, Date.now(), {}), this.dataMap.set(str, colorInter);
13426
+ }
13427
+ return this.clearCache(this.dataMap, this.cacheParams), colorInter.data;
13390
13428
  }
13391
- }, {
13392
- key: "GetColorInterpolateInstance",
13393
- value: function GetColorInterpolateInstance(stops) {
13394
- return ColorInterpolate.dataMap.get(stops);
13429
+ }], [{
13430
+ key: "getInstance",
13431
+ value: function getInstance() {
13432
+ return ColorInterpolate._instance || (ColorInterpolate._instance = new ColorInterpolate()), ColorInterpolate._instance;
13395
13433
  }
13396
13434
  }]);
13397
13435
  return ColorInterpolate;
13398
- }();
13399
- ColorInterpolate.dataMap = new Map();
13436
+ }(LRU);
13400
13437
  var ConicalPatternStore = /*#__PURE__*/function () {
13401
13438
  function ConicalPatternStore() {
13402
13439
  _classCallCheck(this, ConicalPatternStore);
@@ -13468,7 +13505,7 @@
13468
13505
  var r = Math.sqrt(Math.max(Math.max(Math.pow(x, 2) + Math.pow(y, 2), Math.pow(width - x, 2) + Math.pow(y, 2)), Math.max(Math.pow(width - x, 2) + Math.pow(height - y, 2), Math.pow(x, 2) + Math.pow(height - y, 2)))),
13469
13506
  stepNum = deltaDeg + 1,
13470
13507
  step = deltaAngle / Math.max(1, stepNum - 1),
13471
- colorInter = ColorInterpolate.GetOrCreate(stops, stepNum),
13508
+ colorInter = ColorInterpolate.getInstance().GetOrCreate(x, y, width, height, stops, stepNum),
13472
13509
  lineWidth = 2 * Math.PI * r / 360;
13473
13510
  conicalCanvas.width = width, conicalCanvas.height = height, conicalCtx.setTransform(1, 0, 0, 1, 0, 0), conicalCtx.clearRect(0, 0, width, height), conicalCtx.translate(x, y), conicalCtx.rotate(startAngle);
13474
13511
  for (var i = 0, len = stepNum - 1; i < len && !(startAngle + i * step > endAngle); i++) {
@@ -18461,6 +18498,7 @@
18461
18498
  return DefaultBaseInteractiveRenderContribution;
18462
18499
  }();
18463
18500
  exports.DefaultBaseInteractiveRenderContribution = __decorate$1w([injectable(), __param$O(0, inject(ContributionProvider)), __param$O(0, named(InteractiveSubRenderContribution)), __metadata$19("design:paramtypes", [Object])], exports.DefaultBaseInteractiveRenderContribution);
18501
+
18464
18502
  var DefaultBaseTextureRenderContribution = /*#__PURE__*/function () {
18465
18503
  function DefaultBaseTextureRenderContribution() {
18466
18504
  _classCallCheck(this, DefaultBaseTextureRenderContribution);
@@ -18561,16 +18599,20 @@
18561
18599
  key: "drawShape",
18562
18600
  value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
18563
18601
  this.textureMap || this.initTextureMap(context, graphic.stage);
18564
- var _graphic$attribute2 = graphic.attribute,
18565
- _graphic$attribute2$t = _graphic$attribute2.texture,
18566
- texture = _graphic$attribute2$t === void 0 ? graphicAttribute.texture : _graphic$attribute2$t,
18567
- _graphic$attribute2$t2 = _graphic$attribute2.textureColor,
18568
- textureColor = _graphic$attribute2$t2 === void 0 ? graphicAttribute.textureColor : _graphic$attribute2$t2,
18569
- _graphic$attribute2$t3 = _graphic$attribute2.textureSize,
18570
- textureSize = _graphic$attribute2$t3 === void 0 ? graphicAttribute.textureSize : _graphic$attribute2$t3,
18571
- _graphic$attribute2$t4 = _graphic$attribute2.texturePadding,
18572
- texturePadding = _graphic$attribute2$t4 === void 0 ? graphicAttribute.texturePadding : _graphic$attribute2$t4;
18573
- if (!texture) return;
18602
+ var _graphic$attribute = graphic.attribute,
18603
+ _graphic$attribute$te = _graphic$attribute.texture,
18604
+ texture = _graphic$attribute$te === void 0 ? graphicAttribute.texture : _graphic$attribute$te,
18605
+ _graphic$attribute$te2 = _graphic$attribute.textureColor,
18606
+ textureColor = _graphic$attribute$te2 === void 0 ? graphicAttribute.textureColor : _graphic$attribute$te2,
18607
+ _graphic$attribute$te3 = _graphic$attribute.textureSize,
18608
+ textureSize = _graphic$attribute$te3 === void 0 ? graphicAttribute.textureSize : _graphic$attribute$te3,
18609
+ _graphic$attribute$te4 = _graphic$attribute.texturePadding,
18610
+ texturePadding = _graphic$attribute$te4 === void 0 ? graphicAttribute.texturePadding : _graphic$attribute$te4;
18611
+ texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
18612
+ }
18613
+ }, {
18614
+ key: "drawTexture",
18615
+ value: function drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
18574
18616
  var pattern = this.textureMap.get(texture);
18575
18617
  if (!pattern) switch (texture) {
18576
18618
  case "circle":
@@ -19086,6 +19128,37 @@
19086
19128
  var defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;
19087
19129
  var defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
19088
19130
 
19131
+ var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
19132
+ _inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
19133
+ var _super = _createSuper(DefaultAreaTextureRenderContribution);
19134
+ function DefaultAreaTextureRenderContribution() {
19135
+ var _this;
19136
+ _classCallCheck(this, DefaultAreaTextureRenderContribution);
19137
+ _this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
19138
+ return _this;
19139
+ }
19140
+ _createClass(DefaultAreaTextureRenderContribution, [{
19141
+ key: "drawShape",
19142
+ value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
19143
+ var _a, _b, _c, _d;
19144
+ this.textureMap || this.initTextureMap(context, graphic.stage);
19145
+ var _ref = options || {},
19146
+ _ref$attribute = _ref.attribute,
19147
+ attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
19148
+ _attribute$texture = attribute.texture,
19149
+ texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
19150
+ _attribute$textureCol = attribute.textureColor,
19151
+ textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
19152
+ _attribute$textureSiz = attribute.textureSize,
19153
+ textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
19154
+ _attribute$texturePad = attribute.texturePadding,
19155
+ texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
19156
+ texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
19157
+ }
19158
+ }]);
19159
+ return DefaultAreaTextureRenderContribution;
19160
+ }(DefaultBaseTextureRenderContribution);
19161
+
19089
19162
  var __decorate$1u = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19090
19163
  var d,
19091
19164
  c = arguments.length,
@@ -19326,6 +19399,26 @@
19326
19399
  }(BaseRender);
19327
19400
  exports.DefaultCanvasCircleRender = __decorate$1t([injectable(), __param$M(0, inject(ContributionProvider)), __param$M(0, named(CircleRenderContribution)), __metadata$17("design:paramtypes", [Object])], exports.DefaultCanvasCircleRender);
19328
19401
 
19402
+ function drawSegItem(ctx, curve, endPercent, params) {
19403
+ if (!curve.p1) return;
19404
+ var _ref = params || {},
19405
+ _ref$offsetX = _ref.offsetX,
19406
+ offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,
19407
+ _ref$offsetY = _ref.offsetY,
19408
+ offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,
19409
+ _ref$offsetZ = _ref.offsetZ,
19410
+ offsetZ = _ref$offsetZ === void 0 ? 0 : _ref$offsetZ;
19411
+ if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19412
+ var _divideCubic = divideCubic(curve, endPercent),
19413
+ _divideCubic2 = _slicedToArray(_divideCubic, 1),
19414
+ curve1 = _divideCubic2[0];
19415
+ ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19416
+ } else {
19417
+ var p = curve.getPointAt(endPercent);
19418
+ ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19419
+ }
19420
+ }
19421
+
19329
19422
  function drawSegments(path, segPath, percent, clipRangeByDimension, params) {
19330
19423
  var _a;
19331
19424
  var _ref = params || {},
@@ -19368,7 +19461,7 @@
19368
19461
  } else _lastCurve = curve;
19369
19462
  });
19370
19463
  } else curves.forEach(function (curve) {
19371
- curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
19464
+ curve.defined ? (needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, 1, params), needMoveTo = !1) : needMoveTo = !0;
19372
19465
  });
19373
19466
  return;
19374
19467
  }
@@ -19407,7 +19500,7 @@
19407
19500
  needMoveTo = !0;
19408
19501
  continue;
19409
19502
  }
19410
- needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, min(_p, 1), params), needMoveTo = !1;
19503
+ needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem(path, curve, min(_p, 1), params), needMoveTo = !1;
19411
19504
  }
19412
19505
  }
19413
19506
  }
@@ -19444,25 +19537,6 @@
19444
19537
  path.lineTo(null !== (_c = startP.x1) && void 0 !== _c ? _c : startP.x, null !== (_d = startP.y1) && void 0 !== _d ? _d : startP.y), path.closePath();
19445
19538
  });
19446
19539
  }
19447
- function drawSegItem$1(ctx, curve, endPercent, params) {
19448
- if (!curve.p1) return;
19449
- var _ref4 = params || {},
19450
- _ref4$offsetX = _ref4.offsetX,
19451
- offsetX = _ref4$offsetX === void 0 ? 0 : _ref4$offsetX,
19452
- _ref4$offsetY = _ref4.offsetY,
19453
- offsetY = _ref4$offsetY === void 0 ? 0 : _ref4$offsetY,
19454
- _ref4$offsetZ = _ref4.offsetZ,
19455
- offsetZ = _ref4$offsetZ === void 0 ? 0 : _ref4$offsetZ;
19456
- if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19457
- var _divideCubic = divideCubic(curve, endPercent),
19458
- _divideCubic2 = _slicedToArray(_divideCubic, 1),
19459
- curve1 = _divideCubic2[0];
19460
- ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19461
- } else {
19462
- var p = curve.getPointAt(endPercent);
19463
- ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19464
- }
19465
- }
19466
19540
 
19467
19541
  var __decorate$1s = undefined && undefined.__decorate || function (decorators, target, key, desc) {
19468
19542
  var d,
@@ -19534,10 +19608,10 @@
19534
19608
  var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
19535
19609
  points = line.attribute.points,
19536
19610
  startP = points[0];
19537
- context.moveTo(startP.x, startP.y, z);
19611
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
19538
19612
  for (var i = 1; i < points.length; i++) {
19539
19613
  var p = points[i];
19540
- context.lineTo(p.x, p.y, z);
19614
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
19541
19615
  }
19542
19616
  context.setShadowBlendStyle && context.setShadowBlendStyle(line, line.attribute, lineAttribute);
19543
19617
  var _line$attribute = line.attribute,
@@ -19770,83 +19844,7 @@
19770
19844
  }
19771
19845
  path.closePath();
19772
19846
  }
19773
- function drawSegItem(ctx, curve, endPercent, params) {
19774
- if (!curve.p1) return;
19775
- var _ref5 = params || {},
19776
- _ref5$offsetX = _ref5.offsetX,
19777
- offsetX = _ref5$offsetX === void 0 ? 0 : _ref5$offsetX,
19778
- _ref5$offsetY = _ref5.offsetY,
19779
- offsetY = _ref5$offsetY === void 0 ? 0 : _ref5$offsetY,
19780
- _ref5$offsetZ = _ref5.offsetZ,
19781
- offsetZ = _ref5$offsetZ === void 0 ? 0 : _ref5$offsetZ;
19782
- if (1 === endPercent) curve.p2 && curve.p3 ? ctx.bezierCurveTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetX + curve.p2.x, offsetY + curve.p2.y, offsetX + curve.p3.x, offsetY + curve.p3.y, offsetZ) : ctx.lineTo(offsetX + curve.p1.x, offsetY + curve.p1.y, offsetZ);else if (curve.p2 && curve.p3) {
19783
- var _divideCubic = divideCubic(curve, endPercent),
19784
- _divideCubic2 = _slicedToArray(_divideCubic, 1),
19785
- curve1 = _divideCubic2[0];
19786
- ctx.bezierCurveTo(offsetX + curve1.p1.x, offsetY + curve1.p1.y, offsetX + curve1.p2.x, offsetY + curve1.p2.y, offsetX + curve1.p3.x, offsetY + curve1.p3.y, offsetZ);
19787
- } else {
19788
- var p = curve.getPointAt(endPercent);
19789
- ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
19790
- }
19791
- }
19792
19847
 
19793
- var DefaultAreaTextureRenderContribution = /*#__PURE__*/function (_DefaultBaseTextureRe) {
19794
- _inherits(DefaultAreaTextureRenderContribution, _DefaultBaseTextureRe);
19795
- var _super = _createSuper(DefaultAreaTextureRenderContribution);
19796
- function DefaultAreaTextureRenderContribution() {
19797
- var _this;
19798
- _classCallCheck(this, DefaultAreaTextureRenderContribution);
19799
- _this = _super.apply(this, arguments), _this.time = exports.BaseRenderContributionTime.afterFillStroke;
19800
- return _this;
19801
- }
19802
- _createClass(DefaultAreaTextureRenderContribution, [{
19803
- key: "drawShape",
19804
- value: function drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
19805
- var _a, _b, _c, _d;
19806
- this.textureMap || this.initTextureMap(context, graphic.stage);
19807
- var _ref = options || {},
19808
- _ref$attribute = _ref.attribute,
19809
- attribute = _ref$attribute === void 0 ? graphic.attribute : _ref$attribute,
19810
- _attribute$texture = attribute.texture,
19811
- texture = _attribute$texture === void 0 ? null !== (_a = graphic.attribute.texture) && void 0 !== _a ? _a : getAttributeFromDefaultAttrList(graphicAttribute, "texture") : _attribute$texture,
19812
- _attribute$textureCol = attribute.textureColor,
19813
- textureColor = _attribute$textureCol === void 0 ? null !== (_b = graphic.attribute.textureColor) && void 0 !== _b ? _b : getAttributeFromDefaultAttrList(graphicAttribute, "textureColor") : _attribute$textureCol,
19814
- _attribute$textureSiz = attribute.textureSize,
19815
- textureSize = _attribute$textureSiz === void 0 ? null !== (_c = graphic.attribute.textureSize) && void 0 !== _c ? _c : getAttributeFromDefaultAttrList(graphicAttribute, "textureSize") : _attribute$textureSiz,
19816
- _attribute$texturePad = attribute.texturePadding,
19817
- texturePadding = _attribute$texturePad === void 0 ? null !== (_d = graphic.attribute.texturePadding) && void 0 !== _d ? _d : getAttributeFromDefaultAttrList(graphicAttribute, "texturePadding") : _attribute$texturePad;
19818
- if (!texture) return;
19819
- var pattern = this.textureMap.get(texture);
19820
- if (!pattern) switch (texture) {
19821
- case "circle":
19822
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
19823
- break;
19824
- case "diamond":
19825
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
19826
- break;
19827
- case "rect":
19828
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
19829
- break;
19830
- case "vertical-line":
19831
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
19832
- break;
19833
- case "horizontal-line":
19834
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
19835
- break;
19836
- case "bias-lr":
19837
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
19838
- break;
19839
- case "bias-rl":
19840
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
19841
- break;
19842
- case "grid":
19843
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
19844
- }
19845
- pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
19846
- }
19847
- }]);
19848
- return DefaultAreaTextureRenderContribution;
19849
- }(DefaultBaseTextureRenderContribution);
19850
19848
  var defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();
19851
19849
  var defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
19852
19850
 
@@ -19903,39 +19901,43 @@
19903
19901
  var z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
19904
19902
  points = area.attribute.points,
19905
19903
  startP = points[0];
19906
- context.moveTo(startP.x, startP.y, z);
19904
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
19907
19905
  for (var i = 1; i < points.length; i++) {
19908
19906
  var p = points[i];
19909
- context.lineTo(p.x, p.y, z);
19907
+ context.lineTo(p.x + offsetX, p.y + offsetY, z);
19910
19908
  }
19911
19909
  for (var _i = points.length - 1; _i >= 0; _i--) {
19912
19910
  var _p = points[_i];
19913
- context.lineTo(null !== (_b = _p.x1) && void 0 !== _b ? _b : _p.x, null !== (_c = _p.y1) && void 0 !== _c ? _c : _p.y, z);
19911
+ context.lineTo((null !== (_b = _p.x1) && void 0 !== _b ? _b : _p.x) + offsetX, (null !== (_c = _p.y1) && void 0 !== _c ? _c : _p.y) + offsetY, z);
19914
19912
  }
19915
- context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute);
19913
+ context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(area, area.attribute, areaAttribute), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
19914
+ attribute: area.attribute
19915
+ });
19916
19916
  var _area$attribute = area.attribute,
19917
19917
  _area$attribute$x = _area$attribute.x,
19918
19918
  originX = _area$attribute$x === void 0 ? 0 : _area$attribute$x,
19919
19919
  _area$attribute$x2 = _area$attribute.x,
19920
19920
  originY = _area$attribute$x2 === void 0 ? 0 : _area$attribute$x2;
19921
- if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), stroke) {
19921
+ if (!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
19922
+ attribute: area.attribute
19923
+ }), stroke) {
19922
19924
  var _area$attribute$strok = area.attribute.stroke,
19923
19925
  _stroke = _area$attribute$strok === void 0 ? areaAttribute && areaAttribute.stroke : _area$attribute$strok;
19924
19926
  if (isArray$1(_stroke) && (_stroke[0] || _stroke[2]) && !1 === _stroke[1]) if (context.beginPath(), _stroke[0]) {
19925
- context.moveTo(startP.x, startP.y, z);
19927
+ context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
19926
19928
  for (var _i2 = 1; _i2 < points.length; _i2++) {
19927
19929
  var _p2 = points[_i2];
19928
- context.lineTo(_p2.x, _p2.y, z);
19930
+ context.lineTo(_p2.x + offsetX, _p2.y + offsetY, z);
19929
19931
  }
19930
19932
  } else if (_stroke[2]) {
19931
19933
  var endP = points[points.length - 1];
19932
- context.moveTo(endP.x, endP.y, z);
19934
+ context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
19933
19935
  for (var _i3 = points.length - 2; _i3 >= 0; _i3--) {
19934
19936
  var _p3 = points[_i3];
19935
- context.lineTo(null !== (_d = _p3.x1) && void 0 !== _d ? _d : _p3.x, null !== (_e = _p3.y1) && void 0 !== _e ? _e : _p3.y, z);
19937
+ context.lineTo((null !== (_d = _p3.x1) && void 0 !== _d ? _d : _p3.x) + offsetX, (null !== (_e = _p3.y1) && void 0 !== _e ? _e : _p3.y) + offsetY, z);
19936
19938
  }
19937
19939
  }
19938
- context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke();
19940
+ strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
19939
19941
  }
19940
19942
  }
19941
19943
  }, {
@@ -23731,7 +23733,7 @@
23731
23733
  }, {
23732
23734
  key: "tryInitInteractiveLayer",
23733
23735
  value: function tryInitInteractiveLayer() {
23734
- this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
23736
+ this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
23735
23737
  }
23736
23738
  }, {
23737
23739
  key: "clearViewBox",
@@ -33309,13 +33311,24 @@
33309
33311
  x = _area$attribute$x === void 0 ? areaAttribute.x : _area$attribute$x,
33310
33312
  _area$attribute$y = _area$attribute.y,
33311
33313
  y = _area$attribute$y === void 0 ? areaAttribute.y : _area$attribute$y;
33314
+ var _area$attribute2 = area.attribute,
33315
+ _area$attribute2$fill = _area$attribute2.fillPickable,
33316
+ fillPickable = _area$attribute2$fill === void 0 ? areaAttribute.fillPickable : _area$attribute2$fill,
33317
+ _area$attribute2$stro = _area$attribute2.strokePickable,
33318
+ strokePickable = _area$attribute2$stro === void 0 ? areaAttribute.strokePickable : _area$attribute2$stro;
33312
33319
  if (pickContext.highPerformanceSave(), area.transMatrix.onlyTranslate()) {
33313
33320
  var _point = area.getOffsetXY(areaAttribute);
33314
33321
  x += _point.x, y += _point.y, pickContext.setTransformForCurrent();
33315
33322
  } else x = 0, y = 0, pickContext.transformFromMatrix(area.transMatrix, !0);
33316
33323
  var picked = !1;
33317
33324
  return this.canvasRenderer.drawShape(area, pickContext, x, y, {}, null, function (context) {
33318
- return !!picked || (picked = context.isPointInPath(point.x, point.y), picked);
33325
+ return !!picked || !!fillPickable && (picked = context.isPointInPath(point.x, point.y), picked);
33326
+ }, function (context, areaAttribute, themeAttribute) {
33327
+ if (picked) return !0;
33328
+ if (!strokePickable) return !1;
33329
+ var lineWidth = areaAttribute.lineWidth || themeAttribute.lineWidth,
33330
+ pickStrokeBuffer = areaAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
33331
+ return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
33319
33332
  }), pickContext.highPerformanceRestore(), picked;
33320
33333
  }
33321
33334
  }]);
@@ -34437,7 +34450,7 @@
34437
34450
 
34438
34451
  var roughModule = _roughModule;
34439
34452
 
34440
- const version = "0.17.8";
34453
+ const version = "0.17.10";
34441
34454
  preLoadAllModule();
34442
34455
  if (isBrowserEnv()) {
34443
34456
  loadBrowserEnv(container);
@@ -34514,6 +34527,7 @@
34514
34527
  exports.DefaultArcRenderContribution = DefaultArcRenderContribution;
34515
34528
  exports.DefaultAreaAllocate = DefaultAreaAllocate;
34516
34529
  exports.DefaultAreaAttribute = DefaultAreaAttribute;
34530
+ exports.DefaultAreaTextureRenderContribution = DefaultAreaTextureRenderContribution;
34517
34531
  exports.DefaultAttribute = DefaultAttribute;
34518
34532
  exports.DefaultBaseBackgroundRenderContribution = DefaultBaseBackgroundRenderContribution;
34519
34533
  exports.DefaultBaseTextureRenderContribution = DefaultBaseTextureRenderContribution;
@@ -34813,9 +34827,9 @@
34813
34827
  exports.genLinearSegments = genLinearSegments;
34814
34828
  exports.genLinearTypeSegments = genLinearTypeSegments;
34815
34829
  exports.genMonotoneXSegments = genMonotoneXSegments;
34830
+ exports.genMonotoneXTypeSegments = genMonotoneXTypeSegments;
34816
34831
  exports.genMonotoneYSegments = genMonotoneYSegments;
34817
- exports.genMonotpneXTypeSegments = genMonotpneXTypeSegments;
34818
- exports.genMonotpneYTypeSegments = genMonotpneYTypeSegments;
34832
+ exports.genMonotoneYTypeSegments = genMonotoneYTypeSegments;
34819
34833
  exports.genNumberType = genNumberType;
34820
34834
  exports.genStepSegments = genStepSegments;
34821
34835
  exports.genStepTypeSegments = genStepTypeSegments;