{
const boxHeight = 200;
const svg = d3.create('svg').attr('viewBox', [0, 0, width, boxHeight]);
const circleX = 100;
const circleY = boxHeight / 2;
const radius = 40;
const lineLength = 200;
const lineStart = [circleX + radius, circleY];
const lineEnd = [lineStart[0] + lineLength, circleY];
const markerBoxWidth = 20;
const markerBoxHeight = 20;
const refX = markerBoxWidth / 2;
const refY = markerBoxHeight / 2;
const markerWidth = markerBoxWidth / 2;
const markerHeight = markerBoxHeight / 2;
const arrowPoints = [[0, 0], [0, 20], [20, 10]];
svg
.append('defs')
.append('marker')
.attr('id', 'arrow')
.attr('viewBox', [0, 0, markerBoxWidth, markerBoxHeight])
.attr('refX', refX)
.attr('refY', refY)
.attr('markerWidth', markerBoxWidth)
.attr('markerHeight', markerBoxHeight)
.attr('orient', 'auto-start-reverse')
.append('path')
.attr('d', d3.line()(arrowPoints))
.attr('stroke', 'black');
svg
.append('circle')
.attr('cx', circleX)
.attr('cy', circleY)
.attr('r', radius)
.style('fill', 'green');
svg
.append('path')
.attr('d', d3.line()([lineStart, lineEnd]))
.attr('stroke', 'black')
.attr('marker-end', 'url(#arrow)')
.attr('fill', 'none');
svg
.append('circle')
.attr('cx', lineEnd[0] + markerWidth + radius)
.attr('cy', circleY)
.attr('r', radius)
.style('fill', 'green');
return svg.node();
}