-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31b7d09
commit bdd3856
Showing
5 changed files
with
1,297 additions
and
1,658 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import { SliceViewLayer } from '../ui/slice-ui'; | ||
import type { Demo } from '../layers'; | ||
import { AnnotationGrid } from '../ui/annotation-grid'; | ||
import { ContactSheetUI } from '../ui/contact-sheet'; | ||
import { ScatterplotUI } from '../ui/scatterplot-ui'; | ||
import { Button } from '@czi-sds/components'; | ||
|
||
export function AppUi(props: { demo: Demo }) { | ||
const { demo } = props; | ||
return ( | ||
<div> | ||
<Button | ||
onClick={() => { | ||
demo.requestSnapshot(3000); | ||
}} | ||
> | ||
{'📷'} | ||
</Button> | ||
<label>{`Layer ${demo.selectedLayer}`}</label> | ||
<Button | ||
onClick={() => { | ||
demo.selectLayer(demo.selectedLayer - 1); | ||
}} | ||
> | ||
{'<-'} | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
demo.selectLayer(demo.selectedLayer + 1); | ||
}} | ||
> | ||
{'->'} | ||
</Button> | ||
<LayerUi demo={demo} /> | ||
</div> | ||
); | ||
} | ||
function LayerUi(props: { demo: Demo }) { | ||
const { demo } = props; | ||
const layer = demo.layers[demo.selectedLayer]; | ||
if (layer) { | ||
switch (layer.type) { | ||
case 'annotationGrid': | ||
return <AnnotationGrid demo={demo} />; | ||
case 'volumeGrid': | ||
return <ContactSheetUI demo={demo} />; | ||
case 'volumeSlice': | ||
return <SliceViewLayer demo={demo} />; | ||
case 'scatterplot': | ||
case 'scatterplotGrid': | ||
return <ScatterplotUI demo={demo} />; | ||
default: | ||
return null; | ||
} | ||
} | ||
return <SliceViewLayer demo={props.demo} />; | ||
} |
Oops, something went wrong.