victory-native
Version:
A charting library for React Native with a focus on performance and customization.
30 lines (29 loc) • 1.35 kB
TypeScript
import * as 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 HorizontalStackedBarOptionsContext } from "../utils/getStackedBarSegments";
type HorizontalStackedBarPathProps = Partial<Pick<PathProps, "color" | "blendMode" | "opacity" | "antiAlias">>;
export type HorizontalStackedBarOptions = HorizontalStackedBarPathProps & {
roundedCorners?: RoundedCorners;
children?: React.ReactNode;
};
export type { HorizontalStackedBarOptionsContext };
export type HorizontalStackedBarOptionsFn = (options: HorizontalStackedBarOptionsContext) => HorizontalStackedBarOptions;
export type HorizontalStackedBarPath = {
path: SkPath;
key: string;
color?: Color;
} & HorizontalStackedBarPathProps & {
children?: React.ReactNode;
};
type Props = {
points: PointsArray[];
chartBounds: ChartBounds;
innerPadding?: number;
barWidth?: number;
barCount?: number;
colors?: Color[];
barOptions?: HorizontalStackedBarOptionsFn;
};
export declare const useHorizontalStackedBarPaths: ({ points, chartBounds, innerPadding, barWidth: customBarWidth, barCount, barOptions, colors, }: Props) => HorizontalStackedBarPath[];