Skip to content

Commit 42f1419

Browse files
authored
Merge pull request #274 from UW-Macrostrat/lexicon-updates
Site Updates
2 parents 1e2bf7d + fa877cf commit 42f1419

File tree

109 files changed

+6394
-1318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+6394
-1318
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"react-router-dom": "^6.8.2",
135135
"react-router-hash-link": "^2.4.3",
136136
"react-spring": "^9.7.3",
137+
"recharts": "^2.13.0",
137138
"reduce-reducers": "^1.0.4",
138139
"redux": "^4.0.5",
139140
"sirv": "^2.0.3",

packages/lithology-hierarchy/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export default function MacrostratLithologyHierarchy({ width, height }) {
2727
}
2828
const liths: Lith[] = res.success.data;
2929

30+
console.log("Liths", liths);
31+
3032
return h("div.flex.row", [
3133
h("div.example-container", [
3234
h(Hierarchy, { width, height, data: nestLiths(liths) }),

packages/settings/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const burwellTileDomain = getRuntimeConfig(
1313
);
1414
export const apiDomain = getRuntimeConfig("MACROSTRAT_API_DOMAIN");
1515
export const tileserverDomain = burwellTileDomain;
16+
export const isDev = getRuntimeConfig("MACROSTRAT_INSTANCE") === "Development";
1617

1718
export const gddDomain = "https://xdd.wisc.edu";
1819
export const pbdbDomain = "https://paleobiodb.org";
@@ -67,4 +68,5 @@ export const SETTINGS = {
6768
apiV2Prefix,
6869
mapPagePrefix,
6970
routerBasename,
71+
isDev,
7072
};

packages/sift/src/js/components/Attributes.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ class _Attributes extends React.Component {
352352
}
353353

354354
if (this.state.liths.length) {
355+
console.log("liths", this.state.liths)
355356
totalCharts += 1;
356357
lithChart = (
357358
<div>

packages/sift/src/js/components/StratName.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ class _StratName extends React.Component {
363363
stratHierarchy = <StratNameHierarchy stratNameID={this.state.id} />;
364364
}
365365

366+
console.log(this.state.strat_names)
367+
366368
return (
367369
<div className="page-content">
368370
<Loading loading={this.state.loading} />

pages/+Page.client.ts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import { Image, Navbar, Footer, useMacrostratAPI } from "./index";
2+
import h from "./main.module.sass";
3+
import { PanelCard } from "@macrostrat/map-interface";
4+
import { LinkCard } from "~/components/cards";
5+
import { useState } from 'react';
6+
import { SETTINGS } from "@macrostrat-web/settings";
7+
import { Loading } from "./index"
8+
9+
export function Page() {
10+
const result = useMacrostratAPI('/stats?all')?.success.data;
11+
12+
if(!result) {
13+
return h(Loading)
14+
}
15+
16+
let columns = 0;
17+
let units = 0;
18+
let polygons = 0;
19+
20+
result.forEach(project => {
21+
columns += project.columns;
22+
units += project.units;
23+
polygons += project.t_polys;
24+
});
25+
26+
return h('div.total', [
27+
h(Navbar),
28+
29+
h('div.start', [
30+
h(Image, { className: "back-img cover-image", src: 'cover_large.jpg' }),
31+
h('div.text', [
32+
h('div.header', {}, [
33+
h('h1.main-title','Macrostrat'),
34+
h('h2.version','v2')
35+
]),
36+
h('div.stats', {}, [
37+
h('div.stat', {}, [
38+
h('span.top-stat#n_columns', {}, formatNumber(columns)),
39+
h('span.top-stat-label', {}, 'Regional Rock Columns')
40+
]),
41+
h('div.stat', {}, [
42+
h('span.top-stat#n_units', {}, formatNumber(units)),
43+
h('span.top-stat-label', {}, 'Rock Units')
44+
]),
45+
h('div.stat', {}, [
46+
h('span.top-stat#n_polys', {}, formatNumber(polygons)),
47+
h('span.top-stat-label', {}, 'Geologic Map Polygons')
48+
]),
49+
h('div.stat', {}, [
50+
h('span.top-stat#n_names', {}, formatNumber(result.length)),
51+
h('span.top-stat-label', {}, 'Projects')
52+
])
53+
]),
54+
h('p.big-text', {}, 'A platform for geological data exploration, integration, and analysis'),
55+
])
56+
]),
57+
h('div.buttons', [
58+
// h(LinkCard, { title: 'Search', href: '/sift/#/' }),
59+
h(LinkCard, { title: "Geologic Map", href: '/map/#3/40.78/-94.13' }, [
60+
h('p', { className: 'long'}, [
61+
h('div.temp', {}, [
62+
'With over 225 maps from data providers around the world across every scale, Macrostrat is the world\'s largest homogenized geologic map database. Our data processing pipeline links geologic map polygons to Macrostrat column polygons, external stratigraphic name lexicons, and geochronological intervals, enabling the enhancement of the original map data and allowing for direct links into ',
63+
h('a', { href: 'https://xdd.wisc.edu', target: '_blank' }, 'xDD'),
64+
' (formly GeoDeepDive).'
65+
]),
66+
h('div.temp', {}, [
67+
'Are you affiliated with a state or national geologic survey? ',
68+
h('a', { href: 'mailto:[email protected]?Subject=Geologic%20Map%20Collaboration' }, 'Get in touch'),
69+
' with us - we\'d love to collaborate and help publicize your maps!'
70+
]),
71+
h('div.temp', {}, [
72+
'Get started by ',
73+
h('a', { href: '/map' }, 'exploring the map'),
74+
' or ',
75+
h('a', { href: '/map/sources' }, 'taking a look at'),
76+
' which maps are currently a part of Macrostrat.'
77+
])
78+
]),
79+
]),
80+
h(LinkCard, { title: 'Maps', href: '/maps'}, [
81+
h('p', "The spatial footprint of rocks on the Earth\'s surface")
82+
]),
83+
h(LinkCard, { title: 'Columns', href: '/columns'}, [
84+
h('p', 'Stratigraphic and geological columns showing the organization of rocks in time')
85+
]),
86+
h(LinkCard, { title: 'Geologic Lexicon', href: '/lex'}, [
87+
h('p', 'Geologic units and data dictionaries')
88+
]),
89+
h(LinkCard, { title: 'Projects', href: '/projects'}, [
90+
h('p', 'Projects for specific regions or geological problems')
91+
]),
92+
h(LinkCard, { title: h('div.rockd-button-container', [
93+
h(Image, { className: "rockd-png", src: 'rockd.png', width: '22px' }),
94+
h('p', 'Rockd')
95+
]), href: 'https://rockd.org'}, [
96+
h('p', 'Go mobile!')
97+
]),
98+
h.if(SETTINGS.isDev)(LinkCard, { title: 'Dev Apps', href: '/dev'},
99+
h('p', 'Layers and testbed apps that aren\'t ready for prime time'),
100+
),
101+
h.if(SETTINGS.isDev)(LinkCard, { title: 'Documentation', href: '/docs'},
102+
h('p', "Macrostrat documentation")
103+
),
104+
]),
105+
Donate,
106+
h(Footer),
107+
])
108+
}
109+
110+
const Donate =
111+
h('div.donate-container', {}, [
112+
h(Image, { className: "back-img donate-img", src: 'donate_medium.jpg' }),
113+
h('div.text-donate', [
114+
h('a', { href: 'https://secure.supportuw.org/give/?id=E0A03FA3-B2A0-431C-83EE-A121A04EEB5D', target: '_blank' }, [
115+
h('h1.title.donate-title', 'Donate Now'),
116+
]),
117+
h('div.donate-info', {}, [
118+
'Grant funding, principally from the ',
119+
h('a', { href: 'http://www.nsf.gov', target: '_blank' }, 'U.S. National Science Foundation'),
120+
', got Macrostrat off the ground and keeps us innovating, but maintaining and growing a free and open digital resource involves ongoing expenses beyond the grant cycle, like annual certificate renewals, cloud server hosting and backup storage that keep your connection safe, domain name registrations that keep us located on the web, and system upgrades to keep us fast and efficient. If you would like to help us continue to grow and provide free resources, you can do so with a one-time or recurring gift to the UW Foundation Paleontology Program Fund in Geology. Thank you!'
121+
])
122+
])
123+
]);
124+
125+
126+
function formatNumber(num) {
127+
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
128+
}

pages/+Page.mdx

Lines changed: 0 additions & 40 deletions
This file was deleted.

pages/_error/+Page.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import h from "@macrostrat/hyper";
1+
import h from "./main.module.styl";
22
import { CenteredContentPage } from "~/layouts";
33
import { PageHeader } from "~/components";
44
import { usePageContext } from "vike-react/usePageContext";
55
import { ClientOnly } from "vike-react/ClientOnly";
6-
import { Spinner, Button } from "@blueprintjs/core";
6+
import { Spinner, Button, Card } from "@blueprintjs/core";
7+
import { BlankImage } from "../index";
8+
import { LinkCard } from "~/components";
79

810
export function Page() {
11+
const ctx = usePageContext();
12+
const is404 = ctx.is404;
13+
914
return h(CenteredContentPage, [h(PageHeader), h(PageContent)]);
1015
}
1116

@@ -17,9 +22,16 @@ function PageContent() {
1722
const reason = ctx.abortReason;
1823

1924
if (is404) {
20-
return h([
21-
h("h1", [h("code.bp5-code", "404"), " Page Not Found"]),
22-
h("p", ["Could not find a page at path ", h("code.bp5-code", path), "."]),
25+
return h('div.error404', [
26+
h(BlankImage, { src: "https://storage.macrostrat.org/assets/web/earth-crust.jpg", className: "error-image", width: "100%", height: "100%" }),
27+
h('div.error-text', [
28+
h('h1', "404"),
29+
h('h2', "The rock you are looking for doesn't exist. Keep digging."),
30+
h('div.buttons', [
31+
h('button', { className: "btn", onClick: () => history.back() }, "Go back"),
32+
h('a', { className: "btn", href: "/" }, "Go home")
33+
]),
34+
])
2335
]);
2436
} else if (statusCode == 401) {
2537
return h([

pages/_error/main.module.styl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.error404
2+
background: black
3+
height: 100vh
4+
text-align: center
5+
color: black
6+
7+
h1
8+
margin-top 0
9+
font-size 100px
10+
11+
.error-text
12+
position absolute
13+
z-index 2
14+
top 30%
15+
left 50%
16+
transform translate(-50%, -50%)
17+
color white
18+
19+
.error-image
20+
position absolute
21+
z-index 1
22+
top 0
23+
left 0
24+
opacity .5
25+
26+
.buttons
27+
display flex
28+
gap 100px
29+
justify-content center
30+
margin-top 50px
31+
32+
a
33+
text-decoration none
34+
35+
36+
button:hover
37+
background-color var(--secondary-background-color)
38+
color: var(text-emphasized-color) !important
39+
40+
.btn
41+
background-color var(--background-color)
42+
color: var(text-emphasized-color) !important
43+
cursor: pointer
44+
margin 14px 0
45+
46+
a
47+
color: var(--text-emphasized-color) !important

0 commit comments

Comments
 (0)