From 28ee32b095def7a1a1190c01b60cd42b3a3b0573 Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Tue, 2 Apr 2024 10:22:29 -0400 Subject: [PATCH 01/12] Update names --- __tests__/main.test.tsx | 2 +- index.html | 2 +- src/components/{app.tsx => App.tsx} | 8 ++++---- src/components/{main.tsx => Main.tsx} | 2 +- .../{playbackControls.tsx => PlaybackControls.tsx} | 0 src/components/{scene.tsx => Scene.tsx} | 0 src/components/{dataControls.tsx => TrackControls.tsx} | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) rename src/components/{app.tsx => App.tsx} (97%) rename src/components/{main.tsx => Main.tsx} (94%) rename src/components/{playbackControls.tsx => PlaybackControls.tsx} (100%) rename src/components/{scene.tsx => Scene.tsx} (100%) rename src/components/{dataControls.tsx => TrackControls.tsx} (96%) diff --git a/__tests__/main.test.tsx b/__tests__/main.test.tsx index d128ef50..72a5bba7 100644 --- a/__tests__/main.test.tsx +++ b/__tests__/main.test.tsx @@ -1,7 +1,7 @@ import { expect, test } from "vitest"; import { PointCanvas } from "../src/lib/PointCanvas.ts"; -import Scene from "../src/components/scene"; +import Scene from "../src/components/Scene"; import React from "react"; import { render } from "@testing-library/react"; diff --git a/index.html b/index.html index 9f2a2f58..7b6e6575 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,6 @@
- + diff --git a/src/components/app.tsx b/src/components/App.tsx similarity index 97% rename from src/components/app.tsx rename to src/components/App.tsx index ac5e5a8d..4574bbcc 100644 --- a/src/components/app.tsx +++ b/src/components/App.tsx @@ -3,9 +3,9 @@ import "@/css/app.css"; import { Box } from "@mui/material"; -import Scene from "@/components/scene.tsx"; -import DataControls from "@/components/dataControls.tsx"; -import PlaybackControls from "@/components/playbackControls.tsx"; +import Scene from "@/components/Scene.tsx"; +import TrackControls from "@/components/TrackControls.tsx"; +import PlaybackControls from "@/components/PlaybackControls.tsx"; import useSelectionBox from "@/hooks/useSelectionBox"; @@ -191,7 +191,7 @@ export default function App() { return ( - void; } -export default function DataControls(props: DataControlsProps) { +export default function TrackControls(props: TrackControlsProps) { const numTimes = props.trackManager?.points.shape[0] ?? 0; const trackLengthPct = numTimes ? (props.trackHighlightLength / 2 / numTimes) * 100 : 0; From ea0a1a2fa210bc14b9deb137f7566124159db246 Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Tue, 2 Apr 2024 12:22:28 -0400 Subject: [PATCH 02/12] Icon changes, add DataControls for info, copy URL, and set data URL --- src/components/App.tsx | 110 ++++++++++++++++++++-------- src/components/DataControls.tsx | 31 ++++++++ src/components/PlaybackControls.tsx | 44 ++++++----- src/components/TrackControls.tsx | 10 +-- src/lib/PointCanvas.ts | 4 + 5 files changed, 140 insertions(+), 59 deletions(-) create mode 100644 src/components/DataControls.tsx diff --git a/src/components/App.tsx b/src/components/App.tsx index 4574bbcc..5f84e3fa 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,11 +1,12 @@ import { useState, useEffect } from "react"; import "@/css/app.css"; -import { Box } from "@mui/material"; +import { Box, Divider, Drawer } from "@mui/material"; -import Scene from "@/components/Scene.tsx"; -import TrackControls from "@/components/TrackControls.tsx"; -import PlaybackControls from "@/components/PlaybackControls.tsx"; +import Scene from "@/components/Scene"; +import DataControls from "@/components/DataControls"; +import TrackControls from "@/components/TrackControls"; +import PlaybackControls from "@/components/PlaybackControls"; import useSelectionBox from "@/hooks/useSelectionBox"; @@ -18,6 +19,8 @@ const initialViewerState = ViewerState.fromUrlHash(window.location.hash); console.log("initial viewer state: %s", JSON.stringify(initialViewerState)); clearUrlHash(); +const drawerWidth = 300; + export default function App() { // Use references here for two things: // * manage objects that should never change, even when the component re-renders @@ -190,33 +193,78 @@ export default function App() { }, [numTimes, curTime, playing]); return ( - - canvas?.removeAllTracks()} - /> - - + + {/* TODO: components *could* go deeper still for organization */} + + + + canvas?.removeAllTracks()} + /> + + + + + + + + + + + + + ); } diff --git a/src/components/DataControls.tsx b/src/components/DataControls.tsx new file mode 100644 index 00000000..320fbdda --- /dev/null +++ b/src/components/DataControls.tsx @@ -0,0 +1,31 @@ +import { TrackManager } from "@/lib/TrackManager"; +import { ButtonIcon } from "@czi-sds/components"; +import { Box } from "@mui/material"; + +interface DataControlsProps { + dataUrl: string; + initialDataUrl: string; + setDataUrl: (dataUrl: string) => void; + copyShareableUrlToClipboard: () => void; + trackManager: TrackManager | null; // TODO: remove this? +} + +export default function DataControls(props: DataControlsProps) { + return ( + + {/* TODO: make this do something */} + + + + + {/* TODO: make this do something */} + + + ); +} diff --git a/src/components/PlaybackControls.tsx b/src/components/PlaybackControls.tsx index 88703be4..c0cb33aa 100644 --- a/src/components/PlaybackControls.tsx +++ b/src/components/PlaybackControls.tsx @@ -1,6 +1,5 @@ -import { Stack } from "@mui/material"; - -import { InputSlider, InputToggle } from "@czi-sds/components"; +import { Box } from "@mui/material"; +import { ButtonIcon, InputSlider } from "@czi-sds/components"; interface PlaybackControlsProps { enabled: boolean; @@ -15,22 +14,14 @@ interface PlaybackControlsProps { export default function PlaybackControls(props: PlaybackControlsProps) { return ( - - - { - props.setAutoRotate((e.target as HTMLInputElement).checked); - }} - /> - - + { - props.setPlaying((e.target as HTMLInputElement).checked); - }} + onClick={() => props.setPlaying(!props.playing)} /> props.setCurTime(value as number)} value={props.curTime} /> - + props.setAutoRotate(!props.autoRotate)} + /> + ); } +// { +// props.setAutoRotate((e.target as HTMLInputElement).checked); +// }} +// /> diff --git a/src/components/TrackControls.tsx b/src/components/TrackControls.tsx index 1dd16c39..ca9a8b75 100644 --- a/src/components/TrackControls.tsx +++ b/src/components/TrackControls.tsx @@ -1,5 +1,5 @@ import { TrackManager } from "@/lib/TrackManager"; -import { Button, ButtonIcon, InputSlider, InputText } from "@czi-sds/components"; +import { Button, InputSlider, InputText } from "@czi-sds/components"; import { Stack } from "@mui/material"; interface TrackControlsProps { @@ -17,7 +17,6 @@ export default function TrackControls(props: TrackControlsProps) { const numTimes = props.trackManager?.points.shape[0] ?? 0; const trackLengthPct = numTimes ? (props.trackHighlightLength / 2 / numTimes) * 100 : 0; - console.log("trackLengthPct: %s", props.trackManager?.maxPointsPerTimepoint); return ( Clear Tracks - ); diff --git a/src/lib/PointCanvas.ts b/src/lib/PointCanvas.ts index e75554fe..1d8f1adf 100644 --- a/src/lib/PointCanvas.ts +++ b/src/lib/PointCanvas.ts @@ -82,6 +82,10 @@ export class PointCanvas { // Set up controls this.controls = new OrbitControls(this.camera, this.renderer.domElement); this.controls.autoRotateSpeed = 1; + + const cameraPosition: Vector3 = new Vector3(500, 500, -1250); + const cameraTarget: Vector3 = new Vector3(500, 500, 250); + this.setCameraProperties(cameraPosition, cameraTarget); } // Use an arrow function so that each instance of the class is bound and From 1af901beb055e5a92aab390d1f313afdfe03dd91 Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Tue, 2 Apr 2024 12:52:49 -0400 Subject: [PATCH 03/12] Add Zebrahub logo --- public/zebrahub-favicon-60x60.png | Bin 0 -> 8619 bytes src/components/App.tsx | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 public/zebrahub-favicon-60x60.png diff --git a/public/zebrahub-favicon-60x60.png b/public/zebrahub-favicon-60x60.png new file mode 100644 index 0000000000000000000000000000000000000000..693cdc2d47efec9ea279e65ce813330fa4aacef9 GIT binary patch literal 8619 zcmV;cAynRpP)0bs zF~%Tc(~IdH(IlDxfheL^2}JL`8`F#FE`V)Zu(7Ge#+Y6NDo=XvecwI%-}`<%;*?1| zlVr5kgQr)&bI(5e?0xQ4TH62cr#yxJg+p$jU&|N@1{-qPI#m6B z1=^(>M)WjH8(~;B3)r#V%FcX(4~lPCKHvYti|3-xKX(SVb8#zGl;gJ4cO;YW*YS7# z(dwpx)h!IIQr-KU4|K-{|JZkUq1hjwu(SJi8KyFjer*kHtHbX5`i1a;f4UqreGI`f zcgI|{|BAW#4?V^7tK9dHePWqN?OZbPb<2%hQAKc?1?z|I6BrU!^7XY zhH5{ETcZa{+uX1o7R;VtV7cJc9fl)^?0R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=>{WMith%ewnp@ zCa`V|0-HKAke##f{k02_B4 zurKRX=+GXp&SPmXaQ3vF=jV^mX!zP?7yU)cX`fa9{Up;{dtiT;Khl!hNUd;r%qsP7 zAGI&KBCYgSc)!+1M{V(e-8ie!twucAEkZwS6rp7{j$v@uV&6Y?n0#m!1xAMRn`9dC z?%!i)&z-To<>jU`lC4u?8Ql)QWtB-xm0all@)_vAb>JT#M_SP({mC44>UsTn&+m@i z(>*Epf7TwjP6Mz5!002ovPDHLkV1lpR>p%bi literal 0 HcmV?d00001 diff --git a/src/components/App.tsx b/src/components/App.tsx index 5f84e3fa..a8097ef6 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -19,7 +19,7 @@ const initialViewerState = ViewerState.fromUrlHash(window.location.hash); console.log("initial viewer state: %s", JSON.stringify(initialViewerState)); clearUrlHash(); -const drawerWidth = 300; +const drawerWidth = 256; export default function App() { // Use references here for two things: @@ -213,6 +213,20 @@ export default function App() { height: "100%", }} > + + logo + +

ZEBRAHUB

+
Date: Tue, 2 Apr 2024 13:20:14 -0400 Subject: [PATCH 04/12] Remove commented code. Tweak appearance. --- src/components/PlaybackControls.tsx | 8 +------- src/components/TrackControls.tsx | 5 ++++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/PlaybackControls.tsx b/src/components/PlaybackControls.tsx index c0cb33aa..46dc7440 100644 --- a/src/components/PlaybackControls.tsx +++ b/src/components/PlaybackControls.tsx @@ -33,6 +33,7 @@ export default function PlaybackControls(props: PlaybackControlsProps) { onChange={(_, value) => props.setCurTime(value as number)} value={props.curTime} /> + {/* TODO: add control button groups - perhaps a separate component */} ); } -// { -// props.setAutoRotate((e.target as HTMLInputElement).checked); -// }} -// /> diff --git a/src/components/TrackControls.tsx b/src/components/TrackControls.tsx index ca9a8b75..059a216c 100644 --- a/src/components/TrackControls.tsx +++ b/src/components/TrackControls.tsx @@ -28,7 +28,10 @@ export default function TrackControls(props: TrackControlsProps) { fullWidth={true} intent={props.trackManager ? "default" : "error"} /> - + + Date: Tue, 2 Apr 2024 20:16:18 -0400 Subject: [PATCH 05/12] Match toolbar sizes --- src/components/DataControls.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/DataControls.tsx b/src/components/DataControls.tsx index 320fbdda..2cd7fc70 100644 --- a/src/components/DataControls.tsx +++ b/src/components/DataControls.tsx @@ -12,7 +12,16 @@ interface DataControlsProps { export default function DataControls(props: DataControlsProps) { return ( - + {/* TODO: make this do something */} From 722f18673b4350ba429ba113397ab1e419235f42 Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Tue, 2 Apr 2024 20:22:08 -0400 Subject: [PATCH 06/12] Fix SDS deprecation warning --- src/components/TrackControls.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TrackControls.tsx b/src/components/TrackControls.tsx index 059a216c..6550855f 100644 --- a/src/components/TrackControls.tsx +++ b/src/components/TrackControls.tsx @@ -48,7 +48,7 @@ export default function TrackControls(props: TrackControlsProps) { value={Math.round(trackLengthPct)} /> - From 89860522efd89687850b86d4231ff03ecd183abc Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Wed, 3 Apr 2024 14:52:25 -0400 Subject: [PATCH 07/12] Partially functioning popover for Zarr URL input --- src/components/App.tsx | 4 -- src/components/DataControls.tsx | 69 ++++++++++++++++++++++++++++++-- src/components/TrackControls.tsx | 16 +------- 3 files changed, 67 insertions(+), 22 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index a8097ef6..6cb8e475 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -229,13 +229,9 @@ export default function App() { canvas?.removeAllTracks()} /> diff --git a/src/components/DataControls.tsx b/src/components/DataControls.tsx index 2cd7fc70..7517cb13 100644 --- a/src/components/DataControls.tsx +++ b/src/components/DataControls.tsx @@ -1,6 +1,12 @@ +import { useState } from "react"; + +import { Box, Popover, Stack, Typography } from "@mui/material"; +import { styled } from "@mui/material/styles"; +import { fontBodyXs } from "czifui"; + +import { Button, ButtonIcon, InputText } from "@czi-sds/components"; + import { TrackManager } from "@/lib/TrackManager"; -import { ButtonIcon } from "@czi-sds/components"; -import { Box } from "@mui/material"; interface DataControlsProps { dataUrl: string; @@ -11,6 +17,16 @@ interface DataControlsProps { } export default function DataControls(props: DataControlsProps) { + const [anchorEl, setAnchorEl] = useState(null); + + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; + return ( {/* TODO: make this do something */} - + + + label": { fontSize: "0.83em", fontWeight: "bold" }, + }} + > + props.setDataUrl(e.target.value)} + fullWidth={true} + intent={props.trackManager ? "default" : "error"} + /> + + Note: Changing this URL will replace the image and reset the canvas. + + + + + + + ); } + +const Note = styled(Typography)` + ${fontBodyXs} +`; diff --git a/src/components/TrackControls.tsx b/src/components/TrackControls.tsx index 6550855f..72af94fb 100644 --- a/src/components/TrackControls.tsx +++ b/src/components/TrackControls.tsx @@ -1,15 +1,11 @@ import { TrackManager } from "@/lib/TrackManager"; -import { Button, InputSlider, InputText } from "@czi-sds/components"; +import { Button, InputSlider } from "@czi-sds/components"; import { Stack } from "@mui/material"; interface TrackControlsProps { - dataUrl: string; - initialDataUrl: string; trackManager: TrackManager | null; trackHighlightLength: number; - setDataUrl: (dataUrl: string) => void; setTrackHighlightLength: (trackHighlightLength: number) => void; - copyShareableUrlToClipboard: () => void; clearTracks: () => void; } @@ -19,16 +15,6 @@ export default function TrackControls(props: TrackControlsProps) { return ( - props.setDataUrl(e.target.value)} - fullWidth={true} - intent={props.trackManager ? "default" : "error"} - /> - From 0e9e6b04a4cad58a69d4cfb81c07832131508576 Mon Sep 17 00:00:00 2001 From: Ashley Anderson Date: Wed, 3 Apr 2024 15:35:02 -0400 Subject: [PATCH 08/12] Add snackbar when copying URL --- src/components/DataControls.tsx | 62 +++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/src/components/DataControls.tsx b/src/components/DataControls.tsx index 7517cb13..e73abf56 100644 --- a/src/components/DataControls.tsx +++ b/src/components/DataControls.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; -import { Box, Popover, Stack, Typography } from "@mui/material"; +import { Alert, Box, Popover, Snackbar, Stack, Typography } from "@mui/material"; import { styled } from "@mui/material/styles"; import { fontBodyXs } from "czifui"; @@ -17,14 +17,24 @@ interface DataControlsProps { } export default function DataControls(props: DataControlsProps) { - const [anchorEl, setAnchorEl] = useState(null); + const [copyUrlSnackBarOpen, setCopyUrlSnackBarOpen] = useState(false); + const [urlPopoverAnchor, setUrlPopoverAnchor] = useState(null); - const handleClick = (event: React.MouseEvent) => { - setAnchorEl(event.currentTarget); + const copyShareableUrlToClipBoard = () => { + props.copyShareableUrlToClipboard(); + setCopyUrlSnackBarOpen(true); }; - const handleClose = () => { - setAnchorEl(null); + const handleShareableUrlSnackBarClose = () => { + setCopyUrlSnackBarOpen(false); + }; + + const showUrlPopover = (event: React.MouseEvent) => { + setUrlPopoverAnchor(event.currentTarget); + }; + + const handleUrlPopoverClose = () => { + setUrlPopoverAnchor(null); }; return ( @@ -39,22 +49,46 @@ export default function DataControls(props: DataControlsProps) { }} > {/* TODO: make this do something */} - + { + window.alert("Not implemented :)"); + }} + /> + + + Shareable URL copied to clipboard! + + - {/* TODO: make this do something */} - + Note: Changing this URL will replace the image and reset the canvas. - - +
+ + + + + Note: Changing this URL will replace the image and reset the canvas. + + + + + - +
);