|
1 | 1 | pkg_help_description: >-
|
2 | 2 | An interactive table component designed for editing and exploring
|
3 |
| - large datasets, DataTable is rendered with standard, semantic HTML |
| 3 | + large datasets, 'dashDataTable' is rendered with standard, semantic HTML |
4 | 4 | <table/> markup, which makes it accessible, responsive, and easy
|
5 |
| - to style. This component was written from scratch in React.js |
6 |
| - specifically for the Dash community. Its API was designed to be |
7 |
| - ergonomic and its behaviour is completely customizable through its |
| 5 | + to style. This component was written from scratch in 'React.js' |
| 6 | + specifically for the 'Dash' community. Its API was designed to be |
| 7 | + ergonomic and its behaviour is completely customizable through its |
8 | 8 | properties.
|
9 | 9 | pkg_help_title: >-
|
10 |
| - Core Interactive Table Component for Dash |
| 10 | + Core Interactive Table Component for 'Dash' |
| 11 | +pkg_authors: >- |
| 12 | + c(person("Chris", "Parmer", email = "[email protected]", role = c("aut")), person("Ryan Patrick", "Kyle", email = "[email protected]", role = c("cre"), comment = c(ORCID = "0000-0002-4958-2844")), person(family = "Plotly Technologies, Inc.", role = "cph")) |
| 13 | +pkg_copyright: >- |
| 14 | + Plotly Technologies, Inc. |
11 | 15 | r_examples:
|
12 |
| - - name: dashDataTable |
13 |
| - dontrun: TRUE |
| 16 | + - name: dashDataTable |
| 17 | + dontrun: FALSE |
14 | 18 | code: |
|
15 | 19 | # For comprehensive documentation of this package's features,
|
16 | 20 | # please consult https://dashr.plot.ly/datatable
|
17 | 21 | #
|
18 | 22 | # A package vignette is currently in development and will
|
19 | 23 | # provide many of the same examples currently available online
|
20 | 24 | # in an offline-friendly format.
|
21 |
| - library(dash) |
22 |
| - library(dashTable) |
23 | 25 |
|
24 |
| - app <- Dash$new() |
| 26 | + # The following if statement is not required to run this |
| 27 | + # example locally, but was added at the request of CRAN |
| 28 | + # maintainers. |
| 29 | + if (interactive()) { |
| 30 | + library(dash) |
| 31 | + library(dashTable) |
25 | 32 |
|
26 |
| - # We can easily restrict the number of rows to display at |
27 |
| - # once by using style_table: |
28 |
| - app$layout( |
29 |
| - dashDataTable( |
30 |
| - id = "table", |
31 |
| - columns = lapply(colnames(iris), |
32 |
| - function(colName){ |
33 |
| - list( |
34 |
| - id = colName, |
35 |
| - name = colName |
36 |
| - ) |
37 |
| - }), |
38 |
| - style_table = list( |
39 |
| - maxHeight = "250px", |
40 |
| - overflowY = "scroll" |
41 |
| - ), |
42 |
| - data = df_to_list(iris) |
43 |
| - ) |
44 |
| - ) |
| 33 | + app <- Dash$new() |
45 | 34 |
|
46 |
| - app$run_server() |
| 35 | + # We can easily restrict the number of rows to display at |
| 36 | + # once by using style_table: |
| 37 | + app$layout( |
| 38 | + dashDataTable( |
| 39 | + id = "table", |
| 40 | + columns = lapply(colnames(iris), |
| 41 | + function(colName){ |
| 42 | + list( |
| 43 | + id = colName, |
| 44 | + name = colName |
| 45 | + ) |
| 46 | + }), |
| 47 | + style_table = list( |
| 48 | + maxHeight = "250px", |
| 49 | + overflowY = "scroll" |
| 50 | + ), |
| 51 | + data = df_to_list(iris) |
| 52 | + ) |
| 53 | + ) |
47 | 54 |
|
48 |
| - app <- Dash$new() |
| 55 | + app$run_server() |
| 56 | + |
| 57 | + app <- Dash$new() |
49 | 58 |
|
50 |
| - # We can also make rows and columns selectable/deletable |
51 |
| - # by setting a few additional attributes: |
52 |
| - app$layout( |
53 |
| - dashDataTable( |
54 |
| - id = "table", |
55 |
| - columns = lapply(colnames(iris), |
56 |
| - function(colName){ |
57 |
| - list( |
58 |
| - id = colName, |
59 |
| - name = colName, |
60 |
| - deletable = TRUE |
61 |
| - ) |
62 |
| - }), |
63 |
| - style_table = list( |
64 |
| - maxHeight = "250px", |
65 |
| - overflowY = "scroll" |
66 |
| - ), |
67 |
| - data = df_to_list(iris), |
68 |
| - editable = TRUE, |
69 |
| - filter_action = "native", |
70 |
| - sort_action = "native", |
71 |
| - sort_mode = "multi", |
72 |
| - column_selectable = "single", |
73 |
| - row_selectable = "multi", |
74 |
| - row_deletable = TRUE |
| 59 | + # We can also make rows and columns selectable/deletable |
| 60 | + # by setting a few additional attributes: |
| 61 | + app$layout( |
| 62 | + dashDataTable( |
| 63 | + id = "table", |
| 64 | + columns = lapply(colnames(iris), |
| 65 | + function(colName){ |
| 66 | + list( |
| 67 | + id = colName, |
| 68 | + name = colName, |
| 69 | + deletable = TRUE |
| 70 | + ) |
| 71 | + }), |
| 72 | + style_table = list( |
| 73 | + maxHeight = "250px", |
| 74 | + overflowY = "scroll" |
| 75 | + ), |
| 76 | + data = df_to_list(iris), |
| 77 | + editable = TRUE, |
| 78 | + filter_action = "native", |
| 79 | + sort_action = "native", |
| 80 | + sort_mode = "multi", |
| 81 | + column_selectable = "single", |
| 82 | + row_selectable = "multi", |
| 83 | + row_deletable = TRUE |
| 84 | + ) |
75 | 85 | )
|
76 |
| - ) |
77 | 86 |
|
78 |
| - app$run_server() |
| 87 | + app$run_server() |
| 88 | + } |
0 commit comments