Spaces:
Sleeping
Sleeping
trying one more time (#9)
Browse files- trying one more time (6fb620168b672b41e9de551e9b052681a725d8c5)
app.py
CHANGED
|
@@ -79,7 +79,7 @@ alt.data_transformers.disable_max_rows()
|
|
| 79 |
df_small=df[['Agency','YTD Gross']].copy()
|
| 80 |
|
| 81 |
select_bar = alt.selection_point(
|
| 82 |
-
fields=["
|
| 83 |
on="click",
|
| 84 |
clear="true"
|
| 85 |
)
|
|
@@ -91,26 +91,25 @@ bar_chart = (
|
|
| 91 |
.encode(
|
| 92 |
y=alt.Y("Agency:N", sort="-x"),
|
| 93 |
x=alt.X("YTD Gross:Q", title="Total YTD Gross"),
|
| 94 |
-
tooltip=["Agency:N", "
|
| 95 |
color=alt.condition(select_bar, alt.value("#4C78A8"), alt.value("#CCCCCC"))
|
| 96 |
)
|
| 97 |
.add_params(select_bar)
|
| 98 |
.properties(width=500, height=800)
|
| 99 |
)
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
# dashboard
|
|
|
|
| 79 |
df_small=df[['Agency','YTD Gross']].copy()
|
| 80 |
|
| 81 |
select_bar = alt.selection_point(
|
| 82 |
+
fields=["Agency"],
|
| 83 |
on="click",
|
| 84 |
clear="true"
|
| 85 |
)
|
|
|
|
| 91 |
.encode(
|
| 92 |
y=alt.Y("Agency:N", sort="-x"),
|
| 93 |
x=alt.X("YTD Gross:Q", title="Total YTD Gross"),
|
| 94 |
+
tooltip=["Agency:N", "YTD Gross:Q"],
|
| 95 |
color=alt.condition(select_bar, alt.value("#4C78A8"), alt.value("#CCCCCC"))
|
| 96 |
)
|
| 97 |
.add_params(select_bar)
|
| 98 |
.properties(width=500, height=800)
|
| 99 |
)
|
| 100 |
+
|
| 101 |
+
box = (
|
| 102 |
+
alt.Chart(df_small)
|
| 103 |
+
.mark_boxplot(size=40)
|
| 104 |
+
.encode(
|
| 105 |
+
x=alt.X("Agency:N", title=""),
|
| 106 |
+
y=alt.Y("YTD Gross:Q", title="Salary Distribution"),
|
| 107 |
+
color=alt.value("#4C78A8")
|
| 108 |
+
)
|
| 109 |
+
.transform_filter(select_bar) # <--- THIS CONNECTS THE GRAPHS
|
| 110 |
+
.properties(width=120, height=800)
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
dashboard = bar_chart | box
|
| 115 |
+
dashboard
|
|
|