UNPKG

2.39 kBTypeScriptView Raw
1/// <reference types="react" />
2import { RectProps } from "react-native-svg";
3import AbstractChart from "../AbstractChart";
4import { ContributionGraphProps, ContributionGraphState } from ".";
5export declare type ContributionChartValue = {
6 value: number;
7 title: string;
8 tooltipDataAttrs: TooltipDataAttrs;
9 date: Date;
10};
11export declare type TooltipDataAttrs = (value: ContributionChartValue) => Partial<RectProps> | Partial<RectProps>;
12declare class ContributionGraph extends AbstractChart<ContributionGraphProps, ContributionGraphState> {
13 constructor(props: ContributionGraphProps);
14 UNSAFE_componentWillReceiveProps(nextProps: ContributionGraphProps): void;
15 getSquareSizeWithGutter(): number;
16 getMonthLabelSize(): number;
17 getStartDate(): Date;
18 getEndDate(): Date;
19 getStartDateWithEmptyDays(): Date;
20 getNumEmptyDaysAtStart(): number;
21 getNumEmptyDaysAtEnd(): number;
22 getWeekCount(): number;
23 getWeekWidth(): number;
24 getWidth(): number;
25 getHeight(): number;
26 getValueCache(values: ContributionChartValue[]): {
27 valueCache: {};
28 minValue: number;
29 maxValue: number;
30 };
31 getValueForIndex(index: number): any;
32 getClassNameForIndex(index: number): string;
33 getTitleForIndex(index: number): any;
34 getTooltipDataAttrsForIndex(index: number): any;
35 getTooltipDataAttrsForValue(value: ContributionChartValue): Partial<RectProps>;
36 getTransformForWeek(weekIndex: number): number[];
37 getTransformForMonthLabels(): string;
38 getTransformForAllWeeks(): string;
39 getViewBox(): string;
40 getSquareCoordinates(dayIndex: number): number[];
41 getMonthLabelCoordinates(weekIndex: number): number[];
42 renderSquare(dayIndex: number, index: number): JSX.Element;
43 handleDayPress(index: number): void;
44 renderWeek(weekIndex: number): JSX.Element;
45 renderAllWeeks(): JSX.Element[];
46 renderMonthLabels(): JSX.Element[];
47 static defaultProps: {
48 numDays: number;
49 endDate: Date;
50 gutterSize: number;
51 squareSize: number;
52 horizontal: boolean;
53 showMonthLabels: boolean;
54 showOutOfRangeDays: boolean;
55 accessor: string;
56 classForValue: (value: any) => "black" | "#8cc665";
57 style: {};
58 };
59 render(): JSX.Element;
60}
61export default ContributionGraph;
62//# sourceMappingURL=ContributionGraph.d.ts.map
\No newline at end of file