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

Alluvial Chart Colorization Documentation #50

Closed
brichard1638 opened this issue Feb 9, 2022 · 5 comments
Closed

Alluvial Chart Colorization Documentation #50

brichard1638 opened this issue Feb 9, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@brichard1638
Copy link

It is not clear how to change the colorization of the Alluvial streams in an Alluvial chart. Can you provide additional documentation code specific to chart colorization, and more specifically, an Alluvial chart?s? Code samples should be specific, not just a reference made to a general argument list. If it is not possible to change the color, would you consider adding an argument to change alluvial color streams?

@chris-demartini
Copy link
Contributor

For color of links you will want to use linkConfig.fillMode prop provided. You can find it and other documentation on available props in the readme for alluvial here: https://github.com/visa/visa-chart-components/tree/main/packages/alluvial-diagram#link-props

@chris-demartini chris-demartini added the documentation Improvements or additions to documentation label Feb 10, 2022
@brichard1638
Copy link
Author

brichard1638 commented Feb 10, 2022 via email

@fkohrt
Copy link

fkohrt commented Feb 11, 2022

Hi @brichard1638, using the example provided in the documentation, this is how you use a custom color for every source:

data.frame(HairEyeColor) |>
  dplyr::filter(Sex=="Female") |>
  dplyr::mutate(newHair = paste(Hair,"-Hair")) |>
  dplyr::mutate(newEye = paste(Eye,"-Eye")) |>
  visachartR::alluvial_diagram(sourceAccessor = "newHair",
                               targetAccessor = "newEye",
                               valueAccessor = "Freq",
                               linkConfig = list(visible = TRUE,
                                                 fillMode = "source",
                                                 opacity = 0.9),
                               colors = palette.colors(palette = "Set 2"))

Note that it's nice to use a color-vision deficiency friendly color palette, see e.g. "A New palette() for R". Also, if you post R code in GitHub issues, please format it accordingly.

@chris-demartini In this example it is strange how the table representation of the graph lacks numbers. Is that supposed to happen?

visachartR

@brichard1638
Copy link
Author

brichard1638 commented Feb 11, 2022 via email

@chris-demartini
Copy link
Contributor

The color question was answered above and the data table bug was fixed with release 6.1.0. closing this item out.

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

No branches or pull requests

3 participants