chart = {
const div = html`<div class="waffle"></div>`
const waffle = d3.select(div)
const numbers = d3.range(100);
waffle
.selectAll('.block')
.data(numbers)
.enter()
.append('div')
.attr('class', 'block')
.style('background-color', d => {
if (d < threshold) {
return '#00A99D'
} else if (d < a2) {
return '#CC8685'
} else {
return '#CCCCCC'
}
})
.style('width', d => {
if (d < threshold && d >= a2) {
return '10px'
} else {
return '20px'
}
})
.style('height', d => {
if (d < threshold && d >= a2) {
return '10px'
} else {
return '20px'
}
})
.style('margin', d => {
if (d < threshold && d >= a2) {
return '9px'
} else {
return '4px'
}
})
return div
}