noaa-onms / onmsR

R package of common functions for dataset wrangling and plotting used across National Marine Sanctuaries, originally for interactive infographic products per Sanctuary
https://noaa-onms.github.io/onmsR
MIT License
0 stars 0 forks source link

get Text layer toggle to work with Inkscape svg #2

Closed bbest closed 3 years ago

bbest commented 3 years ago

Normally in Adobe Illustrator, exporting the Text layer to SVG creates a group g tag with id="text" like so:

<g id="text">

And this is made toggle-able like so:

But in Inkscape, it produces:

<g
     inkscape:groupmode="layer"
     id="layer2"
     inkscape:label="text">

So the id is not found by the JS that turns the <g id="text"> OFF by default in: https://github.com/marinebon/nms4r/blob/255edfa951b2489b132535f48b9ddfa5681c887a/inst/template_website/libs/infographiq.js#L156.

So ideally, we can work with both Adobe Illustrator and Inkscape exported SVGs by figuring out the JQuery reference for either. See links for more:

superjai commented 3 years ago

Issue solved by providing documentation in nms4r vignette how to properly format svg files in Inkscape itself.