Skip to content

Commit 755e822

Browse files
authored
Merge pull request #391 from UW-Macrostrat/heatmap
Add numbers to heatmap
2 parents 526c1de + 6e44106 commit 755e822

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

pages/heatmap/+Page.client.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
MapView,
66
buildInspectorStyle
77
} from "@macrostrat/map-interface";
8-
import { mapboxAccessToken, matomoToken, matomoApiURL, tileserverDomain } from "@macrostrat-web/settings";
8+
import { mapboxAccessToken, matomoToken, postgrestPrefix, tileserverDomain } from "@macrostrat-web/settings";
99
import { Footer } from "~/components/general";
1010
import { Divider, Spinner, Tabs, Tab } from "@blueprintjs/core";
1111
import { useEffect, useState } from "react";
@@ -24,12 +24,22 @@ export function Page() {
2424
}
2525

2626
function PageHeader() {
27+
const stats = useAPIResult(`${postgrestPrefix}/macrostrat_stats`)?.[0];
28+
if (stats == null) return null;
29+
const { rows_last_24_hours, total_rows } = stats;
30+
2731
return h('div.page-header', [
2832
h('h1', 'Heatmap'),
2933
h(Divider),
30-
h('p', 'This is a heatmap of all the locations where Macrostrat has been accessed from.'),
31-
h('p', 'The blue markers indicate today\'s accesses, while the grey markers indicate accesses from other days.'),
32-
]);
34+
h('p', `This is a heatmap of all the locations where Macrostrat has been accessed from.`),
35+
h('p', [
36+
"The blue markers indicate today's ",
37+
h('strong', rows_last_24_hours.toLocaleString()),
38+
" accesses, while the grey markers indicate the total ",
39+
h('strong', total_rows.toLocaleString()),
40+
" accesses from all days."
41+
])
42+
]);
3343
}
3444

3545
function todayStyle() {

0 commit comments

Comments
 (0)