Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#523 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
numpy, pandas, python

Research direction

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.

Written by the indexing model from the issue text.

Description

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
Dominant language
Python
Stars
1.9k
Forks
76
Avg merge
1h 25m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reflex-dev/xy

All issues in reflex-dev/xy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.