Git Product home page Git Product logo

shinysky's Introduction

ShinySky

Various UI widgets/components used by AnalytixWare's flaghship product e.g. alerts, styled buttons

alt text

Install

install.packages("devtools")#if not alrady installed
devtools::install_github("ShinySky","AnalytixWare")
require(shinysky)
shinysky::run.shinysky.example()

Usage

require(shinysky)

##Action Buttons

actionButton(inputId, label, styleclass = yourStyle)

Specify the style with the styleclass argument. The possible styles are "primary", "info", "success", "warning", "danger", "inverse", "link", ""

##Alerts

ui.R

shinyalert(id, click.hide = TRUE, auto.close.after = NULL)

In the past clicking on the alert will hide it. Setting click.hide = FALSE can prevent this behaviour The auto.close.after can take a number and will close the alert after this many seconds.

Simply provide an id. The alert will be hidden until you show it using showshinyalert in server.R

server.R

showshinyalert(session,id,HTMLtext,styleclass)

Put some valid HTML in HTMLtext. Here you can specify the style you want using the styleclass parameter. The possible styles are "primary", "info", "success", "warning", "danger", "inverse", "link", ""

##Select2 The below will create a multiple select2 with "a", "b", "c" as choices

select2Input("select2Input1","This is a multiple select2Input",choices=c("a","b","c"),selected=c("b","a"))

###Video Demo Video Demo

##Typeahead Text Input

textInput.typeahead(
    id="thti"
    ,placeholder="type 'name' or '2'"
    ,local=data.frame(name=c("name1","name2"),info=c("info1","info2"))
    ,valueKey = "name"
    ,tokens=c(1,2)
    ,template = HTML("<p class='repo-language'>{{info}}</p> <p class='repo-name'>{{name}}</p> <p class='repo-description'>You need to learn more CSS to customize this further</p>")
  )

##Busy Indicator ###ui.R

busyIndicator(wait = 1000)

Here the wait determines how long to wait before showing the buys indicator. The default is wait=1000, which is one second. This is to prevent short computation triggering the busyIndicator.

##Events Buttons

eventsButton(inputId, label, events = c("dblclick"))

This button will invalidate (dirty) upon the events. The event does not have to be a "click", in fact the default is dblclick. You can specify multiple events. For a list of event types See: http://api.jquery.com/category/events/mouse-events/

#Handsontable Input/Output ###ui.R

hotable("hotable1")

This will create a handsontable which you can output using

output$hotable1 <- renderHotable({...})

###server.R

something <- reactive({
	hot.to.df(input$hotable1) # this will convert your input into a data.frame
})

#jsTree ###ui.R

jstree("jstree1",with(tags,ul(li("empty_folder"),li("folder1",ul(li("file1"),li("file2"))))))

###server.R

observe({
	print(paste0(input$jstree1,collapse=", "))
})

#jscolorInput ##ui.R

jscolorInput("jscolorInput1")

alt text

Example

shinysky::run.shinysky.example()

or to run individual examples. You can use for example

n = "2"
shinysky::run.shinysky.example(n)

Install

To istall a github package you need the devtools package installed. If you do not have the devtools package installed, run this first

install.packages(devtools)

If you already have the devtools package installed, simply run

devtools::install_github("shinysky","analytixware")

shinysky's People

Contributors

xiaodaigh avatar stjude-htb avatar professorbeautiful avatar jcheng5 avatar

Watchers

James Cloos avatar Enzo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.