Skip to content

Commit 7f857ee

Browse files
authored
Merge pull request #8042 from plotly/cam/convert-to-ts-2026-09-14
chore: Convert constants files to TS
2 parents 7ba4b12 + 8d764d1 commit 7f857ee

94 files changed

Lines changed: 1160 additions & 1177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/components/colorbar/constants.js

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const cn = {
2+
colorbar: 'colorbar',
3+
cbbg: 'cbbg',
4+
cbfill: 'cbfill',
5+
cbfills: 'cbfills',
6+
cbline: 'cbline',
7+
cblines: 'cblines',
8+
cbaxis: 'cbaxis',
9+
cbtitleunshift: 'cbtitleunshift',
10+
cbtitle: 'cbtitle',
11+
cboutline: 'cboutline',
12+
crisp: 'crisp',
13+
jsPlaceholder: 'js-placeholder'
14+
} as const;

src/components/fx/constants.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/components/fx/constants.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Hover labels for multiple horizontal bars get tilted by this angle
2+
export const YANGLE = 60;
3+
4+
// Size and display constants for hover text
5+
6+
// Pixel size of hover arrows
7+
export const HOVERARROWSIZE = 6;
8+
// Pixels padding around text
9+
export const HOVERTEXTPAD = 3;
10+
// Hover font
11+
export const HOVERFONTSIZE = 13;
12+
export const HOVERFONT = 'Arial, sans-serif';
13+
14+
// Minimum time (msec) between hover calls
15+
export const HOVERMINTIME = 50;
16+
17+
// ID suffix (with fullLayout._uid) for hover events in the throttle cache
18+
export const HOVERID = '-hover';

src/components/legend/constants.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/components/legend/constants.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const scrollBarWidth = 6;
2+
export const scrollBarMinHeight = 20;
3+
export const scrollBarColor = '#808BA4';
4+
export const scrollBarMargin = 4;
5+
export const scrollBarEnterAttrs = { rx: 20, ry: 3, width: 0, height: 0 } as const;
6+
7+
// Number of px between legend title and (left) side of legend (always in x direction and from inner border)
8+
export const titlePad = 2;
9+
// Number of px between each legend item (x and/or y direction)
10+
export const itemGap = 5;

src/components/rangeselector/constants.js

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// 'y' position pad above counter axis domain
2+
export const yPad = 0.02;
3+
4+
// Minimum button width (regardless of text size)
5+
export const minButtonWidth = 30;
6+
7+
// Buttons rect radii
8+
export const rx = 3;
9+
export const ry = 3;
10+
11+
// Light fraction used to compute the 'activecolor' default
12+
export const lightAmount = 25;
13+
export const darkAmount = 10;

src/components/rangeslider/constants.js

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Attribute container name
2+
export const name = 'rangeslider';
3+
4+
// Class names
5+
6+
export const containerClassName = 'rangeslider-container';
7+
export const bgClassName = 'rangeslider-bg';
8+
export const rangePlotClassName = 'rangeslider-rangeplot';
9+
10+
export const maskMinClassName = 'rangeslider-mask-min';
11+
export const maskMaxClassName = 'rangeslider-mask-max';
12+
export const slideBoxClassName = 'rangeslider-slidebox';
13+
14+
export const grabberMinClassName = 'rangeslider-grabber-min';
15+
export const grabAreaMinClassName = 'rangeslider-grabarea-min';
16+
export const handleMinClassName = 'rangeslider-handle-min';
17+
18+
export const grabberMaxClassName = 'rangeslider-grabber-max';
19+
export const grabAreaMaxClassName = 'rangeslider-grabarea-max';
20+
export const handleMaxClassName = 'rangeslider-handle-max';
21+
22+
export const maskMinOppAxisClassName = 'rangeslider-mask-min-opp-axis';
23+
export const maskMaxOppAxisClassName = 'rangeslider-mask-max-opp-axis';
24+
25+
// Style constants
26+
27+
export const maskColor = 'rgba(0,0,0,0.4)';
28+
export const maskOppAxisColor = 'rgba(0,0,0,0.2)';
29+
30+
export const slideBoxFill = 'transparent';
31+
export const slideBoxCursor = 'ew-resize';
32+
33+
export const grabAreaFill = 'transparent';
34+
export const grabAreaCursor = 'col-resize';
35+
export const grabAreaWidth = 10;
36+
37+
export const handleWidth = 4;
38+
export const handleRadius = 1;
39+
export const handleStrokeWidth = 1;
40+
41+
export const extraPad = 15;

0 commit comments

Comments
 (0)