From ee5a80e2aec0093861b4d1671b618cb37e7d807e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:57:58 +0000 Subject: [PATCH 1/3] feat(highcharts): implement scatter-annotated --- .../implementations/highcharts.py | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 plots/scatter-annotated/implementations/highcharts.py diff --git a/plots/scatter-annotated/implementations/highcharts.py b/plots/scatter-annotated/implementations/highcharts.py new file mode 100644 index 0000000000..32741de47f --- /dev/null +++ b/plots/scatter-annotated/implementations/highcharts.py @@ -0,0 +1,146 @@ +"""pyplots.ai +scatter-annotated: Annotated Scatter Plot with Text Labels +Library: highcharts | Python 3.13 +Quality: pending | Created: 2025-12-30 +""" + +import json +import tempfile +import time +import urllib.request +from pathlib import Path + +import numpy as np +from selenium import webdriver +from selenium.webdriver.chrome.options import Options + + +# Data - Tech companies with market metrics +np.random.seed(42) +companies = [ + "TechCorp", + "DataFlow", + "CloudNet", + "ByteWorks", + "NeuralSys", + "QuantumIO", + "CyberEdge", + "AlphaCore", + "OmniSoft", + "GridLogic", + "NovaCode", + "SyncLabs", + "PrimeData", + "VectorAI", + "CoreStack", +] +revenue = np.random.uniform(50, 500, 15) # Revenue in millions +growth = revenue * 0.12 + np.random.normal(0, 15, 15) # Growth rate % + +# Create data points with names (labels) +data_points = [ + {"x": round(float(revenue[i]), 1), "y": round(float(growth[i]), 1), "name": companies[i]} + for i in range(len(companies)) +] + +# Build Highcharts configuration +chart_config = { + "chart": { + "type": "scatter", + "width": 4800, + "height": 2700, + "backgroundColor": "#ffffff", + "marginBottom": 280, + "marginTop": 120, + "marginLeft": 220, + "marginRight": 200, + }, + "title": { + "text": "scatter-annotated · highcharts · pyplots.ai", + "style": {"fontSize": "48px", "fontWeight": "bold"}, + }, + "xAxis": { + "title": { + "text": "Annual Revenue ($ millions)", + "style": {"fontSize": "36px", "color": "#333333"}, + "margin": 30, + }, + "labels": {"style": {"fontSize": "28px"}, "y": 40}, + "gridLineWidth": 1, + "gridLineColor": "rgba(0, 0, 0, 0.15)", + "min": 0, + "max": 550, + "tickInterval": 100, + }, + "yAxis": { + "title": {"text": "Year-over-Year Growth (%)", "style": {"fontSize": "36px", "color": "#333333"}, "margin": 20}, + "labels": {"style": {"fontSize": "28px"}}, + "gridLineWidth": 1, + "gridLineColor": "rgba(0, 0, 0, 0.15)", + }, + "legend": {"enabled": False}, + "credits": {"enabled": False}, + "plotOptions": { + "scatter": { + "marker": {"radius": 20, "fillColor": "rgba(48, 105, 152, 0.7)"}, + "dataLabels": { + "enabled": True, + "format": "{point.name}", + "style": {"fontSize": "26px", "fontWeight": "500", "textOutline": "3px white", "color": "#333333"}, + "y": -30, + "allowOverlap": False, + }, + } + }, + "series": [{"type": "scatter", "name": "Companies", "color": "#306998", "data": data_points}], +} + +# Download Highcharts JS for inline embedding +highcharts_url = "https://code.highcharts.com/highcharts.js" +with urllib.request.urlopen(highcharts_url, timeout=30) as response: + highcharts_js = response.read().decode("utf-8") + +# Generate HTML with inline scripts +chart_json = json.dumps(chart_config) +html_content = f""" + + + + + + +
+ + +""" + +# Write temp HTML file +with tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False, encoding="utf-8") as f: + f.write(html_content) + temp_path = f.name + +# Save interactive HTML +with open("plot.html", "w", encoding="utf-8") as f: + f.write(html_content) + +# Setup headless Chrome +chrome_options = Options() +chrome_options.add_argument("--headless") +chrome_options.add_argument("--no-sandbox") +chrome_options.add_argument("--disable-dev-shm-usage") +chrome_options.add_argument("--disable-gpu") +chrome_options.add_argument("--window-size=4800,2700") + +# Take screenshot +driver = webdriver.Chrome(options=chrome_options) +driver.get(f"file://{temp_path}") +time.sleep(5) +driver.save_screenshot("plot.png") +driver.quit() + +# Cleanup +Path(temp_path).unlink() From 4aafcbb491353945bfe36ea9fbb174e6104750ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 17:58:19 +0000 Subject: [PATCH 2/3] chore(highcharts): add metadata for scatter-annotated --- .../metadata/highcharts.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plots/scatter-annotated/metadata/highcharts.yaml diff --git a/plots/scatter-annotated/metadata/highcharts.yaml b/plots/scatter-annotated/metadata/highcharts.yaml new file mode 100644 index 0000000000..e29ac55285 --- /dev/null +++ b/plots/scatter-annotated/metadata/highcharts.yaml @@ -0,0 +1,19 @@ +# Per-library metadata for highcharts implementation of scatter-annotated +# Auto-generated by impl-generate.yml + +library: highcharts +specification_id: scatter-annotated +created: '2025-12-30T17:58:18Z' +updated: '2025-12-30T17:58:18Z' +generated_by: claude-opus-4-5-20251101 +workflow_run: 20602455906 +issue: 0 +python_version: 3.13.11 +library_version: unknown +preview_url: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot.png +preview_thumb: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot_thumb.png +preview_html: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot.html +quality_score: null +review: + strengths: [] + weaknesses: [] From e009a43a6595a09e886ff53386c96e94fd8987f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Dec 2025 18:06:31 +0000 Subject: [PATCH 3/3] chore(highcharts): update quality score 91 and review feedback for scatter-annotated --- .../implementations/highcharts.py | 6 ++--- .../metadata/highcharts.yaml | 24 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/plots/scatter-annotated/implementations/highcharts.py b/plots/scatter-annotated/implementations/highcharts.py index 32741de47f..ac609e9b82 100644 --- a/plots/scatter-annotated/implementations/highcharts.py +++ b/plots/scatter-annotated/implementations/highcharts.py @@ -1,7 +1,7 @@ -"""pyplots.ai +""" pyplots.ai scatter-annotated: Annotated Scatter Plot with Text Labels -Library: highcharts | Python 3.13 -Quality: pending | Created: 2025-12-30 +Library: highcharts unknown | Python 3.13.11 +Quality: 91/100 | Created: 2025-12-30 """ import json diff --git a/plots/scatter-annotated/metadata/highcharts.yaml b/plots/scatter-annotated/metadata/highcharts.yaml index e29ac55285..8aecd0be95 100644 --- a/plots/scatter-annotated/metadata/highcharts.yaml +++ b/plots/scatter-annotated/metadata/highcharts.yaml @@ -1,10 +1,7 @@ -# Per-library metadata for highcharts implementation of scatter-annotated -# Auto-generated by impl-generate.yml - library: highcharts specification_id: scatter-annotated created: '2025-12-30T17:58:18Z' -updated: '2025-12-30T17:58:18Z' +updated: '2025-12-30T18:06:31Z' generated_by: claude-opus-4-5-20251101 workflow_run: 20602455906 issue: 0 @@ -13,7 +10,20 @@ library_version: unknown preview_url: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot.png preview_thumb: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot_thumb.png preview_html: https://storage.googleapis.com/pyplots-images/plots/scatter-annotated/highcharts/plot.html -quality_score: null +quality_score: 91 review: - strengths: [] - weaknesses: [] + strengths: + - 'Excellent use of Highcharts dataLabels with allowOverlap: false to prevent label + collisions' + - Clean, professional appearance with appropriate color choice and transparency + - 'Good text outline (textOutline: 3px white) ensures label readability over grid + lines' + - Realistic tech company business context that demonstrates the annotation use case + well + - Proper title format following spec requirements + weaknesses: + - Uses raw JSON dict configuration instead of highcharts-core Python classes as + shown in library rules + - Grid lines could be slightly more visible (alpha 0.15 is quite faint) + - Some labels could benefit from smart positioning (e.g., labels near axis edges + like DataFlow appear slightly cramped)