mk_chart = function() {
const [rootdiv, svg, g] = initChart();
svg.attr("viewBox", [dim.mid.nW, dim.mid.nH, dim.W, dim.H]);
g.attr('tranform', `translate(${dim.mgs.g}, ${dim.mgs.s})`)
.attr("class", "shape")
.append("path")
.attr("d", shape_gen);
const line = d3.line()
.x((d) => rect_border.x(d[0]))
.y((d) => rect_border.y(d[1]))
.curve(d3.curveLinearClosed);
g.append('path')
.datum(rect_border.data)
.attr("class", "shape-border")
.attr('d', line);
rootdiv.appendChild(svg.node());
rootdiv.append(style)
return rootdiv;
}