ReactionMechanismGenerator / ReactionMechanismGenerator/RMG-Py

problems with svg images

Open
#2,985 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
530
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
8

Description

Bug Description

I'm trying to export .svg files of my molecules and they're rendering incorrectly in most viewers, including Firefox and PowerPoint. Claude said something about Cairo using feImage or a compositing filter technique.

My Ubuntu Image Viewer can render the file and so I can zoom in and take a screenshot if I need images for a slideshow, but it's not the same. The vectorized image can be resized while a .png starts to introduce losses.

I was able to generate .svg files a year ago, and I'm nervous that if things break down further, I won't be even able to get high quality screenshots.

Example Code
import rmgpy.species
sp = rmgpy.species.Species(smiles='O=CCO[O]')
sp.molecule[0].draw('example.svg')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with rmgpy.species and molecule.draw('example.svg'). Inspect how the SVG is generated, then compare the output in Firefox and PowerPoint with Ubuntu Image Viewer, as reported. Done means the exported SVG renders correctly in the affected viewers while remaining a scalable vector image.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.