const tooltip = ((() => {
const tip = d3.tip()
.attr('class', 'd3-tip')
.offset([50, 10]);
return (svgSelection, state) => {
tip.html(d => [
`
${state.radius}: `,
`${d[state.radius]}
`,
`${state.x}: `,
`${d[state.x]}
`,
`${state.y}: `,
`${d[state.y]}
`,
`${state.color}: `,
`${d[state.color]}
`,
].join(''));
svgSelection.call(tip);
return {
show: tip.show,
hide: tip.hide,
};
};
})());