atriusmaps-node-sdk 3.3.708 → 3.3.710
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/cjs/package.json.js
CHANGED
|
@@ -74,7 +74,9 @@ function createNavGraph(data, floorIdToOrdinal, floorIdToStructureId, securityLa
|
|
|
74
74
|
|
|
75
75
|
function createEdge(data, nodes) {
|
|
76
76
|
const type = getEdgeType(data);
|
|
77
|
-
const
|
|
77
|
+
const typeLower = type.toLowerCase();
|
|
78
|
+
// All edge types are accessible except Escalator and regular Stairs (AccessibleStairs are accessible)
|
|
79
|
+
const isAccessible = typeLower !== 'escalator' && typeLower !== 'stairs';
|
|
78
80
|
// todo consider calculating edge distance with 'path' differently
|
|
79
81
|
const distance = distanceBetweenNodes(data.s, data.d, nodes);
|
|
80
82
|
const transitTime = data.l || distance / DEFAULT_WALKING_SPEED_M_PER_MIN;
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",t="3.3.
|
|
1
|
+
var e="web-engine",t="3.3.710",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json"},a=["defaults"],n={react:"^18.3.1"},c={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^4.3.4","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1","prop-types":"^15.8.1",ramda:"^0.30.1",react:"^18.3.1","react-compound-slider":"^3.4.0","react-dom":"^18.3.1","react-json-editor-ajrm":"^2.5.14","react-qr-svg":"^2.4.0","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^14.2.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",typescript:"^5.8.2",vite:"^4.3.9",vitest:"^4.0.17","webpack-merge":"^6.0.1"},d="yarn@4.7.0",m={node:"24.x"},u={},y={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,resolutions:n,dependencies:c,devDependencies:p,packageManager:d,engines:m,nx:u};export{a as browserslist,y as default,c as dependencies,p as devDependencies,m as engines,s as license,o as main,e as name,u as nx,d as packageManager,n as resolutions,l as scripts,r as type,t as version,i as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pick as t,isNil as o,map as n,omit as e,path as r}from"ramda";import{encode as i,calculateAdjacent as s}from"../../../src/extModules/geohasher.js";import{distance as l}from"../../../src/utils/geodesy.js";import d from"./minPriorityQueue.js";function u(r,s,l,d){const u={},c={},a=new Set;let h={};r.nodes.forEach(o=>{const n=s(o.floorId),e=l(o.floorId);!function(t){const o=t.floorId+":"+i(t.lat,t.lng).substr(0,7),n=t.floorId+":"+i(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),u[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e})}),r.edges.forEach(t=>u[t.s].edges.push(function(t,n){const e=function(t){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r=
|
|
1
|
+
import{pick as t,isNil as o,map as n,omit as e,path as r}from"ramda";import{encode as i,calculateAdjacent as s}from"../../../src/extModules/geohasher.js";import{distance as l}from"../../../src/utils/geodesy.js";import d from"./minPriorityQueue.js";function u(r,s,l,d){const u={},c={},a=new Set;let h={};r.nodes.forEach(o=>{const n=s(o.floorId),e=l(o.floorId);!function(t){const o=t.floorId+":"+i(t.lat,t.lng).substr(0,7),n=t.floorId+":"+i(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),u[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e})}),r.edges.forEach(t=>u[t.s].edges.push(function(t,n){const e=function(t){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r=e.toLowerCase(),i="escalator"!==r&&"stairs"!==r,s=f(t.s,t.d,n),l=t.l||s/60,d=t=>t.map(t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}})),u=t.p?d(t.p):null;return{distance:s,dst:t.d,o:t.o,isAccessible:i,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:l,type:e,path:u,weight:l}}(t,u)));const p=t=>{if(void 0===t.floorId&&void 0===t.ordinal)throw Error("Endpoint specified in findRoute without floorId nor an ordinal");const o=t.lat||t.latitude,n=t.lng||t.longitude;return t.floorId?w(t.floorId,o,n,c,u):T(t.ordinal,o,n,u)};return{_nodes:u,_geoDb:c,_nodesToAvoid:a,addNodesToAvoid:t=>function(t){a.clear(),t.forEach(t=>a.add(t))}(t),findClosestNode:(t,o,n)=>w(t,o,n,c,u),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(p(t),p(o),n,a,h,d,e)}(t,o,u,n),findAllShortestPaths:function(t,o,n){const e=p(t),r=o.map(t=>p(t));return e&&r.length?function(t,o,n,e,r={},i={},s={}){return o.map(o=>{try{return I(t,o,n,e,r,i,s)}catch(t){return null}})}(e,r,u,a,h,d,n):[]},floorIdToOrdinal:s,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){h=n(e(["lastUpdated"]),t),y()},clearCache:y}}function f(t,o,n){const e=n[t],r=n[o];return l(e.lat,e.lng,r.lat,r.lng)}let c,a,h,p,g,m;const y=()=>{c={},a={},h={},p=new d,g=null,m={}};function I(t,o,n,e,i={},s={},l={}){for(t.id===g&&m===JSON.stringify(l)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(l));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const d=t.edges[n];if(e.size>0&&e.has(d.dst))continue;if(h[d.dst])continue;if(l.requiresAccessibility&&!d.isAccessible)continue;let u=d.weight;if(d.o&&i[d.o]){const t=i[d.o];t.queueTime&&(u=t.queueTime),t.isTemporarilyClosed&&(u=9999),d.securityWaitTimes=t}if(d.o&&s[d.o]){d.securityLane=s[d.o];const{type:t,id:o}=s[d.o],n=r(["selectedSecurityLanes",t],l);if(n&&!n.includes(o))continue}void 0===c[d.dst]?(a[d.dst]=t,c[d.dst]=o+u,p.offerWithPriority(d.dst,o+u)):c[d.dst]>o+u&&(c[d.dst]=o+u,a[d.dst]=t,p.raisePriority(d.dst,o+u))}h[t.id]=!0}if(!h[o.id])return null;const d=[];let u=o;for(;u;)d.push(u),u=a[u.id];return d.reverse()}function b(t,o,n,e){const r=o.substr(0,e),i=[];i.push(t+":"+s(s(r,"top"),"left")),i.push(t+":"+s(r,"top")),i.push(t+":"+s(s(r,"top"),"right")),i.push(t+":"+s(r,"left")),i.push(t+":"+r),i.push(t+":"+s(r,"right")),i.push(t+":"+s(s(r,"bottom"),"left")),i.push(t+":"+s(r,"bottom")),i.push(t+":"+s(s(r,"bottom"),"right"));const l=[];for(let t=0;t<i.length;t++){const o=n[i[t]];if(o)for(let t=0;t<o.length;t++)l.push(o[t])}return l}function w(t,o,n,e,r){const s=function(t,o,n){let e=b(t,o,n,8);return e.length>0?e:(e=b(t,o,n,7),e.length>0?e:null)}(t,i(o,n),e)||function(t,o,n,e){const r=Object.values(e).filter(o=>o.floorId===t).map(t=>[t,l(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByFloor2 found no nodes on floor ${t}`);return v(r)}(t,o,n,r),d=[];for(let t=0;t<s.length;t++){const e=l(o,n,s[t].lat,s[t].lng);d.push([s[t],e])}d.sort(function(t,o){return t[1]-o[1]});const u=[];for(let t=0;t<d.length;t++)u.push(d[t][0]);return u[0]}function T(t,o,n,e){const r=Object.values(e).filter(o=>o.ordinal===t).map(t=>[t,l(t.lat,t.lng,o,n)]);if(!r.length)throw Error(`findClosestNodeByOrdinal found no nodes on ordinal ${t}`);return v(r)}function v(t){let o=t[0];for(let n=1;n<t.length;n++)t[n][1]<o[1]&&(o=t[n]);return o[0]}export{u as createNavGraph,T as findClosestNodeByOrdinal,I as findShortestPath};
|
package/package.json
CHANGED