Skip to content

Commit f2622c5

Browse files
committed
Add additional types and type generation script
1 parent 5ed7da0 commit f2622c5

25 files changed

Lines changed: 3558 additions & 691 deletions

src/types/components/colorbar.d.ts

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/**
2+
* ColorBar types
3+
*
4+
* Defines the structure of ColorBar configuration.
5+
*/
6+
7+
import type { Font } from '../core/layout';
8+
import type { Color, Datum, DTickValue, XAnchor, XRef, YAnchor, YRef } from '../lib/common';
9+
10+
/**
11+
* Exponent format type
12+
*/
13+
export type ExponentFormat = 'none' | 'e' | 'E' | 'power' | 'SI' | 'B';
14+
15+
/**
16+
* Show prefix/suffix type
17+
*/
18+
export type ShowTickLabel = 'all' | 'first' | 'last' | 'none';
19+
20+
/**
21+
* Tick label position type
22+
*/
23+
export type TickLabelPosition =
24+
| 'outside'
25+
| 'inside'
26+
| 'outside top'
27+
| 'inside top'
28+
| 'outside left'
29+
| 'inside left'
30+
| 'outside right'
31+
| 'inside right'
32+
| 'outside bottom'
33+
| 'inside bottom';
34+
35+
/**
36+
* Tick label overflow type
37+
*/
38+
export type TickLabelOverflow = 'allow' | 'hide past div' | 'hide past domain';
39+
40+
/**
41+
* Length mode type
42+
*/
43+
export type LengthMode = 'fraction' | 'pixels';
44+
45+
/**
46+
* ColorBar title configuration
47+
*/
48+
export interface ColorBarTitle {
49+
text?: string;
50+
font?: Partial<Font>;
51+
side?: 'right' | 'top' | 'bottom';
52+
}
53+
54+
/**
55+
* Tick format stop configuration
56+
*/
57+
export interface TickFormatStop {
58+
enabled?: boolean;
59+
dtickrange?: [DTickValue | null, DTickValue | null];
60+
value?: string;
61+
name?: string;
62+
templateitemname?: string;
63+
}
64+
65+
/**
66+
* ColorBar configuration
67+
*/
68+
export interface ColorBar {
69+
orientation?: 'h' | 'v';
70+
thicknessmode?: LengthMode;
71+
thickness?: number;
72+
lenmode?: LengthMode;
73+
len?: number;
74+
x?: number;
75+
xref?: XRef;
76+
xanchor?: XAnchor;
77+
xpad?: number;
78+
y?: number;
79+
yref?: YRef;
80+
yanchor?: YAnchor;
81+
ypad?: number;
82+
outlinecolor?: Color;
83+
outlinewidth?: number;
84+
bordercolor?: Color;
85+
borderwidth?: number;
86+
bgcolor?: Color;
87+
tickmode?: 'auto' | 'linear' | 'array';
88+
nticks?: number;
89+
tick0?: number | string;
90+
dtick?: DTickValue;
91+
tickvals?: Datum[] | Datum[][];
92+
ticktext?: Datum[] | Datum[][];
93+
ticks?: 'outside' | 'inside' | '';
94+
ticklabeloverflow?: TickLabelOverflow;
95+
ticklabelposition?: TickLabelPosition;
96+
ticklen?: number;
97+
tickwidth?: number;
98+
tickcolor?: Color;
99+
ticklabelstep?: number;
100+
showticklabels?: boolean;
101+
labelalias?: DTickValue;
102+
tickfont?: Partial<Font>;
103+
tickangle?: 'auto' | number;
104+
tickformat?: string;
105+
tickformatstops?: Array<Partial<TickFormatStop>>;
106+
tickprefix?: string;
107+
showtickprefix?: ShowTickLabel;
108+
ticksuffix?: string;
109+
showticksuffix?: ShowTickLabel;
110+
separatethousands?: boolean;
111+
exponentformat?: ExponentFormat;
112+
minexponent?: number;
113+
showexponent?: ShowTickLabel;
114+
title?: Partial<ColorBarTitle>;
115+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* RangeSelector types
3+
*
4+
* Defines the structure of RangeSelector configuration.
5+
*/
6+
7+
import type { Font } from '../core/layout';
8+
import type { Color, XAnchor, YAnchor } from '../lib/common';
9+
10+
/**
11+
* RangeSelector step type
12+
*/
13+
export type RangeSelectorStep = 'month' | 'year' | 'day' | 'hour' | 'minute' | 'second' | 'all';
14+
15+
/**
16+
* RangeSelector button configuration
17+
*/
18+
export interface RangeSelectorButton {
19+
visible?: boolean;
20+
step?: RangeSelectorStep;
21+
stepmode?: 'backward' | 'todate';
22+
count?: number;
23+
label?: string;
24+
name?: string;
25+
templateitemname?: string;
26+
}
27+
28+
/**
29+
* RangeSelector configuration
30+
*/
31+
export interface RangeSelector {
32+
buttons?: Array<Partial<RangeSelectorButton>>;
33+
visible?: boolean;
34+
x?: number;
35+
xanchor?: XAnchor;
36+
y?: number;
37+
yanchor?: YAnchor;
38+
activecolor?: Color;
39+
bgcolor?: Color;
40+
bordercolor?: Color;
41+
borderwidth?: number;
42+
font?: Partial<Font>;
43+
}

src/types/components/slider.d.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Slider types
3+
*
4+
* Defines the structure of Slider configuration.
5+
*/
6+
7+
import type { Transition } from '../core/animation';
8+
import type { Font, Padding } from '../core/layout';
9+
import type { Color, XAnchor, YAnchor } from '../lib/common';
10+
import type { LengthMode } from './colorbar';
11+
12+
/**
13+
* Slider step configuration
14+
*/
15+
export interface SliderStep {
16+
visible?: boolean;
17+
method?: 'restyle' | 'relayout' | 'animate' | 'update' | 'skip';
18+
args?: any[];
19+
label?: string;
20+
value?: string;
21+
execute?: boolean;
22+
name?: string;
23+
templateitemname?: string;
24+
}
25+
26+
/**
27+
* Slider current value configuration
28+
*/
29+
export interface CurrentValue {
30+
visible?: boolean;
31+
xanchor?: XAnchor;
32+
offset?: number;
33+
prefix?: string;
34+
suffix?: string;
35+
font?: Partial<Font>;
36+
}
37+
38+
/**
39+
* Slider configuration
40+
*/
41+
export interface Slider {
42+
visible?: boolean;
43+
active?: number;
44+
steps?: Array<Partial<SliderStep>>;
45+
lenmode?: LengthMode;
46+
len?: number;
47+
x?: number;
48+
y?: number;
49+
pad?: Partial<Padding>;
50+
xanchor?: XAnchor;
51+
yanchor?: YAnchor;
52+
transition?: Partial<Transition>;
53+
currentvalue?: Partial<CurrentValue>;
54+
font?: Partial<Font>;
55+
activebgcolor?: Color;
56+
bgcolor?: Color;
57+
bordercolor?: Color;
58+
borderwidth?: number;
59+
ticklen?: number;
60+
tickcolor?: Color;
61+
tickwidth?: number;
62+
minorticklen?: number;
63+
name?: string;
64+
templateitemname?: string;
65+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* UpdateMenu types
3+
*
4+
* Defines the structure of UpdateMenu configuration.
5+
*/
6+
7+
import type { Color, XAnchor, YAnchor } from '../lib/common';
8+
import type { Font, Padding } from '../core/layout';
9+
10+
/**
11+
* UpdateMenu button configuration
12+
*/
13+
export interface UpdateMenuButton {
14+
visible?: boolean;
15+
method?: 'restyle' | 'relayout' | 'animate' | 'update' | 'skip';
16+
args?: any[];
17+
args2?: any[];
18+
label?: string;
19+
execute?: boolean;
20+
name?: string;
21+
templateitemname?: string;
22+
}
23+
24+
/**
25+
* UpdateMenu direction type
26+
*/
27+
export type UpdateMenuDirection = 'left' | 'up' | 'right' | 'down';
28+
29+
/**
30+
* UpdateMenu type
31+
*/
32+
export type UpdateMenuType = 'dropdown' | 'buttons';
33+
34+
/**
35+
* UpdateMenu configuration
36+
*/
37+
export interface UpdateMenu {
38+
active?: number;
39+
bgcolor?: Color;
40+
bordercolor?: Color;
41+
borderwidth?: number;
42+
buttons?: Array<Partial<UpdateMenuButton>>;
43+
direction?: UpdateMenuDirection;
44+
font?: Partial<Font>;
45+
name?: string;
46+
pad?: Partial<Padding>;
47+
showactive?: boolean;
48+
templateitemname?: string;
49+
type?: UpdateMenuType;
50+
visible?: boolean;
51+
x?: number;
52+
xanchor?: XAnchor;
53+
y?: number;
54+
yanchor?: YAnchor;
55+
}

0 commit comments

Comments
 (0)