@expofp/floorplan 3.7.16 → 3.8.0
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-CjtFTyzR.js → Button-1J9oictV.js} +5 -5
- package/dist/browser/{CookieConsent-CxzQ4NKQ.js → CookieConsent-DIB9ja_x.js} +7 -7
- package/dist/browser/{Debug-sUGx7yjo.js → Debug-Dj0pjQgz.js} +7 -7
- package/dist/browser/{Demo-DJkxdhsK.js → Demo-DFFTbr3B.js} +9 -9
- package/dist/browser/{Free-CMj5_sOK.js → Free-VNovKWeM.js} +9 -9
- package/dist/browser/{Gallery-CO2oAxhp.js → Gallery-CsjJODa1.js} +9 -9
- package/dist/browser/{GpsLoader-GENe0D-6.js → GpsLoader-LtDTQ04B.js} +25 -25
- package/dist/browser/{KioskStore-D0To4HWV.js → KioskStore-BlqVE5Em.js} +26 -26
- package/dist/browser/{MaplibreAdapter-DHXfG9I7.js → MaplibreAdapter-BdhppB5g.js} +941 -960
- package/dist/browser/{ModalContainer-DJXx-Dpp.js → ModalContainer-B3TzgHkN.js} +10 -10
- package/dist/browser/{PermissionNotice-Cr9iy6ED.js → PermissionNotice-CFzmPPcM.js} +6 -6
- package/dist/browser/{SetKioskMode-jQmIPKPu.js → SetKioskMode-BmGR1XVY.js} +11 -11
- package/dist/browser/ShowKiosk-zlmmcHhV.js +28 -0
- package/dist/browser/{TouchHand-CSDv-0f5.js → TouchHand-CJVe9zjZ.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-DHdJQRhs.js → ViewerMenuPanel-BWULAn9z.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-DjsOy3Gq.js → add-debug-secret-listener-BmN449zK.js} +1 -1
- package/dist/browser/{boolean-editor-D8afncMt.js → boolean-editor-DfnwzSdd.js} +9 -9
- package/dist/browser/{bootIntercom-CSWtIMFV.js → bootIntercom-Dm7ltiQq.js} +2 -2
- package/dist/browser/{browser-jkQElf_j.js → browser-BHxQ7Crl.js} +2 -2
- package/dist/browser/bundle.json +61 -61
- package/dist/browser/{classnames-DerROiP3.js → classnames-CYIl-Aml.js} +2 -2
- package/dist/browser/{client-Vh95j-4Q.js → client-C9cyInZ3.js} +4 -4
- package/dist/browser/{components-B84vWumL.js → components-CGrjy21U.js} +1680 -1684
- package/dist/browser/{createWayfinding-CvBZJycA.js → createWayfinding-BiBK6J8p.js} +513 -494
- package/dist/browser/{debug-overlay-2VT9jNwO.js → debug-overlay-DDKkKZ7_.js} +10 -10
- package/dist/browser/{debug-ui-B1rCZ_20.js → debug-ui-CKdNfGUm.js} +6 -6
- package/dist/browser/{dist-B1GjLRER.js → dist-Dveh_M6J.js} +3 -3
- package/dist/browser/{dist-DlO0STw3.js → dist-Sr-nbWel.js} +6 -6
- package/dist/browser/{dist-CzB3q54J.js → dist-Y5bXC6OR.js} +5 -5
- package/dist/browser/{efp-debug-init-DHecVGAB.js → efp-debug-init-QlttX6qg.js} +2 -2
- package/dist/browser/{enum-editor-CYok5EWK.js → enum-editor-D8AUxIjM.js} +11 -11
- package/dist/browser/{es5-B6ZCP3Nf.js → es5-DM_2dLMc.js} +2 -2
- package/dist/browser/{event-not-found-CnZ50wHB.js → event-not-found-BzZrJTbo.js} +1 -1
- package/dist/browser/{exports-Bkiz-xsy.js → exports-C77c46fn.js} +1 -1
- package/dist/browser/{favicon-CnAVgZ0M.js → favicon-CLXnJgR0.js} +1 -1
- package/dist/browser/{fetch-retry.umd-DBGHQyaB.js → fetch-retry.umd-DIeR-B1a.js} +2 -2
- package/dist/browser/{flex-D4pQUlUP.js → flex-B9_T4ILl.js} +5 -5
- package/dist/browser/{floorplan.loader-cJkA6gUT.js → floorplan.loader-DBLUmBct.js} +11 -11
- package/dist/browser/{floorplan.ready-2H0Etexv.js → floorplan.ready-C_Yqubo7.js} +303 -227
- package/dist/browser/{fuse-DchetBTf.js → fuse-BA9FAI84.js} +2 -2
- package/dist/browser/{i18n-BxzWqmMz.js → i18n-i9ni8Aks.js} +4 -4
- package/dist/browser/index.js +12 -12
- package/dist/browser/{index.module-c39ZrI4i.js → index.module-DPZn4TXU.js} +4 -4
- package/dist/browser/{is-webview-Cf05uzxP.js → is-webview-Dy8i33Cj.js} +1 -1
- package/dist/browser/{jsx-runtime-CpBZ_Xu9.js → jsx-runtime-DzGUGvz-.js} +2 -2
- package/dist/browser/{lib-BLeI_T8z.js → lib-BHciLO67.js} +4 -4
- package/dist/browser/{loadImage-D0OiaH3g.js → loadImage-Kl5pv_Gu.js} +4 -4
- package/dist/browser/{logDeviceInfo-pCQ1SwDY.js → logDeviceInfo-CS0Fd9Bz.js} +9 -9
- package/dist/browser/{main-BQOT4eqL.js → main-CnhK8g8p.js} +1 -1
- package/dist/browser/{mobx-CR2pTm02.js → mobx-MDNY-J4R.js} +4 -4
- package/dist/browser/{particles.min-CNUDOoq0.js → particles.min-BfWO2YCb.js} +2 -2
- package/dist/browser/{prop-types-BOYxjTWi.js → prop-types-8OQVQO5z.js} +2 -2
- package/dist/browser/{react-CIU0fTyL.js → react-BHziDcUN.js} +2 -2
- package/dist/browser/{react-dom-BYBThAht.js → react-dom-B2YH_-FW.js} +3 -3
- package/dist/browser/{reset-all-settings-BhzcLM6d.js → reset-all-settings-DhiQzgYR.js} +7 -7
- package/dist/browser/{rolldown-runtime-BbFBHYUl.js → rolldown-runtime-kNW8iHBm.js} +1 -1
- package/dist/browser/{settings-3mNrotnD.js → settings-Cu5Wcs8p.js} +2 -2
- package/dist/browser/{settings-item-DNQSLrXW.js → settings-item-v4B4uQdw.js} +6 -6
- package/dist/browser/{store-CbkLKghg.js → store-pynNgMKs.js} +5842 -5757
- package/dist/browser/{string-editor-DbizsPe5.js → string-editor-DpTkbez0.js} +7 -7
- package/dist/browser/{theme-CSXyl6GN.js → theme-BOa5CSxW.js} +8 -8
- package/dist/browser/{ui-D8gVz9vz.js → ui-Bq-HLu6b.js} +8 -8
- package/dist/browser/{useRenderTarget-Bzj4QCqf.js → useRenderTarget-l4FhOrhr.js} +4 -4
- package/dist/esm/components/LevelSelector.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/booth-by-xy.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
- 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 +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- 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 +1 -2
- 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 +4 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +10 -4
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.js +5 -5
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/useCameraReactions.d.ts +2 -2
- package/dist/esm/components/Maplibre/useCameraReactions.js +1 -1
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
- package/dist/esm/components/Maplibre/utils/geo-config.d.ts +6 -6
- package/dist/esm/components/Maplibre/utils/geo-config.js +1 -1
- package/dist/esm/components/Maplibre/utils/solver.js +1 -1
- package/dist/esm/components/gps/useUserLocationAndHeading.d.ts +1 -1
- package/dist/esm/components/gps/useUserLocationAndHeading.js +1 -1
- package/dist/esm/components/gps/utils.d.ts +1 -1
- package/dist/esm/components/gps/utils.js +1 -1
- package/dist/esm/data/svg.d.ts +4 -4
- package/dist/esm/data/svg.js +1 -1
- package/dist/esm/floorplan.ready.d.ts +39 -2
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/renderer/engine-core/canvases.d.ts +1 -1
- package/dist/esm/renderer/engine-core/canvases.js +1 -1
- package/dist/esm/renderer/engine-core/defs.d.ts +23 -4
- package/dist/esm/renderer/engine-core/defs.js +3 -3
- package/dist/esm/renderer/engine-core/types.d.ts +13 -2
- package/dist/esm/renderer/engine-core/update-def.d.ts +3 -2
- package/dist/esm/renderer/engine-core/update-def.js +1 -1
- package/dist/esm/renderer/engine-core/utils/rotation.d.ts +13 -1
- package/dist/esm/renderer/index.d.ts +2 -2
- package/dist/esm/renderer/index.js +1 -1
- package/dist/esm/services/routing.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +14 -2
- package/dist/esm/store/BoothStore.js +1 -1
- package/dist/esm/store/LayerStore.d.ts +4 -4
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +3 -3
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.d.ts +6 -7
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/store/init/init-layers.js +1 -1
- package/dist/esm/store/init/init-ui.js +1 -1
- package/dist/esm/utils/gps.d.ts +0 -1
- package/dist/esm/utils/gps.js +1 -1
- package/dist/esm/utils/imageloader.d.ts +1 -3
- package/dist/esm/utils/imageloader.js +1 -1
- package/dist/esm/utils/math.d.ts +0 -1
- package/dist/esm/utils/math.js +1 -1
- package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +4 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -1
- package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.d.ts +7 -6
- package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.js +1 -1
- package/dist/esm/wayfinding/core/graph/constants.d.ts +16 -2
- package/dist/esm/wayfinding/core/graph/constants.js +1 -1
- package/dist/esm/wayfinding/core/graph/graphHelpers.js +1 -1
- package/dist/esm/wayfinding/core/graph/linkCost.js +1 -1
- package/dist/esm/wayfinding/core/graph/pathfinder/aStarPathFinder.js +1 -1
- package/dist/esm/wayfinding/core/index.d.ts +0 -1
- package/dist/esm/wayfinding/core/position/distanceToRoute.d.ts +1 -1
- package/dist/esm/wayfinding/core/position/distanceToRoute.js +1 -1
- package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -1
- package/dist/esm/wayfinding/core/position/rerouteController.d.ts +1 -1
- package/dist/esm/wayfinding/core/position/rerouteController.js +1 -1
- package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -1
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.d.ts +2 -2
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.js +1 -1
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.d.ts +1 -1
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.js +1 -1
- package/dist/esm/wayfinding/core/rendering/routeGeometry.d.ts +4 -8
- package/dist/esm/wayfinding/core/rendering/routeGeometry.js +1 -1
- package/dist/esm/wayfinding/core/routing/getRouteLength.js +1 -1
- package/dist/esm/wayfinding/core/types.d.ts +3 -2
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
- package/dist/esm/wayfinding/renderer/iconManager.js +1 -1
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
- package/dist/esm/wayfinding/runtime/positionView.d.ts +3 -3
- package/dist/esm/wayfinding/runtime/positionView.js +1 -1
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +6 -5
- package/dist/esm/wayfinding/runtime/routeUpdate.js +1 -1
- package/dist/esm/wayfinding/runtime/types.d.ts +4 -3
- package/package.json +4 -4
- package/dist/browser/ShowKiosk-DyaUJmSm.js +0 -28
- package/dist/esm/components/Map/drawing/config/Rect.d.ts +0 -7
- package/dist/esm/components/Map/drawing/config/Rect.js +0 -1
- package/dist/esm/core/Line.d.ts +0 -12
- package/dist/esm/core/Line.js +0 -1
- package/dist/esm/core/Polygon.d.ts +0 -16
- package/dist/esm/core/Polygon.js +0 -1
- package/dist/esm/core/Rect.d.ts +0 -36
- package/dist/esm/core/Rect.js +0 -1
- package/dist/esm/core/Size.d.ts +0 -7
- package/dist/esm/core/Size.js +0 -1
- package/dist/esm/utils/haversineDistance.d.ts +0 -7
- package/dist/esm/utils/haversineDistance.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
import{pointDistance as f}from"@expofp/geometry";function d(n,c,e,t,r,l){const i=r-e,s=l-t,a=n-e,u=c-t,y=i*i+s*s;if(y===0)return f({x:n,y:c},{x:e,y:t});let o=(a*i+u*s)/y;o<0?o=0:o>1&&(o=1);const x=e+o*i,b=t+o*s;return f({x:n,y:c},{x,y:b})}export function distancePointToRouteOnLayer(n,c){let e=1/0;for(const t of c){if(n.layer&&(t.p0.layer!==n.layer||t.p1.layer!==n.layer))continue;const r=d(n.x,n.y,t.p0.x,t.p0.y,t.p1.x,t.p1.y);r<e&&(e=r)}return e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{haversineDistance as i,pointDistance as c}from"@expofp/geometry";export const SNAP_THRESHOLD_METERS=7.5;const u=15,S=20;function h(t,r){const{p0:e,p2:o}=r,n=i(e,o),s=c(e,o);return!n||!s?0:t*(s/n)}export const getThresholdSafe=t=>{if(typeof t=="number"&&Number.isFinite(t))return t};export function getThresholdFromMetersToSvg({thresholdInMeters:t,gpsConfig:r}){let e=0;return t&&r&&(e=h(t,r)),e||(e=S),e}export function resolveRerouteThresholdSvg(t){const r=getThresholdSafe(t?.rerouteThreshold)||u;return getThresholdFromMetersToSvg({thresholdInMeters:r,gpsConfig:t})}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RouteLine, RoutePoint } from '../types';
|
|
2
2
|
/** Decides whether the current GPS tick warrants rebuilding the route. */
|
|
3
3
|
export interface RerouteController {
|
|
4
4
|
/** Evaluates the current tick. Returns `true` when the caller should rebuild the route. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distancePointToRouteOnLayer as
|
|
1
|
+
import{distancePointToRouteOnLayer as a}from"./distanceToRoute";export function createRerouteController(n){return{shouldReroute(t,e){if(!e.length)return!1;const r=t.layer;return r&&!e.some(o=>o.p0.layer===r&&o.p1.layer===r)?!0:a(t,e)>n}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pointInPolygon as E}from"../geometry/pointInPolygon";import{projectPointOnSegment as
|
|
1
|
+
import{pointDistance as P}from"@expofp/geometry";import{pointInPolygon as E}from"../geometry/pointInPolygon";import{projectPointOnSegment as v}from"../geometry/projectPointOnSegment";function F(e,a){let p=0;for(const n of e){const o=P(n.p0,n.p1);if(o!==0){if(p+o>=a){const r=(a-p)/o,h=n.p0.x+(n.p1.x-n.p0.x)*r,s=n.p0.y+(n.p1.y-n.p0.y)*r;return{point:{layer:n.p0.layer,x:h,y:s},line:n}}p+=o}}const i=e[e.length-1];return{point:{layer:i.p0.layer,x:i.p1.x,y:i.p1.y},line:i}}export{SNAP_THRESHOLD_METERS}from"./gpsThreshold";export function snapToRoute(e,a,p){const i=a.length;if(!i)return{snapped:!1};const{snapThreshold:n,to:o,from:r,minRemainingUnits:h=.5}=p,s=e.layer||null;let D=1/0,m=null,u=0,b=s==null;for(let t=0;t<i;t++){const y=a[t],{p0:l,p1:f}=y,g=P(l,f);if(g===0)continue;if(s!=null&&String(l.layer)!==s){u+=g;continue}b=!0;const x=v({x:e.x,y:e.y},l,f);x.distance<D&&(D=x.distance,m={segmentIndex:t,t:x.t,distanceFromPolylineStart:u+g*x.t}),u+=g}if(s!=null&&!b)return{snapped:!1};const c=u,A=a[0].p0,I=a[i-1].p1,L=P(o,A),O=P(o,I),S=L<=O,T=Math.min(h,c);if(r?.bounds&&(s==null||!r.layer||r.layer===s)&&E({x:e.x,y:e.y},r.bounds)){const t=c,y=S?t:c-t,l=F(a,y);return{snapped:!0,snappedPoint:l.point,snappedLine:l.line,distance:t}}if(o.bounds&&(s==null||!o.layer||o.layer===s)&&E({x:e.x,y:e.y},o.bounds)){const t=T,y=c-t,f=F(a,S?t:y);return{snapped:!0,snappedPoint:f.point,snappedLine:f.line,distance:t}}if(!m||D>n)return{snapped:!1};let d=S?m.distanceFromPolylineStart:c-m.distanceFromPolylineStart;d<T&&(d=T);const j=c-d,R=F(a,S?d:j);return{snapped:!0,snappedPoint:R.point,snappedLine:R.line,distance:d}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Point2Like } from '@expofp/geometry';
|
|
2
2
|
/**
|
|
3
3
|
* Generates evenly-spaced points along a quadratic Bézier curve
|
|
4
4
|
* between two points. Used for dotted trail visualization when
|
|
@@ -15,5 +15,5 @@ export declare function computeTrailPoints(from: {
|
|
|
15
15
|
}, to: {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
18
|
-
}, interval?: number, curvature?: number):
|
|
18
|
+
}, interval?: number, curvature?: number): Point2Like[];
|
|
19
19
|
//# sourceMappingURL=computeTrailPoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{pointDistance as a}from"@expofp/geometry";const y=.4,T=8;export function computeTrailPoints(c,i,o=T,t=y){const n=a(i,c);if(n===0||o<=0)return[];const e=Math.max(Math.ceil(n/o)+1,2),u={x:(c.x+i.x)/2,y:(c.y+i.y)/2-n*t},r=[];for(let s=0;s<e;s++){const x=s/(e-1);r.push(A(c,u,i,x))}return r}function A(c,i,o,t){const n=1-t;return{x:n*n*c.x+2*n*t*i.x+t*t*o.x,y:n*n*c.y+2*n*t*i.y+t*t*o.y}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
import{pointDistance as g}from"@expofp/geometry";function y(t,s,f){let r=0,a=1/0,c=1/0;const p=f.reduce((e,n)=>e+n,0);for(let e=0;e<s.length;e++){const n=s[e],o=f[e];if(t.layer&&n.p0.layer!==t.layer){r+=o;continue}const d=n.p1.x-n.p0.x,i=n.p1.y-n.p0.y,u=d*d+i*i;if(u<1e-10){r+=o;continue}const h=((t.x-n.p0.x)*d+(t.y-n.p0.y)*i)/u,m=Math.max(0,Math.min(1,h)),x=n.p0.x+d*m,S=n.p0.y+i*m,l=Math.hypot(t.x-x,t.y-S);l<a&&(a=l,c=r+o*m),r+=o}return{found:c!==1/0,fromStart:c,total:p}}export function normalizeRouteDirection(t,s,f){const r=t.map(o=>g(o.p0,o.p1)),a=y(s,t,r),c=a.found?a:y(f,t,r);if(!c.found)return t;const p=c.fromStart,e=c.total-c.fromStart;return(a.found?e<p:p<e)?t.slice().reverse().map(o=>({...o,p0:o.p1,p1:o.p0})):t}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
x1: number;
|
|
3
|
-
y1: number;
|
|
4
|
-
x2: number;
|
|
5
|
-
y2: number;
|
|
6
|
-
}
|
|
1
|
+
import { Box } from '@expofp/geometry';
|
|
7
2
|
/**
|
|
8
3
|
* Computes the axis-aligned bounding box of a set of points.
|
|
9
|
-
*
|
|
4
|
+
* Always returns a {@link Box}. An empty array returns `Box.fromPoints([])` — a zero-size
|
|
5
|
+
* box at the origin — which is distinguished from a real route bbox via `.isEmpty()`.
|
|
10
6
|
*/
|
|
11
7
|
export declare function computeBoundingBox(points: readonly {
|
|
12
8
|
x: number;
|
|
13
9
|
y: number;
|
|
14
|
-
}[]):
|
|
10
|
+
}[]): Box;
|
|
15
11
|
//# sourceMappingURL=routeGeometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function computeBoundingBox(
|
|
1
|
+
import{Box as n}from"@expofp/geometry";export function computeBoundingBox(o){return n.fromPoints(o)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pointDistance as r}from"@expofp/geometry";export function getRouteLength(e){return e.reduce((o,t)=>o+r(t.p0,t.p1),0)}
|
|
@@ -23,8 +23,9 @@ export interface RouteLine {
|
|
|
23
23
|
/**
|
|
24
24
|
* Optional custom cost for virtual (floor-transition) links, configured
|
|
25
25
|
* per-line in the designer as "Virtual length". When set, the pathfinder
|
|
26
|
-
* uses this value instead of the default VIRTUAL_LINE_PENALTY
|
|
27
|
-
*
|
|
26
|
+
* uses this value instead of the default VIRTUAL_LINE_PENALTY, overriding it
|
|
27
|
+
* per line — `0` makes the transition free (preferred), a large value makes
|
|
28
|
+
* it avoided. When unset, the non-zero default keeps routes on the same floor.
|
|
28
29
|
*/
|
|
29
30
|
readonly virtualLength?: number;
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{fpGeo as i}from"../data/fpGeo";import o,{layersStore as n,uiState as l}from"../store";import{createCanvasIconProvider as g,createFloorContext as h,graphDataSource as T}from"./adapters";import{bindMobxReactions as A}from"./bindMobxReactions";import{SNAP_THRESHOLD_METERS as y,createWayfindingEngine as M,getThresholdFromMetersToSvg as N,getThresholdSafe as I,resolveRerouteThresholdSvg as L}from"./core";import{createKioskHandler as v}from"./handlers/kioskHandler";import{createYahHandler as W}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as x,WF_LINES_ANIMATED_LAYER_NAME as F,WF_LINES_LAYER_NAME as P,WF_POINTS_LAYER_NAME as k,WF_TRAIL_LAYER_NAME as C}from"./layers";import{createWayfindingRuntime as H}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as Y}from"./renderer";export function createWayfinding(d){const f=M(T),s=g({iconMap:o.fp.icons,pixelRatio:devicePixelRatio}),r=Y(d),a=h(n,o.routeStore),t={points:k,trail:C,lines:P,linesAnimated:F,currentPosition:x},m=I(i?.properties?.config?.snapThreshold)||y,u=N({thresholdInMeters:m,gpsConfig:i?.properties?.config}),c=H({engine:f,renderer:r,iconProvider:s,floorContext:a,layers:t,snapThreshold:u,onTransitionClick:e=>{e.role==="exit"&&n.updateVisibility(e.targetLayer,!0)},onRouteUpdate:(e,p)=>{o.routeStore.updateRoute(e),p.isEmpty()||(l.moveToRect=p)},onRouteDistance:e=>o.routeStore.updateRouteDistance(e)}),R=v({renderer:r,kioskIconMap:o.fp.icons,layer:t.points}),S=W({renderer:r,iconProvider:s,floorContext:a,layer:t.points}),E=L(i?.properties?.config),_=A({runtime:c,kioskHandler:R,yahHandler:S,stores:{routeStore:o.routeStore,uiState:l,layerStore:n},rerouteThresholdSvg:E});return r.flush(),()=>{_(),c.destroy()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{degToRad as u}from"@expofp/geometry";import{createKioskCanvas as s}from"../adapters";const n="kiosk",i=0;export function createKioskHandler({renderer:t,kioskIconMap:f,layer:a}){return(o,c,l)=>{if(!o){t.setIcon(n,null),t.flush();return}if(l!==i&&o.z&&c&&o.z!==c){t.setIcon(n,null),t.flush();return}t.setIcon(n,{canvas:s(f,o.iconSizePercent),layer:a,x:o.x,y:o.y,rotation:u(o.heading??0)}),t.flush()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createImageDef as
|
|
1
|
+
import{createImageDef as L,getBounds as m,getRotation as v,rectToRenderer as D}from"../../renderer";import{pickDefaultScene as g}from"../../renderer/engine-core/defs";export function createIconManager(u,r){const l=new Map,d=new Map,f=new Map;function b(e,a){return a===void 0?e:`${e}#${a}`}function k(e,a){let t=d.get(e);t||(t=new Set,d.set(e,t)),t.add(a),f.set(a,e)}function p(e){const a=f.get(e);if(!a)return;const t=d.get(a);t&&t.delete(e),f.delete(e)}function h(e,a,t){const n=u.touchLayer(t.layer),i=L(t.canvas,m(t.x,t.y,t.canvas.width,t.canvas.height,r.scale,t.rotation),{hidden:t.hidden??!1,dim:t.dimmed??!1,origin:t.origin});n.children.push(i),r.onPtScale(e,c=>{const s=l.get(e);if(!(!s||s.imageDef.hidden))return s.imageDef.bounds=D(m(s.imageDef.bounds.center.x,s.imageDef.bounds.center.y,s.imageDef.source.width,s.imageDef.source.height,c,s.imageDef.bounds.rotation)),s.imageDef}),t.cardinalSnap&&r.onRoll(e,c=>{const s=l.get(e);if(!s)return;const y=v(c,s.imageDef.bounds.rotation);if(y!==void 0)return s.imageDef.bounds.rotation+=y,s.imageDef});const o={imageDef:i,layerName:t.layer,callback:t.onClick??null};return l.set(e,o),k(a,e),o}function N(e,a,t,n){const i=u.resolveLayer(t.layerName),o=i.children,c=o.indexOf(t.imageDef);c>=0&&o.splice(c,1),u.touchedLayers.set(t.layerName,i),r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e),l.delete(e),p(e),h(e,a,n)}function w(e,a,t,n){if(t.layerName!==n.layer)throw new Error(`renderer: icon "${e}" cannot move between layers (was "${t.layerName}", got "${n.layer}")`);if(t.imageDef.source!==n.canvas){N(e,a,t,n);return}t.imageDef.bounds=D(m(n.x,n.y,n.canvas.width,n.canvas.height,r.scale,n.rotation)),t.imageDef.hidden=n.hidden??!1,t.imageDef.dim=n.dimmed??!1,t.callback=n.onClick??null,u.touchLayer(n.layer)}return{setIcon(e,a,t){const n=b(e,t);if(a===null){const o=l.get(n);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName));return}const i=l.get(n);i?w(n,e,i,a):h(n,e,a)},clearIcons(e){const a=typeof e=="string"?[e]:e;for(const t of a){const n=d.get(t);if(n)for(const i of n){const o=l.get(i);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName))}}},hideAll(){for(const e of l.values())e.imageDef.hidden=!0,e.callback=null,u.touchedLayers.set(e.layerName,u.resolveLayer(e.layerName))},destroy(){for(const e of l.keys())r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e);l.clear(),d.clear(),f.clear()},handleClick({data:e}){const{defs:a}=g(e);for(const t of l.values())if(t.callback&&!t.imageDef.hidden&&a.includes(t.imageDef)){t.callback();return}},handleHover({data:e}){const a=r.renderer;if(!a)return;const{defs:t}=g(e);let n=!1;for(const i of l.values())if(i.callback&&!i.imageDef.hidden&&t.includes(i.imageDef)){n=!0;break}a.canvas.style.cursor=n?"pointer":""}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Box as C}from"@expofp/geometry";import{CURRENT_POSITION_POINT_ID as G}from"./positionView";import{getRouteLength as H,snapToRoute as J}from"../core";import{getRouteLines as K}from"./getRouteLines";import{createEndpointView as Q}from"./endpointView";import{createPositionTrailView as X}from"./positionTrailView";import{createRouteLinesView as Y}from"./routeLinesView";import{computeRouteRenderData as Z}from"./routeRenderData";import{computeRouteUpdate as $}from"./routeUpdate";import{createTrailView as D}from"./trailView";import{createTransitionView as x}from"./transitionView";const tt=A=>A.flatMap(e=>[e.p0,e.p1]);export function createWayfindingRuntime({engine:A,renderer:e,iconProvider:P,floorContext:c,layers:f,snapThreshold:E,onTransitionClick:B,onRouteUpdate:N,onRouteDistance:R}){const d=Q({renderer:e,iconProvider:P,floorContext:c,layer:f.points}),I=x({renderer:e,iconProvider:P,floorContext:c,onTransitionClick:B,layer:f.points}),M=D({renderer:e,iconProvider:P,floorContext:c,layer:f.trail}),l=X({renderer:e,iconProvider:P,floorContext:c,trails:M,iconLayer:f.currentPosition,snapThreshold:E}),O=Y({renderer:e,linesLayer:f.lines,animatedLinesLayer:f.linesAnimated});let u=[],o=null,r=null,s=null,p=0,y=!1,T=!1;function S(){return c.showAllFloors()?null:c.getActiveFloor()}function _(){const t=S();return t===null?u.filter(n=>!n.virtual):u.filter(n=>n.p0.layer===t&&!n.virtual)}function V(){if(!o||!r)return null;const t=_();return t.length?{from:o,to:r,routePoints:tt(t),visibleLines:t}:null}function m(t=null,n=!1){if(!o||!r)return;const i=Z({routeLines:u,currentRouteLayer:S(),from:o,to:r,snap:t});O.draw(i,n),p=i.distance}function g(t){const n=V();if(!n){l.setTrail(null,null);return}const i=s&&t&&!t.snapped?s:null,h=a=>a.bounds?.length?null:a.id===G?i:a,L=y?null:h(n.from);if(L){l.setTrail(n.routePoints[n.routePoints.length-1],L);return}const b=h(n.to);l.setTrail(b?n.routePoints[0]:null,b)}function U(){if(!o||!r)return;const t=V();if(!t){d.hide(),I.clear(),l.clearTrail(),m();return}d.place(o,r,t.routePoints,T),I.place(u),m(),g(null)}function w(){if(!o||!r)return;const t=V();t&&d.place(o,r,t.routePoints,T)}function F(){if(T=!1,!s||!o||!r)return null;const t=u.filter(h=>!h.virtual);if(!t.length)return null;const n=V(),i=n?l.applyToRoute(s,n,t):J(s,t,{snapThreshold:E,from:o,to:r});return i.snapped&&(y=!0),T=i.snapped,i}function k(){const t=$(u,_());return N(t.lines,t.bounds),t}function W({from:t,to:n,waypoints:i,accessible:h}){const L=K({engine:A,from:t,to:n,waypoints:i,accessible:h});if(!L.length)return v(),!1;y=!1,o=t,r=n,u=L,U();const{lines:b}=k(),a=F();return w(),g(a),a&&m(a,!0),R(a?p:H(b)),e.flush(),!0}function j(t){const n=s!==null;if(s=t,!t){T=!1,l.hideIcon(),g(null),n&&w(),m(),R(p),e.flush();return}l.placeIcon(t);const i=F();w(),g(i),i&&m(i,!0),R(p),e.flush()}function q(){U();const t=F();w(),g(t),t&&m(t,!0),u.length&&k(),R(p),e.flush()}function v(){y=!1,u=[],o=null,r=null,p=0,d.hide(),I.clear(),l.clearTrail(),O.clear(),N([],new C),R(0),e.flush()}function z(){v(),s=null,e.destroy()}return{setRoute:W,onPositionChanged:j,onFloorChanged:q,clearRoute:v,destroy:z}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { IconProvider } from '../adapters';
|
|
2
|
+
import type { WayfindingRenderer } from '../renderer';
|
|
3
|
+
import type { PositionInput } from './types';
|
|
4
4
|
export declare const CURRENT_POSITION_POINT_ID = "current-position";
|
|
5
5
|
interface PositionView {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CURRENT_POSITION_POINT_ID="current-position";const c="position";export function createPositionView({renderer:
|
|
1
|
+
import{degToRad as I}from"@expofp/geometry";export const CURRENT_POSITION_POINT_ID="current-position";const c="position";export function createPositionView({renderer:n,iconProvider:i,layer:r}){return{place(o,e){const t=Number.isFinite(o.angle),s=t?"current_arrow":"current",a=t?I(o.angle):void 0;n.setIcon(c,{canvas:i.getIcon(s).canvas,layer:r,x:o.x,y:o.y,rotation:a,hidden:e,dimmed:e,origin:[.5,.5]})},hide(){n.setIcon(c,null)}}}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RouteLine } from '../core';
|
|
2
|
+
import { Box } from '@expofp/geometry';
|
|
2
3
|
/**
|
|
3
4
|
* Compute the payload for the runtime's `onRouteUpdate` callback:
|
|
4
5
|
* - `lines`: route lines as the consumer sees them — virtual graph-internal
|
|
5
6
|
* segments are filtered out before publication.
|
|
6
|
-
* - `bounds`: bounding box over the visible route points
|
|
7
|
-
* the route is empty or collapses to a single point
|
|
8
|
-
* to fit).
|
|
7
|
+
* - `bounds`: bounding box over the visible route points. It is an EMPTY box
|
|
8
|
+
* (`bounds.isEmpty()`) when the route is empty or collapses to a single point
|
|
9
|
+
* (no useful viewport to fit); consumers check `isEmpty()` rather than null.
|
|
9
10
|
*/
|
|
10
11
|
export declare function computeRouteUpdate(routeLines: ReadonlyArray<RouteLine>, visibleLines: ReadonlyArray<RouteLine>): {
|
|
11
12
|
lines: RouteLine[];
|
|
12
|
-
bounds:
|
|
13
|
+
bounds: Box;
|
|
13
14
|
};
|
|
14
15
|
//# sourceMappingURL=routeUpdate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{computeBoundingBox as
|
|
1
|
+
import{computeBoundingBox as r}from"../core";export function computeRouteUpdate(t,n){const p=t.filter(o=>!o.virtual),u=n.flatMap(o=>[o.p0,o.p1]),e=r(u);return{lines:p,bounds:e}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Box } from '@expofp/geometry';
|
|
2
|
+
import type { RouteEndpoint, RouteLine, TransitionPointDef, WayfindingEngine } from '../core';
|
|
2
3
|
import type { WayfindingRenderer } from '../renderer';
|
|
3
4
|
import type { IconProvider } from '../adapters';
|
|
4
5
|
/** User position + optional heading, without efp store coupling. */
|
|
@@ -46,8 +47,8 @@ export interface WayfindingRuntimeConfig {
|
|
|
46
47
|
readonly layers: LayerNames;
|
|
47
48
|
readonly snapThreshold: number;
|
|
48
49
|
readonly onTransitionClick: (point: TransitionPointDef) => void;
|
|
49
|
-
/** Fired when the route itself changes. `bounds` is the bbox of visible route points (
|
|
50
|
-
readonly onRouteUpdate: (lines: RouteLine[], bounds:
|
|
50
|
+
/** Fired when the route itself changes. `bounds` is the bbox of visible route points; call `bounds.isEmpty()` to detect an empty/cleared route. */
|
|
51
|
+
readonly onRouteUpdate: (lines: RouteLine[], bounds: Box) => void;
|
|
51
52
|
/** Fired when distance changes — on route change and on position snap updates. */
|
|
52
53
|
readonly onRouteDistance: (distance: number) => void;
|
|
53
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
"react-virtuoso": "^4.12.6",
|
|
67
67
|
"react-zoom-pan-pinch-sr": "^0.2.0",
|
|
68
68
|
"resize-observer": "^1.0.4",
|
|
69
|
-
"simple-geometry": "^1.0.5",
|
|
70
69
|
"slugify": "1.6.6",
|
|
71
70
|
"stats-gl": "^3.6.0",
|
|
72
71
|
"swiper": "^9.1.0",
|
|
73
72
|
"tslib": "^2.3.0",
|
|
74
73
|
"uuid": "^9.0.1",
|
|
75
74
|
"zod": "4.3.5",
|
|
76
|
-
"@expofp/
|
|
77
|
-
"@expofp/resolve": "3.
|
|
75
|
+
"@expofp/geometry": "3.8.0",
|
|
76
|
+
"@expofp/resolve": "3.8.0",
|
|
77
|
+
"@expofp/debug": "3.8.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
try {
|
|
3
|
-
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.7.16" };
|
|
5
|
-
var t = new e.Error().stack;
|
|
6
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "26b953ae-2311-4500-b58c-f1a4cfb22319", e._sentryDebugIdIdentifier = "sentry-dbid-26b953ae-2311-4500-b58c-f1a4cfb22319");
|
|
7
|
-
} catch {}
|
|
8
|
-
})();
|
|
9
|
-
import "./rolldown-runtime-BbFBHYUl.js";
|
|
10
|
-
import { t as e } from "./react-CIU0fTyL.js";
|
|
11
|
-
import { t } from "./jsx-runtime-CpBZ_Xu9.js";
|
|
12
|
-
import "./i18n-BxzWqmMz.js";
|
|
13
|
-
import { t as n } from "./index.module-c39ZrI4i.js";
|
|
14
|
-
import { lt as r, o as i, ut as a } from "./store-CbkLKghg.js";
|
|
15
|
-
import { n as o } from "./mobx-CR2pTm02.js";
|
|
16
|
-
import { t as s } from "./KioskStore-D0To4HWV.js";
|
|
17
|
-
import { t as c } from "./TouchHand-CSDv-0f5.js";
|
|
18
|
-
e();
|
|
19
|
-
var l = t(), u = n(() => (o(() => {
|
|
20
|
-
if (localStorage.getItem("kiosk") === "0") return;
|
|
21
|
-
s.restoreData();
|
|
22
|
-
let e = s.kiosk;
|
|
23
|
-
if (e) return r(e, !0), a(e), s.resetCamera(), i.setResetCameraFn(() => s.resetCamera()), () => {
|
|
24
|
-
i.uiState.setKioskData(null), i.uiState.resetMapSettings();
|
|
25
|
-
};
|
|
26
|
-
}), i.uiState.kiosk && i.uiState.inIdle ? /* @__PURE__ */ (0, l.jsx)(c, {}) : null));
|
|
27
|
-
//#endregion
|
|
28
|
-
export { u as default };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Rect as RectShape } from '@expofp/renderer';
|
|
2
|
-
import CoreRect from '../../../../core/Rect';
|
|
3
|
-
export declare class Rect extends RectShape {
|
|
4
|
-
static fromCoreRect(rect: CoreRect, rotate?: number): RectShape;
|
|
5
|
-
static inflateRect(rect: Rect, borderWidth: number): Rect;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=Rect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Rect as n}from"@expofp/renderer";export class Rect extends n{static fromCoreRect(x,a=0){return new n({x:x.x1,y:x.y1},{x:x.x2,y:x.y2},-a)}static inflateRect(x,a){return new Rect({x:x.min.x+a,y:x.min.y+a},{x:x.max.x-a,y:x.max.y-a},x.rotation)}}
|
package/dist/esm/core/Line.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type Rect from './Rect';
|
|
2
|
-
export default class Line {
|
|
3
|
-
x1: number;
|
|
4
|
-
x2: number;
|
|
5
|
-
y1: number;
|
|
6
|
-
y2: number;
|
|
7
|
-
constructor(x1: number, y1: number, x2: number, y2: number);
|
|
8
|
-
static fromSvgLineElement(svgLine: SVGLineElement): Line;
|
|
9
|
-
static fromRect(r: Rect): Line[];
|
|
10
|
-
intersects(r: Rect | Line): boolean;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=Line.d.ts.map
|
package/dist/esm/core/Line.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class s{x1;x2;y1;y2;constructor(t,x,y,h){this.x1=t,this.y1=x,this.x2=y,this.y2=h}static fromSvgLineElement(t){return new s(t.x1.baseVal.value,t.y1.baseVal.value,t.x2.baseVal.value,t.y2.baseVal.value)}static fromRect(t){return[new s(t.x1,t.y1,t.x2,t.y1),new s(t.x2,t.y1,t.x2,t.y2),new s(t.x2,t.y2,t.x1,t.y2),new s(t.x1,t.y2,t.x1,t.y1)]}intersects(t){const x=this.x1>this.x2||this.x1===this.x2&&this.y2<this.y1,y=x?this.x2:this.x1,h=x?this.x1:this.x2,a=x?this.y2:this.y1,e=x?this.y1:this.y2;return h>=t.x1&&y<=t.x2&&e>=t.y1&&a<=t.y2}}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type Rect from './Rect';
|
|
2
|
-
export default class Polygon4 {
|
|
3
|
-
x1: number;
|
|
4
|
-
y1: number;
|
|
5
|
-
x2: number;
|
|
6
|
-
y2: number;
|
|
7
|
-
x3: number;
|
|
8
|
-
y3: number;
|
|
9
|
-
x4: number;
|
|
10
|
-
y4: number;
|
|
11
|
-
private constructor();
|
|
12
|
-
static fromRect(r: Rect): Polygon4;
|
|
13
|
-
rotate(radians: number, cx: number, cy: number): Polygon4;
|
|
14
|
-
toTriangles(): [Triangle, Triangle];
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=Polygon.d.ts.map
|
package/dist/esm/core/Polygon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class n{x1;y1;x2;y2;x3;y3;x4;y4;constructor(t,i,h,x,y,s,o,c){this.x1=t,this.y1=i,this.x2=h,this.y2=x,this.x3=y,this.y3=s,this.x4=o,this.y4=c}static fromRect(t){return new n(t.x1,t.y1,t.x2,t.y1,t.x2,t.y2,t.x1,t.y2)}rotate(t,i,h){if(!t)return this;const x=Math.sin(t),y=Math.cos(t);function s(e,r){const u=e-i,a=r-h,m=u*y+a*x,p=a*y-u*x;return e=i+m,r=h+p,[e,r]}const[o,c]=s(this.x1,this.y1),[f,w]=s(this.x2,this.y2),[l,D]=s(this.x3,this.y3),[M,d]=s(this.x4,this.y4);return new n(o,c,f,w,l,D,M,d)}toTriangles(){return[[[this.x1,this.y1],[this.x2,this.y2],[this.x4,this.y4]],[[this.x2,this.y2],[this.x4,this.y4],[this.x3,this.y3]]]}}
|
package/dist/esm/core/Rect.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export default class Rect {
|
|
2
|
-
x1: number;
|
|
3
|
-
x2: number;
|
|
4
|
-
y1: number;
|
|
5
|
-
y2: number;
|
|
6
|
-
get h(): number;
|
|
7
|
-
get w(): number;
|
|
8
|
-
get cx(): number;
|
|
9
|
-
get cy(): number;
|
|
10
|
-
private constructor();
|
|
11
|
-
static fromX1y1x2y2(x1: number, y1: number, x2: number, y2: number): Rect;
|
|
12
|
-
static fromXywh(x: number, y: number, w: number, h: number): Rect;
|
|
13
|
-
static fromCxcywh(cx: number, cy: number, w: number, h: number): Rect;
|
|
14
|
-
static fromXywhRect(rect: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
w: number;
|
|
18
|
-
h: number;
|
|
19
|
-
}): Rect;
|
|
20
|
-
static fromSvgRectElement(svgRect: SVGRectElement): Rect;
|
|
21
|
-
static fromMultiple(rects: Rect[]): Rect;
|
|
22
|
-
contains(r: Rect): boolean;
|
|
23
|
-
intersects(r: Rect): boolean;
|
|
24
|
-
getIntersection(r: Rect): Rect;
|
|
25
|
-
getRotated90(): Rect;
|
|
26
|
-
normalize(width: number, height: number): Rect;
|
|
27
|
-
withPadding(x: number, y?: number): Rect;
|
|
28
|
-
scale(s: number): Rect;
|
|
29
|
-
getArea(): number;
|
|
30
|
-
clone(): Rect;
|
|
31
|
-
translate(dx: number, dy: number): this;
|
|
32
|
-
equals(r: Rect): boolean;
|
|
33
|
-
toString(): string;
|
|
34
|
-
containsPoint(x: number, y: number): boolean;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=Rect.d.ts.map
|
package/dist/esm/core/Rect.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class n{x1;x2;y1;y2;get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(t,i,s,h){if(t>s){const r=t;t=s,s=r}if(i>h){const r=i;i=h,h=r}if(t>s||i>h)throw new Error(`Invalid rect ${t} ${s} ${i} ${h}`);this.x1=t,this.y1=i,this.x2=s,this.y2=h}static fromX1y1x2y2(t,i,s,h){return new n(t,i,s,h)}static fromXywh(t,i,s,h){return this.fromX1y1x2y2(t,i,t+s,i+h)}static fromCxcywh(t,i,s,h){return this.fromX1y1x2y2(t-s/2,i-h/2,t+s/2,i+h/2)}static fromXywhRect(t){return this.fromX1y1x2y2(t.x,t.y,t.x+t.w,t.y+t.h)}static fromSvgRectElement(t){return this.fromXywh(t.x.baseVal.value,t.y.baseVal.value,t.width.baseVal.value,t.height.baseVal.value)}static fromMultiple(t){return n.fromX1y1x2y2(Math.min(...t.map(i=>i.x1)),Math.min(...t.map(i=>i.y1)),Math.max(...t.map(i=>i.x2)),Math.max(...t.map(i=>i.y2)))}contains(t){return t.x1>=this.x1&&t.x2<=this.x2&&t.y1>=this.y1&&t.y2<=this.y2}intersects(t){const i=Math.max(this.x1,t.x1),s=Math.min(this.x2,t.x2),h=Math.max(this.y1,t.y1),r=Math.min(this.y2,t.y2);return s>=i&&r>=h}getIntersection(t){const i=Math.max(this.x1,t.x1),s=Math.min(this.x2,t.x2),h=Math.max(this.y1,t.y1),r=Math.min(this.y2,t.y2);return s>=i&&r>=h?n.fromX1y1x2y2(i,h,s,r):n.fromX1y1x2y2(0,0,0,0)}getRotated90(){return n.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(t,i){const s=this.x1/t,h=this.x2/t,r=this.y1/i,y=this.y2/i;return n.fromX1y1x2y2(s,r,h,y)}withPadding(t,i=t){return this.w<t*2||this.h<i*2?this:n.fromCxcywh(this.cx,this.cy,this.w-t*2,this.h-i*2)}scale(t){return n.fromX1y1x2y2(this.x1*t,this.y1*t,this.x2*t,this.y2*t)}getArea(){return this.w*this.h}clone(){return new n(this.x1,this.y1,this.x2,this.y2)}translate(t,i){return this.x1+=t,this.x2+=t,this.y1+=i,this.y2+=i,this}equals(t){return t.x1===this.x1&&t.x2===this.x2&&t.y1===this.y1&&t.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(t,i){return t>=this.x1&&t<=this.x2&&i>=this.y1&&i<=this.y2}}
|
package/dist/esm/core/Size.d.ts
DELETED
package/dist/esm/core/Size.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class h{width;height;constructor(t,i){this.width=t,this.height=i}scale(t){return new h(this.width*t,this.height*t)}}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Great-circle distance between two GPS points using the Haversine formula.
|
|
3
|
-
*
|
|
4
|
-
* @returns distance in metres
|
|
5
|
-
*/
|
|
6
|
-
export declare function haversineDistance(lat1: number, lng1: number, lat2: number, lng2: number): number;
|
|
7
|
-
//# sourceMappingURL=haversineDistance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function haversineDistance(t,c,n,M){const o=t*Math.PI/180,i=n*Math.PI/180,s=(n-t)*Math.PI/180,a=(M-c)*Math.PI/180,h=Math.sin(s/2)*Math.sin(s/2)+Math.cos(o)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2);return 6371e3*(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)))}
|