{
const {x, y, width, height, margin} = setup;
const color = d3.scaleSequential(
d3.extent(iris_transformada, d => d.area_petalo),
d3.interpolateViridis
);
const radio = d3.scaleSqrt()
.domain(d3.extent(iris_transformada, d => d.area_petalo))
.range([2, 10]);
const svg = d3.create("svg")
.attr("width", width)
.attr("height", height);
svg.append("g")
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(d3.axisBottom(x));
svg.append("g")
.attr("transform", `translate(${margin.left},0)`)
.call(d3.axisLeft(y));
svg.selectAll("circle")
.data(iris_transformada)
.join("circle")
.attr("cx", d => x(d.longitud_sepalo))
.attr("cy", d => y(d.longitud_petalo))
.attr("r", d => radio(d.area_petalo))
.attr("fill", d => color(d.area_petalo))
.attr("opacity", 0.8);
const container = html`<div style="display: flex; gap: 40px; align-items: center;"></div>`;
container.appendChild(svg.node());
const legend = Legend(color, {title: "Área del pétalo"});
container.appendChild(legend);
return container;
}