Spaces:
Build error
Build error
fix: Remove caption in favor of legend placement
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ def draw_interactive_scatter_plot(
|
|
106 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
107 |
colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
|
108 |
|
109 |
-
p.add_layout(Legend(title='Topics keywords', background_fill_alpha=0.2), '
|
110 |
p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="original_label")
|
111 |
p.axis.visible = False
|
112 |
p.xgrid.grid_line_dash = "dashed"
|
@@ -119,10 +119,10 @@ def draw_interactive_scatter_plot(
|
|
119 |
# p.legend.title = "Topics ID"
|
120 |
# p.legend.background_fill_alpha = 0.25
|
121 |
|
122 |
-
disclaimer = Label(x=0, y=0, x_units="screen", y_units="screen",
|
123 |
-
|
124 |
-
|
125 |
-
p.add_layout(disclaimer, "below")
|
126 |
|
127 |
return p
|
128 |
|
|
|
106 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
107 |
colors = factor_cmap("label", palette=[Pallete[n_colors][int(id_) + 1] for id_ in values_set], factors=values_set)
|
108 |
|
109 |
+
p.add_layout(Legend(title='Topics keywords', background_fill_alpha=0.2), 'above')
|
110 |
p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors, legend_group="original_label")
|
111 |
p.axis.visible = False
|
112 |
p.xgrid.grid_line_dash = "dashed"
|
|
|
119 |
# p.legend.title = "Topics ID"
|
120 |
# p.legend.background_fill_alpha = 0.25
|
121 |
|
122 |
+
# disclaimer = Label(x=0, y=0, x_units="screen", y_units="screen",
|
123 |
+
# text_font_size="14px", text_color="gray",
|
124 |
+
# text="Topic equals -1 means no topic was detected for such tweet")
|
125 |
+
# p.add_layout(disclaimer, "below")
|
126 |
|
127 |
return p
|
128 |
|