Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Plotly.animate events functions

Hi,

I’m updating a 3D scatter in real-time with the following way:
Plotly.animate(‘3D’, {
data: update,
traces: [0]
}, {
// These 2 make sure the plot updates as quickly as possible:
transition: { duration: 0 },
frame: { duration: 0, redraw: false }
});

I would like to use an event function to do something on the new dot.
I know that there is this event listener:
.on(‘plotly_animated’, function() {
console.log(‘animated’)
});

But I cannot access to the data. Any idea ?
Furthermore, I would like to “blink” the dot during 5sec, how can I give this king of animation style to my new data ?

Thanks a lot.
Regards.

var gd  = document.getElementById('graph')

Plotly.animate(gd, /* */)

gd.on(‘plotly_animated’, function() {
   // the graph's data is liked to gd.data
});