@@ -3,11 +3,10 @@ import {
33 Column ,
44 DetritalColumn ,
55 FossilDataType ,
6+ HybridScaleType ,
67 Identifier ,
7- IsotopesColumn ,
88 MacrostratColumnStateProvider ,
99 MacrostratDataProvider ,
10- MeasurementDataProvider ,
1110 PBDBFossilsColumn ,
1211 ReferencesField ,
1312} from "@macrostrat/column-views" ;
@@ -18,15 +17,15 @@ import { PatternProvider } from "~/_providers";
1817import styles from "./index.module.sass" ;
1918import { navigate } from "vike/client/router" ;
2019
21- import { SGPMeasurementsColumn } from "./facets" ;
20+ import { SGPMeasurementsColumn , StableIsotopesColumn } from "./facets" ;
2221import { ModalUnitPanel } from "./modal-panel" ;
2322
2423import { PageBreadcrumbs } from "~/components" ;
2524import { onDemand } from "~/_utils" ;
2625import { ErrorBoundary } from "@macrostrat/ui-components" ;
2726import { DataField } from "@macrostrat/data-components" ;
2827import { ColumnAxisType } from "@macrostrat/column-components" ;
29- import { atom , useAtom , useAtomValue , useSetAtom } from "jotai" ;
28+ import { atom , useAtom , useAtomValue } from "jotai" ;
3029import { Button , FormGroup , HTMLSelect } from "@blueprintjs/core" ;
3130
3231const ColumnMap = onDemand ( ( ) => import ( "./map" ) . then ( ( mod ) => mod . ColumnMap ) ) ;
@@ -45,7 +44,7 @@ const heightAxisTypeAtom = atom<ColumnAxisType>();
4544const facetAtom = atom < string | null > ( ) ;
4645
4746function inferHeightAxisType ( axisType : ColumnAxisType , units ) : ColumnAxisType {
48- if ( axisType == ColumnAxisType . AGE ) {
47+ if ( axisType ! == ColumnAxisType . HEIGHT && axisType !== ColumnAxisType . DEPTH ) {
4948 return axisType ;
5049 }
5150 // Infer axis type from units
@@ -85,6 +84,7 @@ function ColumnPageInner({ columnInfo, linkPrefix = "/", projectID }) {
8584
8685 // Set subsidiary options
8786
87+ let hybridScale = null ;
8888 let maxInternalColumns = undefined ;
8989 let unconformityLabels = true ;
9090 let showTimescale = true ;
@@ -95,6 +95,22 @@ function ColumnPageInner({ columnInfo, linkPrefix = "/", projectID }) {
9595 unconformityLabels = false ;
9696 showTimescale = false ;
9797 }
98+ } else if (
99+ axisType == ColumnAxisType . HEIGHT ||
100+ axisType == ColumnAxisType . DEPTH
101+ ) {
102+ // Set up for approximate height column
103+ hybridScale = { type : HybridScaleType . ApproximateHeight } ;
104+ // Show ages on secondary axis
105+ axisType = ColumnAxisType . HEIGHT ;
106+ }
107+
108+ if ( axisType == ColumnAxisType . ORDINAL ) {
109+ // For ordinal columns, use the fancier "equidistant-surfaces" scale
110+ axisType = ColumnAxisType . AGE ;
111+ hybridScale = { type : HybridScaleType . EquidistantSurfaces } ;
112+
113+ maxInternalColumns = undefined ;
98114 }
99115
100116 const [ selectedUnitID , setSelectedUnitID ] = useState < number > (
@@ -169,6 +185,8 @@ function ColumnPageInner({ columnInfo, linkPrefix = "/", projectID }) {
169185 selectedUnit : selectedUnitID ,
170186 maxInternalColumns,
171187 showLabelColumn,
188+ hybridScale,
189+ pixelScale : 20 ,
172190 } ,
173191 children
174192 ) ,
@@ -225,29 +243,13 @@ function ColumnBasicInfo({ data, showColumnID = true }) {
225243let ageAxisOptions = {
226244 Height : ColumnAxisType . HEIGHT ,
227245 Age : ColumnAxisType . AGE ,
246+ Ordinal : ColumnAxisType . ORDINAL ,
228247} ;
229248
230249function facetElements ( facet : string | null , columnID : number ) {
231250 switch ( facet ) {
232251 case "stable-isotopes" :
233- return h ( MeasurementDataProvider , { col_id : columnID } , [
234- h ( IsotopesColumn , {
235- parameter : "D13C" ,
236- label : "δ¹³C" ,
237- color : "dodgeblue" ,
238- domain : [ - 14 , 6 ] ,
239- width : 100 ,
240- nTicks : 4 ,
241- } ) ,
242- h ( IsotopesColumn , {
243- parameter : "D18O" ,
244- label : "δ¹⁸O" ,
245- color : "red" ,
246- domain : [ - 40 , 0 ] ,
247- width : 100 ,
248- nTicks : 4 ,
249- } ) ,
250- ] ) ;
252+ return h ( StableIsotopesColumn , { columnID } ) ;
251253 case "sgp-samples" :
252254 return h ( SGPMeasurementsColumn , { columnID } ) ;
253255 case "fossil-taxa" :
0 commit comments