Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`facet_chart` does not refine/load full-resolution data when zooming

Aperta
#523 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
numpy, pandas, python

Direzione di ricerca

Start by running the provided Python reproduction and compare the facet_chart(link="x") behavior with the standalone line_chart control while zooming into a burst. Trace the facet_chart and linked-X handling from those entry points to determine where refinement differs; done means zooming reveals the irregular high-resolution samples in the faceted chart.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

When using xy.facet_chart() with a DataFrame containing multiple time series, zooming into the chart does not appear to refine/load the underlying high-resolution data.

The same data plotted as a standalone xy.line_chart() does correctly refine/load the full-resolution data when zooming.

This appears to be specific to the combination of:

  • facet_chart
  • link="x"
  • highly non-uniform temporal sampling / long periods of inactivity

Environment

Python: 3.13
xy: 0.0.8.dev5+72a069f
OS: Linux

Example

maybe not minimal, but shows shorts bursts of data, followed by long times when nothing happens.

import numpy as np
import pandas as pd
import xy

rng = np.random.default_rng(42)

signals = {
    "a": 880_000,
    "b": 860_000,
}

frames = []

for signal, n in signals.items():

    # Number of bursts
    n_bursts = 100

    # Samples per burst (roughly)
    burst_sizes = np.full(n_bursts, n // n_bursts, dtype=int)
    burst_sizes[:n % n_bursts] += 1

    times = []
    values = []

    t = 0.0

    for burst_idx, burst_n in enumerate(burst_sizes):

        # ---------------------------------------------------------
        # Burst
        # ---------------------------------------------------------

        # Random, strictly positive intervals inside the burst
        dt = rng.lognormal(
            mean=-2.0,
            sigma=0.7,
            size=burst_n,
        )

        burst_time = t + np.cumsum(dt)

        # Random step signal during the burst
        change = rng.random(burst_n) < 0.002

        burst_values = np.empty(burst_n)
        current = rng.normal()

        for i in range(burst_n):
            if change[i]:
                current = rng.normal()
            burst_values[i] = current

        times.append(burst_time)
        values.append(burst_values)

        # ---------------------------------------------------------
        # Sleep
        # ---------------------------------------------------------

        burst_duration = burst_time[-1] - t

        # Sleep is 10,000 × the burst duration
        sleep_time = 10_000 * burst_duration

        t = burst_time[-1] + sleep_time

    time = np.concatenate(times)
    value = np.concatenate(values)

    frames.append(
        pd.DataFrame({
            "time": time,
            "value": value,
            "signal": signal,
        })
    )

df_test = pd.concat(frames, ignore_index=True)

df_test["signal"] = pd.Categorical(
    df_test["signal"],
    categories=list(signals),
    ordered=True,
)

chart = xy.facet_chart(
    xy.step("time", "value", width=1.2),
    by="signal",
    data=df_test,
    cols=1,
    share_x=True,
    share_y=False,
    link="x",
    width=1100,
    height=400,
    gap=10,
    title="Burst / sleep signals",
)


# Standalone control
s1 = df_test[df_test["signal"] == "a"]

chart2 = xy.line_chart(
    xy.step(
        s1["time"].to_numpy(),
        s1["value"].to_numpy(),
    ),
    width=1100,
    height=400,
)

print("standalone")
display(chart2)

print("facet")
display(chart)

The standalone chart correctly refines/loads the higher-resolution data when zooming.

Expected behavior

Zooming into a burst in the faceted chart should cause the visualization to refine to the underlying data points, just as it does for the standalone line_chart.

In particular, zooming into a small burst should reveal the irregular high-frequency samples contained within that burst.

Actual behavior

The faceted chart remains visually decimated after zooming and does not appear to refine to the underlying high-resolution samples.

The issue is particularly apparent because the data contains:

  • large amount of data (> 800k samples?)
  • irregular timestamps
  • dense bursts
  • very large gaps between bursts
  • linked X axes across facets
Image Image
Lingua principale
Python
Stelle
1.9k
Fork
75
Merge medio
1h 18m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di reflex-dev/xy

Tutte le issue di reflex-dev/xy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.