Problem
Currently, TimeseriesGraph only supports line, marker, and interval series that require explicit time arrays. For large multi-channel timeseries data with uniform sampling (common in scientific applications), this approach is inefficient because:
- Memory overhead: Storing redundant time arrays for each channel
- No downsampling: Large datasets can't be efficiently visualized at different zoom levels
- Limited multi-channel support: Each channel requires a separate line series
Solution
Add a new add_uniform_series() method to TimeseriesGraph that:
- Uniform time spacing: Only requires start time and sampling frequency (no explicit time array)
- Multi-channel support: Single series can contain multiple channels with individual colors and names
- Efficient storage: Uses downsample pyramid with min/max pairs for fast rendering at any zoom level
- Dynamic y-limits: Calculates y-axis range from visible data rather than entire dataset
- Legend integration: Each channel appears as separate legend entry
API Example
# Create multi-channel data (N timepoints × M channels)
data = np.random.randn(1000000, 4) # 1M timepoints, 4 channels
graph = fp.TimeseriesGraph()
graph.add_uniform_series(
name="Neural Signals",
start_time_sec=0.0,
sampling_frequency_hz=1000.0,
data=data,
channel_names=["Ch1", "Ch2", "Ch3", "Ch4"],
colors=["red", "blue", "green", "orange"],
width=1.0
)
Problem
Currently, TimeseriesGraph only supports line, marker, and interval series that require explicit time arrays. For large multi-channel timeseries data with uniform sampling (common in scientific applications), this approach is inefficient because:
Solution
Add a new
add_uniform_series()method to TimeseriesGraph that:API Example