Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 34 additions & 30 deletions plots/area-basic/implementations/highcharts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" pyplots.ai
"""pyplots.ai
area-basic: Basic Area Chart
Library: highcharts 1.10.3 | Python 3.14.2
Quality: 74/100 | Created: 2025-12-23
Quality: /100 | Updated: 2026-02-11
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header docstring now has an incomplete quality value (Quality: /100) and removes the previously-present created date while only showing “Updated”. Please fill in the quality score (or remove the field if it’s meant to be populated automatically) and keep the header fields consistent with the repo’s metadata conventions.

Suggested change
Quality: /100 | Updated: 2026-02-11
Quality: 90/100 | Created: 2026-02-11 | Updated: 2026-02-11

Copilot uses AI. Check for mistakes.
"""

import tempfile
Expand Down Expand Up @@ -31,14 +31,15 @@
chart = Chart(container="container")
chart.options = HighchartsOptions()

# Chart configuration
# Chart configuration — generous bottom margin to ensure x-axis title renders fully
chart.options.chart = {
"type": "area",
"width": 4800,
"height": 2700,
"backgroundColor": "#ffffff",
"marginBottom": 200,
"marginLeft": 200,
"marginBottom": 300,
"marginLeft": 220,
"spacingBottom": 40,
}

# Title
Expand All @@ -47,39 +48,58 @@
"style": {"fontSize": "72px", "fontWeight": "bold"},
}

# X-axis
# Subtitle for data context
chart.options.subtitle = {
"text": "Daily Website Visitors Over One Month",
"style": {"fontSize": "42px", "color": "#666666"},
}

# X-axis — explicit margin and offset to prevent title clipping
chart.options.x_axis = {
"title": {"text": "Day of Month", "style": {"fontSize": "48px"}},
"labels": {"style": {"fontSize": "36px"}},
"title": {"text": "Day of Month", "style": {"fontSize": "48px"}, "margin": 30},
"labels": {"style": {"fontSize": "36px"}, "y": 45},
"gridLineWidth": 1,
"gridLineColor": "rgba(0, 0, 0, 0.1)",
"tickInterval": 1,
}

# Y-axis — set min close to data range to avoid wasted whitespace
# Y-axis — min near data floor to maximize visual resolution of the data range
chart.options.y_axis = {
"title": {"text": "Daily Visitors (count)", "style": {"fontSize": "48px"}},
"labels": {"style": {"fontSize": "36px"}},
"gridLineWidth": 1,
"gridLineColor": "rgba(0, 0, 0, 0.1)",
"min": 1000,
"min": 1500,
"startOnTick": False,
}

# Plot options with semi-transparent fill and gradient
chart.options.plot_options = {
"area": {
"fillColor": {
"linearGradient": {"x1": 0, "y1": 0, "x2": 0, "y2": 1},
"stops": [[0, "rgba(48, 105, 152, 0.5)"], [1, "rgba(48, 105, 152, 0.1)"]],
"stops": [[0, "rgba(48, 105, 152, 0.5)"], [1, "rgba(48, 105, 152, 0.05)"]],
},
"lineWidth": 4,
"marker": {"enabled": True, "radius": 8, "fillColor": "#306998"},
"marker": {"enabled": True, "radius": 6, "fillColor": "#306998"},
"color": "#306998",
"tooltip": {"headerFormat": "<b>Day {point.x}</b><br/>", "pointFormat": "Visitors: {point.y:,.0f}"},
}
}

# Legend
chart.options.legend = {"enabled": False}
# Legend — enabled with styling for single series identification
chart.options.legend = {
"enabled": True,
"itemStyle": {"fontSize": "36px", "fontWeight": "normal"},
"align": "right",
"verticalAlign": "top",
"layout": "horizontal",
"x": -40,
"y": 60,
}

# Credits off
chart.options.credits = {"enabled": False}

# Add series
series = AreaSeries()
Expand Down Expand Up @@ -111,22 +131,6 @@
f.write(html_content)
temp_path = f.name

# Also save HTML for interactive version
with open("plot.html", "w", encoding="utf-8") as f:
# For standalone HTML, use CDN link
standalone_html = f"""<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://code.highcharts.com/highcharts.js"></script>
</head>
<body style="margin:0;">
<div id="container" style="width: 100%; height: 100vh;"></div>
<script>{html_str}</script>
</body>
</html>"""
f.write(standalone_html)

chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
Expand Down
4 changes: 2 additions & 2 deletions plots/area-basic/metadata/highcharts.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library: highcharts
specification_id: area-basic
created: '2025-12-23T00:49:25Z'
updated: '2026-02-11T22:27:44Z'
updated: '2026-02-11T22:41:58+00:00'
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp formats are inconsistent (Z vs +00:00). Both are valid ISO-8601, but mixing formats makes metadata harder to diff/parse consistently. Consider standardizing on one format across created/updated (whichever the repo convention is).

Suggested change
updated: '2026-02-11T22:41:58+00:00'
updated: '2026-02-11T22:41:58Z'

Copilot uses AI. Check for mistakes.
generated_by: claude-opus-4-6
workflow_run: 20447991263
issue: 0
Expand All @@ -10,7 +10,7 @@ library_version: 1.10.3
preview_url: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot.png
preview_thumb: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot_thumb.png
preview_html: https://storage.googleapis.com/pyplots-images/plots/area-basic/highcharts/plot.html
quality_score: 74
quality_score: null
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preview_html still points to plot.html, but this PR removes generating plot.html in the implementation. Either restore plot.html generation, or remove/blank out preview_html in metadata so it doesn’t reference a non-existent artifact. Also, setting quality_score: null is likely unintended given the PR description claims an updated score; if the pipeline expects a numeric score, update it accordingly (or use the project’s standard “unknown” sentinel if one exists).

Copilot uses AI. Check for mistakes.
impl_tags:
dependencies:
- selenium
Expand Down
Loading