@deck.gl/core 9.2.2 → 9.2.4
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/dist.dev.js +20 -15
- package/dist/index.cjs +26 -20
- package/dist/index.cjs.map +3 -3
- package/dist/lib/deck.d.ts.map +1 -1
- package/dist/lib/deck.js +27 -16
- package/dist/lib/deck.js.map +1 -1
- package/dist/lib/init.js +2 -2
- package/dist/lib/tooltip-widget.d.ts.map +1 -1
- package/dist/lib/tooltip-widget.js +6 -2
- package/dist/lib/tooltip-widget.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +2 -2
- package/src/lib/deck.ts +30 -18
- package/src/lib/tooltip-widget.ts +8 -2
package/dist/dist.dev.js
CHANGED
|
@@ -36260,9 +36260,10 @@ void main() {
|
|
|
36260
36260
|
onRenderHTML(rootElement) {
|
|
36261
36261
|
}
|
|
36262
36262
|
onViewportChange(viewport) {
|
|
36263
|
-
if (this.isVisible && viewport.id === this.lastViewport?.id && viewport
|
|
36263
|
+
if (this.isVisible && viewport.id === this.lastViewport?.id && !viewport.equals(this.lastViewport)) {
|
|
36264
36264
|
this.setTooltip(null);
|
|
36265
36265
|
}
|
|
36266
|
+
this.lastViewport = viewport;
|
|
36266
36267
|
}
|
|
36267
36268
|
onHover(info) {
|
|
36268
36269
|
const { deck } = this;
|
|
@@ -36271,7 +36272,6 @@ void main() {
|
|
|
36271
36272
|
return;
|
|
36272
36273
|
}
|
|
36273
36274
|
const displayInfo = getTooltip(info);
|
|
36274
|
-
this.lastViewport = info.viewport;
|
|
36275
36275
|
this.setTooltip(displayInfo, info.x, info.y);
|
|
36276
36276
|
}
|
|
36277
36277
|
setTooltip(displayInfo, x2, y2) {
|
|
@@ -36501,7 +36501,17 @@ void main() {
|
|
|
36501
36501
|
if (props.gl instanceof WebGLRenderingContext) {
|
|
36502
36502
|
log_default.error("WebGL1 context not supported.")();
|
|
36503
36503
|
}
|
|
36504
|
-
|
|
36504
|
+
const userOnResize = this.props.deviceProps?.onResize;
|
|
36505
|
+
deviceOrPromise = webgl2Adapter.attach(props.gl, {
|
|
36506
|
+
...this.props.deviceProps,
|
|
36507
|
+
onResize: (canvasContext, info) => {
|
|
36508
|
+
const { width, height } = canvasContext.canvas;
|
|
36509
|
+
canvasContext.drawingBufferWidth = width;
|
|
36510
|
+
canvasContext.drawingBufferHeight = height;
|
|
36511
|
+
this._needsRedraw = "Canvas resized";
|
|
36512
|
+
userOnResize?.(canvasContext, info);
|
|
36513
|
+
}
|
|
36514
|
+
});
|
|
36505
36515
|
}
|
|
36506
36516
|
if (!deviceOrPromise) {
|
|
36507
36517
|
deviceOrPromise = this._createDevice(props);
|
|
@@ -36572,18 +36582,8 @@ void main() {
|
|
|
36572
36582
|
this.animationLoop.start();
|
|
36573
36583
|
}
|
|
36574
36584
|
this.animationLoop?.setProps(resolvedProps);
|
|
36575
|
-
if (props.useDevicePixels !== void 0 && this.device?.canvasContext
|
|
36576
|
-
this.device.canvasContext.
|
|
36577
|
-
const canvas2 = this.device.canvasContext.canvas;
|
|
36578
|
-
const entry = {
|
|
36579
|
-
target: canvas2,
|
|
36580
|
-
contentBoxSize: [{ inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }],
|
|
36581
|
-
devicePixelContentBoxSize: [
|
|
36582
|
-
{ inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }
|
|
36583
|
-
],
|
|
36584
|
-
borderBoxSize: [{ inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }]
|
|
36585
|
-
};
|
|
36586
|
-
this.device.canvasContext._handleResize([entry]);
|
|
36585
|
+
if (props.useDevicePixels !== void 0 && this.device?.canvasContext) {
|
|
36586
|
+
this.device.canvasContext.setProps({ useDevicePixels: props.useDevicePixels });
|
|
36587
36587
|
}
|
|
36588
36588
|
if (this.layerManager) {
|
|
36589
36589
|
this.viewManager.setProps(resolvedProps);
|
|
@@ -36810,6 +36810,7 @@ void main() {
|
|
|
36810
36810
|
// we must use 'premultiplied' canvas for webgpu to enable transparency and match shaders
|
|
36811
36811
|
alphaMode: this.props.deviceProps?.type === "webgpu" ? "premultiplied" : void 0
|
|
36812
36812
|
};
|
|
36813
|
+
const userOnResize = this.props.deviceProps?.onResize;
|
|
36813
36814
|
return luma.createDevice({
|
|
36814
36815
|
// luma by default throws if a device is already attached
|
|
36815
36816
|
// asynchronous device creation could happen after finalize() is called
|
|
@@ -36825,6 +36826,10 @@ void main() {
|
|
|
36825
36826
|
canvas: this._createCanvas(props),
|
|
36826
36827
|
useDevicePixels: this.props.useDevicePixels,
|
|
36827
36828
|
autoResize: true
|
|
36829
|
+
},
|
|
36830
|
+
onResize: (canvasContext, info) => {
|
|
36831
|
+
this._needsRedraw = "Canvas resized";
|
|
36832
|
+
userOnResize?.(canvasContext, info);
|
|
36828
36833
|
}
|
|
36829
36834
|
});
|
|
36830
36835
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -232,7 +232,7 @@ var json_loader_default = {
|
|
|
232
232
|
|
|
233
233
|
// dist/lib/init.js
|
|
234
234
|
function checkVersion() {
|
|
235
|
-
const version = true ? "9.2.
|
|
235
|
+
const version = true ? "9.2.4" : globalThis.DECK_VERSION || "untranspiled source";
|
|
236
236
|
const existingVersion = globalThis.deck && globalThis.deck.VERSION;
|
|
237
237
|
if (existingVersion && existingVersion !== version) {
|
|
238
238
|
throw new Error(`deck.gl - multiple versions detected: ${existingVersion} vs ${version}`);
|
|
@@ -6684,9 +6684,10 @@ var TooltipWidget = class extends Widget {
|
|
|
6684
6684
|
}
|
|
6685
6685
|
onViewportChange(viewport) {
|
|
6686
6686
|
var _a;
|
|
6687
|
-
if (this.isVisible && viewport.id === ((_a = this.lastViewport) == null ? void 0 : _a.id) && viewport
|
|
6687
|
+
if (this.isVisible && viewport.id === ((_a = this.lastViewport) == null ? void 0 : _a.id) && !viewport.equals(this.lastViewport)) {
|
|
6688
6688
|
this.setTooltip(null);
|
|
6689
6689
|
}
|
|
6690
|
+
this.lastViewport = viewport;
|
|
6690
6691
|
}
|
|
6691
6692
|
onHover(info) {
|
|
6692
6693
|
const { deck } = this;
|
|
@@ -6695,7 +6696,6 @@ var TooltipWidget = class extends Widget {
|
|
|
6695
6696
|
return;
|
|
6696
6697
|
}
|
|
6697
6698
|
const displayInfo = getTooltip(info);
|
|
6698
|
-
this.lastViewport = info.viewport;
|
|
6699
6699
|
this.setTooltip(displayInfo, info.x, info.y);
|
|
6700
6700
|
}
|
|
6701
6701
|
setTooltip(displayInfo, x, y) {
|
|
@@ -6794,6 +6794,7 @@ var defaultProps = {
|
|
|
6794
6794
|
};
|
|
6795
6795
|
var Deck = class {
|
|
6796
6796
|
constructor(props) {
|
|
6797
|
+
var _a;
|
|
6797
6798
|
this.width = 0;
|
|
6798
6799
|
this.height = 0;
|
|
6799
6800
|
this.userData = {};
|
|
@@ -6887,8 +6888,8 @@ var Deck = class {
|
|
|
6887
6888
|
}
|
|
6888
6889
|
};
|
|
6889
6890
|
this._onPointerDown = (event) => {
|
|
6890
|
-
var
|
|
6891
|
-
if (((
|
|
6891
|
+
var _a2;
|
|
6892
|
+
if (((_a2 = this.device) == null ? void 0 : _a2.type) === "webgpu") {
|
|
6892
6893
|
return;
|
|
6893
6894
|
}
|
|
6894
6895
|
const pos = event.offsetCenter;
|
|
@@ -6913,7 +6914,17 @@ var Deck = class {
|
|
|
6913
6914
|
if (props.gl instanceof WebGLRenderingContext) {
|
|
6914
6915
|
log_default.error("WebGL1 context not supported.")();
|
|
6915
6916
|
}
|
|
6916
|
-
|
|
6917
|
+
const userOnResize = (_a = this.props.deviceProps) == null ? void 0 : _a.onResize;
|
|
6918
|
+
deviceOrPromise = import_webgl.webgl2Adapter.attach(props.gl, {
|
|
6919
|
+
...this.props.deviceProps,
|
|
6920
|
+
onResize: (canvasContext, info) => {
|
|
6921
|
+
const { width, height } = canvasContext.canvas;
|
|
6922
|
+
canvasContext.drawingBufferWidth = width;
|
|
6923
|
+
canvasContext.drawingBufferHeight = height;
|
|
6924
|
+
this._needsRedraw = "Canvas resized";
|
|
6925
|
+
userOnResize == null ? void 0 : userOnResize(canvasContext, info);
|
|
6926
|
+
}
|
|
6927
|
+
});
|
|
6917
6928
|
}
|
|
6918
6929
|
if (!deviceOrPromise) {
|
|
6919
6930
|
deviceOrPromise = this._createDevice(props);
|
|
@@ -6953,7 +6964,7 @@ var Deck = class {
|
|
|
6953
6964
|
}
|
|
6954
6965
|
/** Partially update props */
|
|
6955
6966
|
setProps(props) {
|
|
6956
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
6967
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6957
6968
|
this.stats.get("setProps Time").timeStart();
|
|
6958
6969
|
if ("onLayerHover" in props) {
|
|
6959
6970
|
log_default.removed("onLayerHover", "onHover")();
|
|
@@ -6986,18 +6997,8 @@ var Deck = class {
|
|
|
6986
6997
|
this.animationLoop.start();
|
|
6987
6998
|
}
|
|
6988
6999
|
(_f = this.animationLoop) == null ? void 0 : _f.setProps(resolvedProps);
|
|
6989
|
-
if (props.useDevicePixels !== void 0 && ((
|
|
6990
|
-
this.device.canvasContext.
|
|
6991
|
-
const canvas = this.device.canvasContext.canvas;
|
|
6992
|
-
const entry = {
|
|
6993
|
-
target: canvas,
|
|
6994
|
-
contentBoxSize: [{ inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }],
|
|
6995
|
-
devicePixelContentBoxSize: [
|
|
6996
|
-
{ inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }
|
|
6997
|
-
],
|
|
6998
|
-
borderBoxSize: [{ inlineSize: canvas.clientWidth, blockSize: canvas.clientHeight }]
|
|
6999
|
-
};
|
|
7000
|
-
this.device.canvasContext._handleResize([entry]);
|
|
7000
|
+
if (props.useDevicePixels !== void 0 && ((_g = this.device) == null ? void 0 : _g.canvasContext)) {
|
|
7001
|
+
this.device.canvasContext.setProps({ useDevicePixels: props.useDevicePixels });
|
|
7001
7002
|
}
|
|
7002
7003
|
if (this.layerManager) {
|
|
7003
7004
|
this.viewManager.setProps(resolvedProps);
|
|
@@ -7217,7 +7218,7 @@ var Deck = class {
|
|
|
7217
7218
|
}
|
|
7218
7219
|
// Create a device from the deviceProps, assigning required defaults
|
|
7219
7220
|
_createDevice(props) {
|
|
7220
|
-
var _a, _b;
|
|
7221
|
+
var _a, _b, _c;
|
|
7221
7222
|
const canvasContextUserProps = (_a = this.props.deviceProps) == null ? void 0 : _a.createCanvasContext;
|
|
7222
7223
|
const canvasContextProps = typeof canvasContextUserProps === "object" ? canvasContextUserProps : void 0;
|
|
7223
7224
|
const deviceProps = { adapters: [], ...props.deviceProps };
|
|
@@ -7228,6 +7229,7 @@ var Deck = class {
|
|
|
7228
7229
|
// we must use 'premultiplied' canvas for webgpu to enable transparency and match shaders
|
|
7229
7230
|
alphaMode: ((_b = this.props.deviceProps) == null ? void 0 : _b.type) === "webgpu" ? "premultiplied" : void 0
|
|
7230
7231
|
};
|
|
7232
|
+
const userOnResize = (_c = this.props.deviceProps) == null ? void 0 : _c.onResize;
|
|
7231
7233
|
return import_core14.luma.createDevice({
|
|
7232
7234
|
// luma by default throws if a device is already attached
|
|
7233
7235
|
// asynchronous device creation could happen after finalize() is called
|
|
@@ -7243,6 +7245,10 @@ var Deck = class {
|
|
|
7243
7245
|
canvas: this._createCanvas(props),
|
|
7244
7246
|
useDevicePixels: this.props.useDevicePixels,
|
|
7245
7247
|
autoResize: true
|
|
7248
|
+
},
|
|
7249
|
+
onResize: (canvasContext, info) => {
|
|
7250
|
+
this._needsRedraw = "Canvas resized";
|
|
7251
|
+
userOnResize == null ? void 0 : userOnResize(canvasContext, info);
|
|
7246
7252
|
}
|
|
7247
7253
|
});
|
|
7248
7254
|
}
|