mirror of
https://github.com/jcreek/OpenNetworkDiagram.git
synced 2026-07-12 18:43:44 +00:00
build(*): Add Netlify support
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"@eslint/compat": "^1.2.5",
|
||||
"@eslint/js": "^9.18.0",
|
||||
"@sveltejs/adapter-auto": "^4.0.0",
|
||||
"@sveltejs/adapter-netlify": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
|
||||
Generated
+278
@@ -21,6 +21,9 @@ importers:
|
||||
'@sveltejs/adapter-auto':
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0(@sveltejs/kit@2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))
|
||||
'@sveltejs/adapter-netlify':
|
||||
specifier: ^5.0.0
|
||||
version: 5.0.0(@sveltejs/kit@2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))
|
||||
'@sveltejs/kit':
|
||||
specifier: ^2.16.0
|
||||
version: 2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
@@ -82,150 +85,300 @@ packages:
|
||||
resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
|
||||
'@esbuild/aix-ppc64@0.24.2':
|
||||
resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [aix]
|
||||
|
||||
'@esbuild/aix-ppc64@0.25.2':
|
||||
resolution: {integrity: sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [aix]
|
||||
|
||||
'@esbuild/android-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-arm@0.24.2':
|
||||
resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-arm@0.25.2':
|
||||
resolution: {integrity: sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-x64@0.24.2':
|
||||
resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-x64@0.25.2':
|
||||
resolution: {integrity: sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/darwin-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/darwin-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/darwin-x64@0.24.2':
|
||||
resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/darwin-x64@0.25.2':
|
||||
resolution: {integrity: sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/freebsd-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/freebsd-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/freebsd-x64@0.24.2':
|
||||
resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/freebsd-x64@0.25.2':
|
||||
resolution: {integrity: sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/linux-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-arm@0.24.2':
|
||||
resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-arm@0.25.2':
|
||||
resolution: {integrity: sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ia32@0.24.2':
|
||||
resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ia32@0.25.2':
|
||||
resolution: {integrity: sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-loong64@0.24.2':
|
||||
resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-loong64@0.25.2':
|
||||
resolution: {integrity: sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-mips64el@0.24.2':
|
||||
resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-mips64el@0.25.2':
|
||||
resolution: {integrity: sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ppc64@0.24.2':
|
||||
resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ppc64@0.25.2':
|
||||
resolution: {integrity: sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-riscv64@0.24.2':
|
||||
resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-riscv64@0.25.2':
|
||||
resolution: {integrity: sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-s390x@0.24.2':
|
||||
resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-s390x@0.25.2':
|
||||
resolution: {integrity: sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-x64@0.24.2':
|
||||
resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-x64@0.25.2':
|
||||
resolution: {integrity: sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/netbsd-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/netbsd-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/netbsd-x64@0.24.2':
|
||||
resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/netbsd-x64@0.25.2':
|
||||
resolution: {integrity: sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/openbsd-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/openbsd-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/openbsd-x64@0.24.2':
|
||||
resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/openbsd-x64@0.25.2':
|
||||
resolution: {integrity: sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/sunos-x64@0.24.2':
|
||||
resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
|
||||
'@esbuild/sunos-x64@0.25.2':
|
||||
resolution: {integrity: sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
|
||||
'@esbuild/win32-arm64@0.24.2':
|
||||
resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-arm64@0.25.2':
|
||||
resolution: {integrity: sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-ia32@0.24.2':
|
||||
resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-ia32@0.25.2':
|
||||
resolution: {integrity: sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-x64@0.24.2':
|
||||
resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==}
|
||||
engines: {node: '>=18'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-x64@0.25.2':
|
||||
resolution: {integrity: sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -303,6 +456,9 @@ packages:
|
||||
resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==}
|
||||
engines: {node: '>=18.18'}
|
||||
|
||||
'@iarna/toml@2.2.5':
|
||||
resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
|
||||
|
||||
'@jridgewell/gen-mapping@0.3.8':
|
||||
resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@@ -446,6 +602,11 @@ packages:
|
||||
peerDependencies:
|
||||
'@sveltejs/kit': ^2.0.0
|
||||
|
||||
'@sveltejs/adapter-netlify@5.0.0':
|
||||
resolution: {integrity: sha512-if2JvVHuQWRG9V2A3P8CrbB+qo0qLFvpIu2Nb/sbMqoejDL+4kuzT4WPA7dUgruAF0Hj/AAGpxaJedgNd6ZENw==}
|
||||
peerDependencies:
|
||||
'@sveltejs/kit': ^2.4.0
|
||||
|
||||
'@sveltejs/kit@2.20.4':
|
||||
resolution: {integrity: sha512-B3Y1mb1Qjt57zXLVch5tfqsK/ebHe6uYTcFSnGFNwRpId3+fplLgQK6Z2zhDVBezSsPuhDq6Pry+9PA88ocN6Q==}
|
||||
engines: {node: '>=18.13'}
|
||||
@@ -722,6 +883,11 @@ packages:
|
||||
resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
|
||||
esbuild@0.24.2:
|
||||
resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
esbuild@0.25.2:
|
||||
resolution: {integrity: sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==}
|
||||
engines: {node: '>=18'}
|
||||
@@ -1396,78 +1562,153 @@ snapshots:
|
||||
'@jridgewell/gen-mapping': 0.3.8
|
||||
'@jridgewell/trace-mapping': 0.3.25
|
||||
|
||||
'@esbuild/aix-ppc64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/aix-ppc64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ia32@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ia32@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-loong64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-loong64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-mips64el@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-mips64el@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ppc64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ppc64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-riscv64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-riscv64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-s390x@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-s390x@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/sunos-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/sunos-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-arm64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-arm64@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-ia32@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-ia32@0.25.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-x64@0.24.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-x64@0.25.2':
|
||||
optional: true
|
||||
|
||||
@@ -1536,6 +1777,8 @@ snapshots:
|
||||
|
||||
'@humanwhocodes/retry@0.4.2': {}
|
||||
|
||||
'@iarna/toml@2.2.5': {}
|
||||
|
||||
'@jridgewell/gen-mapping@0.3.8':
|
||||
dependencies:
|
||||
'@jridgewell/set-array': 1.2.1
|
||||
@@ -1636,6 +1879,13 @@ snapshots:
|
||||
'@sveltejs/kit': 2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
import-meta-resolve: 4.1.0
|
||||
|
||||
'@sveltejs/adapter-netlify@5.0.0(@sveltejs/kit@2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))':
|
||||
dependencies:
|
||||
'@iarna/toml': 2.2.5
|
||||
'@sveltejs/kit': 2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
esbuild: 0.24.2
|
||||
set-cookie-parser: 2.7.1
|
||||
|
||||
'@sveltejs/kit@2.20.4(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2))':
|
||||
dependencies:
|
||||
'@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.25.8)(vite@6.2.5(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
@@ -1919,6 +2169,34 @@ snapshots:
|
||||
graceful-fs: 4.2.11
|
||||
tapable: 2.2.1
|
||||
|
||||
esbuild@0.24.2:
|
||||
optionalDependencies:
|
||||
'@esbuild/aix-ppc64': 0.24.2
|
||||
'@esbuild/android-arm': 0.24.2
|
||||
'@esbuild/android-arm64': 0.24.2
|
||||
'@esbuild/android-x64': 0.24.2
|
||||
'@esbuild/darwin-arm64': 0.24.2
|
||||
'@esbuild/darwin-x64': 0.24.2
|
||||
'@esbuild/freebsd-arm64': 0.24.2
|
||||
'@esbuild/freebsd-x64': 0.24.2
|
||||
'@esbuild/linux-arm': 0.24.2
|
||||
'@esbuild/linux-arm64': 0.24.2
|
||||
'@esbuild/linux-ia32': 0.24.2
|
||||
'@esbuild/linux-loong64': 0.24.2
|
||||
'@esbuild/linux-mips64el': 0.24.2
|
||||
'@esbuild/linux-ppc64': 0.24.2
|
||||
'@esbuild/linux-riscv64': 0.24.2
|
||||
'@esbuild/linux-s390x': 0.24.2
|
||||
'@esbuild/linux-x64': 0.24.2
|
||||
'@esbuild/netbsd-arm64': 0.24.2
|
||||
'@esbuild/netbsd-x64': 0.24.2
|
||||
'@esbuild/openbsd-arm64': 0.24.2
|
||||
'@esbuild/openbsd-x64': 0.24.2
|
||||
'@esbuild/sunos-x64': 0.24.2
|
||||
'@esbuild/win32-arm64': 0.24.2
|
||||
'@esbuild/win32-ia32': 0.24.2
|
||||
'@esbuild/win32-x64': 0.24.2
|
||||
|
||||
esbuild@0.25.2:
|
||||
optionalDependencies:
|
||||
'@esbuild/aix-ppc64': 0.25.2
|
||||
|
||||
@@ -1,144 +1,168 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount, afterUpdate, tick } from 'svelte';
|
||||
import { networkStore, loadNetworkData } from '../../stores/networkStore';
|
||||
import { get } from 'svelte/store';
|
||||
import MachineCard from './MachineCard.svelte';
|
||||
import DeviceCard from './DeviceCard.svelte';
|
||||
|
||||
import type { NetworkData, Port } from '../../lib/types';
|
||||
import { astar } from '../utils/pathfinding';
|
||||
import type { Point } from '../utils/pathfinding';
|
||||
|
||||
export let jsonPath: string = '/data/network.json';
|
||||
|
||||
let data: NetworkData;
|
||||
let data: NetworkData | undefined = undefined;
|
||||
|
||||
// We'll store all port references in one big map for easy access
|
||||
let lines: any[] = [];
|
||||
// DEBUG: Log when component mounts
|
||||
onMount(() => {
|
||||
// Async block for data loading and initial connection
|
||||
(async () => {
|
||||
console.log('NetworkDiagram mounted');
|
||||
await loadNetworkData(jsonPath);
|
||||
data = get(networkStore);
|
||||
console.log('Loaded network data:', data);
|
||||
await tick(); // Wait for DOM update
|
||||
const container = document.querySelector('.diagram-container');
|
||||
if (container) {
|
||||
updateSVGConnections();
|
||||
} else {
|
||||
console.warn('Container not found, skipping updateSVGConnections');
|
||||
}
|
||||
})();
|
||||
|
||||
onMount(async () => {
|
||||
await loadNetworkData(jsonPath);
|
||||
data = get(networkStore);
|
||||
// Optionally, update connections on window resize
|
||||
const handleResize = () => {
|
||||
const container = document.querySelector('.diagram-container');
|
||||
if (container) updateSVGConnections();
|
||||
};
|
||||
window.addEventListener('resize', handleResize);
|
||||
|
||||
// Wait for DOM to render fully
|
||||
setTimeout(() => {
|
||||
createLines();
|
||||
}, 0);
|
||||
return () => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Called after child components have rendered.
|
||||
* We gather all port references and draw lines using global LeaderLine
|
||||
*/
|
||||
async function createLines() {
|
||||
// Use global UMD version from window
|
||||
const LeaderLine = (window as any).LeaderLine;
|
||||
if (!LeaderLine) {
|
||||
console.error('LeaderLine is not loaded.');
|
||||
// SVG-based connection rendering
|
||||
let svgWidth = 0;
|
||||
let svgHeight = 0;
|
||||
let svgOffsetX = 0;
|
||||
let svgOffsetY = 0;
|
||||
let svgConnections: { points: [number, number][]; color: string; label: string }[] = [];
|
||||
|
||||
const GRID_SIZE = 40; // px per grid cell
|
||||
|
||||
function updateSVGConnections() {
|
||||
const container = document.querySelector('.diagram-container') as HTMLElement;
|
||||
if (!container) {
|
||||
console.warn('No container element found in updateSVGConnections');
|
||||
return;
|
||||
}
|
||||
const rect = container.getBoundingClientRect();
|
||||
svgWidth = rect.width;
|
||||
svgHeight = rect.height;
|
||||
svgOffsetX = rect.left;
|
||||
svgOffsetY = rect.top;
|
||||
|
||||
console.log('updateSVGConnections called');
|
||||
|
||||
const portDataMap: Map<string, { element: HTMLDivElement; port: Port }> = new Map();
|
||||
// Gather all port elements
|
||||
if (!data) {
|
||||
console.warn('No data loaded in updateSVGConnections');
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear any previous lines
|
||||
for (const ln of lines) {
|
||||
ln.remove();
|
||||
}
|
||||
lines = [];
|
||||
|
||||
type PortInfo = {
|
||||
parentName: string;
|
||||
port: Port;
|
||||
element: HTMLDivElement;
|
||||
};
|
||||
|
||||
const portDataMap: Map<string, PortInfo> = new Map();
|
||||
|
||||
// GATHER MACHINE PORTS
|
||||
for (const machine of data.machines) {
|
||||
if (machine.ports) {
|
||||
for (const p of machine.ports) {
|
||||
const key = `${machine.machineName}-${p.portName}`;
|
||||
const elem = document.querySelector(`[data-port-key="${key}"]`) as HTMLDivElement;
|
||||
if (elem) {
|
||||
portDataMap.set(key, {
|
||||
parentName: machine.machineName,
|
||||
port: p,
|
||||
element: elem
|
||||
});
|
||||
}
|
||||
if (elem) portDataMap.set(key, { element: elem, port: p });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GATHER DEVICE PORTS
|
||||
for (const dev of data.devices) {
|
||||
if (dev.ports) {
|
||||
for (const p of dev.ports) {
|
||||
const key = `${dev.name}-${p.portName}`;
|
||||
const elem = document.querySelector(`[data-port-key="${key}"]`) as HTMLDivElement;
|
||||
if (elem) {
|
||||
portDataMap.set(key, {
|
||||
parentName: dev.name,
|
||||
port: p,
|
||||
element: elem
|
||||
});
|
||||
for (const dev of data.devices) {
|
||||
if (dev.ports) {
|
||||
for (const p of dev.ports) {
|
||||
const key = `${dev.name}-${p.portName}`;
|
||||
const elem = document.querySelector(`[data-port-key="${key}"]`) as HTMLDivElement;
|
||||
if (elem) portDataMap.set(key, { element: elem, port: p });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DRAW CONNECTIONS
|
||||
svgConnections = [];
|
||||
// Pathfinding: mark all cards as obstacles
|
||||
const cols = Math.ceil(svgWidth / GRID_SIZE);
|
||||
const rows = Math.ceil(svgHeight / GRID_SIZE);
|
||||
const cardElements = document.querySelectorAll('.device-card, .machine-card');
|
||||
const grid: number[][] = Array.from({ length: rows }, () => Array(cols).fill(0));
|
||||
for (const el of cardElements) {
|
||||
const r = el.getBoundingClientRect();
|
||||
const left = Math.floor((r.left - svgOffsetX) / GRID_SIZE);
|
||||
const top = Math.floor((r.top - svgOffsetY) / GRID_SIZE);
|
||||
const right = Math.ceil((r.right - svgOffsetX) / GRID_SIZE);
|
||||
const bottom = Math.ceil((r.bottom - svgOffsetY) / GRID_SIZE);
|
||||
for (let y = top; y < bottom; y++) {
|
||||
for (let x = left; x < right; x++) {
|
||||
if (x >= 0 && y >= 0 && x < cols && y < rows) grid[y][x] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
svgConnections = [];
|
||||
for (const [key, info] of portDataMap.entries()) {
|
||||
const localPort = info.port;
|
||||
if (!localPort.connectedTo) continue;
|
||||
|
||||
const remoteKey = localPort.connectedTo;
|
||||
const remoteInfo = portDataMap.get(remoteKey);
|
||||
const remoteInfo = portDataMap.get(localPort.connectedTo);
|
||||
if (!remoteInfo) continue;
|
||||
if (key > localPort.connectedTo) continue; // Avoid duplicates
|
||||
|
||||
if (key > remoteKey) continue; // Avoid duplicates
|
||||
const a = info.element.getBoundingClientRect();
|
||||
const b = remoteInfo.element.getBoundingClientRect();
|
||||
const PADDING = 8;
|
||||
const isRightward = (b.left + b.width / 2) > (a.left + a.width / 2);
|
||||
const startX = isRightward ? a.right - svgOffsetX + PADDING : a.left - svgOffsetX - PADDING;
|
||||
const endX = isRightward ? b.left - svgOffsetX - PADDING : b.right - svgOffsetX + PADDING;
|
||||
const startY = a.top + a.height / 2 - svgOffsetY;
|
||||
const endY = b.top + b.height / 2 - svgOffsetY;
|
||||
|
||||
const localSpeed = localPort.speedGbps ?? 1;
|
||||
const remoteSpeed = remoteInfo.port.speedGbps ?? 1;
|
||||
const cableSpeed = Math.min(localSpeed, remoteSpeed);
|
||||
const color = getLineColor(cableSpeed);
|
||||
// Source/target grid points
|
||||
const start: Point = [Math.floor(startX / GRID_SIZE), Math.floor(startY / GRID_SIZE)];
|
||||
const end: Point = [Math.floor(endX / GRID_SIZE), Math.floor(endY / GRID_SIZE)];
|
||||
// Temporarily clear source/target cells
|
||||
grid[start[1]][start[0]] = 0;
|
||||
grid[end[1]][end[0]] = 0;
|
||||
|
||||
// Calculate the best sockets for the line to exit/enter
|
||||
const localRect = info.element.getBoundingClientRect();
|
||||
const remoteRect = remoteInfo.element.getBoundingClientRect();
|
||||
const dx = remoteRect.left - localRect.left;
|
||||
const dy = remoteRect.top - localRect.top;
|
||||
|
||||
let startSocket = 'right';
|
||||
let endSocket = 'left';
|
||||
if (Math.abs(dx) > Math.abs(dy)) {
|
||||
// More horizontal distance
|
||||
startSocket = dx > 0 ? 'right' : 'left';
|
||||
endSocket = dx > 0 ? 'left' : 'right';
|
||||
let path = astar(grid, start, end);
|
||||
let points: [number, number][] = [];
|
||||
if (path.length > 0) {
|
||||
points = path.map(([gx, gy]) => [
|
||||
gx * GRID_SIZE + GRID_SIZE / 2,
|
||||
gy * GRID_SIZE + GRID_SIZE / 2
|
||||
]);
|
||||
// Ensure start and end points are exactly at the card edges
|
||||
points[0] = [startX, startY];
|
||||
points[points.length - 1] = [endX, endY];
|
||||
} else {
|
||||
// More vertical distance
|
||||
startSocket = dy > 0 ? 'bottom' : 'top';
|
||||
endSocket = dy > 0 ? 'top' : 'bottom';
|
||||
// fallback: simple L-bend
|
||||
points = [
|
||||
[startX, startY],
|
||||
[endX, startY],
|
||||
[endX, endY]
|
||||
];
|
||||
}
|
||||
|
||||
const line = new LeaderLine(info.element, remoteInfo.element, {
|
||||
path: 'grid',
|
||||
startPlug: 'behind',
|
||||
endPlug: 'behind',
|
||||
startSocket,
|
||||
endSocket,
|
||||
color,
|
||||
size: 4,
|
||||
middleLabel: LeaderLine.captionLabel({
|
||||
text: `${cableSpeed}GbE`,
|
||||
fontSize: 12,
|
||||
color: 'white',
|
||||
outlineColor: 'black',
|
||||
outlineSize: 2
|
||||
})
|
||||
});
|
||||
|
||||
lines.push(line);
|
||||
const speed = Math.min(localPort.speedGbps ?? 1, remoteInfo.port.speedGbps ?? 1);
|
||||
const color = getLineColor(speed);
|
||||
const label = `${speed}GbE`;
|
||||
svgConnections.push({ points, color, label });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getLineColor(speed: number): string {
|
||||
if (speed >= 10) return 'orange';
|
||||
if (speed >= 2.5) return 'green';
|
||||
@@ -149,7 +173,33 @@
|
||||
|
||||
<main>
|
||||
{#if data}
|
||||
<div class="diagram-container">
|
||||
<div class="diagram-container" style="position:relative;">
|
||||
<svg
|
||||
class="diagram-svg"
|
||||
width={svgWidth}
|
||||
height={svgHeight}
|
||||
style="position:absolute;top:0;left:0;z-index:0;pointer-events:none;"
|
||||
>
|
||||
{#each svgConnections as conn}
|
||||
<polyline
|
||||
points={conn.points.map(([x, y]) => `${x},${y}`).join(' ')}
|
||||
stroke={conn.color}
|
||||
stroke-width="4"
|
||||
fill="none"
|
||||
/>
|
||||
<!-- Optionally render a label at the midpoint -->
|
||||
<text
|
||||
x={(conn.points[1][0] + conn.points[2][0]) / 2}
|
||||
y={(conn.points[1][1] + conn.points[2][1]) / 2 - 6}
|
||||
font-size="12"
|
||||
fill="white"
|
||||
stroke="black"
|
||||
stroke-width="2"
|
||||
paint-order="stroke"
|
||||
text-anchor="middle">{conn.label}</text
|
||||
>
|
||||
{/each}
|
||||
</svg>
|
||||
{#each data.machines as machine}
|
||||
<MachineCard {machine} />
|
||||
{/each}
|
||||
@@ -166,6 +216,9 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
position: relative; /* required for leader-line positioning */
|
||||
position: relative;
|
||||
}
|
||||
.diagram-svg {
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
// Simple grid-based A* pathfinding for orthogonal routing
|
||||
// Returns a list of [x, y] points from start to end, or [] if no path found
|
||||
|
||||
export type Point = [number, number];
|
||||
|
||||
interface Node {
|
||||
x: number;
|
||||
y: number;
|
||||
g: number;
|
||||
h: number;
|
||||
f: number;
|
||||
parent?: Node;
|
||||
}
|
||||
|
||||
export function astar(grid: number[][], start: Point, end: Point): Point[] {
|
||||
const height = grid.length;
|
||||
const width = grid[0].length;
|
||||
const open: Node[] = [];
|
||||
const closed: boolean[][] = Array.from({ length: height }, () => Array(width).fill(false));
|
||||
|
||||
function heuristic([x, y]: Point): number {
|
||||
// Manhattan distance
|
||||
return Math.abs(x - end[0]) + Math.abs(y - end[1]);
|
||||
}
|
||||
|
||||
open.push({ x: start[0], y: start[1], g: 0, h: heuristic(start), f: heuristic(start) });
|
||||
|
||||
while (open.length > 0) {
|
||||
// Get node with lowest f
|
||||
open.sort((a, b) => a.f - b.f);
|
||||
const current = open.shift()!;
|
||||
if (current.x === end[0] && current.y === end[1]) {
|
||||
// Reconstruct path
|
||||
const path: Point[] = [];
|
||||
let node: Node | undefined = current;
|
||||
while (node) {
|
||||
path.push([node.x, node.y]);
|
||||
node = node.parent;
|
||||
}
|
||||
return path.reverse();
|
||||
}
|
||||
closed[current.y][current.x] = true;
|
||||
// Explore neighbors (orthogonal only)
|
||||
for (const [dx, dy] of [[1,0], [-1,0], [0,1], [0,-1]]) {
|
||||
const nx = current.x + dx;
|
||||
const ny = current.y + dy;
|
||||
if (nx < 0 || ny < 0 || nx >= width || ny >= height) continue;
|
||||
if (grid[ny][nx] === 1 || closed[ny][nx]) continue; // Obstacle or closed
|
||||
const g = current.g + 1;
|
||||
const h = heuristic([nx, ny]);
|
||||
const existing = open.find(n => n.x === nx && n.y === ny);
|
||||
if (!existing) {
|
||||
open.push({ x: nx, y: ny, g, h, f: g + h, parent: current });
|
||||
} else if (g < existing.g) {
|
||||
existing.g = g;
|
||||
existing.f = g + h;
|
||||
existing.parent = current;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import adapter from '@sveltejs/adapter-auto';
|
||||
import adapter from '@sveltejs/adapter-netlify';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
|
||||
Reference in New Issue
Block a user