Re:Show HN: Textures.js, SVG Patterns for Data Visualization
by ricsca on Wednesday March 18, 2015 @10:23AM
(#9225647)
Interesting point. I simply relied o this post of Mike Bostock http://bost.ocks.org/mike/chart/.
[ Parent
| on HN ]
Re:Show HN: Textures.js, SVG Patterns for Data Visualization
by wayfarer2s on Wednesday March 18, 2015 @10:59AM
(#9225943)
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.
Re:Show HN: Textures.js, SVG Patterns for Data Visualization
by bkirwi on Wednesday March 18, 2015 @12:32PM
(#9226680)
Yeah, it makes sense to mimic the D3 style: the only thing worse than a bad convention is two conventions.
Re:Show HN: Textures.js, SVG Patterns for Data Visualization
by findjashua on Wednesday March 18, 2015 @10:38AM
(#9225762)
imho, if the operations are to be performed in a certain order, use chaining. Otherwise, passing a config object is much cleaner