Open mheilman opened 9 years ago
That's a great idea and I have actually been thinking about this, at least as an option. I have a branch that's trying to tap into IPython's display function, which would make it possible to embed not just images, but whatever IPython supports. I'll hold off on implementing embedded images manually until that branch matures, since I might be able to get it for free through IPython.
Really glad to get some input from a front-end expert on this, @mheilman :smiley:
haha :-)
It might be more convenient to have the plot image files in the HTML output as base64, either as the default or as an option (they could always be separated out by right-clicking and saving in a browser), rather than having an
index.html
with several separatepng
and/orsvg
files.Converting an image file to base64 in python would be something like this:
And then embedding the image in HTML would be like this:
Just a thought.
http://stackoverflow.com/questions/3715493/encoding-an-image-file-with-base64 http://stackoverflow.com/questions/1207190/embedding-base64-images