jfiel5 commited on
Commit
2f8aee4
·
verified ·
1 Parent(s): a8d482f

trying one more time (#9)

Browse files

- trying one more time (6fb620168b672b41e9de551e9b052681a725d8c5)

Files changed (1) hide show
  1. app.py +18 -19
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=["agency"],
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", "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
- bar_chart
101
-
102
- # box = (
103
- # alt.Chart(df_small)
104
- # .mark_boxplot(size=40)
105
- # .encode(
106
- # x=alt.X("Agency:N", title=""),
107
- # y=alt.Y("YTD Gross:Q", title="Salary Distribution"),
108
- # color=alt.value("#4C78A8")
109
- # )
110
- # .transform_filter(select_bar) # <--- THIS CONNECTS THE GRAPHS
111
- # .properties(width=120, height=800)
112
- # )
113
-
114
-
115
- # dashboard = bar_chart | box
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