@expofp/floorplan 3.2.6 → 3.2.8
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-AXeH9_mR.js → CookieConsent-B1LE7YfT.js} +2990 -2572
- package/dist/browser/{Debug-D5ilpjt9.js → Debug-DhDzWQYS.js} +7 -7
- package/dist/browser/{Demo-D2ZQ82R-.js → Demo-D_175gLz.js} +11 -11
- package/dist/browser/{Free-Cmu2GELK.js → Free-eF7PbjEi.js} +13 -13
- package/dist/browser/{Gallery-CHhf9uSJ.js → Gallery-BA-pvWo8.js} +9 -9
- package/dist/browser/{GpsLoader-D1p1K7tv.js → GpsLoader-CfS8cpM_.js} +35 -35
- package/dist/browser/{KioskStore-B5seJF_w.js → KioskStore-D6ga9Qev.js} +17 -17
- package/dist/browser/{Mapbox-vm-JvDPW.js → Mapbox-B2UgukAw.js} +41 -41
- package/dist/browser/{SetKioskMode-CsvIhnEp.js → SetKioskMode-DN9dYtQq.js} +18 -18
- package/dist/browser/ShowKiosk-NOvinyaO.js +26 -0
- package/dist/browser/{ThreeComponent-l50EC7kp.js → ThreeComponent-Dd6C-3ZE.js} +195 -195
- package/dist/browser/{TouchHand-CzIhbCk_.js → TouchHand-D4zCIp9f.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-DN5BiNZZ.js → ViewerMenuPanel-3gfsNYAC.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-BP0ji46o.js → add-debug-secret-listener-PCn2L2xn.js} +1 -1
- package/dist/browser/{boolean-editor-BIXc9xad.js → boolean-editor-C62I7paI.js} +10 -10
- package/dist/browser/bootIntercom-CJp5myUd.js +37 -0
- package/dist/browser/{box-Cj2OPB5o.js → box-BllGyNzW.js} +5 -5
- package/dist/browser/{browser-iEBlxETL.js → browser-hErw7TCJ.js} +2 -2
- package/dist/browser/bundle.json +53 -53
- package/dist/browser/{classnames-BdEjlCJw.js → classnames-DZ15rBvY.js} +2 -2
- package/dist/browser/{client-AFMbhyej.js → client-vSscuHGN.js} +4 -4
- package/dist/browser/{data-BNcMQJM9.js → data-Pg90oQgy.js} +49 -49
- package/dist/browser/{debug-overlay-BvzIl4S5.js → debug-overlay-Cz0LzO7B.js} +11 -11
- package/dist/browser/{debug-ui-Cjk1VEBj.js → debug-ui-HOJ52C7W.js} +6 -6
- package/dist/browser/{dist-CpONuUgR.js → dist-B-j5Mwk6.js} +5 -5
- package/dist/browser/{dist-CCy_DoUq.js → dist-D1FyJZyA.js} +6 -6
- package/dist/browser/{dist-B03hOAXP.js → dist-Di6V6Vgc.js} +3 -3
- package/dist/browser/{efp-debug-init-DjqnYMK4.js → efp-debug-init-GJ1wnZRj.js} +2 -2
- package/dist/browser/{enum-editor-DNavJMSd.js → enum-editor-DDYy1Hf6.js} +11 -11
- package/dist/browser/{exports-BaXbuICo.js → exports-D2FWPMfV.js} +1 -1
- package/dist/browser/{favicon-CPIIkXVW.js → favicon-CLnUT7_M.js} +1 -1
- package/dist/browser/{fetch-retry.umd-DuhpKOAv.js → fetch-retry.umd-CsTB0zFM.js} +2 -2
- package/dist/browser/{flex-BEEq9bN8.js → flex-fdrXlk1E.js} +6 -6
- package/dist/browser/{flex.props-DxAZIGSj.js → flex.props-CKl-laU4.js} +2 -2
- package/dist/browser/{floorplan.loader-KZ3u0Juq.js → floorplan.loader-B9u5roId.js} +9 -9
- package/dist/browser/{floorplan.ready-DMR98iUb.js → floorplan.ready-DhqJ6xoZ.js} +215 -254
- package/dist/browser/{fuse-CjSkZXtV.js → fuse-BiPQjoVv.js} +2 -2
- package/dist/browser/index.js +12 -12
- package/dist/browser/{is-debug-DPDBcjeg.js → is-debug-DatwRSE7.js} +3 -3
- package/dist/browser/{jsx-runtime-DnQmxKxk.js → jsx-runtime-IE8skafD.js} +2 -2
- package/dist/browser/{lib-BXRYaEmQ.js → lib-DeP5xNNM.js} +4 -4
- package/dist/browser/{main-Bw8nBuIh.js → main-DHo0y8hQ.js} +1 -1
- package/dist/browser/{mobx-DsBbHmhw.js → mobx-CrV9DCMJ.js} +4 -4
- package/dist/browser/{particles.min-BmgWvtXZ.js → particles.min-CvpZUl3e.js} +2 -2
- package/dist/browser/{prop-types-CRT2Qy-L.js → prop-types-BHwYgrUd.js} +2 -2
- package/dist/browser/{react-BCrcyjAU.js → react-B3Fm-ZS0.js} +2 -2
- package/dist/browser/{react-dom-z6XbaPl9.js → react-dom-CySklTOi.js} +3 -3
- package/dist/browser/{reset-all-settings-BOrTf1Lp.js → reset-all-settings-Cl74zGyE.js} +7 -7
- package/dist/browser/{rolldown-runtime-BSQQuCTD.js → rolldown-runtime-BAuBEODA.js} +1 -1
- package/dist/browser/{settings-DTDJKJjP.js → settings-BIgQOlLC.js} +2 -2
- package/dist/browser/{settings-item-DdnzmVZj.js → settings-item-CMHd9Vr7.js} +6 -6
- package/dist/browser/{store-CB1U4gvI.js → store-WG-XbhCX.js} +4643 -4503
- package/dist/browser/{string-editor-BEncfiNG.js → string-editor-Cdda3m3H.js} +8 -8
- package/dist/browser/{theme-RyeKAHMc.js → theme-CEfCl0Wg.js} +8 -8
- package/dist/browser/{ui-D5E2lSMl.js → ui-Cxw-zCCr.js} +8 -8
- package/dist/esm/RouteCutIn.js +1 -1
- package/dist/esm/components/IntercomLauncher.d.ts +5 -0
- package/dist/esm/components/IntercomLauncher.js +1 -0
- package/dist/esm/components/Layout.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/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/SearchBox.js +1 -1
- package/dist/esm/components/gps/useUserLocationAndHeading.js +1 -1
- package/dist/esm/components/gps/utils.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/intercom/bootIntercom.js +1 -19
- package/dist/esm/services/routing.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +0 -1
- package/dist/esm/store/BoothStore.js +1 -1
- package/dist/esm/store/IntercomStore.d.ts +7 -0
- package/dist/esm/store/IntercomStore.js +1 -0
- package/dist/esm/store/RootStore.d.ts +2 -0
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/index.d.ts +1 -0
- package/dist/esm/store/index.js +1 -1
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/tools/track-event.js +1 -1
- package/dist/esm/utils/customCommands.d.ts +1 -1
- package/dist/esm/utils/customCommands.js +1 -1
- package/dist/esm/utils/gps.d.ts +0 -1
- package/dist/esm/utils/gps.js +1 -1
- package/dist/esm/utils/haversineDistance.d.ts +7 -0
- package/dist/esm/utils/haversineDistance.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +13 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToWaypoint.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +20 -0
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -0
- package/dist/esm/wayfinding/adapters/floorContext.d.ts +10 -0
- package/dist/esm/wayfinding/adapters/floorContext.js +1 -0
- package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +15 -0
- package/dist/esm/wayfinding/adapters/index.d.ts +9 -0
- package/dist/esm/wayfinding/adapters/index.js +1 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.d.ts +7 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.js +1 -0
- package/dist/esm/wayfinding/adapters/positionInput.d.ts +11 -0
- package/dist/esm/wayfinding/adapters/positionInput.js +1 -0
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +27 -0
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -0
- package/dist/esm/wayfinding/{__tests__ → core/__tests__}/helpers.d.ts +0 -5
- package/dist/esm/wayfinding/core/__tests__/helpers.js +1 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.d.ts +16 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -0
- package/dist/esm/wayfinding/{graph → core/graph}/graphCache.d.ts +2 -1
- package/dist/esm/wayfinding/core/index.d.ts +16 -0
- package/dist/esm/wayfinding/core/index.js +1 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.js +1 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +22 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.js +1 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.d.ts +4 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -0
- package/dist/esm/{components/Map/drawing/config/route-snapping → wayfinding/core/position}/splitRouteByPoint.d.ts +1 -1
- package/dist/esm/wayfinding/core/position/splitRouteByPoint.js +1 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.d.ts +19 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.js +1 -0
- package/dist/esm/wayfinding/{rendering → core/rendering}/computeTransitionPoints.d.ts +2 -2
- package/dist/esm/wayfinding/core/rendering/computeTransitionPoints.js +1 -0
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.d.ts +11 -0
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.js +1 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.d.ts +20 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.js +1 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.d.ts +15 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.js +1 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.d.ts +19 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.js +1 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.d.ts +7 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.js +1 -0
- package/dist/esm/wayfinding/{types.d.ts → core/types.d.ts} +37 -0
- package/dist/esm/wayfinding/createWayfinding.d.ts +3 -0
- package/dist/esm/wayfinding/createWayfinding.js +1 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.d.ts +25 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -0
- package/dist/esm/wayfinding/handlers/yahHandler.d.ts +23 -0
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -0
- package/dist/esm/wayfinding/layers.d.ts +14 -0
- package/dist/esm/wayfinding/layers.js +1 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.d.ts +14 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -0
- package/dist/esm/wayfinding/renderer/iconManager.d.ts +31 -0
- package/dist/esm/wayfinding/renderer/iconManager.js +1 -0
- package/dist/esm/wayfinding/renderer/index.d.ts +3 -0
- package/dist/esm/wayfinding/renderer/index.js +1 -0
- package/dist/esm/wayfinding/renderer/layerManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/layerManager.js +1 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +42 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.js +1 -0
- package/dist/esm/wayfinding/renderer/trailManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/trailManager.js +1 -0
- package/dist/esm/wayfinding/renderer/types.d.ts +162 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.d.ts +3 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -0
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +16 -0
- package/dist/esm/wayfinding/runtime/endpointView.js +1 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.d.ts +13 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.js +1 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +57 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.js +1 -0
- package/dist/esm/wayfinding/runtime/positionView.d.ts +23 -0
- package/dist/esm/wayfinding/runtime/positionView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.d.ts +29 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.js +1 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +14 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.js +1 -0
- package/dist/esm/wayfinding/runtime/trailView.d.ts +21 -0
- package/dist/esm/wayfinding/runtime/trailView.js +1 -0
- package/dist/esm/wayfinding/runtime/transitionView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/transitionView.js +1 -0
- package/dist/esm/wayfinding/runtime/types.d.ts +72 -0
- package/dist/esm/wayfinding/runtime/types.js +1 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.d.ts +4 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.js +1 -0
- package/package.json +3 -3
- package/dist/browser/ShowKiosk-BL9nfBDf.js +0 -26
- package/dist/browser/bootIntercom-D3i1xdrZ.js +0 -40
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.d.ts +0 -14
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.js +0 -1
- package/dist/esm/components/Map/drawing/config/config-wf.d.ts +0 -8
- package/dist/esm/components/Map/drawing/config/config-wf.js +0 -1
- package/dist/esm/components/Map/drawing/config/config-yah.d.ts +0 -2
- package/dist/esm/components/Map/drawing/config/config-yah.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/index.d.ts +0 -5
- package/dist/esm/components/Map/drawing/config/route-snapping/index.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.d.ts +0 -21
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/splitRouteByPoint.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/types.d.ts +0 -18
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.d.ts +0 -29
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.js +0 -1
- package/dist/esm/utils/buildOptimizedRoute.d.ts +0 -11
- package/dist/esm/utils/buildOptimizedRoute.js +0 -1
- package/dist/esm/utils/yah.d.ts +0 -8
- package/dist/esm/utils/yah.js +0 -1
- package/dist/esm/wayfinding/_PLAN-public-api.d.ts +0 -220
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.d.ts +0 -27
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.js +0 -1
- package/dist/esm/wayfinding/__tests__/helpers.js +0 -1
- package/dist/esm/wayfinding/index.d.ts +0 -18
- package/dist/esm/wayfinding/index.js +0 -1
- package/dist/esm/wayfinding/rendering/computeTransitionPoints.js +0 -1
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.d.ts +0 -19
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.js +0 -1
- package/dist/esm/wayfinding/rendering/routeGeometry.d.ts +0 -16
- package/dist/esm/wayfinding/rendering/routeGeometry.js +0 -1
- package/dist/esm/wayfinding/routing/getGraphLines.d.ts +0 -14
- package/dist/esm/wayfinding/routing/getGraphLines.js +0 -1
- /package/dist/esm/{components/Map/drawing/config/route-snapping/types.js → wayfinding/adapters/iconProvider.js} +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphCache.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.js +0 -0
- /package/dist/esm/wayfinding/{types.js → core/types.js} +0 -0
- /package/dist/esm/wayfinding/{_PLAN-public-api.js → renderer/types.js} +0 -0
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
export type Unsubscribe = () => void;
|
|
2
|
-
export interface Point {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
layer: string;
|
|
6
|
-
}
|
|
7
|
-
export interface RouteEstimation {
|
|
8
|
-
/** Длина маршрута в единицах пространства */
|
|
9
|
-
distance: number;
|
|
10
|
-
/** Примерное время в секундах */
|
|
11
|
-
duration: number;
|
|
12
|
-
}
|
|
13
|
-
export interface Route {
|
|
14
|
-
points: Point[];
|
|
15
|
-
estimation: RouteEstimation;
|
|
16
|
-
}
|
|
17
|
-
export interface RouteResult {
|
|
18
|
-
primary: Route;
|
|
19
|
-
alternatives: Route[];
|
|
20
|
-
}
|
|
21
|
-
export interface RouteRequest {
|
|
22
|
-
from: Point;
|
|
23
|
-
to: Point;
|
|
24
|
-
}
|
|
25
|
-
export interface MultiPointRouteRequest {
|
|
26
|
-
points: [Point, Point, ...Point[]];
|
|
27
|
-
/**
|
|
28
|
-
* false (дефолт) — маршрут строится в переданном порядке точек.
|
|
29
|
-
* true — порядок промежуточных точек оптимизируется (TSP).
|
|
30
|
-
* Старт и финиш (первая и последняя точки) всегда фиксированы.
|
|
31
|
-
*/
|
|
32
|
-
optimize?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export type ManeuverType = 'straight' | 'turn-left' | 'turn-right' | 'turn-slight-left' | 'turn-slight-right' | 'u-turn' | 'take-elevator' | 'take-stairs' | 'take-escalator' | 'exit-building' | 'enter-building' | 'change-layer' | 'arrive';
|
|
35
|
-
export interface Instruction {
|
|
36
|
-
type: ManeuverType;
|
|
37
|
-
/** Локализованный текст */
|
|
38
|
-
text: string;
|
|
39
|
-
/** Расстояние до следующего манёвра */
|
|
40
|
-
distance: number;
|
|
41
|
-
bearing?: number;
|
|
42
|
-
isLayerTransition: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface NavigationProgress {
|
|
45
|
-
status: 'active' | 'paused' | 'arrived' | 'off-route';
|
|
46
|
-
currentInstruction: Instruction;
|
|
47
|
-
nextInstruction: Instruction | null;
|
|
48
|
-
distanceToNextManeuver: number;
|
|
49
|
-
distanceToDestination: number;
|
|
50
|
-
/** Секунды */
|
|
51
|
-
timeToDestination: number;
|
|
52
|
-
currentLayer: string;
|
|
53
|
-
/** Позиция пользователя привязанная к маршруту */
|
|
54
|
-
snappedPoint: Point;
|
|
55
|
-
offRouteDistance?: number;
|
|
56
|
-
}
|
|
57
|
-
export interface UserPosition {
|
|
58
|
-
point: Point;
|
|
59
|
-
heading?: number;
|
|
60
|
-
}
|
|
61
|
-
export interface MarkerIcon {
|
|
62
|
-
svg: string;
|
|
63
|
-
width?: number;
|
|
64
|
-
height?: number;
|
|
65
|
-
}
|
|
66
|
-
export interface RouteLineStyle {
|
|
67
|
-
color?: string;
|
|
68
|
-
width?: number;
|
|
69
|
-
opacity?: number;
|
|
70
|
-
}
|
|
71
|
-
export type RouteAnimation = (lines: LineDef[], route: Route) => () => void;
|
|
72
|
-
export interface LineDef {
|
|
73
|
-
points: [Vector2Like, Vector2Like];
|
|
74
|
-
color: string;
|
|
75
|
-
width: number;
|
|
76
|
-
}
|
|
77
|
-
export interface Vector2Like {
|
|
78
|
-
x: number;
|
|
79
|
-
y: number;
|
|
80
|
-
}
|
|
81
|
-
export interface RendererStyle {
|
|
82
|
-
route?: RouteLineStyle;
|
|
83
|
-
animation?: RouteAnimation;
|
|
84
|
-
alternativeRoute?: {
|
|
85
|
-
line?: RouteLineStyle;
|
|
86
|
-
opacity?: number;
|
|
87
|
-
};
|
|
88
|
-
markers?: {
|
|
89
|
-
origin?: MarkerIcon;
|
|
90
|
-
destination?: MarkerIcon;
|
|
91
|
-
waypoint?: MarkerIcon;
|
|
92
|
-
userPosition?: MarkerIcon;
|
|
93
|
-
layerTransition?: {
|
|
94
|
-
up?: MarkerIcon;
|
|
95
|
-
down?: MarkerIcon;
|
|
96
|
-
/** Переход без смены уровня (например переход между корпусами на одном этаже) */
|
|
97
|
-
same?: MarkerIcon;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Рендерер — единственная визуальная зависимость wayfinding-модуля.
|
|
103
|
-
* Реализуй этот интерфейс если хочешь использовать свой рендерер.
|
|
104
|
-
*/
|
|
105
|
-
export interface WayfindingRenderer {
|
|
106
|
-
renderRoute(route: Route, style: RendererStyle): void;
|
|
107
|
-
renderAlternatives(routes: Route[], style: RendererStyle): void;
|
|
108
|
-
clearRoute(): void;
|
|
109
|
-
renderPosition(position: UserPosition): void;
|
|
110
|
-
clearPosition(): void;
|
|
111
|
-
/** Переключить отображаемый слой */
|
|
112
|
-
setActiveLayer(layerId: string): void;
|
|
113
|
-
destroy(): void;
|
|
114
|
-
}
|
|
115
|
-
export interface WayfindingEventMap {
|
|
116
|
-
'route:ready': {
|
|
117
|
-
result: RouteResult;
|
|
118
|
-
};
|
|
119
|
-
'route:error': {
|
|
120
|
-
error: WayfindingError;
|
|
121
|
-
};
|
|
122
|
-
'route:cleared': Record<string, never>;
|
|
123
|
-
'navigation:started': {
|
|
124
|
-
route: Route;
|
|
125
|
-
};
|
|
126
|
-
'navigation:progress': {
|
|
127
|
-
progress: NavigationProgress;
|
|
128
|
-
};
|
|
129
|
-
'navigation:instruction': {
|
|
130
|
-
instruction: Instruction;
|
|
131
|
-
};
|
|
132
|
-
'navigation:deviation': {
|
|
133
|
-
offRouteDistance: number;
|
|
134
|
-
};
|
|
135
|
-
'navigation:rerouting': Record<string, never>;
|
|
136
|
-
'navigation:rerouted': {
|
|
137
|
-
result: RouteResult;
|
|
138
|
-
};
|
|
139
|
-
'navigation:arrived': Record<string, never>;
|
|
140
|
-
'navigation:stopped': Record<string, never>;
|
|
141
|
-
'navigation:paused': Record<string, never>;
|
|
142
|
-
'navigation:resumed': Record<string, never>;
|
|
143
|
-
'location:update': {
|
|
144
|
-
position: UserPosition;
|
|
145
|
-
};
|
|
146
|
-
'location:lost': Record<string, never>;
|
|
147
|
-
'layer:change': {
|
|
148
|
-
from: string | null;
|
|
149
|
-
to: string;
|
|
150
|
-
};
|
|
151
|
-
'error': {
|
|
152
|
-
error: WayfindingError;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
export type WayfindingEventName = keyof WayfindingEventMap;
|
|
156
|
-
export type WayfindingErrorCode = 'NO_ROUTE_FOUND' | 'SPACE_NOT_LOADED' | 'LOCATION_UNAVAILABLE' | 'UNKNOWN';
|
|
157
|
-
export interface WayfindingError {
|
|
158
|
-
code: WayfindingErrorCode;
|
|
159
|
-
message: string;
|
|
160
|
-
cause?: unknown;
|
|
161
|
-
}
|
|
162
|
-
export interface WayfindingEngineConfig {
|
|
163
|
-
/**
|
|
164
|
-
* Данные пространства — передаются как есть.
|
|
165
|
-
* Engine сам определяет формат (lines/lineEnds, GeoJSON, NavMesh, Grid…)
|
|
166
|
-
* через зарегистрированные адаптеры.
|
|
167
|
-
*/
|
|
168
|
-
space: unknown;
|
|
169
|
-
/**
|
|
170
|
-
* Рендерер — рисует маршрут, маркеры, анимацию.
|
|
171
|
-
* Передай свой если уже есть своя карта.
|
|
172
|
-
*/
|
|
173
|
-
renderer: WayfindingRenderer;
|
|
174
|
-
/** Начальный стиль. Незаданные поля — дефолты рендерера. */
|
|
175
|
-
style?: RendererStyle;
|
|
176
|
-
rerouting?: {
|
|
177
|
-
/** Включить автоматический перерасчёт маршрута. По умолчанию false. */
|
|
178
|
-
enabled: boolean;
|
|
179
|
-
/** Расстояние отклонения от маршрута в единицах пространства после которого запускается перерасчёт */
|
|
180
|
-
threshold: number;
|
|
181
|
-
};
|
|
182
|
-
locale?: string;
|
|
183
|
-
}
|
|
184
|
-
export interface WayfindingEngine {
|
|
185
|
-
destroy(): void;
|
|
186
|
-
/** Построить маршрут. Результат также придёт событием 'route:ready'. */
|
|
187
|
-
route(request: RouteRequest): Promise<RouteResult>;
|
|
188
|
-
/** Построить маршрут через несколько точек в заданном порядке. */
|
|
189
|
-
routeMultiPoint(request: MultiPointRouteRequest): Promise<RouteResult>;
|
|
190
|
-
getCurrentRoute(): RouteResult | null;
|
|
191
|
-
clearRoute(): void;
|
|
192
|
-
startNavigation(): Promise<void>;
|
|
193
|
-
pauseNavigation(): void;
|
|
194
|
-
resumeNavigation(): void;
|
|
195
|
-
stopNavigation(): void;
|
|
196
|
-
getProgress(): NavigationProgress | null;
|
|
197
|
-
/**
|
|
198
|
-
* Обновить позицию пользователя.
|
|
199
|
-
* Если position.point.layer === 'unknown' — engine определит слой автоматически
|
|
200
|
-
* через snap к ближайшему узлу пространства и выдаст 'location:update'
|
|
201
|
-
* с разрешённым layer.
|
|
202
|
-
*/
|
|
203
|
-
updatePosition(position: UserPosition): void;
|
|
204
|
-
on<E extends WayfindingEventName>(event: E, handler: (payload: WayfindingEventMap[E]) => void): Unsubscribe;
|
|
205
|
-
once<E extends WayfindingEventName>(event: E, handler: (payload: WayfindingEventMap[E]) => void): Unsubscribe;
|
|
206
|
-
/** Текущее состояние — для синхронного чтения при первом рендере */
|
|
207
|
-
getState(): WayfindingState;
|
|
208
|
-
}
|
|
209
|
-
/** Factory function — создаёт и инициализирует engine. */
|
|
210
|
-
export declare function createWayfindingEngine(config: WayfindingEngineConfig): Promise<WayfindingEngine>;
|
|
211
|
-
export interface WayfindingState {
|
|
212
|
-
route: RouteResult | null;
|
|
213
|
-
progress: NavigationProgress | null;
|
|
214
|
-
/** Текущий активный слой карты */
|
|
215
|
-
activeLayer: string | null;
|
|
216
|
-
/** Последняя известная позиция пользователя с разрешённым layer */
|
|
217
|
-
userPosition: UserPosition | null;
|
|
218
|
-
spaceLoaded: boolean;
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=_PLAN-public-api.d.ts.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Booth } from "../../../store/BoothStore";
|
|
2
|
-
export declare class RouteLine {
|
|
3
|
-
p0: RoutePoint;
|
|
4
|
-
p1: RoutePoint;
|
|
5
|
-
unaccessible: boolean;
|
|
6
|
-
unidirection: boolean;
|
|
7
|
-
virtual: boolean;
|
|
8
|
-
weight: number;
|
|
9
|
-
constructor(p0: RoutePoint, p1: RoutePoint, unaccessible: boolean, unidirection: boolean, virtual: boolean, weight: number);
|
|
10
|
-
}
|
|
11
|
-
export declare class RoutePoint {
|
|
12
|
-
layer: string;
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
constructor(layer: string, x: number, y: number);
|
|
16
|
-
}
|
|
17
|
-
type Sublines = {
|
|
18
|
-
lines: RouteLine[];
|
|
19
|
-
lineEnds: RoutePoint[];
|
|
20
|
-
};
|
|
21
|
-
export declare let sublines: () => Sublines;
|
|
22
|
-
export declare function resetPathFinder(): void;
|
|
23
|
-
export declare function setSublines(fn: () => Sublines): void;
|
|
24
|
-
export declare function getGraphLines(fromBooth: Booth, toBooth: Booth, onlyAccessible?: boolean, waypoints?: Booth[]): RouteLine[];
|
|
25
|
-
export declare function getRouteLength(routeLines: RouteLine[]): number;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=legacyWayfinding.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lineAngle as L,lineLength as w,Point as u,pointInsideRectangle as F,Rect as I}from"simple-geometry";import $ from"../../../core/Polygon";import M from"../../graph/utils/a-star/a-star";import S from"ngraph.graph";export class RouteLine{p0;p1;unaccessible;unidirection;virtual;weight;constructor(n,r,s,a,i,t){this.p0=n,this.p1=r,this.unaccessible=s,this.unidirection=a,this.virtual=i,this.weight=t}}export class RoutePoint{layer;x;y;constructor(n,r,s){this.layer=n,this.x=r,this.y=s}}const P=e=>`${e.layer}_${e.x}_${e.y}`,b=(e,n)=>e.layer===n.layer&&w(e,n)<=1,W=(e,n,r)=>b(e.p0,n)&&b(e.p1,r)&&e.p0.layer===n.layer&&e.p1.layer===r.layer||b(e.p0,r)&&b(e.p1,n)&&e.p0.layer===r.layer&&e.p1.layer===n.layer;function _(e){const n=e.split("_");return[n[0],parseFloat(n[1]),parseFloat(n[2])]}export let sublines=()=>window.__wfData;let g={finder:null,oriented:!0,onlyAccessible:!1};export function resetPathFinder(){g.finder=null}export function setSublines(e){sublines=e}const k=0;function T(e,n){const r=S(),s=performance.now();let{lines:a}=sublines();a.forEach(t=>{(!n||!t.unaccessible)&&(r.addLink(P(t.p0),P(t.p1),{distance:t.virtual?k:w(t.p0,t.p1)/(t.weight||4)}),e&&!t.unidirection&&r.addLink(P(t.p1),P(t.p0),{distance:t.virtual?k:w(t.p1,t.p0)/(t.weight||4)}))}),g.oriented=e,g.onlyAccessible=n,g.finder=M(r,{oriented:e,distance(t,o,p){var d=1;if(o.parent){const h=_(o.parent?.node.id),f=_(o.node.id),m=_(t.id);var y=L({x:h[1],y:h[2]},{x:f[1],y:f[2]}),x=L({x:f[1],y:f[2]},{x:m[1],y:m[2]});y!==x&&(d=1.01)}return d*p.data.distance}});const i=performance.now();console.debug(`WF. Graph created. ~ ${i-s}ms.`)}function j(e,n,r){return e.filter(s=>W(s,n,r))[0]}export function getGraphLines(e,n,r=!1,s=[]){let a=performance.now();const i=$.fromRect(e.rect).rotate(e.rotate,e.rect.cx,e.rect.cy),t=$.fromRect(n.rect).rotate(n.rotate,n.rect.cx,n.rect.cy),o=new I(new u(i.x1,i.y1),new u(i.x2,i.y2),new u(i.x3,i.y3),new u(i.x4,i.y4)),p=new I(new u(t.x1,t.y1),new u(t.x2,t.y2),new u(t.x3,t.y3),new u(t.x4,t.y4)),d=new Map(s.map(l=>{const c=$.fromRect(l.rect).rotate(l.rotate,l.rect.cx,l.rect.cy);return[l.id,new I(new u(c.x1,c.y1),new u(c.x2,c.y2),new u(c.x3,c.y3),new u(c.x4,c.y4))]}));(!g.finder||g.onlyAccessible!==r)&&T(g.oriented,r);const y=[],x=[];let{lines:h,lineEnds:f}=sublines();for(let l=0;l<f.length;l++){const c=f[l],R=(c.layer===e.layer?.name||!e.layer)&&F(c,o),v=(c.layer===n.layer?.name||!n.layer)&&F(c,p);R&&y.push(c),v&&x.push(c)}const m=[],A=[y,...s.reduce((l,c)=>{const R=d.get(c.id);if(R){const v=f.filter(G=>(G.layer===c.layer?.name||!c.layer)&&F(G,R));v.length>0&&l.push(v)}return l},[]),x];if(m.push(...A.slice(1).map((l,c)=>D(A[c],l)).reverse().flat()),!m.length)return console.debug(`WF. Get graph lines: 0 ~ ${performance.now()-a}ms.`),[];const E=m.flatMap(l=>U(l.points,h));return console.debug(`WF. Get graph lines: ${E.length} ~ ${performance.now()-a}ms.`),E}function D(e,n){const r=[];for(let s=0;s<e.length;s++)for(let a=0;a<n.length;a++)try{const i=g.finder.find(P(e[s]),P(n[a]));if(!i.length)continue;let t=0,o=[];for(let p=0;p<i.length;p++){const d=i[p],y=i[p+1],x=d.id,h=_(x);o.push(new RoutePoint(h[0],h[1],h[2])),y&&(t+=d.links.find(f=>f.toId===x&&f.fromId===y.id).data.distance)}r.push({distance:t,points:o})}catch(i){console.warn(i)}return r.sort((s,a)=>s.distance-a.distance).slice(0,1)}function U(e,n){let r=[];for(let s=1;s<e.length;s++){const a=e[s-1],i=e[s];let t=j(n,a,i);if(!t)continue;let o=new RouteLine(a,i,t.unaccessible,t.unidirection,t.virtual,t.weight);w(t.p0,i)<w(t.p0,a)&&(o.p0=a,o.p1=i);const p=r[r.length-1],d=p?L(p.p0,p.p1):null,y=L(o.p0,o.p1);!p||p.virtual!==o.virtual||Math.abs(y-d)>5?r.push(o):p.p1=o.p1}return r}export function getRouteLength(e){return e.reduce((n,r)=>n+w(r.p0,r.p1),0)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vi as u}from"vitest";export function makePoint(e,t,n){return{layer:e,x:t,y:n}}export function makeLinearGraph(e,...t){const n=t.map(([i,r])=>makePoint(e,i,r)),o=n.slice(1).map((i,r)=>makeLine(n[r],i));return{points:n,lines:o}}export function makeLine(e,t,n={}){return{p0:e,p1:t,unaccessible:!1,unidirection:!1,virtual:!1,weight:4,...n}}export function makeNode(e,t,n){return{id:`${e}_${t}_${n}`,layer:e,x:t,y:n}}export function createMockDataSource(e={}){return{getLines:()=>e.lines??[],getLineEnds:()=>e.lineEnds??[]}}export function createMockGraph(e={}){const{lines:t=[],lineEnds:n=[],hasNodeResult:o=!0,findResult:i=[],graphOptions:r}=e;return{finder:{build:u.fn(),hasNode:typeof o=="function"?u.fn(o):u.fn().mockReturnValue(o),find:typeof i=="function"?u.fn(i):u.fn().mockReturnValue(i)},dataSource:{getLines:()=>t,getLineEnds:()=>n},options:r??{oriented:!0}}}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type { RoutePoint, RouteLine, RouteResult, } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* TODO: The exports below are temporary. They exist because RouteStore and config-wf.ts call wayfinding functions directly.
|
|
4
|
-
* When WayfindingRuntime and WayfindingStore are created (ARCHITECTURE.md phases 7-8), these will
|
|
5
|
-
* become internal implementation details and should be removed from the
|
|
6
|
-
* public barrel.
|
|
7
|
-
*/
|
|
8
|
-
export type { RouteWaypoint } from "./types";
|
|
9
|
-
export { getGraphLines } from "./routing/getGraphLines";
|
|
10
|
-
export { getRouteLength } from "./routing/getRouteLength";
|
|
11
|
-
export { computeTransitionPoints } from "./rendering/computeTransitionPoints";
|
|
12
|
-
export { normalizeRouteDirection } from "./rendering/normalizeRouteDirection";
|
|
13
|
-
export { bezierCurve, splitPolyLine } from "./rendering/routeGeometry";
|
|
14
|
-
export { createGraphCache } from "./graph/graphCache";
|
|
15
|
-
export type { GraphCache } from "./graph/graphCache";
|
|
16
|
-
export { boothToWaypoint } from "./adapters/boothToWaypoint";
|
|
17
|
-
export { graphDataSource } from "./adapters/graphDataSource";
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{getGraphLines}from"./routing/getGraphLines";export{getRouteLength}from"./routing/getRouteLength";export{computeTransitionPoints}from"./rendering/computeTransitionPoints";export{normalizeRouteDirection}from"./rendering/normalizeRouteDirection";export{bezierCurve,splitPolyLine}from"./rendering/routeGeometry";export{createGraphCache}from"./graph/graphCache";export{boothToWaypoint}from"./adapters/boothToWaypoint";export{graphDataSource}from"./adapters/graphDataSource";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function s(o,n){return o.toLowerCase()===n.toLowerCase()}function p(o,n){return o.findIndex(r=>s(r,n))}function x(o,n,r){const a=p(o,n),t=p(o,r);return a===-1||t===-1?"neutral":t>a?"up":"down"}function d(o,n,r){return o.find(a=>s(a.p0.layer,n)?!r.has(a.p1.layer.toLowerCase()):s(a.p1.layer,n)?!r.has(a.p0.layer.toLowerCase()):!1)}function C(o,n,r,a){if(n.has(a.toLowerCase()))return a;let t=a;const l=new Set([r.toLowerCase(),t.toLowerCase()]);let u=d(o,t,l);for(;u&&(t=s(u.p0.layer,t)?u.p1.layer:u.p0.layer,!n.has(t.toLowerCase()));)l.add(t.toLowerCase()),u=d(o,t,l);return t}export function computeTransitionPoints(o){const{routeLines:n,currentLayerName:r,floorOrder:a}=o,t=n.filter(e=>e.virtual&&!s(e.p0.layer,e.p1.layer)),l=new Set;for(const e of n)e.virtual||(l.add(e.p0.layer.toLowerCase()),l.add(e.p1.layer.toLowerCase()));const w=(r?t.filter(e=>s(e.p0.layer,r)||s(e.p1.layer,r)):t).map(e=>{const c=r?s(e.p0.layer,r):!0,i=c?e.p0:e.p1,L=c?e.p1:e.p0,f=C(t,l,i.layer,L.layer);return{x:i.x,y:i.y,layer:i.layer,targetLayer:f,direction:x(a,i.layer,f),role:r&&c?"entry":"exit"}}),y=new Set;return w.filter(e=>{const c=`${e.x}:${e.y}`;return y.has(c)?!1:(y.add(c),!0)})}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RouteLine, RoutePoint } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Ensures that `routeLines` run in the from→to direction.
|
|
4
|
-
*
|
|
5
|
-
* A* returns paths in target→source order. For rendering (arrow animation,
|
|
6
|
-
* route progress split) the lines must go from the origin to the destination.
|
|
7
|
-
*
|
|
8
|
-
* The function projects `from` and `to` onto `entireRouteLines` (the full
|
|
9
|
-
* multi-floor route) and reverses `routeLines` if `from` is closer to the
|
|
10
|
-
* polyline end than to its start.
|
|
11
|
-
*
|
|
12
|
-
* @param entireRouteLines Full route across all floors (used to determine direction).
|
|
13
|
-
* @param routeLines Lines to normalize (may be a floor-filtered subset).
|
|
14
|
-
* @param from Route origin (user-selected "from" point).
|
|
15
|
-
* @param to Route destination (user-selected "to" point).
|
|
16
|
-
* @returns Lines guaranteed to run from→to, or the original array unchanged.
|
|
17
|
-
*/
|
|
18
|
-
export declare function normalizeRouteDirection(entireRouteLines: RouteLine[], routeLines: RouteLine[], from: RoutePoint, to: RoutePoint): RouteLine[];
|
|
19
|
-
//# sourceMappingURL=normalizeRouteDirection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function l(n,r,d){let a=0,p=1/0,e=1/0;const s=d.reduce((c,t)=>c+t,0);for(let c=0;c<r.length;c++){const t=r[c],f=d[c];if(t.p0.layer!==n.layer){a+=f;continue}const o=t.p1.x-t.p0.x,y=t.p1.y-t.p0.y,h=o*o+y*y;if(h<1e-10){a+=f;continue}const i=((n.x-t.p0.x)*o+(n.y-t.p0.y)*y)/h,u=Math.max(0,Math.min(1,i)),x=t.p0.x+o*u,g=t.p0.y+y*u,m=Math.hypot(n.x-x,n.y-g);m<p&&(p=m,e=a+f*u),a+=f}return{found:e!==1/0,fromStart:e,total:s}}export function normalizeRouteDirection(n,r,d,a){if(!r.length)return r;const p=n.map(o=>Math.hypot(o.p1.x-o.p0.x,o.p1.y-o.p0.y)),e=l(d,n,p),s=e.found?e:l(a,n,p);if(!s.found)return r;const c=s.fromStart,t=s.total-s.fromStart;return(e.found?t<c:c<t)?r.slice().reverse().map(o=>({...o,p0:o.p1,p1:o.p0})):r}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Point, Line } from "simple-geometry";
|
|
2
|
-
/**
|
|
3
|
-
* Recursive De Casteljau interpolation for a Bézier curve.
|
|
4
|
-
* Returns the point on the curve defined by `controlPoints` at parameter `t` (0–1).
|
|
5
|
-
*/
|
|
6
|
-
export declare function bezierCurve(controlPoints: Point[], t: number): Point;
|
|
7
|
-
/**
|
|
8
|
-
* Splits a polyline (sequence of line segments) into evenly spaced points
|
|
9
|
-
* separated by `interval` units. Preserves the first and last points of the polyline.
|
|
10
|
-
*
|
|
11
|
-
* When segments meet at an angle, the remaining distance from the previous segment
|
|
12
|
-
* is projected onto the next segment direction (cosine correction) to maintain
|
|
13
|
-
* visually consistent spacing around corners.
|
|
14
|
-
*/
|
|
15
|
-
export declare function splitPolyLine(lines: Line[], interval: number): Point[];
|
|
16
|
-
//# sourceMappingURL=routeGeometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function bezierCurve(t,e){if(t.length===0)return{x:0,y:0};if(t.length===1)return t[0];const s=[];for(let n=0;n<t.length-1;n++){const c=(1-e)*t[n].x+e*t[n+1].x,x=(1-e)*t[n].y+e*t[n+1].y;s.push({x:c,y:x})}return bezierCurve(s,e)}export function splitPolyLine(t,e){if(t.length===0)return[];if(e<=0)return[t[0].p0,t[t.length-1].p1];const s=[];let n=0;for(let o=0;o<t.length;o++){const M=t[o],p=M.p0,l=M.p1,u=l.x-p.x,a=l.y-p.y,h=Math.sqrt(u*u+a*a);if(h===0)continue;const w=u/h,X=a/h;let r=0;for(;n+r*e<=h;){const f=n+r*e,g=p.x+w*f,i=p.y+X*f;s.push({x:g,y:i}),r++}const Y=n+(r-1)*e;let y=h-Y;if(y=Math.max(y,0),o<t.length-1){const f=t[o+1],g=f.p0,i=f.p1,d=i.x-g.x,D=i.y-g.y,L=Math.sqrt(d*d+D*D);if(L===0)n=0;else{const q=d/L,b=D/L,z=w*q+X*b,A=y*z;n=e-A}}else n=e-y;n=Math.max(n,0)}const c=t[0].p0;(s.length===0||s[0].x!==c.x||s[0].y!==c.y)&&s.unshift(c);const x=t[t.length-1].p1,m=s[s.length-1];return(m.x!==x.x||m.y!==x.y)&&s.push(x),s}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RouteWaypoint, RouteLine, GraphDataSource } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* High-level routing: resolves waypoints to route lines using a cached graph.
|
|
4
|
-
* Accepts `GraphDataSource` explicitly — no global configuration.
|
|
5
|
-
*
|
|
6
|
-
* Orchestrates two steps:
|
|
7
|
-
* 1. Resolve: waypoint → candidate graph points (via resolveWaypointCandidates)
|
|
8
|
-
* 2. Route: candidate points → shortest path via A* (via buildRoute / buildMultiPointRoute)
|
|
9
|
-
*
|
|
10
|
-
* Returns lines in **target→source** order — the convention used throughout
|
|
11
|
-
* the pipeline (see `aStarPathFinder.find()` JSDoc for rationale).
|
|
12
|
-
*/
|
|
13
|
-
export declare function getGraphLines(dataSource: GraphDataSource, from: RouteWaypoint, to: RouteWaypoint, onlyAccessible?: boolean, waypoints?: RouteWaypoint[]): RouteLine[];
|
|
14
|
-
//# sourceMappingURL=getGraphLines.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createGraphCache as f}from"../graph/graphCache";import{buildRoute as m}from"./buildRoute";import{buildMultiPointRoute as h}from"./buildMultiPointRoute";import{findGraphPointsInRect as p,findNearestGraphPoint as g}from"./findNearestGraphPoint";const C=f();function o(r,e){if(e.rect)return p(r.dataSource,e.rect,e.layer);const n=g(r,{x:e.x,y:e.y,layer:e.layer});return n?[n]:[]}export function getGraphLines(r,e,n,l=!1,a=[]){const u=performance.now(),t=C.getOrBuild(r,l),s=o(t,e),c=o(t,n),i=a.length>0?h(t,[s,...a.map(d=>o(t,d)),c]):m(t,s,c);return console.debug(`WF. Get graph lines: ${i.lines.length} ~ ${performance.now()-u}ms.`),i.lines}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|