Spaces:
Build error
Build error
feat: Increase circle size and prettify grid
Browse files
app.py
CHANGED
@@ -55,8 +55,10 @@ def draw_interactive_scatter_plot(
|
|
55 |
hover = HoverTool(tooltips=[(text_column, "@text{safe}"), (label_column, "@original_label")])
|
56 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
57 |
colors = factor_cmap("label", palette=[Pallete[int(id_)] for id_ in values_color_set], factors=values_set)
|
58 |
-
p.circle("x", "y", size=
|
59 |
p.axis.visible = False
|
|
|
|
|
60 |
# p.xgrid.grid_line_color = None
|
61 |
# p.ygrid.grid_line_color = None
|
62 |
p.toolbar.logo = None
|
@@ -80,7 +82,7 @@ def generate_plot(
|
|
80 |
with st.spinner("Now trying to express them with my own words... π¬"):
|
81 |
embeddings_2d = get_tsne_embeddings(embeddings)
|
82 |
plot = draw_interactive_scatter_plot(
|
83 |
-
tws, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, encoded_labels, '
|
84 |
)
|
85 |
return plot
|
86 |
|
|
|
55 |
hover = HoverTool(tooltips=[(text_column, "@text{safe}"), (label_column, "@original_label")])
|
56 |
p = figure(plot_width=800, plot_height=800, tools=[hover], title='2D visualization of tweets', background_fill_color="#fafafa")
|
57 |
colors = factor_cmap("label", palette=[Pallete[int(id_)] for id_ in values_color_set], factors=values_set)
|
58 |
+
p.circle("x", "y", size=12, source=source, fill_alpha=0.4, line_color=colors, fill_color=colors)
|
59 |
p.axis.visible = False
|
60 |
+
p.xgrid.grid_line_dash = "dashed"
|
61 |
+
p.ygrid.grid_line_dash = "dashed"
|
62 |
# p.xgrid.grid_line_color = None
|
63 |
# p.ygrid.grid_line_color = None
|
64 |
p.toolbar.logo = None
|
|
|
82 |
with st.spinner("Now trying to express them with my own words... π¬"):
|
83 |
embeddings_2d = get_tsne_embeddings(embeddings)
|
84 |
plot = draw_interactive_scatter_plot(
|
85 |
+
tws, embeddings_2d[:, 0], embeddings_2d[:, 1], encoded_labels, encoded_labels, 'Tweet', 'Topic (-1 = None)'
|
86 |
)
|
87 |
return plot
|
88 |
|