plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Type definition error: Type `{ matches: string; }` is not assignable to type `Partial<LayoutAxis>`

Open yKicchan opened this issue 2 years ago • 0 comments

Hi,

I am getting a typescript error when I try to set 'y' in LayoutAxis.matches. If I ignore this error and run the program, the y2 axis is as expected.

Environments

  • "plotly.js":"2.28.0"
  • "@types/plotly.js":"2.12.32"

Declared here

Axis: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/index.d.ts#L572 LayoutAxis: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/plotly.js/index.d.ts#L832

Document

https://plotly.com/javascript/reference/layout/yaxis/#layout-yaxis-matches

matches Parent: layout.yaxis Type: enumerated , one of ( "/^x([2-9]|[1-9][0-9]+)?( domain)?$/" | "/^y([2-9]|[1-9][0-9]+)?( domain)?$/" ) If set to another axis id (e.g. x2, y), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a scaleanchor and a matches constraint is currently forbidden. Moreover, note that matching axes must have the same type.

SS

スクリーンショット 2024-01-30 16 43 52

Thank you for the support!

yKicchan avatar Jan 30 '24 07:01 yKicchan