Fix Bug of multiple circles over each other.

This commit is contained in:
Lorenz Padberg 2022-10-04 11:18:11 +02:00
parent 5a4ff1cfda
commit 87ab5ae194
1 changed files with 6 additions and 5 deletions

View File

@ -68,12 +68,13 @@ const radius = Math.min(width, height) / 2.4;
function render() { function render() {
const arrowStrokeWidth = 2; const arrowStrokeWidth = 2;
const svg = d3 const svg = d3.select(".circle-visualization");
.select(".circle-visualization") // Clean svg before adding new stuff.
.attr("viewBox", `0 0 ${width} ${height}`); svg.selectAll("*").remove();
// Append markter as definition to the svg // Append marker as definition to the svg
svg svg
.attr("viewBox", `0 0 ${width} ${height}`)
.append("svg:defs") .append("svg:defs")
.append("svg:marker") .append("svg:marker")
.attr("id", "triangle") .attr("id", "triangle")