Skip to content

Commit

Permalink
Merge branch 'columns-correlation-diagram' into correlation-chart
Browse files Browse the repository at this point in the history
* columns-correlation-diagram:
  Moved correlation diagram to within columns section
  • Loading branch information
davenquinn committed Jul 11, 2024
2 parents cff57c4 + 1d70efb commit fda52a7
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 19 deletions.
9 changes: 8 additions & 1 deletion src/components/page-header.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import hyper from "@macrostrat/hyper";
import { MacrostratIcon } from "./macrostrat-icon";
import { Link } from "./buttons";
import { DevLinkButton, Link } from "./buttons";
import styles from "./icon.module.sass";
import { AnchorButton, ButtonGroup } from "@blueprintjs/core";

const h = hyper.styled(styles);

Expand Down Expand Up @@ -49,3 +50,9 @@ export function Icon(props) {
children,
]);
}

export function AssistantLinks({ children }) {
return h("div.float-right.padding.stick-to-top", [
h(ButtonGroup, { vertical: true, large: true }, [children]),
]);
}
8 changes: 6 additions & 2 deletions src/pages/columns/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import h from "@macrostrat/hyper";
import { ContentPage } from "~/layouts";
import { PageHeader, Link } from "~/components";
import { Tag } from "@blueprintjs/core";
import { PageHeader, Link, AssistantLinks, DevLinkButton } from "~/components";
import { AnchorButton, Tag } from "@blueprintjs/core";
import { usePageProps } from "~/renderer";

export function Page() {
const { columnGroups, title, linkPrefix } = usePageProps();

return h(ContentPage, [
h(AssistantLinks, [
h(AnchorButton, { href: "/projects", minimal: true }, "Projects"),
h(DevLinkButton, { href: "/columns/correlation" }, "Correlation chart"),
]),
h(PageHeader, { title }),
columnGroups.map((d) => h(ColumnGroup, { data: d, key: d.id, linkPrefix })),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
UnitSelectionProvider,
useSelectedUnit,
} from "@macrostrat/column-views";
import { UnitDescription } from "~/pages/correlation/column";
import { UnitDescription } from "~/pages/columns/correlation/column";

export function Page() {
const startup = useCorrelationDiagramStore((state) => state.startup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export default {
},
},
},
title: "Correlation diagram",
title: "Correlation chart",
};
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useColumn,
} from "@macrostrat/column-components";
import { Timescale, TimescaleOrientation } from "@macrostrat/timescale";
import { JSONView, useDarkMode } from "@macrostrat/ui-components";
import { useDarkMode } from "@macrostrat/ui-components";
import classNames from "classnames";
import { useContext, useEffect, useMemo, useRef } from "react";
import { AgeAxis, useSelectedUnit } from "@macrostrat/column-views";
Expand All @@ -25,7 +25,7 @@ import {
LegendPanelHeader,
UnitDetailsPopover,
} from "~/components/unit-details";
import { useCorrelationDiagramStore } from "~/pages/correlation/state";
import { useCorrelationDiagramStore } from "~/pages/columns/correlation/state";

export function MacrostratColumnProvider(props) {
// A column provider specialized the Macrostrat API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UnitLong } from "@macrostrat/api-types";
import { GapBoundPackage, SectionRenderData, AgeComparable } from "./types";

import h from "./main.module.sass";
import { useCorrelationDiagramStore } from "~/pages/correlation/state";
import { useCorrelationDiagramStore } from "~/pages/columns/correlation/state";

export interface ColumnIdentifier {
col_id: number;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 9 additions & 11 deletions src/pages/maps/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import h from "./main.module.scss";
import { AnchorButton, ButtonGroup } from "@blueprintjs/core";
import { ContentPage } from "~/layouts";
import { PageHeader, DevLinkButton } from "~/components";
import { PageHeader, DevLinkButton, AssistantLinks } from "~/components";
import { usePageProps } from "~/renderer";

export function Page() {
const { sources } = usePageProps();

return h(ContentPage, [
h("div.float-right.padding.stick-to-top", [
h(ButtonGroup, { vertical: true, large: true }, [
h(
AnchorButton,
{ icon: "flows", href: "/maps/ingestion" },
"Ingestion system"
),
h(AnchorButton, { icon: "map", href: "/map/sources" }, "Show on map"),
h(DevLinkButton, { href: "/maps/legend" }, "Legend table"),
]),
h(AssistantLinks, [
h(
AnchorButton,
{ icon: "flows", href: "/maps/ingestion" },
"Ingestion system"
),
h(AnchorButton, { icon: "map", href: "/map/sources" }, "Show on map"),
h(DevLinkButton, { href: "/maps/legend" }, "Legend table"),
]),
h(PageHeader, { title: "Maps" }),
h(
Expand Down

0 comments on commit fda52a7

Please sign in to comment.