d3.js in html emails

214 views
Skip to first unread message

Daniel W

unread,
Sep 9, 2012, 7:51:34 PM9/9/12
to d3...@googlegroups.com
I'm using d3.js for dashboarding.  In addition to dashboarding, one of the data distribution media at my company is a daily email.  In an ideal world, I'd use d3.js for both dashboards and this email, so that I only have to learn and implement one charting library. 

Unfortunately, it sounds like email clients don't like javascript in html emails, for understandable reasons.  We all use gmail here.  

I'm trying to get a sense of what options I have, if any.  I'm totally fine with static images.  From this stack overflow, it sounds like maybe I could use an img take and link to an .svg file?  How would I go from a d3.js-created vis to an .svg file?  

Thanks in advance.  

Chris Viau

unread,
Sep 10, 2012, 12:39:27 PM9/10/12
to d3...@googlegroups.com
You can:
-Grab the results and save it as an SVG file: http://bl.ocks.org/1263606
-Print the result to PDF and convert it to PNG or SVG (using Inkscape)
-Render it to Canvas or PNG using Canvg: http://jsfiddle.net/plaliberte/HAXyd/
-Render it to Canvas wihout using Canvg: http://bl.ocks.org/2294676
-Simply grab a simple screenshot
-Render the result to PDF or PNG using command line tools or libraries like Wkhtmltopdf, Batik, PhantomJS, Node+jsdom
Chris
Reply all
Reply to author
Forward
0 new messages