Spaces:
Runtime error
Runtime error
Nazneen Rajani
commited on
Commit
·
6c74904
1
Parent(s):
8e718d6
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,7 +67,7 @@ def data_comparison(df):
|
|
| 67 |
#data_kmeans['distance_from_centroid'] = data_kmeans.apply(distance_from_centroid, axis=1)
|
| 68 |
|
| 69 |
selection = alt.selection_multi(fields=['cluster','label'])
|
| 70 |
-
color = alt.condition(alt.datum.slice == 'high-loss', alt.Color('cluster:N', scale = alt.Scale(domain=df.cluster.tolist())), alt.value("lightgray"))
|
| 71 |
# color = alt.condition(selection,
|
| 72 |
# alt.Color('cluster:Q', legend=None),
|
| 73 |
# # scale = alt.Scale(domain = pop_domain,range=color_range)),
|
|
@@ -88,7 +88,7 @@ def data_comparison(df):
|
|
| 88 |
).interactive()
|
| 89 |
|
| 90 |
legend = alt.Chart(df).mark_point().encode(
|
| 91 |
-
y=alt.Y('cluster:
|
| 92 |
x=alt.X("label"),
|
| 93 |
shape=alt.Shape('label', scale=alt.Scale(
|
| 94 |
range=['circle', 'diamond']), legend=None),
|
|
|
|
| 67 |
#data_kmeans['distance_from_centroid'] = data_kmeans.apply(distance_from_centroid, axis=1)
|
| 68 |
|
| 69 |
selection = alt.selection_multi(fields=['cluster','label'])
|
| 70 |
+
color = alt.condition(alt.datum.slice == 'high-loss', alt.Color('cluster:N', scale = alt.Scale(domain=df.cluster.unique().tolist())), alt.value("lightgray"))
|
| 71 |
# color = alt.condition(selection,
|
| 72 |
# alt.Color('cluster:Q', legend=None),
|
| 73 |
# # scale = alt.Scale(domain = pop_domain,range=color_range)),
|
|
|
|
| 88 |
).interactive()
|
| 89 |
|
| 90 |
legend = alt.Chart(df).mark_point().encode(
|
| 91 |
+
y=alt.Y('cluster:N', axis=alt.Axis(orient='right'), title=""),
|
| 92 |
x=alt.X("label"),
|
| 93 |
shape=alt.Shape('label', scale=alt.Scale(
|
| 94 |
range=['circle', 'diamond']), legend=None),
|