Skip to content

Commit cc00623

Browse files
committed
add name checking for config attributes
1 parent e830583 commit cc00623

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

NEWS.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
* **plotly** objects can now be serialized and unserialized in different environments (i.e., you can now use `saveRDS()` to save an object as an rds file and restore it on another machine with `readRDS()`). Note this object is *dynamically* linked to JavaScript libraries, so one should take care to use consistent versions of **plotly** when serializing and unserializing (#1376).
1919
* The `plotly_example()` will now attempt to open the source file(s) used to run the example. Set `edit = FALSE` to prevent the source file(s) from opening.
2020
* The `event_data()` function now relays the (official plotly.js) `customdata` attribute in similar fashion to (unofficial) `key` attribute (#1423).
21-
21+
* An informative warning is now thrown if invalid argument names are supplied to `config()`.
2222

2323
## CHANGES
2424

2525
* The 'collaborate' button no longer appears in the modebar, and as a result, the `config()` function no longer has a `collaborate` argument.
26-
27-
## CHANGES
28-
2926
* Since plotly.js now defaults to *not* showing the "Edit in Chart Studio" button, the `cloud` argument in `config()` was removed. If you want to show this button, use the new plotly.js `showSendToCloud` config attribute instead (e.g. `config(plot_ly(), showSendToCloud = TRUE)`)
3027

3128
## BUG FIXES

R/utils.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ verify_attr_names <- function(p) {
425425
c(names(Schema$layout$layoutAttributes), c("barmode", "bargap", "mapType")),
426426
"layout"
427427
)
428+
attrs_name_check(
429+
names(p$x$config),
430+
names(Schema$config),
431+
"config"
432+
)
428433
for (tr in seq_along(p$x$data)) {
429434
thisTrace <- p$x$data[[tr]]
430435
attrSpec <- Schema$traces[[thisTrace$type %||% "scatter"]]$attributes

0 commit comments

Comments
 (0)