From 226a7c8981eae742e85d97a9481d6ae0f6a24b95 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:47:13 +0000 Subject: [PATCH 1/3] feat(plotly): implement line-timeseries-rolling --- .../implementations/plotly.py | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 plots/line-timeseries-rolling/implementations/plotly.py diff --git a/plots/line-timeseries-rolling/implementations/plotly.py b/plots/line-timeseries-rolling/implementations/plotly.py new file mode 100644 index 0000000000..183be5e5e4 --- /dev/null +++ b/plots/line-timeseries-rolling/implementations/plotly.py @@ -0,0 +1,91 @@ +"""pyplots.ai +line-timeseries-rolling: Time Series with Rolling Average Overlay +Library: plotly | Python 3.13 +Quality: pending | Created: 2025-12-30 +""" + +import numpy as np +import pandas as pd +import plotly.graph_objects as go + + +# Data - Daily temperature readings with noise +np.random.seed(42) + +# Generate 200 days of data +dates = pd.date_range("2024-01-01", periods=200, freq="D") + +# Create realistic temperature pattern with seasonal trend + noise +days = np.arange(200) +seasonal = 15 * np.sin(2 * np.pi * days / 365 - np.pi / 2) # Seasonal component +trend = 0.02 * days # Slight warming trend +noise = np.random.randn(200) * 3 # Daily fluctuations +base_temp = 12 # Base temperature (Celsius) + +raw_values = base_temp + seasonal + trend + noise + +# Create DataFrame +df = pd.DataFrame({"date": dates, "value": raw_values}) + +# Calculate 14-day rolling average +window_size = 14 +df["rolling_avg"] = df["value"].rolling(window=window_size, center=False).mean() + +# Create figure +fig = go.Figure() + +# Raw data - lighter, semi-transparent line +fig.add_trace( + go.Scatter( + x=df["date"], y=df["value"], mode="lines", name="Raw Data", line=dict(color="#306998", width=1.5), opacity=0.4 + ) +) + +# Rolling average - prominent smooth line +fig.add_trace( + go.Scatter( + x=df["date"], + y=df["rolling_avg"], + mode="lines", + name=f"{window_size}-Day Rolling Average", + line=dict(color="#FFD43B", width=4), + ) +) + +# Layout for 4800x2700 canvas +fig.update_layout( + title=dict(text="line-timeseries-rolling · plotly · pyplots.ai", font=dict(size=32), x=0.5, xanchor="center"), + xaxis=dict( + title=dict(text="Date", font=dict(size=24)), + tickfont=dict(size=18), + showgrid=True, + gridwidth=1, + gridcolor="rgba(0,0,0,0.1)", + ), + yaxis=dict( + title=dict(text="Temperature (°C)", font=dict(size=24)), + tickfont=dict(size=18), + showgrid=True, + gridwidth=1, + gridcolor="rgba(0,0,0,0.1)", + ), + template="plotly_white", + legend=dict( + font=dict(size=20), + x=0.02, + y=0.98, + xanchor="left", + yanchor="top", + bgcolor="rgba(255,255,255,0.8)", + bordercolor="rgba(0,0,0,0.2)", + borderwidth=1, + ), + margin=dict(l=100, r=50, t=100, b=80), + plot_bgcolor="white", +) + +# Save as PNG (4800x2700) +fig.write_image("plot.png", width=1600, height=900, scale=3) + +# Save interactive HTML +fig.write_html("plot.html", include_plotlyjs="cdn") From 06ef6e809e0477c542a23d1e3ba2ba2aaeabbbea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:47:33 +0000 Subject: [PATCH 2/3] chore(plotly): add metadata for line-timeseries-rolling --- .../metadata/plotly.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plots/line-timeseries-rolling/metadata/plotly.yaml diff --git a/plots/line-timeseries-rolling/metadata/plotly.yaml b/plots/line-timeseries-rolling/metadata/plotly.yaml new file mode 100644 index 0000000000..ad9e273e09 --- /dev/null +++ b/plots/line-timeseries-rolling/metadata/plotly.yaml @@ -0,0 +1,19 @@ +# Per-library metadata for plotly implementation of line-timeseries-rolling +# Auto-generated by impl-generate.yml + +library: plotly +specification_id: line-timeseries-rolling +created: '2025-12-30T17:47:33Z' +updated: '2025-12-30T17:47:33Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 20602448540 +issue: 0 +python_version: 3.13.11 +library_version: 6.5.0 +preview_url: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot.png +preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot_thumb.png +preview_html: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot.html +quality_score: null +review: + strengths: [] + weaknesses: [] From 1da7ab2119f3a599d9039a9cd4e6e635da89abb4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:51:40 +0000 Subject: [PATCH 3/3] chore(plotly): update quality score 93 and review feedback for line-timeseries-rolling --- .../implementations/plotly.py | 6 ++--- .../metadata/plotly.yaml | 23 +++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/plots/line-timeseries-rolling/implementations/plotly.py b/plots/line-timeseries-rolling/implementations/plotly.py index 183be5e5e4..f868f1c85c 100644 --- a/plots/line-timeseries-rolling/implementations/plotly.py +++ b/plots/line-timeseries-rolling/implementations/plotly.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai line-timeseries-rolling: Time Series with Rolling Average Overlay -Library: plotly | Python 3.13 -Quality: pending | Created: 2025-12-30 +Library: plotly 6.5.0 | Python 3.13.11 +Quality: 93/100 | Created: 2025-12-30 """ import numpy as np diff --git a/plots/line-timeseries-rolling/metadata/plotly.yaml b/plots/line-timeseries-rolling/metadata/plotly.yaml index ad9e273e09..d6623e7406 100644 --- a/plots/line-timeseries-rolling/metadata/plotly.yaml +++ b/plots/line-timeseries-rolling/metadata/plotly.yaml @@ -1,10 +1,7 @@ -# Per-library metadata for plotly implementation of line-timeseries-rolling -# Auto-generated by impl-generate.yml - library: plotly specification_id: line-timeseries-rolling created: '2025-12-30T17:47:33Z' -updated: '2025-12-30T17:47:33Z' +updated: '2025-12-30T17:51:40Z' generated_by: claude-opus-4-5-20251101 workflow_run: 20602448540 issue: 0 @@ -13,7 +10,19 @@ library_version: 6.5.0 preview_url: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/line-timeseries-rolling/plotly/plot.html -quality_score: null +quality_score: 93 review: - strengths: [] - weaknesses: [] + strengths: + - Excellent visual clarity with well-chosen colors (blue raw data, yellow rolling + average) that provide strong contrast + - Rolling average line appropriately prominent (width=4) while raw data is appropriately + subdued (opacity=0.4) + - Legend includes the window size (14-Day Rolling Average) as specified in the spec + - Clean code structure following KISS principles with proper seed for reproducibility + - Realistic temperature scenario with believable seasonal patterns + - Produces both PNG and interactive HTML outputs leveraging Plotly strengths + weaknesses: + - Grid opacity at 0.1 is almost too subtle; could be increased to 0.2-0.3 for better + readability + - Could leverage more Plotly-specific features like customized hover templates showing + both raw and rolling values, or a range selector for interactivity