I was playing around with on_drag
features of bqplot
. and I noticed that it is slightly lagging..
I am not sure if this is
- real issue
- I do something inappropriate
- meant to work like it is
so the code I have is the following
from bqplot import pyplot as plt
import numpy as np
fig=plt.figure()
lin=plt.plot([0,1],
[0,0])
scatt1=plt.scatter([0],[0],colors=['Red'])
scatt2=plt.scatter([1],[0],enable_move=True)
plt.xlim(-3,3)
plt.ylim(-3,3)
fig.layout.height = '500px'
fig.layout.width = '500px'
plt.show()
def call_back2(name, value):
#print(value,name)
if value['point']:
X=value['point']['x']
Y=value['point']['y']
lin.x=[scatt1.x[0],(X-scatt1.x)[0]]
lin.y=[scatt1.y[0],(Y-scatt1.y)[0]]
scatt2.on_drag_start(call_back2)
scatt2.on_drag(call_back2)
scatt2.on_drag_end(call_back2)
it is simply two points connected and you can drag the blue one around what I notice is that the line ever so slightly lags behind the blue dot.