Skip to content

Commit

Permalink
Merge pull request #149 from i-VRESSE/table-from-ui
Browse files Browse the repository at this point in the history
Use table components from haddock3-ui
  • Loading branch information
sverhoeven authored Sep 17, 2024
2 parents 87d1d6d + 8c221dd commit 7ea762e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 99 deletions.
70 changes: 0 additions & 70 deletions app/caprieval/CaprievalReport.client.css

This file was deleted.

12 changes: 6 additions & 6 deletions app/caprieval/CaprievalReport.client.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
ClusterTable,
StructureTable,
} from "@i-vresse/haddock3-analysis-components";
import "./CaprievalReport.client.css";
import { ClusterTable } from "@i-vresse/haddock3-ui/table/ClusterTable";
import { StructureTable } from "@i-vresse/haddock3-ui/table/StructureTable";

import { ScatterPlots } from "./ScatterPlots";
import { useSearchParams } from "@remix-run/react";
import { BoxPlots } from "./BoxPlots";
import type { CaprievalData } from "./caprieval.server";
import { useTheme } from "remix-themes";

/*
* Component has to be client only due
Expand All @@ -16,11 +14,13 @@ import type { CaprievalData } from "./caprieval.server";

export const CaprievalReport = ({ scatters, boxes, table }: CaprievalData) => {
const [searchParams, setSearchParams] = useSearchParams();
const [theme] = useTheme();
const style = { colorScheme: theme === "dark" ? "dark" : "light" };
const hasOtherCluster =
"clusters" in table &&
table.clusters.some((c) => c["cluster_id"] === "Other");
return (
<div className="caprieval-report flex flex-col gap-4">
<div className="caprieval-report flex flex-col gap-4" style={style}>
{"clusters" in table ? (
<ClusterTable {...table} />
) : (
Expand Down
6 changes: 2 additions & 4 deletions app/caprieval/caprieval.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ import {
CAPRIEVAL_SCATTERPLOT_CHOICES,
CAPRIEVAL_BOXPLOT_CHOICES,
} from "./constants";
import type {
ClusterTable,
StructureTable,
} from "@i-vresse/haddock3-analysis-components";
import type { ClusterTable } from "@i-vresse/haddock3-ui/table/ClusterTable";
import type { StructureTable } from "@i-vresse/haddock3-ui/table/StructureTable";
import { BartenderError } from "~/models/errors";
import { getDataFromHtml, getPlotFromHtml } from "~/lib/html";

Expand Down
21 changes: 4 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"/coverage"
],
"dependencies": {
"@i-vresse/haddock3-analysis-components": "^0.4.4",
"@i-vresse/haddock3-ui": "^0.1.9",
"@i-vresse/haddock3-ui": "^0.2.2",
"@i-vresse/wb-core": "^3.2.1",
"@i-vresse/wb-form": "^2.0.1",
"@radix-ui/react-checkbox": "^1.0.4",
Expand Down

0 comments on commit 7ea762e

Please sign in to comment.