chart = {
const svg = d3.create('svg')
.attr('viewBox', [0, 0, width, height]);
const wrapper = svg.append('g')
.attr('transform', `translate(${margin.left}, ${margin.top})`);
wrapper.append('g')
.call(xAxis);
const circles = wrapper.selectAll('circle')
.data(work2019)
.join('circle')
.attr('r', d => circleScale(d.minuten))
.attr('fill', d => color(d.typ))
.attr('stroke', '#fff');
d3.timeout(() => {
for (var i = 0, n = Math.ceil(Math.log(force.alphaMin()) /
Math.log(1 - force.alphaDecay())); i < n; ++i) {
force.tick();
circles
.attr('cx', d => d.x)
.attr('cy', d => d.y);
}
})
return Object.assign(svg.node(), {force});
}