Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@macrostrat/web",
"private": true,
"version": "5.2.2",
"version": "5.3.0",
"description": "Macrostrat map interface",
"type": "module",
"scripts": {
Expand Down Expand Up @@ -61,23 +61,23 @@
"@macrostrat-web/sift": "workspace:*",
"@macrostrat-web/text-toolchain": "workspace:*",
"@macrostrat-web/utility-functions": "workspace:*",
"@macrostrat/api-types": "^1.1.0",
"@macrostrat/color-utils": "^1.1.0",
"@macrostrat/column-components": "^1.1.0",
"@macrostrat/column-views": "^2.1.2",
"@macrostrat/data-components": "^0.2.0",
"@macrostrat/data-sheet": "^2.0.2",
"@macrostrat/feedback-components": "^1.1.9",
"@macrostrat/form-components": "^0.2.4",
"@macrostrat/api-types": "^1.1.3",
"@macrostrat/color-utils": "^1.1.2",
"@macrostrat/column-components": "^1.3.1",
"@macrostrat/column-views": "^2.2.1",
"@macrostrat/data-components": "^0.2.2",
"@macrostrat/data-sheet": "^2.2.1",
"@macrostrat/feedback-components": "^1.1.10",
"@macrostrat/form-components": "^0.2.5",
"@macrostrat/hyper": "^3.0.6",
"@macrostrat/map-interface": "^1.5.6",
"@macrostrat/map-styles": "^1.2.0",
"@macrostrat/mapbox-react": "^2.6.0",
"@macrostrat/mapbox-utils": "^1.5.0",
"@macrostrat/style-system": "^0.2.1",
"@macrostrat/svg-map-components": "^1.0.4",
"@macrostrat/timescale": "^2.2.1",
"@macrostrat/ui-components": "^4.4.5",
"@macrostrat/map-interface": "^1.6.0",
"@macrostrat/map-styles": "^1.2.4",
"@macrostrat/mapbox-react": "^2.6.4",
"@macrostrat/mapbox-utils": "^1.6.1",
"@macrostrat/style-system": "^0.2.3",
"@macrostrat/svg-map-components": "^1.0.6",
"@macrostrat/timescale": "^2.3.0",
"@macrostrat/ui-components": "^4.5.2",
"@react-hook/size": "^2.1.2",
"@supabase/postgrest-js": "^1.18.1",
"@turf/bbox": "^6.5.0",
Expand All @@ -102,7 +102,7 @@
"classnames": "^2.2.6",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"cross-fetch": "^4.0.0",
"cross-fetch": "^4.1.0",
"d3-array": "^3.1.1",
"d3-axis": "^3.0.0",
"d3-format": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/column-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@supabase/postgrest-js": "^1.18.1",
"@types/mapbox__mapbox-gl-draw": "^1.2.3",
"axios": "^1.13.2",
"cross-fetch": "^3.1.5",
"cross-fetch": "^4.0.0",
"mapbox-gl": "^3.0.0",
"react": "^18",
"react-beautiful-dnd": "^13.1.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/section-editor/src/column/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import {
FaciesProvider,
AssetPathContext,
GrainsizeLayoutProvider,
GeologicPatternProvider,
SymbolColumn,
DivisionEditOverlay,
ColumnImage,
LithologyColumn,
Expand Down Expand Up @@ -175,7 +173,6 @@ class StratColumn extends Component {
h(CoveredOverlay),
h(LithologyBoxes),
]),
h(SymbolColumn, { left: 90, symbols: [] }),
h(ColumnAxis),
h(GrainsizeAxis),
// Notes column
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// https://vike.dev/onBeforeRender

import { apiV2Prefix } from "@macrostrat-web/settings";
import { preprocessUnits } from "@macrostrat/column-views";
import fetch from "cross-fetch";

import { ColumnSummary } from "#/map/map-interface/app-state/handlers/columns";
Expand Down Expand Up @@ -34,6 +33,8 @@ export async function data(pageContext) {
{
project_id,
col_id,
show_position: true,
response: "long",
},
(res) => res
),
Expand Down Expand Up @@ -75,19 +76,13 @@ async function getData(
* gets around the current limitation that there's no way to request any column data
* without knowing the status_code.
*/
let res = await getAndUnwrap(
assembleURL(entity, { ...args, status_code: "active" })
);
let data = unwrapResponse(res);

if (data.length > 0) {
return data;
}
const url = assembleURL(entity, {
...args,
status_code: "active,in process",
});

let res2 = await getAndUnwrap(
assembleURL(entity, { ...args, status_code: "in process" })
);
return unwrapResponse(res2);
const res = await getAndUnwrap(url);
return unwrapResponse(res);
}

function assembleURL(
Expand All @@ -100,7 +95,7 @@ function assembleURL(
}: {
col_id: number;
project_id: number;
status_code?: "active" | "in process";
status_code?: string;
[key: string]: string | number;
}
) {
Expand Down
71 changes: 71 additions & 0 deletions pages/columns/@column/column-inspector/facets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import hyper from "@macrostrat/hyper";
import { useAPIResult } from "@macrostrat/ui-components";
import {
BaseMeasurementsColumn,
IsotopesColumn,
MeasurementDataProvider,
TruncatedList,
} from "@macrostrat/column-views";
import { apiDomain } from "@macrostrat-web/settings";
import styles from "./index.module.sass";

const h = hyper.styled(styles);

function useSGPData({ col_id }) {
const res = useAPIResult(
apiDomain + "/api/pg/sgp_unit_matches",
{
col_id: `eq.${col_id}`,
},
(d) => d
);
return res;
}

export function SGPMeasurementsColumn({ columnID }) {
const data = useSGPData({ col_id: columnID });

if (data == null) return null;

return h(BaseMeasurementsColumn, {
data,
noteComponent: SGPSamplesNote,
});
}

function SGPSamplesNote(props) {
const { note } = props;
const sgp_samples = note?.data?.sgp_samples;

if (sgp_samples == null || sgp_samples.length === 0) return null;

return h(TruncatedList, {
className: "sgp-samples",
data: sgp_samples,
itemRenderer: (p) => h("span", p.data.name),
});
}

export function StableIsotopesColumn({ columnID }) {
return h(
"div.isotopes-column",
h(MeasurementDataProvider, { col_id: columnID }, [
h(IsotopesColumn, {
parameter: "D13C",
label: "δ¹³C",
color: "dodgeblue",
domain: [-14, 6],
width: 100,
nTicks: 4,
}),
h(IsotopesColumn, {
parameter: "D18O",
label: "δ¹⁸O",
color: "red",
domain: [-40, 0],
width: 100,
nTicks: 4,
}),
])
);
}
14 changes: 13 additions & 1 deletion pages/columns/@column/column-inspector/index.module.sass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

max-width: 80rem
margin: 0 auto
gap: 1em


.left-column
Expand All @@ -38,7 +39,7 @@


.column-view
margin: 0 4em 4em
margin: 0 0 4em
padding: 0

.column-header
Expand Down Expand Up @@ -109,3 +110,14 @@ rect.selection-overlay
.column-map, .unit-details-panel
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3)
border-radius: 6px


.column-title-row
display: flex
flex-direction: row
align-items: baseline
justify-content: space-between

.isotopes-column
display: flex
flex-direction: row
Loading