Skip to content

Commit

Permalink
Update Leeds-2023 charts
Browse files Browse the repository at this point in the history
  • Loading branch information
taz-chiles committed Oct 25, 2024
1 parent 52e0322 commit 0705bc7
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 108 deletions.
14 changes: 0 additions & 14 deletions scripts/dummy-data.py

This file was deleted.

6 changes: 5 additions & 1 deletion scripts/leeds-2023/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def fuzzy_match_leeds_wards(data, ward_name_col="ward", ward_code_col="ward_code
'Total tickets sold': tickets_by_date['tickets'].sum()
}, index=[0])

headlines = headlines.melt(var_name='title', value_name='value')
# headlines = headlines.melt(var_name='title', value_name='value')

headlines.to_csv(os.path.join(DATA_DIR, 'events_ticketing_headlines.csv'), index=False)

Expand Down Expand Up @@ -150,7 +150,11 @@ def fuzzy_match_leeds_wards(data, ward_name_col="ward", ward_code_col="ward_code

# Write summary CSV
summary = pd.DataFrame.from_dict(summary, orient="index", columns=['value']).sort_index()

summary = summary.reset_index().rename(columns={'index': 'title'})

summary = summary.set_index('title').T

summary.to_csv(os.path.join(DATA_DIR, 'schools_headlines.csv'), index=False)


Expand Down
8 changes: 2 additions & 6 deletions src/_data/viz/leeds_2023/events_ticketing_headlines.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
title,value
Total events,1069
Total in person attendances,129954
Total online attendances,21416
Total ticket orders,11
Total tickets sold,87388
Total events,Total in person attendances,Total online attendances,Total ticket orders,Total tickets sold
1069,129954,21416,11,87388
13 changes: 2 additions & 11 deletions src/_data/viz/leeds_2023/schools_headlines.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
title,value
Date build,2024-06-19
Earliest date,2022-11-01
Engagements with pupils not assigned to ward,2860
Engagements with schools not assigned to ward,23
Percentage of Leeds schools engaged,65.9%
Schools in Leeds,346
Schools not assigned to ward,31
Total pupil engagements,35376
Total school engagements,501
Unique schools,228
Date build,Earliest date,Engagements with pupils not assigned to ward,Engagements with schools not assigned to ward,Percentage of Leeds schools engaged,Schools in Leeds,Schools not assigned to ward,Total pupil engagements,Total school engagements,Unique schools
2024-10-25,2022-11-01,2860,23,65.9%,346,31,35376,501,228
5 changes: 3 additions & 2 deletions src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/* OI Viz */

.axis-grid-title { font-family: var(--oi-main-fontstack); font-weight: 600; font-size: 1.3em;}
.axis-grid-title { font-family: var(--oi-main-fontstack); font-weight: 600; font-size: 1.2em;}
.oi-viz { padding-bottom:0.5em;}
.oi-map-hex { padding-bottom:0;}
.oi-map-hex text { fill: #ffffff;}
Expand All @@ -36,7 +36,7 @@
.oi-dashboard .oi-dashboard-inner { --auto-dashboard-min-size: 200px; width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--auto-dashboard-min-size)), 1fr)); grid-gap: 1em; }
.oi-dashboard .panel h3 { font-weight: 400; font-size: 1.2em; text-align: center; }
.oi-dashboard .panel { padding: 2em; background: #91cfce; color: #0a2f45; display: grid; }
.oi-dashboard .bignum { font-size: 4em; line-height: 1.25em; font-weight: bold; text-align: center; display: block; margin-top: 0; }
.oi-dashboard .bignum { font-size: 2.5rem; line-height: 1.25em; font-weight: bold; text-align: center; display: block; margin-top: 0; }
.oi-dashboard .footnote { font-size: 0.8em; text-align: center; display: block; }
.oi-dashboard { grid-gap: 0.5rem!important;}

Expand All @@ -50,6 +50,7 @@
}

