Skip to content

Typing issue with BinInputs #2307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Learath2 opened this issue Mar 31, 2025 · 0 comments
Open

Typing issue with BinInputs #2307

Learath2 opened this issue Mar 31, 2025 · 0 comments

Comments

@Learath2
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant