This commit is contained in:
Adam 2023-04-24 01:34:14 -04:00
parent 4d9e01d172
commit be7f7f6471
5 changed files with 50 additions and 34 deletions

View file

@ -1721,7 +1721,7 @@ packages:
'@babel/runtime': 7.21.0 '@babel/runtime': 7.21.0
dev: false 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==} resolution: {integrity: sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
peerDependencies: peerDependencies:
@ -1730,15 +1730,15 @@ packages:
rollup: rollup:
optional: true optional: true
dependencies: dependencies:
'@rollup/pluginutils': 5.0.2(rollup@3.20.7) '@rollup/pluginutils': 5.0.2(rollup@3.21.0)
commondir: 1.0.1 commondir: 1.0.1
estree-walker: 2.0.2 estree-walker: 2.0.2
glob: 8.1.0 glob: 8.1.0
is-reference: 1.2.1 is-reference: 1.2.1
magic-string: 0.27.0 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==} resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
peerDependencies: peerDependencies:
@ -1747,10 +1747,10 @@ packages:
rollup: rollup:
optional: true optional: true
dependencies: dependencies:
'@rollup/pluginutils': 5.0.2(rollup@3.20.7) '@rollup/pluginutils': 5.0.2(rollup@3.21.0)
rollup: 3.20.7 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==} resolution: {integrity: sha512-Y35fRGUjC3FaurG722uhUuG8YHOJRJQbI6/CkbRkdPotSpDj9NtIN85z1zrcyDcCQIW4qp5mgG72U+gJ0TAFEg==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
peerDependencies: peerDependencies:
@ -1759,15 +1759,15 @@ packages:
rollup: rollup:
optional: true optional: true
dependencies: dependencies:
'@rollup/pluginutils': 5.0.2(rollup@3.20.7) '@rollup/pluginutils': 5.0.2(rollup@3.21.0)
'@types/resolve': 1.20.2 '@types/resolve': 1.20.2
deepmerge: 4.3.1 deepmerge: 4.3.1
is-builtin-module: 3.2.1 is-builtin-module: 3.2.1
is-module: 1.0.0 is-module: 1.0.0
resolve: 1.22.2 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==} resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
engines: {node: '>=14.0.0'} engines: {node: '>=14.0.0'}
peerDependencies: peerDependencies:
@ -1779,7 +1779,7 @@ packages:
'@types/estree': 1.0.1 '@types/estree': 1.0.1
estree-walker: 2.0.2 estree-walker: 2.0.2
picomatch: 2.3.1 picomatch: 2.3.1
rollup: 3.20.7 rollup: 3.21.0
/@sideway/address@4.1.4: /@sideway/address@4.1.4:
resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==}
@ -3219,7 +3219,7 @@ packages:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 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==} resolution: {integrity: sha512-bbDOv47+Bw4C/cgs0czZqfm8L82xOZssk4ayZjG40y9zbXclNk7YikrZTDao6p7+HDiGxrN0b65SgZiVm9k1Cg==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
@ -3231,21 +3231,21 @@ packages:
dependencies: dependencies:
open: 8.4.2 open: 8.4.2
picomatch: 2.3.1 picomatch: 2.3.1
rollup: 3.20.7 rollup: 3.21.0
source-map: 0.7.4 source-map: 0.7.4
yargs: 17.7.1 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==} resolution: {integrity: sha512-3CmcMmCLAzJDUXiO3z6386/Pt8/k9xTZv8gIHyXI8hYGoAInnYdOsFXiGGzQRMy6TXR1jUZme2qbdwjH2nFMjg==}
engines: {node: '>=8'} engines: {node: '>=8'}
peerDependencies: peerDependencies:
rollup: '>=2.0.0' rollup: '>=2.0.0'
dependencies: dependencies:
rollup: 3.20.7 rollup: 3.21.0
route-sort: 1.0.0 route-sort: 1.0.0
/rollup@3.20.7: /rollup@3.21.0:
resolution: {integrity: sha512-P7E2zezKSLhWnTz46XxjSmInrbOCiul1yf+kJccMxT56vxjHwCbDfoLbiqFgu+WQoo9ij2PkraYaBstgB2prBA==} resolution: {integrity: sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'} engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true hasBin: true
optionalDependencies: optionalDependencies:
@ -3334,12 +3334,12 @@ packages:
undici: ^5.8.0 undici: ^5.8.0
vite: '*' vite: '*'
dependencies: dependencies:
'@rollup/plugin-commonjs': 24.1.0(rollup@3.20.7) '@rollup/plugin-commonjs': 24.1.0(rollup@3.21.0)
'@rollup/plugin-json': 6.0.0(rollup@3.20.7) '@rollup/plugin-json': 6.0.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)
compression: 1.7.4 compression: 1.7.4
polka: 1.0.0-next.22 polka: 1.0.0-next.22
rollup: 3.20.7 rollup: 3.21.0
sirv: 2.0.2 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) 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 terser: 5.17.1
@ -3404,9 +3404,9 @@ packages:
get-port: 6.1.2 get-port: 6.1.2
parse-multipart-data: 1.5.0 parse-multipart-data: 1.5.0
picocolors: 1.0.0 picocolors: 1.0.0
rollup: 3.20.7 rollup: 3.21.0
rollup-plugin-visualizer: 5.9.0(rollup@3.20.7) rollup-plugin-visualizer: 5.9.0(rollup@3.21.0)
rollup-route-manifest: 1.0.0(rollup@3.20.7) rollup-route-manifest: 1.0.0(rollup@3.21.0)
sade: 1.8.1 sade: 1.8.1
set-cookie-parser: 2.6.0 set-cookie-parser: 2.6.0
sirv: 2.0.2 sirv: 2.0.2
@ -3415,7 +3415,7 @@ packages:
terser: 5.17.1 terser: 5.17.1
undici: 5.22.0 undici: 5.22.0
vite: 4.3.1(@types/node@18.16.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) vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.3.1)
wait-on: 6.0.1(debug@4.3.4) wait-on: 6.0.1(debug@4.3.4)
transitivePeerDependencies: transitivePeerDependencies:
@ -3665,14 +3665,14 @@ packages:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'} 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==} resolution: {integrity: sha512-XyrhTxYF+5X8CH0PFmYJhs8WGJMOa2UxwUftTaT0FiMm24VfUp+UsAh7xDZI3doPOiB5GxKEizDGxdU98Ay+Vg==}
engines: {node: '>=14'} engines: {node: '>=14'}
peerDependencies: peerDependencies:
vite: ^3.1.0 || ^4.0.0 vite: ^3.1.0 || ^4.0.0
dependencies: dependencies:
'@antfu/utils': 0.7.2 '@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 debug: 4.3.4
fs-extra: 11.1.1 fs-extra: 11.1.1
picocolors: 1.0.0 picocolors: 1.0.0
@ -3728,7 +3728,7 @@ packages:
'@types/node': 18.16.0 '@types/node': 18.16.0
esbuild: 0.17.18 esbuild: 0.17.18
postcss: 8.4.23 postcss: 8.4.23
rollup: 3.20.7 rollup: 3.21.0
optionalDependencies: optionalDependencies:
fsevents: 2.3.2 fsevents: 2.3.2

View file

@ -30,8 +30,8 @@ export default function BadassMap() {
transitionType="flyTo" transitionType="flyTo"
> >
<MapScatLayer data={scatData()} /> <MapScatLayer />
<MapArcLayer data={arcData()} /> <MapArcLayer />
<MapControls /> <MapControls />
</MapGL >) as JSX.Element; </MapGL >) as JSX.Element;

View file

@ -4,13 +4,15 @@ import { Layer } from 'solid-map-gl';
import type { JSX } from 'solid-js'; import type { JSX } from 'solid-js';
import { scatData } from '~/root';
export default function MapScatLayer(props: any) { export default function MapScatLayer(props: any) {
return (<Layer customLayer={ return (<Layer customLayer={
new MapboxLayer({ new MapboxLayer({
id: 'deckgl-scatterplot', id: 'deckgl-scatterplot',
type: ScatterplotLayer, type: ScatterplotLayer,
data: props.data, data: scatData(),
getPosition: (d: any) => d.coordinates, getPosition: (d: any) => d.coordinates,
getRadius: 30, getRadius: 30,
getFillColor: [255, 140, 0], getFillColor: [255, 140, 0],

View file

@ -1,5 +1,7 @@
import { createSignal } from "solid-js"; import { createSignal } from "solid-js";
import { scatData, setScatData } from "~/root";
type ChargingStation = { type ChargingStation = {
Name: string Name: string
PhoneNumer: string PhoneNumer: string
@ -54,5 +56,16 @@ export async function fetchStations() {
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
}); });
let resJson = await response.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[]; return resJson as StationResponse[];
}; };

View file

@ -18,10 +18,8 @@ import BadassMap from './components/BadassMap';
import type { Viewport } from "solid-map-gl"; import type { Viewport } from "solid-map-gl";
import type { JSX } from "solid-js"; import type { JSX } from "solid-js";
import { createStore } from "solid-js/store";
type ScatData = {
coordinates: number[]
}
type ArcData = { type ArcData = {
source: number[], source: number[],
@ -37,6 +35,9 @@ const TEST = {
NSE: { LngLatLike: { lng: -74.0112660425065, lat: 40.70689167578798 }, coords: [-74.0112660425065, 40.70689167578798], }, NSE: { LngLatLike: { lng: -74.0112660425065, lat: 40.70689167578798 }, coords: [-74.0112660425065, 40.70689167578798], },
}; };
type ScatData = {
coordinates: number[]
}
export const [scatData, setScatData] = createSignal<ScatData[]>([ export const [scatData, setScatData] = createSignal<ScatData[]>([
{ coordinates: TEST.FAN.coords }, { coordinates: TEST.FAN.coords },
{ coordinates: TEST.GDT.coords }, { coordinates: TEST.GDT.coords },