Hacker News new | past | comments | ask | show | jobs | submit login

An initial config object would probably be ideal, and then you could have the chaining to supplement those values. You could have the initial method take in the config and use the values in that in place of the defaults. So

  textures.circles()
    .radius(4)
    .fill("transparent")
    .strokeWidth(2);
could initially be

  var circles = textures.circles({
    radius: 4,
    fill: "transparent",
    strokeWidth: 2 
  });
and later updated to be

  circles.strokeWidth( 1 );
Which works rather nicely especially when the config object is generated dynamically.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: