UNPKG

1.49 kBTypeScriptView Raw
1import React, { PureComponent, CSSProperties } from 'react';
2import { Payload, Props as DefaultProps } from './DefaultLegendContent';
3import { LayoutType } from '../util/types';
4import { UniqueOption } from '../util/payload/getUniqPayload';
5export type Props = DefaultProps & {
6 wrapperStyle?: CSSProperties;
7 chartWidth?: number;
8 chartHeight?: number;
9 width?: number;
10 height?: number;
11 margin?: {
12 top?: number;
13 left?: number;
14 bottom?: number;
15 right?: number;
16 };
17 payloadUniqBy?: UniqueOption<Payload>;
18 onBBoxUpdate?: (box: DOMRect | null) => void;
19};
20interface State {
21 boxWidth: number;
22 boxHeight: number;
23}
24export declare class Legend extends PureComponent<Props, State> {
25 static displayName: string;
26 static defaultProps: {
27 iconSize: number;
28 layout: string;
29 align: string;
30 verticalAlign: string;
31 };
32 private wrapperNode;
33 static getWithHeight(item: {
34 props: {
35 layout?: LayoutType;
36 height?: number;
37 width?: number;
38 };
39 }, chartWidth: number): null | {
40 height: number;
41 } | {
42 width: number;
43 };
44 lastBoundingBox: {
45 width: number;
46 height: number;
47 };
48 componentDidMount(): void;
49 componentDidUpdate(): void;
50 getBBox(): DOMRect;
51 private updateBBox;
52 private getBBoxSnapshot;
53 private getDefaultPosition;
54 render(): React.JSX.Element;
55}
56export {};