This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import DeckGLMap from "./DeckGLMap" | |
| import { ScatterplotLayer } from "@deck.gl/layers" | |
| import { useRecoilValue } from "recoil" | |
| import { statusByDateQuery, countriesQuery, API_DATE_FORMAT } from "../../state/api" | |
| import { format } from "date-fns" | |
| const DataMap = () => { | |
| const date = new Date() | |
| const formattedDate = format(date, API_DATE_FORMAT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| cases: 5244238 | |
| coordinates: [(-97, 38)] | |
| country: "US" | |
| deaths: 167029 | |
| last_update: "2020-08-13T23:27:24" | |
| name: "United States of America" | |
| recovered: 1774648 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| cases: 5244238 | |
| country: "US" | |
| deaths: 167029 | |
| last_update: "2020-08-13T23:27:24" | |
| recovered: 1774648 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Suspense } from "react" | |
| import { RecoilRoot } from "recoil" | |
| import DataMap from "./components/map/DataMap" | |
| const App = () => { | |
| return ( | |
| <RecoilRoot> | |
| <Suspense fallback="Loading..."> | |
| <DataMap /> | |
| </Suspense> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { atom } from "recoil" | |
| export const DATE_RANGE = [new Date("10 Jan 2020"), new Date()] | |
| export const currentDateState = atom({ | |
| key: "current-date-state", | |
| default: new Date(), | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import DeckGLMap from "./DeckGLMap" | |
| import { ScatterplotLayer } from "@deck.gl/layers" | |
| const DataMap = ({ mapboxToken = "", data = [] }) => { | |
| const scatterplotLayer = new ScatterplotLayer({ | |
| id: "scatterplot-layer", | |
| data, | |
| stroked: false, | |
| filled: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import DeckGL from "@deck.gl/react" | |
| import { StaticMap } from "react-map-gl" | |
| // Viewport settings | |
| const INITIAL_VIEW_STATE = { | |
| longitude: -20, | |
| latitude: 0, | |
| pitch: 0, | |
| zoom: 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import { useRecoilValue } from "recoil" | |
| import { format } from "date-fns" | |
| import { mapboxToken } from "../../mapbox-token" | |
| import { currentDateState } from "../../state/app" | |
| import { API_DATE_FORMAT, statusByDateQuery, countriesQuery } from "../../state/api" | |
| import DataMap from "./DataMap" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Suspense } from "react" | |
| import { RecoilRoot } from "recoil" | |
| import TimelineMap from "./components/map/TimelineMap" | |
| const App = () => { | |
| return ( | |
| <RecoilRoot> | |
| <Suspense fallback="Loading..."> | |
| <TimelineMap /> | |
| </Suspense> |