Skip to content

Commit

Permalink
Merge branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsklar99 committed Jul 17, 2024
2 parents 14af467 + 1be8a71 commit 7566e2a
Show file tree
Hide file tree
Showing 166 changed files with 5,227 additions and 2,005 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ jobs:
submodules: "recursive"
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: hub.opensciencegrid.org/macrostrat/web
# New: apply the 'latest' tag to non-prerelease semver tags
tags: |
type=raw,value=sha-{{sha}}
type=raw,value=latest-itb
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')}}
type=raw,value=latest-itb-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=pr,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=tag,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=raw,value=latest-itb,enable=${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')}}
type=raw,value=latest-,suffix={{date 'YYYYMMDDHHmmss'}},enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')}}
type=raw,value=latest-itb-,suffix={{date 'YYYYMMDDHHmmss'}},enable=${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')}}
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{version}}-{{date 'YYYYMMDDHHmmss'}}
flavor: |
latest=false
- name: Set up Docker BuildX
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ docker-compose.yaml
!.yarn/versions

# IntelliJ
.idea
.idea/workspace.xml
.idea/tasks.xml

Expand Down
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/runConfigurations/Run_with_Chrome_Debugger.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/web.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions CONTRIBUTING.md

This file was deleted.

1 change: 1 addition & 0 deletions CONTRIBUTING.md
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Initialize the development environment with common settings
all:
git config --local submodule.recurse true
git submodule update --init --recursive
yarn install
1 change: 1 addition & 0 deletions content/.obsidian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace.json
1 change: 1 addition & 0 deletions content/.obsidian/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions content/.obsidian/appearance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"accentColor": ""
}
30 changes: 30 additions & 0 deletions content/.obsidian/core-plugins-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"properties": false,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": false
}
20 changes: 20 additions & 0 deletions content/.obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
"file-explorer",
"global-search",
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"page-preview",
"daily-notes",
"templates",
"note-composer",
"command-palette",
"editor-status",
"bookmarks",
"outline",
"word-count",
"file-recovery"
]
7 changes: 7 additions & 0 deletions content/Architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Macrostrat is centered around a [[PostgreSQL]] database
- A "database-centric" application

## Architectural models

- Supabase
- [[PostgREST]]
6 changes: 6 additions & 0 deletions content/Community.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Macrostrat is part of a broad geoinformatics ecosystem.


## Cool Earth observing websites

https://earth.nullschool.net: weather and ocean-circulation visualizations
26 changes: 26 additions & 0 deletions content/Components/Macrostrat data services.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Macrostrat has emerged as the go-to resource for digital geological map and
geologic column data.

There are two main reasons for this:

1. Macrostrat currently contains voluminous geologic map and column data that cannot be accessed in aggregate anywhere else.
- Over 300 different geologic maps, containing more than 2.5 million rock unit polygons covering the world, have been integrated into a single, unified, queryable environment in Macrostrat.
- Additionally, more than 35,000 rock units from over 1,500 regional columns covering all of North America and limited other regions are publicly available.
2. Macrostrat has a public "REST" application programming interface (API) that makes the full complement of data available in Findable, Accessible, Interoperable, and Reusable (FAIR) fashion with a CC-BY license.

Many third-party applications and users take advantage of Macrostrat FAIR data services:

- Mancos
- StraboSpot
- Flyover Country
- MinDat
- The iNaturalist web and mobile applications
- A California Academy of Sciences interactive museum kiosk
- Local geological surveys and individual scientists.

## Usage

Macrostrat’s data services have become impactful community resources for geologic information:
- Our geologic map server has served more than 2 billion tile requests since logging began in 2018 (~10 per second)
- Over the last 28 days, our other data APIs have served 3.8 million requests (~2 per second).
- Conservatively, these amount to 100,000 requests for information each day.
16 changes: 16 additions & 0 deletions content/Components/Macrostrat lexicon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Macrostrat maintains a lexicon of geologic information, such as stratigraphic units, etc.

## Concepts

- Lithologies (e.g., sandstone)
- Lithology attributes (e.g., _hummocky cross-stratified_)
- Environmental interpretations
- Stratigraphic names

## Mechanics

