function ScatterPlot(){ var model = Model(); Reactivis(model) .svg() .margin() .xScale().xAxis() .yScale().yAxis() .rScale() .colorScale() .resize(); model.when(["g", "data", "x", "y", "r", "color"], function(g, data, x, y, r, color){ var circles = g.selectAll("circle").data(data); circles.enter().append("circle"); circles .attr("cx", x) .attr("cy", y) .attr("r", r) .attr("fill", color) circles.exit().remove(); }); return model; }