In this chapter I will collect all the tasks still to do.
The lists will not only cover things to do for this book, but also other more general issues I came about working on this book. The task list will be divided into different subjects:
Book content: ToDo list for this book covering all content tasks, like missing chapters, text modules, bibliographies, references, links etc. This section also includes the polishing of text passages in grammar and style, improving arguments with a better text structure, more understandable graphics, etc. I have also edited a section with my own challenges, i.e., exercises their idea came up when I worked with an example.
Book appearance: Creating colored and numbered textboxes for different subjects by adapting the CSS for this book and/or using Quartos layout facilities.
Shiny: List of things to learn even if those subjects are not the scope of this book. This includes not only the shinylive extension and the {shinylive} package using here in this book, but also the many packages supporting Shiny, helper in the Shiny universe.
Quarto: Researching Quarto functionality to enhance this book but also more general to improve my knowledge about Quarto. This includes Quarto extension, static and dynamic formats for Quarto, R Markdown, including with type setting systems like Typst/TyX or LyX. Applying interactivity and animation with other packages like {leaflet}, {plotly}, {htmlwidgets}, but also using JavaScript, JavaScript frameworks like Observable JS and more.
R: Last but not least I stumble often over new R functions and packages that I should investigate more in detail.
Miscellaneous:If I sometimes do not know definitely in which category one task belongs I will guess it and add it to the miscellaneous task list. This duplicate will get a reference to the subject oriented lists and vice versa.
Important D.1
My aim is to clean up all tasks under Book content and Book appearance and to transfer the other todo list to my other relevant note-books.
D.1 Book content
D.1.1 All chapters
D.1.2 Index file
D.1.3 Chapter 03
D.1.4Chapter 07
D.1.5 Annex “packages used”
Add the following packages:
D.1.6 Annex “extensions used”
D.1.7 Clean & Check
D.1.8 Errors to investigate
D.1.9 Missing exercises
D.1.10 My own challenges
Mandatory and voluntary improvements
Marked challenges are important as they are part of the original book and currently not working for me. The other challenges are personal interesting exercises but not part of “Mastering Shiny”.
D.2 Book appearance
D.2.1 CSS
D.2.2 Quarto
D.3 Shiny
D.4 R
D.5 Quarto computation
Quarto vs shinylive cache
While Quarto’s caching is primarily for managing the execution of code chunks within a document, shinylive’s caching is more about managing the web assets required to run Shiny applications in a browser. This means that the caching strategies and mechanisms are tailored to their respective purposes: Quarto focuses on document rendering efficiency, while shinylive focuses on the efficient delivery and execution of Shiny applications in a web environment functions.
D.6 Miscellanoeus
D.6.1 Related with this book
D.6.2 Not related with this book
D.7 Providing addtional indices
It would be nice to have different indices to look and find various types of content. For instance it would be helpful to get a listing of all warnings or all code chunks listings. I have thought about several posibilities:
Using TextSniper to copy the results of RStudio “Find In Files” into a Quarto document and editing manually. This is a solution I could apply immediately, but it needs a lot of manual work. I need to copy and paste the listing code.
{sifr} works for me! This is the best option! But I need to change for my search the default file extension for different R and other programming code file extension to ".*\\.qmd$". The command is options(sifr.path_pattern = ".*\\.qmd$") It works for me only with the first parameter pattern whenever I use from the root level of my R project, but it may be helpful to add recursive = FALSE. (fixed = TRUE, e.g. matching the string as-is did not work) The function generates Markers in RStudio to get to the code of line directly, but it also stores the result in an R object type sif_result — a kind of data.frame.
I could do some extra coding and provide a wrapper to generate the markdown code lines from the sif_result objects by converting it with tibble::as_tibble(x) to a tibble and the extracting the part in the curly brakes (e.g., #lst-03-greeting-example) and as final step to replace # with @. (If you clean up the lst-lines then you have fixed position to delete: 1-5 and the last. pos 6 — or after deleting the first — has to be changed into @.)
---execute: cache: true---# ToDo List {#sec-annex-todo}```{r}#| label: setup#| results: hold#| include: falsebase::source(file ="R/helper.R")library(glosario)ggplot2::theme_set(ggplot2::theme_bw())options(show.signif.stars =FALSE)```::::: {#obj-todo-list}:::: {.my-objectives}::: {.my-objectives-header}Objectives:::::: {.my-objectives-container}In this chapter I will collect all the tasks still to do. The lists will not only cover things to do for this book, but also other more general issues I came about working on this book. The task list will be divided into different subjects:- **Book content**: ToDo list for this book covering all content tasks, like missing chapters, text modules, bibliographies, references, links etc. This section also includes the polishing of text passages in grammar and style, improving arguments with a better text structure, more understandable graphics, etc. I have also edited a section with my own challenges, i.e., exercises their idea came up when I worked with an example.- **Book appearance**: Creating colored and numbered textboxes for different subjects by adapting the `r glossary("CSS")` for this book and/or using Quartos layout facilities.- **Shiny**: List of things to learn even if those subjects are not the scope of this book. This includes not only the `shinylive` extension and the {**shinylive**} package using here in this book, but also the many packages supporting Shiny, helper in the Shiny universe.- **Quarto**: Researching Quarto functionality to enhance this book but also more general to improve my knowledge about Quarto. This includes Quarto extension, static and dynamic formats for [Quarto](https://r4ds.hadley.nz/quarto-formats), [R Markdown](https://rmarkdown.rstudio.com/), including {{< latex >}} with type setting systems like [Typst](https://typst.app/)/[TyX](https://tyx-editor.com/) or [LyX](https://www.lyx.org/). Applying interactivity and animation with other packages like {**leaflet**}, {**plotly**}, {**htmlwidgets**}, but also using JavaScript, JavaScript frameworks like [Observable JS](https://quarto.org/docs/interactive/ojs/) and more.- **R**: Last but not least I stumble often over new R functions and packages that I should investigate more in detail.- **Miscellaneous**:If I sometimes do not know definitely in which category one task belongs I will guess it and add it to the miscellaneous task list. This duplicate will get a reference to the subject oriented lists and vice versa. ::: {.callout-important #imp-annex-todo-objective}My aim is to clean up all tasks under Book content and Book appearance and to transfer the other todo list to my other relevant note-books.:::::::::::::::## Book content {#sec-annex-todo-book-content}### All chapters- [ ] add glossary list and sessions_info- [ ] revise/write all **chapter objectives** (overviews)- [ ] add for all code chunk a reference for listings/outputs.- [ ] add as summary my own résumé. (The summaries in the MS-book is very general and useless. They just mention the main sections of the chapter and function most of all as a bridge passage to the next chapter.- [ ] add for all types of numbered callouts a table of content. Where and how? (First reflection in @sec-annex-provide-additional-indices)- [ ] add references to Hadley live demos (where and how?) --- look for `https://hadley.shinyapps.io` to get a listing of all appearances in the original book. Collect these reference per chapter (see my first reflection how to do this listing in @sec-annex-provide-additional-indices). Where? Maybe in the starting objective callout box?- [ ] comment all apps and describe their function, so that you can use it independently of the book. Make an explicit reference to the book, so that you can find the book passages explaining the app. Provide URLs if available. It would be helpful to develop a snippet for this task. Snippet code: `###`.- [ ] revise all apps-XX folders: rename folder and add comments (name, purpose etc.) An example can be found in "apps09/download-report-github/app.R"- [ ] reference packages to their package profiles- [x] ~~delete in the code chunks all lines with `library(shiny)` and add it for each chapter only once in the setup chunk.~~ [setup chunk does not work with shinylive-r standalone = TRUE]{.mark}. - [ ] delete all `shiny::<function()>` references, but keep or add all the other package references. Add/keep `shiny::` if it could be confused with another package just mentioned.- [ ] change all code examples in the first three chapters to see Shiny in a horizontal section and not in an additional tab.- [ ] change the reference to external R file(s) (applying what I have learned from my [Posit post](https://forum.posit.co/t/shinylive-r-cannot-include-r-file/202123/6). Create and use all `apps_XX` folders with shiny apps and include them in the `shinylive-r` chunks. This has the big advantage that I can develop real Shiny app and use them in shinylive with only one source code.- [ ] Extract all shinylive workarounds to my new file `R/shinylive.R` and embed this function into the `shinylive-r` snippets.- [ ] wait for an answer to [my question on Posit](https://forum.posit.co/t/shinylive-r-with-renderimage/202516) about displaying images with shinylive.- [ ] use [Grammarly App](https://www.grammarly.com/desktop/mac) and [Grammarly browser extension](https://www.grammarly.com/browser) to get better English- [ ] Starting with chapter 08 change all `shinylive` chunks to comment file references with include shortcodes.- [ ] clean text from the first person order to facilitate the differences between book text and my comment. "I" should only used for my personal comments, not for text of "Mastering Shiny".### Index file- [ ] describe method for `<package>::<function()>` references- [ ] describe method to develop Shiny apps and their usage in the Quarto code chunks. This includes also the usage of the apps-XX directories.- [ ] explain external functions used in "R/helper"- [ ] explain text bookmarks like `@XXX_<section_number>`- [ ] explain that I have used the native pipe (and the consequences)- [ ] explain using of snippets and provide source for callout blocks.- [ ] warn that first div block (`:::`) needs empty line before and last div block after it.- [x] explain why I used copy & paste from the original source without quoting- [x] explain how to distinguish between my comments and the original "Mastering Shiny" source.- [x] provide an example of (slightly changed) text passages from the original and my own personal comments.- [ ] explain that I have used throughout the text American English, e.g., I changed `colour` to `color` and `generalisation` to `generalization`.### Chapter 03- [ ] finish my own summary of `@sec-chap03` about reactive expressions### ~~Chapter 07~~- [x] explain solution and present solution for the failed image rendering code chunk under @@cnj-07-render-images-failed### Annex "packages used"- [x]`citeproc` in "Packages used" (@sec-annex-packages-used)- [x] Clean it from previous note book- [x] Update it to contain all the packages already mentioned or used- [x] Add {**withr**}, {**progress**} and {**shinycssloaders**}- [ ] It would nice to have links to the package usage in the text, but that would be a lot of work. I could find these text passages by looking for `{**` strings or developing a `grep()` function for the text search.- [x] Mark those package that are essential for learning shiny (and the Mastering Shiny book). Use [standard marks for the header!]{.mark}). This has the advantage that you can see the emphasis also in the table of content on the right side.Add the following packages:- [ ] brickr- [ ] base64enc- [ ] datasets- [ ] gapminder- [ ] ggforce- [ ] lorem- [ ] openintro- [ ] R6- [ ] rwasm- [ ] shinyWidget- [ ] sysfonts- [ ] webR### Annex "extensions used"- [ ] Prepare annex chapter with a list of the extension used: - [ ] include-code-files (currently not used in this book!) - [ ] section-bibliographies - [ ] shinylive - [ ] base64### Clean & Check- [x] internal links/references if a chapter is finished- [x] do not commit test files in the "learning-shiny" directory. Starting their names with `test-` will ignore them.- [ ] remove these test-files resp. copy them to the `_archive` folder.### Errors to investigate- [ ] Downloading reports: {@sec-09downloading-reports-standard}- [ ] Downloading reports: {@sec-09downloading-reports-callr}- [x] Reference to other files (e.g., R Code) with `## File: app.R` etc.- [x] Render image {@sec-07-images} with quarto extension### Missing exercises- [ ] @sec-04-exercises- [x] @sec-chap06-5_4_exercises- [ ] Exercise @sec-10-choose-geom-advanced 10.2.3: the third (the last one)- [ ] @sec-10-exercises3 10.3.5 all five- [ ] @sec-11-exercises 11.3: all two### My own challenges::: {.callout-note}###### Mandatory and voluntary improvementsMarked challenges are important as they are part of the original book and currently not working for me. The other challenges are personal interesting exercises but not part of "Mastering Shiny". :::- [ ] experiment with actionButtons in @sec-02-action-buttons- [ ] start and reset button "Progressive updates" (@cnj-08-progressive-updates)- [x][load multiple files]{.mark}: @lst-09-multiple-uploaded-files (wrong) @lst-09-multiple-files-uploads (corrected)- [ ][pre-filter the list of datasets]{.mark} to get only data frames in @cnj-09-downloading-data- [x][load external file programmatically]{.mark} (without using `fileInput()`): @wrn-10-upating-nested. This was a silly error of mine. See my posting at the [Posit forum](https://forum.posit.co/t/shinylive-in-quarto-document-with-reactive-data-source/204237/3?u=petzi53).- [ ] force dot `.` as decimal separator independent of the browser used. {**shinyWidget**} with `formatNumericInput()` and `autonumericInput()` is not working for my case, because it does not provide up/down buttons. There are several approaches- [ ] In @sec-12-example-ggplot2 let user select the dataset - [ ] In @sec-12-example-ggplot2 provide methods and formula for the `smooth` geom.## Book appearance {#sec-annex-todo-book-appearance}### CSS- [x] resource box needs more space at the top (padding-top)- [x] limit right margin of boxes inside boxes with `padding-right: 10px` in container- [ ] get correct header for numbered box without preset theorem variation (black instead of grey and in line with the number, at the moment the title is one line lower than the number) Ask at StackOverflow?- [ ] reorganize my callout boxes- [x] create annex about all my boxes in the CSS file (but also the snippets in RStudio)### Quarto {#sec-annex-todo-quarto}- [x] small check mark boxes at the beginning of the line (See [Markdown Basics: Lists](https://quarto.org/docs/authoring/markdown-basics.html#lists))- [x] how to put ticks in these check mark boxes interactively (disappears after page reloading)- [ ] better font for plot axes - [ ] use [diagrams](https://quarto.org/docs/authoring/diagrams.html) for developing reactive graphs - [ ] how and when to use screenshots / graphics with 3D-margin but still working with [lightbox](https://quarto.org/docs/output-formats/html-lightbox-figures.html)- [ ] **Check Zotero quotation** of this book but also of my other books. There is something wrong with the citations. sometimes it refers to other article (see [t-test chapter](https://bookdown.org/pbaumgartner/swr-harris/) or it is not a correct citation (as in this book). There should be a systematic approach for Quarto books, maybe different from bookdown books.## Shiny {#sec-annex-todo-shiny}- [x] How to source external files for `shinylive` extension (See [Posit answer](https://forum.posit.co/t/shinylive-r-cannot-include-r-file/202123/8))- [ ] How to work in `shinylive` with external images: via an [URL to an external website](https://forum.posit.co/t/shinylive-r-with-renderimage/202516/10), but I believe there is another solution with local images too. May the problem is related with the {**shinylive**} package (not the extension)- [ ] Change localization. (At the moment my Shiny UI requires `121,8` instead of the English localization `121.8`)## R {#sec-annex-todo-r}- [x] Report {**glossary**} issue when [content of a term is part of another term](https://github.com/debruine/glossary/issues/11) - [ ] Look into the glossary repo from time to time until the issue will be (hopefully) solved.- [ ] Explore the glossary package to see if and how one could write long entries with several paragraphs. - [ ] Look into [Posit Connect Cloud](https://connect.posit.cloud/)## Quarto computation- [x] how to use cache to make the rendering process of this book faster: It seems that this is not possible, as shinylive-r chunks use a different mechanism and are not eligible for Quarto cache:::: {.callout-note}###### Quarto vs shinylive cacheWhile Quarto's caching is primarily for managing the execution of code chunks within a document, shinylive's caching is more about managing the web assets required to run Shiny applications in a browser. This means that the caching strategies and mechanisms are tailored to their respective purposes: Quarto focuses on document rendering efficiency, while shinylive focuses on the efficient delivery and execution of Shiny applications in a web environment functions.:::- [ ] how about the {**munsell**} package problem with {**ggplot2**}## Miscellanoeus### Related with this book- [ ] Learn the more modern UI of {**bslib**} to create the user interface (UI) for Shiny apps.- [ ] Look at the [list of awesome shiny extensions](https://github.com/nanxstats/awesome-shiny-extensions)- [ ] Investigate where the `.callout` selector for `report` snippet comes from? From Bootstrap?- [ ] By this occasion try to [apply features of the Bootstrap framework]{.mark} not only for boxes but also for adapting UI appearances of Shiny (and other Quarto websites)! - [x] Download Google fonts as repo that can be updated easily. (See <https://www.junian.net/tech/macos-google-fonts/>)### Not related with this book- [ ] Explore if [GitHub Copilot](https://github.com/features/copilot) is useful for me. - [ ] Read [Rstudio User Guide](https://docs.posit.co/ide/user/ide/guide/tools/copilot.html) to GitHub Copilot - [ ] Read [How to use GitHub Copilot in RStudio](https://tilburg.ai/2023/12/github-copilot-rstudio/) - [ ] Read [GitHub Copilot in RStudio and VS Code](https://tilburgsciencehub.com/topics/automation/ai/gpt-models/github-copilot/) - [ ] Read article from the GitHub Blog: [How to use GitHub Copilot](https://github.blog/ai-and-ml/github-copilot/what-can-github-copilot-do-examples/) with examples- [ ] Hypothes.is preparation to get highlighted data similar to Zotero. Write an R package? (see Hypothes.is [Tools, Plug-ins and Integration](https://web.hypothes.is/tools-plug-ins-and-integrations/))- [ ][{**hypothesis**}](https://r-world-devs.github.io/hypothesis/index.html): add, share and manage annotations for Shiny applications and R Markdown documents. See also [GitHub repo](https://github.com/r-world-devs/hypothesis). Last update 2 years ago.- [ ][{**hypothesisr**}](https://github.com/mdlincoln/hypothesisr): Wrapper for the Hypothes.is API. Last update 6 years ago. Public archived, Aug 30, 2019, no out of date. Recommends {**rapiclient**}.- [ ][{**rapiclient**}](https://github.com/bergant/rapiclient): Dynamic Open API (Swagger) Client for R.## Providing addtional indices {#sec-annex-provide-additional-indices}It would be nice to have different indices to look and find various types of content. For instance it would be helpful to get a listing of all warnings or all code chunks listings. I have thought about several posibilities:1. Using TextSniper to copy the results of RStudio "Find In Files" into a Quarto document and editing manually. This is a solution I could apply immediately, but it needs a lot of manual work. I need to copy and paste the listing code. 2. The very promising {**findInFiles**} package does not work (See: [findInFiles returns always "no results"](https://github.com/stla/findInFiles/issues/5))3. There are several [proposal for R functions](https://stackoverflow.com/questions/45502010/is-there-an-r-version-of-rstudios-find-in-files) using `r glossary("regex")`4. {**sifr**} works for me! **This is the best option!** But I need to change for my search the default file extension for different R and other programming code file extension to `".*\\.qmd$"`. The command is `options(sifr.path_pattern = ".*\\.qmd$")` It works for me only with the first parameter `pattern` whenever I use from the root level of my R project, but it may be helpful to add `recursive = FALSE`. (`fixed = TRUE`, e.g. matching the string as-is did not work) The function generates Markers in RStudio to get to the code of line directly, but it also stores the result in an R object type `sif_result` --- a kind of data.frame. I could do some extra coding and provide a wrapper to generate the markdown code lines from the `sif_result` objects by converting it with `tibble::as_tibble(x)` to a tibble and the extracting the part in the curly brakes (e.g., `#lst-03-greeting-example`) and as final step to replace `#` with `@`. (If you clean up the lst-lines then you have fixed position to delete: 1-5 and the last. pos 6 --- or after deleting the first --- has to be changed into `@`.)