Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap and Contour traces disappear with figure animation. #4491

Closed
rottaj opened this issue Jan 16, 2020 · 1 comment
Closed

Heatmap and Contour traces disappear with figure animation. #4491

rottaj opened this issue Jan 16, 2020 · 1 comment

Comments

@rottaj
Copy link

rottaj commented Jan 16, 2020

There is an issue with the heat map and contour plots when used as a trace with animations. Attached is some code; when run the heat-map disappears when animation begins.

`
scatterDf = pd.DataFrame({'Time': scatterDataX, 'Depth': scatterDataY, 'TimeShow': scatterTime})
print(scatterDf, 'DF')

fig = go.Figure()

data = [go.Scatter(
x=[],
y=[],
mode='markers',
marker=dict(color='blue')
)]

dataX = list(scatterDf['Time'])
dataY = list(scatterDf['Depth'])

frames = [dict(data= [dict(type='scatter',
x=dataX[:k+1],
y=dataY[:k+1])],
traces= [1],
name='frame{}'.format(k)
)for k in range(1, len(scatterDf))]

layout = go.Layout(
autosize=True,
hovermode='closest',
)

sliders = [dict(steps= [dict(method= 'animate',
args= [[ 'frame{}'.format(k) ],
dict(mode= 'immediate',
frame= dict( duration=100, redraw= False ),
transition=dict( duration= 0)
)
],
label='{:d}'.format(k)
) for k in range(len(scatterDf))],
transition= dict(duration= 0 ),
x=0,#slider starting position
y=0,
currentvalue=dict(font=dict(size=12),
prefix='Point: ',
visible=True,
xanchor= 'center'),
len=1.0)
]

layout.update(updatemenus=[dict(type='buttons', showactive=False,
y=0,
x=1.05,
buttons=[dict(label='Play',
method='animate',
args=[None,
dict(frame=dict(duration=100,
redraw=False),
transition=dict(duration=0),
fromcurrent=True, mode='immediate')
]
)
]
)
],
sliders=sliders)

fig = go.Figure(data=data, layout=layout, frames=frames)
fig.update_yaxes(autorange="reversed", range=[5000, -1000])
fig.add_heatmap(z=z2, zauto=False, zmin=-1, zmax=1)
fig.show()

`

@etpinard
Copy link
Contributor

This ticket is essentially equivalent to #1019 but for heatmap and contour traces.

Please note that only scatter and bar traces support coordinate animations at the moment.

Future animation development can be tracked in #3456, so I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants