marinebon / infographiqR

R functions for creation of interactive intelligent infographics, ie infographiq
https://marinebon.github.io/infographiqR
MIT License
11 stars 2 forks source link

non-group svg element silhouettes not activated #26

Closed reikopm closed 6 years ago

reikopm commented 6 years ago

Some of the svg silhouettes are not activating, i.e. when I try to click on them nothing happens. I've checked the svg_id codes in svg_elements.csv and they appear to correspond with the id codes in pelagic.svg. For example Phytoplankton works, pinnipeds does not. pinnipeds.html does exist.

Processing ran without errors but issued two warnings, Warning messages: 1: In if (!is.na(modal_caption)) { : the condition has length > 1 and only the first element will be used 2: In if (!is.na(modal_caption)) { : the condition has length > 1 and only the first element will be used

In info-mb I have updated the files, svg_elements.csv and plot_indicators.csv

Should I try to reset the element ids in pelagic.svg?

7yl4r commented 6 years ago

pelagic.svg and svg_elements.svg look correct to me, but I see that nothing in the docs folder has changed.

Have you been able to run create_info_site (step 2 of infographiq readme)? Running this function generates the website from your files into the ./docs directory, so your changes will not show up on the website until it is run.

7yl4r commented 6 years ago

Looking at the updated site, I see that this is a bug within infographiq.

Currently the svg element with the id must be a group for this to work because of the d3 selectors used.

I will put this on my todo list and have it fixed soon.

reikopm commented 6 years ago

I noticed in inkscape, looking at the various svg elements, that for the silhouettes that do not show up the code looks like this

I think it should look like this
7yl4r commented 6 years ago

You are correct. Versions of infographiq past 723c92c9c378bf992b2cb76aa9fd5d5ae0c18c28 should work regardless of the id being on group or path though. I tested it on info-mb and it seems to be working. You will need to reinstall or update the library before building the site for the fix to apply.

reikopm commented 6 years ago

I updated to the new version of infographiq and it fixed the non-grouped svg elements. But the "forage-invertss", "copepods", "jellies", and "eDNA" (new svg) are not activated. I tried to figure it out but ...

Interesting that the Forage invertebrates are on the right side menu but the Jellies, Copepods, and Environmental eDNA are not.

7yl4r commented 6 years ago

It looks to me like the site hasn't properly regenerated since you changed forage-invertss to forage-inverts and added copepods & jellies. docs/svg_elements.csv looks like an older version. I would think this would be fixed after deleting /rmd and /docs completely and rebuilding.

Infographiq should probably do a better job of doing a clean build, but for now I have gotten in the habit of manually clearing them whenever something doesn't look right. rm -rf ./rmd && rm -rf ./docs && Rscript ./create_info_site.R

reikopm commented 6 years ago

Yay! It worked. Many thanks!