Code Monkey home page Code Monkey logo

geomnet's People

Contributors

cpsievert avatar heike avatar hrbrmstr avatar njtierney avatar sctyner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geomnet's Issues

Legend for line width

Hi!
I am using geom_net to plot my network data and I am pretty impressed by how useful and nice this package is. Since I am using the line width to represent weighted edges, it would be possible to include an additional legend for line width in my plot? I mean, I would like to have a legend with line width proportional to the values that I have in the dataframe.

I appreciate any help or feedback on this!
Thanks
Gustavo

Facets

Layout ALL vertices first, then facet instead of recomputing the layout for each facet.

geomnet not in CRAN

The package is archived.

When I try to build the github version I get

* creating vignettes ... ERROR
--- re-buildinggeomnet-vignette.Rmdusing rmarkdown
Quitting from lines 15-112 (geomnet-vignette.Rmd) 
Error: processing vignette 'geomnet-vignette.Rmd' failed with diagnostics:
The first two columns of `x` must be of the same type.
--- failed re-buildinggeomnet-vignette.RmdSUMMARY: processing the following file failed:geomnet-vignette.RmdError: Vignette re-building failed.
Execution halted

After installing last CRAN archived version, when trying to compile first examples in that vignette I also get

Error: The first two columns of `x` must be of the same type.

