Skip to content

Commit

Permalink
Merge pull request #75 from pharmaverse/webr_enhancements
Browse files Browse the repository at this point in the history
enhance plot labels; remove large binary before deploy
  • Loading branch information
rossfarrugia authored Sep 2, 2024
2 parents 6a0ac27 + 90988f7 commit b9cc207
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ jobs:
with:
to: html

# temporary!
# remove this step if closed (& relleased): https://github.com/quarto-ext/shinylive/issues/59
- name: Remove large WebR assets 🧹
run: |
packages_path <- sprintf("./_site/site_libs/quarto-contrib/shinylive-%s/shinylive/webr/packages", shinylive::assets_version())
# remove the dirs with size > 100 MB
for (x in list.dirs(packages_path)) {
x_files <- file.info(list.files(x, full.names = TRUE))
if (any(x_files$size > 100 * 1024^2)) {
print(x)
print(x_files)
unlink(x, recursive = TRUE)
}
}
# refresh the `metadata.rds` file
metadata_path <- file.path(packages_path, "metadata.rds")
metadata <- readRDS(metadata_path)
new_metadata <- metadata[intersect(names(metadata), list.dirs(packages_path, full.names = FALSE))]
saveRDS(new_metadata, metadata_path)
shell: Rscript {0}

- name: Publish docs
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
Expand Down
6 changes: 5 additions & 1 deletion interactive/teal.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ app <- init(
output$hist <- renderPlot({
req(input$var)
hist(x = data()[["iris"]][[input$var]])
hist(
x = data()[["iris"]][[input$var]],
main = sprintf("Histogram of %s", input$var),
xlab = input$var
)
})
},
ui = function(id) {
Expand Down

0 comments on commit b9cc207

Please sign in to comment.