Git Product home page Git Product logo

Comments (8)

thomasp85 avatar thomasp85 commented on August 9, 2024

That is strange as it should be available (it is imported from grid in the namespace file)

Can I get you to try and install the latest GitHub version, and if the problem persists, try to load grid
explicitly (library(grid)) and see if that helps. If there's still a problem I would like to get a minimal reproducible example along with your session info...

from ggraph.

fmusili avatar fmusili commented on August 9, 2024

from ggraph.

thomasp85 avatar thomasp85 commented on August 9, 2024

Hmm... It still shouldn't do that - can you share the error producing code along with your session info

from ggraph.

fmusili avatar fmusili commented on August 9, 2024

############# error producing code
library(dplyr)
library(ggplot2)
library(ggraph)
library(ggiraph)
library(igraph)
library(ggnetwork)

Commodity = c("Oranges","Oranges","Passion","Meat","Oranges","Oranges","Bananas","Cucumber"," Maize" )
from = c("Kenya","Kenya","Kenya","Kenya","Kenya","Kenya","Kenya","Kenya","Kenya")
to = c( "China","Egypt","Zambia","Japan","Rwanda","Uganda","Egypt","Japan","Uganda")
edges = data.frame(Commodity, from, to)
edges<-edges%>%group_by(from,to)%>%
summarise(Com = toString(unique(Commodity)))
vertices<-unique(rbind(data.frame(name=edges$from,Legend="Source",Commodity=""),
data.frame(name=edges$to,Legend="Destination",Commodity=edges$Com)))
g <- graph_from_data_frame(edges, directed=TRUE,vertices=vertices)
V(g)$label<-as.character(V(g)$name)
V(g)$tooltip <- paste(unique(as.character(V(g)$name)),"\n","(",V(g)$Commodity,")")

gg_point_1 <-ggraph(g, layout = 'igraph',algorithm = 'kk')+
geom_edge_link(aes(x = x, y = y,label= V(g)$label[-(1:1)]),
arrow = arrow(length = unit(4, "mm"), type = "closed"),
label_colour = "blue",
angle_calc = 'along',
label_dodge = unit(2.5, 'mm'),
end_cap = circle(3, 'mm')) +
geom_node_point(size =5 ,color = "red")+
theme_blank() +
geom_point_interactive(aes(x = x, y = y,tooltip=tooltip,color=Legend),size=7)+
ggtitle(paste0("Title"))+
scale_color_brewer(palette="Dark2")+
theme(plot.title = element_text(color="darkblue", size=13, face="bold"))
ggiraph(code = print(gg_point_1 ),zoom_max = 3,width = 0.9,width_svg = 9,
height_svg = 8)

######## sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X El Capitan 10.11.4

locale:
[1] C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] gdtools_0.1.3 ggnetwork_0.5.1 igraph_1.0.1 ggiraph_0.3.2.9000 ggraph_0.1.1 ggplot2_2.2.1
[7] dplyr_0.5.0 raster_2.5-8 sp_1.2-4

loaded via a namespace (and not attached):
[1] Rcpp_0.12.9 sna_2.4 RColorBrewer_1.1-2 plyr_1.8.4 R.methodsS3_1.7.1
[6] R.utils_2.5.0 tools_3.3.2 digest_0.6.12 tibble_1.2 gtable_0.2.0
[11] lattice_0.20-34 DBI_0.5-1 ggrepel_0.6.5 xml2_1.1.1 htmlwidgets_0.8
[16] grid_3.3.2 R6_2.2.0 rvg_0.1.2 tweenr_0.1.5 deldir_0.1-12
[21] udunits2_0.13 magrittr_1.5 scales_0.4.1 htmltools_0.3.5 MASS_7.3-45
[26] units_0.4-2 assertthat_0.1 ggforce_0.1.1 colorspace_1.3-2 labeling_0.3
[31] network_1.13.0 lazyeval_0.2.0 munsell_0.4.3 statnet.common_3.3.0 R.oo_1.21.0

from ggraph.

thomasp85 avatar thomasp85 commented on August 9, 2024

Hmm... I cannot reproduce. Can I get you to test if you get the error when you run the code without ggiraph calls?

from ggraph.

fmusili avatar fmusili commented on August 9, 2024

It works fine without ggiraph calls.

from ggraph.

thomasp85 avatar thomasp85 commented on August 9, 2024

There's some strangeness going on in that interaction then. As it is solved by loading grid I won't look more into it now as ggraph itself works, but might look further when time permits

from ggraph.

fmusili avatar fmusili commented on August 9, 2024

Ok, thank you!

from ggraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.