viz = {
const {visWidth, visHeight, margin} = dimensions;
const svg = d3.create('svg')
.attr('width', visWidth + margin.left + margin.right)
.attr('height', visHeight + margin.top + margin.bottom);
const g = svg.append('g')
.attr('font-family', 'sans-serif')
.attr('transform', `translate(${margin.left}, ${margin.top})`);
g.append('text')
.text(`Top 20 Keywords Video Youtube`)
const cells = g.selectAll('g')
.data(top20allNew)
.join('g')
.attr('transform', (d, i) => {
const r = Math.floor(i / numCols);
const c = i % numCols;
return `translate(${col(c)}, ${row(r)})`;
});
cells.append('path')
.attr('d', d => area(d.counts))
.attr('fill', 'blue');
cells.append('text')
.attr('font-size', 14)
.attr('font-weight', 600)
.attr('dominant-baseline', 'middle')
.attr('x', 10)
.attr('y', y(400))
.text(d => d.root)
const xAxes = cells.append('g')
.attr('transform', d => `translate(0,${row.bandwidth()})`)
.call(xAxis)
.call(g => g.select('.domain').remove())
.call(g => g.selectAll('line').attr('stroke', '#c0c0c0'));
const yAxes = cells.append('g')
.call(yAxis)
.call(g => g.select('.domain').remove())
.call(g => g.selectAll('line').attr('stroke', '#c0c0c0'));
return svg.node();
}