{
const width = window.innerWidth
const height = Math.min(width / 1.5, 400);
const canvas = document.getElementById('canvas');
canvas.width = width;
canvas.height = height;
const rc = rough.canvas(document.getElementById('canvas'));
const projection = d3.geoAlbersUsa()
.fitSize([width,height], us_geo)
.translate([width/2,(height/2)]);
let geoPath = d3.geoPath()
.projection(projection)
us_geo.features.forEach(function(d,i){
let winner = us_2024_results[d.properties.STUSPS].winner;
rc.path(geoPath(d), {
fill: winner == 'gop' ? '#CC0B07' : '#015b90',
roughness: roughness,
bowing: bowing,
hachureAngle: randomiseAngle ? Math.random() * hachureAngle : hachureAngle,
hachureGap: hachureGap,
fillStyle: fillStyle,
fillWeight: fillWeight,
stroke: "black",
strokeWidth: strokeWidth,
simplification: simplification,
});
})
}