xxxxxxxxxx
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0;padding: 20px;}
input{height: 20px}
</style>
</head>
<body>
<div>
<input type="range" min="0" max="75" value="50" id="myRange"/>
</div>
<script>
const svg = d3.select("body")
.append("svg")
.attr("width",160)
.attr("height",160)
.style("background-color","white")
const colorScale = d3.scaleOrdinal()
.domain([0,1,2,3,4])
.range(
[
'#7fc97f',
'#beaed4',
'#fdc086',
'#ffff99',
'#386cb0'
])
const circle = svg.append("circle")
.attr("cx",80)
.attr("cy",80)
.attr("r",50)
.attr("stroke","black")
.attr("stroke-width",3)
.attr("fill","#7fc97f")
d3.select("#myRange").on("input", function(d){
value = this.value
circle.attr("r",value)
})
</script>
</body>
</html>
https://d3js.org/d3.v5.min.js