@antv/g-lite 1.2.13 → 1.2.14

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.esm.js CHANGED
@@ -9622,7 +9622,7 @@ var EventService = /** @class */ (function () {
9622
9622
  };
9623
9623
  EventService.prototype.hitTest = function (position) {
9624
9624
  var viewportX = position.viewportX, viewportY = position.viewportY;
9625
- var _a = this.context.config, width = _a.width, height = _a.height;
9625
+ var _a = this.context.config, width = _a.width, height = _a.height, disableHitTesting = _a.disableHitTesting;
9626
9626
  // outside canvas
9627
9627
  if (viewportX < 0 ||
9628
9628
  viewportY < 0 ||
@@ -9630,7 +9630,7 @@ var EventService = /** @class */ (function () {
9630
9630
  viewportY > height) {
9631
9631
  return null;
9632
9632
  }
9633
- return (this.pickHandler(position) ||
9633
+ return ((!disableHitTesting && this.pickHandler(position)) ||
9634
9634
  this.rootTarget || // return Document
9635
9635
  null);
9636
9636
  };
@@ -10081,13 +10081,20 @@ var RenderingService = /** @class */ (function () {
10081
10081
  this.globalRuntime.sceneGraphService.syncHierarchy(renderingContext.root);
10082
10082
  this.globalRuntime.sceneGraphService.triggerPendingEvents();
10083
10083
  if (renderingContext.renderReasons.size && this.inited) {
10084
- this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
10084
+ // @ts-ignore
10085
+ renderingContext.dirtyRectangleRenderingDisabled =
10086
+ this.disableDirtyRectangleRendering();
10087
+ if (!canvasConfig.disableRenderHooks) {
10088
+ this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
10089
+ }
10085
10090
  this.hooks.beginFrame.call();
10086
- renderingContext.renderListCurrentFrame.forEach(function (object) {
10087
- _this.hooks.beforeRender.call(object);
10088
- _this.hooks.render.call(object);
10089
- _this.hooks.afterRender.call(object);
10090
- });
10091
+ if (!canvasConfig.disableRenderHooks) {
10092
+ renderingContext.renderListCurrentFrame.forEach(function (object) {
10093
+ _this.hooks.beforeRender.call(object);
10094
+ _this.hooks.render.call(object);
10095
+ _this.hooks.afterRender.call(object);
10096
+ });
10097
+ }
10091
10098
  this.hooks.endFrame.call();
10092
10099
  renderingContext.renderListCurrentFrame = [];
10093
10100
  renderingContext.renderReasons.clear();
@@ -10104,8 +10111,12 @@ var RenderingService = /** @class */ (function () {
10104
10111
  }
10105
10112
  // TODO: relayout
10106
10113
  // dirtycheck first
10114
+ var renderable = displayObject.renderable;
10107
10115
  var objectChanged = enableDirtyCheck
10108
- ? this.hooks.dirtycheck.call(displayObject)
10116
+ ? // @ts-ignore
10117
+ renderable.dirty || renderingContext.dirtyRectangleRenderingDisabled
10118
+ ? displayObject
10119
+ : null
10109
10120
  : displayObject;
10110
10121
  if (objectChanged) {
10111
10122
  var objectToRender = enableCulling
@@ -12272,9 +12283,8 @@ var DATASET_PREFIX = 'data-';
12272
12283
  var DisplayObject = /** @class */ (function (_super) {
12273
12284
  __extends(DisplayObject, _super);
12274
12285
  function DisplayObject(config) {
12275
- var _this = this;
12276
12286
  var _a;
12277
- _this = _super.call(this) || this;
12287
+ var _this = _super.call(this) || this;
12278
12288
  _this.isCustomElement = false;
12279
12289
  _this.isMutationObserved = false;
12280
12290
  /**
@@ -13089,8 +13099,8 @@ var CustomElement = /** @class */ (function (_super) {
13089
13099
  __extends(CustomElement, _super);
13090
13100
  // private shadowNodes: DisplayObject[] = [];
13091
13101
  function CustomElement(_a) {
13092
- if (_a === void 0) { _a = {}; }
13093
13102
  var _this = this;
13103
+ if (_a === void 0) { _a = {}; }
13094
13104
  var style = _a.style, rest = __rest(_a, ["style"]);
13095
13105
  _this = _super.call(this, __assign({ style: runtime.enableCSSParsing
13096
13106
  ? __assign({ x: '', y: '' }, style) : __assign({}, style) }, rest)) || this;
@@ -13147,8 +13157,8 @@ var Group = /** @class */ (function (_super) {
13147
13157
  var HTML = /** @class */ (function (_super) {
13148
13158
  __extends(HTML, _super);
13149
13159
  function HTML(_a) {
13150
- if (_a === void 0) { _a = {}; }
13151
13160
  var _this = this;
13161
+ if (_a === void 0) { _a = {}; }
13152
13162
  var style = _a.style, rest = __rest(_a, ["style"]);
13153
13163
  _this = _super.call(this, __assign({ type: Shape.HTML, style: runtime.enableCSSParsing
13154
13164
  ? __assign({ x: '', y: '', width: 'auto', height: 'auto', innerHTML: '' }, style) : __assign({}, style) }, rest)) || this;
@@ -13226,8 +13236,8 @@ var Image = /** @class */ (function (_super) {
13226
13236
  var Line = /** @class */ (function (_super) {
13227
13237
  __extends(Line, _super);
13228
13238
  function Line(_a) {
13229
- if (_a === void 0) { _a = {}; }
13230
13239
  var _this = this;
13240
+ if (_a === void 0) { _a = {}; }
13231
13241
  var style = _a.style, rest = __rest(_a, ["style"]);
13232
13242
  _this = _super.call(this, __assign({ type: Shape.LINE, style: __assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0, isBillboard: false }, style) }, rest)) || this;
13233
13243
  _this.markerStartAngle = 0;
@@ -13337,8 +13347,8 @@ var Line = /** @class */ (function (_super) {
13337
13347
  var Path = /** @class */ (function (_super) {
13338
13348
  __extends(Path, _super);
13339
13349
  function Path(_a) {
13340
- if (_a === void 0) { _a = {}; }
13341
13350
  var _this = this;
13351
+ if (_a === void 0) { _a = {}; }
13342
13352
  var style = _a.style, rest = __rest(_a, ["style"]);
13343
13353
  _this = _super.call(this, __assign({ type: Shape.PATH, style: runtime.enableCSSParsing
13344
13354
  ? __assign({ path: '', miterLimit: '' }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
@@ -13538,8 +13548,8 @@ var Path = /** @class */ (function (_super) {
13538
13548
  var Polygon = /** @class */ (function (_super) {
13539
13549
  __extends(Polygon, _super);
13540
13550
  function Polygon(_a) {
13541
- if (_a === void 0) { _a = {}; }
13542
13551
  var _this = this;
13552
+ if (_a === void 0) { _a = {}; }
13543
13553
  var style = _a.style, rest = __rest(_a, ["style"]);
13544
13554
  _this = _super.call(this, __assign({ type: Shape.POLYGON, style: runtime.enableCSSParsing
13545
13555
  ? __assign({ points: '', miterLimit: '', isClosed: true }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
@@ -14266,33 +14276,6 @@ var CullingPlugin = /** @class */ (function () {
14266
14276
  return CullingPlugin;
14267
14277
  }());
14268
14278
 
14269
- /**
14270
- * Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
14271
- */
14272
- var DirtyCheckPlugin = /** @class */ (function () {
14273
- function DirtyCheckPlugin() {
14274
- }
14275
- DirtyCheckPlugin.prototype.apply = function (context) {
14276
- var renderingService = context.renderingService;
14277
- renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin.tag, function (object) {
14278
- if (object) {
14279
- var renderable = object.renderable;
14280
- var isDirty = renderable.dirty ||
14281
- renderingService.disableDirtyRectangleRendering();
14282
- if (isDirty) {
14283
- return object;
14284
- }
14285
- else {
14286
- return null;
14287
- }
14288
- }
14289
- return object;
14290
- });
14291
- };
14292
- DirtyCheckPlugin.tag = 'DirtyCheck';
14293
- return DirtyCheckPlugin;
14294
- }());
14295
-
14296
14279
  /**
14297
14280
  * support mouse & touch events
14298
14281
  * @see https://github.com/pixijs/pixi.js/blob/dev/packages/interaction/README.md
@@ -14483,7 +14466,6 @@ var EventPlugin = /** @class */ (function () {
14483
14466
  return { x: x, y: y };
14484
14467
  };
14485
14468
  EventPlugin.prototype.bootstrapEvent = function (event, normalizedEvent, view, nativeEvent) {
14486
- var _a, _b;
14487
14469
  event.view = view;
14488
14470
  event.originalEvent = null;
14489
14471
  event.nativeEvent = nativeEvent;
@@ -14498,10 +14480,10 @@ var EventPlugin = /** @class */ (function () {
14498
14480
  event.tiltY = normalizedEvent.tiltY;
14499
14481
  event.twist = normalizedEvent.twist;
14500
14482
  this.transferMouseData(event, normalizedEvent);
14501
- var x = (_a = this.getViewportXY(normalizedEvent), _a.x), y = _a.y;
14483
+ var _a = this.getViewportXY(normalizedEvent), x = _a.x, y = _a.y;
14502
14484
  event.viewport.x = x;
14503
14485
  event.viewport.y = y;
14504
- var canvasX = (_b = this.context.eventService.viewport2Canvas(event.viewport), _b.x), canvasY = _b.y;
14486
+ var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
14505
14487
  event.canvas.x = canvasX;
14506
14488
  event.canvas.y = canvasY;
14507
14489
  event.global.copyFrom(event.canvas);
@@ -14519,17 +14501,16 @@ var EventPlugin = /** @class */ (function () {
14519
14501
  return event;
14520
14502
  };
14521
14503
  EventPlugin.prototype.normalizeWheelEvent = function (nativeEvent) {
14522
- var _a, _b;
14523
14504
  var event = this.rootWheelEvent;
14524
14505
  this.transferMouseData(event, nativeEvent);
14525
14506
  event.deltaMode = nativeEvent.deltaMode;
14526
14507
  event.deltaX = nativeEvent.deltaX;
14527
14508
  event.deltaY = nativeEvent.deltaY;
14528
14509
  event.deltaZ = nativeEvent.deltaZ;
14529
- var x = (_a = this.getViewportXY(nativeEvent), _a.x), y = _a.y;
14510
+ var _a = this.getViewportXY(nativeEvent), x = _a.x, y = _a.y;
14530
14511
  event.viewport.x = x;
14531
14512
  event.viewport.y = y;
14532
- var canvasX = (_b = this.context.eventService.viewport2Canvas(event.viewport), _b.x), canvasY = _b.y;
14513
+ var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
14533
14514
  event.canvas.x = canvasX;
14534
14515
  event.canvas.y = canvasY;
14535
14516
  event.global.copyFrom(event.canvas);
@@ -14821,7 +14802,6 @@ var PrepareRendererPlugin = /** @class */ (function () {
14821
14802
  // some objects may be removed since last frame
14822
14803
  .filter(function (object) { return object.isConnected; })
14823
14804
  .forEach(function (node) {
14824
- var _a, _b;
14825
14805
  var rBushNode = node.rBushNode;
14826
14806
  // clear dirty node
14827
14807
  if (rBushNode && rBushNode.aabb) {
@@ -14829,8 +14809,8 @@ var PrepareRendererPlugin = /** @class */ (function () {
14829
14809
  }
14830
14810
  var renderBounds = node.getRenderBounds();
14831
14811
  if (renderBounds) {
14832
- var minX = (_a = __read(renderBounds.getMin(), 2), _a[0]), minY = _a[1];
14833
- var maxX = (_b = __read(renderBounds.getMax(), 2), _b[0]), maxY = _b[1];
14812
+ var _a = __read(renderBounds.getMin(), 2), minX = _a[0], minY = _a[1];
14813
+ var _b = __read(renderBounds.getMax(), 2), maxX = _b[0], maxY = _b[1];
14834
14814
  if (!rBushNode.aabb) {
14835
14815
  rBushNode.aabb = {};
14836
14816
  }
@@ -15186,7 +15166,9 @@ var Canvas = /** @class */ (function (_super) {
15186
15166
  this.context.rBushRoot = new RBush();
15187
15167
  // reset rendering plugins
15188
15168
  this.context.renderingPlugins = [];
15189
- this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(), new DirtyCheckPlugin(), new CullingPlugin([new FrustumCullingStrategy()]));
15169
+ this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(),
15170
+ // new DirtyCheckPlugin(),
15171
+ new CullingPlugin([new FrustumCullingStrategy()]));
15190
15172
  //
15191
15173
  this.loadRendererContainerModule(renderer);
15192
15174
  // init context service