Skip to content

scatter symbol size accessor #1205

@gordonwoodhull

Description

@gordonwoodhull

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions