Skip to content

Grouped marks (area and line) filter differently on different channels #760

Closed
@mbostock

Description

@mbostock

The area and line marks have special filtering behavior for their positional channels (x and y for line; x1, y1, x2, and y2 for area). If some of the x values are NaN, for example, you’ll get gaps:

Screen Shot 2022-02-15 at 2 48 33 PM

Here x is defined as:

d => d.unemployment < 14 ? d.date : NaN

However, if I do something similar with the stroke channel, the line will interpolate across missing values:

Screen Shot 2022-02-15 at 2 46 54 PM

Here stroke is defined as:

d => d.unemployment < 14 ? d.division : NaN

The latter seems like a bug: it would be preferable to show gaps if any of the values are missing for required channels rather than interpolating over the missing values. This is related to the desire to specify custom reducers for grouped values, rather than being limited to just showing the first value for each group. #724

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions