Causata / svgenie

Save your D3 graphs and other SVG as an image, without a server-side component
MIT License
43 stars 6 forks source link

Using selectors of selecting svg on page. #2

Closed ravisuhag closed 7 years ago

ravisuhag commented 10 years ago

Hi

is there any way i can use selectors for selecting svg to save ?

benrudolph commented 10 years ago

One workaround is to select the element before hand and pass it in as the first argument. The test page has an example: https://github.com/Causata/svgenie/blob/master/test/test.html#L12

ravisuhag commented 10 years ago

Thanks, will try it out ..Also i am having one more problem There are few svg elements on which i have applied classes. But saving with svgenie is not rendering styles applied through classes. Is there any workaround for that. P.S. i can not inline all the styles as i am using C3.JS library.

benrudolph commented 10 years ago

I had the same issue. I built this tiny jquery plugin to inline the styles for you. Let me know if that helps: https://github.com/benrudolph/jquery.inlinify