Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
cbd6603
Improve column status code loading
davenquinn Nov 21, 2025
19bac10
Started clipping units of eODP columns
davenquinn Nov 21, 2025
be63988
Updated unit height scale
davenquinn Nov 22, 2025
84d2cee
Updated composite scale
davenquinn Nov 22, 2025
6f43eeb
Separate out age limitation
davenquinn Nov 22, 2025
b2c1f8f
Composite scale seems to work for height-based columns
davenquinn Nov 23, 2025
21d2f6f
Updated unconformity info
davenquinn Nov 23, 2025
f7d1761
Add PBDB occurrences
davenquinn Nov 23, 2025
019a34f
Refactor
davenquinn Nov 23, 2025
ab5cd12
Streamlined base column provider
davenquinn Nov 23, 2025
fd1da8d
Standardize dz to use BaseMeasurementsColumn
davenquinn Nov 23, 2025
95698e2
Further standardize column views
davenquinn Nov 23, 2025
5abc999
Starting point for occurrence matrix
davenquinn Nov 24, 2025
ca227e1
Control column padding
davenquinn Nov 24, 2025
4ec4692
Fixed taxon ranges
davenquinn Nov 24, 2025
5f7e908
Address label fit
davenquinn Nov 24, 2025
4ffd832
Starting point for nonlinear columns
davenquinn Nov 25, 2025
8b11e9e
Nonlinear scale is starting to work sort of
davenquinn Nov 25, 2025
dd62bb7
Updated composite scale
davenquinn Nov 25, 2025
0b77d0b
Updated nonlinear scale creation
davenquinn Nov 25, 2025
9dea40c
Improved nonlinear scales for correlation chart
davenquinn Nov 25, 2025
c8895c1
Updated timescale label components and props
davenquinn Nov 25, 2025
d68e73f
Some improvements to unconformity labels
davenquinn Nov 25, 2025
0a83b65
Partially working dynamic scales
davenquinn Nov 26, 2025
2ce070a
Update composite scale for equidistant surfaces
davenquinn Nov 26, 2025
279f247
Replicate ordinal scale for height
davenquinn Nov 26, 2025
36d6543
Replicate ordinal scale again
davenquinn Nov 26, 2025
1570bc0
Basic working height scale
davenquinn Nov 26, 2025
6eb19ad
Getting closer on timescale
davenquinn Nov 26, 2025
8ca1acf
Add timescale option to get intervals from Macrostrat API
davenquinn Nov 27, 2025
b64e71d
Partially improve age axis
davenquinn Nov 27, 2025
52a0b3d
Separate hybrid scale props
davenquinn Nov 27, 2025
ba36617
Fixed nonlinear scale
davenquinn Nov 27, 2025
16f323d
Start adjusting to reduce interdependency
davenquinn Nov 28, 2025
94685b5
Removed duplicate code from static-map-utils
davenquinn Nov 28, 2025
3832de9
Move location info to data-components
davenquinn Nov 28, 2025
2f816da
Updated unit details panel
davenquinn Nov 28, 2025
044a851
Fixed unit popover navigation
davenquinn Nov 28, 2025
3612ac1
Improve unit names
davenquinn Nov 28, 2025
2d4d62a
Got rid of more circular dependencies
davenquinn Nov 28, 2025
fcc29ec
Fixed xDD panel
davenquinn Nov 28, 2025
f6e554d
Updated changelogs
davenquinn Nov 28, 2025
65f2a88
Updated changelogs and package versions
davenquinn Nov 29, 2025
d43a241
Apply formatting changes
davenquinn Nov 29, 2025
5fb77a4
Make sure @macrostrat/column-views builds
davenquinn Nov 29, 2025
4c1393f
Merge remote-tracking branch 'origin/column-updates' into column-updates
davenquinn Nov 29, 2025
168f620
Fixed @macrostrat/data-components
davenquinn Nov 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"publish:storybook": "./scripts/publish-storybook.sh",
"format": "prettier --write .",
"check-types": "tsc --noEmit",
"check-circular": "madge --circular --extensions ts,tsx ."
"check-circular": "madge --exclude __archive --circular --extensions ts,tsx ."
},
"author": "Daven Quinn",
"license": "ISC",
Expand Down
4 changes: 4 additions & 0 deletions packages/api-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ 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.1.3] - 2025-11-28

- Update `MacrostratInterval` and `Interval` types

## [1.1.2] - 2025-08-22

- Added types for `StratName` and `StratNameConcept`
Expand Down
2 changes: 1 addition & 1 deletion packages/api-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@macrostrat/api-types",
"version": "1.1.2",
"version": "1.1.3",
"description": "Type definitions for Macrostrat's API",
"main": "./src/index.d.ts",
"types": "./src/index.d.ts",
Expand Down
14 changes: 12 additions & 2 deletions packages/api-types/src/defs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ export interface MacrostratRef {
t_units: number;
}

