-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial tabular view mode and additional state to manage viewport tra…
- Loading branch information
1 parent
f5a08b2
commit 0c551c8
Showing
7 changed files
with
255 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {Box, Paper} from "@mui/material"; | ||
import useStore from "./model/store.ts"; | ||
import {MaterialReactTable, type MRT_ColumnDef, useMaterialReactTable} from "material-react-table"; | ||
import {useMemo} from "react"; | ||
import {Node} from "@xyflow/react"; | ||
|
||
const data: Node[] = []; | ||
|
||
const TabularView = () => { | ||
const overview = useStore((state) => state.overview); | ||
|
||
const columns = useMemo<MRT_ColumnDef<Node>[]>( | ||
() => [ | ||
{ | ||
accessorKey: 'data.label', | ||
header: 'Label' | ||
}, | ||
{ | ||
accessorKey: 'type', | ||
header: 'Type', | ||
} | ||
], | ||
[], | ||
); | ||
|
||
const table = useMaterialReactTable({ | ||
columns: columns, | ||
data: overview.nodes, | ||
}); | ||
|
||
console.log(overview.nodes); | ||
|
||
return ( | ||
<Box sx={{ width: "100%", mt: 2 }} height={{ xs: 400, sm: 600, md: 800 }}> | ||
<Paper> | ||
<MaterialReactTable table={table} /> | ||
</Paper> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default TabularView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters