Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Update dashTable to 4.5.1 with support for async loading in R (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkyle authored Dec 19, 2019
1 parent 9435701 commit 3058bd5
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 33 deletions.
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Package: dashTable
Title: Core Interactive Table Component for Dash
Version: 4.5.1
Authors @R: as.person(c(Chris Parmer <chris@plot.ly>))
Description: Dash DataTable is an interactive table component designed for designed for viewing, editing, and exploring large datasets. DataTable is rendered with standard, semantic HTML <table/> markup, which makes it accessible, responsive, and easy to style. This component was written from scratch in React.js specifically for the Dash community. Its API was designed to be ergonomic and its behavior is completely customizable through its properties.
Description: An interactive table component designed for designed for viewing, editing, and exploring large datasets, DataTable is rendered with standard, semantic HTML <table/> markup, which makes it accessible, responsive, and easy to style. This component was written from scratch in React.js specifically for the Dash community. Its API was designed to be ergonomic and its behaviour is completely customizable through its properties.
Depends: R (>= 3.0.2)
Imports:
Suggests:
Imports:
Suggests:
License: MIT + file LICENSE
URL: https://github.com/plotly/dash-table
BugReports: https://github.com/plotly/dash-table/issues
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# AUTO GENERATED FILE - DO NOT EDIT

export(dashDataTable)
export(df_to_list)
8 changes: 8 additions & 0 deletions R/df_to_list.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
df_to_list <- function(df) {
if(!(is.data.frame(df)))
stop("df_to_list requires a data.frame object; please verify that df is of the correct type.")
setNames(lapply(split(df, seq(nrow(df))),
FUN = function (x) {
as.list(x)
}), NULL)
}
10 changes: 5 additions & 5 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ version = "4.5.1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'bundle.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
all_files = FALSE), class = "html_dependency"),
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.5.1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async~export.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
all_files = FALSE), class = "html_dependency"),
all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.5.1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async~export.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
all_files = FALSE), class = "html_dependency"),
all_files = FALSE, dynamic = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.5.1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async~table.js',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
all_files = FALSE), class = "html_dependency"),
all_files = FALSE, async = TRUE), class = "html_dependency"),
`dash_table` = structure(list(name = "dash_table",
version = "4.5.1", src = list(href = NULL,
file = "deps"), meta = NULL,
script = 'async~table.js.map',
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
all_files = FALSE), class = "html_dependency"))
all_files = FALSE, dynamic = TRUE), class = "html_dependency"))
return(deps_metadata)
}
18 changes: 9 additions & 9 deletions dash-info.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pkg_help_description: >
Dash DataTable is an interactive table component designed for
designed for viewing, editing, and exploring large datasets.
DataTable is rendered with standard, semantic HTML <table/> markup,
which makes it accessible, responsive, and easy to style. This
component was written from scratch in React.js specifically for the
Dash community. Its API was designed to be ergonomic and its behaviour
is completely customizable through its properties.
pkg_help_title: >
pkg_help_description: >-
An interactive table component designed for editing and exploring
large datasets, DataTable is rendered with standard, semantic HTML
<table/> markup, which makes it accessible, responsive, and easy
to style. This component was written from scratch in React.js
specifically for the Dash community. Its API was designed to be
ergonomic and its behaviour is completely customizable through its
properties.
pkg_help_title: >-
Core Interactive Table Component for Dash
4 changes: 2 additions & 2 deletions dash_table/async~table.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_table/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_table/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_table/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_table/demo.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/deps/async~table.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/demo.js.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions man/dashTable-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
\docType{package}
\name{dashTable-package}
\alias{dashTable}
\title{Core Interactive Table Component for Dash
}
\title{Core Interactive Table Component for Dash}
\description{
Dash DataTable is an interactive table component designed for designed for viewing, editing, and exploring large datasets. DataTable is rendered with standard, semantic HTML <table/> markup, which makes it accessible, responsive, and easy to style. This component was written from scratch in React.js specifically for the Dash community. Its API was designed to be ergonomic and its behaviour is completely customizable through its properties.

}
\author{
\strong{Maintainer}: Ryan Patrick Kyle <ryan@plot.ly>
Expand Down
41 changes: 41 additions & 0 deletions man/df_to_list.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
% Auto-generated: do not edit by hand
\name{df_to_list}

\alias{df_to_list}

\title{Convert data.frame objects to list-of-lists format}

\description{
Convert a \code{\link{data.frame}} to a list of lists for compatibility with \code{\link{dashDataTable}}. The function will return a nested list object in which the sublists contain named elements of varying type; the names correspond to the column names in the original \code{\link{data.frame}}.
}

\usage{
df_to_list(df=NULL)
}

\arguments{
\item{df}{A \code{data.frame} object, which will be transformed into a list of lists. Each row will become a single named list, in which the elements are named as the columns from which they were extracted.}
}

\examples{
\dontrun{
# first, create data frame
df <- read.csv(url(
'https://raw.githubusercontent.com/plotly/datasets/master/solar.csv'
),
check.names=FALSE,
stringsAsFactors=FALSE
)

# then convert to list-of-lists format for use in dashTable
# the following snippet below will print as JSON
# see the help for dashDataTable to see an actual app example
dashDataTable(
id = 'table',
columns = lapply(colnames(df), function(x) {
list(name = x, id = x)
}),
data = df_to_list(df)
)
}
}

0 comments on commit 3058bd5

Please sign in to comment.