SVG images in memory (no read/write (temporary files)) #5996
Unanswered
DocMinus
asked this question in
Show and tell
Replies: 2 comments 2 replies
-
@DocMinus The GIST link does not work. You can generate a base64-encoded
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I have updated my post above to use an HTML tag. I am not sure what you are attempting to do and why you think an intermediate file is needed. It is worth mentioning that you can always generate file-like object in memory using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Perhaps this is obvious to some, but I couldn't really find any examples dealing with displaying (SVG image) structures that don't go via using (temporary files). I am talking in context of e.g. using a GUI. (edit) Example would be when you don't have ipython console available, say when you use tkinter or you use as webpage.
I have put up a GIST (see below), if anyone is interested. The example is of course simple, and in Jupyter one would just use the rdkit method as is also shown, but it proves the concept.
Myself I have used this together with plotly dash to display structures without having to write temporary files (shown in the comment section of the GIST).
https://gist.github.com/DocMinus/026ed8c845f9ad3c7dcf3df286038714
Again, it feels in retrospect simple/obvious, but I haven't encountered any solutions close to this so far. Thanks for reading.
Edit: fixed the link
Beta Was this translation helpful? Give feedback.
All reactions