feat: candlestick chart#676
Conversation
🦋 Changeset detectedLatest commit: 28ab50e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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, andgetCandlestickGeometry(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.
Description
Adds Cartesian candlestick chart support for OHLC data.
This includes:
Candlestickchart mark for rendering open, high, low, and close valuesuseCandlestickPathsfor lower-level Skia path accesscandleOptionsNo new runtime dependencies were added.
Fixes #554
Screenshots / Videos
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
How Has This Been Tested?
Ran:
yarn typecheckyarn lintyarn workspace victory-native testyarn workspace victory-native test:headlessAlso verified in the Expo example app on iOS Simulator:
Note:
yarn lintreports the existing React version warning fromeslint-plugin-react; this PR does not introduce a new warning.Checklist
yarn run check:codeand all checks pass