Skip to content

Commit

Permalink
Feat(cpgweb: search widget): Add csv file viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
leoank committed Jun 3, 2024
1 parent 382f0da commit c09dd37
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 116 deletions.
127 changes: 127 additions & 0 deletions cpgweb/package-lock.json

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

3 changes: 3 additions & 0 deletions cpgweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
"bootstrap": "^5.3.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"d3-dsv": "^3.0.1",
"immutable": "5.0.0-beta.5",
"lucide-react": "^0.378.0",
"next": "14.2.0",
"next-themes": "^0.3.0",
"react": "^18",
"react-bootstrap": "^2.10.2",
"react-datasheet-grid": "^4.11.4",
"react-dom": "^18",
"react-wrap-balancer": "^1.1.0",
"style-loader": "^4.0.0",
Expand All @@ -45,6 +47,7 @@
"xterm-addon-webgl": "^0.16.0"
},
"devDependencies": {
"@types/d3-dsv": "^3.0.7",
"@types/fontfaceobserver": "^2.1.3",
"@types/node": "^20",
"@types/react": "^18",
Expand Down
1 change: 1 addition & 0 deletions cpgweb/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"use client";
import Link from "next/link";
import { Inter as FontSans } from "next/font/google";
import 'react-datasheet-grid/dist/style.css';
import "../styles/globals.css";
import { cn } from "@/src/lib/utils";
import { ThemeProvider } from "@/src/components/theme-provider";
Expand Down
81 changes: 2 additions & 79 deletions cpgweb/src/app/search/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,7 @@ import { Button } from "../../components/ui/button";
import { Download, Eye, Loader2 } from "lucide-react";
import { get_key_file } from "../../lib/cpg_ops";
import React from "react";
import { FileViewer } from "./file-viewer"

// export const columns: ColumnDef<THit>[] = [
// {
// accessorKey: "objectID",
// header: "Object ID",
// cell: ({ row }) => <div>{row.getValue("objectID")}</div>,
// },
// {
// accessorKey: "project_id",
// header: "Project ID",
// cell: ({ row }) => <div>{row.getValue("project_id")}</div>,
// },
// {
// accessorKey: "Col",
// header: "Col",
// cell: ({ row }) => <div>{row.getValue("Col")}</div>,
// },
// {
// accessorKey: "Assay_Plate_Barcode",
// header: "Assay Plate Barcode",
// cell: ({ row }) => <div>{row.getValue("Assay_Plate_Barcode")}</div>,
// },
// {
// accessorKey: "Name",
// header: "Name",
// cell: ({ row }) => <div>{row.getValue("Name")}</div>,
// },
// {
// accessorKey: "PlateName",
// header: "PlateName",
// cell: ({ row }) => <div>{row.getValue("PlateName")}</div>,
// },
// {
// accessorKey: "Plate_Map_Name",
// header: "Plate Map Name",
// cell: ({ row }) => <div>{row.getValue("Plate_Map_Name")}</div>,
// },
// {
// accessorKey: "PublicID",
// header: "Public ID",
// cell: ({ row }) => <div>{row.getValue("PublicID")}</div>,
// },
// {
// accessorKey: "Row",
// header: "Row",
// cell: ({ row }) => <div>{row.getValue("Row")}</div>,
// },
// {
// accessorKey: "key",
// header: "Key",
// cell: ({ row }) => <div>{row.getValue("key")}</div>,
// },
// {
// accessorKey: "_highlightResult",
// header: "Hightlight Result",
// cell: ({ row }) => {
// const value: any = row.getValue("_highlightResult");

// const keys = Object.keys(value).filter(
// (key) => key !== "objectID" && key !== "project_id"
// );

// return (
// <div>
// {keys.map((key) => {
// return (
// <div key={key} className="flex">
// <div className="text-red-400 w-36">{key}</div>
// <div>{value[key].value}</div>
// </div>
// );
// })}
// </div>
// );
// },
// },
// ];
import { FileViewer } from "./file-viewer";

export const columns: ColumnDef<THit>[] = [
{
Expand Down Expand Up @@ -153,7 +76,7 @@ function ProjectKeyActions(props: TProjectKeyActions) {
setIsDownloadLoading(false);
return;
}
downloadData(data);
downloadData(data as Uint8Array);
}}
>
{isDownloadLoading && (
Expand Down
Loading

0 comments on commit c09dd37

Please sign in to comment.