Update app.py
Browse files
app.py
CHANGED
|
@@ -49,13 +49,23 @@ def create_plotly_tree():
|
|
| 49 |
|
| 50 |
def print_on_click(trace, points, selector):
|
| 51 |
print('Clicked')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
PLOTLY_TREE = create_plotly_tree()
|
| 55 |
node_trace = PLOTLY_TREE.data[1]
|
| 56 |
print('node_trace', node_trace)
|
| 57 |
print(node_trace.on_click)
|
| 58 |
-
node_trace.on_click(
|
| 59 |
|
| 60 |
print('PLOTLY_TREE', PLOTLY_TREE)
|
| 61 |
|
|
|
|
| 49 |
|
| 50 |
def print_on_click(trace, points, selector):
|
| 51 |
print('Clicked')
|
| 52 |
+
|
| 53 |
+
def update_point(trace, points, selector):
|
| 54 |
+
c = list(scatter.marker.color)
|
| 55 |
+
s = list(scatter.marker.size)
|
| 56 |
+
for i in points.point_inds:
|
| 57 |
+
c[i] = '#bae2be'
|
| 58 |
+
s[i] = 20
|
| 59 |
+
with f.batch_update():
|
| 60 |
+
scatter.marker.color = c
|
| 61 |
+
scatter.marker.size = s
|
| 62 |
|
| 63 |
|
| 64 |
PLOTLY_TREE = create_plotly_tree()
|
| 65 |
node_trace = PLOTLY_TREE.data[1]
|
| 66 |
print('node_trace', node_trace)
|
| 67 |
print(node_trace.on_click)
|
| 68 |
+
node_trace.on_click(update_point)
|
| 69 |
|
| 70 |
print('PLOTLY_TREE', PLOTLY_TREE)
|
| 71 |
|