Issue with marker size when using animated graph
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
When attempting to size markers in an animated graph, the sizing is incorrect unless the data.frame is first ordered correctly.
In the example below the markers should:
- Increase in size, then decrease again
- Decrease in size, then increase again
- Decrease in size
- Increase in size
- Iterate between small and large
I think it may have something to do with a warning I get 'arrange_()' is deprecated as of dplyr 0.7.0
Please use 'arrange()' instead
I'm using dplyr 1.0.0 and plotly 4.9.2.1
# data
data <- data.frame(xaxis = rep(as.character(c(1:5)), each = 10),
yaxis = rep(c(1:5,5:1), 5),
size = c(
c(seq(1,10,2), seq(10,1,-2)),
c(seq(10,1,-2), seq(1,10,2)),
c(1:10),
c(10:1),
rep(c(1,10), 5)
),
frame = c(1:10)
)
# example 1, unordered
plot_ly(
data = data,
x = ~xaxis,
y = ~yaxis,
frame = ~frame,
type = 'scatter',
marker = list(size = ~size*10),
mode = 'markers'
)
# example 2, ordered
data <- data[order(data$frame),]
plot_ly(
data = data,
x = ~xaxis,
y = ~yaxis,
frame = ~frame,
type = 'scatter',
marker = list(size = ~size*10),
mode = 'markers'
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied R reproducer with dplyr 1.0.0 and plotly 4.9.2.1, then trace animated marker sizing and the deprecated arrange_() path. Done means unordered data produces the five listed size patterns and the relevant deprecation warning is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- plotly, r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100