@soali You can animate your points, i.e. in each frame add new points. Here is the Plotly tutorial for offline and online animation: https://plot.ly/python/animations/.
Thank You! @empet I appreciate it. I have been playing around with animations and am still not able to achieve the goal. Is there a way, using animations and the frames, to update an existing plot as new data (a trace) is being received by the program? Something like this: https://i.stack.imgur.com/1HROm.gif
@soali, You can animate 3d points as in your gif. This example of 3d animation could inspire you to simulate the motion of those 3d points: https://plot.ly/~empet/14891
I have created this in matplotlib. Could you please tell me what is the way to reproduce this in dash?
2D live plotting I am able to achieve. How to do 3D?
This is the only change you have to make to get your lines rotated:
t = np.linspace(0, 10, 12)
x, y, z = np.cos(t), np.sin(t), t
fig= go.Figure(go.Scatter3d(x=x, y=y, z=z, mode='lines', line_width=5)) #you can define your own lines here
Eventually you can change in updatemenus, the frame duration to get the desired speed of rotation.
Thank you for your reply. I have achieved phenomenal graphing in both 2D and 3D, interactive, live, transparent and much more. I will be putting up the code in some time for others to refer.
Meanwhile, Iโm stuck with one issue. I have a 2D Graph component. I have pan and zoom option available by default. But how do I achieve rotate option also along the 2D plane interactively with a mouse click like this jsfiddle: https://jsfiddle.net/xpaz8etg/
PS: I have statically enabled rotation with CSS transform property. But I want to be interactive to the user to set the orientation. I tried implementing the code from above fiddle into Dash but failed. It doesnโt seem to work.
@Hi@rahulrajpl,
I reproduced the square rotation in this notebook https://plot.ly/~empet/15514, but the rotation is controlled by a slider not the mouse.
With Plotly you cannot use the mouse to rotate a shape clockwise with some angle, and then suddenly to change the sense of rotation.
As you can notice, playing with the animated rotation, when the slider is moved to the right, the square rotates clockwise about its center, while moving it to the left, the direction of rotation is counter-clockwise.
I think that you should ask this question under a separate title, because here the title is irrelevant for this answer.
@rahulrajpl, Could you, please, (re)open a new question with the title: " Animating rotation of a planar shape about a point" , such that interested users can find it when searching a related topic topic?