@unovis/ts 1.5.2 → 1.6.0-bigip.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/axis/index.d.ts +0 -1
- package/components/axis/index.js +2 -10
- package/components/axis/index.js.map +1 -1
- package/components/brush/config.d.ts +1 -1
- package/components/brush/config.js.map +1 -1
- package/components/crosshair/config.d.ts +5 -0
- package/components/crosshair/config.js +1 -1
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +6 -1
- package/components/crosshair/index.js +182 -34
- package/components/crosshair/index.js.map +1 -1
- package/components/crosshair/sync-bus.d.ts +9 -0
- package/components/crosshair/sync-bus.js +27 -0
- package/components/crosshair/sync-bus.js.map +1 -0
- package/components/graph/config.d.ts +8 -0
- package/components/graph/config.js +1 -1
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +1 -0
- package/components/graph/index.js +14 -9
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.js +31 -29
- package/components/graph/modules/layout.js.map +1 -1
- package/components/graph/modules/link/index.js +1 -1
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/types.d.ts +2 -1
- package/components/graph/types.js.map +1 -1
- package/components/plotband/config.d.ts +59 -0
- package/components/plotband/config.js +9 -0
- package/components/plotband/config.js.map +1 -0
- package/components/plotband/constants.d.ts +5 -0
- package/components/plotband/constants.js +413 -0
- package/components/plotband/constants.js.map +1 -0
- package/components/plotband/index.d.ts +15 -0
- package/components/plotband/index.js +92 -0
- package/components/plotband/index.js.map +1 -0
- package/components/plotband/style.d.ts +4 -0
- package/components/plotband/style.js +38 -0
- package/components/plotband/style.js.map +1 -0
- package/components/plotband/types.d.ts +51 -0
- package/components/plotband/types.js +27 -0
- package/components/plotband/types.js.map +1 -0
- package/components/timeline/config.d.ts +65 -14
- package/components/timeline/config.js +15 -1
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/constants.d.ts +3 -0
- package/components/timeline/constants.js +6 -0
- package/components/timeline/constants.js.map +1 -0
- package/components/timeline/index.d.ts +21 -10
- package/components/timeline/index.js +379 -93
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.d.ts +7 -0
- package/components/timeline/style.js +40 -1
- package/components/timeline/style.js.map +1 -1
- package/components/timeline/types.d.ts +62 -0
- package/components/timeline/types.js +2 -0
- package/components/timeline/types.js.map +1 -0
- package/components/timeline/utils.d.ts +2 -0
- package/components/timeline/utils.js +16 -0
- package/components/timeline/utils.js.map +1 -0
- package/components.d.ts +4 -2
- package/components.js +1 -0
- package/components.js.map +1 -1
- package/containers/xy-container/config.d.ts +2 -0
- package/containers/xy-container/config.js +1 -1
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.js +2 -2
- package/containers/xy-container/index.js.map +1 -1
- package/data-models/graph.js +7 -1
- package/data-models/graph.js.map +1 -1
- package/index.js +4 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/types/position.d.ts +2 -1
- package/types/position.js +1 -0
- package/types/position.js.map +1 -1
- package/types.d.ts +2 -0
- package/types.js +2 -0
- package/types.js.map +1 -1
- package/utils/data.d.ts +1 -1
- package/utils/data.js +1 -1
- package/utils/data.js.map +1 -1
- package/utils/index.js +2 -2
- package/utils/path.d.ts +8 -0
- package/utils/path.js +109 -1
- package/utils/path.js.map +1 -1
- package/utils/text.d.ts +2 -1
- package/utils/text.js +10 -2
- package/utils/text.js.map +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { XYComponentConfigInterface } from "../../core/xy-component/config";
|
|
2
|
+
import { AxisType } from "../axis/types";
|
|
3
|
+
import { PlotbandLabelOrientation, PlotbandLabelPosition } from './types';
|
|
4
|
+
export interface PlotbandConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {
|
|
5
|
+
/**
|
|
6
|
+
* Fill color of the plotband.
|
|
7
|
+
* Accepts any valid CSS color string.
|
|
8
|
+
*
|
|
9
|
+
* @default 'var(--vis-plotband-color)'
|
|
10
|
+
*/
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Axis to draw the plotband on.
|
|
13
|
+
* @default AxisType.Y
|
|
14
|
+
*/
|
|
15
|
+
axis?: AxisType;
|
|
16
|
+
/** Start coordinate for the plotband.
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
from?: number | null | undefined;
|
|
20
|
+
/** End coordinate for the plotband.
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
to?: number | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Duration of the animation in milliseconds.
|
|
26
|
+
*
|
|
27
|
+
* @default 300
|
|
28
|
+
*/
|
|
29
|
+
duration?: number;
|
|
30
|
+
/** Optional text to display on the plotband */
|
|
31
|
+
labelText?: string;
|
|
32
|
+
/** Position of the label relative to the plotband area (e.g., 'top-left-outside').
|
|
33
|
+
* Can be customized with a string.
|
|
34
|
+
* @default PlotbandLabelPosition.TopLeftOutside
|
|
35
|
+
*/
|
|
36
|
+
labelPosition?: PlotbandLabelPosition;
|
|
37
|
+
/** Horizontal offset (in pixels) for positioning the label.
|
|
38
|
+
* @default 14
|
|
39
|
+
*/
|
|
40
|
+
labelOffsetX?: number;
|
|
41
|
+
/** Vertical offset (in pixels) for positioning the label.
|
|
42
|
+
* @default 14
|
|
43
|
+
*/
|
|
44
|
+
labelOffsetY?: number;
|
|
45
|
+
/** Orientation of the label text.
|
|
46
|
+
* @default PlotbandLabelOrientation.Horizontal
|
|
47
|
+
*/
|
|
48
|
+
labelOrientation?: PlotbandLabelOrientation;
|
|
49
|
+
/** Optional color for the label text */
|
|
50
|
+
labelColor?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Font size (in pixels) for the label text.
|
|
53
|
+
* Uses the CSS variable `--vis-plotband-label-font-size` by default, which resolves to `12px`.
|
|
54
|
+
*
|
|
55
|
+
* @default 12
|
|
56
|
+
*/
|
|
57
|
+
labelSize?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare const PlotbandDefaultConfig: PlotbandConfigInterface<unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
|
|
2
|
+
import { AxisType } from '../axis/types.js';
|
|
3
|
+
import { PlotbandLabelPosition, PlotbandLabelOrientation } from './types.js';
|
|
4
|
+
|
|
5
|
+
// Config
|
|
6
|
+
const PlotbandDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { axis: AxisType.Y, from: 0, to: 0, color: undefined, duration: 300, labelPosition: PlotbandLabelPosition.TopLeftOutside, labelOffsetX: 14, labelOffsetY: 14, labelOrientation: PlotbandLabelOrientation.Horizontal });
|
|
7
|
+
|
|
8
|
+
export { PlotbandDefaultConfig };
|
|
9
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/plotband/config.ts"],"sourcesContent":["// Config\nimport { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { AxisType } from 'components/axis/types'\nimport { PlotbandLabelOrientation, PlotbandLabelPosition } from './types'\n\nexport interface PlotbandConfigInterface<Datum> extends Partial<XYComponentConfigInterface<Datum>> {\n /**\n * Fill color of the plotband.\n * Accepts any valid CSS color string.\n *\n * @default 'var(--vis-plotband-color)'\n */\n color?: string;\n\n /** Axis to draw the plotband on.\n * @default AxisType.Y\n */\n axis?: AxisType;\n\n /** Start coordinate for the plotband.\n * @default 0\n */\n from?: number | null | undefined;\n\n /** End coordinate for the plotband.\n * @default 0\n */\n to?: number | null | undefined;\n\n /**\n * Duration of the animation in milliseconds.\n *\n * @default 300\n */\n duration?: number;\n\n /** Optional text to display on the plotband */\n labelText?: string;\n\n /** Position of the label relative to the plotband area (e.g., 'top-left-outside').\n * Can be customized with a string.\n * @default PlotbandLabelPosition.TopLeftOutside\n */\n labelPosition?: PlotbandLabelPosition;\n\n /** Horizontal offset (in pixels) for positioning the label.\n * @default 14\n */\n labelOffsetX?: number;\n\n /** Vertical offset (in pixels) for positioning the label.\n * @default 14\n */\n labelOffsetY?: number;\n\n /** Orientation of the label text.\n * @default PlotbandLabelOrientation.Horizontal\n */\n labelOrientation?: PlotbandLabelOrientation;\n\n /** Optional color for the label text */\n labelColor?: string;\n\n /**\n * Font size (in pixels) for the label text.\n * Uses the CSS variable `--vis-plotband-label-font-size` by default, which resolves to `12px`.\n *\n * @default 12\n */\n labelSize?: number;\n}\n\nexport const PlotbandDefaultConfig: PlotbandConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n axis: AxisType.Y,\n from: 0,\n to: 0,\n color: undefined,\n duration: 300,\n labelPosition: PlotbandLabelPosition.TopLeftOutside,\n labelOffsetX: 14,\n labelOffsetY: 14,\n labelOrientation: PlotbandLabelOrientation.Horizontal,\n}\n"],"names":[],"mappings":";;;;AAAA;MA0Ea,qBAAqB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC7B,wBAAwB,CAC3B,EAAA,EAAA,IAAI,EAAE,QAAQ,CAAC,CAAC,EAChB,IAAI,EAAE,CAAC,EACP,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,GAAG,EACb,aAAa,EAAE,qBAAqB,CAAC,cAAc,EACnD,YAAY,EAAE,EAAE,EAChB,YAAY,EAAE,EAAE,EAChB,gBAAgB,EAAE,wBAAwB,CAAC,UAAU,EAAA;;;;"}
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { PlotbandLabelPosition } from './types.js';
|
|
2
|
+
|
|
3
|
+
const HORIZONTAL_X = {
|
|
4
|
+
[PlotbandLabelPosition.TopLeftOutside]: ({ startX, offsetX, offsetY }) => ({
|
|
5
|
+
x: startX - offsetX,
|
|
6
|
+
y: offsetY,
|
|
7
|
+
textAnchor: 'end',
|
|
8
|
+
dominantBaseline: 'text-before-edge',
|
|
9
|
+
}),
|
|
10
|
+
[PlotbandLabelPosition.TopLeftInside]: ({ startX, offsetX, offsetY }) => ({
|
|
11
|
+
x: startX + offsetX,
|
|
12
|
+
y: offsetY,
|
|
13
|
+
textAnchor: 'start',
|
|
14
|
+
dominantBaseline: 'text-before-edge',
|
|
15
|
+
}),
|
|
16
|
+
[PlotbandLabelPosition.TopOutside]: ({ startX, width, offsetY }) => ({
|
|
17
|
+
x: startX + width / 2,
|
|
18
|
+
y: offsetY,
|
|
19
|
+
textAnchor: 'middle',
|
|
20
|
+
dominantBaseline: 'text-before-edge',
|
|
21
|
+
}),
|
|
22
|
+
[PlotbandLabelPosition.TopInside]: ({ startX, width, offsetY }) => ({
|
|
23
|
+
x: startX + width / 2,
|
|
24
|
+
y: offsetY,
|
|
25
|
+
textAnchor: 'middle',
|
|
26
|
+
dominantBaseline: 'text-before-edge',
|
|
27
|
+
}),
|
|
28
|
+
[PlotbandLabelPosition.TopRightOutside]: ({ startX, width, offsetX, offsetY }) => ({
|
|
29
|
+
x: startX + width + offsetX,
|
|
30
|
+
y: offsetY,
|
|
31
|
+
textAnchor: 'start',
|
|
32
|
+
dominantBaseline: 'text-before-edge',
|
|
33
|
+
}),
|
|
34
|
+
[PlotbandLabelPosition.TopRightInside]: ({ startX, width, offsetX, offsetY }) => ({
|
|
35
|
+
x: startX + width - offsetX,
|
|
36
|
+
y: offsetY,
|
|
37
|
+
textAnchor: 'end',
|
|
38
|
+
dominantBaseline: 'text-before-edge',
|
|
39
|
+
}),
|
|
40
|
+
[PlotbandLabelPosition.RightOutside]: ({ startX, width, height, offsetX }) => ({
|
|
41
|
+
x: startX + width + offsetX,
|
|
42
|
+
y: height / 2,
|
|
43
|
+
textAnchor: 'start',
|
|
44
|
+
dominantBaseline: 'middle',
|
|
45
|
+
}),
|
|
46
|
+
[PlotbandLabelPosition.RightInside]: ({ startX, width, height, offsetX }) => ({
|
|
47
|
+
x: startX + width - offsetX,
|
|
48
|
+
y: height / 2,
|
|
49
|
+
textAnchor: 'end',
|
|
50
|
+
dominantBaseline: 'middle',
|
|
51
|
+
}),
|
|
52
|
+
[PlotbandLabelPosition.BottomRightOutside]: ({ startX, width, height, offsetX, offsetY }) => ({
|
|
53
|
+
x: startX + width + offsetX,
|
|
54
|
+
y: height - offsetY,
|
|
55
|
+
textAnchor: 'start',
|
|
56
|
+
dominantBaseline: 'text-after-edge',
|
|
57
|
+
}),
|
|
58
|
+
[PlotbandLabelPosition.BottomRightInside]: ({ startX, width, height, offsetX, offsetY }) => ({
|
|
59
|
+
x: startX + width - offsetX,
|
|
60
|
+
y: height - offsetY,
|
|
61
|
+
textAnchor: 'end',
|
|
62
|
+
dominantBaseline: 'text-after-edge',
|
|
63
|
+
}),
|
|
64
|
+
[PlotbandLabelPosition.BottomOutside]: ({ startX, width, height, offsetY }) => ({
|
|
65
|
+
x: startX + width / 2,
|
|
66
|
+
y: height - offsetY,
|
|
67
|
+
textAnchor: 'middle',
|
|
68
|
+
dominantBaseline: 'text-after-edge',
|
|
69
|
+
}),
|
|
70
|
+
[PlotbandLabelPosition.BottomInside]: ({ startX, width, height, offsetY }) => ({
|
|
71
|
+
x: startX + width / 2,
|
|
72
|
+
y: height - offsetY,
|
|
73
|
+
textAnchor: 'middle',
|
|
74
|
+
dominantBaseline: 'text-after-edge',
|
|
75
|
+
}),
|
|
76
|
+
[PlotbandLabelPosition.BottomLeftOutside]: ({ startX, height, offsetX, offsetY }) => ({
|
|
77
|
+
x: startX - offsetX,
|
|
78
|
+
y: height - offsetY,
|
|
79
|
+
textAnchor: 'end',
|
|
80
|
+
dominantBaseline: 'text-after-edge',
|
|
81
|
+
}),
|
|
82
|
+
[PlotbandLabelPosition.BottomLeftInside]: ({ startX, height, offsetX, offsetY }) => ({
|
|
83
|
+
x: startX + offsetX,
|
|
84
|
+
y: height - offsetY,
|
|
85
|
+
textAnchor: 'start',
|
|
86
|
+
dominantBaseline: 'text-after-edge',
|
|
87
|
+
}),
|
|
88
|
+
[PlotbandLabelPosition.LeftOutside]: ({ startX, height, offsetX }) => ({
|
|
89
|
+
x: startX - offsetX,
|
|
90
|
+
y: height / 2,
|
|
91
|
+
textAnchor: 'end',
|
|
92
|
+
dominantBaseline: 'middle',
|
|
93
|
+
}),
|
|
94
|
+
[PlotbandLabelPosition.LeftInside]: ({ startX, height, offsetX }) => ({
|
|
95
|
+
x: startX + offsetX,
|
|
96
|
+
y: height / 2,
|
|
97
|
+
textAnchor: 'start',
|
|
98
|
+
dominantBaseline: 'middle',
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
const VERTICAL_X = {
|
|
102
|
+
[PlotbandLabelPosition.TopLeftOutside]: ({ startX, offsetX, offsetY }) => ({
|
|
103
|
+
x: startX - offsetX,
|
|
104
|
+
y: offsetY,
|
|
105
|
+
textAnchor: 'end',
|
|
106
|
+
dominantBaseline: 'text-after-edge',
|
|
107
|
+
}),
|
|
108
|
+
[PlotbandLabelPosition.TopLeftInside]: ({ startX, offsetX, offsetY }) => ({
|
|
109
|
+
x: startX + offsetX,
|
|
110
|
+
y: offsetY,
|
|
111
|
+
textAnchor: 'end',
|
|
112
|
+
dominantBaseline: 'text-before-edge',
|
|
113
|
+
}),
|
|
114
|
+
[PlotbandLabelPosition.TopOutside]: ({ startX, width, offsetY }) => ({
|
|
115
|
+
x: startX + width / 2,
|
|
116
|
+
y: offsetY,
|
|
117
|
+
textAnchor: 'end',
|
|
118
|
+
dominantBaseline: 'middle',
|
|
119
|
+
}),
|
|
120
|
+
[PlotbandLabelPosition.TopInside]: ({ startX, width, offsetY }) => ({
|
|
121
|
+
x: startX + width / 2,
|
|
122
|
+
y: offsetY,
|
|
123
|
+
textAnchor: 'end',
|
|
124
|
+
dominantBaseline: 'middle',
|
|
125
|
+
}),
|
|
126
|
+
[PlotbandLabelPosition.TopRightOutside]: ({ startX, width, offsetX, offsetY }) => ({
|
|
127
|
+
x: startX + width + offsetX,
|
|
128
|
+
y: offsetY,
|
|
129
|
+
textAnchor: 'end',
|
|
130
|
+
dominantBaseline: 'text-before-edge',
|
|
131
|
+
}),
|
|
132
|
+
[PlotbandLabelPosition.TopRightInside]: ({ startX, width, offsetX, offsetY }) => ({
|
|
133
|
+
x: startX + width - offsetX,
|
|
134
|
+
y: offsetY,
|
|
135
|
+
textAnchor: 'end',
|
|
136
|
+
dominantBaseline: 'text-after-edge',
|
|
137
|
+
}),
|
|
138
|
+
[PlotbandLabelPosition.RightOutside]: ({ startX, width, height, offsetX }) => ({
|
|
139
|
+
x: startX + width + offsetX,
|
|
140
|
+
y: height / 2,
|
|
141
|
+
textAnchor: 'middle',
|
|
142
|
+
dominantBaseline: 'text-before-edge',
|
|
143
|
+
}),
|
|
144
|
+
[PlotbandLabelPosition.RightInside]: ({ startX, width, height, offsetX }) => ({
|
|
145
|
+
x: startX + width - offsetX,
|
|
146
|
+
y: height / 2,
|
|
147
|
+
textAnchor: 'middle',
|
|
148
|
+
dominantBaseline: 'text-after-edge',
|
|
149
|
+
}),
|
|
150
|
+
[PlotbandLabelPosition.BottomRightOutside]: ({ startX, width, height, offsetX, offsetY }) => ({
|
|
151
|
+
x: startX + width + offsetX,
|
|
152
|
+
y: height - offsetY,
|
|
153
|
+
textAnchor: 'start',
|
|
154
|
+
dominantBaseline: 'text-before-edge',
|
|
155
|
+
}),
|
|
156
|
+
[PlotbandLabelPosition.BottomRightInside]: ({ startX, width, height, offsetX, offsetY }) => ({
|
|
157
|
+
x: startX + width - offsetX,
|
|
158
|
+
y: height - offsetY,
|
|
159
|
+
textAnchor: 'start',
|
|
160
|
+
dominantBaseline: 'text-after-edge',
|
|
161
|
+
}),
|
|
162
|
+
[PlotbandLabelPosition.BottomOutside]: ({ startX, width, height, offsetY }) => ({
|
|
163
|
+
x: startX + width / 2,
|
|
164
|
+
y: height - offsetY,
|
|
165
|
+
textAnchor: 'start',
|
|
166
|
+
dominantBaseline: 'middle',
|
|
167
|
+
}),
|
|
168
|
+
[PlotbandLabelPosition.BottomInside]: ({ startX, width, height, offsetY }) => ({
|
|
169
|
+
x: startX + width / 2,
|
|
170
|
+
y: height - offsetY,
|
|
171
|
+
textAnchor: 'start',
|
|
172
|
+
dominantBaseline: 'middle',
|
|
173
|
+
}),
|
|
174
|
+
[PlotbandLabelPosition.BottomLeftOutside]: ({ startX, height, offsetX, offsetY }) => ({
|
|
175
|
+
x: startX - offsetX,
|
|
176
|
+
y: height - offsetY,
|
|
177
|
+
textAnchor: 'start',
|
|
178
|
+
dominantBaseline: 'text-after-edge',
|
|
179
|
+
}),
|
|
180
|
+
[PlotbandLabelPosition.BottomLeftInside]: ({ startX, height, offsetX, offsetY }) => ({
|
|
181
|
+
x: startX + offsetX,
|
|
182
|
+
y: height - offsetY,
|
|
183
|
+
textAnchor: 'start',
|
|
184
|
+
dominantBaseline: 'text-before-edge',
|
|
185
|
+
}),
|
|
186
|
+
[PlotbandLabelPosition.LeftOutside]: ({ startX, height, offsetX }) => ({
|
|
187
|
+
x: startX - offsetX,
|
|
188
|
+
y: height / 2,
|
|
189
|
+
textAnchor: 'middle',
|
|
190
|
+
dominantBaseline: 'text-after-edge',
|
|
191
|
+
}),
|
|
192
|
+
[PlotbandLabelPosition.LeftInside]: ({ startX, height, offsetX }) => ({
|
|
193
|
+
x: startX + offsetX,
|
|
194
|
+
y: height / 2,
|
|
195
|
+
textAnchor: 'middle',
|
|
196
|
+
dominantBaseline: 'text-before-edge',
|
|
197
|
+
}),
|
|
198
|
+
};
|
|
199
|
+
const HORIZONTAL_Y = {
|
|
200
|
+
[PlotbandLabelPosition.TopLeftOutside]: ({ startY, offsetX, offsetY }) => ({
|
|
201
|
+
x: offsetX,
|
|
202
|
+
y: startY - offsetY,
|
|
203
|
+
textAnchor: 'start',
|
|
204
|
+
dominantBaseline: 'text-after-edge',
|
|
205
|
+
}),
|
|
206
|
+
[PlotbandLabelPosition.TopLeftInside]: ({ startY, offsetX, offsetY }) => ({
|
|
207
|
+
x: offsetX,
|
|
208
|
+
y: startY + offsetY,
|
|
209
|
+
textAnchor: 'start',
|
|
210
|
+
dominantBaseline: 'text-before-edge',
|
|
211
|
+
}),
|
|
212
|
+
[PlotbandLabelPosition.TopOutside]: ({ startX, width, startY, offsetY }) => ({
|
|
213
|
+
x: startX + width / 2,
|
|
214
|
+
y: startY - offsetY,
|
|
215
|
+
textAnchor: 'middle',
|
|
216
|
+
dominantBaseline: 'text-after-edge',
|
|
217
|
+
}),
|
|
218
|
+
[PlotbandLabelPosition.TopInside]: ({ startX, width, startY, offsetY }) => ({
|
|
219
|
+
x: startX + width / 2,
|
|
220
|
+
y: startY + offsetY,
|
|
221
|
+
textAnchor: 'middle',
|
|
222
|
+
dominantBaseline: 'text-before-edge',
|
|
223
|
+
}),
|
|
224
|
+
[PlotbandLabelPosition.TopRightOutside]: ({ startY, width, offsetX, offsetY }) => ({
|
|
225
|
+
x: width - offsetX,
|
|
226
|
+
y: startY - offsetY,
|
|
227
|
+
textAnchor: 'end',
|
|
228
|
+
dominantBaseline: 'text-after-edge',
|
|
229
|
+
}),
|
|
230
|
+
[PlotbandLabelPosition.TopRightInside]: ({ startY, width, offsetX, offsetY }) => ({
|
|
231
|
+
x: width - offsetX,
|
|
232
|
+
y: startY + offsetY,
|
|
233
|
+
textAnchor: 'end',
|
|
234
|
+
dominantBaseline: 'text-before-edge',
|
|
235
|
+
}),
|
|
236
|
+
[PlotbandLabelPosition.RightOutside]: ({ startY, height, width, offsetX }) => ({
|
|
237
|
+
x: width - offsetX,
|
|
238
|
+
y: startY + height / 2,
|
|
239
|
+
textAnchor: 'end',
|
|
240
|
+
dominantBaseline: 'middle',
|
|
241
|
+
}),
|
|
242
|
+
[PlotbandLabelPosition.RightInside]: ({ startY, height, width, offsetX }) => ({
|
|
243
|
+
x: width - offsetX,
|
|
244
|
+
y: startY + height / 2,
|
|
245
|
+
textAnchor: 'end',
|
|
246
|
+
dominantBaseline: 'middle',
|
|
247
|
+
}),
|
|
248
|
+
[PlotbandLabelPosition.BottomRightOutside]: ({ startY, height, width, offsetX, offsetY }) => ({
|
|
249
|
+
x: width - offsetX,
|
|
250
|
+
y: startY + height + offsetY,
|
|
251
|
+
textAnchor: 'end',
|
|
252
|
+
dominantBaseline: 'text-before-edge',
|
|
253
|
+
}),
|
|
254
|
+
[PlotbandLabelPosition.BottomRightInside]: ({ startY, height, width, offsetX, offsetY }) => ({
|
|
255
|
+
x: width - offsetX,
|
|
256
|
+
y: startY + height - offsetY,
|
|
257
|
+
textAnchor: 'end',
|
|
258
|
+
dominantBaseline: 'text-after-edge',
|
|
259
|
+
}),
|
|
260
|
+
[PlotbandLabelPosition.BottomOutside]: ({ startX, width, startY, height, offsetY }) => ({
|
|
261
|
+
x: startX + width / 2,
|
|
262
|
+
y: startY + height + offsetY,
|
|
263
|
+
textAnchor: 'middle',
|
|
264
|
+
dominantBaseline: 'text-before-edge',
|
|
265
|
+
}),
|
|
266
|
+
[PlotbandLabelPosition.BottomInside]: ({ startX, width, startY, height, offsetY }) => ({
|
|
267
|
+
x: startX + width / 2,
|
|
268
|
+
y: startY + height - offsetY,
|
|
269
|
+
textAnchor: 'middle',
|
|
270
|
+
dominantBaseline: 'text-after-edge',
|
|
271
|
+
}),
|
|
272
|
+
[PlotbandLabelPosition.BottomLeftOutside]: ({ startY, height, offsetX, offsetY }) => ({
|
|
273
|
+
x: offsetX,
|
|
274
|
+
y: startY + height + offsetY,
|
|
275
|
+
textAnchor: 'start',
|
|
276
|
+
dominantBaseline: 'text-before-edge',
|
|
277
|
+
}),
|
|
278
|
+
[PlotbandLabelPosition.BottomLeftInside]: ({ startY, height, offsetX, offsetY }) => ({
|
|
279
|
+
x: offsetX,
|
|
280
|
+
y: startY + height - offsetY,
|
|
281
|
+
textAnchor: 'start',
|
|
282
|
+
dominantBaseline: 'text-after-edge',
|
|
283
|
+
}),
|
|
284
|
+
[PlotbandLabelPosition.LeftOutside]: ({ startY, height, offsetX }) => ({
|
|
285
|
+
x: offsetX,
|
|
286
|
+
y: startY + height / 2,
|
|
287
|
+
textAnchor: 'start',
|
|
288
|
+
dominantBaseline: 'middle',
|
|
289
|
+
}),
|
|
290
|
+
[PlotbandLabelPosition.LeftInside]: ({ startY, height, offsetX }) => ({
|
|
291
|
+
x: offsetX,
|
|
292
|
+
y: startY + height / 2,
|
|
293
|
+
textAnchor: 'start',
|
|
294
|
+
dominantBaseline: 'middle',
|
|
295
|
+
}),
|
|
296
|
+
};
|
|
297
|
+
const VERTICAL_Y = {
|
|
298
|
+
[PlotbandLabelPosition.TopLeftOutside]: ({ startY, offsetX, offsetY }) => ({
|
|
299
|
+
x: offsetX,
|
|
300
|
+
y: startY - offsetY,
|
|
301
|
+
textAnchor: 'start',
|
|
302
|
+
dominantBaseline: 'text-after-edge',
|
|
303
|
+
rotation: -90,
|
|
304
|
+
}),
|
|
305
|
+
[PlotbandLabelPosition.TopLeftInside]: ({ startY, offsetX, offsetY }) => ({
|
|
306
|
+
x: offsetX,
|
|
307
|
+
y: startY + offsetY,
|
|
308
|
+
textAnchor: 'end',
|
|
309
|
+
dominantBaseline: 'text-before-edge',
|
|
310
|
+
rotation: -90,
|
|
311
|
+
}),
|
|
312
|
+
[PlotbandLabelPosition.TopOutside]: ({ startX, width, startY, offsetY }) => ({
|
|
313
|
+
x: startX + width / 2,
|
|
314
|
+
y: startY - offsetY,
|
|
315
|
+
textAnchor: 'end',
|
|
316
|
+
dominantBaseline: 'middle',
|
|
317
|
+
rotation: -90,
|
|
318
|
+
}),
|
|
319
|
+
[PlotbandLabelPosition.TopInside]: ({ startX, width, startY, offsetY }) => ({
|
|
320
|
+
x: startX + width / 2,
|
|
321
|
+
y: startY + offsetY,
|
|
322
|
+
textAnchor: 'end',
|
|
323
|
+
dominantBaseline: 'middle',
|
|
324
|
+
rotation: -90,
|
|
325
|
+
}),
|
|
326
|
+
[PlotbandLabelPosition.TopRightOutside]: ({ startY, width, offsetX, offsetY }) => ({
|
|
327
|
+
x: width - offsetX,
|
|
328
|
+
y: startY - offsetY,
|
|
329
|
+
textAnchor: 'start',
|
|
330
|
+
dominantBaseline: 'text-after-edge',
|
|
331
|
+
rotation: -90,
|
|
332
|
+
}),
|
|
333
|
+
[PlotbandLabelPosition.TopRightInside]: ({ startY, width, offsetX, offsetY }) => ({
|
|
334
|
+
x: width - offsetX,
|
|
335
|
+
y: startY + offsetY,
|
|
336
|
+
textAnchor: 'end',
|
|
337
|
+
dominantBaseline: 'text-after-edge',
|
|
338
|
+
rotation: -90,
|
|
339
|
+
}),
|
|
340
|
+
[PlotbandLabelPosition.RightOutside]: ({ startY, height, width, offsetX }) => ({
|
|
341
|
+
x: width - offsetX,
|
|
342
|
+
y: startY + height / 2,
|
|
343
|
+
textAnchor: 'middle',
|
|
344
|
+
dominantBaseline: 'text-after-edge',
|
|
345
|
+
rotation: -90,
|
|
346
|
+
}),
|
|
347
|
+
[PlotbandLabelPosition.RightInside]: ({ startY, height, width, offsetX }) => ({
|
|
348
|
+
x: width - offsetX,
|
|
349
|
+
y: startY + height / 2,
|
|
350
|
+
textAnchor: 'middle',
|
|
351
|
+
dominantBaseline: 'text-after-edge',
|
|
352
|
+
rotation: -90,
|
|
353
|
+
}),
|
|
354
|
+
[PlotbandLabelPosition.BottomRightOutside]: ({ startY, height, width, offsetX, offsetY }) => ({
|
|
355
|
+
x: width - offsetX,
|
|
356
|
+
y: startY + height + offsetY,
|
|
357
|
+
textAnchor: 'start',
|
|
358
|
+
dominantBaseline: 'text-before-edge',
|
|
359
|
+
rotation: -90,
|
|
360
|
+
}),
|
|
361
|
+
[PlotbandLabelPosition.BottomRightInside]: ({ startY, height, width, offsetX, offsetY }) => ({
|
|
362
|
+
x: width - offsetX,
|
|
363
|
+
y: startY + height - offsetY,
|
|
364
|
+
textAnchor: 'start',
|
|
365
|
+
dominantBaseline: 'text-after-edge',
|
|
366
|
+
rotation: -90,
|
|
367
|
+
}),
|
|
368
|
+
[PlotbandLabelPosition.BottomOutside]: ({ startX, width, startY, height, offsetY }) => ({
|
|
369
|
+
x: startX + width / 2,
|
|
370
|
+
y: startY + height + offsetY,
|
|
371
|
+
textAnchor: 'start',
|
|
372
|
+
dominantBaseline: 'middle',
|
|
373
|
+
rotation: -90,
|
|
374
|
+
}),
|
|
375
|
+
[PlotbandLabelPosition.BottomInside]: ({ startX, width, startY, height, offsetY }) => ({
|
|
376
|
+
x: startX + width / 2,
|
|
377
|
+
y: startY + height - offsetY,
|
|
378
|
+
textAnchor: 'start',
|
|
379
|
+
dominantBaseline: 'middle',
|
|
380
|
+
rotation: -90,
|
|
381
|
+
}),
|
|
382
|
+
[PlotbandLabelPosition.BottomLeftOutside]: ({ startY, height, offsetX, offsetY }) => ({
|
|
383
|
+
x: offsetX,
|
|
384
|
+
y: startY + height + offsetY,
|
|
385
|
+
textAnchor: 'end',
|
|
386
|
+
dominantBaseline: 'text-before-edge',
|
|
387
|
+
rotation: -90,
|
|
388
|
+
}),
|
|
389
|
+
[PlotbandLabelPosition.BottomLeftInside]: ({ startY, height, offsetX, offsetY }) => ({
|
|
390
|
+
x: offsetX,
|
|
391
|
+
y: startY + height - offsetY,
|
|
392
|
+
textAnchor: 'start',
|
|
393
|
+
dominantBaseline: 'text-before-edge',
|
|
394
|
+
rotation: -90,
|
|
395
|
+
}),
|
|
396
|
+
[PlotbandLabelPosition.LeftOutside]: ({ startY, height, offsetX }) => ({
|
|
397
|
+
x: offsetX,
|
|
398
|
+
y: startY + height / 2,
|
|
399
|
+
textAnchor: 'middle',
|
|
400
|
+
dominantBaseline: 'text-before-edge',
|
|
401
|
+
rotation: -90,
|
|
402
|
+
}),
|
|
403
|
+
[PlotbandLabelPosition.LeftInside]: ({ startY, height, offsetX }) => ({
|
|
404
|
+
x: offsetX,
|
|
405
|
+
y: startY + height / 2,
|
|
406
|
+
textAnchor: 'middle',
|
|
407
|
+
dominantBaseline: 'text-before-edge',
|
|
408
|
+
rotation: -90,
|
|
409
|
+
}),
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export { HORIZONTAL_X, HORIZONTAL_Y, VERTICAL_X, VERTICAL_Y };
|
|
413
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/components/plotband/constants.ts"],"sourcesContent":["import { LayoutMap, PlotbandLabelPosition } from './types'\n\nexport const HORIZONTAL_X: LayoutMap = {\n [PlotbandLabelPosition.TopLeftOutside]: ({ startX, offsetX, offsetY }) => ({\n x: startX - offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopLeftInside]: ({ startX, offsetX, offsetY }) => ({\n x: startX + offsetX,\n y: offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopOutside]: ({ startX, width, offsetY }) => ({\n x: startX + width / 2,\n y: offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopInside]: ({ startX, width, offsetY }) => ({\n x: startX + width / 2,\n y: offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopRightOutside]: ({ startX, width, offsetX, offsetY }) => ({\n x: startX + width + offsetX,\n y: offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopRightInside]: ({ startX, width, offsetX, offsetY }) => ({\n x: startX + width - offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.RightOutside]: ({ startX, width, height, offsetX }) => ({\n x: startX + width + offsetX,\n y: height / 2,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.RightInside]: ({ startX, width, height, offsetX }) => ({\n x: startX + width - offsetX,\n y: height / 2,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.BottomRightOutside]: ({ startX, width, height, offsetX, offsetY }) => ({\n x: startX + width + offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomRightInside]: ({ startX, width, height, offsetX, offsetY }) => ({\n x: startX + width - offsetX,\n y: height - offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomOutside]: ({ startX, width, height, offsetY }) => ({\n x: startX + width / 2,\n y: height - offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomInside]: ({ startX, width, height, offsetY }) => ({\n x: startX + width / 2,\n y: height - offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomLeftOutside]: ({ startX, height, offsetX, offsetY }) => ({\n x: startX - offsetX,\n y: height - offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomLeftInside]: ({ startX, height, offsetX, offsetY }) => ({\n x: startX + offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.LeftOutside]: ({ startX, height, offsetX }) => ({\n x: startX - offsetX,\n y: height / 2,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.LeftInside]: ({ startX, height, offsetX }) => ({\n x: startX + offsetX,\n y: height / 2,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n}\n\nexport const VERTICAL_X: LayoutMap = {\n [PlotbandLabelPosition.TopLeftOutside]: ({ startX, offsetX, offsetY }) => ({\n x: startX - offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.TopLeftInside]: ({ startX, offsetX, offsetY }) => ({\n x: startX + offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopOutside]: ({ startX, width, offsetY }) => ({\n x: startX + width / 2,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.TopInside]: ({ startX, width, offsetY }) => ({\n x: startX + width / 2,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.TopRightOutside]: ({ startX, width, offsetX, offsetY }) => ({\n x: startX + width + offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopRightInside]: ({ startX, width, offsetX, offsetY }) => ({\n x: startX + width - offsetX,\n y: offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.RightOutside]: ({ startX, width, height, offsetX }) => ({\n x: startX + width + offsetX,\n y: height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.RightInside]: ({ startX, width, height, offsetX }) => ({\n x: startX + width - offsetX,\n y: height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomRightOutside]: ({ startX, width, height, offsetX, offsetY }) => ({\n x: startX + width + offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.BottomRightInside]: ({ startX, width, height, offsetX, offsetY }) => ({\n x: startX + width - offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomOutside]: ({ startX, width, height, offsetY }) => ({\n x: startX + width / 2,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.BottomInside]: ({ startX, width, height, offsetY }) => ({\n x: startX + width / 2,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.BottomLeftOutside]: ({ startX, height, offsetX, offsetY }) => ({\n x: startX - offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomLeftInside]: ({ startX, height, offsetX, offsetY }) => ({\n x: startX + offsetX,\n y: height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.LeftOutside]: ({ startX, height, offsetX }) => ({\n x: startX - offsetX,\n y: height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.LeftInside]: ({ startX, height, offsetX }) => ({\n x: startX + offsetX,\n y: height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n}\n\nexport const HORIZONTAL_Y: LayoutMap = {\n [PlotbandLabelPosition.TopLeftOutside]: ({ startY, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.TopLeftInside]: ({ startY, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopOutside]: ({ startX, width, startY, offsetY }) => ({\n x: startX + width / 2,\n y: startY - offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.TopInside]: ({ startX, width, startY, offsetY }) => ({\n x: startX + width / 2,\n y: startY + offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.TopRightOutside]: ({ startY, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY - offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.TopRightInside]: ({ startY, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.RightOutside]: ({ startY, height, width, offsetX }) => ({\n x: width - offsetX,\n y: startY + height / 2,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.RightInside]: ({ startY, height, width, offsetX }) => ({\n x: width - offsetX,\n y: startY + height / 2,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.BottomRightOutside]: ({ startY, height, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + height + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.BottomRightInside]: ({ startY, height, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + height - offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomOutside]: ({ startX, width, startY, height, offsetY }) => ({\n x: startX + width / 2,\n y: startY + height + offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.BottomInside]: ({ startX, width, startY, height, offsetY }) => ({\n x: startX + width / 2,\n y: startY + height - offsetY,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.BottomLeftOutside]: ({ startY, height, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + height + offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n }),\n [PlotbandLabelPosition.BottomLeftInside]: ({ startY, height, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n }),\n [PlotbandLabelPosition.LeftOutside]: ({ startY, height, offsetX }) => ({\n x: offsetX,\n y: startY + height / 2,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n [PlotbandLabelPosition.LeftInside]: ({ startY, height, offsetX }) => ({\n x: offsetX,\n y: startY + height / 2,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n }),\n}\n\nexport const VERTICAL_Y: LayoutMap = {\n [PlotbandLabelPosition.TopLeftOutside]: ({ startY, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.TopLeftInside]: ({ startY, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.TopOutside]: ({ startX, width, startY, offsetY }) => ({\n x: startX + width / 2,\n y: startY - offsetY,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n rotation: -90,\n }),\n [PlotbandLabelPosition.TopInside]: ({ startX, width, startY, offsetY }) => ({\n x: startX + width / 2,\n y: startY + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'middle',\n rotation: -90,\n }),\n [PlotbandLabelPosition.TopRightOutside]: ({ startY, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.TopRightInside]: ({ startY, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.RightOutside]: ({ startY, height, width, offsetX }) => ({\n x: width - offsetX,\n y: startY + height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.RightInside]: ({ startY, height, width, offsetX }) => ({\n x: width - offsetX,\n y: startY + height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomRightOutside]: ({ startY, height, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + height + offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomRightInside]: ({ startY, height, width, offsetX, offsetY }) => ({\n x: width - offsetX,\n y: startY + height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-after-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomOutside]: ({ startX, width, startY, height, offsetY }) => ({\n x: startX + width / 2,\n y: startY + height + offsetY,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomInside]: ({ startX, width, startY, height, offsetY }) => ({\n x: startX + width / 2,\n y: startY + height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'middle',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomLeftOutside]: ({ startY, height, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + height + offsetY,\n textAnchor: 'end',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.BottomLeftInside]: ({ startY, height, offsetX, offsetY }) => ({\n x: offsetX,\n y: startY + height - offsetY,\n textAnchor: 'start',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.LeftOutside]: ({ startY, height, offsetX }) => ({\n x: offsetX,\n y: startY + height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n [PlotbandLabelPosition.LeftInside]: ({ startY, height, offsetX }) => ({\n x: offsetX,\n y: startY + height / 2,\n textAnchor: 'middle',\n dominantBaseline: 'text-before-edge',\n rotation: -90,\n }),\n}\n"],"names":[],"mappings":";;AAEa,MAAA,YAAY,GAAc;AACrC,IAAA,CAAC,qBAAqB,CAAC,cAAc,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;QACzE,CAAC,EAAE,MAAM,GAAG,OAAO;AACnB,QAAA,CAAC,EAAE,OAAO;AACV,QAAA,UAAU,EAAE,KAAK;AACjB,QAAA,gBAAgB,EAAE,kBAAkB;KACrC,CAAC;AACF,IAAA,CAAC,qBAAqB,CAAC,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;QACxE,CAAC,EAAE,MAAM,GAAG,OAAO;AACnB,QAAA,CAAC,EAAE,OAAO;AAC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,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,gBAAgB,EAAE,kBAAkB;QACpC,QAAQ,EAAE,CAAC,EAAE;KACd,CAAC;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
2
|
+
import { XYComponentCore } from "../../core/xy-component";
|
|
3
|
+
import { PlotbandConfigInterface } from './config';
|
|
4
|
+
import * as s from './style';
|
|
5
|
+
export declare class Plotband<Datum> extends XYComponentCore<Datum, PlotbandConfigInterface<Datum>> {
|
|
6
|
+
static selectors: typeof s;
|
|
7
|
+
protected _defaultConfig: PlotbandConfigInterface<Datum>;
|
|
8
|
+
from: number | null | undefined;
|
|
9
|
+
to: number | null | undefined;
|
|
10
|
+
plotband: Selection<SVGRectElement, unknown, null, undefined>;
|
|
11
|
+
label: Selection<SVGTextElement, unknown, null, undefined>;
|
|
12
|
+
constructor(config: PlotbandConfigInterface<Datum>);
|
|
13
|
+
_render(customDuration?: number): void;
|
|
14
|
+
private computeLabel;
|
|
15
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { smartTransition } from '../../utils/d3.js';
|
|
2
|
+
import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
3
|
+
import { AxisType } from '../axis/types.js';
|
|
4
|
+
import { VERTICAL_X, HORIZONTAL_X, VERTICAL_Y, HORIZONTAL_Y } from './constants.js';
|
|
5
|
+
import { PlotbandDefaultConfig } from './config.js';
|
|
6
|
+
import * as style from './style.js';
|
|
7
|
+
import { plotband, label } from './style.js';
|
|
8
|
+
|
|
9
|
+
// Utils
|
|
10
|
+
class Plotband extends XYComponentCore {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super();
|
|
13
|
+
this._defaultConfig = PlotbandDefaultConfig;
|
|
14
|
+
if (config)
|
|
15
|
+
this.setConfig(config);
|
|
16
|
+
this.plotband = this.g.append('rect')
|
|
17
|
+
.attr('class', plotband);
|
|
18
|
+
this.label = this.g
|
|
19
|
+
.append('text')
|
|
20
|
+
.attr('class', label);
|
|
21
|
+
}
|
|
22
|
+
_render(customDuration) {
|
|
23
|
+
super._render(customDuration);
|
|
24
|
+
const { config } = this;
|
|
25
|
+
this.from = config.from;
|
|
26
|
+
this.to = config.to;
|
|
27
|
+
this.plotband
|
|
28
|
+
.style('fill', config.color);
|
|
29
|
+
if (this.from == null || this.to == null)
|
|
30
|
+
return;
|
|
31
|
+
let x = 0;
|
|
32
|
+
let y = 0;
|
|
33
|
+
let width = 0;
|
|
34
|
+
let height = 0;
|
|
35
|
+
if (config.axis === 'y') {
|
|
36
|
+
const y1 = this.yScale(this.from);
|
|
37
|
+
const y2 = this.yScale(this.to);
|
|
38
|
+
y = Math.min(y1, y2);
|
|
39
|
+
height = Math.abs(y1 - y2);
|
|
40
|
+
x = 0;
|
|
41
|
+
width = this._width;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const x1 = this.xScale(this.from);
|
|
45
|
+
const x2 = this.xScale(this.to);
|
|
46
|
+
x = Math.min(x1, x2);
|
|
47
|
+
width = Math.abs(x1 - x2);
|
|
48
|
+
y = 0;
|
|
49
|
+
height = this._height;
|
|
50
|
+
}
|
|
51
|
+
smartTransition(this.plotband, config.duration)
|
|
52
|
+
.attr('x', x)
|
|
53
|
+
.attr('y', y)
|
|
54
|
+
.attr('width', width)
|
|
55
|
+
.attr('height', height);
|
|
56
|
+
if (config.labelText) {
|
|
57
|
+
const labelProps = this.computeLabel(config.axis, x, y, width, height, config.labelPosition, config.labelOffsetX, config.labelOffsetY, config.labelOrientation);
|
|
58
|
+
this.label
|
|
59
|
+
.attr('dominant-baseline', labelProps.dominantBaseline)
|
|
60
|
+
.attr('transform', labelProps.transform)
|
|
61
|
+
.style('text-anchor', labelProps.textAnchor)
|
|
62
|
+
.style('fill', config.labelColor)
|
|
63
|
+
.style('font-size', config.labelSize ? `${config.labelSize}px` : undefined);
|
|
64
|
+
smartTransition(this.label, config.duration)
|
|
65
|
+
.text(config.labelText)
|
|
66
|
+
.attr('x', labelProps.x)
|
|
67
|
+
.attr('y', labelProps.y);
|
|
68
|
+
}
|
|
69
|
+
smartTransition(this.plotband.exit())
|
|
70
|
+
.style('opacity', 0)
|
|
71
|
+
.remove();
|
|
72
|
+
}
|
|
73
|
+
computeLabel(axis, startX, startY, width, height, position, offsetX, offsetY, orientation) {
|
|
74
|
+
const isVertical = orientation === 'vertical';
|
|
75
|
+
const rotation = isVertical ? -90 : 0;
|
|
76
|
+
const args = { startX, startY, width, height, offsetX, offsetY };
|
|
77
|
+
let layoutPartial;
|
|
78
|
+
if (axis === AxisType.X) {
|
|
79
|
+
layoutPartial = (isVertical ? VERTICAL_X : HORIZONTAL_X)[position](args);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
layoutPartial = (isVertical ? VERTICAL_Y : HORIZONTAL_Y)[position](args);
|
|
83
|
+
}
|
|
84
|
+
const { x, y, textAnchor, dominantBaseline } = layoutPartial;
|
|
85
|
+
const transform = rotation !== 0 ? `rotate(${rotation}, ${x}, ${y})` : '';
|
|
86
|
+
return { x, y, rotation, textAnchor, transform, dominantBaseline };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
Plotband.selectors = style;
|
|
90
|
+
|
|
91
|
+
export { Plotband };
|
|
92
|
+
//# sourceMappingURL=index.js.map
|