3. Helper Methods - PDBeurope/pdb-topology-viewer GitHub Wiki

Helper Methods

Helper functions are useful to programatically control the visualization.

Check the links below for working examples demonstrating the use of helper function -

Available functions

No. Function Parameters Description
1 highlight `startResidue:number, endResidue:number, color?:{r:number, g:number, b:number} string`
2 clearHighlight - Clear highlightExample:Instance.clearHighlight()
3 updateTheme paramsType: json{start:number, end:number, color?: string}[] Color residuesExample:Instance.updateTheme([{start:1, end:6, color: "#ff0000"}])Above code will color residues 1 to 5 in red color param is optional and can be represented as rgb string or hex code or css supported color name. Ex. - rgb(250,0,0) or #ff0000 or red for red.
4 resetTheme - Reset themeExample:Instance.resetTheme()