plotly / plotly/plotly.js

[BUG]: Typing issue in relayout()

Open
#8,047 2 comments 0 reactions 1 assignee View on GitHub

@camdecoster is already working on this.

Since Sep 16, 2026.

bug P3 size: 1
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Description

Updating to plotly 4.1 caused a typing issue with relayout()

For this line of code:

Plotly.relayout(this.plotlyChartEl().plotlyInstance, {
    'xaxis.autorange': true,
    'yaxis.autorange': true,
});

I get the following error from typescript:
Image

I checked the code here at:
https://github.com/plotly/plotly.js/blob/v4.1.1/src/types/core/api.d.ts#L212
export function relayout(root: Root, layout: Partial<Layout>)
Here the Partial<Layout> seems to cause the issue.

Notes

Versions:

  • plotly.js: 4.1.0
  • angular-plotly.js: 22.0.1
  • angular: 22.1.x
Alternatives

I tried:

Plotly.relayout(this.plotlyChartEl().plotlyInstance, {
    xaxis: {autorange: true},
    yaxis: {autorange: true},
});

but this will replace the existing xaxis properties like anchor, color, etc. will be removed -- i just want to update the autorange in this line of code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.