diff --git a/lightning/pnpm-lock.yaml b/lightning/pnpm-lock.yaml index 95e4b45..0438ab2 100644 --- a/lightning/pnpm-lock.yaml +++ b/lightning/pnpm-lock.yaml @@ -1721,7 +1721,7 @@ packages: '@babel/runtime': 7.21.0 dev: false - /@rollup/plugin-commonjs@24.1.0(rollup@3.20.7): + /@rollup/plugin-commonjs@24.1.0(rollup@3.21.0): resolution: {integrity: sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1730,15 +1730,15 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 is-reference: 1.2.1 magic-string: 0.27.0 - rollup: 3.20.7 + rollup: 3.21.0 - /@rollup/plugin-json@6.0.0(rollup@3.20.7): + /@rollup/plugin-json@6.0.0(rollup@3.21.0): resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1747,10 +1747,10 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) - rollup: 3.20.7 + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) + rollup: 3.21.0 - /@rollup/plugin-node-resolve@15.0.2(rollup@3.20.7): + /@rollup/plugin-node-resolve@15.0.2(rollup@3.21.0): resolution: {integrity: sha512-Y35fRGUjC3FaurG722uhUuG8YHOJRJQbI6/CkbRkdPotSpDj9NtIN85z1zrcyDcCQIW4qp5mgG72U+gJ0TAFEg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1759,15 +1759,15 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.2 - rollup: 3.20.7 + rollup: 3.21.0 - /@rollup/pluginutils@5.0.2(rollup@3.20.7): + /@rollup/pluginutils@5.0.2(rollup@3.21.0): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1779,7 +1779,7 @@ packages: '@types/estree': 1.0.1 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.20.7 + rollup: 3.21.0 /@sideway/address@4.1.4: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} @@ -3219,7 +3219,7 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - /rollup-plugin-visualizer@5.9.0(rollup@3.20.7): + /rollup-plugin-visualizer@5.9.0(rollup@3.21.0): resolution: {integrity: sha512-bbDOv47+Bw4C/cgs0czZqfm8L82xOZssk4ayZjG40y9zbXclNk7YikrZTDao6p7+HDiGxrN0b65SgZiVm9k1Cg==} engines: {node: '>=14'} hasBin: true @@ -3231,21 +3231,21 @@ packages: dependencies: open: 8.4.2 picomatch: 2.3.1 - rollup: 3.20.7 + rollup: 3.21.0 source-map: 0.7.4 yargs: 17.7.1 - /rollup-route-manifest@1.0.0(rollup@3.20.7): + /rollup-route-manifest@1.0.0(rollup@3.21.0): resolution: {integrity: sha512-3CmcMmCLAzJDUXiO3z6386/Pt8/k9xTZv8gIHyXI8hYGoAInnYdOsFXiGGzQRMy6TXR1jUZme2qbdwjH2nFMjg==} engines: {node: '>=8'} peerDependencies: rollup: '>=2.0.0' dependencies: - rollup: 3.20.7 + rollup: 3.21.0 route-sort: 1.0.0 - /rollup@3.20.7: - resolution: {integrity: sha512-P7E2zezKSLhWnTz46XxjSmInrbOCiul1yf+kJccMxT56vxjHwCbDfoLbiqFgu+WQoo9ij2PkraYaBstgB2prBA==} + /rollup@3.21.0: + resolution: {integrity: sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -3334,12 +3334,12 @@ packages: undici: ^5.8.0 vite: '*' dependencies: - '@rollup/plugin-commonjs': 24.1.0(rollup@3.20.7) - '@rollup/plugin-json': 6.0.0(rollup@3.20.7) - '@rollup/plugin-node-resolve': 15.0.2(rollup@3.20.7) + '@rollup/plugin-commonjs': 24.1.0(rollup@3.21.0) + '@rollup/plugin-json': 6.0.0(rollup@3.21.0) + '@rollup/plugin-node-resolve': 15.0.2(rollup@3.21.0) compression: 1.7.4 polka: 1.0.0-next.22 - rollup: 3.20.7 + rollup: 3.21.0 sirv: 2.0.2 solid-start: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.3.1) terser: 5.17.1 @@ -3404,9 +3404,9 @@ packages: get-port: 6.1.2 parse-multipart-data: 1.5.0 picocolors: 1.0.0 - rollup: 3.20.7 - rollup-plugin-visualizer: 5.9.0(rollup@3.20.7) - rollup-route-manifest: 1.0.0(rollup@3.20.7) + rollup: 3.21.0 + rollup-plugin-visualizer: 5.9.0(rollup@3.21.0) + rollup-route-manifest: 1.0.0(rollup@3.21.0) sade: 1.8.1 set-cookie-parser: 2.6.0 sirv: 2.0.2 @@ -3415,7 +3415,7 @@ packages: terser: 5.17.1 undici: 5.22.0 vite: 4.3.1(@types/node@18.16.0) - vite-plugin-inspect: 0.7.24(rollup@3.20.7)(vite@4.3.1) + vite-plugin-inspect: 0.7.24(rollup@3.21.0)(vite@4.3.1) vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.3.1) wait-on: 6.0.1(debug@4.3.4) transitivePeerDependencies: @@ -3665,14 +3665,14 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-inspect@0.7.24(rollup@3.20.7)(vite@4.3.1): + /vite-plugin-inspect@0.7.24(rollup@3.21.0)(vite@4.3.1): resolution: {integrity: sha512-XyrhTxYF+5X8CH0PFmYJhs8WGJMOa2UxwUftTaT0FiMm24VfUp+UsAh7xDZI3doPOiB5GxKEizDGxdU98Ay+Vg==} engines: {node: '>=14'} peerDependencies: vite: ^3.1.0 || ^4.0.0 dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) debug: 4.3.4 fs-extra: 11.1.1 picocolors: 1.0.0 @@ -3728,7 +3728,7 @@ packages: '@types/node': 18.16.0 esbuild: 0.17.18 postcss: 8.4.23 - rollup: 3.20.7 + rollup: 3.21.0 optionalDependencies: fsevents: 2.3.2 diff --git a/lightning/src/components/BadassMap.tsx b/lightning/src/components/BadassMap.tsx index 898b05b..87818c8 100644 --- a/lightning/src/components/BadassMap.tsx +++ b/lightning/src/components/BadassMap.tsx @@ -30,8 +30,8 @@ export default function BadassMap() { transitionType="flyTo" > - - + + ) as JSX.Element; diff --git a/lightning/src/components/MapScatLayer.tsx b/lightning/src/components/MapScatLayer.tsx index 1363e2b..9568ff0 100644 --- a/lightning/src/components/MapScatLayer.tsx +++ b/lightning/src/components/MapScatLayer.tsx @@ -4,13 +4,15 @@ import { Layer } from 'solid-map-gl'; import type { JSX } from 'solid-js'; +import { scatData } from '~/root'; + export default function MapScatLayer(props: any) { return ( d.coordinates, getRadius: 30, getFillColor: [255, 140, 0], diff --git a/lightning/src/lib/fetchStations.tsx b/lightning/src/lib/fetchStations.tsx index 33d0e72..d9f6ddc 100644 --- a/lightning/src/lib/fetchStations.tsx +++ b/lightning/src/lib/fetchStations.tsx @@ -1,5 +1,7 @@ import { createSignal } from "solid-js"; +import { scatData, setScatData } from "~/root"; + type ChargingStation = { Name: string PhoneNumer: string @@ -54,5 +56,16 @@ export async function fetchStations() { headers: { 'Content-Type': 'application/json' } }); let resJson = await response.json(); + console.log('Response JSON: ', resJson); + let buf = []; + for (let station of resJson) { + buf.push({coordinates: [station.Loc.Coordinates[1], station.Loc.Coordinates[0]]}) + }; + console.log('Scat before: ', scatData()); + console.log('Buffer: ', buf); + setScatData(buf); + console.log('Scat after: ', scatData()); + + //console.log(getCoords(resJson)); return resJson as StationResponse[]; }; diff --git a/lightning/src/root.tsx b/lightning/src/root.tsx index 1a64711..ae8f082 100644 --- a/lightning/src/root.tsx +++ b/lightning/src/root.tsx @@ -18,10 +18,8 @@ import BadassMap from './components/BadassMap'; import type { Viewport } from "solid-map-gl"; import type { JSX } from "solid-js"; +import { createStore } from "solid-js/store"; -type ScatData = { - coordinates: number[] -} type ArcData = { source: number[], @@ -37,6 +35,9 @@ const TEST = { NSE: { LngLatLike: { lng: -74.0112660425065, lat: 40.70689167578798 }, coords: [-74.0112660425065, 40.70689167578798], }, }; +type ScatData = { + coordinates: number[] +} export const [scatData, setScatData] = createSignal([ { coordinates: TEST.FAN.coords }, { coordinates: TEST.GDT.coords },