Open keeper1030 opened 1 year ago
Hi @keeper1030, you may refer to the ring perception demo (http://partridgejiang.github.io/Kekule.js/demos/items/algorithm/ringSearch.html) and sub structure search demo (http://partridgejiang.github.io/Kekule.js/demos/items/algorithm/structureSearch.html). In those demos, part of atoms/bonds in editor or viewer are highlighited to illustrate a matched sub structure. Actually, you can change the color of any object (atom, bond, molecule, etc.) by changing its renderOptions
property, e.g.:
bond.setRenderOption('color', '#00ff00');
Then you may also listener to the userModificationDone
event of editor to clear the color of those objects:
editor.on('userModificationDone', evt => {
bond.setRenderOption('color', null);
});
Can I check is it contain specific Molecule? I'm trying to change color of that specific Molecule in Editor's objects like below picture. FurtherMore, if color changed Molecule's atom or bond are change, it should back to origin color.