Commit
·
0cb5b70
1
Parent(s):
f616ac0
Add sidebar with how to use instructions.
Browse files
app.py
CHANGED
@@ -98,9 +98,29 @@ fig.update_layout(
|
|
98 |
plot_bgcolor="rgba(0, 0, 0, 0)",
|
99 |
paper_bgcolor="rgba(0, 0, 0, 0)"
|
100 |
)
|
|
|
101 |
x, y = 0.0, 0.0
|
|
|
102 |
# Display the scatterplot and capture click events
|
103 |
selected_points = plotly_events(fig, click_event=True, hover_event=False, override_height=600, override_width="100%")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
with st.form(key="form1"):
|
105 |
# If a point is clicked, handle the embedding inversion
|
106 |
if selected_points:
|
|
|
98 |
plot_bgcolor="rgba(0, 0, 0, 0)",
|
99 |
paper_bgcolor="rgba(0, 0, 0, 0)"
|
100 |
)
|
101 |
+
|
102 |
x, y = 0.0, 0.0
|
103 |
+
|
104 |
# Display the scatterplot and capture click events
|
105 |
selected_points = plotly_events(fig, click_event=True, hover_event=False, override_height=600, override_width="100%")
|
106 |
+
|
107 |
+
# Sidebar for additional information
|
108 |
+
st.sidebar.header("Scatter Plot Info")
|
109 |
+
st.sidebar.write("""
|
110 |
+
This scatter plot visualizes the UMAP dimensionality reduction of Reddit post titles.
|
111 |
+
Each point represents a post, with similar titles being positioned closer together.
|
112 |
+
""")
|
113 |
+
st.sidebar.write("Use the form below to select coordinates or click on a point in the scatter plot.")
|
114 |
+
st.sidebar.markdown("---")
|
115 |
+
|
116 |
+
st.sidebar.header("How to Use")
|
117 |
+
st.sidebar.write("""
|
118 |
+
1. **Click a point** in the scatter plot to see the corresponding coordinates.
|
119 |
+
2. **Adjust the coordinates** using the form inputs if needed.
|
120 |
+
3. **Submit** to see the reconstructed text output.
|
121 |
+
""")
|
122 |
+
|
123 |
+
# Form for inputting coordinates
|
124 |
with st.form(key="form1"):
|
125 |
# If a point is clicked, handle the embedding inversion
|
126 |
if selected_points:
|