plotly / plotly/plotly.js

No bar transition when uniformtext is used

Open
#4,789 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

See https://codepen.io/emmanuelle-plotly/pen/ExVWBdV : there is no transition, but if you remove the uniformtext parameters the transition works again. The corresponding Python code is

df = dict(val=[1, 4, 4, 3], x=['a', 'b', 'a', 'b'], frame=[1, 1, 2, 2])
fig = px.bar(df, x='x', y='val', animation_frame='frame', text='val')
# Comment the line below for transition to work again
fig.update_layout(uniformtext_minsize=20, uniformtext_mode='hide')
fig.update_traces(texttemplate='%{text}', textposition='inside')

fig.show()

This problem was first noticed on the forum https://community.plotly.com/t/bar-chart-animation-transition-breaks-when-uniformtext-in-layout/38394

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 with the linked CodePen reproduction and the provided Python example in Plotly.js. Compare the animated bar behavior with uniformtext_minsize and uniformtext_mode enabled versus removed, then confirm that the bar transition works while uniform text remains configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.