← Back to Pull requests

feat(web): add Candlestick Chart #280

Merged
danestves merged 6 files (552 lines) on Nov 06, 2026 22:23 UTC
View on GitHub
danestves danestves commented on Nov 06, 2026 15:39 UTC
Author

panelui-web has no Candlestick Chart, so open, high, low and close data has no web equivalent of the app's component. This adds it on @tanstack/charts, on the same pattern as Bar Chart, with the app's parts and props.

Stacked on #270, which adds the Charts section this page lands in. Until #270 merges, this diff includes it.

No mock round was run. The look is the app's chart in Bar Chart's web data language, as briefed, so push back if you want to see options.

Bodies and wicks are barY marks with explicit ends. A period that closed where it opened keeps a body 1.5px tall, and a row with a missing price is skipped but keeps its slot. The arithmetic is in candles.ts, with focused tests.

Differences from the app:

  • risingColor and fallingColor take theme roles, as on Bar Chart, instead of colour strings.

  • Tooltip has no activateAfterLongPress. Hover and a sideways drag replace it, and a click or tap pins the reading.

  • label and labelForDatum replace the accessibility props, as on Bar Chart.

  • A body grows from its open towards its close, not from its middle.

  • status="loading" draws no candles, as the app's source does. The app's docs text mentions placeholders, but the web page describes what the code does.
  • New on the web: the arrow keys, Home and End walk the periods, Escape clears, and reduced motion drops the entrance.

    All the gates pass locally. The docs production build was not run, so CI covers that.

    web-meta.json, src/index.ts and the generated files will conflict with the other chart PRs, whichever lands second. The conflicts are additive.

    Proof

    Recorded from the docs page with this PR's code: hovering across periods, pinning, keyboard reading, loading into the entrance, the data morph, and replay.

    Desktop, dark:

    !Dark desktop walkthrough

    Desktop, light:

    !Light desktop walkthrough

    Phone width (400px), dark:

    <img src="https://raw.githubusercontent.com/danestves/PanelUI/pr-media-candlestick-chart/phone-dark.gif" width="320" alt="Phone width walkthrough">

    | | Dark | Light |
    | --- | --- | --- |
    | At rest | !At rest, dark | !At rest, light |
    | Reading a period | !Reading, dark | !Reading, light |
    | Theme colours | !Colours, dark | !Colours, light |
    | Sized for a card | !Card, dark | !Card, light |
    | Loading | !Loading, dark | !Loading, light |

    Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

    Created with Claude Opus 5.5 in T3 Code (Claude Code harness).

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added a customizable candlestick chart with interactive period selection, configurable data and colors, axes, tooltips, loading states, and replay support.
    Added interactive chart examples and a dedicated Charts section in the web documentation and component gallery.
    Documentation
    Added candlestick chart usage guidance, examples, accessibility notes, and API details.
    Moved Bar Chart documentation from Data to Charts; existing links redirect to its new location.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 552 lines (+414 / -138) across 6 files Reviewer: None requested Review duration: 404m
    All Vouch review confidence checks passed
    Residual risk 0.34 = Change Risk (0.60) × (1 − Review Confidence (0.44)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 552 lines diff across 6 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.378
    Shallow Review Depth shallow_review_depth
    0.344
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #280"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    danestves danestves
    Labels
    risk: low confidence: 44.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 60.1% (MEDIUM) · Higher = larger blast radius
    60.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.2% · Lower = rushed or shallow review
    44.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 33.5% · Safe to merge
    33.5%