plotly / plotly/plotly.js

[BUG]: Typing issue in relayout()

Ouverte
#8,047 2 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@camdecoster y travaille déjà.

Depuis le 16/9/2026.

bug P3 size: 1
Langage dominant
JavaScript
Étoiles
18.3k
Forks
2k
Merge moyen
2 j 12 h
PR mergées (30 j)
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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.