chart_3 = {
var width = 700,
height = 700
projection.fitSize([width, height], data_h3);
const svg = d3.select(DOM.svg(800, 800))
.style("width", width)
.style("height", height);
const g = svg.append("g")
g.selectAll("path")
.data(data_h3.features)
.enter().append("path")
.attr("d", path)
.attr('stroke', '#000')
.attr("fill", function(d) {
console.log(d.properties.h3, expression[d.properties.h3])
return expression[d.properties.h3]
})
.attr("d", path)
.attr("transform", "translate(0," + 30 + ")")
svg.append("g")
.attr("transform", "translate(400,40)")
.call(legend);
svg.append("text")
.attr("y", 760)
.attr("fill", "currentColor")
.attr("text-anchor", "start")
.attr("font-size", "10")
.attr("font-family", "Helvetica")
.text("Source: Observatorio de Ciudades UC (2017); GOPLACEIT (2019)");
return svg.node();
}