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

Rotate Labels #2

Open
mviertel opened this issue Apr 23, 2016 · 9 comments
Open

Rotate Labels #2

mviertel opened this issue Apr 23, 2016 · 9 comments

Comments

@mviertel
Copy link

Hi!
Short question regarding group labels: is it possible to rotate them?

See: http://stackoverflow.com/questions/31943102/rotate-labels-in-a-chorddiagram-r-circlize

Awesome work, by the way!!!

Best

@mattflor
Copy link
Owner

What you mean? Group labels are rotated already perpendicular to the group arcs, just like in the SO question.

@mviertel
Copy link
Author

I was just wondering whether I have control over the rotation. I´d like to have them horizontal to the arcs like in the left graph.

@mattflor
Copy link
Owner

I see. I'm sorry that's not possible at the moment.

@mviertel
Copy link
Author

mviertel commented Apr 24, 2016

Thanks for the info!

I have one more and final question: Have you experienced that the tooltips seem to be getting misplaced in shiny apps if you need to scroll down to reach the plot. I added a minimal example and a screenshot.

Any Ideas?

ui.r:

require(shiny)
require(shinydashboard)
require(shinythemes)
require(chorddiag)

if (interactive()) {
  header <- dashboardHeader()

  sidebar <- dashboardSidebar(
    sidebarMenu(
      # Setting id makes input$tabs give the tabName of currently-selected tab
      id = "tabs",
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard"))
    )
  )
  body <- dashboardBody(
    tabItems(
      tabItem("dashboard",
              div(p("Dashboard tab content"),
                  fluidRow(
                    box(height = "600px",
                        "bla")
                  ),
                  fluidRow(
                    column(3,
                           sliderInput("margin", "Margin",  min = 0, max = 200, value = 100),
                           sliderInput("groupnamePadding", "Group Name Padding",  min = 0, max = 100, value = 30),
                           checkboxInput("showTicks", "Show Ticks", value = TRUE)
                    ),
                    box(
                      title = "Plot",
                      chorddiagOutput('chorddiag', height = '600px')
                    )
                  ))
      )
    )
  )
dashboardPage(header, sidebar, body)
}

Server.r:

require(shiny)
require(shinydashboard)
require(shinythemes)
require(chorddiag)

m <- matrix(c(11975,  5871, 8916, 2868,
              1951, 10048, 2060, 6171,
              8010, 16145, 8090, 8045,
              1013,   990,  940, 6907),
            byrow = TRUE,
            nrow = 4, ncol = 4)
groupNames <- c("black", "blonde", "brown", "red")
groupColors <- c("#000000", "#FFDD89", "#957244", "#F26223")

row.names(m) <- groupNames
colnames(m) <- groupNames


server<-function(input, output) {
  output$chorddiag <- renderChorddiag(
    chorddiag(m
              #groupColors = groupColors,
              #groupnamePadding = input$groupnamePadding,
              #showTicks = input$showTicks,
              #margin = input$margin
    )
  )
}

image

@mattflor
Copy link
Owner

I just commited a fix for the placement issue, so just install the latest version. Let me know if it works for you.

@mviertel
Copy link
Author

Works like a charm!! Thanks a lot!

@YubinXie
Copy link

I am also hoping to be able to make the label to be horizontal; it is really hard to read perpendicular text.
(Thanks for your great package!)

@Mohsin0911
Copy link

Hi!
please guide me
same question like
its possible to rotate group labels: and ##how to save as 3d form ##
this is my script
`library(chorddiag)

data<- read.csv("C:/Users/Hp/Desktop/final chord diagram 16 s.csv", sep=",", header = T, row=1)

my.data <-as.matrix(data)

row.names(my.data) <- c("HL", "HR", "ML", "MR", "LL", "LR", "RL", "RR")

colnames(my.data) <- c("Alphaproteobacteria", "Betaproteobacteria", "Gammaproteobacteria",
"Actinobacteria", "Firmicutes", "Bacteroidetes",
"Others")

groupColors <- c("orange", "maroon","cyan", "salmon","sienna1", "skyblue", "gold", "pink","chocolate", "red", "grey", "green","brown", "blue", "purple")

chorddiag(my.data,type = "bipartite", showTicks = T,tickInterval = 5 ,groupColors = groupColors ,
groupnameFontsize = 15,grop_ ,groupnamePadding = 20, margin = 100
Rplot05
)
`
thanks in advance

@pedro-longhin
Copy link

I see. I'm sorry that's not possible at the moment.

is this option still not available? i want to rotate the labels, but they are automatic going to perpendicular position.

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

5 participants