{"id":13734729,"url":"https://github.com/JohnCoene/shinyscroll","last_synced_at":"2025-05-08T11:30:47.325Z","repository":{"id":85366755,"uuid":"235596719","full_name":"JohnCoene/shinyscroll","owner":"JohnCoene","description":"Scroll to an element in Shiny","archived":false,"fork":false,"pushed_at":"2020-07-17T09:49:54.000Z","size":279,"stargazers_count":21,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T15:30:19.299Z","etag":null,"topics":["r","rstats","shiny"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnCoene.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-01-22T14:58:31.000Z","updated_at":"2023-12-19T19:45:07.000Z","dependencies_parsed_at":"2023-07-02T22:31:33.808Z","dependency_job_id":null,"html_url":"https://github.com/JohnCoene/shinyscroll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fshinyscroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fshinyscroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fshinyscroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnCoene%2Fshinyscroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnCoene","download_url":"https://codeload.github.com/JohnCoene/shinyscroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224727010,"owners_count":17359530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","rstats","shiny"],"created_at":"2024-08-03T03:00:59.271Z","updated_at":"2024-11-15T03:30:54.283Z","avatar_url":"https://github.com/JohnCoene.png","language":"R","funding_links":[],"categories":["R","UI Components"],"sub_categories":["Advanced Interactivity"],"readme":"\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n# shinyscroll\n\nProgramatically scroll in Shiny.\n\n## Installation\n\nInstall it with `remotes` from Github:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"JohnCoene/shinyscroll\")\n```\n\n## Example\n\n{shinyscroll} was created to solve the use case below, where I want the window to scroll to a plot dynamically created by a click in a DT table.\n\n``` r\nlibrary(DT)\nlibrary(shiny)\nlibrary(shinyscroll)\n\nui \u003c- fluidPage(\n  use_shinyscroll(),\n  h1(\"shinyscroll\"),\n  p(\"Select a row\"),\n  DTOutput(\"table\"),\n  plotOutput(\"plot\")\n)\n\nserver \u003c- function(input, output, session){\n\n  output$table \u003c- renderDT({\n    datatable(cars, selection = \"single\", options = list(pageLength = 20L))\n  })\n\n  dataset \u003c- eventReactive(input$table_rows_selected, {\n    scroll(\"plot\") # scroll to plot\n    runif(100)\n  })\n\n  output$plot \u003c- renderPlot(plot(dataset()))\n}\n\nshinyApp(ui, server)\n```\n\n![](./man/figures/shinyscroll.gif)\n\nIt's also used in the DXY tab of the [coronavirus tracker](http://shiny.john-coene.com/coronavirus)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnCoene%2Fshinyscroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohnCoene%2Fshinyscroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnCoene%2Fshinyscroll/lists"}