@expofp/floorplan 3.26.0 → 3.27.1
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/browser/{Button-DI5g1CPS.js → Button-KGleP3m4.js} +6 -6
- package/dist/browser/{CookieConsent-Qws_nQ3N.js → CookieConsent-_czkUaUS.js} +8 -8
- package/dist/browser/{Debug-DTNPNDds.js → Debug-bz6KlGgY.js} +8 -8
- package/dist/browser/DebugTools-CHRXev1e.js +1922 -0
- package/dist/browser/{Demo-BDZjOBQc.js → Demo-Duw5xaxW.js} +10 -10
- package/dist/browser/{Free-Cage9TkV.js → Free-CTEgif-b.js} +10 -10
- package/dist/browser/{GalleryContainer-EeLKgziN.js → GalleryContainer-DHLJOPfK.js} +11 -11
- package/dist/browser/{GpsLoader-CJMX_mJN.js → GpsLoader-CJ5KyhZa.js} +34 -34
- package/dist/browser/{KioskStore-BSza48xl.js → KioskStore-BMvlzIQe.js} +58 -107
- package/dist/browser/{MaplibreAdapter-evVQiVQj.js → MaplibreAdapter-YyHtIPQy.js} +2056 -2141
- package/dist/browser/{ModalContainer-CTKDfIyR.js → ModalContainer-DuilVP6n.js} +11 -11
- package/dist/browser/{PermissionNotice-O469DuWb.js → PermissionNotice-C5Z1g99X.js} +7 -7
- package/dist/browser/SetKioskMode-BcAj0bcd.js +48 -0
- package/dist/browser/{ShowKiosk-DumFiuHU.js → ShowKiosk-D7Klhgza.js} +11 -11
- package/dist/browser/{ViewerMenuPanel-ByFemA_T.js → ViewerMenuPanel-apP-IAf0.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-TLumKuSo.js → add-debug-secret-listener-HZVxK64L.js} +1 -1
- package/dist/browser/{adopt-global-settings-ghJrZaU5.js → adopt-global-settings-CWSlkexR.js} +10 -10
- package/dist/browser/{boolean-editor-WIpm-pFP.js → boolean-editor-BcBAWb-G.js} +10 -10
- package/dist/browser/{bootIntercom-BR_Ehbyl.js → bootIntercom-Jil5W-0K.js} +3 -3
- package/dist/browser/bundle.json +77 -65
- package/dist/browser/camera-events-DrdhxgVS.js +18 -0
- package/dist/browser/{classnames-BmlkHMS8.js → classnames-BU0Ok49m.js} +2 -2
- package/dist/browser/{client-CIHxJZmk.js → client-BU_uyO3_.js} +793 -992
- package/dist/browser/{components-7lxOhyyi.js → components-CppHY7O7.js} +1952 -2013
- package/dist/browser/debug-context-C_w9lssh.js +24315 -0
- package/dist/browser/{debug-overlay-B7jCqVlX.js → debug-overlay-fKIQx7R_.js} +11 -11
- package/dist/browser/{debug-ui-D1ApG52e.js → debug-ui-BO_gZvdf.js} +7 -7
- package/dist/browser/dimming-WtGfPnAD.js +1108 -0
- package/dist/browser/{dist-BrF5yJyj.js → dist-BfpVKsX1.js} +6 -6
- package/dist/browser/{dist-C67OkD_4.js → dist-C2P11Xlj.js} +7 -7
- package/dist/browser/{dist-CnpnDA-V.js → dist-PTVsGItC.js} +3 -3
- package/dist/browser/{efp-debug-init-BqEN61Fo.js → efp-debug-init-Ce-CZeeI.js} +4 -4
- package/dist/browser/{enum-editor-Cy6VeZZd.js → enum-editor-CupsYrxs.js} +5 -5
- package/dist/browser/{es5-DyV1fctu.js → es5-DI5LkTYN.js} +2 -2
- package/dist/browser/{event-not-found-BpFVdXz_.js → event-not-found-D4Xi--mZ.js} +1 -1
- package/dist/browser/{exports-C7NzL4lf.js → exports-CePcAVlz.js} +1 -1
- package/dist/browser/{favicon-BHscWjwp.js → favicon-Dcly9HEc.js} +1 -1
- package/dist/browser/{fetch-retry.umd-BytZeydp.js → fetch-retry.umd-dWO0gw3b.js} +2 -2
- package/dist/browser/{flex-BQBLAC6l.js → flex-nmgYIErO.js} +6 -6
- package/dist/browser/{floorplan.loader-DkaQPhwC.js → floorplan.loader-Nb2QDU7l.js} +10 -10
- package/dist/browser/{floorplan.ready-DwuXZphI.js → floorplan.ready-D_9nn960.js} +344 -308
- package/dist/browser/{fuse-DZTwJ52u.js → fuse-s0oxaMyr.js} +2 -2
- package/dist/browser/{i18n-Bcv8xw_q.js → i18n-D0X-IbhS.js} +5 -5
- package/dist/browser/index.js +14 -14
- package/dist/browser/{index.module-BFxDVa3K.js → index.module-CtQP4Qv8.js} +4 -4
- package/dist/browser/{integrateKiosk-VTNZSSfD.js → integrateKiosk-CTKZOTyE.js} +5 -5
- package/dist/browser/{is-webview-CjItzxdV.js → is-webview-C5K2dDqT.js} +1 -1
- package/dist/browser/{jsx-runtime-CT2c-IhD.js → jsx-runtime-hIg99QxI.js} +2 -2
- package/dist/browser/{kiosk-record-v7r7q7t0.js → kiosk-record-BkSt5SU1.js} +1 -1
- package/dist/browser/{lib-DGh8lZgT.js → lib-DyJ1LDRt.js} +3 -3
- package/dist/browser/{loadImage-a_ahClbD.js → loadImage-Chw6Qd0w.js} +4 -4
- package/dist/browser/{logDeviceInfo-DHfa6NcE.js → logDeviceInfo-3jqov_0t.js} +9 -9
- package/dist/browser/{mobx-dAtztuiQ.js → mobx-C29RNezs.js} +7 -7
- package/dist/browser/{optional-boolean-editor-D43-yLO3.js → optional-boolean-editor-DYudule5.js} +4 -4
- package/dist/browser/{optional-enum-editor-Cvn8TV-x.js → optional-enum-editor-CdOjFlrE.js} +5 -5
- package/dist/browser/{optional-string-editor-sY0yVw_j.js → optional-string-editor-DIJigrO5.js} +5 -5
- package/dist/browser/{particles.min-BD7iDSr6.js → particles.min-BZCTScUM.js} +2 -2
- package/dist/browser/{react-BJopqGbW.js → react-D4xfjtF6.js} +2 -2
- package/dist/browser/{react-dom-B77nDdqp.js → react-dom-B6MtngPG.js} +3 -3
- package/dist/browser/{rolldown-runtime-BmHtYG9i.js → rolldown-runtime-hkgDPyCj.js} +1 -1
- package/dist/browser/scheduler-CUIe3W2m.js +212 -0
- package/dist/browser/{select-ByU-Ym6-.js → select-Dt6UIEBZ.js} +11 -11
- package/dist/browser/{settings-CEH1i0Pj.js → settings-CyYgXisa.js} +2 -2
- package/dist/browser/{settings-item-_PTji9Bz.js → settings-item-COIUD8kZ.js} +7 -7
- package/dist/browser/store-C33lZtwI.js +31207 -0
- package/dist/browser/{string-editor-DaF1t7MK.js → string-editor-kOSWCbwh.js} +5 -5
- package/dist/browser/{text-field-XRLZPyNV.js → text-field-DD6CFKaL.js} +6 -6
- package/dist/browser/{theme-D0OZcdto.js → theme-gxjTjrZ9.js} +9 -9
- package/dist/browser/{ui-7ozfXlN3.js → ui-DBItAumt.js} +9 -9
- package/dist/browser/{useRenderTarget-BG295f3e.js → useRenderTarget-DkuQpLE2.js} +5 -5
- package/dist/browser/viewport-A_9Nzrm0.js +41 -0
- package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -2
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Kiosk/SetKioskMode.d.ts +1 -2
- package/dist/esm/components/Kiosk/SetKioskMode.js +1 -1
- package/dist/esm/components/Map/Map.d.ts +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/MapCamera.d.ts +17 -0
- package/dist/esm/components/Map/MapCamera.js +1 -0
- package/dist/esm/components/Map/MapViewport.d.ts +12 -0
- package/dist/esm/components/Map/MapViewport.js +1 -0
- package/dist/esm/components/Map/booth-by-xy.d.ts +13 -0
- package/dist/esm/components/Map/booth-by-xy.js +1 -1
- package/dist/esm/components/Map/camera-events.d.ts +16 -0
- package/dist/esm/components/Map/camera-events.js +1 -0
- package/dist/esm/components/Map/camera.d.ts +48 -0
- package/dist/esm/components/Map/camera.js +1 -0
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +70 -3
- package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +3 -6
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +11 -7
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +16 -3
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +18 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +23 -2
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/layer-images.d.ts +35 -0
- package/dist/esm/components/Map/drawing/config/layer-images.js +1 -0
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +38 -3
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/pointer.d.ts +73 -0
- package/dist/esm/components/Map/pointer.js +1 -0
- package/dist/esm/components/Map/scene.d.ts +20 -0
- package/dist/esm/components/Map/scene.js +1 -0
- package/dist/esm/components/Map/traffic/trafficLayers.d.ts +2 -7
- package/dist/esm/components/Map/traffic/trafficLayers.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Map/viewport.d.ts +63 -0
- package/dist/esm/components/Map/viewport.js +1 -0
- package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +6 -2
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +30 -8
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/useDimming.d.ts +2 -2
- package/dist/esm/components/Maplibre/useDimming.js +1 -1
- package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +5 -6
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
- package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +1 -2
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -5
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
- package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +8 -3
- package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -1
- package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +3 -3
- package/dist/esm/components/Ws.js +1 -1
- package/dist/esm/engine/defs.d.ts +30 -0
- package/dist/esm/engine/defs.js +3 -0
- package/dist/esm/engine/fonts.js +1 -0
- package/dist/esm/engine/update-def.d.ts +52 -0
- package/dist/esm/engine/update-def.js +1 -0
- package/dist/esm/engine/utils/rotation.d.ts +6 -0
- package/dist/esm/engine/utils/rotation.js +1 -0
- package/dist/esm/floorplan.ready.d.ts +2 -0
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +11 -0
- package/dist/esm/store/LayerStore.d.ts +2 -0
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RootStore.d.ts +0 -2
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/details-events.d.ts +11 -0
- package/dist/esm/store/details-events.js +1 -0
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/utils/dimming.d.ts +13 -2
- package/dist/esm/utils/dimming.js +1 -1
- package/dist/esm/utils/mobx.d.ts +2 -2
- package/dist/esm/utils/mobx.js +1 -1
- package/dist/esm/utils/scene-bounds.d.ts +1 -1
- package/dist/esm/utils/scene-bounds.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/createWayfinding.d.ts +19 -2
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/package.json +11 -10
- package/dist/browser/SetKioskMode-DUk4c-Gs.js +0 -57
- package/dist/browser/booth-by-xy-CyZpg1Fn.js +0 -1130
- package/dist/browser/main-sUuehgQu.js +0 -289
- package/dist/browser/store-Oj0dGPnb.js +0 -41431
- package/dist/esm/components/Map/pointInConvexQuad.d.ts +0 -3
- package/dist/esm/components/Map/pointInConvexQuad.js +0 -1
- package/dist/esm/components/Map/visibleArea.d.ts +0 -16
- package/dist/esm/components/Map/visibleArea.js +0 -1
- package/dist/esm/components/Maplibre/useRendererEvents.d.ts +0 -9
- package/dist/esm/components/Maplibre/useRendererEvents.js +0 -1
- package/dist/esm/components/Maplibre/utils/update-pump.d.ts +0 -18
- package/dist/esm/components/Maplibre/utils/update-pump.js +0 -1
- package/dist/esm/renderer/HandlerRegistry.d.ts +0 -18
- package/dist/esm/renderer/HandlerRegistry.js +0 -1
- package/dist/esm/renderer/RendererService.d.ts +0 -44
- package/dist/esm/renderer/RendererService.js +0 -1
- package/dist/esm/renderer/engine-core/defs.d.ts +0 -40
- package/dist/esm/renderer/engine-core/defs.js +0 -3
- package/dist/esm/renderer/engine-core/fonts.js +0 -1
- package/dist/esm/renderer/engine-core/settings.d.ts +0 -4
- package/dist/esm/renderer/engine-core/settings.js +0 -1
- package/dist/esm/renderer/engine-core/types.d.ts +0 -50
- package/dist/esm/renderer/engine-core/types.js +0 -1
- package/dist/esm/renderer/engine-core/update-def.d.ts +0 -12
- package/dist/esm/renderer/engine-core/update-def.js +0 -1
- package/dist/esm/renderer/engine-core/utils/rotation.d.ts +0 -17
- package/dist/esm/renderer/engine-core/utils/rotation.js +0 -1
- package/dist/esm/renderer/index.d.ts +0 -19
- package/dist/esm/renderer/index.js +0 -1
- /package/dist/esm/{renderer/engine-core → engine}/canvases.d.ts +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/canvases.js +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/fonts.d.ts +0 -0
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/stats-gl@3.8.0_three@0.184.0/node_modules/stats-gl/dist/panel.js
|
|
2
|
-
(function() {
|
|
3
|
-
try {
|
|
4
|
-
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
5
|
-
e.SENTRY_RELEASE = { id: "3.26.0" };
|
|
6
|
-
var t = new e.Error().stack;
|
|
7
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "533bf5ba-d354-4779-8c53-27d3e917165a", e._sentryDebugIdIdentifier = "sentry-dbid-533bf5ba-d354-4779-8c53-27d3e917165a");
|
|
8
|
-
} catch {}
|
|
9
|
-
})();
|
|
10
|
-
var e = class {
|
|
11
|
-
constructor(e, t, n) {
|
|
12
|
-
this.id = 0, this.name = e, this.fg = t, this.bg = n, this.gradient = null, this.PR = Math.round(window.devicePixelRatio || 1), this.WIDTH = 90 * this.PR, this.HEIGHT = 48 * this.PR, this.TEXT_X = 3 * this.PR, this.TEXT_Y = 2 * this.PR, this.GRAPH_X = 3 * this.PR, this.GRAPH_Y = 15 * this.PR, this.GRAPH_WIDTH = 84 * this.PR, this.GRAPH_HEIGHT = 30 * this.PR, this.canvas = document.createElement("canvas"), this.canvas.width = this.WIDTH, this.canvas.height = this.HEIGHT, this.canvas.style.width = "90px", this.canvas.style.height = "48px", this.canvas.style.position = "absolute", this.canvas.style.cssText = "width:90px;height:48px;background-color: transparent !important;", this.context = this.canvas.getContext("2d"), this.initializeCanvas();
|
|
13
|
-
}
|
|
14
|
-
createGradient() {
|
|
15
|
-
if (!this.context) throw Error("No context");
|
|
16
|
-
let e = this.context.createLinearGradient(0, this.GRAPH_Y, 0, this.GRAPH_Y + this.GRAPH_HEIGHT), t, n = this.fg;
|
|
17
|
-
switch (this.fg.toLowerCase()) {
|
|
18
|
-
case "#0ff":
|
|
19
|
-
t = "#006666";
|
|
20
|
-
break;
|
|
21
|
-
case "#0f0":
|
|
22
|
-
t = "#006600";
|
|
23
|
-
break;
|
|
24
|
-
case "#ff0":
|
|
25
|
-
t = "#666600";
|
|
26
|
-
break;
|
|
27
|
-
case "#e1e1e1":
|
|
28
|
-
t = "#666666";
|
|
29
|
-
break;
|
|
30
|
-
default:
|
|
31
|
-
t = this.bg;
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
return e.addColorStop(0, t), e.addColorStop(1, n), e;
|
|
35
|
-
}
|
|
36
|
-
initializeCanvas() {
|
|
37
|
-
this.context && (this.context.imageSmoothingEnabled = !1, this.context.font = "bold " + 9 * this.PR + "px Helvetica,Arial,sans-serif", this.context.textBaseline = "top", this.gradient = this.createGradient(), this.context.fillStyle = this.bg, this.context.fillRect(0, 0, this.WIDTH, this.HEIGHT), this.context.fillStyle = this.fg, this.context.fillText(this.name, this.TEXT_X, this.TEXT_Y), this.context.fillStyle = this.bg, this.context.globalAlpha = .9, this.context.fillRect(this.GRAPH_X, this.GRAPH_Y, this.GRAPH_WIDTH, this.GRAPH_HEIGHT));
|
|
38
|
-
}
|
|
39
|
-
update(e, t, n = 0) {
|
|
40
|
-
if (!this.context || !this.gradient) return;
|
|
41
|
-
let r = Math.min(Infinity, e), i = Math.max(t, e);
|
|
42
|
-
this.context.globalAlpha = 1, this.context.fillStyle = this.bg, this.context.fillRect(0, 0, this.WIDTH, this.GRAPH_Y), this.context.fillStyle = this.fg, this.context.fillText(`${e.toFixed(n)} ${this.name} (${r.toFixed(n)}-${parseFloat(i.toFixed(n))})`, this.TEXT_X, this.TEXT_Y);
|
|
43
|
-
}
|
|
44
|
-
updateGraph(e, t) {
|
|
45
|
-
if (!this.context || !this.gradient) return;
|
|
46
|
-
e === 0 && t === 0 && (t = 1), t = Math.max(t, e, .1), e = Math.max(e, 0);
|
|
47
|
-
let n = Math.round(this.GRAPH_X), r = Math.round(this.GRAPH_Y), i = Math.round(this.GRAPH_WIDTH), a = Math.round(this.GRAPH_HEIGHT), o = Math.round(this.PR);
|
|
48
|
-
this.context.drawImage(this.canvas, n + o, r, i - o, a, n, r, i - o, a), this.context.fillStyle = this.bg, this.context.fillRect(n + i - o, r, o, a);
|
|
49
|
-
let s = Math.min(a, Math.round(e / t * a));
|
|
50
|
-
s > 0 && (this.context.globalAlpha = .9, this.context.fillStyle = this.gradient, this.context.fillRect(n + i - o, r + (a - s), o, s)), this.context.globalAlpha = 1;
|
|
51
|
-
}
|
|
52
|
-
}, t = class extends e {
|
|
53
|
-
constructor(e, t, n) {
|
|
54
|
-
super(e, t, n), this.vsyncValue = 0, this.SMALL_HEIGHT = 9 * this.PR, this.HEIGHT = this.SMALL_HEIGHT, this.WIDTH = 35 * this.PR, this.TEXT_Y = 0 * this.PR, this.canvas.height = this.HEIGHT, this.canvas.width = this.WIDTH, this.canvas.style.height = "9px", this.canvas.style.width = "35px", this.canvas.style.cssText = "\n width: 35px;\n height: 9px;\n position: absolute;\n top: 0;\n left: 0;\n background-color: transparent !important;\n pointer-events: none;\n ", this.initializeCanvas();
|
|
55
|
-
}
|
|
56
|
-
initializeCanvas() {
|
|
57
|
-
this.context && (this.context.imageSmoothingEnabled = !1, this.context.font = "bold " + 9 * this.PR + "px Helvetica,Arial,sans-serif", this.context.textBaseline = "top", this.context.globalAlpha = 1);
|
|
58
|
-
}
|
|
59
|
-
update(e, t, n = 0) {
|
|
60
|
-
this.context && (this.vsyncValue = e, this.context.clearRect(0, 0, this.WIDTH, this.HEIGHT), this.context.globalAlpha = 1, this.context.fillStyle = this.bg, this.context.fillText(`${e.toFixed(0)}Hz`, this.TEXT_X, this.TEXT_Y));
|
|
61
|
-
}
|
|
62
|
-
updateGraph(e, t) {}
|
|
63
|
-
setOffset(e, t) {
|
|
64
|
-
this.canvas.style.transform = `translate(${e}px, ${t}px)`;
|
|
65
|
-
}
|
|
66
|
-
}, n = class e {
|
|
67
|
-
constructor({ trackGPU: n = !1, trackCPT: r = !1, trackHz: i = !1, trackFPS: a = !0, logsPerSecond: o = 4, graphsPerSecond: s = 30, samplesLog: c = 40, samplesGraph: l = 10, precision: u = 2, minimal: d = !1, horizontal: f = !0, mode: p = 0 } = {}) {
|
|
68
|
-
this.gl = null, this.ext = null, this.activeQuery = null, this.gpuQueries = [], this.threeRendererPatched = !1, this.frameTimes = [], this.renderCount = 0, this.totalCpuDuration = 0, this.totalGpuDuration = 0, this.totalGpuDurationCompute = 0, this.fpsPanel = null, this.msPanel = null, this.gpuPanel = null, this.gpuPanelCompute = null, this.vsyncPanel = null, this.averageFps = {
|
|
69
|
-
logs: [],
|
|
70
|
-
graph: []
|
|
71
|
-
}, this.averageCpu = {
|
|
72
|
-
logs: [],
|
|
73
|
-
graph: []
|
|
74
|
-
}, this.averageGpu = {
|
|
75
|
-
logs: [],
|
|
76
|
-
graph: []
|
|
77
|
-
}, this.averageGpuCompute = {
|
|
78
|
-
logs: [],
|
|
79
|
-
graph: []
|
|
80
|
-
}, this.updateCounter = 0, this.lastMin = {}, this.lastMax = {}, this.lastValue = {}, this.VSYNC_RATES = [
|
|
81
|
-
{
|
|
82
|
-
refreshRate: 60,
|
|
83
|
-
frameTime: 16.67
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
refreshRate: 75,
|
|
87
|
-
frameTime: 13.33
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
refreshRate: 90,
|
|
91
|
-
frameTime: 11.11
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
refreshRate: 120,
|
|
95
|
-
frameTime: 8.33
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
refreshRate: 144,
|
|
99
|
-
frameTime: 6.94
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
refreshRate: 165,
|
|
103
|
-
frameTime: 6.06
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
refreshRate: 240,
|
|
107
|
-
frameTime: 4.17
|
|
108
|
-
}
|
|
109
|
-
], this.detectedVSync = null, this.frameTimeHistory = [], this.HISTORY_SIZE = 120, this.VSYNC_THRESHOLD = .05, this.lastFrameTime = 0, this.handleClick = (e) => {
|
|
110
|
-
e.preventDefault(), this.showPanel(++this.mode % this.dom.children.length);
|
|
111
|
-
}, this.handleResize = () => {
|
|
112
|
-
this.fpsPanel && this.resizePanel(this.fpsPanel), this.msPanel && this.resizePanel(this.msPanel), this.gpuPanel && this.resizePanel(this.gpuPanel), this.gpuPanelCompute && this.resizePanel(this.gpuPanelCompute);
|
|
113
|
-
}, this.mode = p, this.horizontal = f, this.minimal = d, this.trackGPU = n, this.trackCPT = r, this.trackHz = i, this.trackFPS = a, this.samplesLog = c, this.samplesGraph = l, this.precision = u, this.logsPerSecond = o, this.graphsPerSecond = s;
|
|
114
|
-
let m = performance.now();
|
|
115
|
-
this.prevGraphTime = m, this.dom = document.createElement("div"), this.initializeDOM(), this.beginTime = performance.now(), this.prevTextTime = this.beginTime, this.prevCpuTime = this.beginTime, this._panelId = 0, this.trackFPS && (this.fpsPanel = this.addPanel(new e.Panel("FPS", "#0ff", "#002")), this.msPanel = this.addPanel(new e.Panel("CPU", "#0f0", "#020"))), this.trackHz === !0 && (this.vsyncPanel = new t("", "#f0f", "#202"), this.dom.appendChild(this.vsyncPanel.canvas), this.vsyncPanel.setOffset(56, 35)), this.setupEventListeners();
|
|
116
|
-
}
|
|
117
|
-
initializeDOM() {
|
|
118
|
-
this.dom.style.cssText = `
|
|
119
|
-
position: fixed;
|
|
120
|
-
top: 0;
|
|
121
|
-
left: 0;
|
|
122
|
-
opacity: 0.9;
|
|
123
|
-
z-index: 10000;
|
|
124
|
-
${this.minimal ? "cursor: pointer;" : ""}
|
|
125
|
-
`;
|
|
126
|
-
}
|
|
127
|
-
setupEventListeners() {
|
|
128
|
-
this.minimal ? (this.dom.addEventListener("click", this.handleClick), this.showPanel(this.mode)) : window.addEventListener("resize", this.handleResize);
|
|
129
|
-
}
|
|
130
|
-
async init(e) {
|
|
131
|
-
if (!e) {
|
|
132
|
-
console.error("Stats: The \"canvas\" parameter is undefined.");
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
if (!this.handleThreeRenderer(e) && !await this.handleWebGPURenderer(e)) if (this.initializeWebGL(e)) {
|
|
136
|
-
this.trackGPU && this.initializeGPUTracking();
|
|
137
|
-
return;
|
|
138
|
-
} else console.error("Stats-gl: Failed to initialize WebGL context");
|
|
139
|
-
}
|
|
140
|
-
handleThreeRenderer(e) {
|
|
141
|
-
return e.isWebGLRenderer && !this.threeRendererPatched ? (this.patchThreeRenderer(e), this.gl = e.getContext(), this.trackGPU && this.initializeGPUTracking(), !0) : !1;
|
|
142
|
-
}
|
|
143
|
-
async handleWebGPURenderer(e) {
|
|
144
|
-
return e.isWebGPURenderer ? ((this.trackGPU || this.trackCPT) && (e.backend.trackTimestamp = !0, e._initialized || await e.init(), e.hasFeature("timestamp-query") && this.initializeWebGPUPanels()), this.info = e.info, this.patchThreeWebGPU(e), !0) : !1;
|
|
145
|
-
}
|
|
146
|
-
initializeWebGPUPanels() {
|
|
147
|
-
this.trackGPU && (this.gpuPanel = this.addPanel(new e.Panel("GPU", "#ff0", "#220"))), this.trackCPT && (this.gpuPanelCompute = this.addPanel(new e.Panel("CPT", "#e1e1e1", "#212121")));
|
|
148
|
-
}
|
|
149
|
-
initializeWebGL(e) {
|
|
150
|
-
if (e instanceof WebGL2RenderingContext) this.gl = e;
|
|
151
|
-
else if (e instanceof HTMLCanvasElement || e instanceof OffscreenCanvas) {
|
|
152
|
-
if (this.gl = e.getContext("webgl2"), !this.gl) return console.error("Stats: Unable to obtain WebGL2 context."), !1;
|
|
153
|
-
} else return console.error("Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas."), !1;
|
|
154
|
-
return !0;
|
|
155
|
-
}
|
|
156
|
-
initializeGPUTracking() {
|
|
157
|
-
this.gl && (this.ext = this.gl.getExtension("EXT_disjoint_timer_query_webgl2"), this.ext && (this.gpuPanel = this.addPanel(new e.Panel("GPU", "#ff0", "#220"))));
|
|
158
|
-
}
|
|
159
|
-
begin() {
|
|
160
|
-
this.beginProfiling("cpu-started"), !(!this.gl || !this.ext) && (this.activeQuery && this.gl.endQuery(this.ext.TIME_ELAPSED_EXT), this.activeQuery = this.gl.createQuery(), this.activeQuery && this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT, this.activeQuery));
|
|
161
|
-
}
|
|
162
|
-
end() {
|
|
163
|
-
this.renderCount++, this.gl && this.ext && this.activeQuery && (this.gl.endQuery(this.ext.TIME_ELAPSED_EXT), this.gpuQueries.push({ query: this.activeQuery }), this.activeQuery = null), this.endProfiling("cpu-started", "cpu-finished", "cpu-duration");
|
|
164
|
-
}
|
|
165
|
-
update() {
|
|
166
|
-
this.endProfiling("cpu-started", "cpu-finished", "cpu-duration"), this.info ? this.processWebGPUTimestamps() : this.processGpuQueries(), this.updateAverages(), this.resetCounters();
|
|
167
|
-
}
|
|
168
|
-
processWebGPUTimestamps() {
|
|
169
|
-
this.totalGpuDuration = this.info.render.timestamp, this.totalGpuDurationCompute = this.info.compute.timestamp;
|
|
170
|
-
}
|
|
171
|
-
resetCounters() {
|
|
172
|
-
this.renderCount = 0, this.totalCpuDuration = 0, this.beginTime = this.endInternal();
|
|
173
|
-
}
|
|
174
|
-
resizePanel(e) {
|
|
175
|
-
e.canvas.style.position = "absolute", this.minimal ? e.canvas.style.display = "none" : (e.canvas.style.display = "block", this.horizontal ? (e.canvas.style.top = "0px", e.canvas.style.left = e.id * e.WIDTH / e.PR + "px") : (e.canvas.style.left = "0px", e.canvas.style.top = e.id * e.HEIGHT / e.PR + "px"));
|
|
176
|
-
}
|
|
177
|
-
addPanel(e) {
|
|
178
|
-
return e.canvas && (this.dom.appendChild(e.canvas), e.id = this._panelId, this.resizePanel(e), this._panelId++), e;
|
|
179
|
-
}
|
|
180
|
-
showPanel(e) {
|
|
181
|
-
for (let t = 0; t < this.dom.children.length; t++) {
|
|
182
|
-
let n = this.dom.children[t];
|
|
183
|
-
n.style.display = t === e ? "block" : "none";
|
|
184
|
-
}
|
|
185
|
-
this.mode = e;
|
|
186
|
-
}
|
|
187
|
-
processGpuQueries() {
|
|
188
|
-
!this.gl || !this.ext || (this.totalGpuDuration = 0, this.gpuQueries.forEach((e, t) => {
|
|
189
|
-
if (this.gl) {
|
|
190
|
-
let n = this.gl.getQueryParameter(e.query, this.gl.QUERY_RESULT_AVAILABLE), r = this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);
|
|
191
|
-
if (n && !r) {
|
|
192
|
-
let n = this.gl.getQueryParameter(e.query, this.gl.QUERY_RESULT) * 1e-6;
|
|
193
|
-
this.totalGpuDuration += n, this.gl.deleteQuery(e.query), this.gpuQueries.splice(t, 1);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
detectVSync(e) {
|
|
199
|
-
if (this.lastFrameTime === 0) {
|
|
200
|
-
this.lastFrameTime = e;
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
let t = e - this.lastFrameTime;
|
|
204
|
-
if (this.lastFrameTime = e, this.frameTimeHistory.push(t), this.frameTimeHistory.length > this.HISTORY_SIZE && this.frameTimeHistory.shift(), this.frameTimeHistory.length < 60) return;
|
|
205
|
-
let n = this.frameTimeHistory.reduce((e, t) => e + t) / this.frameTimeHistory.length, r = this.frameTimeHistory.reduce((e, t) => e + (t - n) ** 2, 0) / this.frameTimeHistory.length;
|
|
206
|
-
if (Math.sqrt(r) > 2) {
|
|
207
|
-
this.detectedVSync = null;
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
let i = null, a = Infinity;
|
|
211
|
-
for (let e of this.VSYNC_RATES) {
|
|
212
|
-
let t = Math.abs(n - e.frameTime);
|
|
213
|
-
t < a && (a = t, i = e);
|
|
214
|
-
}
|
|
215
|
-
i && a / i.frameTime <= this.VSYNC_THRESHOLD ? this.detectedVSync = i : this.detectedVSync = null;
|
|
216
|
-
}
|
|
217
|
-
endInternal() {
|
|
218
|
-
var e;
|
|
219
|
-
let t = performance.now();
|
|
220
|
-
for (this.frameTimes.push(t); this.frameTimes.length > 0 && this.frameTimes[0] <= t - 1e3;) this.frameTimes.shift();
|
|
221
|
-
let n = Math.round(this.frameTimes.length);
|
|
222
|
-
this.addToAverage(n, this.averageFps);
|
|
223
|
-
let r = t >= this.prevTextTime + 1e3 / this.logsPerSecond, i = t >= this.prevGraphTime + 1e3 / this.graphsPerSecond;
|
|
224
|
-
if (this.updatePanelComponents(this.fpsPanel, this.averageFps, 0, r, i), this.updatePanelComponents(this.msPanel, this.averageCpu, this.precision, r, i), this.gpuPanel && this.updatePanelComponents(this.gpuPanel, this.averageGpu, this.precision, r, i), this.trackCPT && this.gpuPanelCompute && this.updatePanelComponents(this.gpuPanelCompute, this.averageGpuCompute, this.precision, r, i), r && (this.prevTextTime = t), i && (this.prevGraphTime = t), this.vsyncPanel !== null) {
|
|
225
|
-
this.detectVSync(t);
|
|
226
|
-
let n = ((e = this.detectedVSync) == null ? void 0 : e.refreshRate) || 0;
|
|
227
|
-
r && n > 0 && this.vsyncPanel.update(n, n);
|
|
228
|
-
}
|
|
229
|
-
return t;
|
|
230
|
-
}
|
|
231
|
-
updatePanelComponents(e, t, n, r, i) {
|
|
232
|
-
if (!e || t.logs.length === 0) return;
|
|
233
|
-
e.name in this.lastMin || (this.lastMin[e.name] = Infinity, this.lastMax[e.name] = 0, this.lastValue[e.name] = 0);
|
|
234
|
-
let a = t.logs[t.logs.length - 1];
|
|
235
|
-
this.lastMax[e.name] = Math.max(...t.logs), this.lastMin[e.name] = Math.min(this.lastMin[e.name], a), this.lastValue[e.name] = this.lastValue[e.name] * .7 + a * .3;
|
|
236
|
-
let o = Math.max(Math.max(...t.logs), ...t.graph.slice(-this.samplesGraph));
|
|
237
|
-
this.updateCounter++, r && e.update(this.lastValue[e.name], this.lastMax[e.name], n), i && e.updateGraph(a, o);
|
|
238
|
-
}
|
|
239
|
-
beginProfiling(e) {
|
|
240
|
-
if (window.performance) try {
|
|
241
|
-
window.performance.clearMarks(e), window.performance.mark(e);
|
|
242
|
-
} catch (e) {
|
|
243
|
-
console.debug("Stats: Performance marking failed:", e);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
endProfiling(e, t, n) {
|
|
247
|
-
if (!(!window.performance || !t || !e)) try {
|
|
248
|
-
window.performance.getEntriesByName(e, "mark").length === 0 && this.beginProfiling(e), window.performance.clearMarks(t), window.performance.mark(t), window.performance.clearMeasures(n);
|
|
249
|
-
let r = performance.measure(n, e, t);
|
|
250
|
-
this.totalCpuDuration += r.duration, window.performance.clearMarks(e), window.performance.clearMarks(t), window.performance.clearMeasures(n);
|
|
251
|
-
} catch (e) {
|
|
252
|
-
console.debug("Stats: Performance measurement failed:", e);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
updatePanel(e, t, n = 2) {
|
|
256
|
-
if (!e || t.logs.length === 0) return;
|
|
257
|
-
let r = performance.now();
|
|
258
|
-
e.name in this.lastMin || (this.lastMin[e.name] = Infinity, this.lastMax[e.name] = 0, this.lastValue[e.name] = 0);
|
|
259
|
-
let i = t.logs[t.logs.length - 1], a = Math.max(...t.logs.slice(-30));
|
|
260
|
-
this.lastMin[e.name] = Math.min(this.lastMin[e.name], i), this.lastMax[e.name] = Math.max(this.lastMax[e.name], i), this.lastValue[e.name] = this.lastValue[e.name] * .7 + i * .3;
|
|
261
|
-
let o = Math.max(a, ...t.graph.slice(-this.samplesGraph));
|
|
262
|
-
this.updateCounter++, this.updateCounter % (this.logsPerSecond * 2) == 0 && (this.lastMax[e.name] = a, this.lastMin[e.name] = i), e.update && (r >= this.prevCpuTime + 1e3 / this.logsPerSecond && e.update(this.lastValue[e.name], i, this.lastMax[e.name], o, n), r >= this.prevGraphTime + 1e3 / this.graphsPerSecond && (e.updateGraph(i, o), this.prevGraphTime = r));
|
|
263
|
-
}
|
|
264
|
-
updateAverages() {
|
|
265
|
-
this.addToAverage(this.totalCpuDuration, this.averageCpu), this.addToAverage(this.totalGpuDuration, this.averageGpu), this.info && this.totalGpuDurationCompute !== void 0 && this.addToAverage(this.totalGpuDurationCompute, this.averageGpuCompute);
|
|
266
|
-
}
|
|
267
|
-
addToAverage(e, t) {
|
|
268
|
-
t.logs.push(e), t.logs.length > this.samplesLog && (t.logs = t.logs.slice(-this.samplesLog)), t.graph.push(e), t.graph.length > this.samplesGraph && (t.graph = t.graph.slice(-this.samplesGraph));
|
|
269
|
-
}
|
|
270
|
-
get domElement() {
|
|
271
|
-
return this.dom;
|
|
272
|
-
}
|
|
273
|
-
patchThreeWebGPU(e) {
|
|
274
|
-
let t = e.info.reset, n = this;
|
|
275
|
-
e.info.reset = function() {
|
|
276
|
-
n.beginProfiling("cpu-started"), t.call(this);
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
patchThreeRenderer(e) {
|
|
280
|
-
let t = e.render, n = this;
|
|
281
|
-
e.render = function(e, r) {
|
|
282
|
-
n.begin(), t.call(this, e, r), n.end();
|
|
283
|
-
}, this.threeRendererPatched = !0;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
n.Panel = e;
|
|
287
|
-
var r = n;
|
|
288
|
-
//#endregion
|
|
289
|
-
export { r as default };
|