lengend = {
const svg = d3
.create("svg")
.attr('viewBox', [0, 0, width, width])
const gradient = DOM.uid();
svg.append("radialGradient")
.attr("id", gradient.id)
.attr("gradientUnits", "userSpaceOnUse")
.attr("cx", "0%")
.attr("cy", "0%")
.attr("fr", fromRadius+"%")
.attr("r", toRadius+"%")
.selectAll("stop")
.data(d3.ticks(0, 1, 10))
.join("stop")
.attr("offset", d=>d)
.attr("stop-color", colorScale);
const group = svg.append('g')
.attr('transform', `translate(${width/2}, ${width/2})`)
group.append('rect')
.attr('x', width/100 * fromRadius)
.attr('width', (toRadius-fromRadius) * width/100)
.attr('height', 20)
.attr('fill', `url(#${gradient.id})`)
return svg.node()
}