Skip to content

Commit f7bc521

Browse files
committed
provide a way to remove custom icon
1 parent 73ca1aa commit f7bc521

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## CHANGES
44

55
* Now requires a version of __ggplot2__ higher than 2.1.0 because the new ggproto faceting infrastructure introduced breaking changes.
6+
* A book icon is added to the mode bar, by default, which links to the plotly book. If you want to remove this icon from a plot `p`, do `config(p, modeBarButtonsToRemove = "Collaborate")`
67

78
## BUG FIXES
89

R/layout.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ config <- function(p, ...) {
7070
p$x$config[["modeBarButtonsToRemove"]] %||% 'sendDataToCloud',
7171
attrs[["modeBarButtonsToRemove"]]
7272
)
73+
# include the plotly book collaboration link?
74+
removeCollab <- "Collaborate" %in% p$x$config[["modeBarButtonsToRemove"]]
7375
if (length(p$x$config[["modeBarButtonsToRemove"]])) {
7476
p$x$config[["modeBarButtonsToRemove"]] <- list(p$x$config[["modeBarButtonsToRemove"]])
7577
}
7678
p$x$config[["modeBarButtonsToAdd"]] <- c(
77-
list(sharingButton()),
79+
if (!removeCollab) list(sharingButton()),
7880
attrs[["modeBarButtonsToAdd"]]
7981
)
8082
attrs <- attrs[grepl("modeBarButtonsTo", names(attrs))]

0 commit comments

Comments
 (0)