UNPKG

victory-native

Version:

A charting library for React Native with a focus on performance and customization.

31 lines (30 loc) 1.28 kB
import React from "react"; import { type Color, type PathProps, type SkPath } from "@shopify/react-native-skia"; import { type RoundedCorners } from "../../utils/createRoundedRectPath"; import type { ChartBounds, PointsArray } from "../../types"; import { type VerticalStackedBarOptionsContext } from "../utils/getStackedBarSegments"; export type CustomizablePathProps = Partial<Pick<PathProps, "color" | "blendMode" | "opacity" | "antiAlias">>; export type StackedBarOptionsContext = VerticalStackedBarOptionsContext; export type StackedBarOptions = CustomizablePathProps & { roundedCorners?: RoundedCorners; children?: React.ReactNode; }; export type StackedBarOptionsFn = (options: StackedBarOptionsContext) => StackedBarOptions; export type StackedBarPath = { path: SkPath; key: string; color?: Color; } & CustomizablePathProps & { children?: React.ReactNode; }; type Props = { points: PointsArray[]; chartBounds: ChartBounds; innerPadding?: number; barWidth?: number; barCount?: number; colors?: Color[]; barOptions?: StackedBarOptionsFn; }; export declare const useStackedBarPaths: ({ points, chartBounds, innerPadding, barWidth: customBarWidth, barCount, barOptions, colors, }: Props) => StackedBarPath[]; export {};