Estoy tratando de hacer algo similar a http://stuffin.space/ , donde resalto un objeto y muestro su ruta, pero solo cuando se desplaza el objeto. Con lo que tengo hasta ahora, puedo verlo funcionar una vez, pero es lento y no funciona después de la primera vez. Aquí está el código para esta sección.
var myPlot = document.getElementById('solarPlot') myPlot.on('plotly_hover', function(data){ var index = data.points[0].pointIndex var elem = data.points[0].data.elems[index] //Note that elems is something I stored as a part of plots previously to have the data available. It contains the bare minimum info to plot the trajectory. var newPlot = determinePlotFromElem(elem) //This returns a plot. The last line of the function is as below //{x:xs, y:ys, z:zs, mode:'lines', type: 'scatter3d', line:{color:color, width:1}, showlegend: false, hoverinfo:'skip'} //TODO: Set a better color for this plot! plots.push(newPlot) Plotly.react('solarPlot', plots, layout) }); myPlot.on('plotly_unhover', function(data){ plots = plots.slice(0,numPlots) //This limits the number of plots to the base plots Plotly.react('solarPlot', plots, layout) })En primer lugar, se tarda unos 2 segundos en crear los nuevos gráficos y una cantidad de tiempo similar para actualizar este gráfico temporal. ¿Hay una mejor manera de hacer esto, una que sea más rápida?