chart = {
const randomGenerator = d3.randomNormal( 0, width / 8 )
const data = d3.range(0,500).map(d => ({
x: randomGenerator(),
y: randomGenerator()
}))
const xScale = d3.scaleLinear([ -width/2, width/2 ], [ -width/2, width/2 ]),
yScale = d3.scaleLinear([ -height/2, height/2 ], [ -height/2, height/2 ])
const svg = d3.create('svg')
.attr('width', width)
.attr('height', height)
const container = svg.append('g')
.attr('class', 'container')
.attr('transform', `translate(${ width/2 },${ height/2 })`)
const points = container.selectAll('circle.point')
.data( data )
.join('circle')
.attr('class', 'point')
.attr('cx', d => xScale( d.x ))
.attr('cy', d => yScale( d.y ))
.attr('r', 8)
.style('fill', color)
.style('opacity', 0.8)
const xAxis = d3.axisBottom( xScale )
container.append('g').call( xAxis )
const yAxis = d3.axisLeft( yScale )
container.append('g').call( yAxis )
container.selectAll('.tick text').remove()
return svg.node()
}