Skip to content

Commit

Permalink
Adding maps
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesdring committed Nov 21, 2023
1 parent 8848ffe commit a70d192
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ site.use(
},
colour: {
scales: {
YFF: '#000000 0%, #7D2248 33%, #e55912 62%, #f7ab3d 84%, #fcddb1 100%',
YFF: '#000000 0%, #7D2248 33%, #e55912 62%, #f7ab3d 84%, #fcddb1 100%'
},
names: yff.namedColours,
series: ['#E55912', '#005776', '#F7AB3D', '#4A783C'],
Expand Down
6 changes: 6 additions & 0 deletions src/_includes/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
text-align: center;
}

.dashboard-viz {
& svg {
height: min(40em, 30vh);
}
}

.auto-grid .oi-dashboard .panel h3 { font-size: 1.2em; }
/* OI dashboard component */
.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; }
Expand Down
4 changes: 4 additions & 0 deletions src/_includes/partials/dashboard.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{% endfor %}
</ul>

{% comp 'grid.masonry', { block_width: '20rem' } %}
{% include './dashboard/maps.njk' %}
{% endcomp %}

{% comp 'grid.masonry', { block_width: '20rem' } %}
{% include './dashboard/headlines.njk' %}
{% endcomp %}
Expand Down
53 changes: 53 additions & 0 deletions src/_includes/partials/dashboard/maps.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% set background = "#005776" %}

{% comp 'grid.block', {
link: '~/maps/neet-factors/index.njk' | url + '?map-selector=total-score',
background: background,
colour: 'white'
} %}

<h3>NEET factors</h3>

<p>
Likelihood of NEET outcome modelled on multiple factors by Local Authority.
</p>

<div class="dashboard-viz">
{{ comp.oi.map.hex_cartogram({
config: {
hexjson: search.data('/maps').uk_local_authority_districts_2021,
data: search.data('/maps/neet-factors').view.total_score.rows,
matchKey: 'local_authority_code',
value: 'value',
scale: 'YFF',
tooltip: '{{ n }}: <strong>{{ value | toFixed(2) }}</strong>'
}
}) | simpleviz | safe }}
</div>
{% endcomp %}

{% comp 'grid.block', {
link: '~/maps/employment/index.njk' | url + '?map-selector=census-youth-unemployed-economically-inactive',
background: background,
colour: 'white'
} %}
<h3>Employment</h3>

<p>
Propoprtion of young people unemployed, economically inactive and not in full-time education by parliamentary consituency.
</p>

<div class="dashboard-viz">
{{ comp.oi.map.hex_cartogram({
config: {
hexjson: search.data('/maps').constituencies,
data: search.data('/maps/employment').view.census_unemployed_or_economically_inactive_and_not_in_fte_youth.rows,
matchKey: 'geography_code',
value: 'rate',
scale: 'YFF',
tooltip: '{{ n }}: <strong>{{ rate | toFixed(1) }}%</strong>'
}
}) | simpleviz | safe }}
</div>

{% endcomp %}
File renamed without changes.

0 comments on commit a70d192

Please sign in to comment.