chart = {
const colors = ["#3f4e68", "#8aa496", "#aae5b7", "#e4ffa1", "#a7ca64", "#3e3a1d", "#22040a", "#530911", "#6c060e", "#b31919"]
const lines = [line, line2, line3, line4, line5];
const colorNow = colors[getRandomIntInclusive(1, colors.length-1)];
let animTime = 1000;
const svg = d3.select(DOM.svg(width, height))
.style("width", "100%")
.style("height", "auto");
for (let i = 0; i < data.length; i++) {
svg.selectAll("g")
.data([data[i]])
.enter()
.append("path")
.attr("class", "letterPart" + i)
.attr("fill", function () {
if (i==4 | i==8) return "white"
else return colorNow
})
.attr("fill-opacity", 1)
.attr("d", line);
}
function animateIt () {
for (let j = 0; j < data.length; j++) {
let thisClass = ".letterPart" + j;
svg.selectAll(thisClass)
.data([data[j]])
.transition()
.duration(2000)
.attr("d", d => {
let fn = lines[getRandomIntInclusive(0, lines.length-1)]
return fn(d)
})
}}
for (let k=0; k<20; k++) {
setTimeout(animateIt, animTime)
animTime += 2100;
}
return svg.node();
}