Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
65dcba5
Updated edit table management
davenquinn Jan 2, 2025
e1fe9d1
Save edit table columns to backend; auth debugging improvements
davenquinn Jan 2, 2025
775cd69
Updated edit table somewhat
davenquinn Jan 2, 2025
519ac16
Improve filtering of null groups (fixes #249)
davenquinn Jan 2, 2025
11882a6
Improved edit table contents
davenquinn Jan 3, 2025
f6e1f0d
Remove old adjustable panel
davenquinn Jan 3, 2025
febdfde
Simplify map interface
davenquinn Jan 3, 2025
39f9861
Moved legend table to library
davenquinn Jan 3, 2025
3ca0df2
Removed more references to local table
davenquinn Jan 4, 2025
261461d
Created toggle for new table design
davenquinn Jan 4, 2025
8e8921c
Moved style files around
davenquinn Jan 4, 2025
d242d33
Improved loading of cell components
davenquinn Jan 4, 2025
ac236ec
Reorder source-layer columns
davenquinn Jan 4, 2025
e295cdc
Moved back to a single table
davenquinn Jan 4, 2025
e475be3
Updated imports further
davenquinn Jan 4, 2025
3893153
Rename default column config to shared
davenquinn Jan 4, 2025
125eba6
Moved column config to a standalone function
davenquinn Jan 5, 2025
f816dcb
Make omitted row headers show up differently
davenquinn Jan 5, 2025
ba883d2
Row omission seems to work
davenquinn Jan 5, 2025
30148f9
Removed outdated omit field config
davenquinn Jan 5, 2025
713aad7
Added starting point for column tables
davenquinn Jan 6, 2025
6abc628
Started streamlining editing
davenquinn Jan 6, 2025
77d1973
Updated map polygons
davenquinn Jan 6, 2025
8fbeafb
Updated map styling
davenquinn Jan 6, 2025
22aa188
Reconfigured page layout
davenquinn Jan 6, 2025
5bac1b9
Correctly do a multi-layer selection
davenquinn Jan 6, 2025
44449ef
Updated table view
davenquinn Jan 6, 2025
6a84bf0
Updated the style of scripts
davenquinn Jan 7, 2025
63dd8cd
Adjusted configuration for page state
davenquinn Jan 7, 2025
a859191
Updated edit table
davenquinn Jan 10, 2025
036bba0
Remove ref setting
davenquinn Jan 29, 2025
d670a07
Deduplicate interval renderer
davenquinn Jan 29, 2025
fff5eae
Updated intervals selection
davenquinn Jan 29, 2025
dcc47a6
Slightly improved map interface design
davenquinn Jan 30, 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 deps/web-components
Submodule web-components updated 50 files
+0 −1 .idea/misc.xml
+20 −18 package.json
+1 −1 packages/api-views/package.json
+1 −1 packages/auth-components/package.json
+0 −3 packages/color-utils/package.json
+0 −1 packages/column-components/package.json
+0 −3 packages/data-sheet/package.json
+0 −0 packages/data-sheet/src/data-sheet-old.stories.ts
+7 −4 packages/data-sheet2/package.json
+6 −1 packages/data-sheet2/src/components/colors.ts
+449 −0 packages/data-sheet2/src/core.ts
+2 −661 packages/data-sheet2/src/index.ts
+2 −0 packages/data-sheet2/src/main.module.sass
+24 −0 packages/data-sheet2/src/postgrest-table/cell-renderers.ts
+287 −0 packages/data-sheet2/src/postgrest-table/data-loaders.ts
+172 −0 packages/data-sheet2/src/postgrest-table/index.ts
+52 −0 packages/data-sheet2/src/postgrest-table/main.module.sass
+266 −0 packages/data-sheet2/src/provider.ts
+97 −0 packages/data-sheet2/src/utils/column-spec.ts
+7 −0 packages/data-sheet2/src/utils/index.ts
+0 −18 packages/data-sheet2/stories/data-sheet-2.stories.ts
+15 −20 packages/data-sheet2/stories/data-sheet-test/index.ts
+41 −0 packages/data-sheet2/stories/data-sheet.stories.ts
+6 −0 packages/data-sheet2/stories/postgrest-sheet.stories.module.sass
+84 −0 packages/data-sheet2/stories/postgrest-sheet.stories.ts
+229 −0 packages/feedback-components/src/extractions/index.ts
+10 −0 packages/feedback-components/src/extractions/main.module.sass
+29 −0 packages/feedback-components/src/extractions/types.ts
+409 −0 packages/feedback-components/src/feedback/edit-state.ts
+36 −0 packages/feedback-components/src/feedback/feedback.module.sass
+220 −0 packages/feedback-components/src/feedback/index.ts
+61 −0 packages/feedback-components/src/feedback/node.ts
+110 −0 packages/feedback-components/src/feedback/text-visualizer.ts
+70 −0 packages/feedback-components/src/feedback/type-selector/index.ts
+13 −0 packages/feedback-components/src/feedback/type-selector/main.module.sass
+78 −0 packages/feedback-components/src/feedback/types.ts
+2 −24 packages/feedback-components/src/index.ts
+0 −1 packages/map-components/package.json
+0 −1 packages/map-interface/package.json
+1 −1 packages/map-interface/src/context-panel/index.ts
+0 −4 packages/mapbox-react/package.json
+0 −2 packages/mapbox-styles/package.json
+0 −4 packages/mapbox-utils/package.json
+1 −4 packages/style-system/package.json
+0 −2 packages/timescale/package.json
+0 −3 packages/ui-components/package.json
+1 −1 packages/ui-components/src/toaster.ts
+3 −3 toolchain/hyperstyle-loader/package.json
+0 −1 toolchain/vite-plugin-hyperstyles/package.json
+11 −5 vite.config.ts
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"@visx/axis": "^2.14.0",
"@visx/scale": "^2.2.2",
"@vitejs/plugin-react": "^4.0.4",
"allotment": "^1.20.2",
"axios": "^0.25.0",
"chroma-js": "^3.0.0",
"classnames": "^2.2.6",
Expand Down
7 changes: 7 additions & 0 deletions pages/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default {
"environment",
"urlPathname",
"scripts",
"pageStyle",
],
clientRouting: true,
supportsDarkMode: true,
Expand All @@ -29,6 +30,12 @@ export default {
server: true,
},
},
pageStyle: {
env: {
client: true,
server: true,
},
},
scripts: {
env: {
client: false,
Expand Down
39 changes: 3 additions & 36 deletions pages/dev/map/sources/+Page.client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import h from "@macrostrat/hyper";
// Import other components
import { burwellTileDomain, mapboxAccessToken } from "@macrostrat-web/settings";
import { mapboxAccessToken } from "@macrostrat-web/settings";
// Import other components
import { Spacer, useDarkMode } from "@macrostrat/ui-components";
import mapboxgl from "mapbox-gl";
Expand All @@ -13,12 +13,11 @@ import {
buildInspectorStyle,
LocationPanel,
MapView,
FeaturePanel,
FeatureSelectionHandler,
} from "@macrostrat/map-interface";
import { NonIdealState } from "@blueprintjs/core";
import { LinkItem } from "pages/dev/map/layers/lib";
import { Link } from "~/components";
import { boundingGeometryMapStyle } from "~/map-styles";

export function Page() {
const dark = useDarkMode();
Expand All @@ -33,39 +32,7 @@ export function Page() {
const [actualStyle, setActualStyle] = useState(null);

useEffect(() => {
const color = isEnabled ? 255 : 20;

const overlayStyle: mapboxgl.Style = {
version: 8,
sources: {
rgeom: {
type: "vector",
tiles: [burwellTileDomain + "/maps/bounds/{z}/{x}/{y}"],
maxzoom: 9,
},
},
layers: [
{
id: "rgeom",
type: "fill",
source: "rgeom",
"source-layer": "bounds",
paint: {
"fill-color": `rgba(${color}, ${color}, ${color}, 0.1)`,
},
},
{
id: "rgeom-line",
type: "line",
source: "rgeom",
"source-layer": "bounds",
paint: {
"line-color": `rgba(${color}, ${color}, ${color}, 0.5)`,
"line-width": 1,
},
},
],
};
const overlayStyle = boundingGeometryMapStyle(isEnabled);

buildInspectorStyle(baseStyle, overlayStyle, {
mapboxToken: mapboxAccessToken,
Expand Down
31 changes: 29 additions & 2 deletions pages/dev/me/+Page.client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
import h from "@macrostrat/hyper";
import { DocumentationPage } from "~/layouts";
import { AuthStatus } from "@macrostrat/auth-components";
import { AuthStatus, useAuth } from "@macrostrat/auth-components";
import { usePostgresQuery } from "#/integrations/xdd/extractions/lib/data-service";

export function Page() {
return h(DocumentationPage, { title: "Login" }, [h(AuthStatus)]);
return h(DocumentationPage, { title: "Login" }, [
h(UserIdentity),
h(UserIdentityPostgrest),
h(AuthStatus),
]);
}

function UserIdentity() {
const { user } = useAuth();

return h("div", [
h("h3", "User Identity"),
h("pre", JSON.stringify(user, null, 2)),
]);
}

function UserIdentityPostgrest() {
const res = usePostgresQuery("rpc/auth_status");

if (res == null) {
return h("div", "No Postgrest auth status");
}

return h("div", [
h("h3", "User identity (PostgREST)"),
h("pre", JSON.stringify(res?.token, null, 2)),
]);
}
4 changes: 3 additions & 1 deletion pages/integrations/xdd/feedback/+Page.client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { FullscreenPage } from "~/layouts";
import h from "./main.module.sass";
import { PageBreadcrumbs } from "~/components";
import { PostgRESTTableView } from "~/components/legend-table";
import { PostgRESTTableView } from "@macrostrat/data-sheet2";
import { postgrestPrefix } from "@macrostrat-web/settings";

export function Page() {
return h(FullscreenPage, { className: "main" }, [
h(PageBreadcrumbs),
h("h1", "Source text"),
h(PostgRESTTableView, {
endpoint: postgrestPrefix,
table: "kg_source_text",
columns:
"id,map_legend_id,paper_id,last_update,created,n_runs,n_entities,n_matches,n_strat_names",
Expand Down
4 changes: 3 additions & 1 deletion pages/integrations/xdd/runs/+Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { FullscreenPage } from "~/layouts";
import hyper from "@macrostrat/hyper";
import styles from "./main.module.sass";
import { PageBreadcrumbs } from "~/components";
import { PostgRESTTableView } from "~/components/legend-table";
import { PostgRESTTableView } from "@macrostrat/data-sheet2";
import { postgrestPrefix } from "@macrostrat-web/settings";

const h = hyper.styled(styles);

Expand All @@ -11,6 +12,7 @@ export function Page() {
h(PageBreadcrumbs),
h("h1", "Model runs"),
h(PostgRESTTableView, {
endpoint: postgrestPrefix,
table: "kg_model_run",
columns:
"id,timestamp,model_id,version_id,source_text_id,map_legend_id,supersedes,superseded_by",
Expand Down
8 changes: 4 additions & 4 deletions pages/integrations/xdd/types/+Page.client.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { FullscreenPage } from "~/layouts";
import h from "@macrostrat/hyper";
import { PageBreadcrumbs } from "~/components";
import { PostgRESTTableView } from "~/components/legend-table";

import {
PostgRESTTableView,
ColorCell,
//EditableTextArea,
//ColorPicker,
EditableTextArea,
} from "@macrostrat/data-sheet2";
import { asChromaColor } from "@macrostrat/color-utils";
import { AuthStatus } from "@macrostrat/auth-components";
import { postgrestPrefix } from "@macrostrat-web/settings";

const colorField = {
name: "Color",
Expand All @@ -30,6 +29,7 @@ export function Page() {
h(PageBreadcrumbs),
h("div.header", [h("h1", "Entity types"), h("div.spacer"), h(AuthStatus)]),
h(PostgRESTTableView, {
endpoint: postgrestPrefix,
table: "kg_entity_type",
editable: true,
columnOptions: {
Expand Down
5 changes: 5 additions & 0 deletions pages/layout.module.sass
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
right: 0
margin: 1em
z-index: 5000

.fullscreen-page
height: 100vh
overflow: hidden
position: relative
1 change: 1 addition & 0 deletions pages/map/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export default {
},
},
title: "Map",
pageStyle: "fullscreen",
};
6 changes: 2 additions & 4 deletions pages/maps/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import h from "./main.module.scss";
import { AnchorButton, ButtonGroup } from "@blueprintjs/core";
import { AnchorButton } from "@blueprintjs/core";
import { ContentPage } from "~/layouts";
import { PageHeader, DevLinkButton, AssistantLinks } from "~/components";
import { usePageProps } from "~/renderer/usePageProps";
Expand All @@ -20,9 +20,7 @@ export function Page() {
h(PageHeader, { title: "Maps" }),
h(
"ul.maps-list",
sources.map((d) =>
h.if(d.is_mapped)(SourceItem, { source: d, key: d.source_id })
)
sources.map((d) => h(SourceItem, { source: d, key: d.source_id }))
),
]);
}
Expand Down
3 changes: 3 additions & 0 deletions pages/maps/+config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
pageStyle: "content",
};
1 change: 1 addition & 0 deletions pages/maps/+onBeforeRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export async function onBeforeRender(pageContext) {
const res = await postgrest
.from("sources_metadata")
.select("*")
.eq("is_finalized", true)
.order("source_id", { ascending: true });

const pageProps = { sources: res.data };
Expand Down
1 change: 1 addition & 0 deletions pages/maps/@id/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default {
},
},
},
pageStyle: "fullscreen",
};
7 changes: 3 additions & 4 deletions pages/maps/@id/legend/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { HotkeysProvider, Spinner, Tag } from "@blueprintjs/core";
import DataSheet from "@macrostrat/data-sheet2";
import { HotkeysProvider, Spinner } from "@blueprintjs/core";
import { DataSheet, ColorCell } from "@macrostrat/data-sheet2";
import { FullscreenPage } from "~/layouts";
import hyper from "@macrostrat/hyper";
import styles from "./main.module.sass";
import { ColorCell } from "@macrostrat/data-sheet2";
import { PageBreadcrumbs } from "~/components";
import {
LongTextViewer,
IntervalCell,
lithologyRenderer,
ExpandedLithologies,
} from "~/components/legend-table";
} from "~/components/data-table";
import { useLegendData } from "../utils";
import { useData } from "vike-react/useData";

Expand Down
1 change: 0 additions & 1 deletion pages/maps/ingestion/+Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function Page() {

return h(ContentPage, [
h(PageBreadcrumbs),
//h(IngestNavbar, { user }),
h("div.ingestion-title-bar", [
h("h1", ["Map ingestion queue"]),
h("div.spacer"),
Expand Down
1 change: 1 addition & 0 deletions pages/maps/ingestion/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
export default {
// Applies to all pages
ssr: false,
pageStyle: "content",
};
37 changes: 33 additions & 4 deletions pages/maps/ingestion/@id/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import hyper from "@macrostrat/hyper";
import styles from "./main.module.sass";
import { AnchorButton, ButtonGroup } from "@blueprintjs/core";
import { FullscreenPage } from "~/layouts";
import { Header } from "./components";
import { MapInterface } from "./components";
import { usePageProps } from "~/renderer/usePageProps";
import { useState } from "react";
import { Allotment } from "allotment";
import { MapSelectedFeatures } from "./details-panel";
import "allotment/dist/style.css";

const h = hyper.styled(styles);

Expand All @@ -30,12 +33,38 @@ export function Page() {

const basename = `/maps/ingestion/${source_id}`;

return h(FullscreenPage, { className: "page" }, [
const [mapSelectedFeatures, selectFeatures] = useState([]);
const [inspectPosition, setInspectPosition] = useState(null);

const showSelectedFeatures =
mapSelectedFeatures != null && mapSelectedFeatures.length > 0;

return h("div.page", [
h(Header, headerProps),
h("div.ingestion-main-panel", [
h("div.context-panel", [h(EditMenu, { parentRoute: basename })]),
h("div.main-content", [
h(MapInterface, { id: source_id, map: mapBounds, slug: source.slug }),
h(Allotment, { className: "main-panel", defaultSizes: [800, 300] }, [
h("div.map-container", [
h(MapInterface, {
map: mapBounds,
slug: source.slug,
onClickFeatures: selectFeatures,
selectedFeatures: mapSelectedFeatures,
inspectPosition,
setInspectPosition,
}),
]),
h(Allotment.Pane, { visible: showSelectedFeatures }, [
h(MapSelectedFeatures, {
features: mapSelectedFeatures,
onClose() {
selectFeatures([]);
setInspectPosition(null);
},
selectFeatures,
className: "details-panel",
}),
]),
]),
]),
]);
Expand Down
1 change: 1 addition & 0 deletions pages/maps/ingestion/@id/+config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default {
},
},
},
pageStyle: "fullscreen",
};
Loading