This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dashTable to 4.5.1 with support for async loading in R (#668)
- Loading branch information
Showing
17 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
) | ||
} | ||
} |