createLabel = (parent, position, string) => {
const label = parent.append("text")
.attr("x", position.x)
.attr("y", position.y)
.text(string)
.attr('font-size', `${24}px`)
.attr('font-weight', 'bold')
.attr('font-family', `Roboto`)
.attr("alignment-baseline", "middle");
const textBox = label.node().getBBox();
return {
string,
box: {
x: position.x,
y: position.y,
width: textBox.width + labelPadding * 2,
height: textBox.height + labelPadding * 2
},
};
}