Skip to content

Commit c8aa409

Browse files
committed
Add points return type for scatter
1 parent 5e72097 commit c8aa409

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lightning/types/plots.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,23 @@ def clean(x, y, color=None, label=None, value=None, colormap=None, size=None, al
7171

7272
def selected(self):
7373
"""
74-
Selected points from scatter plot
74+
Selected points from scatter plot as indices
7575
"""
7676
user_data = self.get_user_data()['settings']
7777
if 'selected' in user_data.keys():
7878
return user_data['selected']
7979
else:
8080
return []
8181

82+
def points(self):
83+
"""
84+
Selected points from scatter plot as x,y coordinates
85+
"""
86+
user_data = self.get_user_data()['settings']
87+
if 'x' in user_data.keys() and 'y' in user_data.keys():
88+
return user_data['x'], user_data['y']
89+
else:
90+
return []
8291

8392
@viztype
8493
class Matrix(Base):

0 commit comments

Comments
 (0)