-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
From SO: dc.js scatter plot with variable symbol size
It would be great to allow the scatter plot's symbol size to be data-driven.
Currently the size is determined by whether the point is brushed or filtered (scatter-plot.js):
_symbol.size(function (d, i) {
if (!_existenceAccessor(d)) {
return _emptySize;
} else if (_filtered[i]) {
return Math.pow(_symbolSize, 2);
} else {
return Math.pow(_excludedSize, 2);
}
});We could add a symbolSizeAccessor and make the anonymous function above into the default value. And/or we could provide direct access to the _symbol member. (The former is more dc-like, the latter is arguably more powerful.)
In general, it should be possible to map any visual attribute to data, and then things like brushing and filtering are just cascading data-driven styles on top of the base styles. This is the direction I'm going in dc.graph.js. We'd still have good defaults, but the user should be able to change which attribute has which meaning.