Skip to content

Commit

Permalink
Merge pull request #102 from tinykite/fix-map-numbers
Browse files Browse the repository at this point in the history
Fix map numbers
  • Loading branch information
tinykite authored Apr 4, 2024
2 parents f92008b + d51cfad commit 1e2f821
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions src/components/cap-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export class CapMap extends LitElement {
return mapping;
}

getFormattedNumber(number) {
return number.toLocaleString();
}

render() {
return html`
<div class="mapRegion">
Expand All @@ -166,42 +170,38 @@ export class CapMap extends LitElement {
: "State and Federal Totals"}
</h3>
<p class="infoBox__text">
${this.activeStats.caseCount}<br /><span
${this.getFormattedNumber(this.activeStats.caseCount)}<br /><span
class="infoBox__textDescriptor"
>Unique cases</span
>
</p>
<p class="infoBox__text">
${this.activeStats.reporterCount}<br /><span
class="infoBox__textDescriptor"
>Reporters</span
>
${this.getFormattedNumber(
this.activeStats.reporterCount,
)}<br /><span class="infoBox__textDescriptor">Reporters</span>
</p>
<p class="infoBox__text">
${this.activeStats.pageCount}<br /><span
${this.getFormattedNumber(this.activeStats.pageCount)}<br /><span
class="infoBox__textDescriptor"
>Pages scanned</span
>
</p>
<h3 class="infoBox__heading">Federal Totals</h3>
<p class="infoBox__text">
${nationalCaselawStats.total.caseCount}<br /><span
class="infoBox__textDescriptor"
>Unique cases</span
>
${this.getFormattedNumber(
nationalCaselawStats.total.caseCount,
)}<br /><span class="infoBox__textDescriptor">Unique cases</span>
</p>
<p class="infoBox__text">
${nationalCaselawStats.total.reporterCount}<br /><span
class="infoBox__textDescriptor"
>Reporters</span
>
${this.getFormattedNumber(
nationalCaselawStats.total.reporterCount,
)}<br /><span class="infoBox__textDescriptor">Reporters</span>
</p>
<p class="infoBox__text">
${nationalCaselawStats.total.pageCount}<br /><span
class="infoBox__textDescriptor"
>Pages scanned</span
>
${this.getFormattedNumber(
nationalCaselawStats.total.pageCount,
)}<br /><span class="infoBox__textDescriptor">Pages scanned</span>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/data/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1e2f821

Please sign in to comment.