Changing Shapes in a Scatter Plot/Bubble Plot

The Plot Class defaults to showing all data as Circle elements. To change all of the shapes to use the Rectangle Class, set the shape property to "Rect". Additionally, an accessor function can instead be provided to the shape property in order to use different shapes for different elements.

var myData = [
  {"value": 100, "weight": .45,  "name": "alpha"},
  {"value": 70,  "weight": .60,  "name": "beta"},
  {"value": 40,  "weight": -.2,  "name": "gamma"},
  {"value": 15,  "weight": .1,   "name": "delta"},
  {"value": 5,   "weight": -.43, "name": "epsilon"},
  {"value": 1,   "weight": 0,    "name": "zeta"}

new d3plus.Plot()
    data: myData,
    groupBy: "name",
    shape: function(d) {
      if ( === "alpha" || === "delta" || === "epsilon") return "Rect";
      return "Circle";
    size: "value",
    x: "value",
    y: "weight"