Skip to content

bisector no longer supports two-argument (object, value) comparator #249

@louking

Description

@louking

It looks like 22cdb3f broke my compare function, which used an array of objects.

I see I can use array of values, but wanted to point out this breaking change.

My compare function was

            that.bisectX = d3.bisector(function (d, x) {
                if (that.xascending) {
                    return d.x - x;
                } else {
                    return x - d.x;
                }
            }).left;

The breaking change is at

if (compare1(x, x) !== 0) return hi;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions