From 06521cc5fdfe293379411941d3654eb75dbad2e1 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Fri, 7 Aug 2020 17:33:42 +0530 Subject: [PATCH] Added active label per country --- src/PolygonLabel.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/PolygonLabel.tsx 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)} +
+
+ `; +}