-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feature request: trelliscope support for sepia and night mode in bookdown #103
Comments
Hi @stefvanbuuren - After creating the example display and updating all elements to have no background, I don't see the desired effect. Can you provide a screenshot of what it a "correct" plot should look like? In general I have been wanting to add the ability for users to provide custom style specifications. Doing this properly will take some time though. In the mean time, I think this issue is addressable by making all whitespace have no background, as I don't see how this as a default setting would have an adverse effect on anything else. |
My thinking is that the data area, the plot margin and selected trelliscope panels could be made transparent. If the reader changes bookdown background changes to sepia/dark, then sepia/dark would shine through in the plots. In the figure below, I have tried to draw what the figure could look like if my background color is yellow3 (sepia is not an R color). I failed because I do not know how to change some of the backgrounds to transparent, the cross-hatched areas. So ideally these should also be transparent, and show the bookdown sepia/dark coloring set by the reader. |
Ah I see now! So you are talking about a background color behind the entire embedded display. Are you embedding your displays as iframes in your book? If so, I'm not sure if this is possible. |
I use knitr::include_url(url = "https://d-score.org/dbook-apps/p-d-equate-1339/#display=Percent_pass_by_D_score__four_models&nrow=2&ncol=2&arr=row&pg=65&labels=equate,model&sort=equate_index;asc,model;asc&filter=&sidebar=&fv=", height = "450px") |
I see. Can you point me to an example of the output so I can inspect? You had shared this link before but I'm getting a 404: https://stefvanbuuren.name/dbook2/section-sec-impactequate.html |
Ah yes, sorry. It's now moved it to https://d-score.org/dbook2/section-sec-impactequate.html . |
That's progress. I will need to look into the transparency of the plots. |
I checked and regenerated, but the plots were already transparent.
|
I went in and manually disabled all background colors in the Trelliscope display but the images do not appear to be transparent. To double check, I right-clicked on the first graph in the Trelliscope display and chose "Download Image" and opened it in an image editor to confirm that it doesn't have a transparent background. |
I use transparent colors to blend
ggplot2
andplotly
figures into sepia and night modes inbookdown
documents. See for example https://d-score.org/dbook1/sec-aged.html, and switch to sepia and night mode.In
trelliscopejs
this approach doesn't work (e.g. https://d-score.org/dbook2/section-sec-impactequate.html). The background of trelliscope figure is solid white, which blocks any transparent color settings in the figures.My question: Would there be a simple trick to change the solid white into transparent?
Here's a short demo code that I use to sets transparent colors in
trelliscopejs
:I would like all white areas to become transparent, whereas any coloured areas (left navigation bar, bottom sort bar, trelliscope logo) should retain their colouring. Is that possible by setting some styles?
The text was updated successfully, but these errors were encountered: