Skip to content

feat: candlestick chart#676

Merged
zibs merged 4 commits into
mainfrom
codex/candlestick-chart
Jun 9, 2026
Merged

feat: candlestick chart#676
zibs merged 4 commits into
mainfrom
codex/candlestick-chart

Conversation

@zibs

@zibs zibs commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds Cartesian candlestick chart support for OHLC data.

This includes:

  • Candlestick chart mark for rendering open, high, low, and close values
  • useCandlestickPaths for lower-level Skia path access
  • Pure OHLC geometry utilities with unit coverage
  • Status-based positive, negative, and neutral candle colors
  • Per-candle custom styling via candleOptions
  • Doji/minimum-body handling
  • Missing/invalid value skipping
  • Animation support, including a windowed-update example that uses per-candle paths for smoother transitions
  • Example app route with realistic TSLA data, scrub interaction, windowed updates, custom styling, and edge-case examples
  • Website docs and type tests
  • Headless golden fixture

No new runtime dependencies were added.

Fixes #554

Screenshots / Videos

Screenshot 2026-06-04 at 9 22 42 AM
Screen.Recording.2026-06-04.at.9.22.27.AM.mov
Screen.Recording.2026-06-04.at.9.14.54.AM.mov

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Ran:

  • yarn typecheck
  • yarn lint
  • yarn workspace victory-native test
  • yarn workspace victory-native test:headless

Also verified in the Expo example app on iOS Simulator:

  • Candlestick route renders
  • TSLA candlestick chart displays correctly
  • Scrub readout and vertical indicator work
  • Windowed update example renders and animates
  • Custom styling example renders
  • Doji and missing-value example renders

Note: yarn lint reports the existing React version warning from eslint-plugin-react; this PR does not introduce a new warning.

Checklist

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run yarn run check:code and all checks pass

@zibs zibs requested a review from Copilot June 5, 2026 15:59
@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 28ab50e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
victory-native Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
victory-native-xl-docs Ready Ready Preview, Comment Jun 5, 2026 4:20pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds first-class Cartesian candlestick chart support (OHLC) to victory-native, including a new Candlestick mark, a lower-level useCandlestickPaths hook, reusable geometry utilities with tests, and accompanying docs/examples.

Changes:

  • Introduces Candlestick, useCandlestickPaths, and getCandlestickGeometry (plus exported types) to render OHLC candlesticks and expose geometry/paths for custom composition.
  • Adds unit tests for OHLC geometry and a headless golden test/fixture for visual regression coverage.
  • Adds example app route + website documentation and type tests to validate the new public API.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/sidebars.ts Adds candlestick docs entries to the Docusaurus sidebar.
website/docs/cartesian/candlestick/use-candlestick-paths.md Documents the new useCandlestickPaths hook API and usage patterns.
website/docs/cartesian/candlestick/candlestick.md Documents the new Candlestick component, props, and interaction model.
lib/type-tests/jsx-component-return-types.ts Extends JSX return-type type tests to include Candlestick.
lib/type-tests/candlestick-types.tsx Adds type-level coverage for candlestick props and useCandlestickPaths options/context.
lib/test/headless/fixtures/candlestickCartesianChart.tsx Adds a headless render fixture for candlestick golden testing.
lib/test/headless/candlestick.test.ts Adds a golden PNG comparison test for headless candlestick rendering.
lib/src/index.ts Exports the new candlestick component, hook, utils, and associated types from the public entrypoint.
lib/src/cartesian/utils/getCandlestickGeometry.ts Implements pure OHLC → geometry computation, including missing/invalid skipping + doji handling.
lib/src/cartesian/utils/getCandlestickGeometry.test.ts Adds unit tests validating candlestick geometry behavior and edge cases.
lib/src/cartesian/hooks/useCandlestickPaths.ts Implements grouped/custom Skia path generation for candlestick bodies/wicks.
lib/src/cartesian/components/Candlestick.tsx Adds the Candlestick mark component with optional animation and shared paint props.
example/consts/routes.ts Registers a new example route for the candlestick chart page.
example/app/candlestick.tsx Adds a full candlestick example screen (scrub, windowed updates, styling, edge cases).
.changeset/candlestick-chart.md Declares a minor version bump for the new candlestick feature surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/src/cartesian/hooks/useCandlestickPaths.ts Outdated
@zibs zibs merged commit ded7485 into main Jun 9, 2026
3 checks passed
@zibs zibs deleted the codex/candlestick-chart branch June 9, 2026 21:09
@github-actions github-actions Bot mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Will candlestick charts be implemented in the future?

2 participants