Open karldw opened 4 years ago
I'd like to bump this issue. It is a shame that development of revealjs seems to have stopped entirely (presumably due to the popularity of xaringan). While I think xaringan is great (especially when combined with the excellent xaringanExtra and xaringanthemer), the underlying presentation framework of reveal.js is far superior to remark.js - not only in functionality but in simple things like properly handling font scaling etc. While remark.js seems simpler at face value, the second you want to do something more fine controlled it really struggles in comparison with reveal.js. I'd love to see more active development of revealjs as a result.
Hi @karldw & @py9mrg,
On my fork, I upgraded to 4.1.0 and added all the config options available in reveal.js 4.1.0. I haven't had the chance to test them all, but if you want to help/collaborate with the testing of each config, that would make the process faster and it would be great!
See my repo here. You can install the packages using devtools:
# install.packages("devtools") # uncomment this line to install the devtools package.
devtools::install_github("samguay/revealjs")
Cheers
Hello @SamGuay ,
That's excellent - thanks a lot. At the minute I've kind of given up on both revealjs and xaringan because of the issues I mentioned, my company has just completely its layout and I don't have the time to rewrite all the CSS to match, and because too many of my work colleagues want Google Slides so they can collaborate/comment (not many people where I work use anything outside of G Suite - and yes, having to manually update, reinsert and reposition plots every time they want a minor change is soul destroying). If I manage to find some time I'll give it a go and let you know. Either way great work and I'm sure eventually I'll get to giving it a go eventually!
@SamGuay -- nice! I don't have time right now to review this in detail, but why not open a pull request to import your changes to the main repo?
One small thing I noticed was your fork pulling fonts from google. I think this project tries to serve fonts itself so the presentation works offline. It might be worth changing those font imports.
Thanks for the feedback :).
As said in #84, I will make it cleaner and make sure all previous standards are met before making a PR. I'll make sure that everything works offline, which I haven't had the chance to do yet.
PS: @py9mrg, I feel you, same here when collaborators are involved!
Hello @SamGuay ,
Managed to get some time to do some quick tests and no problems for me. I haven't been very thorough but I did actually notice a huge improvement - reactable tables actually work, now!
I'll elaborate my point in case anyone else has a similar issue. Another reason why I tended to choose revealjs over xaringan was because the latter doesn't play well with interactive tables - as in tables with a search box - because all the keyboard shortcuts are still active. If you're searching for something with an m in its name your slide immediately mirrors, or a b and it goes blank - not exactly a smooth experience (I understand this is an issue with remark, really). But with revealjs it just works - keyboard shortcuts get deactivated as soon as you click in the search box.
The one problem with revealjs was that it must do some funky CSS trickery that doesn't play nicely with reactable (or DT for that matter) and the fonts are horribly huge. It's not clear to me why because manually setting everything I can think of h1, p etc etc don't do anything - only changing the main font does - but then that kills all the other formatting in the reactable table (e.g. headers are no longer bold) and almost none of the reactable theme options get respected.
But... with your update that's (sort of) all fixed. Out of the box reactable fonts are still all horribly huge (whereas in xaringan they look nice straight away) but at least you can manually theme the table and these options are now respected. Which is brilliant.
Thanks for the feedback!
I have improved on my local version and found some ways to improve DT tables and interactive HTML widgets with the Zoom option enabled. I haven't had the time to push it and clean it yet, but once my PhD comprehension exam is done, I'll definitely improve it!
If you need to embed some DT tables, the easiest way I found is to save your widget independently and load them in an Iframe. Not the best workflow, but it did work for my presentation last week, with proper formatting and all!
Yeah I used to use frameWidget from the widgetframe package in xaringan but (a) edit it doesn't work any more! only works when not self contained (I didn't notice I had that option set) and (b) all the CSS gets ignored. There are other ways around it, like you say manually doing iframes but it becomes very messy (and, more importantly, I'm lazy).
But now, with your update, I can simply add something like:
reactable(data, theme = reactableTheme(
tableBodyStyle = list(fontSize = "10px"),
headerStyle = list(fontSize = "20px"),
...)
# if you want to be super lazy and don't mind the same font size in body and table then:
reactable(data, style = list(fontSize = "10px"))
and the font sizes are fixed without killing the font family, weight etc etc and without having to worry about iframes.
Nice, thanks for the tips! I love taking the lazypath whenever I can!
I would really like to use navigationModen: linear
but this does not seem to work in the cran version. Is there anything I can test to make more options available sooner?
@ShKlinkenberg, I think for now the easiest way to do this would be to try out @SamGuay's fork. Samuel asked for testing/feedback in one of the comments above. If you notice issues, please bring them up!
To install that fork:
# install.packages("remotes") # uncomment this line to install the remotes package.
remotes::install_github("samguay/revealjs")
The README says "Reveal.js has many additional options to conifgure it's behavior. You can specify any of these options using
reveal_options
". reveal.js has added a number of options between the current release (4.0.0, May 2020) and the version included in the CRAN release (3.3.0, Apr 2016). It would be helpful to have a list of options that work.The full list of options is here: https://revealjs.com/config/ Looking at the release notes, it looks like the new, unavailable options are:
embedded
(4.0.0)keyboardCondition: 'focused'
(4.0.0)mobileViewDistance
(3.9.0)navigationMode
(3.8.0)hash
(3.8.0)preloadIframes
(3.8.0)math
(3.8.0)pdfSeparateFragments
(3.7.0)fragmentInURL
(3.7.0)hashOneBasedIndex
(3.7.0)controlsTutorial
(3.6.0)autoSlide
(3.6.0)display
(3.5.0)