export type Interval = {
export type TimescaleRef = {
timescale_id: number;
name: string;
};

export type MacrostratInterval = {
int_id: number;
name: string;
abbrev?: string;
t_age?: number;
b_age?: number;
timescales?: string[];
int_type?: string;
timescales?: TimescaleRef[];
color: string;
};

type Interval = MacrostratInterval;

export type { Interval };
4 changes: 4 additions & 0 deletions packages/color-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ 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.1.2] - 2025-11-28

Updated Parcel bundler

## [1.1.1] - 2025-06-25

Add `delta` parameter to `getLuminanceAdjustedColorScheme` to control the
Expand Down
2 changes: 1 addition & 1 deletion packages/color-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@macrostrat/color-utils",
"version": "1.1.1",
"version": "1.1.2",
"description": "Color utility functions",
"type": "module",
"main": "dist/index.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/column-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.3.1] - 2025-11-28

- Update axis components
- Improve handling on nonlinear and discontinuous axes

## [1.3.0] - 2025-10-29

- Switch to `@visx/axis` for axis rendering
Expand Down
2 changes: 1 addition & 1 deletion packages/column-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@macrostrat/column-components",
"version": "1.3.0",
"version": "1.3.1",
"description": "React rendering primitives for stratigraphic columns",
"keywords": [
"geology",
Expand Down
19 changes: 15 additions & 4 deletions packages/column-components/src/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext, useEffect, useRef } from "react";
import h from "./hyper";
import { select } from "d3-selection";
import { axisLeft } from "d3-axis";
import { scaleLinear, ScaleLinear } from "d3-scale";
import { ScaleContinuousNumeric, scaleLinear, ScaleLinear } from "d3-scale";
import { useColumn } from "./context";

