Skip to content

feat(plotly): implement ohlc-bar#7058

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/ohlc-bar/plotly
May 17, 2026
Merged

feat(plotly): implement ohlc-bar#7058
MarkusNeusinger merged 4 commits into
mainfrom
implementation/ohlc-bar/plotly

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: ohlc-bar - python/plotly

Implements the python/plotly version of ohlc-bar.

File: plots/ohlc-bar/implementations/python/plotly.py

Parent Issue: #3293


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 17, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot displays on a warm off-white background (#FAF8F1) with dark text (INK #1A1A17) for the title "ohlc-bar · plotly · anyplot.ai" and axis labels "Price (USD)" and "Date". Tick labels use secondary color (INK_SOFT #4A4A44) and are clearly readable. The 45 OHLC bars show green (#009E73) for up days and orange (#D55E00) for down days, with thin vertical lines representing the high-low range and horizontal ticks marking open (left) and close (right) prices. Grid lines are subtle and properly styled. All text is readable and has excellent contrast against the light background.

Dark render (plot-dark.png): The same plot renders on a warm near-black background (#1A1A17) with light text (INK #F0EFE8) that is equally readable. Axis labels and tick labels use light theme tokens (INK_SOFT #B8B7B0) with proper contrast. Critically, the data colors (green #009E73 and orange #D55E00) are identical to the light render—only the chrome (background, text, grid) has adapted. No dark-on-dark failures are present. The OHLC structure and all bars remain clearly visible and properly styled.

Both renders pass legibility checks. Theme adaptation is perfect.

Score: 86/100

Category Score Max
Visual Quality 30 30
Design Excellence 8 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 8 10
Total 86 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - Title 28px, axis labels 22px, tick labels 18px — all readable in both themes
  • VQ-02: No Overlap (6/6) - No overlapping text, well-spaced elements, proper margins
  • VQ-03: Element Visibility (6/6) - OHLC bars clearly visible with width=2, all markers distinguishable
  • VQ-04: Color Accessibility (2/2) - Okabe-Ito palette, adequate contrast, CVD-safe
  • VQ-05: Layout & Canvas (4/4) - Good proportions, generous margins, nothing cut off
  • VQ-06: Axis Labels & Title (2/2) - Correct title format, Y-axis includes units (USD)
  • VQ-07: Palette Compliance (2/2) - First series #009E73, second #D55E00, backgrounds correct, data colors identical both renders

Design Excellence (8/20)

  • DE-01: Aesthetic Sophistication (4/8) - Professional default styling but no custom palette refinement
  • DE-02: Visual Refinement (2/6) - Standard grid and frame, no custom styling beyond defaults
  • DE-03: Data Storytelling (2/6) - Color distinguishes up/down but no visual hierarchy or focal point

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct OHLC bar chart using go.Ohlc()
  • SC-02: Required Features (4/4) - Vertical bars (high-low), left tick (open), right tick (close), color coding
  • SC-03: Data Mapping (3/3) - Date and price axes correctly mapped with proper range
  • SC-04: Title & Legend (3/3) - Title follows format, no legend needed

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - All OHLC aspects shown, 45 business days, clear up/down movements
  • DQ-02: Realistic Context (5/5) - Realistic timeframe, base price, volatility, neutral data
  • DQ-03: Appropriate Scale (4/4) - Sensible price range and intervals

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - Simple linear structure, no unnecessary abstractions
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) ensures deterministic output
  • CQ-03: Clean Imports (2/2) - Only used imports, proper path handling
  • CQ-04: Code Elegance (2/2) - Appropriate complexity, no fake UI, Plotly idiomatic
  • CQ-05: Output & API (1/1) - Correct file naming: plot-{THEME}.png and plot-{THEME}.html

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) - Native go.Ohlc() trace is the idiomatic approach; theme tokens correctly applied
  • LM-02: Distinctive Features (3/5) - Uses library features appropriately but could explore custom hover templates

Score Caps Applied

  • None — no caps triggered

Strengths

  • Correct use of Plotly's native go.Ohlc() trace for authentic OHLC rendering
  • Perfect theme adaptation with all chrome properly switching between light/dark, matching token specs exactly
  • Excellent legibility in both renders with properly-sized fonts (28px title, 22px axis labels, 18px ticks)
  • Proper Okabe-Ito palette compliance: #009E73 for up bars, #D55E00 for down bars
  • Clean, reproducible code with np.random.seed(42) and deterministic data generation
  • Correct output format: plot-{THEME}.png at 4800×2700 (1600×900 × 3scale) plus plot-{THEME}.html

Weaknesses

  • Design excellence is minimal: standard Plotly styling with no custom refinements (grid, spines, typography hierarchy)
  • No visual storytelling beyond basic color distinction — could emphasize price trends or movements
  • Limited interactive features: HTML output could include custom hover templates with OHLC details

Issues Found

None — implementation meets all specification requirements.

AI Feedback for Next Attempt

N/A — this implementation is approved.

Verdict: APPROVED

@github-actions github-actions Bot added quality:86 Quality score 86/100 ai-rejected Quality not OK, triggers update labels May 17, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 17, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): OHLC bar chart rendered on warm off-white surface (#FAF8F1) displaying 45 trading days of stock price data (Jun-Jul 2024). Title "ohlc-bar · plotly · anyplot.ai" is centered in dark text (size 28px). X-axis labeled "Date" with date ticks (e.g., Jun 09, Jun 16) in readable format; Y-axis labeled "Price (USD)" with currency prefix on tick labels (e.g., $125, $170). Data rendered as OHLC bars: up-days shown in brand green (#009E73) with thin 2px vertical line (high-low range) and left/right ticks (open/close); down-days shown in vermillion (#D55E00) with same structure. Grid lines are subtle (~10% opacity) and aid price level reading. All text is clearly legible against the light background; no overlap detected. The layout is balanced with appropriate margins. Legibility verdict: PASS

Dark render (plot-dark.png): Same OHLC chart rendered on warm near-black surface (#1A1A17) with light text throughout. Title, axis labels, and all tick labels are light-colored and clearly visible against the dark background. Data colors are identical to light render: up-days remain #009E73 (brand green), down-days remain #D55E00 (vermillion)—only the chrome (background, text, grid color) has flipped to dark-theme equivalents. The green is vibrant and readable on the dark surface. Grid opacity matches the light version. No dark-on-dark text failures; all elements properly themed. Legibility verdict: PASS

Score: 88/100

Category Score Max
Visual Quality 30 30
Design Excellence 8 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 10 10
Total 88 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) — Title 28px, axis labels 22px, tick labels 18px; explicitly set, perfect in both themes
  • VQ-02: No Overlap (6/6) — Date labels well-spaced; no overlapping elements
  • VQ-03: Element Visibility (6/6) — OHLC bars optimally visible for 45 data points; 2px line width appropriate
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette (#009E73, #D55E00) CVD-safe with excellent contrast
  • VQ-05: Layout & Canvas (4/4) — Plot fills 50-70% of canvas; balanced margins
  • VQ-06: Axis Labels & Title (2/2) — Descriptive labels with units
  • VQ-07: Palette Compliance (2/2) — First series #009E73 ✓; backgrounds #FAF8F1/#1A1A17 ✓; theme-adaptive chrome perfect ✓

Design Excellence (8/20)

  • DE-01: Aesthetic Sophistication (4/8) — Well-configured Plotly defaults with correct palette; no exceptional design touches
  • DE-02: Visual Refinement (2/6) — Library defaults with explicit chrome configuration; minimal additional customization
  • DE-03: Data Storytelling (2/6) — Color encodes up/down direction; no visual hierarchy or narrative emphasis beyond color

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct OHLC using go.Ohlc() native trace; all subtypes present
  • SC-02: Required Features (4/4) — Thin H-L bars ✓; left tick open ✓; right tick close ✓; color differentiation ✓; grid ✓
  • SC-03: Data Mapping (3/3) — Dates on X, prices on Y; axes show full data range
  • SC-04: Title & Legend (3/3) — Title format correct; legend omitted (appropriate for single series)

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows both up-bars (green) and down-bars (orange) with realistic OHLC mechanics
  • DQ-02: Realistic Context (5/5) — Stock price scenario; Jun-Jul 2024 timeframe; neutral, comprehensible domain
  • DQ-03: Appropriate Scale (4/4) — Base $150, daily returns ~0.1%, intraday volatility 1-3%—all plausible

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Linear flow: imports → theme setup → data generation → plot → save
  • CQ-02: Reproducibility (2/2) — np.random.seed(42) ensures deterministic output
  • CQ-03: Clean Imports (2/2) — Only used imports
  • CQ-04: Code Elegance (2/2) — Clean, Pythonic, appropriate complexity; no fake UI
  • CQ-05: Output & API (1/1) — Saves plot-{THEME}.png + plot-{THEME}.html

Library Mastery (10/10)

  • LM-01: Idiomatic Usage (5/5) — Expert use of go.Figure() + go.Ohlc(); proper layout configuration with theme tokens
  • LM-02: Distinctive Features (5/5) — Plotly's native OHLC trace; distinctive feature not easily replicated in matplotlib/seaborn

Score Caps Applied

  • None — no caps triggered

Strengths

  • Perfect visual quality: explicit font sizes, proper theme-adaptive chrome in both renders, no overlapping elements
  • Excellent specification compliance: uses Plotly's native OHLC trace correctly; all required features present
  • Clean, reproducible code with proper seed and deterministic data generation
  • Realistic stock price data that demonstrates all aspects of OHLC bars (up and down days)
  • Idiomatic Plotly usage leveraging the library's distinctive OHLC feature

Weaknesses

  • Design excellence is modest: uses well-configured defaults without exceptional aesthetic touches (typical for Attempt 2)
  • Data storytelling is minimal: plot displays data with color encoding but no visual hierarchy or narrative emphasis to guide viewer insight

Issues Found

None requiring fixes. Implementation is publication-ready.

AI Feedback for Next Attempt

N/A — This implementation meets the approval threshold (88 ≥ 80). Merge approved.

Verdict: APPROVED

@github-actions github-actions Bot added quality:88 Quality score: 88/100 ai-approved Quality OK, ready for merge and removed quality:86 Quality score 86/100 labels May 17, 2026
@MarkusNeusinger MarkusNeusinger merged commit a10dc21 into main May 17, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/ohlc-bar/plotly branch May 17, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:88 Quality score: 88/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant