Skip to content

Typing issue with BinInputs #2307

@Learath2

Description

@Learath2

I'm not quite sure if this would be considered a bug (or whether it's really fixable), but the snippet below has a type error unless the type is asserted through as Plot.RectOptions

const plot = Plot.plot({
    x: {axis: null, domain: d3.range(54)},
    y: {tickFormat: Plot.formatWeekday("en", "narrow"), tickSize: 0, domain: d3.range(7)},
    color: {scheme: "PiYG"},
    marks: [
        Plot.rect(data, Plot.bin({fill: "count"},
            {
                x: (d: AuditItemParsed) => d3.utcWeek.count(d3.utcYear(d.timestamp), d.timestamp),
                y: (d: AuditItemParsed) => d.timestamp.getUTCDay(),
                interval: 1,
                inset: 1,
            }
        ))
    ],
})

Object literal may only specify known properties, and 'inset' does not exist in type 'BinInputs<RectOptions | undefined>'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions