No bar transition when uniformtext is used
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
There is no easy fix for this until we could revise transition code.
So at the moment, this is the expected behaviour for bar-like traces as well as treemap & sunburst.
BTW I will tag this as a bug & documentation.
Curious whether there are any updates on this issue
Can confirm same behaviour applies for Treemaps
Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson
@gvwilson This issue is still happening on 3.0.1 js code on the sunburst chart.
Sample js code:
var data = [{
type: "sunburst",
labels: ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
parents: ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
values: [10, 14, 12, 10, 2, 6, 6, 4, 4],
outsidetextfont: {size: 20, color: "#377eb8"},
leaf: {opacity: 0.4},
marker: {line: {width: 2}},
}];
var layout = {
margin: {l: 0, r: 0, b: 0, t: 0},
width: 500,
height: 500,
uniformtext: {
mode: 'hide', /* if commented out, transitions work; when not commented out, transitions do not work */
minsize: 10
},
};
var config = {
displayModeBar : false,
displaylogo : false,
responsive : false
};
Plotly.newPlot('myDiv', data, layout, config);