Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,53 +43,20 @@ scatter = (
|
|
43 |
)
|
44 |
|
45 |
# Bottom Panel: Bar Chart (Square Footage Distribution by Year Acquired)
|
46 |
-
#--------------
|
47 |
-
|
48 |
-
# Data preparation for visualization
|
49 |
-
acquisition_data = data['Year Acquired'].value_counts().reset_index()
|
50 |
-
acquisition_data.columns = ['Year Acquired', 'Building Count']
|
51 |
-
|
52 |
-
# # Create Altair bar chart
|
53 |
-
# bar_chart = alt.Chart(acquisition_data).mark_bar().encode(
|
54 |
-
# x=alt.X('Year Acquired:O', title='Year Acquired', sort='-x'),
|
55 |
-
# y=alt.Y('Building Count:Q', title='Number of Buildings'),
|
56 |
-
# tooltip=['Year Acquired', 'Building Count']
|
57 |
-
# ).properties(
|
58 |
-
# title="Number of Buildings Acquired Over the Years",
|
59 |
-
# width=600,
|
60 |
-
# height=400
|
61 |
-
# )
|
62 |
bar_chart = (
|
63 |
-
alt.Chart(
|
64 |
.mark_bar()
|
65 |
.encode(
|
66 |
-
x="
|
67 |
-
y=alt.Y("
|
68 |
color=alt.condition(click, color, alt.value("lightgray")),
|
69 |
-
tooltip=[
|
70 |
)
|
71 |
.transform_filter(brush)
|
72 |
-
.properties(width=550, title="
|
73 |
.add_params(click)
|
74 |
)
|
75 |
|
76 |
-
# st.altair_chart(bar_chart, use_container_width=True)
|
77 |
-
|
78 |
-
#--------------
|
79 |
-
# bar_chart = (
|
80 |
-
# alt.Chart(data)
|
81 |
-
# .mark_bar()
|
82 |
-
# .encode(
|
83 |
-
# x="Square Footage:Q",
|
84 |
-
# y=alt.Y("Year Acquired:Q", title="Year Acquired"),
|
85 |
-
# color=alt.condition(click, color, alt.value("lightgray")),
|
86 |
-
# tooltip=["Square Footage", "Year Acquired"]
|
87 |
-
# )
|
88 |
-
# .transform_filter(brush)
|
89 |
-
# .properties(width=550, title="Square Footage Distribution by Year Acquired")
|
90 |
-
# .add_params(click)
|
91 |
-
# )
|
92 |
-
|
93 |
# Combined Chart
|
94 |
chart = alt.vconcat(scatter, bar_chart, title="Building Inventory Insights")
|
95 |
|
|
|
43 |
)
|
44 |
|
45 |
# Bottom Panel: Bar Chart (Square Footage Distribution by Year Acquired)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
bar_chart = (
|
47 |
+
alt.Chart(data)
|
48 |
.mark_bar()
|
49 |
.encode(
|
50 |
+
x="Agency Name:O",
|
51 |
+
y=alt.Y("Year Acquired:Q", title="Year Acquired"),
|
52 |
color=alt.condition(click, color, alt.value("lightgray")),
|
53 |
+
tooltip=["Agency Name", "Year Acquired"]
|
54 |
)
|
55 |
.transform_filter(brush)
|
56 |
+
.properties(width=550, title="Agency Name Distribution by Year Acquired")
|
57 |
.add_params(click)
|
58 |
)
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
# Combined Chart
|
61 |
chart = alt.vconcat(scatter, bar_chart, title="Building Inventory Insights")
|
62 |
|