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

Separate Dark/Light Text Colours in Legend #56

Closed
ciflikli opened this issue Jan 25, 2018 · 9 comments
Closed

Separate Dark/Light Text Colours in Legend #56

ciflikli opened this issue Jan 25, 2018 · 9 comments

Comments

@ciflikli
Copy link

Similar to this implementation in statebins (explained in the second code chunk in Downsizing) is it possible to supply different text colours to the legend to maximise legibility? For example, in the below example, light colours would keep the black text, but the darker shades would get white:

sunburst

@cjyetman
Copy link
Collaborator

Here's the relevant code @hrbrmstr uses in statebins to switch from 'dark' or 'light' text.

@ciflikli
Copy link
Author

Thanks for pointing that out. However, sunburstR doesn't create a ggplot object, right? How would you use that function to change the text colour here? If I assign the above plot to an object, I get sunburst, htmlwidget as class and it returns a list.

@cjyetman
Copy link
Collaborator

That wasn't meant as a tip to resolve your immediate problem. It was a tip to @timelyportfolio or possibly future me for a way to integrate this into the package.

@timelyportfolio
Copy link
Owner

timelyportfolio commented Jan 26, 2018

@ciflikli, thanks so much for the expression of interest, and I agree this would be a nice feature. Your screenshot looks very nice. There are tools that make this fairly straightforward to implement, and I will look to add soon. As always, thanks @cjyetman for helping with the package and issues.

@ciflikli
Copy link
Author

Sounds great, @timelyportfolio. @cjyetman sorry if I sounded a tad brash earlier, I was just confused.

@timelyportfolio
Copy link
Owner

I think 565958b adds this functionality. @ciflikli, will you test with devtools::install_github("timelyportfolio/sunburstR") and let me know if the change works as expected?

@ciflikli
Copy link
Author

ciflikli commented Jan 29, 2018

I can confirm it works as advertised!
new

@timelyportfolio
Copy link
Owner

Great, I will try to submit to CRAN this week after a couple more rounds of testing.

@timelyportfolio
Copy link
Owner

@ciflikli, on CRAN now, so will close but please feel free to reopen.

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