Newer
Older
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
import { SAPIRegion } from "src/atlasComponents/sapi/core"
export const nameSpace = `[state.atlasAppearance]`
type CustomLayerBase = {
id: string
}
export type ColorMapCustomLayer = {
clType: 'customlayer/colormap' | 'baselayer/colormap'
colormap: WeakMap<SAPIRegion, number[]>
} & CustomLayerBase
export type NgLayerCustomLayer = {
clType: 'customlayer/nglayer' | 'baselayer/nglayer'
source: string
visible?: boolean
shader?: string
transform?: number[][]
opacity?: number
segments?: (number|string)[]
// type?: string
// annotation?: string // TODO what is this used for?
} & CustomLayerBase
/**
* custom layer is a catch all term that apply **any** special looks
* to an atlas. it could include:
*
* - different colormap
* - different volume (pmap)
* - different indicies
*
* It is up to the viewer on how to interprete these information.
* each instance **must** contain a clType and an id
* - clType facilitates viewer on how to interprete the custom layer
* - id allows custom layer to be removed, if necessary
*/
export type CustomLayer = ColorMapCustomLayer | NgLayerCustomLayer