.oi-chart-bar line { stroke: #004563!important; stroke-opacity: 0.3; }
.oi-chart-line line { stroke: #004563!important; stroke-opacity: 0.3; }

@media screen and (max-width: 1200px) {
.oi-dashboard { grid-gap: 1.5vw; }
Expand Down
103 changes: 50 additions & 53 deletions src/leeds-2023-legacy/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ title: LEEDS 2023 Legacy Dashboard
</p>
</div>

{{
comp.oi.dashboard({
config: {
data: "viz.leeds_2023.events_ticketing_headlines",
title: "title",
value: "value",
width: "20%",
panels: [{
name: "Total events"
},{
name: "Total in person attendances"
},{
name: "Total online attendances"
},{
name: "Total tickets sold"
}]
}
}) | safe
}}
{% comp "dashboard.panels", { columns: 3 } %}

{% comp "dashboard.pane" %}
<h3>Total events</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.events_ticketing_headlines['rows'][0]['Total events'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total in person attendances</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.events_ticketing_headlines['rows'][0]['Total in person attendances'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total tickets sold</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.events_ticketing_headlines['rows'][0]['Total tickets sold'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% endcomp %}

<div class="block">

Expand All @@ -38,25 +40,34 @@ title: LEEDS 2023 Legacy Dashboard
The Year of Culture offered children and young people a chance to take part in a creative learning programme - from creative workshops and participatory challenges to classroom resources and activities. Their school engagements linked back to the curriculum, so that pupils' experiences aligned with learning goals. They developed a free, inclusive programme to support cultural and creative education in Leeds schools, engaging with students across all parts of the city. The data shown below was extracted from Airtable, the data management system run internally within LEEDS 2023.
</p>

{{
comp.oi.dashboard({
config: {
data: "viz.leeds_2023.schools_headlines",
title: "title",
value: "value",
width: "20%",
panels: [{
name: "Total school engagements"
},{
name: "Unique schools"
},{
name: "Total pupil engagements"
},{
name: "Percentage of Leeds schools engaged"
}]
}
}) | safe
}}
{% comp "dashboard.panels", { columns: 4 } %}

{% comp "dashboard.pane" %}
<h3>Total<br>events</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Total school engagements'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total in person attendances</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Unique schools'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total tickets<br>sold</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Total pupil engagements'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total tickets<br>sold</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Percentage of Leeds schools engaged'], fontsize: '2.5rem', suffix: '%' } %}
{% endcomp %}
{% endcomp %}

{% endcomp %}


<div class="read-more">
<a href="/leeds-2023-legacy/school-engagement/">READ MORE</a>
Expand Down Expand Up @@ -110,11 +121,6 @@ title: LEEDS 2023 Legacy Dashboard
</li>
</ul>

{# <div class="read-more">
<a href="/leeds-2023-legacy/volunteers/">READ MORE</a>
</div> #}


</div>

<div class="block">
Expand Down Expand Up @@ -176,11 +182,6 @@ title: LEEDS 2023 Legacy Dashboard
</li>
</ul>

{# <div class="read-more">
<a href="/leeds-2023-legacy/media-coverage/">READ MORE</a>
</div> #}


</div>

<div class="block">
Expand Down Expand Up @@ -215,11 +216,7 @@ title: LEEDS 2023 Legacy Dashboard

</ul>

{# <div class="read-more">
<a href="/leeds-2023-legacy/social-analytics/">READ MORE</a>
</div> #}

</div>
</div>



50 changes: 29 additions & 21 deletions src/leeds-2023-legacy/school-engagement/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,33 @@ title: Engagement with Children & Young People
The creative learning programme was designed to be inclusive, engaging with schools across all wards in Leeds and interacting with young people in areas previously underserved by creative and cultural education.
</p>

{{
comp.oi.dashboard({
config: {
data: "viz.leeds_2023.schools_headlines",
title: "title",
value: "value",
width: "20%",
panels: [{
name: "Total school engagements"
},{
name: "Unique schools"
},{
name: "Total pupil engagements"
},{
name: "Percentage of Leeds schools engaged"
}]
}
}) | safe
}}
{% comp "dashboard.panels", { columns: 4 } %}

{% comp "dashboard.pane" %}
<h3>Total<br>events</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Total school engagements'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total in person attendances</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Unique schools'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total tickets<br>sold</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Total pupil engagements'], fontsize: '2.5rem' } %}
{% endcomp %}
{% endcomp %}

{% comp "dashboard.pane" %}
<h3>Total tickets<br>sold</h3>
{% comp "dashboard.big_number", { number: viz.leeds_2023.schools_headlines['rows'][0]['Percentage of Leeds schools engaged'], fontsize: '2.5rem', suffix: '%' } %}
{% endcomp %}
{% endcomp %}

{% endcomp %}

{% comp "dashboard.panels", { columns: 1 } %}

Expand Down Expand Up @@ -327,5 +335,5 @@ title: Engagement with Children & Young People
}]
}
}) | safe
}} #}

}} #}

0 comments on commit 0705bc7

Please sign in to comment.