@expofp/floorplan 3.5.2 → 3.6.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/{CookieConsent-SW2eXIC8.js → CookieConsent-7RHQNfPi.js} +8 -8
- package/dist/browser/{Debug-t7OzIN-8.js → Debug-DSE0G1X0.js} +7 -7
- package/dist/browser/{Demo-DJ98mlUr.js → Demo-CGLXtx_J.js} +11 -11
- package/dist/browser/{Free-B9JCPcnr.js → Free-BUwTP1Pf.js} +11 -11
- package/dist/browser/{Gallery-CPBGS9q7.js → Gallery-DOvcwDSP.js} +10 -10
- package/dist/browser/{GpsLoader-vcgurCKn.js → GpsLoader-CaxnWRT4.js} +42 -42
- package/dist/browser/{KioskStore-DzLhE0fK.js → KioskStore-n7sNyISt.js} +36 -36
- package/dist/browser/{MaplibreAdapter-CAGVMAol.js → MaplibreAdapter-DRETosPg.js} +98 -98
- package/dist/browser/{Modal-DBVl72uz.js → Modal-jkCNhc5W.js} +10 -10
- package/dist/browser/{PermissionNotice-BDny4W7h.js → PermissionNotice-CUfYOzWa.js} +7 -7
- package/dist/browser/{SetKioskMode-CjKFTXwj.js → SetKioskMode-BTMes6Qv.js} +11 -11
- package/dist/browser/{ShowKiosk-bwEsTLSP.js → ShowKiosk-f-dRGxyO.js} +10 -10
- package/dist/browser/{TouchHand-DFPQ2vE8.js → TouchHand-CCDAq3if.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-DK-DJHgD.js → ViewerMenuPanel-O7HHZhKd.js} +12 -12
- package/dist/browser/{add-debug-secret-listener-ND2YIuwE.js → add-debug-secret-listener-BpT8IiY7.js} +1 -1
- package/dist/browser/{boolean-editor-BXVL077p.js → boolean-editor-CDMX2vVS.js} +9 -9
- package/dist/browser/{bootIntercom-DLTAHEbT.js → bootIntercom-D_XUSIsZ.js} +2 -2
- package/dist/browser/{browser-V3D46fyx.js → browser-C2T1Beyd.js} +2 -2
- package/dist/browser/bundle.json +59 -56
- package/dist/browser/{classnames-Dxv3Iqu-.js → classnames-bu9CKQ9B.js} +2 -2
- package/dist/browser/{client-C1kJisHy.js → client-CRHe4rvq.js} +4 -4
- package/dist/browser/compat-helper.js +1 -0
- package/dist/browser/{components-B8Qifx-N.js → components-Bo47YnR8.js} +1522 -1514
- package/dist/browser/{createWayfinding-C8Pmd2H5.js → createWayfinding-BadUdVb3.js} +598 -614
- package/dist/browser/{debug-overlay-DWJkUc3u.js → debug-overlay-D1j-kvcX.js} +10 -10
- package/dist/browser/{debug-ui-jAj6--ux.js → debug-ui-DSlWZ4sC.js} +6 -6
- package/dist/browser/{dist-CPyShXna.js → dist-DfuOQuyQ.js} +5 -5
- package/dist/browser/{dist-BHV9ghY4.js → dist-DlacjPUu.js} +6 -6
- package/dist/browser/{dist-DUIasJnS.js → dist-DmKlo6QJ.js} +3 -3
- package/dist/browser/{efp-debug-init-AR3Fvs_0.js → efp-debug-init-Bm0MVP2h.js} +2 -2
- package/dist/browser/{enum-editor-FiZIrNXM.js → enum-editor-siCO7Xfo.js} +11 -11
- package/dist/browser/{event-not-found-BzPx68a_.js → event-not-found-D0nWb3qT.js} +1 -1
- package/dist/browser/{exports-DlEzkzSC.js → exports-B3z1iY3M.js} +1 -1
- package/dist/browser/{favicon-Dobo0b59.js → favicon-CwfYl17D.js} +1 -1
- package/dist/browser/{fetch-retry.umd-CXT8SYkm.js → fetch-retry.umd-0wqPcBus.js} +2 -2
- package/dist/browser/{flex-DGR_Loqd.js → flex-3cepd5kd.js} +5 -5
- package/dist/browser/{floorplan.loader-GMByEo0q.js → floorplan.loader-CMiIp9U5.js} +48 -47
- package/dist/browser/{floorplan.ready-DTwVRPUA.js → floorplan.ready-C1Ih8AXF.js} +232 -232
- package/dist/browser/{fuse-CoX8SCVF.js → fuse-1C6moGnL.js} +2 -2
- package/dist/browser/{i18n-CONnsQk4.js → i18n-s1qY7lAy.js} +570 -543
- package/dist/browser/icons/departure_inactive.svg +5 -0
- package/dist/browser/index.js +11 -11
- package/dist/browser/{jsx-runtime-iIXfJE8d.js → jsx-runtime-DkIKrO9X.js} +2 -2
- package/dist/browser/{lib-CAUtTowO.js → lib-CQEgphr9.js} +4 -4
- package/dist/browser/{main-5p-fstPx.js → main-CIw-sA9x.js} +1 -1
- package/dist/browser/{mobx-CP3094rF.js → mobx-BWVP8GMN.js} +8 -8
- package/dist/browser/{particles.min-BvP0Ecuj.js → particles.min-CGCC5E7s.js} +2 -2
- package/dist/browser/{prop-types-CtPkc8Dm.js → prop-types-BLMbF9Gx.js} +2 -2
- package/dist/browser/{react-DgvgFS2Z.js → react-DWv1jiJx.js} +2 -2
- package/dist/browser/{react-dom-Bi44rMnr.js → react-dom-B1kJrfKr.js} +3 -3
- package/dist/browser/{reset-all-settings-CB8d29KN.js → reset-all-settings-CBz-vDc5.js} +7 -7
- package/dist/browser/{rolldown-runtime-D0nkOxqx.js → rolldown-runtime-r-_hAitn.js} +1 -1
- package/dist/browser/{settings-CTPClT89.js → settings-CGEJf2_B.js} +2 -2
- package/dist/browser/{settings-item-DFxxEXOa.js → settings-item-BbG-b-eF.js} +6 -6
- package/dist/browser/{storage-DvQIEAC7.js → storage-CQsko9cP.js} +5 -5
- package/dist/browser/{store-BlZ4xT_G.js → store-CaZsJa12.js} +5746 -5681
- package/dist/browser/{string-editor-YIMEKgRw.js → string-editor-Baea8YX3.js} +7 -7
- package/dist/browser/{theme-Gip68cNV.js → theme-BHkNtMJn.js} +8 -8
- package/dist/browser/{ui-CZUswZut.js → ui-DmzqbuSF.js} +8 -8
- package/dist/browser/{useRenderTarget-DTeVFvZz.js → useRenderTarget-BGCa_TOt.js} +4 -4
- package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Wayfinding.js +1 -1
- package/dist/esm/data/Flags.d.ts +9 -0
- package/dist/esm/services/routing.js +1 -1
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RoutePlannerStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +15 -6
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.d.ts +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/utils/loadIcons.js +1 -1
- package/dist/esm/wayfinding/adapters/arbitraryPoint.d.ts +28 -0
- package/dist/esm/wayfinding/adapters/arbitraryPoint.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +3 -3
- package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/index.d.ts +2 -0
- package/dist/esm/wayfinding/adapters/index.js +1 -1
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +9 -1
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -1
- package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.d.ts +23 -0
- package/dist/esm/wayfinding/core/geometry/projectPointOnSegment.js +1 -0
- package/dist/esm/wayfinding/core/index.d.ts +6 -3
- package/dist/esm/wayfinding/core/index.js +1 -1
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +9 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -1
- package/dist/esm/wayfinding/core/position/rerouteController.d.ts +10 -0
- package/dist/esm/wayfinding/core/position/rerouteController.js +1 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.d.ts +2 -2
- package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -1
- package/dist/esm/wayfinding/core/routing/{findNearestGraphPoint.d.ts → graphPointResolvers.d.ts} +1 -3
- package/dist/esm/wayfinding/core/routing/graphPointResolvers.js +1 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.d.ts +17 -3
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.js +1 -1
- package/dist/esm/wayfinding/core/types.d.ts +5 -6
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/dist/esm/wayfinding/layers.d.ts +1 -0
- package/dist/esm/wayfinding/layers.js +1 -1
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -1
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +4 -1
- package/dist/esm/wayfinding/runtime/endpointView.js +1 -1
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +14 -20
- package/dist/esm/wayfinding/runtime/positionTrailView.js +1 -1
- package/dist/esm/wayfinding/runtime/positionView.d.ts +1 -0
- package/dist/esm/wayfinding/runtime/positionView.js +1 -1
- package/dist/esm/wayfinding/runtime/routeRenderData.d.ts +1 -1
- package/dist/esm/wayfinding/runtime/types.d.ts +1 -0
- package/package.json +9 -3
- package/dist/esm/RouteCutIn.d.ts +0 -23
- package/dist/esm/RouteCutIn.js +0 -1
- package/dist/esm/wayfinding/core/position/shouldReroute.d.ts +0 -3
- package/dist/esm/wayfinding/core/position/shouldReroute.js +0 -1
- package/dist/esm/wayfinding/core/routing/findNearestGraphPoint.js +0 -1
- package/dist/esm/wayfinding/utils/findBoothInRadius.d.ts +0 -4
- package/dist/esm/wayfinding/utils/findBoothInRadius.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createGraphCache as
|
|
1
|
+
import{createGraphCache as G}from"./graph/graphCache";import{getRouteLength as m}from"./routing/getRouteLength";import{buildRoute as b}from"./routing/buildRoute";import{buildMultiPointRoute as R}from"./routing/buildMultiPointRoute";import{resolveWaypointCandidates as h}from"./routing/resolveWaypointCandidates";import{reorderWaypoints as y}from"./routing/optimizeWaypointOrder";const g=1e-6,u=(e,t)=>e.layer===t.layer&&Math.abs(e.x-t.x)<g&&Math.abs(e.y-t.y)<g;function O(e,t){if(!e.length)return e;const n=e[e.length-1],o=n.p1,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p0,r)?[...e.slice(0,-1),{...n,p1:t.projection}]:[...e,{...t.segment,p0:o,p1:t.projection}]}function j(e,t){if(!e.length)return e;const n=e[0],o=n.p0,r=u(t.segment.p0,o)?t.segment.p1:t.segment.p0;return u(n.p1,r)?[{...n,p0:t.projection},...e.slice(1)]:[{...t.segment,p0:t.projection,p1:o},...e]}function E(e,t,n){let o=e;return t&&(o=O(o,t)),n&&(o=j(o,n)),o}export function createWayfindingEngine(e){const t=G();return{buildRoute(n,o,r){const i=t.getOrBuild(e,r?.accessible??!1),s=h(i,n),a=h(i,o),c=b(i,s.candidates,a.candidates),p=!!s.offGraphEntry||!!a.offGraphEntry,f=E(c.lines,s.offGraphEntry,a.offGraphEntry);return{lines:f,distance:p?m(f):c.totalDistance}},buildWaypointsRoute(n,o){if(n.length<2)return{lines:[],distance:0};const r=t.getOrBuild(e,o?.accessible??!1),s=(o?.fastest?y(n):n).map(d=>h(r,d)),a=R(r,s.map(d=>d.candidates)),c=s[0].offGraphEntry,p=s[s.length-1].offGraphEntry,f=!!c||!!p,l=E(a.lines,c,p);return{lines:l,distance:f?m(l):a.totalDistance}}}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface SegmentProjection {
|
|
2
|
+
readonly projected: {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
};
|
|
6
|
+
readonly distance: number;
|
|
7
|
+
readonly t: number;
|
|
8
|
+
}
|
|
9
|
+
interface Point2D {
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Projects `point` onto the segment `a`–`b`, clamping the parameter `t` to
|
|
15
|
+
* `[0, 1]` so the result always lies on the segment (not its infinite line).
|
|
16
|
+
*
|
|
17
|
+
* `t` is the normalized position along the segment: `0` = `a`, `1` = `b`.
|
|
18
|
+
* For a zero-length segment (`a` equals `b`) the projection collapses to `a`
|
|
19
|
+
* with `t = 0`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function projectPointOnSegment(point: Point2D, a: Point2D, b: Point2D): SegmentProjection;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=projectPointOnSegment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function projectPointOnSegment(c,t,x){const e=x.x-t.x,n=x.y-t.y,y=e*e+n*n;if(y===0){const j=Math.hypot(c.x-t.x,c.y-t.y);return{projected:{x:t.x,y:t.y},distance:j,t:0}}const d=((c.x-t.x)*e+(c.y-t.y)*n)/y,o=Math.max(0,Math.min(1,d)),s=t.x+e*o,r=t.y+n*o,h=Math.hypot(c.x-s,c.y-r);return{projected:{x:s,y:r},distance:h,t:o}}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { createWayfindingEngine } from "./createWayfindingEngine";
|
|
2
2
|
export type { WayfindingEngine, Route } from "./createWayfindingEngine";
|
|
3
|
-
export type { GraphDataSource, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, } from "./types";
|
|
3
|
+
export type { GraphDataSource, RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig, } from "./types";
|
|
4
|
+
export { projectPointOnSegment } from "./geometry/projectPointOnSegment";
|
|
5
|
+
export type { SegmentProjection } from "./geometry/projectPointOnSegment";
|
|
4
6
|
export { computeTransitionPoints } from "./rendering/computeTransitionPoints";
|
|
5
7
|
export type { TransitionPointDef } from "./rendering/computeTransitionPoints";
|
|
6
8
|
export { computeTrailPoints } from "./rendering/computeTrailPoints";
|
|
@@ -8,8 +10,9 @@ export { computeBoundingBox } from "./rendering/routeGeometry";
|
|
|
8
10
|
export type { BoundingBox } from "./rendering/routeGeometry";
|
|
9
11
|
export { normalizeRouteDirection } from "./rendering/normalizeRouteDirection";
|
|
10
12
|
export { getRouteLength } from "./routing/getRouteLength";
|
|
11
|
-
export { SNAP_THRESHOLD_METERS, getThresholdSafe,
|
|
12
|
-
export {
|
|
13
|
+
export { SNAP_THRESHOLD_METERS, getThresholdFromMetersToSvg, getThresholdSafe, resolveRerouteThresholdSvg, } from "./position/gpsThreshold";
|
|
14
|
+
export { createRerouteController } from "./position/rerouteController";
|
|
15
|
+
export type { RerouteController } from "./position/rerouteController";
|
|
13
16
|
export { snapToRoute } from "./position/snapToRoute";
|
|
14
17
|
export { splitRouteByPoint } from "./position/splitRouteByPoint";
|
|
15
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createWayfindingEngine}from"./createWayfindingEngine";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{computeBoundingBox}from"./rendering/routeGeometry";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{getRouteLength}from"./routing/getRouteLength";export{SNAP_THRESHOLD_METERS,getThresholdSafe,
|
|
1
|
+
export{createWayfindingEngine}from"./createWayfindingEngine";export{projectPointOnSegment}from"./geometry/projectPointOnSegment";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{computeTrailPoints}from"./rendering/computeTrailPoints";export{computeBoundingBox}from"./rendering/routeGeometry";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{getRouteLength}from"./routing/getRouteLength";export{SNAP_THRESHOLD_METERS,getThresholdFromMetersToSvg,getThresholdSafe,resolveRerouteThresholdSvg}from"./position/gpsThreshold";export{createRerouteController}from"./position/rerouteController";export{snapToRoute}from"./position/snapToRoute";export{splitRouteByPoint}from"./position/splitRouteByPoint";
|
|
@@ -18,5 +18,14 @@ export declare function getThresholdFromMetersToSvg({ thresholdInMeters, gpsConf
|
|
|
18
18
|
thresholdInMeters?: number;
|
|
19
19
|
gpsConfig?: GpsProjectionConfig;
|
|
20
20
|
}): number;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the reroute threshold (SVG units) for the active plan: honours
|
|
23
|
+
* `gpsConfig.rerouteThreshold` (meters) override, otherwise falls back to
|
|
24
|
+
* {@link REROUTE_THRESHOLD_METERS}. Returns plan-scaled SVG units suitable
|
|
25
|
+
* for `shouldReroute`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveRerouteThresholdSvg(gpsConfig?: GpsProjectionConfig & {
|
|
28
|
+
rerouteThreshold?: number;
|
|
29
|
+
}): number;
|
|
21
30
|
export {};
|
|
22
31
|
//# sourceMappingURL=gpsThreshold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lineLength as
|
|
1
|
+
import{lineLength as i}from"simple-geometry";import{haversineDistance as l}from"../../../utils/haversineDistance";export const SNAP_THRESHOLD_METERS=7.5;const c=15,h=20;function u(t,r){const{p0:e,p2:n}=r,o=l(e.lat,e.lng,n.lat,n.lng),s=i(e,n);return!o||!s?0:t*(s/o)}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=u(t,r)),e||(e=h),e}export function resolveRerouteThresholdSvg(t){const r=getThresholdSafe(t?.rerouteThreshold)||c;return getThresholdFromMetersToSvg({thresholdInMeters:r,gpsConfig:t})}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RouteLine, RoutePoint } from "../types";
|
|
2
|
+
/** Decides whether the current GPS tick warrants rebuilding the route. */
|
|
3
|
+
export interface RerouteController {
|
|
4
|
+
/** Evaluates the current tick. Returns `true` when the caller should rebuild the route. */
|
|
5
|
+
shouldReroute(position: RoutePoint, routeLines: RouteLine[]): boolean;
|
|
6
|
+
}
|
|
7
|
+
/** `thresholdSvg` — plan-scale-aware off-route distance (SVG units), produced by
|
|
8
|
+
* `resolveRerouteThresholdSvg` and passed in by the composition root. */
|
|
9
|
+
export declare function createRerouteController(thresholdSvg: number): RerouteController;
|
|
10
|
+
//# sourceMappingURL=rerouteController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{distancePointToRouteOnLayer as o}from"./distanceToRoute";export function createRerouteController(n){return{shouldReroute(r,t){if(!t.length)return!1;const e=r.layer;return e&&!t.some(a=>a.p0.layer===e&&a.p1.layer===e)?!0:o({x:r.x,y:r.y,layer:e},t)>n}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RouteLine, RoutePoint, RouteSnapResult, SnapToRouteConfig } from "../types";
|
|
2
2
|
export { SNAP_THRESHOLD_METERS } from "./gpsThreshold";
|
|
3
|
-
export declare function snapToRoute(position:
|
|
3
|
+
export declare function snapToRoute(position: RoutePoint, routeLines: RouteLine[], config: SnapToRouteConfig): RouteSnapResult;
|
|
4
4
|
//# sourceMappingURL=snapToRoute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pointInPolygon as
|
|
1
|
+
import{pointInPolygon as E}from"../geometry/pointInPolygon";import{projectPointOnSegment as O}from"../geometry/projectPointOnSegment";function D(o,a){let y=0;for(const n of o){const t=Math.hypot(n.p1.x-n.p0.x,n.p1.y-n.p0.y);if(t!==0){if(y+t>=a){const r=(a-y)/t,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}}y+=t}}const i=o[o.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(o,a,y){const i=a.length;if(!i)return{snapped:!1};const{snapThreshold:n,to:t,from:r,minRemainingUnits:h=.5}=y,s=o.layer||null;let P=1/0,u=null,m=0,F=s==null;for(let e=0;e<i;e++){const f=a[e],{p0:l,p1:c}=f,S=Math.hypot(c.x-l.x,c.y-l.y);if(S===0)continue;if(s!=null&&String(l.layer)!==s){m+=S;continue}F=!0;const g=O({x:o.x,y:o.y},l,c);g.distance<P&&(P=g.distance,u={segmentIndex:e,t:g.t,distanceFromPolylineStart:m+S*g.t}),m+=S}if(s!=null&&!F)return{snapped:!1};const p=m,b=a[0].p0,M=a[i-1].p1,A=Math.hypot(t.x-b.x,t.y-b.y),I=Math.hypot(t.x-M.x,t.y-M.y),x=A<=I,T=Math.min(h,p);if(r?.bounds&&(s==null||!r.layer||r.layer===s)&&E({x:o.x,y:o.y},r.bounds)){const e=p,f=x?e:p-e,l=D(a,f);return{snapped:!0,snappedPoint:l.point,snappedLine:l.line,distance:e}}if(t.bounds&&(s==null||!t.layer||t.layer===s)&&E({x:o.x,y:o.y},t.bounds)){const e=T,f=p-e,c=D(a,x?e:f);return{snapped:!0,snappedPoint:c.point,snappedLine:c.line,distance:e}}if(!u||P>n)return{snapped:!1};let d=x?u.distanceFromPolylineStart:p-u.distanceFromPolylineStart;d<T&&(d=T);const L=p-d,R=D(a,x?d:L);return{snapped:!0,snappedPoint:R.point,snappedLine:R.line,distance:d}}
|
package/dist/esm/wayfinding/core/routing/{findNearestGraphPoint.d.ts → graphPointResolvers.d.ts}
RENAMED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { GraphDataSource, PolygonVertex, RoutePoint } from "../types";
|
|
2
2
|
/** Graph endpoints inside a convex polygon (e.g. booth rect), filtered by layer. */
|
|
3
3
|
export declare function findGraphPointsInPolygon(dataSource: GraphDataSource, polygon: ReadonlyArray<PolygonVertex>, layer?: string): RoutePoint[];
|
|
4
|
-
|
|
5
|
-
export declare function findNearestGraphPoint(dataSource: GraphDataSource, point: RoutePoint): RoutePoint | null;
|
|
6
|
-
//# sourceMappingURL=findNearestGraphPoint.d.ts.map
|
|
4
|
+
//# sourceMappingURL=graphPointResolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computePolygonArea as i,pointInPolygon as p}from"../geometry/pointInPolygon";export function findGraphPointsInPolygon(r,o,n){const e=i(o);return r.getLineEnds().filter(t=>(!n||t.layer===n)&&p(t,o,e))}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import type { GraphInstance, RouteEndpoint, RoutePoint } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { GraphInstance, RouteEndpoint, RouteLine, RoutePoint } from "../types";
|
|
2
|
+
export interface OffGraphEntry {
|
|
3
|
+
readonly segment: RouteLine;
|
|
4
|
+
readonly projection: RoutePoint;
|
|
5
|
+
}
|
|
6
|
+
/** A* candidates plus an optional `offGraphEntry` — set when the route's entry needs perpendicular
|
|
7
|
+
* trim to land on a point inside a segment instead of at a graph node. */
|
|
8
|
+
export interface ResolvedCandidates {
|
|
9
|
+
readonly candidates: RoutePoint[];
|
|
10
|
+
readonly offGraphEntry: OffGraphEntry | null;
|
|
11
|
+
}
|
|
12
|
+
/** Turns a route endpoint into A* candidates.
|
|
13
|
+
* - Booth (has `bounds`) → graph nodes inside the polygon.
|
|
14
|
+
* - Off-graph point → nearest segment on its layer; both ends are candidates and `offGraphEntry`
|
|
15
|
+
* holds the perpendicular foot to trim to. If the foot falls off the segment, attach at its node.
|
|
16
|
+
* */
|
|
17
|
+
export declare function resolveWaypointCandidates(graph: GraphInstance, endpoint: RouteEndpoint): ResolvedCandidates;
|
|
4
18
|
//# sourceMappingURL=resolveWaypointCandidates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{projectPointOnSegment as l}from"../geometry/projectPointOnSegment";import{findGraphPointsInPolygon as p}from"./graphPointResolvers";export function resolveWaypointCandidates(i,e){if(e.bounds?.length)return{candidates:p(i.dataSource,e.bounds,e.layer),offGraphEntry:null};let a=null,f=1/0;for(const t of i.dataSource.getLines()){if(t.virtual||e.layer&&t.p0.layer!==e.layer||t.p0.x===t.p1.x&&t.p0.y===t.p1.y)continue;const o=l(e,t.p0,t.p1);o.distance<f&&(f=o.distance,a={segment:t,proj:o})}if(!a)return{candidates:[],offGraphEntry:null};const{segment:n,proj:r}=a;return r.t===0?{candidates:[n.p0],offGraphEntry:null}:r.t===1?{candidates:[n.p1],offGraphEntry:null}:{candidates:[n.p0,n.p1],offGraphEntry:{segment:n,projection:{layer:n.p0.layer,x:r.projected.x,y:r.projected.y}}}}
|
|
@@ -64,12 +64,6 @@ export interface RouteResult {
|
|
|
64
64
|
readonly lines: RouteLine[];
|
|
65
65
|
readonly totalDistance: number;
|
|
66
66
|
}
|
|
67
|
-
/** Minimal position interface — replaces CurrentPosition class dependency in core. */
|
|
68
|
-
export interface PositionPoint {
|
|
69
|
-
readonly x: number;
|
|
70
|
-
readonly y: number;
|
|
71
|
-
readonly z?: string | number | null;
|
|
72
|
-
}
|
|
73
67
|
export type RouteSnapResult = {
|
|
74
68
|
snapped: false;
|
|
75
69
|
} | {
|
|
@@ -83,9 +77,14 @@ export type RouteSnapResult = {
|
|
|
83
77
|
* Route endpoint: anchor on a layer, with optional perimeter polygon (booth bounds).
|
|
84
78
|
* With `bounds` → engine picks the optimal graph node inside the polygon.
|
|
85
79
|
* Without `bounds` → off-graph point (e.g. kiosk); engine snaps to nearest graph anchor.
|
|
80
|
+
*
|
|
81
|
+
* `id` is an opaque runtime discriminator the engine ignores — used by the
|
|
82
|
+
* adapter layer to mark off-graph endpoints (e.g. CP-derived vs kiosk anchor)
|
|
83
|
+
* so the renderer can branch on endpoint origin without re-checking UI types.
|
|
86
84
|
*/
|
|
87
85
|
export interface RouteEndpoint extends RoutePoint {
|
|
88
86
|
readonly bounds?: ReadonlyArray<PolygonVertex>;
|
|
87
|
+
readonly id?: string;
|
|
89
88
|
}
|
|
90
89
|
export type SnapToRouteConfig = {
|
|
91
90
|
snapThreshold: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import h from"../core/Rect";import{fpGeo as n}from"../data/fpGeo";import o,{layersStore as s,uiState as f}from"../store";import{createCanvasIconProvider as E,createFloorContext as y,graphDataSource as T}from"./adapters";import{bindMobxReactions as A}from"./bindMobxReactions";import{SNAP_THRESHOLD_METERS as M,createWayfindingEngine as N,getThresholdFromMetersToSvg as x,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 F,WF_LINES_ANIMATED_LAYER_NAME as P,WF_LINES_LAYER_NAME as k,WF_POINTS_LAYER_NAME as C,WF_TRAIL_LAYER_NAME as H}from"./layers";import{createWayfindingRuntime as Y}from"./runtime/createWayfindingRuntime";import{createWayfindingRenderer as D}from"./renderer";export function createWayfinding(l){const m=N(T),a=E({iconMap:o.fp.icons,pixelRatio:devicePixelRatio}),t=D(l),c=y(s,o.routeStore),i={points:C,trail:H,lines:k,linesAnimated:P,currentPosition:F},d=I(n?.properties?.config?.snapThreshold)||M,R=x({thresholdInMeters:d,gpsConfig:n?.properties?.config}),p=Y({engine:m,renderer:t,iconProvider:a,floorContext:c,layers:i,snapThreshold:R,onTransitionClick:e=>{e.role==="exit"&&s.updateVisibility(e.targetLayer,!0)},onRouteUpdate:(e,r)=>{o.routeStore.updateRoute(e),r&&(f.moveToRect=h.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2))},onRouteDistance:e=>o.routeStore.updateRouteDistance(e)}),S=v({renderer:t,kioskIconMap:o.fp.icons,layer:i.points}),g=W({renderer:t,iconProvider:a,floorContext:c,layer:i.points}),u=L(n?.properties?.config),_=A({runtime:p,kioskHandler:S,yahHandler:g,stores:{routeStore:o.routeStore,uiState:f,layerStore:s},rerouteThresholdSvg:u});return t.flush(),()=>{_(),p.destroy()}}
|
|
@@ -11,4 +11,5 @@ export declare const WF_POINTS_LAYER_NAME = "wf-points";
|
|
|
11
11
|
export declare const WF_TRAIL_LAYER_NAME = "wf-trail-points";
|
|
12
12
|
export declare const WF_LINES_LAYER_NAME = "wf-lines";
|
|
13
13
|
export declare const WF_LINES_ANIMATED_LAYER_NAME = "wf-lines-animated";
|
|
14
|
+
export declare const WF_CURRENT_POSITION_LAYER_NAME = "wf-current-position";
|
|
14
15
|
//# sourceMappingURL=layers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WF_POINTS_LAYER_NAME="wf-points",WF_TRAIL_LAYER_NAME="wf-trail-points",WF_LINES_LAYER_NAME="wf-lines",WF_LINES_ANIMATED_LAYER_NAME="wf-lines-animated";
|
|
1
|
+
export const WF_POINTS_LAYER_NAME="wf-points",WF_TRAIL_LAYER_NAME="wf-trail-points",WF_LINES_LAYER_NAME="wf-lines",WF_LINES_ANIMATED_LAYER_NAME="wf-lines-animated",WF_CURRENT_POSITION_LAYER_NAME="wf-current-position";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getRouteLength as
|
|
1
|
+
import{CURRENT_POSITION_POINT_ID as C}from"./positionView";import{getRouteLength as G,snapToRoute as H}from"../core";import{getRouteLines as J}from"./getRouteLines";import{createEndpointView as K}from"./endpointView";import{createPositionTrailView as Q}from"./positionTrailView";import{createRouteLinesView as X}from"./routeLinesView";import{computeRouteRenderData as Y}from"./routeRenderData";import{computeRouteUpdate as Z}from"./routeUpdate";import{createTrailView as $}from"./trailView";import{createTransitionView as D}from"./transitionView";const x=A=>A.flatMap(e=>[e.p0,e.p1]);export function createWayfindingRuntime({engine:A,renderer:e,iconProvider:P,floorContext:c,layers:f,snapThreshold:E,onTransitionClick:M,onRouteUpdate:N,onRouteDistance:R}){const d=K({renderer:e,iconProvider:P,floorContext:c,layer:f.points}),I=D({renderer:e,iconProvider:P,floorContext:c,onTransitionClick:M,layer:f.points}),W=$({renderer:e,iconProvider:P,floorContext:c,layer:f.trail}),l=Q({renderer:e,iconProvider:P,floorContext:c,trails:W,iconLayer:f.currentPosition,snapThreshold:E}),O=X({renderer:e,linesLayer:f.lines,animatedLinesLayer:f.linesAnimated});let r=[],o=null,u=null,s=null,p=0,y=!1,T=!1;function S(){return c.showAllFloors()?null:c.getActiveFloor()}function _(){const t=S();return t===null?r.filter(n=>!n.virtual):r.filter(n=>n.p0.layer===t&&!n.virtual)}function V(){if(!o||!u)return null;const t=_();return t.length?{from:o,to:u,routePoints:x(t),visibleLines:t}:null}function m(t=null,n=!1){if(!o||!u)return;const i=Y({routeLines:r,currentRouteLayer:S(),from:o,to:u,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===C?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||!u)return;const t=V();if(!t){d.hide(),I.clear(),l.clearTrail(),m();return}d.place(o,u,t.routePoints,T),I.place(r),m(),g(null)}function w(){if(!o||!u)return;const t=V();t&&d.place(o,u,t.routePoints,T)}function F(){if(T=!1,!s||!o||!u)return null;const t=r.filter(h=>!h.virtual);if(!t.length)return null;const n=V(),i=n?l.applyToRoute(s,n,t):H(s,t,{snapThreshold:E,from:o,to:u});return i.snapped&&(y=!0),T=i.snapped,i}function k(){const t=Z(r,_());return N(t.lines,t.bounds),t}function j({from:t,to:n,waypoints:i,accessible:h}){const L=J({engine:A,from:t,to:n,waypoints:i,accessible:h});if(!L.length)return v(),!1;y=!1,o=t,u=n,r=L,U();const{lines:b}=k(),a=F();return w(),g(a),a&&m(a,!0),R(a?p:G(b)),e.flush(),!0}function q(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 z(){U();const t=F();w(),g(t),t&&m(t,!0),r.length&&k(),R(p),e.flush()}function v(){y=!1,r=[],o=null,u=null,p=0,d.hide(),I.clear(),l.clearTrail(),O.clear(),N([],null),R(0),e.flush()}function B(){v(),s=null,e.destroy()}return{setRoute:j,onPositionChanged:q,onFloorChanged:z,clearRoute:v,destroy:B}}
|
|
@@ -3,7 +3,10 @@ import type { RouteEndpoint, RoutePoint } from "../core";
|
|
|
3
3
|
import type { WayfindingRenderer } from "../renderer";
|
|
4
4
|
import type { FloorContext } from "./types";
|
|
5
5
|
interface EndpointView {
|
|
6
|
-
|
|
6
|
+
/** Place source/destination icons. `snapped` — the live CP is currently on the route, so its
|
|
7
|
+
* source shows greyed-out. A kiosk anchor (off-graph origin that isn't the CP) stays hidden;
|
|
8
|
+
* everything else (booth, CP off-route, no live CP) shows full-colour. */
|
|
9
|
+
place(from: RouteEndpoint, to: RouteEndpoint, visibleRoutePoints: ReadonlyArray<RoutePoint>, snapped: boolean): void;
|
|
7
10
|
hide(): void;
|
|
8
11
|
}
|
|
9
12
|
export declare function createEndpointView({ renderer, iconProvider, floorContext, layer, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function createEndpointView({renderer:n,iconProvider:c,floorContext:
|
|
1
|
+
import{CURRENT_POSITION_POINT_ID as I}from"./positionView";function p(n,c){return!c||!n.bounds&&n.id!==I}export function createEndpointView({renderer:n,iconProvider:c,floorContext:e,layer:i}){return{place(s,o,t,l){if(!t.length)return;const a=e.isLayerVisible(s.layer),d=e.isLayerVisible(o.layer),u=t[t.length-1],r=t[0],y=s.id===I&&l;n.setIcon("source",{canvas:c.getIcon(y?"source_inactive":"source").canvas,layer:i,x:u.x,y:u.y,hidden:p(s,a),dimmed:!a,cardinalSnap:!0}),n.setIcon("destination",{canvas:c.getIcon("destination").canvas,layer:i,x:r.x,y:r.y,hidden:!d||!o.bounds,dimmed:!d,cardinalSnap:!0})},hide(){n.setIcon("source",null),n.setIcon("destination",null)}}}
|
|
@@ -4,9 +4,9 @@ import type { WayfindingRenderer } from "../renderer";
|
|
|
4
4
|
import type { FloorContext, PositionInput } from "./types";
|
|
5
5
|
import type { TrailView } from "./trailView";
|
|
6
6
|
/**
|
|
7
|
-
* Snapshot of the visible route the position-trail view operates on. The
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Snapshot of the visible route the position-trail view operates on. The runtime computes it
|
|
8
|
+
* (visibility filtering, route-points derivation) and passes it in so the view stays free of
|
|
9
|
+
* route-state knowledge.
|
|
10
10
|
*/
|
|
11
11
|
export interface RouteSnapshot {
|
|
12
12
|
readonly from: RouteEndpoint;
|
|
@@ -15,10 +15,9 @@ export interface RouteSnapshot {
|
|
|
15
15
|
readonly visibleLines: ReadonlyArray<RouteLine>;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Owns the user-position icon and the single
|
|
19
|
-
* trail
|
|
20
|
-
*
|
|
21
|
-
* the same slot, so a single owner keeps the state machine simple.
|
|
18
|
+
* Owns the user-position icon and the single off-graph trail slot. The runtime decides which end of
|
|
19
|
+
* the route needs a trail (kiosk FROM, kiosk TO, or off-route CP FROM — never both at once in
|
|
20
|
+
* practice) and passes the corresponding `tip` + `anchor` here.
|
|
22
21
|
*/
|
|
23
22
|
interface PositionTrailView {
|
|
24
23
|
/** Place the position icon at the raw position. */
|
|
@@ -26,22 +25,17 @@ interface PositionTrailView {
|
|
|
26
25
|
/** Hide the position icon. */
|
|
27
26
|
hideIcon(): void;
|
|
28
27
|
/**
|
|
29
|
-
* Snap the position to `routeLines` (caller-provided — typically the full
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* is restored (or cleared when neither endpoint is off-graph).
|
|
33
|
-
* - Off-route: a trail is drawn from the position to the nearest end of
|
|
34
|
-
* the visible route; the icon stays where it was last placed.
|
|
28
|
+
* Snap the position to `routeLines` (caller-provided — typically the full non-virtual route
|
|
29
|
+
* across all floors) and place the position icon at the snap point or at the raw position.
|
|
30
|
+
* Returns the snap result; the trail is **not** touched — call `setTrail` separately.
|
|
35
31
|
*
|
|
36
|
-
* `routeLines` is decoupled from `route.visibleLines` so the snap stays
|
|
37
|
-
*
|
|
32
|
+
* `routeLines` is decoupled from `route.visibleLines` so the snap stays correct regardless of
|
|
33
|
+
* which floor is currently selected in the UI.
|
|
38
34
|
*/
|
|
39
35
|
applyToRoute(position: PositionInput, route: RouteSnapshot, routeLines: ReadonlyArray<RouteLine>): RouteSnapResult;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
refreshTrail(route: RouteSnapshot | null): void;
|
|
36
|
+
/** Draw the trail from `tip` (a route's graph endpoint) to `anchor` (the off-graph point).
|
|
37
|
+
* Passing either as null hides the trail. */
|
|
38
|
+
setTrail(tip: RoutePoint | null, anchor: RoutePoint | null): void;
|
|
45
39
|
/** Clear the trail slot (does not touch the icon). */
|
|
46
40
|
clearTrail(): void;
|
|
47
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{snapToRoute as
|
|
1
|
+
import{snapToRoute as T}from"../core";import{createPositionView as f}from"./positionView";const n="trail";export function createPositionTrailView({renderer:p,iconProvider:s,floorContext:l,trails:i,iconLayer:t,snapThreshold:d}){const r=f({renderer:p,iconProvider:s,layer:t});return{placeIcon(e){const a=!l.isLayerVisible(e.layer);r.place(e,a)},hideIcon(){r.hide()},applyToRoute(e,a,y){const c=T(e,[...y],{snapThreshold:d,from:a.from,to:a.to}),o=!l.isLayerVisible(e.layer);return c.snapped?r.place({...e,x:c.snappedPoint.x,y:c.snappedPoint.y},o):r.place(e,o),c},setTrail(e,a){e&&a?i.place(n,e,a):i.clear(n)},clearTrail(){i.clear(n)}}}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IconProvider } from "../adapters";
|
|
2
2
|
import type { WayfindingRenderer } from "../renderer";
|
|
3
3
|
import type { PositionInput } from "./types";
|
|
4
|
+
export declare const CURRENT_POSITION_POINT_ID = "current-position";
|
|
4
5
|
interface PositionView {
|
|
5
6
|
/**
|
|
6
7
|
* Place or update the current-position icon. The icon variant (dot vs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const c="position";export function createPositionView({renderer:o,iconProvider:
|
|
1
|
+
export const CURRENT_POSITION_POINT_ID="current-position";const c="position";export function createPositionView({renderer:o,iconProvider:i,layer:s}){return{place(n,t){const e=Number.isFinite(n.angle),a=e?"current_arrow":"current",r=e?n.angle*Math.PI/180:void 0;o.setIcon(c,{canvas:i.getIcon(a).canvas,layer:s,x:n.x,y:n.y,rotation:r,hidden:t,dimmed:t,origin:[.5,.5]})},hide(){o.setIcon(c,null)}}}
|
|
@@ -23,7 +23,7 @@ export declare function computeRouteRenderData({ routeLines, currentRouteLayer,
|
|
|
23
23
|
readonly currentRouteLayer: string | null;
|
|
24
24
|
readonly from: RouteEndpoint;
|
|
25
25
|
readonly to: RouteEndpoint;
|
|
26
|
-
readonly snap: RouteSnapResult |
|
|
26
|
+
readonly snap: RouteSnapResult | null;
|
|
27
27
|
}): RouteRenderData;
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=routeRenderData.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"tslib": "^2.3.0",
|
|
74
74
|
"uuid": "^9.0.1",
|
|
75
75
|
"zod": "4.3.5",
|
|
76
|
-
"@expofp/
|
|
77
|
-
"@expofp/
|
|
76
|
+
"@expofp/resolve": "3.6.1",
|
|
77
|
+
"@expofp/debug": "3.6.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.29.7",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"@vitejs/plugin-react": "^6.0.2",
|
|
90
90
|
"@vitest/browser": "^4.1.7",
|
|
91
91
|
"@vitest/browser-playwright": "^4.1.7",
|
|
92
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
92
93
|
"playwright": "^1.60.0",
|
|
93
94
|
"react": "^19.2.7",
|
|
94
95
|
"react-dom": "^19.2.7",
|
|
@@ -102,6 +103,11 @@
|
|
|
102
103
|
},
|
|
103
104
|
"nx": {
|
|
104
105
|
"targets": {
|
|
106
|
+
"lint": {
|
|
107
|
+
"options": {
|
|
108
|
+
"fix": false
|
|
109
|
+
}
|
|
110
|
+
},
|
|
105
111
|
"minify-esm": {
|
|
106
112
|
"dependsOn": [
|
|
107
113
|
"build",
|
package/dist/esm/RouteCutIn.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SpecialBooth } from "./store/BoothStore";
|
|
2
|
-
import Rect from "./core/Rect";
|
|
3
|
-
export declare class RouteCutIn extends SpecialBooth {
|
|
4
|
-
readonly id: number;
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly destination: LayerPoint;
|
|
7
|
-
readonly slug: string;
|
|
8
|
-
readonly meta: {};
|
|
9
|
-
protected readonly store: import("./store/BoothStore").default;
|
|
10
|
-
readonly exhibitors: never[];
|
|
11
|
-
readonly paths: never[];
|
|
12
|
-
readonly routePoint: LayerPoint;
|
|
13
|
-
readonly rect: Rect;
|
|
14
|
-
readonly entity: {
|
|
15
|
-
readonly type: "route-cut-in";
|
|
16
|
-
};
|
|
17
|
-
constructor(id: number, name: string, destination: LayerPoint, slug: string, meta?: {});
|
|
18
|
-
private findClosestRoutePoint;
|
|
19
|
-
private distanceToLine;
|
|
20
|
-
private findClosestPointOnLine;
|
|
21
|
-
private findClosestLineEnd;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=RouteCutIn.d.ts.map
|
package/dist/esm/RouteCutIn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SpecialBooth as b}from"./store/BoothStore";import{graphDataSource as E}from"./wayfinding/adapters";import P from"./store";import D from"./core/Rect";import{areLayersEnabled as S}from"./utils/areLayersEnabled";export class RouteCutIn extends b{id;name;destination;slug;meta;store=P.boothStore;exhibitors=[];paths=[];routePoint;rect=D.fromCxcywh(0,0,0,0);entity={type:"route-cut-in"};constructor(i,r,n,s,t={}){super(),this.id=i,this.name=r,this.destination=n,this.slug=s,this.meta=t,this.layer=P.layerStore.findLayer(n.layer),this.routePoint=this.findClosestRoutePoint();const e=this.findClosestLineEnd(this.routePoint);e&&(this.rect=D.fromCxcywh(e.x,e.y,1,1)),Object.freeze(this)}findClosestRoutePoint(){const i=E.getLines(),r=S()?i.filter(t=>t.p0.layer===this.destination.layer&&t.p1.layer===this.destination.layer):i;if(!r?.length)return null;let n=1/0,s=null;return r.forEach(t=>{const e=this.distanceToLine(this.destination,t.p0,t.p1);e<n&&(n=e,s=t)}),{...this.findClosestPointOnLine(this.destination,s),layer:this.destination.layer}}distanceToLine(i,r,n){const s=i.x,t=i.y,e=r.x,o=r.y,l=n.x,d=n.y,x=s-e,h=t-o,a=l-e,u=d-o,m=x*a+h*u,f=a*a+u*u;let c=-1;f!==0&&(c=m/f);let y,p;c<0?(y=e,p=o):c>1?(y=l,p=d):(y=e+c*a,p=o+c*u);const L=s-y,C=t-p;return Math.sqrt(L*L+C*C)}findClosestPointOnLine(i,r){const{x:n,y:s}=r.p0,{x:t,y:e}=r.p1,{x:o,y:l}=i,d=o-n,x=l-s,h=t-n,a=e-s,u=d*h+x*a,m=h*h+a*a;let f=-1;m!==0&&(f=u/m);let c,y;return f<0?(c=n,y=s):f>1?(c=t,y=e):(c=n+f*h,y=s+f*a),{x:c,y}}findClosestLineEnd(i){if(!i)return null;const r=E.getLineEnds(),n=S()?r.filter(o=>o.layer===i.layer):r;let s=null,t=1/0;function e(o,l,d,x){return Math.sqrt((d-o)**2+(x-l)**2)}return n.forEach(o=>{const l=e(i.x,i.y,o.x,o.y);l<t&&(t=l,s=o)}),s}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{distancePointToRouteOnLayer as u}from"./distanceToRoute";const c=10;export function shouldReroute(t,e,r=c){if(!t||!e.length)return!1;const l={layer:t.z!=null?String(t.z):"",x:t.x,y:t.y},n=u(l,e);return isFinite(n)&&n>r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lineLength as f}from"simple-geometry";import{computePolygonArea as l,pointInPolygon as a}from"../geometry/pointInPolygon";export function findGraphPointsInPolygon(r,n,t){const o=l(n);return r.getLineEnds().filter(e=>(!t||e.layer===t)&&a(e,n,o))}export function findNearestGraphPoint(r,n){let t=null,o=1/0;for(const e of r.getLineEnds()){if(n.layer&&e.layer!==n.layer)continue;const i=f(e,n);i<o&&(o=i,t=e)}return t}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Booth } from "../../store/BoothStore";
|
|
2
|
-
import type { CurrentPosition } from "../../store/RouteStore";
|
|
3
|
-
export declare function findBoothInRadius(position: CurrentPosition | null, booths: Booth[], excludeBooths?: Booth[], radius?: number): Booth | null;
|
|
4
|
-
//# sourceMappingURL=findBoothInRadius.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const s=20;function f(n,i,t){const u=n<t.x1?t.x1-n:n>t.x2?n-t.x2:0,d=i<t.y1?t.y1-i:i>t.y2?i-t.y2:0;return u*u+d*d}export function findBoothInRadius(n,i,t=[],u=20){if(!n||!i.length)return null;const d=n.z!=null?String(n.z):null,o=u*u,r=new Set(t.filter(e=>e?.id).map(e=>String(e.id)));let a=null,c=1/0;for(const e of i){if(!e.rect||e.id&&r.has(String(e.id))||d&&e.layer?.name!==d)continue;const l=f(n.x,n.y,e.rect);l<=o&&l<c&&(c=l,a=e)}return a}
|