plotly / plotly/plotly.js

[BUG]: Typing issue in relayout()

Aperta
#8,047 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@camdecoster ci sta già lavorando.

Dal 16/9/2026.

bug P3 size: 1
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.