Skip to content

Commit

Permalink
setColorByResidue
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Jun 20, 2024
1 parent 03f77d0 commit f3ee76d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/src/widget_ngl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,16 +741,17 @@ class NGLView extends widgets.DOMWidgetView{
}
}
}
setColorByResidue(colors, component_index, repr_index){
var repr = this.stage.compList[component_index].reprList[repr_index];
var schemeId = NGL.ColormakerRegistry.addScheme(function(params){

setColorByResidue(colors, componentIndex, reprIndex){
const repr = this.stage.compList[componentIndex]?.reprList[reprIndex];
const schemeId = NGL.ColormakerRegistry.addScheme(function(params){
this.atomColor = function(atom){
var color = colors[atom.residueIndex];
return color
const color = colors[atom.residueIndex];
return color;
};
params; // to pass eslint; ack;
});
repr.setColor(schemeId);
repr?.setColor(schemeId);
}

addShape(name: string, shapes: any[]) {
Expand Down

0 comments on commit f3ee76d

Please sign in to comment.