I've had trouble combining clickable graphviz in complex applications. I've made it work in El Dorado which is a Sinatra app available as open source. github
Results from a neo4j query are used to expand a dot template. This is piped through the dot-to-svg app server-side and then tweaked a bit back in ruby. github
@svg = pipe('dot -Tsvg', dotify(dot)) .gsub(/<a /,'<a target="_top" ')
A companion anchor tag is inserted into the html page for mysterious reasons. Then the processed svg text is emitted as a dataurl of an embed element. github
%a{href:'#', class:'svg'} %embed{ style: 'max-width: 100%', src: "data:image/svg+xml;utf8,#{@svg}" }
These obscure ruby and haml idioms have become key technology in my work at New Relic. See El Dorado UI