You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sounds like the picking for scatters is not implemented for scatter, with raster rendering.
So for now in Flint i use a fallback, which is probably always used.
from silx.gui.plot.items.scatter import Scatter
def isScatter(item):
return isinstance(item, Scatter)
results = list(plot.pickItems(x, y, isScatter))
for result in results:
indices = result.getIndices(copy=False)
return indices
if len(results) == 0:
selectedScatter = plot.getActiveScatter()
# Pick on the active curve with a higher tolerance
if selectedScatter is not None:
index = __closest(selectedScatter, x, y)
return index
def __closest(scatter, x, y) -> int | None:
"""Returns the closest index from a scatter item"""
xx = scatter.getXData()
yy = scatter.getYData()
if xx is None or len(xx) == 0:
return None
dist = (xx - x) ** 2 + (yy - y) ** 2
index = numpy.nanargmin(dist)
return index
The text was updated successfully, but these errors were encountered:
Sounds like the picking for scatters is not implemented for scatter, with raster rendering.
So for now in Flint i use a fallback, which is probably always used.
The text was updated successfully, but these errors were encountered: