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 styled from "styled-components" | |
| import { useRecoilState } from "recoil" | |
| import { currentStatState, availableStats } from "../../state/app" | |
| const StyledCurrentStatSelect = styled("div")` | |
| display: flex; | |
| flex-flow: column; | |
| align-items: center; | |
| position: absolute; |
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 { useRecoilValueLoadable } from "recoil" | |
| import { mapboxToken } from "../../mapbox-token" | |
| import { countriesQuery, currentDateStatusState } from "../../state/api" | |
| import DataMap from "./DataMap" | |
| import LoadingIndicator from "../ui/LoadingIndicator" |
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 = [], dotCoordinates = "coordinates", displayStat = "cases" }) => { | |
| 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 { useRecoilValueLoadable, useRecoilValue } from "recoil" | |
| import { mapboxToken } from "../../mapbox-token" | |
| import { countriesQuery, currentDateStatusState } from "../../state/api" | |
| import DataMap from "./DataMap" | |
| import LoadingIndicator from "../ui/LoadingIndicator" | |
| import { currentStatState } from "../../state/app" |
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 { selector, atom } from "recoil" | |
| import { isAfter, isBefore, format } from "date-fns" | |
| import { API_DATE_FORMAT, statusByDateQuery } from "../api" | |
| export const DATE_RANGE = [new Date("10 Jan 2020"), new Date()] | |
| export const CASES = "cases" | |
| export const DEATHS = "deaths" | |
| export const RECOVERED = "recovered" |
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 = [], | |
| dotCoordinates = "coordinates", | |
| displayStat = "cases", | |
| statMax = 1, |
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 { useRecoilValueLoadable, useRecoilValue } from "recoil" | |
| import { mapboxToken } from "../../mapbox-token" | |
| import { countriesQuery, currentDateStatusState } from "../../state/api" | |
| import { currentStatState, currentStatMaxState } from "../../state/app" | |
| import DataMap from "./DataMap" | |
| import LoadingIndicator from "../ui/LoadingIndicator" |
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 = [], | |
| dotCoordinates = "coordinates", | |
| displayStat = "cases", | |
| statMax = 1, |
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, { useMemo } from "react" | |
| import styled from "styled-components" | |
| import { useRecoilState } from "recoil" | |
| import { currentDateState, DATE_RANGE } from "../../state/app" | |
| import { differenceInCalendarDays, addDays, formatDistanceToNow } from "date-fns" | |
| const StyledTimeTravelSlider = styled("div")` | |
| display: flex; | |
| flex-flow: column; | |
| align-items: center; |
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" | |
| import TimeTravelButtons from "./components/time/TimeTravelButtons" | |
| const App = () => { | |
| return ( | |
| <RecoilRoot> | |
| <Suspense fallback="Loading..."> | |
| <TimeTravelButtons /> |