@antv/g-lite 1.2.12 → 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 +35 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +35 -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,20 @@ 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
|
+
if (!canvasConfig.disableRenderHooks) {
|
|
10109
|
+
this.renderDisplayObject(renderingContext.root, canvasConfig, renderingContext);
|
|
10110
|
+
}
|
|
10106
10111
|
this.hooks.beginFrame.call();
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
+
if (!canvasConfig.disableRenderHooks) {
|
|
10113
|
+
renderingContext.renderListCurrentFrame.forEach(function (object) {
|
|
10114
|
+
_this.hooks.beforeRender.call(object);
|
|
10115
|
+
_this.hooks.render.call(object);
|
|
10116
|
+
_this.hooks.afterRender.call(object);
|
|
10117
|
+
});
|
|
10118
|
+
}
|
|
10112
10119
|
this.hooks.endFrame.call();
|
|
10113
10120
|
renderingContext.renderListCurrentFrame = [];
|
|
10114
10121
|
renderingContext.renderReasons.clear();
|
|
@@ -10125,8 +10132,12 @@ var RenderingService = /** @class */ (function () {
|
|
|
10125
10132
|
}
|
|
10126
10133
|
// TODO: relayout
|
|
10127
10134
|
// dirtycheck first
|
|
10135
|
+
var renderable = displayObject.renderable;
|
|
10128
10136
|
var objectChanged = enableDirtyCheck
|
|
10129
|
-
?
|
|
10137
|
+
? // @ts-ignore
|
|
10138
|
+
renderable.dirty || renderingContext.dirtyRectangleRenderingDisabled
|
|
10139
|
+
? displayObject
|
|
10140
|
+
: null
|
|
10130
10141
|
: displayObject;
|
|
10131
10142
|
if (objectChanged) {
|
|
10132
10143
|
var objectToRender = enableCulling
|
|
@@ -12293,9 +12304,8 @@ var DATASET_PREFIX = 'data-';
|
|
|
12293
12304
|
var DisplayObject = /** @class */ (function (_super) {
|
|
12294
12305
|
tslib.__extends(DisplayObject, _super);
|
|
12295
12306
|
function DisplayObject(config) {
|
|
12296
|
-
var _this = this;
|
|
12297
12307
|
var _a;
|
|
12298
|
-
_this = _super.call(this) || this;
|
|
12308
|
+
var _this = _super.call(this) || this;
|
|
12299
12309
|
_this.isCustomElement = false;
|
|
12300
12310
|
_this.isMutationObserved = false;
|
|
12301
12311
|
/**
|
|
@@ -13110,8 +13120,8 @@ var CustomElement = /** @class */ (function (_super) {
|
|
|
13110
13120
|
tslib.__extends(CustomElement, _super);
|
|
13111
13121
|
// private shadowNodes: DisplayObject[] = [];
|
|
13112
13122
|
function CustomElement(_a) {
|
|
13113
|
-
if (_a === void 0) { _a = {}; }
|
|
13114
13123
|
var _this = this;
|
|
13124
|
+
if (_a === void 0) { _a = {}; }
|
|
13115
13125
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13116
13126
|
_this = _super.call(this, tslib.__assign({ style: runtime.enableCSSParsing
|
|
13117
13127
|
? tslib.__assign({ x: '', y: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13168,8 +13178,8 @@ var Group = /** @class */ (function (_super) {
|
|
|
13168
13178
|
var HTML = /** @class */ (function (_super) {
|
|
13169
13179
|
tslib.__extends(HTML, _super);
|
|
13170
13180
|
function HTML(_a) {
|
|
13171
|
-
if (_a === void 0) { _a = {}; }
|
|
13172
13181
|
var _this = this;
|
|
13182
|
+
if (_a === void 0) { _a = {}; }
|
|
13173
13183
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13174
13184
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.HTML, style: runtime.enableCSSParsing
|
|
13175
13185
|
? tslib.__assign({ x: '', y: '', width: 'auto', height: 'auto', innerHTML: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13247,8 +13257,8 @@ var Image = /** @class */ (function (_super) {
|
|
|
13247
13257
|
var Line = /** @class */ (function (_super) {
|
|
13248
13258
|
tslib.__extends(Line, _super);
|
|
13249
13259
|
function Line(_a) {
|
|
13250
|
-
if (_a === void 0) { _a = {}; }
|
|
13251
13260
|
var _this = this;
|
|
13261
|
+
if (_a === void 0) { _a = {}; }
|
|
13252
13262
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13253
13263
|
_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
13264
|
_this.markerStartAngle = 0;
|
|
@@ -13358,8 +13368,8 @@ var Line = /** @class */ (function (_super) {
|
|
|
13358
13368
|
var Path = /** @class */ (function (_super) {
|
|
13359
13369
|
tslib.__extends(Path, _super);
|
|
13360
13370
|
function Path(_a) {
|
|
13361
|
-
if (_a === void 0) { _a = {}; }
|
|
13362
13371
|
var _this = this;
|
|
13372
|
+
if (_a === void 0) { _a = {}; }
|
|
13363
13373
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13364
13374
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.PATH, style: runtime.enableCSSParsing
|
|
13365
13375
|
? tslib.__assign({ path: '', miterLimit: '' }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -13559,8 +13569,8 @@ var Path = /** @class */ (function (_super) {
|
|
|
13559
13569
|
var Polygon = /** @class */ (function (_super) {
|
|
13560
13570
|
tslib.__extends(Polygon, _super);
|
|
13561
13571
|
function Polygon(_a) {
|
|
13562
|
-
if (_a === void 0) { _a = {}; }
|
|
13563
13572
|
var _this = this;
|
|
13573
|
+
if (_a === void 0) { _a = {}; }
|
|
13564
13574
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13565
13575
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.POLYGON, style: runtime.enableCSSParsing
|
|
13566
13576
|
? tslib.__assign({ points: '', miterLimit: '', isClosed: true }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -14287,33 +14297,6 @@ var CullingPlugin = /** @class */ (function () {
|
|
|
14287
14297
|
return CullingPlugin;
|
|
14288
14298
|
}());
|
|
14289
14299
|
|
|
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
14300
|
/**
|
|
14318
14301
|
* support mouse & touch events
|
|
14319
14302
|
* @see https://github.com/pixijs/pixi.js/blob/dev/packages/interaction/README.md
|
|
@@ -14504,7 +14487,6 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14504
14487
|
return { x: x, y: y };
|
|
14505
14488
|
};
|
|
14506
14489
|
EventPlugin.prototype.bootstrapEvent = function (event, normalizedEvent, view, nativeEvent) {
|
|
14507
|
-
var _a, _b;
|
|
14508
14490
|
event.view = view;
|
|
14509
14491
|
event.originalEvent = null;
|
|
14510
14492
|
event.nativeEvent = nativeEvent;
|
|
@@ -14519,10 +14501,10 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14519
14501
|
event.tiltY = normalizedEvent.tiltY;
|
|
14520
14502
|
event.twist = normalizedEvent.twist;
|
|
14521
14503
|
this.transferMouseData(event, normalizedEvent);
|
|
14522
|
-
var
|
|
14504
|
+
var _a = this.getViewportXY(normalizedEvent), x = _a.x, y = _a.y;
|
|
14523
14505
|
event.viewport.x = x;
|
|
14524
14506
|
event.viewport.y = y;
|
|
14525
|
-
var
|
|
14507
|
+
var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
|
|
14526
14508
|
event.canvas.x = canvasX;
|
|
14527
14509
|
event.canvas.y = canvasY;
|
|
14528
14510
|
event.global.copyFrom(event.canvas);
|
|
@@ -14540,17 +14522,16 @@ var EventPlugin = /** @class */ (function () {
|
|
|
14540
14522
|
return event;
|
|
14541
14523
|
};
|
|
14542
14524
|
EventPlugin.prototype.normalizeWheelEvent = function (nativeEvent) {
|
|
14543
|
-
var _a, _b;
|
|
14544
14525
|
var event = this.rootWheelEvent;
|
|
14545
14526
|
this.transferMouseData(event, nativeEvent);
|
|
14546
14527
|
event.deltaMode = nativeEvent.deltaMode;
|
|
14547
14528
|
event.deltaX = nativeEvent.deltaX;
|
|
14548
14529
|
event.deltaY = nativeEvent.deltaY;
|
|
14549
14530
|
event.deltaZ = nativeEvent.deltaZ;
|
|
14550
|
-
var
|
|
14531
|
+
var _a = this.getViewportXY(nativeEvent), x = _a.x, y = _a.y;
|
|
14551
14532
|
event.viewport.x = x;
|
|
14552
14533
|
event.viewport.y = y;
|
|
14553
|
-
var
|
|
14534
|
+
var _b = this.context.eventService.viewport2Canvas(event.viewport), canvasX = _b.x, canvasY = _b.y;
|
|
14554
14535
|
event.canvas.x = canvasX;
|
|
14555
14536
|
event.canvas.y = canvasY;
|
|
14556
14537
|
event.global.copyFrom(event.canvas);
|
|
@@ -14842,7 +14823,6 @@ var PrepareRendererPlugin = /** @class */ (function () {
|
|
|
14842
14823
|
// some objects may be removed since last frame
|
|
14843
14824
|
.filter(function (object) { return object.isConnected; })
|
|
14844
14825
|
.forEach(function (node) {
|
|
14845
|
-
var _a, _b;
|
|
14846
14826
|
var rBushNode = node.rBushNode;
|
|
14847
14827
|
// clear dirty node
|
|
14848
14828
|
if (rBushNode && rBushNode.aabb) {
|
|
@@ -14850,8 +14830,8 @@ var PrepareRendererPlugin = /** @class */ (function () {
|
|
|
14850
14830
|
}
|
|
14851
14831
|
var renderBounds = node.getRenderBounds();
|
|
14852
14832
|
if (renderBounds) {
|
|
14853
|
-
var
|
|
14854
|
-
var
|
|
14833
|
+
var _a = tslib.__read(renderBounds.getMin(), 2), minX = _a[0], minY = _a[1];
|
|
14834
|
+
var _b = tslib.__read(renderBounds.getMax(), 2), maxX = _b[0], maxY = _b[1];
|
|
14855
14835
|
if (!rBushNode.aabb) {
|
|
14856
14836
|
rBushNode.aabb = {};
|
|
14857
14837
|
}
|
|
@@ -15207,7 +15187,9 @@ var Canvas = /** @class */ (function (_super) {
|
|
|
15207
15187
|
this.context.rBushRoot = new RBush();
|
|
15208
15188
|
// reset rendering plugins
|
|
15209
15189
|
this.context.renderingPlugins = [];
|
|
15210
|
-
this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(),
|
|
15190
|
+
this.context.renderingPlugins.push(new EventPlugin(), new PrepareRendererPlugin(),
|
|
15191
|
+
// new DirtyCheckPlugin(),
|
|
15192
|
+
new CullingPlugin([new FrustumCullingStrategy()]));
|
|
15211
15193
|
//
|
|
15212
15194
|
this.loadRendererContainerModule(renderer);
|
|
15213
15195
|
// init context service
|