plotly / plotly/plotly.js

omitted base property in index.d.ts

Offen
#6,810 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

#  "plotly.js-dist-min": "^2.27.1",
# "@types/plotly.js-dist-min": "^2.3.4",
const minutes = Array.from({ length: 24 * 6 }, (_, i) => {
    const hour = Math.floor(i / 6)
    const minute = (i % 6) * 10
    return `2023-01-01 ${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:00`
  })

  const traceDeath: Partial<Plotly.PlotData> = {
    x: minutes,
    base: minutes.map(() => Math.random() * 5),
    y: minutes.map(() => Math.random() * 5 + 3),
    type: 'bar',
    marker: { color: 'red' },
  }

In this code, please check base property.
I followed Plotly.PlotData
image
Whenever i omit base property, plotly graph changed.
But there is not base property in index.d.ts.

so I added interface

  interface extendPlotData extends Partial<Plotly.PlotData> {
    base?: number[]
  }
    const traceDeath: extendPlotData = {
    x: minutes,
    base: minutes.map(() => Math.random() * 5),
    y: minutes.map(() => Math.random() * 5 + 3),
    type: 'bar',
    marker: { color: 'red' },
  }

I know you have document
https://plotly.com/javascript/reference/bar/#bar-base

but please add missing properties.

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.