Composition line charts bridge NaN gaps (pre-existing in 0.0.8)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 57/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- numpy, python
- Ambito
- data-visualization
Direzione di ricerca
Start by comparing the composition line payload and rendering path with the native xy.pyplot exports, which preserve gaps; the issue provides a minimal reproduction and a 100,000-point decimation case. Trace how invalid samples are removed and how M4 decimation handles gaps, then inspect the relevant specification and news fragment. Done means direct lines and decimated lines preserve separate segments for invalid x or y values, including with clipping, zoom, and streaming append, while finite-data behavior and native pyplot gap behavior remain intact.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Composition line charts remove invalid samples and connect the surviving points across the missing interval. This invents continuity where the data should have a gap.
Classification: pre-existing bug, reproduced in published PyPI xy==0.0.8 and xy==0.0.9a1. This is not a regression introduced by the alpha and is tracked as a follow-up, not a blocker for the 0.0.9 release.
Reproduction
Install either published version in a clean environment:
uv venv --python 3.11 .venv
uv pip install --python .venv/bin/python 'xy==0.0.9a1'
.venv/bin/python repro.py
Save this as repro.py:
from pathlib import Path
import numpy as np
import xy
chart = xy.line_chart(
xy.line(np.arange(6), [0.0, 1.0, np.nan, np.nan, 1.0, 0.0]),
width=800,
height=420,
)
Path("gap.html").write_text(chart.to_html())
Path("gap.svg").write_text(chart.to_svg())
Path("gap.png").write_bytes(chart.to_png(scale=1))
print(xy.__version__)
print(chart.figure().build_payload()[0]["traces"])
Open the HTML in a browser and inspect the PNG/SVG. Repeat in a separate environment with xy==0.0.8.
Actual: one continuous line connects x=1 to x=4, crossing the missing x=2 and x=3 samples. The direct payload contains six input points but only four emitted marks, without preserving the gap between the surviving points.
Expected: two observed segments, x=0→1 and x=4→5, with no connecting line between them.
This contradicts design-dossier §19: Nulls, NaN, and gaps: invalid samples must create line breaks, including after decimation, while invalid values stay out of GPU buffers.
Verified scope and evidence
| Case | PyPI 0.0.8 | PyPI 0.0.9a1 |
|---|---|---|
| Composition, direct line with NaN y | Bridges gap | Bridges gap |
| Composition, direct line with NaN x | Bridges gap | Bridges gap |
| Composition, 100,000-point M4-decimated line with NaN y | Bridges gap | Bridges gap |
Equivalent native xy.pyplot SVG/PNG exports |
Preserve gaps | Preserve gaps |
For the NaN-x case, use x = np.arange(6, dtype=float); x[2:4] = np.nan and y = [0, 1, 1, 1, 1, 0].
For the decimated case:
x = np.arange(100_000, dtype=float)
y = np.ones(len(x))
y[30_000:70_000] = np.nan
chart = xy.line_chart(xy.line(x, y), width=800, height=420)
The composition SVG has one path/move in all three cases; the equivalent pyplot exports have disjoint segments. PNGs were inspected visually, and the small direct example was also confirmed in a real Chromium browser. The same problem is visible in an ordinary datetime revenue report with missing days.
Environment: Linux x86_64, CPython 3.11.15, NumPy 2.4.6, native XY core, independent PyPI installations with no editable checkout or installed-package patches. Browser confirmation used Chromium with software WebGL.
Acceptance criteria
- Preserve gap boundaries for invalid x or y samples in direct line payloads.
- Preserve boundaries through M4 decimation; buckets must not span missing intervals.
- Browser, PNG, and SVG show separate observed segments without NaNs in GPU buffers.
- Cover multiple gaps, clipping/zoom, and streaming append while preserving finite-data behavior.
- Keep native pyplot gap behavior intact and update the relevant specification and news fragment with the fix.
- Lingua principale
- Python
- Stelle
- 1.9k
- Fork
- 79
- Merge medio
- 1g 39m
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reflex-dev/xy
-
Skip finite/log visibility scans when zone maps already prove all-finite on linear axesForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaneeds investigate performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
reflex-dev/xy#169 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
reflex-dev/xy#552 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
reflex-dev/xy#551 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
reflex-dev/xy#550 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
reflex-dev/xy#523 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di reflex-dev/xy
Issue simili
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Graphify-Labs/graphify#5160 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Variable declared without a value suppresses ${VAR:-default} expansionForse già presa @Omarinho12345 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
theskumar/python-dotenv#750 ·
I maintainer di solito rispondono entro 12 giorni
-
Minor bug: Main page buttonApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Operations on a list[T] | None var throw when the value is NoneForse già presa @masenf l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
reflex-dev/reflex#7826 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
UKGovernmentBEIS/control-arena#947 ·
I maintainer di solito rispondono entro 1 giorno