Comments (7)
I absolutely want a way to combine ggraph with maps. My current sentiment is that I'll wait for the native sf support that will arrive in the next version of ggplot2 rather than get tangled in with another extension
from ggraph.
Though I haven't tested it this RPub may be of interest here: https://rpubs.com/debasishb/298685
from ggraph.
I have the very same problem. It would be wonderful to be able to combine ggmap and ggraph.
from ggraph.
@thomasp85 Thanks for the update. In a future version of ggraph, Could it be possible download online maps (gmaps or osm) as ggmap does?
from ggraph.
This is unlikely to be part of ggraph as this is possibly out of scope. I'll wait with ruling this out completely until I start poking at the problem
from ggraph.
@Jim89 @thomasp85 - Similar to this request (which I would be happy to submit separately), would be enabling network functionality atop Leaflet mapping.
from ggraph.
I was looking for a way to plot graphs with sf objects as nodes and couldn't find any solutions online. Since this issue is vaugely related to the plotting of spatial object, I thought I would post a solution here in case any one is interested.
# load packages
library(tidygraph)
library(ggplot2)
library(sf)
library(tibble)
# make data
nodes <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
edges <- tibble(from = 1:5, to = 6:10, type = letters[1:5])
# make centroids
ctr <- as.data.frame(as(st_geometry(st_centroid(nc)), "Spatial")@coords)
names(ctr) <- c("x", "y")
# make graph
g <- tbl_graph(nodes, edges)
# make plot
p <- ggraph(g, "manual", node.position = ctr) +
geom_sf(aes(fill = AREA), data = nodes) +
geom_edge_arc(aes(color = type))
# render plot
print(p)
from ggraph.
Related Issues (20)
- Deprecation warning for size aesthetic thrown by geom_edge_link (and similar) since ggplot2 version 3.4.0 HOT 3
- facet_graph, number of rows HOT 1
- Empty plot on example graph HOT 5
- Error in try_fetch(utils::getFromNamespace(algorithm, "igraph"), error = function(cnd) { : could not find function "try_fetch HOT 2
- Error in check.length(gparname) : 'gpar' element 'lwd' must not be length 0 HOT 2
- [Accessibility] Vignette plots lack alt= attributes
- Error in layout_with_sparse_stress() HOT 2
- Plotting Overlapping Node's Text At the same Z-height as Point HOT 1
- Feature request: small multiples plots replicating entire network HOT 1
- Cannot edit ex-post a layout_tbl_graph with mutate?
- circlepack layout struggles with large number of nodes HOT 5
- `arrow.fill` support HOT 1
- `sort.by` option collapses all nodes into one when using linear layout with circular HOT 1
- Providing custom bezier control points HOT 2
- `geom_conn_bundle()` crashes R HOT 8
- labels are cut off on the sides HOT 2
- Revdep check failure with upcoming ggplot2 3.5.0
- -e HOT 1
- Release ggraph 2.2.0
- algorythmn is arranging circles in wrong manner HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggraph.