Update app.py
Browse files
app.py
CHANGED
@@ -27,13 +27,13 @@ source = ColumnDataSource(data=data)
|
|
27 |
color_mapper = linear_cmap(field_name='id', palette=Viridis256[::-1], low=0, high=len(data['id']))
|
28 |
|
29 |
# Create the figure
|
30 |
-
p = figure(title="Scatter Plot with Image Hover", tools="hover", width=
|
31 |
<div>
|
32 |
<div><strong>@label</strong></div>
|
33 |
<div><img src="@image" ></div>
|
34 |
</div>
|
35 |
""")
|
36 |
-
p.circle('x', 'y', size=
|
37 |
|
38 |
# Add color bar
|
39 |
color_bar = ColorBar(color_mapper=color_mapper['transform'], width=8, location=(0, 0),
|
|
|
27 |
color_mapper = linear_cmap(field_name='id', palette=Viridis256[::-1], low=0, high=len(data['id']))
|
28 |
|
29 |
# Create the figure
|
30 |
+
p = figure(title="Scatter Plot with Image Hover", tools="hover", width=1500, height=1000, tooltips="""
|
31 |
<div>
|
32 |
<div><strong>@label</strong></div>
|
33 |
<div><img src="@image" ></div>
|
34 |
</div>
|
35 |
""")
|
36 |
+
p.circle('x', 'y', size=3, source=source, color=color_mapper) # Apply the color mapper
|
37 |
|
38 |
# Add color bar
|
39 |
color_bar = ColorBar(color_mapper=color_mapper['transform'], width=8, location=(0, 0),
|