I accidentally sent the first part of this prematurely. Repeating:
--

Consider the following excerpt:

svg = drawer.GetDrawingText()
svg2 = svg.replace('svg:','')
svg3 = SVG(svg2)
print 'displaying svg:'
display(svg)
print 'displaying svg2:'
display(svg2)
print 'displaying svg3:'
display(svg3)

svg and svg2 display as xml text. svg3 displays as the image. All this is
in a Jupyter notebook in Chrome.

If I "print", rather than "display", svg and svg2 and copy the contents to
.svg files, then try to read the files into Chrome:

   - Chrome thinks svg.svg is empty
   - When I load svg2.svg, Chrome complains, "This XML file does not appear
   to have any style information associated with it. The document tree is
   shown below...."

svg3 cannot be printed; I'm just told that it's a <IPython.core.display.SVG
object>.

My first conclusion is that I don't know s**t about this stuff, but I
already knew that.... ;-)

My second conclusion (based on the .svg-file experiments) is that it's not
an iPython problem and, since you see the same thing on Firefox, it's
unlikely to be a Chrome problem.

-P.

   -


On Mon, Oct 24, 2016 at 6:44 PM, Dimitri Maziuk <dmaz...@bmrb.wisc.edu>
wrote:

> On 10/24/2016 04:39 PM, Peter S. Shenkin wrote:
>
> > Or is it
> > rather because chemists in your target audience will be thinking of the
> > first atom in, say, a structure from an sd file as atom #1?
>
> That
>
> > 2. Regarding the last line, most of the RDKit code I've seen in past
> > examples displays the molecule using code like the following. When is it
> > necessary/not necessary to remove the "svg" string from the results of
> > GetDrawingText()?
>
> Not sure: it's a namespace, I'm assuming ipython can't deal with xml
> namespaces. Properly written programs should show it either way,
> unfortunately my target viewer is firefox (it's a web application and
> the user's default browser is firefox) and firefox isn't one of them.
> Without svg:'s it'll show the file as xml text instead of the image.
>
> HTH
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to