visualization = {
const text = await FileAttachment("beeswarm-observable-example.svg").text();
const document = (new DOMParser).parseFromString(text, "image/svg+xml");
const svg = d3.select(document.documentElement).remove();
const _width = svg.attr("width");
const _height = svg.attr("height");
svg.attr("viewBox", `0 0 ${_width} ${_height}`);
svg.attr("width", null);
svg.attr("height", null);
const labels = svg.selectAll("g.labels text");
labels.style("opacity", 0);
labels.style("pointer-events", "none");
const groups = svg.selectAll("g#viz > g:not(#axis) > g");
groups.each(function(){
const _g = d3.select(this)
const circles = _g.selectAll("circle");
circles.style("cursor","pointer");
circles.each(function(d,i){
const index = i;
d3.select(this).on("click",function(){
const l = _g.selectAll("text").filter(function(e,j){return j===index})
const currentOpacity = l.style("opacity")
if (currentOpacity==0) {
l.style("opacity", 1)
} else {
l.style("opacity", 0)
}
})
})
})
return svg.node();
}