Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify colour for edges #9

Open
garthtarr opened this issue Dec 21, 2016 · 5 comments
Open

Specify colour for edges #9

garthtarr opened this issue Dec 21, 2016 · 5 comments

Comments

@garthtarr
Copy link
Owner

From an email:

I am trying to assign colors to the edges, using groups and an igraph object; I am being able to make the assignments using the color names, but not with codes in hexadecimal. Is there any possible solution for this?

@garthtarr
Copy link
Owner Author

The colour of the edges is currently inherited from the "source" node. This is less than optimal, it would be nice to be able to specify the colour of the edges individually (e.g. read it from the edge colour properties of an igraph object).

@garthtarr garthtarr changed the title Specify hex colour Specify hex colour for edges Dec 21, 2016
@garthtarr garthtarr changed the title Specify hex colour for edges Specify colour for edges Dec 21, 2016
@garthtarr
Copy link
Owner Author

garthtarr commented Dec 21, 2016

There doesn't appear to be an issue specific to hex colour values. The colour interpretation is done using d3.color which takes hex or CSS named colours.

require(igraph)
require(edgebundleR)
ws_graph <- watts.strogatz.game(1, 50, 4, 0.05)
V(ws_graph)$color = sample(c("#ffeeaa","green","steelblue"),50,replace = TRUE)
edgebundle(ws_graph,tension = 0.1,fontsize = 18,padding=40)

I'll need to work out how to best address the edge colouring issue.

@garthtarr
Copy link
Owner Author

garthtarr commented Dec 21, 2016

Perhaps we should be more ambitious and migrate to using the d3r package so that we can use the d3_igraph() function to convert igraph objects to JSON rather than using the very limited conversion function edgeToJSON_igraph() that we originally wrote. When we do this, we should incorporate the d3 dependency functions.

@ghost
Copy link

ghost commented Nov 6, 2018

Hi,
I have a igraph object, which some edges represents negative correlation and some represents positive correlation. I was wondering if there is a way to plot the edgebundle of it with two different color for different type of the edges.
Thanks

@garthtarr
Copy link
Owner Author

Hi, I have to admit I haven't made any progress on this issue and am unlikely to in the near future. Happy to take pull requests though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant