{
const margin = {top: 40, right: 0, bottom: 0, left: 60};
const svg = d3.create('svg')
.attr('width', matrixWidth + margin.left + margin.right)
.attr('height', matrixHeight + margin.top + margin.bottom);
const g = svg.append("g")
.attr("transform", `translate(${margin.left}, ${margin.top})`);
const xAxis = d3.axisTop(x).tickSize(0);
g.append("g")
.call(xAxis)
.call(g => g.selectAll(".domain").remove())
.append("text")
.attr("x", matrixWidth / 2)
.attr("y", -margin.top + 5)
.attr("fill", "black")
.attr("text-anchor", "middle")
.attr("dominant-baseline", "hanging")
.text("Target");
const yAxis = d3.axisLeft(y).tickSize(0);
g.append("g")
.call(yAxis)
.call(g => g.selectAll(".domain").remove())
.append("text")
.attr("x", -margin.left)
.attr("y", matrixHeight / 2)
.attr("fill", "black")
.attr("dominant-baseline", "middle")
.attr("text-anchor", "start")
.text("Source");
return svg.node();
}