allow deletion of data from Heat Figs with Patch()
Dieses Issue hat noch niemand übernommen.
- #2837 von @justinzhu17 — ohne Merge geschlossen
- Vorherrschende Sprache
- Python
- Sterne
- 24.4k
- Forks
- 2.3k
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 13
Beschreibung
I am trying to delete some data from a heat fig, and it doesn't seem to be possible with patch. With patch, you would return something like
fig = Patch()
del fig['data'][0][x][0]
to delete the first item in the heatfig. The issue is that the heatfig has the following structure:
{ "data": [
{
"x": ["2021-12-21T19:58:00.542000", "2021-12-21T19:58:01.542000", "2021-12-21T19:58:02.542000" ],
"y": [13500.0, 13503.33591, 13506.67183 ],
"z": [[599.8054, 581.1404, 570.4771 ],
[678.9323, 644.2858, 610.9979 ],
[576.6772, 568.9164, 565.6251 ],
}]}
and so you would need to loop through each list in the z field to remove the first item as well (as the heatfig is a 3D array). We can't know ahead of time how many items are in the z field making it impossible to delete data.
Basically, if you want to remove the first timestamp in the fig, you would need the data to look like:
{ "data": [
{
"x": ["2021-12-21T19:58:01.542000", "2021-12-21T19:58:02.542000" ],
"y": [13500.0, 13503.33591, 13506.67183 ],
"z": [[581.1404, 570.4771 ],
[644.2858, 610.9979 ],
[568.9164, 565.6251 ],
}]}
I don't want to load in the whole fig as state because it is quite large (and defeats the purpose of using a Patch()).
I haven't found a work around for this yet.
Beitragsleitfaden
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
Im Issue werden keine Dateien oder Tests genannt. Beginne damit, das Patch()-Beispiel für eine Heatmap-Figur zu reproduzieren, und verfolge das bestehende Patch-Verhalten für verschachtelte x-, y- und z-Daten. Fertig ist die Arbeit, wenn ein Zeitstempel aus der Figur entfernt werden kann, wobei die entsprechenden z-Werte aktualisiert werden, ohne den gesamten Figurenstatus zu laden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100