- This lexicon integrates curated information from a variety of publishers
- Notably the USGS Stratigraphic Names lexicon
- Also lexicons from other organizations
- Linked to from map and column descriptive information (mostly using autogenerated scripts)
- The capability to manage geologic names and concepts is not unique but the tools on top of it are
3 changes: 3 additions & 0 deletions content/Components/Macrostrat stratigraphic columns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Representation of stratigraphy in chronostratigraphic or lithostratigraphic context
- Provided by [[Macrostrat data services]]
- Will soon be viewable in [[Macrostrat user interfaces]]
9 changes: 9 additions & 0 deletions content/Components/Macrostrat user interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[Macrostrat]] user interfaces seek to express the world as geologists are used to seeing it

## Core components

- Maps
- Stratigraphic columns
- Summary pages for geologic entities (units, samples, geochemical datasets, etc.)

Based on [[Macrostrat data services]]
30 changes: 30 additions & 0 deletions content/Contributing/Contributor guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Code style

- Prefer Hyperscript (using the `@macrostrat/hyper` package) over JSX.
- Prefer functional components over class components.
- Prefer named exports over default exports (default exports make it more difficult to track names through the codebase).
- Prefer relative imports (e.g., `import { fetchHelper } from '../helpers'`) over absolute imports (e.g., `import { fetchHelper } from '~/pages/page1/helpers'`). Minimizing the number of up-directory imports or imports from other parts of the codebase is a good way to keep it maintainable.
- Extract logic into hooks or utility functions to keep components straightforward.
- Generally, try to make sure folders have an `index.ts` file that exports all the files that might be used from the outside.
- Put the most important function in the file first, and the least important (ex., utility functions) last.
- Prefer `function foo() {}` over `const foo = () => {}` for named functions.

# Code format

- Use Prettier to format your code. You can run `yarn format` to format the entire codebase, or set up your editor to format on save.
- Sort and prune imports periodically to keep them organized.

# Styling and interface design

- Prefer CSS modules where possible, but don't be afraid to use semantically named global classes for straightforward cases.
- Use sentence case for headings, button text, and other UI elements

# Dumb things to avoid

This codebase has been modernized and kept maintainable
by avoiding (or belatedly correcting) many anti-patterns:

- Hard-coding specific colors
- Creating URLs by concatenating strings
- Deeply nested code blocks (often with confusing [control flow](https://en.wikipedia.org/wiki/Control_flow) or [side effects](<https://en.wikipedia.org/wiki/Side_effect_(computer_science)>) instead of unambiguous returns)
- Duplicated code of more than a few lines
8 changes: 8 additions & 0 deletions content/Frequently asked questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

> [!question] I am interested in downloading the data from a search I ran on Macrostrat to import into ArcGIS.
> For example, if I searched "basalt", how might I be able to download the results as GIS metadata?
We don’t have a great way to bulk-download data in a form suitable for ArcGIS (yet; we are working on it). Part of the problem is that our GIS dataset is huge, so it’s usually easier to stream it from the web. For now, there are a few options:

- There is a way to view our layers directly in QGIS and filter/style them by their attributes (using the QGIS filter functions). Unfortunately this doesn’t work in ArcGIS. But you can pretty easily apply different styles and categories to make the thematic map you desire.
- [macrostratpy](https://github.com/DARPA-CRITICALMAAS/macrostratpy) is a prototype library to download Macrostrat tiles over large areas into a GIS-ready GeoPackage format. Right now it’s difficult to use but we hope to improve that over time.
10 changes: 10 additions & 0 deletions content/Get involved.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Macrostrat is improved by thousands of geologists

- Contribute to code
- Use our web components
- Contribute maps
- Add Rockd checkins

## Coming soon

- Contribute columns
19 changes: 19 additions & 0 deletions content/Guides/Accessing column data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Information about Macrostrat columns can be accessed through our [API](https://macrostrat.org/api/).
# Column footprints

Column footprints can be downloaded for some or all Macrostrat columns through the [`/columns`](https://macrostrat.org/api/columns) API route. This API route can be filtered by many parameters, which drives [[Macrostrat column filtering]].

- The `all` query parameter will download all columns
- The output format can be controlled with the `format` parameter, with options `json`, `csv`, `geojson`, `geojson_bare`, `topojson`, and `topojson_bare`.
- `geojson_bare` files can be opened directly in GIS software such as [QGIS](https://qgis.org)
- Not all Macrostrat columns are in our core column dataset. Other columns are held in different "projects," which can be specified using the `project_id` query parameter. Available projects can be found at the [Projects API route](https://macrostrat.org/api/defs/projects?all).

## Column units

Macrostrat column units drive the Macrostrat column visualization






Loading

0 comments on commit 7566e2a

Please sign in to comment.