forked from AllenInstitute/vis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact-sheet.tsx
More file actions
49 lines (49 loc) · 1.79 KB
/
Copy pathcontact-sheet.tsx
File metadata and controls
49 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Button, InputSlider } from '@czi-sds/components';
import type { Demo } from 'src/layers';
export function ContactSheetUI(props: { demo: Demo }) {
const { demo } = props;
// control the gamut with some sliders
const l = demo.layers[demo.selectedLayer];
if (l && l.type === 'volumeGrid') {
return (
<div>
<label htmlFor="rgb">RGB </label>
<InputSlider
name="rgb"
min={0}
max={1000}
value={[l.data.gamut.R.gamut.min, l.data.gamut.R.gamut.max]}
onChange={(e, value) => {
demo.setGamutChannel('R', value as number[]);
}}
/>
<InputSlider
min={0}
max={1000}
value={[l.data.gamut.G.gamut.min, l.data.gamut.G.gamut.max]}
onChange={(e, value) => {
demo.setGamutChannel('G', value as number[]);
}}
/>
<InputSlider
min={0}
max={1000}
value={[l.data.gamut.B.gamut.min, l.data.gamut.B.gamut.max]}
onChange={(e, value) => {
demo.setGamutChannel('B', value as number[]);
}}
/>
<Button key={'xy'} onClick={() => demo.setPlane('xy')}>
xy
</Button>
<Button key={'yz'} onClick={() => demo.setPlane('yz')}>
yz
</Button>
<Button key={'xz'} onClick={() => demo.setPlane('xz')}>
xz
</Button>
</div>
);
}
return null;
}