-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from UW-Macrostrat/separate-frontend-modules
Separate frontend modules
- Loading branch information
Showing
18 changed files
with
150 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. The format | ||
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this | ||
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [1.0.0] - 2024-02-15 | ||
|
||
Split off `@corelle/rotations` module from legacy `@macrostrat/corelle` package. | ||
The React components for creating an SVG map have been moved to the | ||
`@corelle/svg-map-layers` package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@corelle/rotations", | ||
"version": "1.0.0", | ||
"description": "A client library for the Corelle plate-rotation API", | ||
"scripts": { | ||
"build": "rm -rf dist && parcel build", | ||
"prepare": "npm run build" | ||
}, | ||
"author": "Daven Quinn", | ||
"license": "MIT", | ||
"module": "dist/esm/index.js", | ||
"main": "dist/cjs/index.js", | ||
"source": "src/index.ts", | ||
"types": "dist/esm/index.d.ts", | ||
"dependencies": { | ||
"@types/d3-geo": "^3.0", | ||
"d3-geo": "^3.1.1", | ||
"quaternion": "^2.0.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.13.1||^17.0.0||^18.0.0||^19.0.0" | ||
}, | ||
"exports": { | ||
".": { | ||
"source": "./src/index.ts", | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/esm/index.d.ts" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.0", | ||
"parcel": "^2.13.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { geoTransform, geoPath, GeoProjection } from "d3-geo"; | ||
|
||
type RotateFunction = (coords: [number, number]) => [number, number]; | ||
|
||
export function pathGenerator( | ||
projection: GeoProjection, | ||
rotation: RotateFunction, | ||
canvasContext = null, | ||
) { | ||
/** Returns a composite of a geo projection and a rotation | ||
* Optionally, a canvas context can be provided to render to a canvas | ||
* */ | ||
// Filter out features that are too young | ||
const trans = geoTransform({ | ||
point(lon, lat) { | ||
const [x, y] = rotation([lon, lat]); | ||
return this.stream.point(x, y); | ||
}, | ||
}); | ||
|
||
// This ordering makes no sense but whatever | ||
const stream = (s) => | ||
// https://stackoverflow.com/questions/27557724/what-is-the-proper-way-to-use-d3s-projection-stream | ||
trans.stream(projection.stream(s)); | ||
|
||
return geoPath({ stream }, canvasContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./rotations"; | ||
export * from "./math"; | ||
export * from "./geometry"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters