viewof molecule = {
const mol = rdkit.get_mol(input);
const _svg = mol.get_svg().clean();
const elem = html`${_svg}`;
const valid = mol.is_valid();
elem.title =
!valid? "error: invalid SMILES string":
smile != input? "SMILES string: "+input:
smile == ""? "error: molecule not found":
"name: "+name
const s = DOM.svg(width, height);
s.setAttributeNS(null, 'width', width);
s.setAttributeNS(null, 'height', height);
s.setAttributeNS
( null
, 'style'
, `width: 100%; height: auto; max-width: ${width}; box-sizing: border-box;`
);
s.appendChild(svg`${_svg}`);
elem.value = s;
return elem;
}