@uiw/react-heat-map
Version:
React component create calendar heatmap to visualize time series data, a la github contribution graph.
30 lines (29 loc) • 1 kB
TypeScript
import React from 'react';
import { RectProps } from './Rect';
import { LegendProps } from './Legend';
export type HeatMapValue = {
date: string;
content?: string | string[] | React.ReactNode;
count: number;
};
export interface SVGProps extends React.SVGProps<SVGSVGElement> {
startDate?: Date;
endDate?: Date;
rectSize?: number;
legendCellSize?: number;
space?: number;
rectProps?: RectProps;
legendRender?: LegendProps['legendRender'];
rectRender?: (data: React.SVGProps<SVGRectElement>, valueItem: HeatMapValue & {
column: number;
row: number;
index: number;
}) => React.ReactElement | void;
value?: Array<HeatMapValue>;
weekLabels?: string[] | false;
monthLabels?: string[] | false;
/** position of month labels @default `top` */
monthPlacement?: 'top' | 'bottom';
panelColors?: Record<number, string> | string[];
}
export default function SVG(props: SVGProps): import("react/jsx-runtime").JSX.Element;