plotly / plotly/plotly.R

Legend name not passed when using frame animation

Open
#2,344 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

Legend names are sometimes not passed when using frame option.

#This is working (without frame)
plot_ly()%>%add_markers(1:3,2:4)%>%add_markers(1:3,2:4,name="New name")

#This is not (with frame)
plot_ly()%>%add_markers(1:3,2:4,frame=c(1,1,2))%>%add_markers(1:3,2:4,frame=c(1,2,2),name="New name")

#This is working (with frame) ! 
#This works apparently because frame 1 is repeated twice (frame=c(1,1,2) is okay but frame=c(1,2,3) is not)
plot_ly()%>%add_markers(1:3,2:4,frame=c(1,1,2))%>%add_markers(1:3,2:4,frame=c(1,1,2),name="New name")

[Package plotly version 4.10.4]

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

Reproduce the three plot_ly() examples from the issue with plotly R version 4.10.4, comparing legend names when frame values repeat versus when they differ. Trace the frame animation handling to identify where the second trace's name is lost; done means the named legend entry is preserved for distinct frames without breaking the working cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.