From 2034fb94fdf985f9b9e963b2056e427af5cd1869 Mon Sep 17 00:00:00 2001 From: tinykite Date: Thu, 4 Apr 2024 10:23:44 -0500 Subject: [PATCH 1/2] Fix national caselaw stats --- src/data/map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/map.js b/src/data/map.js index 9e9884c..5d72ee3 100644 --- a/src/data/map.js +++ b/src/data/map.js @@ -59,12 +59,12 @@ export const mapAbbreviations = [ ]; export const nationalCaselawStats = { - total: { + state: { caseCount: 6930777, reporterCount: 612, pageCount: 36357668, }, - state: { + total: { caseCount: 1842484, reporterCount: 75, pageCount: 10409741, From d51cfad71283770916f4f47c9b44da925f59964e Mon Sep 17 00:00:00 2001 From: tinykite Date: Thu, 4 Apr 2024 10:23:54 -0500 Subject: [PATCH 2/2] Format numbers --- src/components/cap-map.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/cap-map.js b/src/components/cap-map.js index 52f2dcc..1b7f1fe 100644 --- a/src/components/cap-map.js +++ b/src/components/cap-map.js @@ -150,6 +150,10 @@ export class CapMap extends LitElement { return mapping; } + getFormattedNumber(number) { + return number.toLocaleString(); + } + render() { return html`
@@ -166,19 +170,18 @@ export class CapMap extends LitElement { : "State and Federal Totals"}

- ${this.activeStats.caseCount}
Unique cases

- ${this.activeStats.reporterCount}
Reporters + ${this.getFormattedNumber( + this.activeStats.reporterCount, + )}
Reporters

- ${this.activeStats.pageCount}
Pages scanned @@ -186,22 +189,19 @@ export class CapMap extends LitElement {

Federal Totals

- ${nationalCaselawStats.total.caseCount}
Unique cases + ${this.getFormattedNumber( + nationalCaselawStats.total.caseCount, + )}
Unique cases

- ${nationalCaselawStats.total.reporterCount}
Reporters + ${this.getFormattedNumber( + nationalCaselawStats.total.reporterCount, + )}
Reporters

- ${nationalCaselawStats.total.pageCount}
Pages scanned + ${this.getFormattedNumber( + nationalCaselawStats.total.pageCount, + )}
Pages scanned