-
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
fb9bee4
commit 31b7d09
Showing
12 changed files
with
354 additions
and
222 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
EXAMPLES | ||
<br /> | ||
<ul> | ||
<li><a href="/dzi">Deep Zoom Image</a><br /></li> | ||
<li><a href="/omezarr">OMEZARR</a><br /></li> | ||
<li><a href="/layers">Layers</a><br /></li> | ||
</ul> | ||
<div id="app"></div> | ||
<script | ||
type="module" | ||
src="/src/index.tsx" | ||
></script> | ||
</body> | ||
</html> |
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
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 |
---|---|---|
@@ -1,58 +1,31 @@ | ||
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'; | ||
import { BrowserRouter, Route, Routes } from 'react-router'; | ||
import { Home } from './home'; | ||
import { TwoClientsPOC } from './dzi/double'; | ||
import { OmezarrDemo } from './omezarr/app'; | ||
|
||
export function AppUi(props: { demo: Demo }) { | ||
const { demo } = props; | ||
export function App() { | ||
console.log('app'); | ||
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> | ||
<BrowserRouter> | ||
<Routes> | ||
<Route | ||
index | ||
element={<Home />} | ||
/> | ||
<Route | ||
path="/dzi" | ||
element={<TwoClientsPOC />} | ||
/> | ||
<Route | ||
path="/omezarr" | ||
element={<OmezarrDemo />} | ||
/> | ||
{/* <Route | ||
path="/layers" | ||
element={<LayersDemo />} | ||
/> */} | ||
</Routes> | ||
</BrowserRouter> | ||
); | ||
} | ||
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} />; | ||
} |
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,26 @@ | ||
import React from 'react'; | ||
|
||
export function Home() { | ||
return ( | ||
<> | ||
EXAMPLES | ||
<br /> | ||
<ul> | ||
<li> | ||
<a href="/dzi">Deep Zoom Image</a> | ||
<br /> | ||
</li> | ||
<li> | ||
<a href="/omezarr">OMEZARR</a> | ||
<br /> | ||
</li> | ||
{/* layers is not in the AC to be converted to a react component | ||
maybe we'll convert it at some point though so I'll leave this here | ||
<li> | ||
<a href="/layers">Layers</a> | ||
<br /> | ||
</li> */} | ||
</ul> | ||
</> | ||
); | ||
} |
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,7 @@ | ||
import { createRoot } from 'react-dom/client'; | ||
import { App } from './app'; | ||
import React from 'react'; | ||
|
||
const container = document.getElementById('app'); | ||
const root = createRoot(container!); | ||
root.render(<App />); |
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,70 @@ | ||
import type { ColumnRequest } from '~/common/loaders/scatterplot/scatterbrain-loader'; | ||
import type { AnnotationGridConfig } from '~/data-sources/annotation/annotation-grid'; | ||
import type { ZarrSliceConfig } from '~/data-sources/ome-zarr/planar-slice'; | ||
import type { ZarrSliceGridConfig } from '~/data-sources/ome-zarr/slice-grid'; | ||
import type { ScatterplotGridConfig, ScatterPlotGridSlideConfig } from '~/data-sources/scatterplot/dynamic-grid'; | ||
|
||
const slide32 = 'MQ1B9QBZFIPXQO6PETJ'; | ||
const colorByGene: ColumnRequest = { name: '88', type: 'QUANTITATIVE' }; | ||
const scottpoc = 'https://tissuecyte-ome-zarr-poc.s3.amazonaws.com/40_128_128/1145081396'; | ||
|
||
export const examples: Record<string, any> = { | ||
['reconstructed']: { | ||
colorBy: colorByGene, | ||
type: 'ScatterPlotGridConfig', | ||
url: 'https://bkp-2d-visualizations-stage.s3.amazonaws.com/wmb_ccf_04112024-20240419205547/4STCSZBXHYOI0JUUA3M/ScatterBrain.json', | ||
} as ScatterplotGridConfig, | ||
['oneSlide']: { | ||
colorBy: colorByGene, | ||
slideId: slide32, | ||
type: 'ScatterPlotGridSlideConfig', | ||
url: 'https://bkp-2d-visualizations-stage.s3.amazonaws.com/wmb_ccf_04112024-20240419205547/4STCSZBXHYOI0JUUA3M/ScatterBrain.json', | ||
} as ScatterPlotGridSlideConfig, | ||
['tissueCyte396']: { | ||
type: 'ZarrSliceGridConfig', | ||
gamut: { | ||
R: { index: 0, gamut: { max: 600, min: 0 } }, | ||
G: { index: 1, gamut: { max: 500, min: 0 } }, | ||
B: { index: 2, gamut: { max: 400, min: 0 } }, | ||
}, | ||
plane: 'xy', | ||
slices: 142, | ||
url: scottpoc, | ||
} as ZarrSliceGridConfig, | ||
['tissueCyteSlice']: { | ||
type: 'zarrSliceConfig', | ||
gamut: { | ||
R: { index: 0, gamut: { max: 600, min: 0 } }, | ||
G: { index: 1, gamut: { max: 500, min: 0 } }, | ||
B: { index: 2, gamut: { max: 400, min: 0 } }, | ||
}, | ||
plane: 'xy', | ||
planeParameter: 0.5, | ||
url: scottpoc, | ||
} as ZarrSliceConfig, | ||
['versa1']: { | ||
url: 'https://neuroglancer-vis-prototype.s3.amazonaws.com/VERSA/scratch/0500408166/', | ||
type: 'ZarrSliceGridConfig', | ||
gamut: { | ||
R: { index: 0, gamut: { max: 20, min: 0 } }, | ||
G: { index: 1, gamut: { max: 20, min: 0 } }, | ||
B: { index: 2, gamut: { max: 20, min: 0 } }, | ||
}, | ||
plane: 'xy', | ||
slices: 4, | ||
} as ZarrSliceGridConfig, | ||
['structureAnnotation']: { | ||
type: 'AnnotationGridConfig', | ||
url: 'https://bkp-2d-visualizations-stage.s3.amazonaws.com/wmb_ccf_04112024-20240419205547/4STCSZBXHYOI0JUUA3M/ScatterBrain.json', | ||
levelFeature: '73GVTDXDEGE27M2XJMT', | ||
annotationUrl: | ||
'https://stage-sfs.brain.devlims.org/api/v1/Annotation/4STCSZBXHYOI0JUUA3M/v3/TLOKWCL95RU03D9PETG/', | ||
stroke: { | ||
opacity: 1, | ||
overrideColor: [1, 0, 0, 1] as const, | ||
}, | ||
fill: { | ||
opacity: 0.7, | ||
}, | ||
} as AnnotationGridConfig, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { createRoot } from 'react-dom/client'; | ||
import { AppUi } from './app'; | ||
import { OmezarrDemo } from './app'; | ||
|
||
const uiroot = createRoot(document.getElementById('main')!); | ||
uiroot.render(AppUi()); | ||
uiroot.render(OmezarrDemo()); |
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
Oops, something went wrong.