Closed xjjius closed 3 years ago
Hi @xjjius, most of the configurations of viewer widget can be accessed by viewer.getRenderConfigs()
, and by default, all viewers in one HTML page shares the same render configuration instance.
You can check the /render/kekule.render.configs.js
to overview all the options. To use specified color of atoms in molecule, just:
viewer.getRenderConfigs().getColorConfigs().setUseAtomSpecifiedColor(true); // for 2D viewer
// or
viewer.getRenderConfigs().getMoleculeDisplayConfigs().setUseAtomSpecifiedColor(true); // for 3D viewer
// force repainting
viewer.repaint();
That works!! Thanks again for your help and the great work!!
I have gone through all the API documents on the demo website. Still can not find a way to set the viewer using specified colors for atoms by code. The only way to do it is click through the setting menu. How can I program it when initiating the viewer component?