-
-
Notifications
You must be signed in to change notification settings - Fork 31
Dash for R v0.5.0 #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dash for R v0.5.0 #205
Changes from all commits
5c83f5c
d20daa8
0845184
29a3042
bbfc6cc
2e09789
c947c73
8e3c168
5d485d9
5c2ea67
cd33eba
f866d38
7e16f8d
4b99c88
2ca3f98
68be6a9
1d5ee2d
e852995
22227f6
006b6d3
93345e6
e6c460a
8c9678b
61e6dfa
ca6613c
fb05d18
85828d3
e4cedb3
cc9e06d
3733ead
2f1be58
6eddf98
a2907ba
98254a1
402969d
d7dcae7
c03c6c1
030adb4
744b696
c853cbf
7c26675
49c97da
21e78db
2c46d9f
0085036
ab702e9
6772b25
b03eccd
1a21232
12d1469
9721087
80576d4
28d30d4
6e0212d
d030347
bd704cd
f0e7dff
0032d96
08a9824
b3fbde2
406f8ae
9f7d33e
e082bc4
1cb3412
40c62a5
7b9c80e
8c05ad5
c1fecf9
c0c9201
a4d9dec
7f75aab
f976757
7d6bc60
1952be7
8fce87c
5a1beb0
0e7ddad
984324e
9385233
6fb198c
82d8b01
b84729b
0241ea6
e8db472
dc002a0
6d9553e
4af8d7c
b3be88d
9107258
cee4b03
b6a0026
15c6615
2f4136d
1aa6f65
e91e6ff
a58b885
6cb8351
9eff393
22c0480
df1f096
d5207c1
a7aa5cb
756adcd
4e227f9
7319e09
b69c9d3
d9176b9
ef2160d
a15b186
8e9ccb1
64a6d71
0f82fec
9d817be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,18 @@ | ||
| # Change Log for Dash for R | ||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| ## [0.5.0 ] - 2020-05-28 | ||
| ### Added | ||
| - Dash for R now depends on the `brotli` package explicitly; previously it was loaded when importing `reqres`. [#204](https://github.com/plotly/dashR/pull/204) | ||
|
|
||
| ### Changed | ||
| - Dash for R no longer wraps the layout in an `htmlDiv` internally, for parity with Dash for Python. Starting in v0.5.0, the `layout` method only accepts a single argument, and that argument must be a Dash component or a function that returns a Dash component. [#121](https://github.com/plotly/dashR/pull/121) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this mean for the majority of apps? Any changes folks will need to do to make sure their apps don't do something odd?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @josegonzalez Good question; ultimately, it means that code like this: app$layout(
htmlDiv("Some text"),
htmlDiv("Some more text")
)is no longer treated as valid. It now needs to be wrapped within a div, with the children passed as a list: app$layout(
htmlDiv(
list(
htmlDiv("Some text"),
htmlDiv("Some more text")
)
)
)This was an artifact of the initial implementation (from the very, very beginning of Dash for R), which supported passing components as I'd consider this a breaking change-level modification, but now is the time to 🔪 the offending code, before we reach v1.0. |
||
| - Package documentation has been significantly refactored to use new features of `roxygen2` when documenting R6 classes | ||
| - The `title` method now specifies `Dash` as the default application title instead of `dash`. [#200](https://github.com/plotly/dashR/pull/200) | ||
|
|
||
| ### Fixed | ||
| - A minor bug in `validate_keys` which prevented `interpolate_index` from working as intended has been resolved | ||
|
|
||
| ## [0.4.1] - 2020-05-08 | ||
| ### Fixed | ||
| - Callbacks with multiple outputs which return one or more components are now permitted; a bug previously prevented their use, fixed in [#198](https://github.com/plotly/dashR/pull/198) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| Package: dash | ||
| Title: An Interface to the Dash Ecosystem for Authoring Reactive Web Applications | ||
| Version: 0.4.1 | ||
| Version: 0.5.0 | ||
| Authors@R: c(person("Chris", "Parmer", role = c("aut"), email = "[email protected]"), person("Ryan Patrick", "Kyle", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5829-9867"), email = "[email protected]"), person("Carson", "Sievert", role = c("aut"), comment = c(ORCID = "0000-0002-4958-2844")), person("Hammad", "Khan", role = c("aut"), email = "[email protected]"), person(family = "Plotly Technologies", role = "cph")) | ||
| Description: A framework for building analytical web applications, Dash offers a pleasant and productive development experience. No JavaScript required. | ||
| Depends: | ||
|
|
@@ -20,7 +20,8 @@ Imports: | |
| digest, | ||
| base64enc, | ||
| mime, | ||
| crayon | ||
| crayon, | ||
| brotli | ||
| Suggests: | ||
| testthat | ||
| Collate: | ||
|
|
@@ -38,7 +39,7 @@ License: MIT + file LICENSE | |
| Encoding: UTF-8 | ||
| LazyData: true | ||
| KeepSource: true | ||
| RoxygenNote: 6.1.1 | ||
| RoxygenNote: 7.1.0 | ||
| Roxygen: list(markdown = TRUE) | ||
| URL: https://github.com/plotly/dashR | ||
| BugReports: https://github.com/plotly/dashR/issues | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,15 +15,6 @@ is.event <- function(x) is.dependency(x) && inherits(x, "event") | |
| # components (TODO: this should be exported by dashRtranspile!) | ||
| is.component <- function(x) inherits(x, "dash_component") | ||
|
|
||
| # layout is really a special type of component | ||
| is.layout <- function(x) { | ||
| is.component(x) && identical(x[["props"]][["id"]], layout_container_id()) | ||
| } | ||
|
|
||
| layout_container_id <- function() { | ||
| "_dashR-layout-container" | ||
| } | ||
|
|
||
| # retrieve the arguments of a callback function that are dash inputs | ||
| callback_inputs <- function(func) { | ||
| compact(lapply(formals(func), function(x) { | ||
|
|
@@ -338,8 +329,8 @@ insertIntoCallbackMap <- function(map, inputs, output, state, func, clientside_f | |
| clientside_function=clientside_function | ||
| ) | ||
| if (length(map) >= 2) { | ||
| ids <- lapply(names(map), function(x) dash:::getIdProps(x)$ids) | ||
| props <- lapply(names(map), function(x) dash:::getIdProps(x)$props) | ||
| ids <- lapply(names(map), function(x) getIdProps(x)$ids) | ||
| props <- lapply(names(map), function(x) getIdProps(x)$props) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the namespace removal?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @josegonzalez The What's particularly strange is that this was added to access a function within the same package, no idea why I or anyone else did this, but in any event the CRAN check is careful to disallow this behaviour for submitted packages (and with good reason). Very much a 🙈 moment. |
||
|
|
||
| outputs_as_list <- mapply(paste, ids, props, sep=".", SIMPLIFY = FALSE) | ||
|
|
||
|
|
@@ -1341,10 +1332,13 @@ interpolate_str <- function(index_template, ...) { | |
| return(template) | ||
| } | ||
|
|
||
| validate_keys <- function(string) { | ||
| validate_keys <- function(string, is_template) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the signature change impact existing calls to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @josegonzalez
The change makes it possible to use the same function for both of those methods, which pass different arguments to Both are matched against a list of necessary keys, and a useful error message thrown if the required keys are not present. |
||
| required_keys <- c("app_entry", "config", "scripts") | ||
|
|
||
| keys_present <- vapply(required_keys, function(x) grepl(x, string), logical(1)) | ||
| if (is_template) | ||
| keys_present <- vapply(required_keys, function(x) grepl(x, string), logical(1)) | ||
| else | ||
| keys_present <- vapply(required_keys, function(x) x %in% string, logical(1)) | ||
|
|
||
| if (!all(keys_present)) { | ||
| stop(sprintf("Did you forget to include %s in your index string?", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add this as an enhancement :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😹 I had forgotten to restore Percy after disabling it on a day where the tests were behaving strangely, so this was basically done in passing.