Skip to content

Commit

Permalink
update GitHub Action and docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgnbhl committed May 26, 2024
1 parent 86185e3 commit fb8bff6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 72 deletions.
77 changes: 24 additions & 53 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -20,62 +20,33 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
7 changes: 3 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ output: github_document

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/scroller)](https://CRAN.R-project.org/package=aniview)
[![pipeline status](https://gitlab.com/lgnbhl/scroller/badges/master/pipeline.svg)](https://gitlab.com/lgnbhl/scroller/pipelines)
[![R build status](https://github.com/lgnbhl/scroller/workflows/R-CMD-check/badge.svg)](https://github.com/lgnbhl/scroller/actions)
[![R-CMD-check](https://github.com/lgnbhl/scroller/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lgnbhl/scroller/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

# scroller <img src="man/figures/logo.png" align="right" />
# scroller <img src="man/figures/logo.png" align="right" height="138" />

> Scroll to any object in your Shiny apps
The package `scroller` allows to scroll to any element on the page in Shiny thanks to [Arbitrary anchor JS](http://arbitrary-anchor.briangonzalez.org/).
**scroller** allows to scroll to any element on the page in Shiny thanks to [Arbitrary anchor JS](http://arbitrary-anchor.briangonzalez.org/).

## Installation

Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/scroller)](https://CRAN.R-project.org/package=aniview)
[![pipeline
status](https://gitlab.com/lgnbhl/scroller/badges/master/pipeline.svg)](https://gitlab.com/lgnbhl/scroller/pipelines)
[![R build
status](https://github.com/lgnbhl/scroller/workflows/R-CMD-check/badge.svg)](https://github.com/lgnbhl/scroller/actions)
[![R-CMD-check](https://github.com/lgnbhl/scroller/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lgnbhl/scroller/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

# scroller <img src="man/figures/logo.png" align="right" />
# scroller <img src="man/figures/logo.png" align="right" height="138" />

> Scroll to any object in your Shiny apps
The package `scroller` allows to scroll to any element on the page in
Shiny thanks to [Arbitrary anchor
JS](http://arbitrary-anchor.briangonzalez.org/).
**scroller** allows to scroll to any element on the page in Shiny thanks
to [Arbitrary anchor JS](http://arbitrary-anchor.briangonzalez.org/).

## Installation

Expand All @@ -33,7 +28,7 @@ remotes::install_github("lgnbhl/scroller")
In order to use scroller, you must first call `use_scroller()` in the
apps’ UI.

Then you can add a CSS selector after the hash (\#) and it will
Then you can add a CSS selector after the hash (#) and it will
automatically be scrolled to. If the selector returns more than 1
element, the first element found will be scrolled to. More information
[here](https://github.com/briangonzalez/jquery.arbitrary-anchor.js#usage).
Expand Down
5 changes: 2 additions & 3 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pandoc: 3.1.11
pkgdown: 2.0.9
pkgdown_sha: ~
articles: {}
last_built: 2024-05-26T18:26Z
last_built: 2024-05-26T18:33Z
urls:
reference: https://felixluginbuhl.com/scroller/reference
article: https://felixluginbuhl.com/scroller/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"path":"https://felixluginbuhl.com/scroller/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Félix Luginbuhl. Author, maintainer.","code":""},{"path":"https://felixluginbuhl.com/scroller/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Luginbuhl F (2024). scroller: Scroll element Shiny. R package version 0.1.1, https://github.com/lgnbhl/scroller, https://felixluginbuhl.com/scroller.","code":"@Manual{, title = {scroller: Scroll to any element in Shiny}, author = {Félix Luginbuhl}, year = {2024}, note = {R package version 0.1.1, https://github.com/lgnbhl/scroller}, url = {https://felixluginbuhl.com/scroller}, }"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"scroller-","dir":"","previous_headings":"","what":"Scroll to any element in Shiny","title":"Scroll to any element in Shiny","text":"Scroll object Shiny apps package scroller allows scroll element page Shiny thanks Arbitrary anchor JS.","code":""},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Scroll to any element in Shiny","text":"Install package Github.","code":"# install.packages(\"remotes\") remotes::install_github(\"lgnbhl/scroller\")"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"shiny","dir":"","previous_headings":"Installation","what":"Shiny","title":"Scroll to any element in Shiny","text":"order use scroller, must first call use_scroller() apps’ UI. can add CSS selector hash (#) automatically scrolled . selector returns 1 element, first element found scrolled . information .","code":"library(shiny) library(tidyverse) library(ggrepel) library(scroller) shinyApp( ui = fluidPage( align = \"center\", scroller::use_scroller(animationLength = 2000), # add use_scroller() in the UI h1(\"Shiny with scroller\"), shiny::actionButton(inputId = NULL, label = \"Scroll to plot\", class = \"btn-success\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"##plot\"), # add scroller id CSS shiny::actionButton(inputId = NULL, label = \"No scroll to plot\", class = \"btn-primary\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"#plot\"), # add id CSS HTML(rep(\"<br/><br/><br/>&darr;<br/>\", 20)), plotOutput(\"plot\"), shiny::actionButton(inputId = NULL, label = \"Scroll to top\", class = \"btn-success\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"#.btn\") # add scroller class reference ), server = function(input, output, session){ output$plot <- renderPlot({ ggplot(starwars, aes(mass, height)) + geom_point(aes(color = gender)) + geom_label_repel(aes(label = name), size = 3) + labs(title = \"Star Wars Characters Body Mass Index\") }) } )"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"customize-it","dir":"","previous_headings":"Installation","what":"Customize it","title":"Scroll to any element in Shiny","text":"can change animation lenght, easing function (see jquery-easing options availables) scroll set.","code":"scroller::use_scroller( animationLength = 1500, easingFunction = \"easeOutCirc\", scrollOffset = 30 )"},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":null,"dir":"Reference","previous_headings":"","what":"scroller dependencies — html_dependencies_scroller","title":"scroller dependencies — html_dependencies_scroller","text":"Get scroller html dependencies.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"scroller dependencies — html_dependencies_scroller","text":"","code":"html_dependencies_scroller(use_cdn = TRUE)"},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"scroller dependencies — html_dependencies_scroller","text":"use_cdn use CDN (default) use locally stored files.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":null,"dir":"Reference","previous_headings":"","what":"Use Scroller — use_scroller","title":"Use Scroller — use_scroller","text":"Use Scroller","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use Scroller — use_scroller","text":"","code":"use_scroller( animationLength = 750, easingFunction = \"linear\", scrollOffset = 0, use_cdn = TRUE )"},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use Scroller — use_scroller","text":"animationLength integrer. Lenght animation easingFunction string. effect jquery-easing. scrollOffset integrer. scrollOffset use_cdn use CDN (default) use locally stored files.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use Scroller — use_scroller","text":"","code":"use_scroller() #> <script>$(document).ready(function(){ #> AA_CONFIG = {animationLength: 750, easingFunction: 'linear', scrollOffset:0}; #> });<\/script>"},{"path":"https://felixluginbuhl.com/scroller/news/index.html","id":"scroller-011","dir":"Changelog","previous_headings":"","what":"scroller 0.1.1","title":"scroller 0.1.1","text":"Added NEWS.md file track changes package. create function html_dependencies_scroller(). Improve HTML dependencies. Now using DNS default. working, use local files.","code":""}]
[{"path":"https://felixluginbuhl.com/scroller/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Félix Luginbuhl. Author, maintainer.","code":""},{"path":"https://felixluginbuhl.com/scroller/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Luginbuhl F (2024). scroller: Scroll element Shiny. R package version 0.1.1, https://github.com/lgnbhl/scroller, https://felixluginbuhl.com/scroller.","code":"@Manual{, title = {scroller: Scroll to any element in Shiny}, author = {Félix Luginbuhl}, year = {2024}, note = {R package version 0.1.1, https://github.com/lgnbhl/scroller}, url = {https://felixluginbuhl.com/scroller}, }"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"scroller-","dir":"","previous_headings":"","what":"Scroll to any element in Shiny","title":"Scroll to any element in Shiny","text":"Scroll object Shiny apps scroller allows scroll element page Shiny thanks Arbitrary anchor JS.","code":""},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Scroll to any element in Shiny","text":"Install package Github.","code":"# install.packages(\"remotes\") remotes::install_github(\"lgnbhl/scroller\")"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"shiny","dir":"","previous_headings":"Installation","what":"Shiny","title":"Scroll to any element in Shiny","text":"order use scroller, must first call use_scroller() apps’ UI. can add CSS selector hash (#) automatically scrolled . selector returns 1 element, first element found scrolled . information .","code":"library(shiny) library(tidyverse) library(ggrepel) library(scroller) shinyApp( ui = fluidPage( align = \"center\", scroller::use_scroller(animationLength = 2000), # add use_scroller() in the UI h1(\"Shiny with scroller\"), shiny::actionButton(inputId = NULL, label = \"Scroll to plot\", class = \"btn-success\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"##plot\"), # add scroller id CSS shiny::actionButton(inputId = NULL, label = \"No scroll to plot\", class = \"btn-primary\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"#plot\"), # add id CSS HTML(rep(\"<br/><br/><br/>&darr;<br/>\", 20)), plotOutput(\"plot\"), shiny::actionButton(inputId = NULL, label = \"Scroll to top\", class = \"btn-success\") %>% shiny::a() %>% shiny::tagAppendAttributes(href = \"#.btn\") # add scroller class reference ), server = function(input, output, session){ output$plot <- renderPlot({ ggplot(starwars, aes(mass, height)) + geom_point(aes(color = gender)) + geom_label_repel(aes(label = name), size = 3) + labs(title = \"Star Wars Characters Body Mass Index\") }) } )"},{"path":"https://felixluginbuhl.com/scroller/index.html","id":"customize-it","dir":"","previous_headings":"Installation","what":"Customize it","title":"Scroll to any element in Shiny","text":"can change animation lenght, easing function (see jquery-easing options availables) scroll set.","code":"scroller::use_scroller( animationLength = 1500, easingFunction = \"easeOutCirc\", scrollOffset = 30 )"},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":null,"dir":"Reference","previous_headings":"","what":"scroller dependencies — html_dependencies_scroller","title":"scroller dependencies — html_dependencies_scroller","text":"Get scroller html dependencies.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"scroller dependencies — html_dependencies_scroller","text":"","code":"html_dependencies_scroller(use_cdn = TRUE)"},{"path":"https://felixluginbuhl.com/scroller/reference/scroller-dependencies.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"scroller dependencies — html_dependencies_scroller","text":"use_cdn use CDN (default) use locally stored files.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":null,"dir":"Reference","previous_headings":"","what":"Use Scroller — use_scroller","title":"Use Scroller — use_scroller","text":"Use Scroller","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use Scroller — use_scroller","text":"","code":"use_scroller( animationLength = 750, easingFunction = \"linear\", scrollOffset = 0, use_cdn = TRUE )"},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use Scroller — use_scroller","text":"animationLength integrer. Lenght animation easingFunction string. effect jquery-easing. scrollOffset integrer. scrollOffset use_cdn use CDN (default) use locally stored files.","code":""},{"path":"https://felixluginbuhl.com/scroller/reference/use_scroller.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Use Scroller — use_scroller","text":"","code":"use_scroller() #> <script>$(document).ready(function(){ #> AA_CONFIG = {animationLength: 750, easingFunction: 'linear', scrollOffset:0}; #> });<\/script>"},{"path":"https://felixluginbuhl.com/scroller/news/index.html","id":"scroller-011","dir":"Changelog","previous_headings":"","what":"scroller 0.1.1","title":"scroller 0.1.1","text":"Added NEWS.md file track changes package. create function html_dependencies_scroller(). Improve HTML dependencies. Now using DNS default. working, use local files.","code":""}]

0 comments on commit fb8bff6

Please sign in to comment.