Closed robertf224 closed 5 years ago
The root object in an composer is actually an instance of Kekule.ChemDocument (when calling composer.setChemObj(molecule)
, the molecule is actually inserted into this document), so the following code may be used to add multiple molecules to composer:
var molecules = [mol1, mol2, mol3];
var chemDoc = composer.getChemObj();
molecules.forEach(function(mol){
chemDoc.appendChild(mol);
});
awesome thanks!
I can't figure out how to add multiple molecules. Using
setChemObj
as described here in sequence doesn't work because each call overrides the previous. Is there some way I can add multiple molecules using the current APIs?