Public
Edited
Jan 23, 2024
Insert cell
Insert cell
constituencies = FileAttachment("Constituencies.json").json()
Insert cell
DublinNorthWest = constituencies[0][1]
Insert cell
Mayo = constituencies[1][1]
Insert cell
//circle = d3.geoCircle().center([-6.28, 53.4]).radius(0.03)()
Insert cell
Mayo_Map = Plot.plot({
projection: {
type: "albers",
domain: d3.geoCircle().center([-10.19, 54.15]).radius(.013)(),
rotate:([1, 0]),
parallels: ([50, 60]),
inset: "15"
},
style: {backgroundColor: "#89CFF0",},
width: 1100,
height: 800,
color: {
scheme: "Greens",
type: "quantize",
n: 5,
//domain: [1, 5000],
label: `Constituencies`,
legend: true
},
marks: [
Plot.geo(Mayo, Plot.centroid({
fill: "white",
//strokeOpacity: 0.15,
//fill: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//fill: d => choroplethData.get(d.properties.CON_SEAT_),
tip: true,
channels:{
Constituency: d => constituencyMap2023.get(d.properties.ENG_NAME_VALUE).properties.ENG_NAME_VALUE,
//Questions: d => choroplethData.get(d.properties.CON_SEAT_),
//Questions: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//Questions: d => filterByHeading.get(d.properties.CON_SEAT_),
}


})
),
//Plot.geo(countiesFile, Plot.centroid({
//fill: "white",
//strokeOpacity: 0.15,
//fill: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//fill: d => choroplethData.get(d.properties.CON_SEAT_),
//tip: true,
//channels:{
//County: d => d.properties.name
//Questions: d => choroplethData.get(d.properties.CON_SEAT_),
//Questions: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//Questions: d => filterByHeading.get(d.properties.CON_SEAT_),
//}


//})
// ),

Plot.geo(Mayo, {stroke: "black"}),
Plot.text(
Mayo,
Plot.centroid({
text: d => d.constituencyMap2023.get(d.properties.ENG_NAME_VALUE).properties.ENG_NAME_VALUE,
//textAnchor: "middle",
//stroke: "white",
fill: "black"
})
),
//Plot.text(
//countiesFile,
//Plot.centroid({
//text: d => countiesFile.get(d => d.properties.name),
//textAnchor: "middle",
//stroke: "grey",
//fill: "purple"
//})
//)
]
})
Insert cell
DublinNorthWest_Map = Plot.plot({
projection: {
type: "albers",
domain: d3.geoCircle().center([-6.28, 53.39]).radius(0.03)(),
rotate:([1, 0]),
parallels: ([50, 60]),
inset: "15"
},
style: {backgroundColor: "#89CFF0",},
width: 1100,
height: 800,
color: {
scheme: "Greens",
type: "quantize",
n: 5,
//domain: [1, 5000],
label: `Constituencies`,
legend: true
},
marks: [
Plot.geo(DublinNorthWest, Plot.centroid({
fill: "white",
//strokeOpacity: 0.15,
//fill: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//fill: d => choroplethData.get(d.properties.CON_SEAT_),
tip: true,
channels:{
Constituency: d => constituencyMap2023.get(d.properties.ENG_NAME_VALUE).properties.ENG_NAME_VALUE,
//Questions: d => choroplethData.get(d.properties.CON_SEAT_),
//Questions: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//Questions: d => filterByHeading.get(d.properties.CON_SEAT_),
}


})
),
//Plot.geo(countiesFile, Plot.centroid({
//fill: "white",
//strokeOpacity: 0.15,
//fill: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//fill: d => choroplethData.get(d.properties.CON_SEAT_),
//tip: true,
//channels:{
//County: d => d.properties.name
//Questions: d => choroplethData.get(d.properties.CON_SEAT_),
//Questions: d => filteredChoroplethHeadings.get(d.properties.CON_SEAT_),
//Questions: d => filterByHeading.get(d.properties.CON_SEAT_),
//}


//})
// ),

Plot.geo(DublinNorthWest, {stroke: "black"}),
Plot.text(
DublinNorthWest,
Plot.centroid({
text: d => d.constituencyMap2023.get(d.properties.ENG_NAME_VALUE).properties.ENG_NAME_VALUE,
//textAnchor: "middle",
//stroke: "white",
fill: "black"
})
),
//Plot.text(
//countiesFile,
//Plot.centroid({
//text: d => countiesFile.get(d => d.properties.name),
//textAnchor: "middle",
//stroke: "grey",
//fill: "purple"
//})
//)
]
})
Insert cell
import {constituencyMap2023} from "f5d57b8f9f6108cc"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more