mapSVG = {
var selector = 'roughmap';
let svg = d3.select('#roughmap');
var rc = rough.svg(document.getElementById('roughmap'));
let feat = d3
.json(
"https://gist.githubusercontent.com/rveciana/181f41663ae9cef7c00ad80cd085f413/raw/63a2b578f5d9536ca51c49e71f3d6a429ae93392/us.json"
)
.then(us => {
var projection = d3.geoAlbersUsa();
var mappath = d3.geoPath().projection(projection);
var colorScale = d3.scaleOrdinal(d3.schemeCategory10);
var features = topojson.feature(us, us.objects.states).features;
svg
.selectAll('.state')
.data(features)
.enter()
.append('g')
.attr('class', 'state');
d3.selectAll('.state').each(function(d, i) {
d3.select(this)
.node()
.appendChild(
rc.path(mappath(d), {
fill: colorScale(d.id),
fillStyle: 'cross-hatch',
roughness: 3,
simplification: 5,
fillWeight: 1.5
})
);
});
});
}