Further, I get a similar error to the one in CRAN (https://cran-archive.r-project.org/web/checks/2021/2021-06-21_check_results_geomnet.html)

Error: `loops` is `FALSE`, but `x` contains loops.
    The following values are affected:
     - `x[604, 1:2]`
     - `x[605, 1:2]`
     - `x[610, 1:2]`
     - `x[615, 1:2]`
     - `x[617, 1:2]`
     - `x[618, 1:2]`
    Execution halted 

if I do

network::as.network(bloodnet[,1:2], matrix.type = "edgelist")
Error: `loops` is `FALSE`, but `x` contains loops.
The following values are affected:
	- `x[13, 1:2]`
	- `x[14, 1:2]`
	- `x[15, 1:2]`
	- `x[16, 1:2]`
	- `x[21, 1:2]`
	- `x[22, 1:2]`

but not sure as they relates.

define range for linewidth

Hello,

I am trying to set a range for the linewidth, similar to what I can do with node size:

scale_size_continuous(range = c(3,10))

Is this functionality included in geom_net?

Thank you

Pull out coordinates

Store the coordinates as ..x.. ..y.. à la ..density.. so that they can be removed from the internal structure.

Legends

Have legends appear on the right for color, shape, linetype, etc. I'm assuming they will show up once we fix the grouping, but in case they don't I thought I'd make an issue for it.

Failed to install geomnet

Hi,

Thank you for creating this amazing product. I am eager to use it to generate network for my analysis. However, I am stuck at step one - I cannot install the package!! Here is the error message. Could you help me identify what the problem would be? Thank you!!

Downloading github repo sctyner/geomnet@master
Installing geomnet
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ
--no-save --no-restore CMD INSTALL
'/private/var/folders/0p/zrfyxxm9021bpfhlybcss75c0000gn/T/Rtmp4Nxf8o/devtoolsfee77a0000a/sctyner-geomnet-b78193e'
--library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library'
--install-tests

  • installing source package ‘geomnet’ ...
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** preparing package for lazy loading
    Error : package ‘ggplot2’ 1.0.1 was found, but >= 1.0.1.9003 is required by ‘geomnet’
    ERROR: lazy loading failed for package ‘geomnet’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/geomnet’
    Error: Command failed (1)

can't find hp.edges

hi, i like your package very much and I want to learn it.

when I try your example, I find that I can't find hp.edges.

Can you put the data in your repo or pacakge?

Thank you very much and looking forward to your reply.

Yang

Labeling Vertices

Want to have labels added logically. A vlabel column in data that is TRUE if the vertex should be labeled with its name or FALSE if it shouldn't be labeled. This would replace the current logical vlabel option.

CRAN

Is this no longer part of CRAN?

ggnet2

Hi @sctyner,

I'm working on a more advanced version of the ggnet function that you found in the GGally package. Here's the vignette for it.

All comments welcome, and congratulations for your work on geom_net, it looks amazing!

Comparison with ggraph and DiagrammeR?

geomnet looks intuitive and versatile. I love how directly and naturally it merges with existing ggplot2 code. As a new user, I am wondering what the best use cases are for geomnet versus ggraph or DiagrammeR. From my reading so far, I suspect that geomnet graphs are easier and quicker to create and that the ggraph and DiagrammeR have more features. Do you think an assessment and some recommendations would be appropriate for the README?

Linewidth doesn't respond when inside aes()

linewidth argument is not responsive to values but only when mapped using aes()

library(ggplot2)
library(geomnet)

data("bikes")
# merge into a single data.frame()
bikes_merged <- merge(bikes$trips, bikes$stations, by.x="Start.station", by.y="name", all=TRUE)
# create a factor
bikes_merged$nbDocksfac <- as.factor(bikes_merged$nbDocks)

p <- ggplot(data = bikes_merged, aes(from_id = Start.station, to_id = End.station))

p + geom_net(aes(shape = nbDocksfac), colour = "blue", size = 6, linewidth=0.75, directed = TRUE, curvature=0.3)   # shapes are OK

p + geom_net(aes(colour = nbDocks), size = 6, directed = TRUE, curvature=0.3) # gradient colored nodes are OK

p + geom_net(aes(colour = nbDocksfac), size = 6, directed = TRUE, curvature=0.3) # categorical colored nodes are OK

p + geom_net(aes(size = nbDocksfac, colour = nbDocksfac),  directed = TRUE, curvature=0.3) # diff size & colour are OK

p + geom_net(aes(linetype = nbDocksfac), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # linetypes are OK

p + geom_net(aes(linewidth = 2), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # fixed linewidth inside aes() is OK

p + geom_net(colour = "blue", size = 6, linewidth = 2, directed = TRUE, curvature=0.3) # fixed linewidth is OK

p + geom_net(aes(linewidth = 0.99), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # bug? linewidth not responsive

Label edges in geom_net

Is it possible to add text to the edges in geom_net using the very intuitive geom_net api?

I do not see anything in the documentation that talks to this


library(geomnet)
library(ggplot2)

x <- structure(list(from = c("a", "b", "d", "f", "g", "e", "c", "i", 
                        "e", "h", "i", "i", "j", "j"), to = c("", "", "", "", "", "a", 
                                                              "b", "c", "d", "e", "f", "g", "h", "i"), edge_val = c(NA, NA, 
                                                                                                                    NA, NA, NA, 1.6, 2.25, 1.75, 0.95, 1.8, 3.2, 2.6, 2.95, 2.45)), .Names = c("from", 
                                                                                                                                                                                               "to", "edge_val"), class = "data.frame", row.names = c(NA, -14L
                                                                                                                                                                                               ))

ggplot(x, aes(from_id = from, to_id = to, linewidth = edge_val)) +
  geom_net(layout.alg = "fruchtermanreingold", labelgeom = "text",repel = TRUE,
           size = 4, labelon = TRUE, vjust = -1, ecolour = "grey80",
           directed = FALSE, fontsize = 4, ealpha = 0.5) +
  theme_net()

The ideal output would be something that looks like:
image

Legend is broken for lines

data(blood)
bloodnet <- merge(blood$edges, blood$vertices, by.x="from", by.y="label", all=TRUE)
p <- ggplot(data = bloodnet, aes(from_id = from, to_id = to))
p + geom_net(aes(colour=rho, linetype = group_to), labelon=TRUE, vjust = -0.5)

image

geomnet::geom_circle radius is proportional to grid limits, not to actual grid

I am not sure if this is a bug or a feature. If this is a feature, adding an argument to offer both would be really helpful.

when creating circles with geom_circle, the radius is proportional to the limits of the figure. Thus, a radius of 0.5 reflects 0.5 times the x and the y axis of the screen. Given it's the radius, it would completely fill the figure. It would be more intuitive and streamlined with other gg functions to have the radius using the actual x and y values on the grid.

kind regards

Youri


edit:

I wrote a solution:

https://github.com/yhoogstrate/geomnet

I am not too deep into the gg enviroment so this probably isn't the most elegant solution.

Custom Layout

Allow users to input their own layout ((x,y) coords of vertices and vertex id?).

Change size of node labels

Maybe this can be done in ggplot2 but to date I can't figure out how. I notice you provide for "labelcolour" in geom_net though. My goal is to generate an even better network plot by making it more readable. Also want to try to integrate "ggrepel." As a teacher myself I really like being able to show students how to produce nice networks without a lot of messing around. You have done a great job with "geomnet."

Best regards

Mike Gallagher

Not on CRAN

geomnet's no longer on CRAN. I wonder if you plan to get it back, or if you need help doing so?

Grouping

Grouping doesn't work in the usual ggplot2 way when it comes to aes things.

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.