davidgohel / ggiraph

make 'ggplot' graphics interactive
https://davidgohel.github.io/ggiraph
806 stars 74 forks source link

ggiraph error after upgrading ggplot to version 2.2.0 #41

Closed abiyug closed 7 years ago

abiyug commented 7 years ago

_geom_mapinteractive function from ggiraph_0.3.2 isn't working when ggplot2 vr 2.2.0 is loaded. It worked with ggplot2 ver 2.1.0

Here is the script

library(ggiraph)
library(maps)
library(ggplot2)
library(ggmap)

states_map <- map_data("state")
        gg_map <- ggplot(crime, aes(map_id = state))
        gg_map <- gg_map + geom_map_interactive(aes(
                fill = Murder,
                tooltip = labs,
                data_id = state,
                onclick = onclick
        ),
        map = states_map)

Here is the output

Error: GeomInteractiveMap was built with an incompatible version of ggproto.
Please reinstall the package that provides this extension.
ashishdamania commented 7 years ago

Not sure if this will work for you. 1) Install ggplot from devtools devtools::install_github("tidyverse/ggplot2")

2) "Reinstall" ggplot extensions

install.packages("ggrepel")
devtools::install_github('davidgohel/ggiraph')
davidgohel commented 7 years ago

Thanks @deepthoughts.This should be automatically fixed when a new version will be on CRAN (it will use the correct ggplot2 version)

abiyug commented 7 years ago

@davidgohel I am not exactly sure what you mean here. So, if I have ggplot2 ver. 2.2.0 installed already, and am installing ggiraph from CRAN, it will automatically load ggplot2 ver 2.1.0?

Or, are we saying ggiraph works currently ONLY if we install ggplot2 from devtools?

davidgohel commented 7 years ago

@abiyug Hadley made a communication about ggplot2 extensions, they need to be rebuild with the latest version of ggplot2.

  1. Get the latest version of ggplot2
  2. build ggiraph from source

That should work.

David

abiyug commented 7 years ago

Well ggplto2 ver 2.2.0 (latest and on CRAN) isn't working well with ggiraph_0.3.2. Unless I am missing something. With so many extension, I wish there was an official version comparability matrix.

davidgohel commented 7 years ago

you did install ggiraph from source, right?

davidgohel commented 7 years ago

and official (cran) version is 2.2.1, not 2.2.0

abiyug commented 7 years ago

the version I had was ggplot2_2.2.0, I had to go back to ggplot2_2.1.0, but I see 2.2.1 is published on 2016-12-30. I will test that and revert.

davidgohel commented 7 years ago

OK, when testing, do not forget to install ggiraph from source (I will send an update to CRAN but not before 2/3 days).

David

abiyug commented 7 years ago

Ok.

abiyug commented 7 years ago

Upgrade to ggplot2_2.2.1 and issue is resolved.

davidgohel commented 7 years ago

I will submit to cran soon, when package will be build on CRAN, this issue should not happen anymore.

David