Glad it was helpful!
So, starting with the error… I believe the issue is because selectedData
can be None
(for example, when the app renders the first time), therefore the type error raised. You can add a conditional testing for not None
to avoid it.
As for the multiple selections and saving the selected list, there are at least two approaches:
-
layout.clickmode = 'event+select'
makes it possible to select multiple points simultaneously by holding shift. While this does not save the selection anywhere, it does allow you to have multiple points selected at once. It can work in simple cases, but maybe not in yours -
A better approach, where the selection is actually saved, can be found in this old post. Take a look and see if it fits your case.