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
Is it possible to add additional labels on the chord diagram? #22
Comments
There's the library(chorddiag)
students = data.frame(Math = c(50, 25, 5, 12),
Art = c(10, 55, 5, 20),
Science = c(45,12,29, 20),
PE = c(24,67,27,15))
students = as.matrix(students)
sections <- paste("Section", LETTERS[1:4])
courses <- colnames(students)
dimnames(students) <- list(Section = sections,
Course = courses)
teachers <- c("Smith", "Johnson", "Williams", "Brown", "Jones", "Miller", "Davis", "Garcia")
tooltip_names <- paste(paste0("<b>", c(sections, courses), "</b>"),
paste0("<br/>Teacher: ", teachers, "<br/>"))
chorddiag(students, type = "bipartite", showTicks = F, margin = 90,
groupnameFontsize = 14, groupnamePadding = 10,
tooltipNames = tooltip_names) |
Hi Matt, Thank you for your answer! Sorry but after working through the answer you provided I realized it might not solve the problem I have on hand . The reason being in my problem each combination of "course" and "section" have a different set of "teachers". What I am trying to create is a network diagram that shows how drugs are connected (through clinical trials). The nodes here are the drugs. The links connecting the nodes (drugs) represent the trials involving the drugs and the number of patients in these trials determines the width/size of the links. What I would like to do is to potentially add the list of the studies that connect the nodes to the label of each link. It would also be nice to remove the little right arrow currently showing in the label since it's kind of misleading in this case to say "Drug1 => Drug2". Here are the codes and data sets I used in the example:
Thank you!! |
@timdisher thought you might be interested in this as well |
I'm afraid that listing studies in the chord tooltips is not possible (at least I don't know how to do it right now) but you can use the
|
Hi Matt,
I was wondering would chorddiag currently able to add additonal "labels" to the link in the chord diagram?
For example, in the first example here, if the size of the links represent the number of students, is it possible to add additional texts that would be displayed when you hover around the links? An example is adding the name of the teachers for each class/section as well as the time so that when you however around the links, not only it will show you the number of students but also the teacher's name and time of the class.
Thanks!
Aaron
The text was updated successfully, but these errors were encountered: