forked from claudey/dub-shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added table & map visualizations with visx
- Loading branch information
1 parent
af0b395
commit aa313ed
Showing
16 changed files
with
2,463 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/data/world-topo.json |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.bar { | ||
transform-origin: bottom !important; | ||
fill: #0070f3; | ||
} | ||
|
||
.tooltip { | ||
z-index: 40; | ||
width: 200px; | ||
padding: 1rem !important; | ||
border-radius: 5px !important; | ||
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px !important; | ||
} | ||
|
||
.tooltip::after { | ||
content: ""; | ||
position: absolute; | ||
width: 0px; | ||
height: 0px; | ||
margin: auto; | ||
|
||
border: 7px solid transparent; | ||
border-top-color: white; | ||
|
||
top: 100%; | ||
left: 95px; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
.tooltip { | ||
background-color: black !important; | ||
border: solid 1px #eaeaea; | ||
box-shadow: none !important; | ||
} | ||
.tooltip::after { | ||
border-top-color: black; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import dynamic from "next/dynamic"; | ||
import { Suspense } from "react"; | ||
import { RawStatsProps } from "@/lib/stats"; | ||
import StatsChart from "@/components/stats/stats-chart"; | ||
const StatsMap = dynamic(() => import("@/components/stats/stats-map"), { | ||
suspense: true, | ||
}); // the map takes a while to load so we'll dynamically import it with suspense | ||
|
||
export default function Stats({ | ||
_key, | ||
stats, | ||
}: { | ||
_key: string; | ||
stats: RawStatsProps[]; | ||
}) { | ||
return ( | ||
<div className="flex flex-col justify-center items-center my-36"> | ||
{/* @ts-ignore */} | ||
<StatsChart _key={_key} stats={stats} /> | ||
<div className="h-20" /> | ||
<Suspense fallback={<div>Loading...</div>}> | ||
{/* @ts-ignore */} | ||
<StatsMap _key={_key} stats={stats} /> | ||
</Suspense> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.