Skip to content

Commit 3285ff6

Browse files
committed
suggest forcats; leverage automargins
1 parent 7055add commit 3285ff6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

demo/crosstalk-highlight-pipeline.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ base <- plot_ly(sd, color = I("black"), height = 400) %>%
88
p1 <- base %>%
99
summarise(miss = sum(is.na(median))) %>%
1010
filter(miss > 0) %>%
11-
arrange(miss) %>%
12-
add_bars(x = ~miss, y = ~factor(city, levels = city), hoverinfo = "x+y") %>%
11+
add_markers(x = ~miss, y = ~forcats::fct_reorder(city, miss), hoverinfo = "x+y") %>%
1312
layout(
1413
barmode = "overlay",
1514
xaxis = list(title = "Number of months missing"),
@@ -21,6 +20,5 @@ p2 <- base %>%
2120
layout(xaxis = list(title = ""))
2221

2322
subplot(p1, p2, titleX = TRUE, widths = c(0.3, 0.7)) %>%
24-
layout(margin = list(l = 120)) %>%
2523
hide_legend() %>%
2624
highlight(dynamic = TRUE, selectize = TRUE)

0 commit comments

Comments
 (0)