function renderLineSegment(types, x1, x2, y1, y2) {
if (!(types instanceof Array)) {
throw new TypeError('Parameter "types" of must be an array');
}
const segments = canvas.selectAll("g.segment");
segments.filter(d => types.indexOf(d.type) > -1).append("line")
.attr("x1", x1 * spacing)
.attr("x2", x2 * spacing)
.attr("y1", y1 * spacing)
.attr("y2", y2 * spacing);
}