Skip to content
Snippets Groups Projects
Commit 014358ac authored by Michal Malý's avatar Michal Malý
Browse files

ReDNATCO plugin stage 12

parent 0deae245
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,8 @@ const ConformersByClass = { ...@@ -71,6 +71,8 @@ const ConformersByClass = {
}; };
type ConformersByClass = typeof ConformersByClass; type ConformersByClass = typeof ConformersByClass;
const DefaultChainColor = Color(0xD9D9D9);
class ColorBox extends React.Component<{ caption: string, color: Color }> { class ColorBox extends React.Component<{ caption: string, color: Color }> {
render() { render() {
const lum = luminance(this.props.color); const lum = luminance(this.props.color);
...@@ -472,7 +474,7 @@ class ReDNATCOMspViewer { ...@@ -472,7 +474,7 @@ class ReDNATCOMspViewer {
name: 'cartoon', name: 'cartoon',
params: { sizeFactor: 0.2, sizeAspectRatio: 0.35, aromaticBonds: false }, params: { sizeFactor: 0.2, sizeAspectRatio: 0.35, aromaticBonds: false },
}, },
colorTheme: { name: 'chain-id', params: { asymId: 'auth' } }, colorTheme: { name: 'uniform', params: { color: DefaultChainColor } }
}; };
case 'ball-and-stick': case 'ball-and-stick':
return { return {
...@@ -480,7 +482,7 @@ class ReDNATCOMspViewer { ...@@ -480,7 +482,7 @@ class ReDNATCOMspViewer {
name: 'ball-and-stick', name: 'ball-and-stick',
params: { sizeFactor: 0.2, sizeAspectRatio: 0.35, aromaticBonds: false }, params: { sizeFactor: 0.2, sizeAspectRatio: 0.35, aromaticBonds: false },
}, },
colorTheme: { name: 'element-symbol', params: { carbonColor: 'chain-id' } }, colorTheme: { name: 'element-symbol', params: { carbonColor: { name: 'custom', params: DefaultChainColor } } },
}; };
} }
} }
...@@ -783,7 +785,7 @@ class ReDNATCOMspViewer { ...@@ -783,7 +785,7 @@ class ReDNATCOMspViewer {
StateTransforms.Representation.StructureRepresentation3D, StateTransforms.Representation.StructureRepresentation3D,
this.substructureVisuals('cartoon'), this.substructureVisuals('cartoon'),
{ ref: IDs.ID('visual', 'nucleic', BaseRef) } { ref: IDs.ID('visual', 'nucleic', BaseRef) }
); )
if (display.showPyramids) { if (display.showPyramids) {
bb.to(IDs.ID('structure', 'nucleic', BaseRef)) bb.to(IDs.ID('structure', 'nucleic', BaseRef))
.apply( .apply(
......
...@@ -40,7 +40,8 @@ export const ElementSymbolColorThemeParams = { ...@@ -40,7 +40,8 @@ export const ElementSymbolColorThemeParams = {
'operator-name': PD.Group(OperatorNameColorThemeParams), 'operator-name': PD.Group(OperatorNameColorThemeParams),
'model-index': PD.Group(ModelIndexColorThemeParams), 'model-index': PD.Group(ModelIndexColorThemeParams),
'structure-index': PD.Group(StructureIndexColorThemeParams), 'structure-index': PD.Group(StructureIndexColorThemeParams),
'element-symbol': PD.EmptyGroup() 'element-symbol': PD.EmptyGroup(),
'custom': PD.Color(Color(0xCCCCCC))
}, { description: 'Use chain-id coloring for carbon atoms.' }), }, { description: 'Use chain-id coloring for carbon atoms.' }),
saturation: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }), saturation: PD.Numeric(0, { min: -6, max: 6, step: 0.1 }),
lightness: PD.Numeric(0.2, { min: -6, max: 6, step: 0.1 }), lightness: PD.Numeric(0.2, { min: -6, max: 6, step: 0.1 }),
...@@ -71,7 +72,8 @@ export function ElementSymbolColorTheme(ctx: ThemeDataContext, props: PD.Values< ...@@ -71,7 +72,8 @@ export function ElementSymbolColorTheme(ctx: ThemeDataContext, props: PD.Values<
pcc.name === 'model-index' ? ModelIndexColorTheme(ctx, pcc.params).color : pcc.name === 'model-index' ? ModelIndexColorTheme(ctx, pcc.params).color :
pcc.name === 'structure-index' ? StructureIndexColorTheme(ctx, pcc.params).color : pcc.name === 'structure-index' ? StructureIndexColorTheme(ctx, pcc.params).color :
pcc.name === 'element-symbol' ? undefined : pcc.name === 'element-symbol' ? undefined :
assertUnreachable(pcc); pcc.name === 'custom' ? () => pcc.params :
assertUnreachable(pcc);
function elementColor(element: ElementSymbol, location: Location) { function elementColor(element: ElementSymbol, location: Location) {
return (carbonColor && element === 'C') return (carbonColor && element === 'C')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment