chart_all_provinces = {
const chart_with = 250
const container_width = width < 700 ? width: width > 1300? width - 800: width-400
const chart_gap_x = 20
const chart_gap_y = chart_gap_x * 1.2
const cols = Math.floor( container_width / ( chart_width + chart_gap) )
const label_height = 30
const svg = d3.create("svg")
.attr("viewBox", [0, 0, container_width, (chart_width + chart_gap_y) * (Math.ceil( 32 / cols) )])
.style("font", "10px sans-serif");
const chart_offset = ( container_width - (cols * chart_width + ( cols - 1 )* chart_gap ) ) / 2
const all_trees = svg.selectAll('g')
.data(provinces_nested)
.join('g')
.attr('transform', (d, i) => `translate(${Math.floor(i % cols) * (chart_width + chart_gap) + chart_offset }, ${Math.floor(i / cols) * (chart_width + chart_gap_y)})`)
const leaf = all_trees.selectAll('g')
.data(d => treemap(d, chart_width).leaves())
.join('g')
.attr("transform", d => `translate(${d.x0},${d.y0 + label_height})`);
leaf.append('rect')
.attr("fill", d => color(d.data.key))
.attr("fill-opacity", .95)
.attr("width", d => d.x1 - d.x0)
.attr("height", d => d.y1 - d.y0);
const region_name = all_trees
.append('text')
.attr("x", 2)
.attr('y', label_height-5)
.attr('font-size', 12)
.attr('font-weight', 'bold')
.attr('fill', '#666666')
.text( d => `${d.key}`);
return svg.node()
}