mattflor / chorddiag

R interface to D3 chord diagrams
158 stars 44 forks source link

Setting tick interval leads to tick label error #6

Closed dkyleward closed 7 years ago

dkyleward commented 7 years ago

If I leave the tick options alone, everything looks OK, but if I modify your README example to include the tickInterval option, the tick labels default to 25,000. I don't see a tickLabelInterval option, but it seems like the behavior just needs to match the tickInterval. Great package by the way!

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)
haircolors <- c("black", "blonde", "brown", "red")
dimnames(m) <- list(have = haircolors,
                    prefer = haircolors)

library(chorddiag)
groupColors <- c("#000000", "#FFDD89", "#957244", "#F26223")
chorddiag(m, groupColors = groupColors, groupnamePadding = 20, tickInterval = 5000)

image

dkyleward commented 7 years ago

It appears I didn't understand the issue, exactly. The labels actually get set to 5x whatever the tick interval is. (You get a label every five ticks.) I can work with that, but it might be nice to be able to customize that behavior. Thanks again.