@visx/heatmap
Version:
visx heatmap
44 lines • 2.38 kB
TypeScript
import React from 'react';
import { GenericCell, ColorScale, OpacityScale } from '../types';
export declare type HeatmapCircleProps<ColumnDatum, BinDatum> = {
/** Array of column data (one per column desired) for the heatmap. */
data?: ColumnDatum[];
/** Left offset applied to heatmap wrapper g element. */
left?: number;
/** Top offset applied to heatmap wrapper g element. */
top?: number;
/** Pixel gap between heatmap circles. */
gap?: number;
/** Pixel radius of heatmap circles. */
radius?: number;
/** Given a column index, returns the x position of a circle cell. */
xScale: (columnIndex: number) => number;
/** Given a row index, returns the y position of a circle cell. */
yScale: (rowIndex: number) => number;
/** Given a count value, returns the desired circle fill color. */
colorScale?: ColorScale;
/** Given a count value, returns the desired circle fill opacity. */
opacityScale?: OpacityScale;
/** Accessor that returns an array of cell BinDatums (rows) for the provided ColumnData. */
bins?: (column: ColumnDatum) => BinDatum[];
/** Accessor that returns the count for the provided Bin. */
count?: (bin: BinDatum) => number;
/** className to apply to each heatmap circle element. */
className?: string;
/** Render function override, provided with heatmap. */
children?: (cells: CircleCell<ColumnDatum, BinDatum>[][]) => React.ReactNode;
};
export declare type CircleCell<ColumnDatum, BinDatum> = GenericCell<ColumnDatum, BinDatum> & {
/** Computed radius for the circle (radius - gap). */
r: number;
/** Input radius for the circle including specified gap. */
radius: number;
/** x position of the cell circle center. */
cx: number;
/** y position of the cell circle center. */
cy: number;
};
export default function HeatmapCircle<ColumnDatum, BinDatum>({ className, top, left, data, gap, radius, xScale, yScale, colorScale, opacityScale, bins, // eslint-disable-line @typescript-eslint/no-explicit-any
count, // eslint-disable-line @typescript-eslint/no-explicit-any
children, ...restProps }: HeatmapCircleProps<ColumnDatum, BinDatum> & Omit<React.SVGProps<SVGCircleElement>, keyof HeatmapCircleProps<ColumnDatum, BinDatum> | 'r' | 'cx' | 'cy' | 'fill' | 'fillOpacity'>): JSX.Element;
//# sourceMappingURL=HeatmapCircle.d.ts.map