Skip to content

Commit

Permalink
Update Heritage at Risk
Browse files Browse the repository at this point in the history
  • Loading branch information
slowe committed Nov 14, 2024
1 parent cf94f09 commit f1c24fb
Show file tree
Hide file tree
Showing 12 changed files with 1,317 additions and 43 deletions.
532 changes: 532 additions & 0 deletions pipelines/society/heritage-at-risk-2024.pl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/_includes/template/embed-national-churches-trust.njk
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ h1 { margin-top: 0; font-size: 2rem; }
panelSelector .capture[role="tabpanel"] { border-radius: 0; border: 0; padding-bottom: 2.5rem; }
.capture .oi-attribution:after { content: "Visualisation: National Churches Trust / Open Innovations"; position: absolute; top: 100%; left: 50%; transform: translate3d(-50%,0,0); background-image: url("data:image/svg+xml,%3Csvg width='1em' height='1em' overflow='auto' viewBox='-32 -32 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='oi-person'%3E%3Cpath d='m-32-32h64v64h-12v-24a4 4 0 0 0 -4 -4h-8a4 4 0 0 0 -4 4v24h-36zm44 27m-8 0a8 8 0 1 0 16 0 8 8 0 1 0-16 0' fill='%23fff'%3E%3C/path%3E%3C/mask%3E%3Cg id='oi-logo' fill='black'%3E%3Ccircle r='32' mask='url(%23oi-person)'%3E%3C/circle%3E%3C/g%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right; padding-right: 1.25rem; }
.oi-left, .oi-right { max-width: 100%; }
.oi-filter input { width: 21em; max-width: 80%; }
.oi-filter input { width: 21em; max-width: 80%; font-size: inherit; }
/*
.oi-filter .oi-filter-button { background: #E3051F; }
.oi-filter input { border-color: #E3051F; }
Expand Down
546 changes: 546 additions & 0 deletions src/themes/society/heritage-at-risk/_data/HAR2024.csv

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/themes/society/heritage-at-risk/embeds/_partials/all.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.constituencies",
"data": "sources.society.heritage-at-risk",
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ n }} ({{ MP }}, {{ Party }})"
"template": "{{ PCON24NM }} ({{ MP }}, {{ Party }})"
},{
"name": "All",
"template": "{{ Type→All }}"
Expand All @@ -15,7 +15,7 @@
"scale": "#ffffcc 0%, #b62126 80%, #771e1c 100%",
"min": 0,
"max": 100,
"matchKey": "PCON10CD",
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"items": [{
Expand Down Expand Up @@ -43,8 +43,8 @@
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ n }}</strong><br />{{ MP }} ({{ Party }})<br />All at risk: <strong>{{ All | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Name }}&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England)"
"tooltip": "<strong>{{ PCON24NM }}</strong><br />{{ MP }} ({{ Party }})<br />All at risk: <strong>{{ All | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ HAR name }}&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/annual-heritage-at-risk-registers-and-maps/\">Heritage at Risk Register</a> 2024 (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.constituencies",
"data": "sources.society.heritage-at-risk",
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ n }} ({{ MP }}, {{ Party }})"
"template": "{{ PCON24NM }} ({{ MP }}, {{ Party }})"
},{
"name": "Archaeology",
"template": "{{ Type→Archaeology }}"
Expand All @@ -15,7 +15,7 @@
"scale": "#ffffcc 0%, #b62126 80%, #771e1c 100%",
"min": 0,
"max": 100,
"matchKey": "PCON10CD",
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"items": [{
Expand Down Expand Up @@ -43,8 +43,8 @@
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ n }}</strong><br />{{ MP }} ({{ Party }})<br />Archaeology sites at risk: <strong>{{ Archaeology | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Name }}&hc=Scheduled Monument &searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England)"
"tooltip": "<strong>{{ PCON24NM }}</strong><br />{{ MP }} ({{ Party }})<br />Archaeology sites at risk: <strong>{{ Archaeology | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ HAR name }}&at=Archaeology&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/annual-heritage-at-risk-registers-and-maps/\">Heritage at Risk Register</a> 2024 (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.constituencies",
"data": "sources.society.heritage-at-risk",
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ n }} ({{ MP }}, {{ Party }})"
"template": "{{ PCON24NM }} ({{ MP }}, {{ Party }})"
},{
"name": "Building or structure",
"template": "{{ Type→Building or structure }}"
Expand All @@ -15,7 +15,7 @@
"scale": "#ffffcc 0%, #b62126 80%, #771e1c 100%",
"min": 0,
"max": 20,
"matchKey": "PCON10CD",
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"items": [{
Expand All @@ -40,8 +40,8 @@
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ n }}</strong><br />{{ MP }} ({{ Party }})<br />Buildings or structures at risk: <strong>{{ Building or structure | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Name }}&hc=All Listed Buildings&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England)"
"tooltip": "<strong>{{ PCON24NM }}</strong><br />{{ MP }} ({{ Party }})<br />Buildings or structures at risk: <strong>{{ Building or structure | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ HAR name }}&at=Building or structure&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/annual-heritage-at-risk-registers-and-maps/\">Heritage at Risk Register</a> 2024 (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.constituencies",
"data": "sources.society.heritage-at-risk",
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ n }} ({{ MP }}, {{ Party }})"
"template": "{{ PCON24NM }} ({{ MP }}, {{ Party }})"
},{
"name": "Conservation area",
"template": "{{ Type→Conservation area }}"
Expand All @@ -15,7 +15,7 @@
"scale": "#ffffcc 0%, #b62126 80%, #771e1c 100%",
"min": 0,
"max": 10,
"matchKey": "PCON10CD",
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"items": [{
Expand Down Expand Up @@ -43,8 +43,8 @@
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ n }}</strong><br />{{ MP }} ({{ Party }})<br />Conservation areas at risk: <strong>{{ Conservation area | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Name }}&hc=Conservation Area&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England)"
"tooltip": "<strong>{{ PCON24NM }}</strong><br />{{ MP }} ({{ Party }})<br />Conservation areas at risk: <strong>{{ Conservation area | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ HAR name }}&at=Conservation area&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/annual-heritage-at-risk-registers-and-maps/\">Heritage at Risk Register</a> 2024 (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.constituencies",
"data": "sources.society.heritage-at-risk",
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ n }} ({{ MP }}, {{ Party }})"
"template": "{{ PCON24NM }} ({{ MP }}, {{ Party }})"
},{
"name": "Place of worship",
"template": "{{ Type→Place of worship }}"
Expand All @@ -15,7 +15,7 @@
"scale": "#ffffcc 0%, #b62126 80%, #771e1c 100%",
"min": 0,
"max": 20,
"matchKey": "PCON10CD",
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"items": [{
Expand Down Expand Up @@ -52,8 +52,8 @@
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ n }}</strong><br />{{ MP }} ({{ Party }})<br />Places of worship at risk: <strong>{{ Place of worship | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Name }}&hc=Listed Place of Worship&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England)"
"tooltip": "<strong>{{ PCON24NM }}</strong><br />{{ MP }} ({{ Party }})<br />Places of worship at risk: <strong>{{ Place of worship | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ HAR name }}&at=Place of Worship&searchtype=harsearch\">More details</a>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/annual-heritage-at-risk-registers-and-maps/\">Heritage at Risk Register</a> 2024 (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
198 changes: 198 additions & 0 deletions src/themes/society/heritage-at-risk/embeds/place-of-worship-2024.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
---
title: Places of worship at risk
searchignore: true
updated: 2024-11-13T18:50+0100
layout: template/embed-national-churches-trust.njk
---
<style>
.tooltip .info { border-top: 4px solid black; }
.footnote { margin-bottom: 0; }
</style>

<p>Places of worship on <a href="https://historicengland.org.uk/advice/heritage-at-risk/search-register/" target="_parent">Historic England's Heritage at Risk Register</a> by UK Parliamentary Constituency.</p>


{% comp 'layout.panelSelector.set', { label: 'Choose the visualisation layer', titleSelector: "h3", position: "top" } %}

{% comp 'layout.panelSelector.panel', { id: "place-of-worship-hex", "title": "Cartogram", classes: "doublepadded" } %}

<p class="not-capture">This cartogram gives every constituency the same size - a hexagon - and that makes it a useful way to visualise the relative numbers of places at risk in different constituencies. Unlike the map view, this means that it is not an accurate representation of geography - so some constituencies may not be where you might expect - although it was <a href="https://open-innovations.org/blog/2024-03-05-uk-constituency-data-hex-maps" target="_parent">designed to keep regions/nations together</a>. Use the search <svg xmlns="https://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 12 13"><g stroke-width="2" stroke="currentColor" fill="none"><path d="M11.29 11.71l-4-4"></path><circle cx="5" cy="5" r="4"></circle></g></svg> to identify a particular constituency by name or by MP.</p>

{% comp "wrapper", {
"component": comp.oi.map.hex_cartogram,
"config": {
"width": 600,
"hexjson": "hexjson.uk-constituencies-2024",
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ Constituency }} ({{ MP }}, {{ Party }})"
},{
"name": "URL",
"template": "https://members.parliament.uk/member/{{ ID }}/contact"
}],
"value": "Type→Place of worship",
"scale": "#ffffcc 0%, #f4be49 20%, #e3051f 50%, #291009 100%",
"min": 0,
"max": 20,
"matchKey": "PCON24CD",
"legend":{
"position": "top right",
"continuous": true,
"items": [{
"value": 20,
"label": "20+"
},{
"value": 15,
"label": "15"
},{
"value": 10,
"label": "10"
},{
"value": 5,
"label": "5"
},{
"value": 0,
"label": "0"
}]
},
"tools":{
"filter":{
"label": "filterLabel"
}
},
"tooltip": "<strong>{{ Constituency }}</strong><div class=\"info\" style=\"border-color:{{ BG }};\"><a href=\"{{ URL }}\" target=\"_parent\">{{ MP }}</a> ({{ Party }})<br />Places of worship at risk: <strong>{{ Type→Place of worship | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Constituency }}&hc=Listed Place of Worship&searchtype=harsearch\" target=\"_parent\">More details</a></div>",
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2024-registers/\">Heritage at Risk 2024 Register</a> (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
{% endcomp %} {# end of selector panel #}

{% comp 'layout.panelSelector.panel', { id: "place-of-worship-map", "title": "Map", classes: "doublepadded" } %}

<p class="not-capture">This is a "heat map" view of the numbers of places at risk in different constituencies. This accurately represents the geographic placement of constituencies but can make it harder to see smaller constituencies. Use the search <svg xmlns="https://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 12 13"><g stroke-width="2" stroke="currentColor" fill="none"><path d="M11.29 11.71l-4-4"></path><circle cx="5" cy="5" r="4"></circle></g></svg> to identify a particular constituency by name or by MP.</p>

{% comp "wrapper", {
"component": comp.oi.map.svg,
"config": {
"width": 800,
"geojson": {
"data": "geojson.constituencies-2024",
"key": "PCON24CD"
},
"data": HAR2024,
"columns":[{
"name": "filterLabel",
"template": "{{ Constituency }} ({{ MP }}, {{ Party }})"
},{
"name": "URL",
"template": "https://members.parliament.uk/member/{{ ID }}/contact"
}],
"projection": {
"name": "osgb"
},
"padding": 30,
"layers": [{
"type": "data",
"key": "PCON24CD",
"value": "Type→Place of worship",
"scale": "#ffffcc 0%, #f4be49 20%, #e3051f 50%, #291009 100%",
"min": 0,
"max": 20,
"tooltip": "<strong>{{ Constituency }}</strong><div class=\"info\" style=\"border-color:{{ BG }};\"><a href=\"{{ URL }}\" target=\"_parent\">{{ MP }}</a> ({{ Party }})<br />Places of worship at risk: <strong>{{ Type→Place of worship | toLocaleString() }}</strong><br /><a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Constituency }}&hc=Listed Place of Worship&searchtype=harsearch\" target=\"_parent\">More details</a></div>"
}],
"legend":{
"position": "top right",
"continuous": true,
"items": [{
"value": 20,
"label": "20+"
},{
"value": 15,
"label": "15"
},{
"value": 10,
"label": "10"
},{
"value": 5,
"label": "5"
},{
"value": 0,
"label": "0"
}]
},
"bounds": {
"lat": { "min": 49.9, "max": 56 },
"lon": { "min": -6.5, "max": 2 }
},
"tools":{
"filter":{
"label": "filterLabel"
}
},
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\">Heritage at Risk 2023 Register</a> (Historic England) / Constituency boundaries: ONS"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
{% endcomp %} {# end of selector panel #}


{% comp 'layout.panelSelector.panel', { id: "place-of-worship-table", "title": "Table", classes: "doublepadded" } %}

<p>Click a column heading to sort the table by that column. Click again to reverse the order.</p>
{% comp "wrapper", {
"component": comp.oi.table,
"config": {
"colours": {
"Con":'#0485A8',
"Lab":'#DC4343',
'LD':'#EAA544',
'Green':'#5EBD4C',
'Brexit':'#0FA697',
'SNP':'#EBDB1C',
'UKIP':'#73537A',
'PC':'#4FBA7C',
'Ind':'#CCA7C6',
'DUP':'#BF3759',
'UUP':'#3b75a8',
'SF':'#2C604D',
'SDLP':'#53BC5B',
'Alliance':'#EAA544',
'Spk':'#909090',
'XSpk':'#909090',
'Monster':'#cccccc',
'WPB':'#1e28d8',
'none':'#dfdfdf'
},
"debug": true,
"sort": ["Places of worship at risk","Constituency"],
"reverse": true,
"width": "100%",
"data": HAR2024,
"columns":[{
"name": "Constituency",
"template": "<a href=\"https://historicengland.org.uk/advice/heritage-at-risk/search-register/results/?advsearch=1&par={{ Constituency }}&hc=Listed Place of Worship&searchtype=harsearch\" target=\"_parent\">{{ Constituency }}</a>",
"sortable": true
},{
"name": "Member of Parliament",
"template": "<a href=\"https://members.parliament.uk/member/{{ ID }}/contact\">{{ MP }}</a>",
"sortable": true
},{
"name": "Party",
"template": "{{ Party }}",
"sortable": true
},{
"name": "Places of worship at risk",
"template": "{{ Type→Place of worship }}",
"align": "center",
"scale": "#ffffcc 0%, #f4be49 20%, #e3051f 50%, #291009 100%",
"min": 0,
"max": 20,
"sortable": true
}],
"attribution": "Data: <a href=\"https://historicengland.org.uk/images-books/publications/har-2023-registers/\" target=\"_parent\">Heritage at Risk 2023 Register</a> (Historic England)"
},
"download": {"text": "Heritage at risk by constituency", "type": "CSV"}
} %}{% endcomp %}
{% endcomp %} {# end of selector panel #}
{% endcomp %} {# end of selector set #}
Loading

0 comments on commit f1c24fb

Please sign in to comment.