interface ColumnAxisProps {
Expand All @@ -21,7 +21,8 @@ interface ColumnAxisProps {
}

interface AgeAxisProps extends ColumnAxisProps {
scale?: ScaleLinear<number, number>;
scale?: ScaleContinuousNumeric<number, number>;
minTickSpacing?: number;
}

const __d3axisKeys = [
Expand All @@ -46,23 +47,33 @@ export function AgeAxis(props: AgeAxisProps) {
className,
showDomain = true,
tickSpacing = 60,
minTickSpacing = 20,
scale,
} = props;

const range = scale.range();
const pixelHeight = Math.abs(range[0] - range[1]);

const pixelHeight = Math.abs(range[0] - range[range.length - 1]);

let tickValues: number[] = undefined;

let ticks = Math.max(Math.round(pixelHeight / tickSpacing), 2);
if (pixelHeight < 3 * tickSpacing || scale.ticks(2).length < 2) {
// Push ticks towards extrema
const t0 = scale.ticks(4);

tickValues = [t0[0], t0[t0.length - 1]];
}

if (pixelHeight < minTickSpacing) {
ticks = 1;
tickValues = scale.ticks(1);
// Get the last tick value only
tickValues = [tickValues[0]];
}

const defaultProps = {
ticks: Math.max(Math.round(pixelHeight / tickSpacing), 2),
ticks,
// Suppress domain endpoints
tickSizeOuter: 0,
tickValues,
Expand Down
20 changes: 15 additions & 5 deletions packages/column-components/src/context/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { scaleLinear, ScaleContinuousNumeric, ScaleLinear } from "d3-scale";
import React, { createContext, useContext, useMemo } from "react";
import h from "@macrostrat/hyper";

type HeightRange = [number, number];
type HeightRange = number;
type ColumnScale = ScaleContinuousNumeric<HeightRange, number> | any;

type ColumnScaleClamped = ScaleLinear<number, number>;
type ColumnScaleClamped = ScaleContinuousNumeric<number, number>;

export declare interface ColumnDivision {
section_id: string;
Expand Down Expand Up @@ -55,6 +55,7 @@ export interface ColumnProviderProps<T extends ColumnDivision> {
width?: number;
axisType?: ColumnAxisType;
children?: any;
scale?: ColumnScale;
}

function ColumnProvider<T extends ColumnDivision>(
Expand All @@ -75,6 +76,7 @@ function ColumnProvider<T extends ColumnDivision>(
divisions = [],
width = 150,
axisType = ColumnAxisType.HEIGHT,
scale: _scale,
...rest
} = props;

Expand Down Expand Up @@ -103,9 +105,17 @@ function ColumnProvider<T extends ColumnDivision>(
}

// same as the old `innerHeight`
const pixelHeight = height * pixelsPerMeter * zoom;

const scale = scaleLinear().domain(range).range([pixelHeight, 0]);
let scale = _scale;
let pixelHeight: number;
if (scale == null) {
pixelHeight = height * pixelsPerMeter * zoom;
scale = scaleLinear().domain(range).range([pixelHeight, 0]);
} else {
pixelHeight = Math.abs(scale.range()[1] - scale.range()[0]);
// Remove any offset that might exist from paddings, scale breaks, etc.
const r1 = scale.range().map((d) => d - scale.range()[0]);
scale = _scale.copy().range(r1);
}
const scaleClamped = scale.copy().clamp(true);

return {
Expand Down
12 changes: 7 additions & 5 deletions packages/column-components/src/context/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { ReactNode } from "react";

//# This isn't really used yet...

export interface ColumnLayoutCtx<T extends ColumnDivision>
extends ColumnCtx<T> {
export interface ColumnLayoutCtx<
T extends ColumnDivision,
> extends ColumnCtx<T> {
width: number;
grainSizes?: string[];
grainsizeScale?: (d: string) => number;
Expand All @@ -34,8 +35,9 @@ const ColumnLayoutContext = createContext<ColumnLayoutCtx<ColumnDivision>>({
zoom: 1,
});

export interface ColumnLayoutProviderProps<T extends ColumnDivision>
extends Partial<ColumnCtx<T>> {
export interface ColumnLayoutProviderProps<
T extends ColumnDivision,
> extends Partial<ColumnCtx<T>> {
grainSizes?: string[];
grainsizeScale?: (d: string) => number;
width: number;
Expand Down Expand Up @@ -77,7 +79,7 @@ export interface CrossAxisLayoutProviderProps {

class CrossAxisLayoutProvider extends Component<CrossAxisLayoutProviderProps> {
static contextType = ColumnContext;
context: ColumnCtx<ColumnDivision>;
declare context: ColumnCtx<ColumnDivision>;
render() {
let { domain, range, width, children } = this.props;
if (range == null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/column-components/src/edit-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class DivisionEditOverlay extends Component<
};

timeout: any;
context: ColumnLayoutCtx<ColumnDivision>;
declare context: ColumnLayoutCtx<ColumnDivision>;
constructor(props: DivisionEditOverlayProps) {
super(props);
this.onHoverInterval = this.onHoverInterval.bind(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface FaciesColorPickerProps {

class FaciesColorPicker extends Component<FaciesColorPickerProps> {
static contextType = FaciesContext;
context: any;
declare context: any;

render() {
const { setFaciesColor } = this.context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class FaciesDescriptionSmall extends Component<FaciesDescriptionSmallProp
static contextType = FaciesContext;
static defaultProps = { selected: null, isEditable: false };

context: any;
declare context: any;

renderEach(d: FaciesData) {
let onClick = null;
Expand Down
3 changes: 2 additions & 1 deletion packages/column-components/src/editor/facies/picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ interface FaciesPickerProps {

export class FaciesPicker extends Component<FaciesPickerProps> {
static contextType = FaciesContext;
context: any;
declare context: any;

render() {
const { facies } = this.context;
const { interval, onChange } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion packages/column-components/src/lithology/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class LithologyBoxes extends UUIDComponent<any> {
resolveID: defaultResolveID,
minimumHeight: 0,
};
context: ColumnLayoutCtx<ColumnDivision>;
declare context: ColumnLayoutCtx<ColumnDivision>;
constructor(props) {
super(props);
this.constructLithologyDivisions =
Expand Down
9 changes: 6 additions & 3 deletions packages/column-components/src/notes/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ const buildColumnIndex = function () {

function withinDomain(scale) {
const scaleDomain = scale.domain();
const d1: [number, number] = [
Math.min(...scaleDomain),
Math.max(...scaleDomain),
];
return (d) => {
const noteRange: [number, number] = [d.height, d.top_height ?? d.height];

const rel = compareAgeRanges(scaleDomain, noteRange);
const rel = compareAgeRanges(d1, noteRange);

return rel !== AgeRangeRelationship.Disjoint;
};
Expand Down Expand Up @@ -101,7 +104,7 @@ class NoteLayoutProvider extends StatefulComponent<
return 12;
},
};
context: ColumnCtx<ColumnDivision>;
declare context: ColumnCtx<ColumnDivision>;
_previousContext: ColumnCtx<ColumnDivision>;
_rendererIndex: object;

Expand Down
2 changes: 1 addition & 1 deletion packages/column-components/src/util/scroll-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ColumnScroller extends Component<ColumnScrollerProps> {

static contextType: Context<ColumnCtx<ColumnDivision>> = ColumnContext;

context: ColumnCtx<ColumnDivision>;
declare context: ColumnCtx<ColumnDivision>;

render() {
const keys = [
Expand Down
7 changes: 7 additions & 0 deletions packages/column-views/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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).

## [2.2.0] - 2025-11-28

- Update SGP and PBDB facets
- Improve `UnitDetailsPanel` styling and information content
- Improve use of discontinous scales
- Create `hybridScale` options block to allow more dynamic scale generation

## [2.1.4] - 2025-10-29

- Improve stories
Expand Down
2 changes: 1 addition & 1 deletion packages/column-views/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@macrostrat/column-views",
"version": "2.1.4",
"version": "2.2.0",
"description": "Data views for Macrostrat stratigraphic columns",
"type": "module",
"source": "src/index.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/column-views/src/age-axis.module.sass
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
background-color: var(--column-background-color)
text-align: center

.composite-age-axis
position: relative
display: flex
flex-direction: row



Loading