victory-native
Version:
A charting library for React Native with a focus on performance and customization.
41 lines (40 loc) • 1.08 kB
TypeScript
import type { PointsArray } from "../../types";
type Point = PointsArray[number];
export type CandlestickStatus = "positive" | "negative" | "neutral";
export type CandlestickRect = {
x: number;
y: number;
width: number;
height: number;
};
export type CandlestickLine = {
x: number;
y1: number;
y2: number;
};
export type CandlestickGeometry = {
datumIndex: number;
x: number;
xValue: Point["xValue"];
open: number;
high: number;
low: number;
close: number;
openY: number;
highY: number;
lowY: number;
closeY: number;
status: CandlestickStatus;
body: CandlestickRect;
wick: CandlestickLine;
};
export type GetCandlestickGeometryArgs = {
openPoints: PointsArray;
highPoints: PointsArray;
lowPoints: PointsArray;
closePoints: PointsArray;
candleWidth: number;
minBodyHeight?: number;
};
export declare const getCandlestickGeometry: ({ openPoints, highPoints, lowPoints, closePoints, candleWidth, minBodyHeight, }: GetCandlestickGeometryArgs) => CandlestickGeometry[];
export {};