plotly / plotly/react-plotly.js
[TypeScript] Missing property in `Partial<PlotData>`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 138
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
Hi, thanks very much for this handy component!
I tried to look at all examples and API docs available but can't figure out how to make use of connector among other properties (e.g. measure) for a Waterfall chart. I wonder whether there is a generic way to pass those parameters or it's just not possible at the moment?
This is the code I have:
<Plot
data={[
{
type: 'waterfall',
x: ['Name 1', 'Name 2'],
y: [15, 20],
connector: {line: {color: 'red'}} // Cause error: Object literal may only specify known properties, and 'connector' does not exist in type 'Partial<PlotData>'
},
]}
layout={{
width: 300
height: 150
}}
/>
The root of the problem seems that only limited number of properties are implemented on Partial<PlotData> - including for instance (as shown in example) the marker: {color: 'red'} property - which is NOT relevant to a waterfall chart at all.
Actually, due to my limited knowledge with React/TypeScript, I don't even know how to look at the definition of PlotData (it looks not available on this repo?) in order to inspect what properties are actually implemented there - would be helpful if anyone can provide some pointers.
This might be related to this: https://github.com/plotly/react-plotly.js/issues/247
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Plot-Komponente und die für ihre data-Prop verwendete Definition von Partial zu finden; das Issue nennt keine Repository-Datei und keinen Test. Vergleiche die deklarierten Waterfall-Eigenschaften mit den in den Plotly-Beispielen und der API-Dokumentation beschriebenen Connector- und Measure-Eigenschaften. Erledigt ist die Aufgabe, wenn gültige Waterfall-Daten, die diese Eigenschaften verwenden, ohne den gemeldeten Fehler einen Typecheck bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react, typescript
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100