GithubHelp home page GithubHelp logo

timelyportfolio / rhandsontable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jrowen/rhandsontable

3.0 3.0 4.0 87.31 MB

An htmlwidgets implementation of Handsontable.js

Home Page: http://jrowen.github.io/rhandsontable/

License: Other

R 0.53% JavaScript 0.36% CSS 0.01% HTML 99.10%

rhandsontable's Introduction

Build Status AppVeyor Build Status CRAN_Status_Badge CRAN_Download_Badge

See the project website for more details and live examples, and see below for important details on use in shiny apps.

An htmlwidgets implementation of Handsontable.js. Per the website:

Handsontable is a minimalist Excel-like data grid editor for HTML & JavaScript

This library was inspired by the shinyTable package. Most of the original functionality was preserved, and the htmlwidgets framework made it possible to leverage even more of the Handsontable.js functionality.

See the vignette for detailed examples and links to shiny apps.

To install from CRAN use

install.packages("rhandsontable")

For the latest development version use

devtools::install_github("jrowen/rhandsontable")

A simple example

library(rhandsontable)

DF = data.frame(int = 1:10,
                numeric = rnorm(10),
                logical = TRUE,
                character = LETTERS[1:10],
                fact = factor(letters[1:10]),
                date = seq(from = Sys.Date(), by = "days", length.out = 10),
                stringsAsFactors = FALSE)

# add a sparkline chart
DF$chart = sapply(1:10, function(x) jsonlite::toJSON(list(values=rnorm(10))))
                                                    
rhandsontable(DF, rowHeaders = NULL) %>%
  hot_col("chart", renderer = htmlwidgets::JS("renderSparkline"))

alt tag

A more involved shiny example

shiny::runGitHub("rhandsontable", "jrowen", subdir = "inst/examples/rhandsontable_corr")

Important note on shiny use: The htmlwidgets package creates widgets as shiny output bindings. The rhandsontable package also attempts to expose the table as a pseudo shiny input binding using handsontable change events (see here for the supported events). This means the table (e.g. hot) can be accessed in shiny using either input$hot or output$hot, but these values may not be in-sync. The timing of updates will depend on the particular reactive path followed by your shiny application.

Since the widget is not currently able to use the standard shiny input binding functionality, you will need to explicitly call the hot_to_r function to convert the handsontable data to an R object.

Two additional inputs are also enabled, input$hot_select and input$hot_comment, which will fire when a cell selection or a comment changes, respectively (if you would like to see more options, please post an issue or create a PR).

This functionality is still evolving, so please don't hesitate to share suggestions and PRs.

rhandsontable's People

Contributors

jrowen avatar marciz avatar robinsonjj avatar shrektan avatar smartinsightsfromdata avatar timelyportfolio avatar tpalusga avatar xhudik avatar yihui avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.