{
const svgHTML = html `<svg height="160" width="160" style="border: 1px solid #ccc" />`
const data = [ 0, 1, 2, 3, 4 ]
const maxHeight = 140
const xScale = d3.scaleOrdinal()
.domain( data )
.range([ 10, 40, 70, 100, 130 ])
const yScale = d3.scaleLinear()
.domain([ 0, 4 ])
.range([ 10, maxHeight ])
const colorScale = d3.scaleLinear()
.domain([ 0, 4 ])
.range(['#eee', 'steelblue'])
const svg = d3.select(svgHTML)
svg.selectAll('rect')
.data( data )
.join('rect')
.attr('width', 20)
.attr('y', 10)
.attr('x', (d) => xScale(d))
.attr('height', (d) => yScale(d))
.style('fill', (d) => colorScale(d))
return svgHTML
}