My goal is to make a plot that you can interact with in the browser. Ideally, I would like a well-documented and mature JavaScript plotting library that supports SVG. As far as
One way to this can be seen in the matplotlib gallery.
Basically:
In matplotlib, use element.set_gid("youridhere") on the matplotlib element you wish to make interactive. That is, use set_gid() on the output from plot()/hist()/whatever().
Create an svg with matplotlib, but use a StringIO object as your file.
Parse the svg with an xml library (e.g. xml.etree.ElementTree)
Find the xml elements with the id that you set (e.g. "youridhere").
Add onclick/on${theeventyoucareabout} attributes with a javascript function name.
Add a script element with your javascript as a CDATA to the xml tree.