map = {
const svg = d3.create('svg')
.attr("width", width)
.attr("height", 300)
.attr("viewBox", [0, 0, width, 300])
.attr(
"style",
"max-width: 100%; height: auto; height: intrinsic;border: solid 1px"
)
const circles = svg.append('g')
.attr('stroke', 200)
.attr('stroke-width', 2)
.attr('fill', 'gray')
function update(result, ratio){
circles.selectAll('circle')
.data(result.points)
.join('circle')
.attr('cx', d=>d[0])
.attr('cy', d=>d[1])
.attr('r', 5)
.style('opacity', (_, i) => result.pointsHash[i] > ratio ? '25%' : '100%' )
}
return {
svg,
update,
}
}