@antv/g-lite 1.2.13 → 1.2.15
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 +39 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -53
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9643,7 +9643,7 @@ var EventService = /** @class */ (function () {
|
|
|
9643
9643
|
};
|
|
9644
9644
|
EventService.prototype.hitTest = function (position) {
|
|
9645
9645
|
var viewportX = position.viewportX, viewportY = position.viewportY;
|
|
9646
|
-
var _a = this.context.config, width = _a.width, height = _a.height;
|
|
9646
|
+
var _a = this.context.config, width = _a.width, height = _a.height, disableHitTesting = _a.disableHitTesting;
|
|
9647
9647
|
// outside canvas
|
|
9648
9648
|
if (viewportX < 0 ||
|
|
9649
9649
|
viewportY < 0 ||
|
|
@@ -9651,7 +9651,7 @@ var EventService = /** @class */ (function () {
|
|
|
9651
9651
|
viewportY > height) {
|
|
9652
9652
|
return null;
|
|
9653
9653
|
}
|
|
9654
|
-
return (this.pickHandler(position) ||
|
|
9654
|
+
return ((!disableHitTesting && this.pickHandler(position)) ||
|
|
9655
9655
|
this.rootTarget || // return Document
|
|
9656
9656
|
null);
|
|
9657
9657
|
};
|
|
@@ -10102,13 +10102,24 @@ var RenderingService = /** @class */ (function () {
|
|
|
10102
10102
|
this.globalRuntime.sceneGraphService.syncHierarchy(renderingContext.root);
|
|
10103
10103
|
this.globalRuntime.sceneGraphService.triggerPendingEvents();
|
|
10104
10104
|
if (renderingContext.renderReasons.size && this.inited) {
|
|
10105
|
-
|
|
10105
|
+
// @ts-ignore
|
|
10106
|
+
renderingContext.dirtyRectangleRenderingDisabled =
|
|
10107
|
+
this.disableDirtyRectangleRendering();
|
|
10108
|
+
var onlyCameraChanged = renderingContext.renderReasons.size === 1 &&
|
|
10109
|
+
renderingContext.renderReasons.has(exports.RenderReason.CAMERA_CHANGED);
|
|
10110
|
+
var shouldTriggerRenderHooks = !canvasConfig.disableRenderHooks ||
|
|
10111
|
+
!(canvasConfig.disableRenderHooks && onlyCameraChanged);
|
|
10112
|
+
if (shouldTriggerRenderHooks) {
|
|
10113
|
+
this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
|
|
10114
|
+
}
|
|
10106
10115
|
this.hooks.beginFrame.call();
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10116
|
+
if (shouldTriggerRenderHooks) {
|
|
10117
|
+
renderingContext.renderListCurrentFrame.forEach(function (object) {
|
|
10118
|
+
_this.hooks.beforeRender.call(object);
|
|
10119
|
+
_this.hooks.render.call(object);
|
|
10120
|
+
_this.hooks.afterRender.call(object);
|
|
10121
|
+
});
|
|
10122
|
+
}
|
|
10112
10123
|
this.hooks.endFrame.call();
|
|
10113
10124
|
renderingContext.renderListCurrentFrame = [];
|
|
10114
10125
|
renderingContext.renderReasons.clear();
|
|
@@ -10125,8 +10136,12 @@ var RenderingService = /** @class */ (function () {
|
|
|
10125
10136
|
}
|
|
10126
10137
|
// TODO: relayout
|
|
10127
10138
|
// dirtycheck first
|
|
10139
|
+
var renderable = displayObject.renderable;
|
|
10128
10140
|
var objectChanged = enableDirtyCheck
|
|
10129
|
-
?
|
|
10141
|
+
? // @ts-ignore
|
|
10142
|
+
renderable.dirty || renderingContext.dirtyRectangleRenderingDisabled
|
|
10143
|
+
? displayObject
|
|
10144
|
+
: null
|
|
10130
10145
|
: displayObject;
|
|
10131
10146
|
if (objectChanged) {
|
|
10132
10147
|
var objectToRender = enableCulling
|
|
@@ -12293,9 +12308,8 @@ var DATASET_PREFIX = 'data-';
|
|
|
12293
12308
|
var DisplayObject = /** @class */ (function (_super) {
|
|
12294
12309
|
tslib.__extends(DisplayObject, _super);
|
|
12295
12310
|
function DisplayObject(config) {
|
|
12296
|
-
var _this = this;
|
|
12297
12311
|
var _a;
|
|
12298
|
-
_this = _super.call(this) || this;
|
|
12312
|
+
var _this = _super.call(this) || this;
|
|
12299
12313
|
_this.isCustomElement = false;
|
|
12300
12314
|
_this.isMutationObserved = false;
|
|
12301
12315
|
/**
|
|
@@ -13110,8 +13124,8 @@ var CustomElement = /** @class */ (function (_super) {
|
|
|
13110
13124
|
tslib.__extends(CustomElement, _super);
|
|
13111
13125
|
// private shadowNodes: DisplayObject[] = [];
|
|
13112
13126
|
function CustomElement(_a) {
|
|
13113
|
-
if (_a === void 0) { _a = {}; }
|
|
13114
13127
|
var _this = this;
|
|
13128
|
+
if (_a === void 0) { _a = {}; }
|
|
13115
13129
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13116
13130
|
_this = _super.call(this, tslib.__assign({ style: runtime.enableCSSParsing
|
|
13117
13131
|
? tslib.__assign({ x: '', y: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13168,8 +13182,8 @@ var Group = /** @class */ (function (_super) {
|
|
|
13168
13182
|
var HTML = /** @class */ (function (_super) {
|
|
13169
13183
|
tslib.__extends(HTML, _super);
|
|
13170
13184
|
function HTML(_a) {
|
|
13171
|
-
if (_a === void 0) { _a = {}; }
|
|
13172
13185
|
var _this = this;
|
|
13186
|
+
if (_a === void 0) { _a = {}; }
|
|
13173
13187
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13174
13188
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.HTML, style: runtime.enableCSSParsing
|
|
13175
13189
|
? tslib.__assign({ x: '', y: '', width: 'auto', height: 'auto', innerHTML: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13247,8 +13261,8 @@ var Image = /** @class */ (function (_super) {
|
|
|
13247
13261
|
var Line = /** @class */ (function (_super) {
|
|
13248
13262
|
tslib.__extends(Line, _super);
|
|
13249
13263
|
function Line(_a) {
|
|
13250
|
-
if (_a === void 0) { _a = {}; }
|
|
13251
13264
|
var _this = this;
|
|
13265
|
+
if (_a === void 0) { _a = {}; }
|
|
13252
13266
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13253
13267
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.LINE, style: tslib.__assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0, isBillboard: false }, style) }, rest)) || this;
|
|
13254
13268
|
_this.markerStartAngle = 0;
|
|
@@ -13358,8 +13372,8 @@ var Line = /** @class */ (function (_super) {
|
|
|
13358
13372
|
var Path = /** @class */ (function (_super) {
|
|
13359
13373
|
tslib.__extends(Path, _super);
|
|
13360
13374
|
function Path(_a) {
|
|
13361
|
-
if (_a === void 0) { _a = {}; }
|
|
13362
13375
|
var _this = this;
|
|
13376
|
+
if (_a === void 0) { _a = {}; }
|
|
13363
13377
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13364
13378
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.PATH, style: runtime.enableCSSParsing
|
|
13365
13379
|
? tslib.__assign({ path: '', miterLimit: '' }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -13559,8 +13573,8 @@ var Path = /** @class */ (function (_super) {
|
|
|
13559
13573
|
var Polygon = /** @class */ (function (_super) {
|
|
13560
13574
|
tslib.__extends(Polygon, _super);
|
|
13561
13575
|
function Polygon(_a) {
|
|
13562
|
-
if (_a === void 0) { _a = {}; }
|
|
13563
13576
|
var _this = this;
|
|
13577
|
+
if (_a === void 0) { _a = {}; }
|
|
13564
13578
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13565
13579
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.POLYGON, style: runtime.enableCSSParsing
|
|
13566
13580
|
? tslib.__assign({ points: '', miterLimit: '', isClosed: true }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -14287,33 +14301,6 @@ var CullingPlugin = /** @class */ (function () {
|
|
|
14287
14301
|
return CullingPlugin;
|
|
14288
14302
|
}());
|
|
14289
14303
|
|
|
14290
|
-
/**
|
|
14291
|
-
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
14292
|
-
*/
|
|
14293
|
-
var DirtyCheckPlugin = /** @class */ (function () {
|
|
14294
|
-
function DirtyCheckPlugin() {
|
|
14295
|
-
}
|
|
14296
|
-
DirtyCheckPlugin.prototype.apply = function (context) {
|
|
14297
|
-
var renderingService = context.renderingService;
|
|
14298
|
-
renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin.tag, function (object) {
|
|
14299
|
-
if (object) {
|
|
14300
|
-
var renderable = object.renderable;
|
|
14301
|
-
var isDirty = renderable.dirty ||
|
|
14302
|
-
renderingService.disableDirtyRectangleRendering();
|
|
14303
|
-
if (isDirty) {
|
|
14304
|
-
return object;
|
|
14305
|
-
}
|
|
14306
|
-
else {
|
|
14307
|
-
return null;
|
|
14308
|
-
}
|
|
14309
|
-
}
|
|
14310
|
-
return object;
|
|
14311
|
-
});
|
|
14312
|
-
};
|
|
14313
|
-
DirtyCheckPlugin.tag = 'DirtyCheck';
|
|
14314
|
-
return DirtyCheckPlugin;
|
|
14315
|
-
}());
|
|
14316
|
-
|
|
14317
14304
|
/**
|
|
14318
14305
|
* support mouse & touch events
|
|
14319
14306
|
* @see https://github.com/pixijs/pixi.js/blob/dev/packages/interaction/README.md
|
|
@@ -14504,7 +14491,6 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14504
14491
|
return { x: x, y: y };
|
|
14505
14492
|
};
|
|
14506
14493
|
EventPlugin.prototype.bootstrapEvent = function (event, normalizedEvent, view, nativeEvent) {
|
|
14507
|
-
var _a, _b;
|
|
14508
14494
|
event.view = view;
|
|
14509
14495
|
event.originalEvent = null;
|
|
14510
14496
|
event.nativeEvent = nativeEvent;
|
|
@@ -14519,10 +14505,10 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14519
14505
|
event.tiltY = normalizedEvent.tiltY;
|
|
14520
14506
|
event.twist = normalizedEvent.twist;
|
|
14521
14507
|
this.transferMouseData(event, normalizedEvent);
|
|
14522
|
-
var
|
|
14508
|
+
var _a = this.getViewportXY(normalizedEvent), x = _a.x, y = _a.y;
|
|
14523
14509
|
event.viewport.x = x;
|
|
14524
14510
|
event.viewport.y = y;
|
|
14525
|
-
var
|
|
14511
|
+
var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
|
|
14526
14512
|
event.canvas.x = canvasX;
|
|
14527
14513
|
event.canvas.y = canvasY;
|
|
14528
14514
|
event.global.copyFrom(event.canvas);
|
|
@@ -14540,17 +14526,16 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14540
14526
|
return event;
|
|
14541
14527
|
};
|
|
14542
14528
|
EventPlugin.prototype.normalizeWheelEvent = function (nativeEvent) {
|
|
14543
|
-
var _a, _b;
|
|
14544
14529
|
var event = this.rootWheelEvent;
|
|
14545
14530
|
this.transferMouseData(event, nativeEvent);
|
|
14546
14531
|
event.deltaMode = nativeEvent.deltaMode;
|
|
14547
14532
|
event.deltaX = nativeEvent.deltaX;
|
|
14548
14533
|
event.deltaY = nativeEvent.deltaY;
|
|
14549
14534
|
event.deltaZ = nativeEvent.deltaZ;
|
|
14550
|
-
var
|
|
14535
|
+
var _a = this.getViewportXY(nativeEvent), x = _a.x, y = _a.y;
|
|
14551
14536
|
event.viewport.x = x;
|
|
14552
14537
|
event.viewport.y = y;
|
|
14553
|
-
var
|
|
14538
|
+
var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
|
|
14554
14539
|
event.canvas.x = canvasX;
|
|
14555
14540
|
event.canvas.y = canvasY;
|
|
14556
14541
|
event.global.copyFrom(event.canvas);
|
|
@@ -14842,7 +14827,6 @@ var PrepareRendererPlugin = /** @class */ (function () {
|
|
|
14842
14827
|
// some objects may be removed since last frame
|
|
14843
14828
|
.filter(function (object) { return object.isConnected; })
|
|
14844
14829
|
.forEach(function (node) {
|
|
14845
|
-
var _a, _b;
|
|
14846
14830
|
var rBushNode = node.rBushNode;
|
|
14847
14831
|
// clear dirty node
|
|
14848
14832
|
if (rBushNode && rBushNode.aabb) {
|
|
@@ -14850,8 +14834,8 @@ var PrepareRendererPlugin = /** @class */ (function () {
|
|
|
14850
14834
|
}
|
|
14851
14835
|
var renderBounds = node.getRenderBounds();
|
|
14852
14836
|
if (renderBounds) {
|
|
14853
|
-
var
|
|
14854
|
-
var
|
|
14837
|
+
var _a = tslib.__read(renderBounds.getMin(), 2), minX = _a[0], minY = _a[1];
|
|
14838
|
+
var _b = tslib.__read(renderBounds.getMax(), 2), maxX = _b[0], maxY = _b[1];
|
|
14855
14839
|
if (!rBushNode.aabb) {
|
|
14856
14840
|
rBushNode.aabb = {};
|
|
14857
14841
|
}
|
|
@@ -15207,7 +15191,9 @@ var Canvas = /** @class */ (function (_super) {
|
|
|
15207
15191
|
this.context.rBushRoot = new RBush();
|
|
15208
15192
|
// reset rendering plugins
|
|
15209
15193
|
this.context.renderingPlugins = [];
|
|
15210
|
-
this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(),
|
|
15194
|
+
this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(),
|
|
15195
|
+
// new DirtyCheckPlugin(),
|
|
15196
|
+
new CullingPlugin([new FrustumCullingStrategy()]));
|
|
15211
15197
|
//
|
|
15212
15198
|
this.loadRendererContainerModule(renderer);
|
|
15213
15199
|
// init context service
|