[BUG]: Typing issue in relayout()

Aberta
#8,047 2 comentários 0 reações 1 responsável Ver no GitHub

@camdecoster já está trabalhando nisso.

Desde 16/9/2026.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

bug P3 size: 1
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

Linguagem predominante
JavaScript
Estrelas
18.3k
Forks
2k
Merge médio
2d 12h
PRs com merge (30d)
28

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de plotly/plotly.js

Todas as issues de plotly/plotly.js

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.