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 the whole diagram #38

Open
yuliaUU opened this issue Jun 1, 2020 · 2 comments
Open

rotate the whole diagram #38

yuliaUU opened this issue Jun 1, 2020 · 2 comments

Comments

@yuliaUU
Copy link

yuliaUU commented Jun 1, 2020

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)

Is it possible to rotate the entire plot, so that, for instance, the category black started at 90 degrees but maybe 180?

@mattflor
Copy link
Owner

mattflor commented Aug 2, 2020

Currently, that is not possible.

@petehilljnr
Copy link

I know this is 2.5 years old but ...
I think this can be achieved by adding a rotation parameter to the widget, then using that on line 133 of chorddiag.js:

svg.attr("transform", "translate(" + xTranslate + "," + yTranslate + ") rotate(" + ROTATION_PARAM +")");
It should rotate all the underlying objects.

Pete

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

3 participants