Open
Description
I'm getting what I believe to be an incorrect type error. I'm using typescript and I needed to set the automargin for the xaxis to "bottom" to avoid an infinite automargin loop. When I did that I got a type error that string is not assignable to type "boolean | undefined".
However the automargin behaves as expected and the infinite automargin loop is gone so it's clear that the value can indeed be a string. I fixed it by augmenting the LayoutAxis
and Layout
type like so.
interface AugmentedLayoutAxis extends Omit<LayoutAxis, "automargin"> {
automargin: string | boolean;
}
interface AugmentedLayout extends Omit<Layout, "xaxis"> {
xaxis: Partial<AugmentedLayoutAxis>;
}
But then I also had to cast it in the component layout property
I believe the fix is to update the LayoutAxis type in @types/plotly.js here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/index.d.ts#L937
Hope this helps.