diff --git a/lightning/package.json b/lightning/package.json index 86c46e1..dc1e38c 100644 --- a/lightning/package.json +++ b/lightning/package.json @@ -12,7 +12,7 @@ "postcss": "^8.4.23", "solid-start-node": "^0.2.26", "typescript": "^4.9.5", - "vite": "^4.3.1" + "vite": "^4.3.2" }, "dependencies": { "@deck.gl/layers": "^8.9.9", diff --git a/lightning/pnpm-lock.yaml b/lightning/pnpm-lock.yaml index 0438ab2..a14dc2b 100644 --- a/lightning/pnpm-lock.yaml +++ b/lightning/pnpm-lock.yaml @@ -36,7 +36,7 @@ dependencies: version: 1.7.2(empty-npm-package@1.0.0) solid-start: specifier: ^0.2.26 - version: 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) + version: 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.2) tailwindcss: specifier: ^3.3.1 version: 3.3.1(postcss@8.4.23) @@ -56,13 +56,13 @@ devDependencies: version: 8.4.23 solid-start-node: specifier: ^0.2.26 - version: 0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.1) + version: 0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.2) typescript: specifier: ^4.9.5 version: 4.9.5 vite: - specifier: ^4.3.1 - version: 4.3.1(@types/node@18.16.0) + specifier: ^4.3.2 + version: 4.3.2(@types/node@18.16.0) packages: @@ -2033,7 +2033,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001481 - electron-to-chromium: 1.4.369 + electron-to-chromium: 1.4.371 node-releases: 2.0.10 update-browserslist-db: 1.0.11(browserslist@4.21.5) @@ -2232,8 +2232,8 @@ packages: /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - /electron-to-chromium@1.4.369: - resolution: {integrity: sha512-LfxbHXdA/S+qyoTEA4EbhxGjrxx7WK2h6yb5K2v0UCOufUKX+VZaHbl3svlzZfv9sGseym/g3Ne4DpsgRULmqg==} + /electron-to-chromium@1.4.371: + resolution: {integrity: sha512-jlBzY4tFcJaiUjzhRTCWAqRvTO/fWzjA3Bls0mykzGZ7zvcMP7h05W6UcgzfT9Ca1SW2xyKDOFRyI0pQeRNZGw==} /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2773,8 +2773,8 @@ packages: hasBin: true dev: false - /joi@17.9.1: - resolution: {integrity: sha512-FariIi9j6QODKATGBrEX7HZcja8Bsh3rfdGYy/Sb65sGlZWK/QWesU1ghk7aJWDj95knjXlQfSmzFSPPkLVsfw==} + /joi@17.9.2: + resolution: {integrity: sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==} dependencies: '@hapi/hoek': 9.3.0 '@hapi/topo': 5.1.0 @@ -2881,8 +2881,8 @@ packages: '@math.gl/core': 3.6.3 dev: false - /merge-anything@5.1.4: - resolution: {integrity: sha512-7PWKwGOs5WWcpw+/OvbiFiAvEP6bv/QHiicigpqMGKIqPPAtGhBLR8LFJW+Zu6m9TXiR/a8+AiPlGG0ko1ruoQ==} + /merge-anything@5.1.5: + resolution: {integrity: sha512-9lquMsJxgaef2BXYUy8VnqHmuLYaEiGd7SULqOTuDFA9Lw6g6Hmdsblc6+yqshdJOQKkn9I106+3D5mnQMstvg==} engines: {node: '>=12.13'} dependencies: is-what: 4.1.8 @@ -3285,8 +3285,8 @@ packages: /set-cookie-parser@2.6.0: resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} - /sirv@2.0.2: - resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==} + /sirv@2.0.3: + resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} dependencies: '@polka/url': 1.0.0-next.21 @@ -3327,7 +3327,7 @@ packages: '@babel/types': 7.21.4 solid-js: 1.7.3 - /solid-start-node@0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.1): + /solid-start-node@0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.2): resolution: {integrity: sha512-8vciTGoQV+lIlCUSVHJPazlaoKDRfBowDkPeBr/EZdmtbcMOKoJYf/APPQWFspylF+nhzunMf0+zJP90VtMEYg==} peerDependencies: solid-start: '*' @@ -3340,15 +3340,15 @@ packages: compression: 1.7.4 polka: 1.0.0-next.22 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) + sirv: 2.0.3 + 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.2) terser: 5.17.1 undici: 5.22.0 - vite: 4.3.1(@types/node@18.16.0) + vite: 4.3.2(@types/node@18.16.0) transitivePeerDependencies: - supports-color - /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.2): resolution: {integrity: sha512-kne2HZlnSMzsirdnvNs1CsDqBl0L0uvKKt1t4de1CH7JIngyqoMcER97jTE0Ejr84KknANaKAdvJAzZcL7Ueng==} hasBin: true peerDependencies: @@ -3409,14 +3409,14 @@ packages: rollup-route-manifest: 1.0.0(rollup@3.21.0) sade: 1.8.1 set-cookie-parser: 2.6.0 - sirv: 2.0.2 + sirv: 2.0.3 solid-js: 1.7.3 - solid-start-node: 0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.1) + solid-start-node: 0.2.26(solid-start@0.2.26)(undici@5.22.0)(vite@4.3.2) 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.21.0)(vite@4.3.1) - vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.3.1) + vite: 4.3.2(@types/node@18.16.0) + vite-plugin-inspect: 0.7.24(rollup@3.21.0)(vite@4.3.2) + vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.3.2) wait-on: 6.0.1(debug@4.3.4) transitivePeerDependencies: - supports-color @@ -3665,7 +3665,7 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-inspect@0.7.24(rollup@3.21.0)(vite@4.3.1): + /vite-plugin-inspect@0.7.24(rollup@3.21.0)(vite@4.3.2): resolution: {integrity: sha512-XyrhTxYF+5X8CH0PFmYJhs8WGJMOa2UxwUftTaT0FiMm24VfUp+UsAh7xDZI3doPOiB5GxKEizDGxdU98Ay+Vg==} engines: {node: '>=14'} peerDependencies: @@ -3676,13 +3676,13 @@ packages: debug: 4.3.4 fs-extra: 11.1.1 picocolors: 1.0.0 - sirv: 2.0.2 - vite: 4.3.1(@types/node@18.16.0) + sirv: 2.0.3 + vite: 4.3.2(@types/node@18.16.0) transitivePeerDependencies: - rollup - supports-color - /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.2): resolution: {integrity: sha512-avp/Jl5zOp/Itfo67xtDB2O61U7idviaIp4mLsjhCa13PjKNasz+IID0jYTyqUp9SFx6/PmBr6v4KgDppqompg==} peerDependencies: solid-js: ^1.7.2 @@ -3692,16 +3692,16 @@ packages: '@babel/preset-typescript': 7.21.4(@babel/core@7.21.4) '@types/babel__core': 7.20.0 babel-preset-solid: 1.7.3(@babel/core@7.21.4) - merge-anything: 5.1.4 + merge-anything: 5.1.5 solid-js: 1.7.3 solid-refresh: 0.5.2(solid-js@1.7.3) - vite: 4.3.1(@types/node@18.16.0) - vitefu: 0.2.4(vite@4.3.1) + vite: 4.3.2(@types/node@18.16.0) + vitefu: 0.2.4(vite@4.3.2) transitivePeerDependencies: - supports-color - /vite@4.3.1(@types/node@18.16.0): - resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==} + /vite@4.3.2(@types/node@18.16.0): + resolution: {integrity: sha512-9R53Mf+TBoXCYejcL+qFbZde+eZveQLDYd9XgULILLC1a5ZwPaqgmdVpL8/uvw2BM/1TzetWjglwm+3RO+xTyw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3732,7 +3732,7 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vitefu@0.2.4(vite@4.3.1): + /vitefu@0.2.4(vite@4.3.2): resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} peerDependencies: vite: ^3.0.0 || ^4.0.0 @@ -3740,7 +3740,7 @@ packages: vite: optional: true dependencies: - vite: 4.3.1(@types/node@18.16.0) + vite: 4.3.2(@types/node@18.16.0) /vt-pbf@3.1.3: resolution: {integrity: sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==} @@ -3756,7 +3756,7 @@ packages: hasBin: true dependencies: axios: 0.25.0(debug@4.3.4) - joi: 17.9.1 + joi: 17.9.2 lodash: 4.17.21 minimist: 1.2.8 rxjs: 7.8.0 diff --git a/lightning/src/components/AccordionTest.tsx b/lightning/src/components/AccordionTest.tsx index 9ddc918..27f1a3c 100644 --- a/lightning/src/components/AccordionTest.tsx +++ b/lightning/src/components/AccordionTest.tsx @@ -5,6 +5,7 @@ import type { JSX } from 'solid-js'; import { useStationsContext } from './StationsContext'; + function ChevronUpIcon(props: JSX.IntrinsicElements['svg']) { return () as JSX.Element; }; - export default function AccordionTest() { const [stations, {setStationsRequest}] = useStationsContext(); return (

Find Stations

+ + pretty list broke

}>
diff --git a/lightning/src/components/StationsContext.tsx b/lightning/src/components/StationsContext.tsx index b928fca..2821ac5 100644 --- a/lightning/src/components/StationsContext.tsx +++ b/lightning/src/components/StationsContext.tsx @@ -42,14 +42,7 @@ export const StationsContext = createContext(); export function StationsProvider(props: any) { - const TEST_PACKET: StationRequest = { - Latitude: 42.36, - Longitude: -71.05625, - Distance: 10, - CountLimit: 10, - }; - - const [stationsRequest, setStationsRequest] = createSignal(TEST_PACKET) + const [stationsRequest, setStationsRequest] = createSignal() async function fetchStations() { const response = await fetch('https://kevinfwu.com/getnearest', { diff --git a/lightning/src/components/Toolbox.tsx b/lightning/src/components/Toolbox.tsx index 75a13a5..3a2cb4f 100644 --- a/lightning/src/components/Toolbox.tsx +++ b/lightning/src/components/Toolbox.tsx @@ -1,26 +1,33 @@ import type { JSX } from "solid-js" import type { Viewport } from "solid-map-gl"; -import { setViewport } from '~/root'; +import { setViewport } from '~/components/map/BadassMap'; export function Toolbox() { - return (
    -

    Toolbox

    + return ( +
      +

      Toolbox

      -
    • +
    • + +
    • -
    • - -
    ) as JSX.Element; +
  • + +
  • +
+ ) as JSX.Element; }; diff --git a/lightning/src/components/map/BadassMap.tsx b/lightning/src/components/map/BadassMap.tsx index 8989489..012b102 100644 --- a/lightning/src/components/map/BadassMap.tsx +++ b/lightning/src/components/map/BadassMap.tsx @@ -1,7 +1,6 @@ import MapGL, { Viewport } from 'solid-map-gl'; import * as maplibre from 'maplibre-gl'; import MapControls from './MapControls'; - import { createSignal } from 'solid-js'; import type { MapOptions } from 'maplibre-gl'; @@ -15,9 +14,15 @@ const MapArcLayer = unstable_clientOnly(() => import('~/components/map/MapArcLay import 'maplibre-gl/dist/maplibre-gl.css'; import StyleJson from '~/style/style.json'; -export default function BadassMap(props: any) { - const [viewport, setViewport] = createSignal(); +export const [viewport, setViewport] = createSignal({ + center: { lng: -71.05625, lat: 42.36, }, + zoom: 15.5, + bearing: 160, + pitch: 60, +}); + +export default function BadassMap(props: any) { return ( setScats(getCoords(stations))); - console.log(scats()); return ( @@ -34,7 +43,7 @@ export default function MapScatLayer(props: any) { new MapboxLayer({ id: 'deckgl-scatterplot', type: ScatterplotLayer, - data: pls(), + data: scats(), getPosition: (d: any) => d.coordinates, getRadius: 90, getFillColor: [255, 140, 0], diff --git a/lightning/src/root.tsx b/lightning/src/root.tsx index a0b67ee..a0b9727 100644 --- a/lightning/src/root.tsx +++ b/lightning/src/root.tsx @@ -1,14 +1,16 @@ // @refresh reload import { A, Body, ErrorBoundary, FileRoutes, Head, Html, Meta, Routes, Scripts, Title } from "solid-start"; -import "./root.css"; -import BadassMap from './components/map/BadassMap'; -import { StationsProvider } from "./components/StationsContext"; - import type { JSX } from "solid-js"; +import { StationsProvider } from "./components/StationsContext"; +import BadassMap from './components/map/BadassMap'; + +import "./root.css"; + export default function Root() { + return ( diff --git a/lightning/src/routes/[...404].tsx b/lightning/src/routes/[...404].tsx index 73750d0..1a0dda0 100644 --- a/lightning/src/routes/[...404].tsx +++ b/lightning/src/routes/[...404].tsx @@ -5,20 +5,22 @@ import type { JSX } from 'solid-js'; export default function NotFound() { - return (
- Not Found + return ( +
+ Not Found - + -

Page Not Found

+

Page Not Found

-

- Visit{" "} - - start.solidjs.com - {" "} - to learn how to build SolidStart apps. -

+

+ Visit{" "} + + start.solidjs.com + {" "} + to learn how to build SolidStart apps. +

-
) as JSX.Element; +
+ ) as JSX.Element; }; diff --git a/lightning/src/routes/about.tsx b/lightning/src/routes/about.tsx index 95addef..326a1d6 100644 --- a/lightning/src/routes/about.tsx +++ b/lightning/src/routes/about.tsx @@ -4,52 +4,54 @@ import type { JSX } from 'solid-js'; export default function Home() { - return (
- About Lightning + return ( +
+ About Lightning -

About

+

About

- - + -

- github.com/adoyle0/maps -

+

+ github.com/adoyle0/maps +

-
) as JSX.Element; +
+ ) as JSX.Element; }; diff --git a/lightning/src/routes/index.tsx b/lightning/src/routes/index.tsx index 69ea31c..e1000af 100644 --- a/lightning/src/routes/index.tsx +++ b/lightning/src/routes/index.tsx @@ -4,7 +4,9 @@ import type { JSX } from 'solid-js'; export default function Home() { - return (<> - Ride the Lightning - ) as JSX.Element; + return ( + <> + Ride the Lightning + + ) as JSX.Element; }; diff --git a/lightning/src/routes/stations.tsx b/lightning/src/routes/stations.tsx index 8715b3b..2269d94 100644 --- a/lightning/src/routes/stations.tsx +++ b/lightning/src/routes/stations.tsx @@ -1,15 +1,27 @@ import { Title, } from 'solid-start'; -import { Suspense } from 'solid-js'; - -import AccordionTest from '~/components/AccordionTest'; import type { JSX } from 'solid-js'; -export default function Stations() { - return (<> - Ride the Lightning - - - - ) as JSX.Element; +import AccordionTest from '~/components/AccordionTest'; +import { useStationsContext } from '~/components/StationsContext'; + + +const TEST_PACKET: StationRequest = { + Latitude: 42.36, + Longitude: -71.05625, + Distance: 1000, + CountLimit: 20000, +}; + +export default function Stations() { + const [stations, {setStationsRequest}] = useStationsContext(); + + setStationsRequest(TEST_PACKET); + + return ( + <> + Ride the Lightning + + + ) as JSX.Element; };