bliss 2.0: flint: Added data index selector
Closes #4450 (closed)
Provide a select_data_index
API for the live and custom scatter plot.
This also fixes the interactive selection on scatter. This was probably broken since the viewer refactoring.
Tested with the following
flint()
amesh(sx, 0,0.01,1,sy,0,0.01,1,0.01,diode1)
p = flint().get_live_plot("default-scatter")
print(p.select_data_index())
And
import numpy
# Create the plot
f = flint()
p = f.get_plot("scatter", name="My plot")
# Create the data and setup the plot
y, x = numpy.ogrid[:10, :10]
x, y = numpy.zeros_like(y) + x, numpy.zeros_like(x) + y
x, y = x.flatten(), y.flatten()
v = numpy.sin(numpy.sqrt((x-5)**2 + (y-5)**2))
p.set_data(x, y, v)
# The colormap can be updated
p.set_colormap(lut="red")
print(p.select_data_index())
This have to be backported in BLISS 2.1.
In the master it would be good to try to rework the selection API in order to dispatch it in each plot clients.
There is some way to reduce the amount of request
/selected
API which exists in the general flint API.
Edited by Valentin Valls