-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I'm trying to understand the initAttr function:
function _initAttr(internalName, d3Name, defaultValue) {
if (!this.base.attr(d3Name)) {
this[internalName] = defaultValue;
this.base.attr(d3Name, defaultValue);
} else {
this[internalName] = this.base.attr(d3Name);
}
}It seems like after you use it
// make sure container height and width are set.
_initAttr.call(this, "_width", "width", 200);
_initAttr.call(this, "_height", "height", 200);these lines become unnecessary:
// setup some reasonable defaults
chart._width = chart.base.attr("width") || 200;
chart._height = chart.base.attr("height") || 200;since in either case (svg width/height are already set, or they're not) the initAttr function is assigning a value to this._width and this._height. What am I missing?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels