Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
34e87121
Commit
34e87121
authored
3 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
Make Confal pyramids colors changeable
parent
749e0c5a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/extensions/dnatco/confal-pyramids/color.ts
+226
-132
226 additions, 132 deletions
src/extensions/dnatco/confal-pyramids/color.ts
with
226 additions
and
132 deletions
src/extensions/dnatco/confal-pyramids/color.ts
+
226
−
132
View file @
34e87121
...
@@ -11,149 +11,248 @@ import { Location } from '../../../mol-model/location';
...
@@ -11,149 +11,248 @@ import { Location } from '../../../mol-model/location';
import
{
CustomProperty
}
from
'
../../../mol-model-props/common/custom-property
'
;
import
{
CustomProperty
}
from
'
../../../mol-model-props/common/custom-property
'
;
import
{
ColorTheme
}
from
'
../../../mol-theme/color
'
;
import
{
ColorTheme
}
from
'
../../../mol-theme/color
'
;
import
{
ThemeDataContext
}
from
'
../../../mol-theme/theme
'
;
import
{
ThemeDataContext
}
from
'
../../../mol-theme/theme
'
;
import
{
Color
}
from
'
../../../mol-util/color
'
;
import
{
Color
,
ColorMap
}
from
'
../../../mol-util/color
'
;
import
{
getColorMapParams
}
from
'
../../../mol-util/color/params
'
;
import
{
ParamDefinition
as
PD
}
from
'
../../../mol-util/param-definition
'
;
import
{
ParamDefinition
as
PD
}
from
'
../../../mol-util/param-definition
'
;
import
{
TableLegend
}
from
'
../../../mol-util/legend
'
;
import
{
TableLegend
}
from
'
../../../mol-util/legend
'
;
import
{
iterableToArray
}
from
'
../../../mol-
data/util
'
;
import
{
ObjectKeys
}
from
'
../../../mol-
util/type-helpers
'
;
const
DefaultColor
=
Color
(
0xCCCCCC
);
const
Description
=
'
Assigns colors to confal pyramids
'
;
const
Description
=
'
Assigns colors to confal pyramids
'
;
const
ErrorColor
=
Color
(
0xFFA10A
);
type
ConformerClasses
=
'
A
'
|
'
B
'
|
'
BII
'
|
'
miB
'
|
'
Z
'
|
'
IC
'
|
'
OPN
'
|
'
SYN
'
|
'
N
'
;
const
ColorMapping
:
ReadonlyMap
<
ConformerClasses
,
Color
>
=
new
Map
([
const
DefaultClassColors
=
{
[
'
A
'
,
Color
(
0xFFC1C1
)],
A
:
0xFFC1C1
,
[
'
B
'
,
Color
(
0xC8CFFF
)],
B
:
0xC8CFFF
,
[
'
BII
'
,
Color
(
0x0059DA
)],
BII
:
0x0059DA
,
[
'
miB
'
,
Color
(
0x3BE8FB
)],
miB
:
0x3BE8FB
,
[
'
Z
'
,
Color
(
0x01F60E
)],
Z
:
0x01F60E
,
[
'
IC
'
,
Color
(
0xFA5CFB
)],
IC
:
0xFA5CFB
,
[
'
OPN
'
,
Color
(
0xE90000
)],
OPN
:
0xE90000
,
[
'
SYN
'
,
Color
(
0xFFFF01
)],
SYN
:
0xFFFF01
,
[
'
N
'
,
Color
(
0xF2F2F2
)],
N
:
0xF2F2F2
,
]);
};
const
ErrorColor
=
Color
(
0xFFA10A
);
const
NtCToClasses
:
ReadonlyMap
<
string
,
[
ConformerClasses
,
ConformerClasses
]
>
=
new
Map
([
const
PyramidsColors
=
ColorMap
({
[
'
NANT
'
,
[
'
N
'
,
'
N
'
]],
NANT_Upr
:
DefaultClassColors
.
N
,
[
'
AA00
'
,
[
'
A
'
,
'
A
'
]],
NANT_Lwr
:
DefaultClassColors
.
N
,
[
'
AA02
'
,
[
'
A
'
,
'
A
'
]],
AA00_Upr
:
DefaultClassColors
.
A
,
[
'
AA03
'
,
[
'
A
'
,
'
A
'
]],
AA00_Lwr
:
DefaultClassColors
.
A
,
[
'
AA04
'
,
[
'
A
'
,
'
A
'
]],
AA02_Upr
:
DefaultClassColors
.
A
,
[
'
AA08
'
,
[
'
A
'
,
'
A
'
]],
AA02_Lwr
:
DefaultClassColors
.
A
,
[
'
AA09
'
,
[
'
A
'
,
'
A
'
]],
AA03_Upr
:
DefaultClassColors
.
A
,
[
'
AA01
'
,
[
'
A
'
,
'
A
'
]],
AA03_Lwr
:
DefaultClassColors
.
A
,
[
'
AA05
'
,
[
'
A
'
,
'
A
'
]],
AA04_Upr
:
DefaultClassColors
.
A
,
[
'
AA06
'
,
[
'
A
'
,
'
A
'
]],
AA04_Lwr
:
DefaultClassColors
.
A
,
[
'
AA10
'
,
[
'
A
'
,
'
A
'
]],
AA08_Upr
:
DefaultClassColors
.
A
,
[
'
AA11
'
,
[
'
A
'
,
'
A
'
]],
AA08_Lwr
:
DefaultClassColors
.
A
,
[
'
AA07
'
,
[
'
A
'
,
'
A
'
]],
AA09_Upr
:
DefaultClassColors
.
A
,
[
'
AA12
'
,
[
'
A
'
,
'
A
'
]],
AA09_Lwr
:
DefaultClassColors
.
A
,
[
'
AA13
'
,
[
'
A
'
,
'
A
'
]],
AA01_Upr
:
DefaultClassColors
.
A
,
[
'
AB01
'
,
[
'
A
'
,
'
B
'
]],
AA01_Lwr
:
DefaultClassColors
.
A
,
[
'
AB02
'
,
[
'
A
'
,
'
B
'
]],
AA05_Upr
:
DefaultClassColors
.
A
,
[
'
AB03
'
,
[
'
A
'
,
'
B
'
]],
AA05_Lwr
:
DefaultClassColors
.
A
,
[
'
AB04
'
,
[
'
A
'
,
'
B
'
]],
AA06_Upr
:
DefaultClassColors
.
A
,
[
'
AB05
'
,
[
'
A
'
,
'
B
'
]],
AA06_Lwr
:
DefaultClassColors
.
A
,
[
'
BA01
'
,
[
'
B
'
,
'
A
'
]],
AA10_Upr
:
DefaultClassColors
.
A
,
[
'
BA05
'
,
[
'
B
'
,
'
A
'
]],
AA10_Lwr
:
DefaultClassColors
.
A
,
[
'
BA09
'
,
[
'
B
'
,
'
A
'
]],
AA11_Upr
:
DefaultClassColors
.
A
,
[
'
BA08
'
,
[
'
BII
'
,
'
A
'
]],
AA11_Lwr
:
DefaultClassColors
.
A
,
[
'
BA10
'
,
[
'
B
'
,
'
A
'
]],
AA07_Upr
:
DefaultClassColors
.
A
,
[
'
BA13
'
,
[
'
BII
'
,
'
A
'
]],
AA07_Lwr
:
DefaultClassColors
.
A
,
[
'
BA16
'
,
[
'
BII
'
,
'
A
'
]],
AA12_Upr
:
DefaultClassColors
.
A
,
[
'
BA17
'
,
[
'
BII
'
,
'
A
'
]],
AA12_Lwr
:
DefaultClassColors
.
A
,
[
'
BB00
'
,
[
'
B
'
,
'
B
'
]],
AA13_Upr
:
DefaultClassColors
.
A
,
[
'
BB01
'
,
[
'
B
'
,
'
B
'
]],
AA13_Lwr
:
DefaultClassColors
.
A
,
[
'
BB17
'
,
[
'
B
'
,
'
B
'
]],
AB01_Upr
:
DefaultClassColors
.
A
,
[
'
BB02
'
,
[
'
B
'
,
'
B
'
]],
AB01_Lwr
:
DefaultClassColors
.
B
,
[
'
BB03
'
,
[
'
B
'
,
'
B
'
]],
AB02_Upr
:
DefaultClassColors
.
A
,
[
'
BB11
'
,
[
'
B
'
,
'
B
'
]],
AB02_Lwr
:
DefaultClassColors
.
B
,
[
'
BB16
'
,
[
'
B
'
,
'
B
'
]],
AB03_Upr
:
DefaultClassColors
.
A
,
[
'
BB04
'
,
[
'
B
'
,
'
BII
'
]],
AB03_Lwr
:
DefaultClassColors
.
B
,
[
'
BB05
'
,
[
'
B
'
,
'
BII
'
]],
AB04_Upr
:
DefaultClassColors
.
A
,
[
'
BB07
'
,
[
'
BII
'
,
'
BII
'
]],
AB04_Lwr
:
DefaultClassColors
.
B
,
[
'
BB08
'
,
[
'
BII
'
,
'
BII
'
]],
AB05_Upr
:
DefaultClassColors
.
A
,
[
'
BB10
'
,
[
'
miB
'
,
'
miB
'
]],
AB05_Lwr
:
DefaultClassColors
.
B
,
[
'
BB12
'
,
[
'
miB
'
,
'
miB
'
]],
BA01_Upr
:
DefaultClassColors
.
B
,
[
'
BB13
'
,
[
'
miB
'
,
'
miB
'
]],
BA01_Lwr
:
DefaultClassColors
.
A
,
[
'
BB14
'
,
[
'
miB
'
,
'
miB
'
]],
BA05_Upr
:
DefaultClassColors
.
B
,
[
'
BB15
'
,
[
'
miB
'
,
'
miB
'
]],
BA05_Lwr
:
DefaultClassColors
.
A
,
[
'
BB20
'
,
[
'
miB
'
,
'
miB
'
]],
BA09_Upr
:
DefaultClassColors
.
B
,
[
'
IC01
'
,
[
'
IC
'
,
'
IC
'
]],
BA09_Lwr
:
DefaultClassColors
.
A
,
[
'
IC02
'
,
[
'
IC
'
,
'
IC
'
]],
BA08_Upr
:
DefaultClassColors
.
BII
,
[
'
IC03
'
,
[
'
IC
'
,
'
IC
'
]],
BA08_Lwr
:
DefaultClassColors
.
A
,
[
'
IC04
'
,
[
'
IC
'
,
'
IC
'
]],
BA10_Upr
:
DefaultClassColors
.
B
,
[
'
IC05
'
,
[
'
IC
'
,
'
IC
'
]],
BA10_Lwr
:
DefaultClassColors
.
A
,
[
'
IC06
'
,
[
'
IC
'
,
'
IC
'
]],
BA13_Upr
:
DefaultClassColors
.
BII
,
[
'
IC07
'
,
[
'
IC
'
,
'
IC
'
]],
BA13_Lwr
:
DefaultClassColors
.
A
,
[
'
OP01
'
,
[
'
OPN
'
,
'
OPN
'
]],
BA16_Upr
:
DefaultClassColors
.
BII
,
[
'
OP02
'
,
[
'
OPN
'
,
'
OPN
'
]],
BA16_Lwr
:
DefaultClassColors
.
A
,
[
'
OP03
'
,
[
'
OPN
'
,
'
OPN
'
]],
BA17_Upr
:
DefaultClassColors
.
BII
,
[
'
OP04
'
,
[
'
OPN
'
,
'
OPN
'
]],
BA17_Lwr
:
DefaultClassColors
.
A
,
[
'
OP05
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB00_Upr
:
DefaultClassColors
.
B
,
[
'
OP06
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB00_Lwr
:
DefaultClassColors
.
B
,
[
'
OP07
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB01_Upr
:
DefaultClassColors
.
B
,
[
'
OP08
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB01_Lwr
:
DefaultClassColors
.
B
,
[
'
OP09
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB17_Upr
:
DefaultClassColors
.
B
,
[
'
OP10
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB17_Lwr
:
DefaultClassColors
.
B
,
[
'
OP11
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB02_Upr
:
DefaultClassColors
.
B
,
[
'
OP12
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB02_Lwr
:
DefaultClassColors
.
B
,
[
'
OP13
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB03_Upr
:
DefaultClassColors
.
B
,
[
'
OP14
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB03_Lwr
:
DefaultClassColors
.
B
,
[
'
OP15
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB11_Upr
:
DefaultClassColors
.
B
,
[
'
OP16
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB11_Lwr
:
DefaultClassColors
.
B
,
[
'
OP17
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB16_Upr
:
DefaultClassColors
.
B
,
[
'
OP18
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB16_Lwr
:
DefaultClassColors
.
B
,
[
'
OP19
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB04_Upr
:
DefaultClassColors
.
B
,
[
'
OP20
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB04_Lwr
:
DefaultClassColors
.
BII
,
[
'
OP21
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB05_Upr
:
DefaultClassColors
.
B
,
[
'
OP22
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB05_Lwr
:
DefaultClassColors
.
BII
,
[
'
OP23
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB07_Upr
:
DefaultClassColors
.
BII
,
[
'
OP24
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB07_Lwr
:
DefaultClassColors
.
BII
,
[
'
OP25
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB08_Upr
:
DefaultClassColors
.
BII
,
[
'
OP26
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB08_Lwr
:
DefaultClassColors
.
BII
,
[
'
OP27
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB10_Upr
:
DefaultClassColors
.
miB
,
[
'
OP28
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB10_Lwr
:
DefaultClassColors
.
miB
,
[
'
OP29
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB12_Upr
:
DefaultClassColors
.
miB
,
[
'
OP30
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB12_Lwr
:
DefaultClassColors
.
miB
,
[
'
OP31
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB13_Upr
:
DefaultClassColors
.
miB
,
[
'
OPS1
'
,
[
'
OPN
'
,
'
OPN
'
]],
BB13_Lwr
:
DefaultClassColors
.
miB
,
[
'
OP1S
'
,
[
'
OPN
'
,
'
SYN
'
]],
BB14_Upr
:
DefaultClassColors
.
miB
,
[
'
AAS1
'
,
[
'
SYN
'
,
'
A
'
]],
BB14_Lwr
:
DefaultClassColors
.
miB
,
[
'
AB1S
'
,
[
'
A
'
,
'
SYN
'
]],
BB15_Upr
:
DefaultClassColors
.
miB
,
[
'
AB2S
'
,
[
'
A
'
,
'
SYN
'
]],
BB15_Lwr
:
DefaultClassColors
.
miB
,
[
'
BB1S
'
,
[
'
B
'
,
'
SYN
'
]],
BB20_Upr
:
DefaultClassColors
.
miB
,
[
'
BB2S
'
,
[
'
B
'
,
'
SYN
'
]],
BB20_Lwr
:
DefaultClassColors
.
miB
,
[
'
BBS1
'
,
[
'
SYN
'
,
'
B
'
]],
IC01_Upr
:
DefaultClassColors
.
IC
,
[
'
ZZ01
'
,
[
'
Z
'
,
'
Z
'
]],
IC01_Lwr
:
DefaultClassColors
.
IC
,
[
'
ZZ02
'
,
[
'
Z
'
,
'
Z
'
]],
IC02_Upr
:
DefaultClassColors
.
IC
,
[
'
ZZ1S
'
,
[
'
Z
'
,
'
SYN
'
]],
IC02_Lwr
:
DefaultClassColors
.
IC
,
[
'
ZZ2S
'
,
[
'
Z
'
,
'
SYN
'
]],
IC03_Upr
:
DefaultClassColors
.
IC
,
[
'
ZZS1
'
,
[
'
SYN
'
,
'
Z
'
]],
IC03_Lwr
:
DefaultClassColors
.
IC
,
[
'
ZZS2
'
,
[
'
SYN
'
,
'
Z
'
]],
IC04_Upr
:
DefaultClassColors
.
IC
,
]);
IC04_Lwr
:
DefaultClassColors
.
IC
,
IC05_Upr
:
DefaultClassColors
.
IC
,
IC05_Lwr
:
DefaultClassColors
.
IC
,
IC06_Upr
:
DefaultClassColors
.
IC
,
IC06_Lwr
:
DefaultClassColors
.
IC
,
IC07_Upr
:
DefaultClassColors
.
IC
,
IC07_Lwr
:
DefaultClassColors
.
IC
,
OP01_Upr
:
DefaultClassColors
.
OPN
,
OP01_Lwr
:
DefaultClassColors
.
OPN
,
OP02_Upr
:
DefaultClassColors
.
OPN
,
OP02_Lwr
:
DefaultClassColors
.
OPN
,
OP03_Upr
:
DefaultClassColors
.
OPN
,
OP03_Lwr
:
DefaultClassColors
.
OPN
,
OP04_Upr
:
DefaultClassColors
.
OPN
,
OP04_Lwr
:
DefaultClassColors
.
OPN
,
OP05_Upr
:
DefaultClassColors
.
OPN
,
OP05_Lwr
:
DefaultClassColors
.
OPN
,
OP06_Upr
:
DefaultClassColors
.
OPN
,
OP06_Lwr
:
DefaultClassColors
.
OPN
,
OP07_Upr
:
DefaultClassColors
.
OPN
,
OP07_Lwr
:
DefaultClassColors
.
OPN
,
OP08_Upr
:
DefaultClassColors
.
OPN
,
OP08_Lwr
:
DefaultClassColors
.
OPN
,
OP09_Upr
:
DefaultClassColors
.
OPN
,
OP09_Lwr
:
DefaultClassColors
.
OPN
,
OP10_Upr
:
DefaultClassColors
.
OPN
,
OP10_Lwr
:
DefaultClassColors
.
OPN
,
OP11_Upr
:
DefaultClassColors
.
OPN
,
OP11_Lwr
:
DefaultClassColors
.
OPN
,
OP12_Upr
:
DefaultClassColors
.
OPN
,
OP12_Lwr
:
DefaultClassColors
.
OPN
,
OP13_Upr
:
DefaultClassColors
.
OPN
,
OP13_Lwr
:
DefaultClassColors
.
OPN
,
OP14_Upr
:
DefaultClassColors
.
OPN
,
OP14_Lwr
:
DefaultClassColors
.
OPN
,
OP15_Upr
:
DefaultClassColors
.
OPN
,
OP15_Lwr
:
DefaultClassColors
.
OPN
,
OP16_Upr
:
DefaultClassColors
.
OPN
,
OP16_Lwr
:
DefaultClassColors
.
OPN
,
OP17_Upr
:
DefaultClassColors
.
OPN
,
OP17_Lwr
:
DefaultClassColors
.
OPN
,
OP18_Upr
:
DefaultClassColors
.
OPN
,
OP18_Lwr
:
DefaultClassColors
.
OPN
,
OP19_Upr
:
DefaultClassColors
.
OPN
,
OP19_Lwr
:
DefaultClassColors
.
OPN
,
OP20_Upr
:
DefaultClassColors
.
OPN
,
OP20_Lwr
:
DefaultClassColors
.
OPN
,
OP21_Upr
:
DefaultClassColors
.
OPN
,
OP21_Lwr
:
DefaultClassColors
.
OPN
,
OP22_Upr
:
DefaultClassColors
.
OPN
,
OP22_Lwr
:
DefaultClassColors
.
OPN
,
OP23_Upr
:
DefaultClassColors
.
OPN
,
OP23_Lwr
:
DefaultClassColors
.
OPN
,
OP24_Upr
:
DefaultClassColors
.
OPN
,
OP24_Lwr
:
DefaultClassColors
.
OPN
,
OP25_Upr
:
DefaultClassColors
.
OPN
,
OP25_Lwr
:
DefaultClassColors
.
OPN
,
OP26_Upr
:
DefaultClassColors
.
OPN
,
OP26_Lwr
:
DefaultClassColors
.
OPN
,
OP27_Upr
:
DefaultClassColors
.
OPN
,
OP27_Lwr
:
DefaultClassColors
.
OPN
,
OP28_Upr
:
DefaultClassColors
.
OPN
,
OP28_Lwr
:
DefaultClassColors
.
OPN
,
OP29_Upr
:
DefaultClassColors
.
OPN
,
OP29_Lwr
:
DefaultClassColors
.
OPN
,
OP30_Upr
:
DefaultClassColors
.
OPN
,
OP30_Lwr
:
DefaultClassColors
.
OPN
,
OP31_Upr
:
DefaultClassColors
.
OPN
,
OP31_Lwr
:
DefaultClassColors
.
OPN
,
OPS1_Upr
:
DefaultClassColors
.
OPN
,
OPS1_Lwr
:
DefaultClassColors
.
OPN
,
OP1S_Upr
:
DefaultClassColors
.
OPN
,
OP1S_Lwr
:
DefaultClassColors
.
SYN
,
AAS1_Upr
:
DefaultClassColors
.
SYN
,
AAS1_Lwr
:
DefaultClassColors
.
A
,
AB1S_Upr
:
DefaultClassColors
.
A
,
AB1S_Lwr
:
DefaultClassColors
.
SYN
,
AB2S_Upr
:
DefaultClassColors
.
A
,
AB2S_Lwr
:
DefaultClassColors
.
SYN
,
BB1S_Upr
:
DefaultClassColors
.
B
,
BB1S_Lwr
:
DefaultClassColors
.
SYN
,
BB2S_Upr
:
DefaultClassColors
.
B
,
BB2S_Lwr
:
DefaultClassColors
.
SYN
,
BBS1_Upr
:
DefaultClassColors
.
SYN
,
BBS1_Lwr
:
DefaultClassColors
.
B
,
ZZ01_Upr
:
DefaultClassColors
.
Z
,
ZZ01_Lwr
:
DefaultClassColors
.
Z
,
ZZ02_Upr
:
DefaultClassColors
.
Z
,
ZZ02_Lwr
:
DefaultClassColors
.
Z
,
ZZ1S_Upr
:
DefaultClassColors
.
Z
,
ZZ1S_Lwr
:
DefaultClassColors
.
SYN
,
ZZ2S_Upr
:
DefaultClassColors
.
Z
,
ZZ2S_Lwr
:
DefaultClassColors
.
SYN
,
ZZS1_Upr
:
DefaultClassColors
.
SYN
,
ZZS1_Lwr
:
DefaultClassColors
.
Z
,
ZZS2_Upr
:
DefaultClassColors
.
SYN
,
ZZS2_Lwr
:
DefaultClassColors
.
Z
,
});
type
PyramidsColors
=
typeof
PyramidsColors
;
function
getConformerColor
(
ntc
:
string
,
useLower
:
boolean
):
Color
{
export
const
ConfalPyramidsColorThemeParams
=
{
const
item
=
NtCToClasses
.
get
(
ntc
);
colors
:
PD
.
MappedStatic
(
'
default
'
,
{
if
(
!
item
)
return
ErrorColor
;
'
default
'
:
PD
.
EmptyGroup
(),
return
ColorMapping
.
get
(
useLower
?
item
[
1
]
:
item
[
0
])
??
ErrorColor
;
'
custom
'
:
PD
.
Group
(
getColorMapParams
(
PyramidsColors
))
}
}),
};
export
type
ConfalPyramidsColorThemeParams
=
typeof
ConfalPyramidsColorThemeParams
;
export
const
ConfalPyramidsColorThemeParams
=
{};
export
type
ConfalPyramidsColorThemeParams
=
typeof
ConfalPyramidsColorThemeParams
export
function
getConfalPyramidsColorThemeParams
(
ctx
:
ThemeDataContext
)
{
export
function
getConfalPyramidsColorThemeParams
(
ctx
:
ThemeDataContext
)
{
return
ConfalPyramidsColorThemeParams
;
// TODO return copy
return
PD
.
clone
(
ConfalPyramidsColorThemeParams
)
;
}
}
export
function
ConfalPyramidsColorTheme
(
ctx
:
ThemeDataContext
,
props
:
PD
.
Values
<
ConfalPyramidsColorThemeParams
>
):
ColorTheme
<
ConfalPyramidsColorThemeParams
>
{
export
function
ConfalPyramidsColorTheme
(
ctx
:
ThemeDataContext
,
props
:
PD
.
Values
<
ConfalPyramidsColorThemeParams
>
):
ColorTheme
<
ConfalPyramidsColorThemeParams
>
{
const
colorMap
=
props
.
colors
.
name
===
'
default
'
?
PyramidsColors
:
props
.
colors
.
params
;
function
color
(
location
:
Location
,
isSecondary
:
boolean
):
Color
{
function
color
(
location
:
Location
,
isSecondary
:
boolean
):
Color
{
if
(
CPT
.
isLocation
(
location
))
{
if
(
CPT
.
isLocation
(
location
))
{
const
{
pyramid
,
isLower
}
=
location
.
data
;
const
{
pyramid
,
isLower
}
=
location
.
data
;
return
getConformerColor
(
pyramid
.
NtC
,
isLower
);
const
key
=
pyramid
.
NtC
+
`_
${
isLower
?
'
Lwr
'
:
'
Upr
'
}
`
as
keyof
PyramidsColors
;
return
colorMap
[
key
]
??
ErrorColor
;
}
}
return
Default
Color
;
return
Error
Color
;
}
}
return
{
return
{
...
@@ -162,12 +261,7 @@ export function ConfalPyramidsColorTheme(ctx: ThemeDataContext, props: PD.Values
...
@@ -162,12 +261,7 @@ export function ConfalPyramidsColorTheme(ctx: ThemeDataContext, props: PD.Values
color
,
color
,
props
,
props
,
description
:
Description
,
description
:
Description
,
legend
:
TableLegend
(
iterableToArray
(
ColorMapping
.
entries
()).
map
(([
conformer
,
color
])
=>
{
legend
:
TableLegend
(
ObjectKeys
(
colorMap
).
map
(
k
=>
[
k
.
replace
(
'
_
'
,
'
'
),
colorMap
[
k
]]
as
[
string
,
Color
]).
concat
([[
'
Error
'
,
ErrorColor
]])),
return
[
conformer
,
color
]
as
[
string
,
Color
];
}).
concat
([
[
'
Error
'
,
ErrorColor
],
[
'
Unknown
'
,
DefaultColor
]
]))
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment