reymond-group / smilesDrawer

A small, highly performant JavaScript component for parsing and drawing SMILES strings. Released under the MIT license.
https://smilesdrawer.rocks
MIT License
434 stars 68 forks source link

One key issue...serverside rendering. #132

Open swamidass opened 2 years ago

swamidass commented 2 years ago

I'd like to move over to this project, but there are a some key issues I'd like to see resolved: Compatibility with serverside rendering.

Right now, the SVG code is interleaved with browserside APIs and UI specific logic. Even using the code on the browser is difficult, because its entangled with browserside logic. If the render logic requires the browser, perhaps that could be mocked with linkedom or other severside rendering package?

That being said, it might be possible for us to build a wrapper around smilesDrawer that mocks the browser/UI enough to extract an SVG. That's not an ideal solution, for several reasons, but it might work as a starting point.

Do you have interest in fixing this issue?