plotly / plotly/plotly.R

Rangeslider start/end do not work with ggplotly

Open
#1,551 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug ggplotly
Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

This works:

d <- tibble::tibble(
  time = seq(as.Date("2016-01-01"), as.Date("2016-08-31"), by = "days"),
  y = rnorm(seq_along(time))
)

plot_ly(d, x = ~time, y = ~y) %>%
  add_lines() %>%
  rangeslider(start = d$time[5], end = d$time[50])

With ggplotly start/end are ignored. Why?

p <- d %>% ggplot(aes(x = time, y = y)) +
  geom_line()

ggplotly(p, dynamicTicks = T) %>% 
  rangeslider(start = d$time[5], end = d$time[50])

R version 3.6.0 (2019-04-26)
plotly ‘4.9.0’

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the direct plot_ly example and the ggplotly example from the issue, using the stated R and plotly versions. Compare the rangeslider behavior and trace how ggplotly handles rangeslider(start, end); done means the requested start and end dates work consistently with ggplotly.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.