UNPKG

1.86 kBTypeScriptView Raw
1/**
2 * @fileOverview Axis of radial direction
3 */
4import React, { PureComponent } from 'react';
5import { BaseAxisProps, TickItem, PresentationAttributesAdaptChildEvent } from '../util/types';
6export interface PolarAngleAxisProps extends BaseAxisProps {
7 angleAxisId?: string | number;
8 cx?: number;
9 cy?: number;
10 radius?: number;
11 axisLineType?: 'polygon' | 'circle';
12 ticks?: TickItem[];
13 orientation?: 'inner' | 'outer';
14}
15export type Props = PresentationAttributesAdaptChildEvent<any, SVGTextElement> & PolarAngleAxisProps;
16export declare class PolarAngleAxis extends PureComponent<Props> {
17 static displayName: string;
18 static axisType: string;
19 static defaultProps: {
20 type: string;
21 angleAxisId: number;
22 scale: string;
23 cx: number;
24 cy: number;
25 orientation: string;
26 axisLine: boolean;
27 tickLine: boolean;
28 tickSize: number;
29 tick: boolean;
30 hide: boolean;
31 allowDuplicatedCategory: boolean;
32 };
33 /**
34 * Calculate the coordinate of line endpoint
35 * @param {Object} data The Data if ticks
36 * @return {Object} (x0, y0): The start point of text,
37 * (x1, y1): The end point close to text,
38 * (x2, y2): The end point close to axis
39 */
40 getTickLineCoord(data: TickItem): {
41 x1: number;
42 y1: number;
43 x2: number;
44 y2: number;
45 };
46 /**
47 * Get the text-anchor of each tick
48 * @param {Object} data Data of ticks
49 * @return {String} text-anchor
50 */
51 getTickTextAnchor(data: TickItem): string;
52 renderAxisLine(): React.JSX.Element;
53 static renderTickItem(option: PolarAngleAxisProps['tick'], props: any, value: string | number): React.JSX.Element;
54 renderTicks(): React.JSX.Element;
55 render(): React.JSX.Element;
56}