plot icon indicating copy to clipboard operation
plot copied to clipboard

Typing issue with `BinInputs`

Open Learath2 opened this issue 10 months ago • 0 comments

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>'.

Learath2 avatar Mar 31 '25 20:03 Learath2