{
const height = 300
const svg = d3.create('svg')
.attr('viewBox', [0, 0, width, 300]);
const circle = svg.append('circle')
.attr('cx', width / 2)
.attr('cy', height / 2)
.attr('r', 80)
.attr('fill', 'green');
const defs = svg.append('defs')
const linearGradient = defs.append('linearGradient')
.attr('id', 'linear-gradient');
linearGradient
.attr('x1', '0%')
.attr('y1', '0%')
.attr('x2', '100%')
.attr('y2', '0%');
linearGradient.append('stop')
.attr('offset', '0%')
.attr('stop-color', 'yellow');
linearGradient.append('stop')
.attr('offset', '100%')
.attr('stop-color', 'red');
circle.style('fill', 'url(#linear-gradient)');
return svg.node();
}