We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6002c8c commit e357474Copy full SHA for e357474
pages/index.js
@@ -24,13 +24,23 @@ export async function getStaticProps() {
24
};
25
}
26
27
-import { TreeMap } from "@nivo/treemap";
+import { TreeMap, TreeMapDefaultProps as TreeMapDefault } from "@nivo/treemap";
28
+
29
+function Node(props) {
30
+ const { country } = props.node.data;
31
+ return (
32
+ <a href={`country/${country}`}>
33
+ <TreeMapDefault.nodeComponent {...props} />
34
+ </a>
35
+ );
36
+}
37
38
export default function HomePage({ date, rows }) {
39
return (
40
<>
41
<h2>Coronavirus {date}</h2>
42
<TreeMap
43
+ nodeComponent={Node}
44
tile="binary"
45
colorBy="flag"
46
colors={{ scheme: "pastel2" }}
0 commit comments