chart = {
const width = 400;
const height = 400;
const svg = d3.create("svg").attr("width", width).attr("height", height);
const gridData = d3.range(9);
const x = d3.scaleLinear().domain(d3.extent(gridData)).range([0, width]);
const y = d3.scaleLinear().domain(d3.extent(gridData)).range([0, height]);
const gridG = svg
.append("g")
.attr("stroke", "#000")
.attr("stroke-dasharray", "4,4")
.attr("stroke-opacity", 0.2);
gridG
.selectAll("line.x")
.data(gridData)
.join("line")
.classed("x", true)
.attr("x1", 0)
.attr("y1", y)
.attr("x2", width)
.attr("y2", y);
gridG
.selectAll("line.y")
.data(gridData)
.join("line")
.classed("y", true)
.attr("x1", x)
.attr("y1", 0)
.attr("x2", x)
.attr("y2", height);
const g = svg
.append("g")
.attr("transform", `translate(${width / 2}, ${height / 2})`);
const clonedExternalSvg = d3.select(externalSvg).clone(true);
clonedExternalSvg.attr("viewBox", null);
clonedExternalSvg.attr("width", null);
clonedExternalSvg.attr("height", null);
g.node().appendChild(clonedExternalSvg.node());
const clonedFourSvg = d3.select(fourSVG).clone(true);
clonedFourSvg.attr("viewBox", null);
clonedFourSvg.attr("width", null);
clonedFourSvg.attr("height", null);
g.node().appendChild(clonedFourSvg.node());
svg.append("g").call(appendSVG, externalSvg);
svg.append("g").call(appendSVG, fourSVG);
return svg.node();
}