Skip to content

Commit d4648b4

Browse files
committed
Initial commit of R package providing dash-table functionality (#442)
* 🎉 initial commit of dashTable R package * border is none if not define * test cases for css border overwrite bugs * edit CHANGELOG.md * Update CHANGELOG.md Co-Authored-By: Marc-André Rivet <[email protected]> * Fix monorepo build (#443) monorepo changes + shallow clone + v0/v1 clean up * Create FUNDING.yml * 📝 correct "dash green" to "dashed blue"
1 parent 5b0f94a commit d4648b4

15 files changed

+922
-3
lines changed

packages/dash-table/.Rbuildignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ignore JS config files/folders
2+
node_modules/
3+
coverage/
4+
src/
5+
lib/
6+
generator/
7+
datasets/
8+
.babelrc
9+
.builderrc
10+
.eslintrc
11+
.npmignore
12+
13+
# demo folder has special meaning in R
14+
# this should hopefully make it still
15+
# allow for the possibility to make R demos
16+
demo/.*\.js
17+
demo/.*\.html
18+
demo/.*\.css
19+
20+
# ignore python files/folders
21+
setup.py
22+
requirements.txt
23+
MANIFEST.in
24+
CHANGELOG.md
25+
tests/
26+
.pylintrc
27+
^.*\.Rproj$
28+
^\.Rproj\.user$

packages/dash-table/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
### Added
7+
[#456](https://github.com/plotly/dash-table/issues/456)
8+
- Support for dash-table is now available for R users of Dash.
9+
610
### Fixed
711
[#434](https://github.com/plotly/dash-table/issues/434)
812
- Fix CSS borders propeties overwrite style_* borders properties.

packages/dash-table/DESCRIPTION

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Package: dashTable
2+
Title: Dash table
3+
Version: 3.7.0
4+
Authors @R: as.person(c(Chris P <[email protected]>))
5+
Description: Dash table
6+
Depends: R (>= 3.0.2)
7+
Imports: dashR
8+
Suggests:
9+
License: MIT + file LICENSE
10+
URL: https://github.com/plotly/dash-table
11+
BugReports: https://github.com/plotly/dash-table/issues
12+
Encoding: UTF-8
13+
LazyData: true
14+
Author: Chris P [aut]
15+
Maintainer: Chris P <[email protected]>

packages/dash-table/NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
export(dashDataTable)
4+
export(df_to_list)

packages/dash-table/R/dashDataTable.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# AUTO GENERATED FILE - DO NOT EDIT
2+
3+
dashDataTable <- function(active_cell=NULL, columns=NULL, locale_format=NULL, content_style=NULL, css=NULL, data=NULL, data_previous=NULL, data_timestamp=NULL, editable=NULL, end_cell=NULL, id=NULL, is_focused=NULL, merge_duplicate_headers=NULL, n_fixed_columns=NULL, n_fixed_rows=NULL, row_deletable=NULL, row_selectable=NULL, selected_cells=NULL, selected_rows=NULL, selected_row_ids=NULL, start_cell=NULL, style_as_list_view=NULL, pagination_mode=NULL, pagination_settings=NULL, navigation=NULL, column_conditional_dropdowns=NULL, column_static_dropdown=NULL, column_static_tooltip=NULL, column_conditional_tooltips=NULL, tooltips=NULL, tooltip_delay=NULL, tooltip_duration=NULL, filter=NULL, filtering=NULL, filtering_type=NULL, filtering_types=NULL, sorting=NULL, sorting_type=NULL, sort_by=NULL, sorting_treat_empty_string_as_none=NULL, style_table=NULL, style_cell=NULL, style_data=NULL, style_filter=NULL, style_header=NULL, style_cell_conditional=NULL, style_data_conditional=NULL, style_filter_conditional=NULL, style_header_conditional=NULL, virtualization=NULL, derived_filter_structure=NULL, derived_viewport_data=NULL, derived_viewport_indices=NULL, derived_viewport_row_ids=NULL, derived_viewport_selected_rows=NULL, derived_viewport_selected_row_ids=NULL, derived_virtual_data=NULL, derived_virtual_indices=NULL, derived_virtual_row_ids=NULL, derived_virtual_selected_rows=NULL, derived_virtual_selected_row_ids=NULL, dropdown_properties=NULL) {
4+
5+
component <- list(
6+
props = list(active_cell=active_cell, columns=columns, locale_format=locale_format, content_style=content_style, css=css, data=data, data_previous=data_previous, data_timestamp=data_timestamp, editable=editable, end_cell=end_cell, id=id, is_focused=is_focused, merge_duplicate_headers=merge_duplicate_headers, n_fixed_columns=n_fixed_columns, n_fixed_rows=n_fixed_rows, row_deletable=row_deletable, row_selectable=row_selectable, selected_cells=selected_cells, selected_rows=selected_rows, selected_row_ids=selected_row_ids, start_cell=start_cell, style_as_list_view=style_as_list_view, pagination_mode=pagination_mode, pagination_settings=pagination_settings, navigation=navigation, column_conditional_dropdowns=column_conditional_dropdowns, column_static_dropdown=column_static_dropdown, column_static_tooltip=column_static_tooltip, column_conditional_tooltips=column_conditional_tooltips, tooltips=tooltips, tooltip_delay=tooltip_delay, tooltip_duration=tooltip_duration, filter=filter, filtering=filtering, filtering_type=filtering_type, filtering_types=filtering_types, sorting=sorting, sorting_type=sorting_type, sort_by=sort_by, sorting_treat_empty_string_as_none=sorting_treat_empty_string_as_none, style_table=style_table, style_cell=style_cell, style_data=style_data, style_filter=style_filter, style_header=style_header, style_cell_conditional=style_cell_conditional, style_data_conditional=style_data_conditional, style_filter_conditional=style_filter_conditional, style_header_conditional=style_header_conditional, virtualization=virtualization, derived_filter_structure=derived_filter_structure, derived_viewport_data=derived_viewport_data, derived_viewport_indices=derived_viewport_indices, derived_viewport_row_ids=derived_viewport_row_ids, derived_viewport_selected_rows=derived_viewport_selected_rows, derived_viewport_selected_row_ids=derived_viewport_selected_row_ids, derived_virtual_data=derived_virtual_data, derived_virtual_indices=derived_virtual_indices, derived_virtual_row_ids=derived_virtual_row_ids, derived_virtual_selected_rows=derived_virtual_selected_rows, derived_virtual_selected_row_ids=derived_virtual_selected_row_ids, dropdown_properties=dropdown_properties),
7+
type = 'DataTable',
8+
namespace = 'dash_table',
9+
propNames = c('active_cell', 'columns', 'locale_format', 'content_style', 'css', 'data', 'data_previous', 'data_timestamp', 'editable', 'end_cell', 'id', 'is_focused', 'merge_duplicate_headers', 'n_fixed_columns', 'n_fixed_rows', 'row_deletable', 'row_selectable', 'selected_cells', 'selected_rows', 'selected_row_ids', 'start_cell', 'style_as_list_view', 'pagination_mode', 'pagination_settings', 'navigation', 'column_conditional_dropdowns', 'column_static_dropdown', 'column_static_tooltip', 'column_conditional_tooltips', 'tooltips', 'tooltip_delay', 'tooltip_duration', 'filter', 'filtering', 'filtering_type', 'filtering_types', 'sorting', 'sorting_type', 'sort_by', 'sorting_treat_empty_string_as_none', 'style_table', 'style_cell', 'style_data', 'style_filter', 'style_header', 'style_cell_conditional', 'style_data_conditional', 'style_filter_conditional', 'style_header_conditional', 'virtualization', 'derived_filter_structure', 'derived_viewport_data', 'derived_viewport_indices', 'derived_viewport_row_ids', 'derived_viewport_selected_rows', 'derived_viewport_selected_row_ids', 'derived_virtual_data', 'derived_virtual_indices', 'derived_virtual_row_ids', 'derived_virtual_selected_rows', 'derived_virtual_selected_row_ids', 'dropdown_properties'),
10+
package = 'dashTable'
11+
)
12+
13+
component$props <- filter_null(component$props)
14+
15+
structure(component, class = c('dash_component', 'list'))
16+
}
17+

packages/dash-table/R/df_to_list.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
df_to_list <- function(df) {
2+
if(!(is.data.frame(df)))
3+
stop("df_to_list requires a data.frame object; please verify that df is of the correct type.")
4+
setNames(lapply(split(df, seq(nrow(df))),
5+
FUN = function (x) {
6+
as.list(x)
7+
}), NULL)
8+
}

packages/dash-table/R/internal.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.dashTable_js_metadata <- function() {
2+
deps_metadata <- list(`dash_table` = structure(list(name = "dash_table",
3+
version = "0", src = list(href = NULL,
4+
file = "deps"), meta = NULL,
5+
script = "bundle.js",
6+
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
7+
all_files = FALSE), class = "html_dependency"),
8+
`dash_table` = structure(list(name = "dash_table",
9+
version = "0", src = list(href = NULL,
10+
file = "deps"), meta = NULL,
11+
script = "bundle.js.map",
12+
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTable",
13+
all_files = FALSE), class = "html_dependency"))
14+
return(deps_metadata)
15+
}

packages/dash-table/inst/deps/bundle.js

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dash-table/inst/deps/bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dash-table/inst/deps/demo.js

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dash-table/inst/deps/demo.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)