diff --git a/src/PolygonLabel.tsx b/src/PolygonLabel.tsx new file mode 100644 index 0000000..1069cd4 --- /dev/null +++ b/src/PolygonLabel.tsx @@ -0,0 +1,22 @@ +import { format } from "d3"; +import { FLAG_ENDPOINT } from "./Constants"; +import { numberWithCommas } from "./utils"; + +export function getPolygonLabel(flagName: string, d: any, c: any): string { + return ` +
+ flag +
+ ${d.NAME}
+
+
+
+ Cases: ${numberWithCommas(c.confirmed)}
+ Deaths: ${numberWithCommas(c.deaths)}
+ Recovered: ${numberWithCommas(c.recoveries)}
+ Active: ${numberWithCommas(c.active)}
+ Population: ${format(".3s")(d.POP_EST)} +
+
+ `; +}