UNPKG

1.75 kBTypeScriptView Raw
1import { CoordinateComponent } from '../runtime';
2import { CoordinateTransform } from './coordinateTransform';
3export type Coordinate = PolarCoordinate | HelixCoordinate | ThetaCoordinate | CustomCoordinate | CartesianCoordinate | ParallelCoordinate | RadialCoordinate | RadarCoordinate | GeoCoordinate;
4export type CoordinateTypes = 'polar' | 'helix' | 'transpose' | 'theta' | 'cartesian' | 'cartesian3D' | 'parallel' | 'fisheye' | 'radial' | 'radar' | string;
5export type BaseCoordinate<T> = T & {
6 transform?: CoordinateTransform[];
7};
8export type PolarCoordinate = BaseCoordinate<{
9 type?: 'polar';
10 startAngle?: number;
11 endAngle?: number;
12 innerRadius?: number;
13 outerRadius?: number;
14}>;
15export type HelixCoordinate = BaseCoordinate<{
16 type?: 'helix';
17 startAngle?: number;
18 endAngle?: number;
19 innerRadius?: number;
20 outerRadius?: number;
21}>;
22export type RadarCoordinate = BaseCoordinate<{
23 type?: 'radar';
24 startAngle?: number;
25 endAngle?: number;
26 innerRadius?: number;
27 outerRadius?: number;
28}>;
29export type ThetaCoordinate = BaseCoordinate<{
30 type?: 'theta';
31 startAngle?: number;
32 endAngle?: number;
33 innerRadius?: number;
34 outerRadius?: number;
35}>;
36export type RadialCoordinate = BaseCoordinate<{
37 type?: 'radial';
38 startAngle?: number;
39 endAngle?: number;
40 innerRadius?: number;
41 outerRadius?: number;
42}>;
43export type CartesianCoordinate = BaseCoordinate<{
44 type?: 'cartesian';
45}>;
46export type ParallelCoordinate = BaseCoordinate<{
47 type?: 'parallel';
48}>;
49export type GeoCoordinate = BaseCoordinate<{
50 type: string;
51 [key: string]: any;
52}>;
53export type CustomCoordinate = BaseCoordinate<{
54 type: CoordinateComponent;
55 [key: string]: any;
56}>;