Minor post-merge comment:
```js
var opacity = goog.isDef(weight) ? goog.math.clamp(weight, 0, 1) : 1;
```

Assuming it will be common not to have a weight attribute/function, it would be nice to avoid the clamping.