plotly / plotly/plotly.js

[BUG]: Typing issue in relayout()

Offen
#8,047 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@camdecoster arbeitet bereits daran.

Seit 16.9.2026.

bug P3 size: 1
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.