All Projects → wleepang → shiny-directory-input

wleepang / shiny-directory-input

Licence: BSD-3-Clause license
An shiny input widget for selecting directories

Programming Languages

r
7636 projects
powershell
5483 projects
javascript
184084 projects - #8 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to shiny-directory-input

daattali.github.io
Dean Attali's website - R/Shiny Consultant
Stars: ✭ 51 (+18.6%)
Mutual labels:  shiny, shiny-applications
shinyAppTutorials
a collection of shiny app demonstrations 📊
Stars: ✭ 50 (+16.28%)
Mutual labels:  shiny, shiny-applications
shinyTime
A timeInput widget for Shiny
Stars: ✭ 23 (-46.51%)
Mutual labels:  widget, shiny
Android-Model-View-Presenter
No description or website provided.
Stars: ✭ 26 (-39.53%)
Mutual labels:  widget
netlify-cms-widget-youtube
Youtube Widget for Netlify CMS
Stars: ✭ 24 (-44.19%)
Mutual labels:  widget
file manager
FileManager is a wonderful widget that allows you to manage files and folders, pick files and folders, and do a lot more. Designed to feel like part of the Flutter framework.
Stars: ✭ 38 (-11.63%)
Mutual labels:  widget
signals-and-systems
Interactive visualizations for Dr. Richard Baraniuk's open-source "Signals and Systems" textbook. R / Shiny.
Stars: ✭ 31 (-27.91%)
Mutual labels:  shiny
ZVRefreshing
A pure-swift and wieldy refresh component.
Stars: ✭ 29 (-32.56%)
Mutual labels:  widget
dragulaR
No description or website provided.
Stars: ✭ 62 (+44.19%)
Mutual labels:  shiny
Unleash-Shiny
https://rinterface.com/shiny/talks/RPharma2020/
Stars: ✭ 25 (-41.86%)
Mutual labels:  shiny
Widget-Blur
This script for the Scriptable app creates widget backgrounds that appear to be transparent. You can also optionally emulate the light or dark blur effect used in the Batteries widget from Apple.
Stars: ✭ 113 (+162.79%)
Mutual labels:  widget
chatKit
Open Source React Chat Widget. Ready for use and can be connected to any backend like Chatbot/NLP/Live Chat engine or messenger.
Stars: ✭ 42 (-2.33%)
Mutual labels:  widget
react-zendesk
A component simplifies Zendesk widget usage in your React application
Stars: ✭ 34 (-20.93%)
Mutual labels:  widget
WidgetUpdateHelper
No description or website provided.
Stars: ✭ 43 (+0%)
Mutual labels:  widget
image-discovery-app-js
JavaScript Image Discovery Web Application. Use to search, discover, filter, and manipulate imagery.
Stars: ✭ 22 (-48.84%)
Mutual labels:  widget
shiny-ob-analytics
obAnalytics Shiny front-end
Stars: ✭ 59 (+37.21%)
Mutual labels:  shiny
assist
Blocknative Assist widget for blockchain usability
Stars: ✭ 54 (+25.58%)
Mutual labels:  widget
yii2-widget-cropbox
This widget allows crop image before upload to server and send informations about crop in JSON format.
Stars: ✭ 90 (+109.3%)
Mutual labels:  widget
VOSONDash
R Shiny application for interactive analysis of networks created by vosonSML.
Stars: ✭ 44 (+2.33%)
Mutual labels:  shiny
pct-shiny
The Shiny map for Local Authorites
Stars: ✭ 20 (-53.49%)
Mutual labels:  shiny

directoryInput

A widget for interactive selection of directories for R Shiny Applications

directory widget

Application

Provides an input for users to select directories via an interactive, and os native dialog, rather than having to type in paths in a textInput().

NOTE: This is intended to only be used with locally run shiny applications. It will not work on server deployed applications because it uses OS shell calls to present a directory choosing dialog. There is currently no way (that I'm aware) of securely presenting a client side directory selection dialog from a hosted web application.

Install the package

First install the shiny R-package from CRAN as it is required:

install.packages('shiny')

Then install this package from github:

devtools::install_github('wleepang/shiny-directory-input')

Special Requirements

  • Windows:
    • PowerShell 3 or higher

Run the demo

Simply run the code to see the widget in action:

library(shinyDirectoryInput)
shinyDirectoryInput::runDirinputExample()

Use the widget

In global.R in your own app (create it if it doesn't already exist) add the line:

library('shinyDirectoryInput')

In ui.R:

  • Add the widget
directoryInput('directory', label = 'select a directory')
  • Add the widget with a default value
directoryInput('directory', label = 'select a directory', value = '~')

In server.R:

  • Important: Pass session into the server, it is used to communicate with the client-side widget
shinyServer(function(input, output, session) {
  # ...
}
  • Invoke the dialog
path = readDirectoryInput(session, 'directory')
  • Update the widget value
path = 'path/to/directory'
updateDirectoryInput(session, 'directory', value = path)
  • Example: Observe when a user clicks the ... button to select a new directory
observeEvent(
  ignoreNULL = TRUE,
  eventExpr = {
    input$directory
  },
  handlerExpr = {
    if (input$directory > 0) {
      # condition prevents handler execution on initial app launch
      
      # launch the directory selection dialog with initial path read from the widget
      path = choose.dir(default = readDirectoryInput(session, 'directory'))
      
      # update the widget value
      updateDirectoryInput(session, 'directory', value = path)
    }
  }
)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].