forked from elastic/elastic-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.ts
More file actions
925 lines (865 loc) · 24 KB
/
theme.ts
File metadata and controls
925 lines (865 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { CSSProperties } from 'react';
import type { $Values } from 'utility-types';
import type { PartitionStyle } from './partition';
import type { BulletStyle } from '../../chart_types/bullet_graph/theme';
import type { Color } from '../../common/colors';
import type { Pixels, Radian, Ratio } from '../../common/geometry';
import type { Font, FontStyle, FontWeight, TextAlign } from '../../common/text_utils';
import type { ColorVariant, HorizontalAlignment, RecursivePartial, VerticalAlignment } from '../common';
import type { Margins, Padding, SimplePadding } from '../dimensions';
import type { Point } from '../point';
/** @public */
export interface Visible {
visible: boolean;
}
/** @public */
export interface TextStyle {
fontSize: number;
fontFamily: string;
fontStyle?: FontStyle;
fontWeight?: FontWeight;
fill: Color;
padding: number | SimplePadding;
}
/**
* Offset in pixels
* @public
*/
export interface TextOffset {
/**
* X offset of tick in px or string with % of height
*/
x: number | string;
/**
* X offset of tick in px or string with % of height
*/
y: number | string;
/**
* Offset coordinate system reference
*
* - `global` - aligns offset coordinate system to global (non-rotated) coordinate system
* - `local` - aligns offset coordinate system to local rotated coordinate system
*/
reference: 'global' | 'local';
}
/**
* Text alignment
* @public
*/
export interface TextAlignment {
horizontal: HorizontalAlignment;
vertical: VerticalAlignment;
}
/**
* Tooltip styles
* @public
*/
export interface TooltipStyle {
/**
* Sets max width of tooltip
*/
maxWidth: NonNullable<CSSProperties['maxWidth']>;
/**
* Sets max height of scrolling tooltip table body
*/
maxTableHeight: CSSProperties['maxHeight'];
/**
* Color used as fallback when contrast logic fails
*/
defaultDotColor: Color;
}
/**
* Shared style properties for varies geometries
* @public
*/
export interface GeometryStyle {
/**
* Opacity multiplier
*
* if set to `0.5` all given opacities will be halfed
*/
opacity: number;
}
/**
* Shared style properties for varies geometries
* @public
*/
export interface GeometryStateStyle {
/**
* Opacity multiplier
*
* if set to `0.5` all given opacities will be halfed
*/
opacity: number;
}
/** @public */
export interface SharedGeometryStateStyle<S extends CSSProperties = GeometryStateStyle> {
default: S;
highlighted: S;
unhighlighted: S;
}
/**
* The stroke color style
* @public
*/
export interface StrokeStyle<C = Color> {
/** The stroke color in hex, rgba, hsl */
stroke: C;
/** The stroke width in pixel */
strokeWidth: number;
}
/** @public */
export type TickStyle = StrokeStyle &
Visible & {
/**
* Amount of padding between tick line and labels
*/
padding: number;
/**
* length of tick line
*/
size: number;
};
/**
* The dash array for a stroke
* @public
*/
export interface StrokeDashArray {
/** The dash array for dashed strokes */
dash: number[];
}
/** @public */
export interface FillStyle {
/** The fill color in hex, rgba, hsl */
fill: Color;
}
/** @public */
export interface Opacity {
/** The opacity value from 0 to 1 */
opacity: number;
}
/** @public */
export interface Truncate {
width: Pixels;
position: 'end' | 'start' | 'middle';
}
/** @public */
export interface AxisStyle {
axisTitle: TextStyle & Visible;
axisPanelTitle: TextStyle & Visible;
axisLine: StrokeStyle & Visible;
tickLabel: TextStyle &
Visible & {
/** The degrees of rotation of the tick labels */
rotation: number;
/**
* Offset in pixels to render text relative to anchor
*
* **Note:** rotation aligns to global cartesian coordinates
*/
offset: TextOffset;
alignment: TextAlignment;
/**
* When set, tick labels are truncated with an ellipsis so their measured width
* does not exceed `width` (unrotated text-direction pixels).
*/
truncation?: Truncate;
};
tickLine: TickStyle;
gridLine: {
horizontal: GridLineStyle;
vertical: GridLineStyle;
};
}
/**
* @public
*/
export interface GridLineStyle {
visible: boolean;
stroke: Color;
strokeWidth: number;
opacity: number;
dash: number[];
}
/** @public */
export interface GoalStyles {
progressLine: Pick<StrokeStyle, 'stroke'>;
targetLine: Pick<StrokeStyle, 'stroke'>;
tickLine: Pick<StrokeStyle, 'stroke'>;
tickLabel: Omit<TextStyle, 'padding' | 'fontSize'>;
majorLabel: Omit<TextStyle, 'padding' | 'fontSize'>;
minorLabel: Omit<TextStyle, 'padding' | 'fontSize'>;
majorCenterLabel: Omit<TextStyle, 'padding' | 'fontSize'>;
minorCenterLabel: Omit<TextStyle, 'padding' | 'fontSize'>;
minFontSize: number;
maxFontSize: number;
/**
* Circular goal/gauge size limit. The chart will _NOT_ be bigger even if there's ample room.
*/
maxCircularSize: number;
/**
* Bullet goal/gauge size limit. The chart will _NOT_ be bigger even if there's ample room.
*/
maxBulletSize: number;
/**
* The bar thickness is a maximum of this fraction of the smaller graph area size
*/
barThicknessMinSizeRatio: number;
/**
* Bar thickness if there's ample room, no need for greater thickness even if there's a large area
*/
baselineArcThickness: number;
/**
* Bar thickness if there's ample room, no need for greater thickness even if there's a large area
*/
baselineBarThickness: number;
/**
* same ratio on each side
*/
marginRatio: number;
maxTickFontSize: number;
maxLabelFontSize: number;
maxCentralFontSize: number;
/**
* 5-degree pitch ie. a circle is 72 steps
*/
arcBoxSamplePitch: Radian;
/**
* mouse hover is detected in the padding too (eg. for Fitts law)
*/
capturePad: number;
}
/** @public */
export interface HeatmapStyle {
/**
* Config of the mask over the area outside of the selected cells
*/
brushMask: { visible: boolean; fill: Color };
/**
* Config of the mask over the selected cells
*/
brushArea: { visible: boolean; fill?: Color; stroke: Color; strokeWidth: number };
/**
* Config of the brushing tool
*/
brushTool: {
visible: boolean;
// TODO add support for changing the brush tool color
fill: Color;
};
xAxisLabel: Font & {
fontSize: Pixels;
visible: boolean;
padding: Pixels | Padding;
/**
* Positive 0 - 90 degree angle
* @defaultValue 0
*/
rotation: number;
};
yAxisLabel: Font & {
fontSize: Pixels;
width: Pixels | 'auto' | { max: Pixels };
visible: boolean;
padding: Pixels | Padding;
};
grid: {
stroke: {
color: string;
width: number;
};
};
cell: {
maxWidth: Pixels | 'fill';
maxHeight: Pixels | 'fill';
align: 'center';
label: Font & {
minFontSize: Pixels;
maxFontSize: Pixels;
useGlobalMinFontSize: boolean;
maxWidth: Pixels | 'fill';
visible: boolean;
};
border: {
strokeWidth: Pixels;
stroke: Color;
};
};
maxLegendHeight?: number;
}
/**
* Metric font weight options for text styling.
* @public
*/
export type MetricFontWeight = Extract<FontWeight, 'bold' | 'normal' | 500>;
/**
* Style options for the Metric chart type.
* @public
*/
export interface MetricStyle {
fontFamily: string;
textDarkColor: Color;
textLightColor: Color;
textSubtitleDarkColor: Color;
textSubtitleLightColor: Color;
textExtraDarkColor: Color;
textExtraLightColor: Color;
valueFontSize: 'default' | 'fit' | number;
minValueFontSize: number;
// Alignments
titlesTextAlign: Extract<TextAlign, 'left' | 'center' | 'right'>;
extraTextAlign: Extract<TextAlign, 'left' | 'center' | 'right'>;
valueTextAlign: Extract<TextAlign, 'left' | 'center' | 'right'>;
valuePosition: 'top' | 'middle' | 'bottom';
iconAlign: Extract<HorizontalAlignment, 'left' | 'right'>;
titleWeight: MetricFontWeight;
border: Color;
barBackground: Color;
emptyBackground: Color;
/**
* Optional color used to blend transparent colors. Defaults to `Theme.background`
*/
blendingBackground?: Color;
nonFiniteText: string;
minHeight: Pixels;
}
/** @alpha */
export interface FlamegraphStyle {
navigation: {
textColor: Color;
buttonTextColor: Color;
buttonDisabledTextColor: Color;
buttonBackgroundColor: Color;
buttonDisabledBackgroundColor: Color;
};
scrollbarTrack: Color;
scrollbarThumb: Color;
minimapFocusBorder: Color;
}
/** @public */
export interface ScalesConfig {
/**
* The proportion of the range that is reserved for blank space between bands.
* A value of 0 means no blank space between bands, and a value of 1 means a bandwidth of zero.
* A number between 0 and 1.
*/
barsPadding: number;
/**
* The proportion of the range that is reserved for blank space between bands in histogramMode.
* A value of 0 means no blank space between bands, and a value of 1 means a bandwidth of zero.
* A number between 0 and 1.
*/
histogramPadding: number;
}
/** @public */
export interface ColorConfig {
vizColors: Color[];
defaultVizColor: Color;
}
/**
* The background style applied to the chart.
* This is used to coordinate adequate contrast of the text in partition and treemap charts.
* @public
*/
export interface BackgroundStyle {
/**
* The background color
*/
color: string;
/**
* The fallback background color used for constrast logic.
* Must be opaque, alpha value will be ignored otherwise.
*/
fallbackColor: Color;
}
/** @public */
export interface LegendLabelOptions {
/**
* Sets maxlines allowable before truncating
*
* Setting value to `0` will _never_ truncate the text
*/
maxLines: number;
/**
* Sets widthLimit allowable before truncating (unit: px)
* Only applicable if the list layout is chosen for the top and bottom positions
*
* Setting value to `0` will _never_ truncate the text
*/
widthLimit: number;
}
/** @public */
export interface LegendStyle {
/**
* Max width used for left/right legend
*
* or
*
* Width of `LegendItem` for top/bottom legend
*/
verticalWidth: number;
/**
* Max height used for top/bottom legend
*/
horizontalHeight: number;
/**
* Added buffer between label and value.
*
* Smaller values render a more compact legend
*/
spacingBuffer: number;
/**
* Legend padding. The Chart margins are independent of the legend.
*
* TODO: make SimplePadding when after axis changes are added
*/
margin: number;
/**
* Options to control legend labels
*/
labelOptions: LegendLabelOptions;
}
/** @public */
export interface Theme {
/**
* Space btw parent DOM element and first available element of the chart (axis if exists, else the chart itself)
*/
chartMargins: Margins;
/**
* Space btw the chart geometries and axis; if no axis, pads space btw chart & container
*/
chartPaddings: Margins;
/**
* Global line styles.
*
* __Note:__ This is not used to set the color of a specific series. As such, any changes to the styles will not be reflected in the tooltip, legend, etc..
*
* You may use `SeriesColorAccessor` to assign colors to a given series or replace the `theme.colors.vizColors` colors to your desired colors.
*/
lineSeriesStyle: LineSeriesStyle;
/**
* Global area styles.
*
* __Note:__ This is not used to set the color of a specific series. As such, any changes to the styles will not be reflected in the tooltip, legend, etc..
*
* You may use `SeriesColorAccessor` to assign colors to a given series or replace the `theme.colors.vizColors` colors to your desired colors.
*/
areaSeriesStyle: AreaSeriesStyle;
/**
* Global bar styles.
*
* __Note:__ This is not used to set the color of a specific series. As such, any changes to the styles will not be reflected in the tooltip, legend, etc..
*
* You may use `SeriesColorAccessor` to assign colors to a given series or replace the `theme.colors.vizColors` colors to your desired colors.
*/
barSeriesStyle: BarSeriesStyle;
/**
* Global bubble styles.
*
* __Note:__ This is not used to set the color of a specific series. As such, any changes to the styles will not be reflected in the tooltip, legend, etc..
*
* You may use `SeriesColorAccessor` to assign colors to a given series or replace the `theme.colors.vizColors` colors to your desired colors.
*/
bubbleSeriesStyle: BubbleSeriesStyle;
arcSeriesStyle: ArcSeriesStyle;
sharedStyle: SharedGeometryStateStyle;
axes: AxisStyle;
scales: ScalesConfig;
colors: ColorConfig;
legend: LegendStyle;
crosshair: CrosshairStyle;
/**
* Used to scale radius with `markSizeAccessor`
*
* value from 1 to 100
*/
markSizeRatio?: number;
/**
* The background allows the consumer to provide a color of the background container of the chart.
* This can then be used to calculate the contrast of the text for partition charts.
*/
background: BackgroundStyle;
/**
* Theme styles for goal and gauge chart types
*/
goal: GoalStyles;
/**
* Theme styles for partition chart types
*/
partition: PartitionStyle;
/**
* Theme styles for heatmap chart types
*/
heatmap: HeatmapStyle;
/**
* Theme styles for metric chart types
*/
metric: MetricStyle;
/**
* Theme styles for bullet graph types
*/
bulletGraph: BulletStyle;
/**
* Theme styles for tooltip
*/
tooltip: TooltipStyle;
/** @alpha */
flamegraph: FlamegraphStyle;
highlighter: HighlighterStyle;
lineAnnotation: LineAnnotationStyle;
rectAnnotation: RectAnnotationStyle;
brush: BrushStyle;
}
/** @public */
export type PartialTheme = RecursivePartial<Theme>;
/** @public */
export type DisplayValueStyle = Omit<TextStyle, 'fill' | 'fontSize'> & {
offsetX: number;
offsetY: number;
fontSize:
| number
| {
min: number;
max: number;
};
fill:
| Color
| { color: Color; borderColor?: Color; borderWidth?: number }
| {
textBorder?: number;
};
alignment?: {
horizontal: Exclude<HorizontalAlignment, 'far' | 'near'>;
vertical: Exclude<VerticalAlignment, 'far' | 'near'>;
};
};
/** @public */
export const PointShape = Object.freeze({
Circle: 'circle' as const,
Square: 'square' as const,
Diamond: 'diamond' as const,
Plus: 'plus' as const,
X: 'x' as const,
Triangle: 'triangle' as const,
});
/** @public */
export type PointShape = $Values<typeof PointShape>;
/** @public */
export interface PointStyle {
/** is the point visible or hidden or shown depending on the chart size*/
visible: 'never' | 'always' | 'auto';
/** a static stroke color if defined, if not it will use the color of the series */
stroke?: Color | ColorVariant;
/** the stroke width of the point */
strokeWidth: number;
/** a static fill color if defined, if not it will use the color of the series */
fill?: Color | ColorVariant;
/** the opacity of each point on the theme/series */
opacity: number;
/** the radius of each point of the theme/series */
radius: Pixels;
/** shape for the point, default to circle */
shape?: PointShape;
/**
* The style applied to the point when it is focused relative to other highlighted elements on the chart.
*/
focused?: { strokeWidth: number };
/**
* The style applied to the point when it is dimmed relative to other highlighted elements on the chart.
* This is typically used to visually de-emphasize the point, for example, when another series is highlighted.
*/
dimmed:
| { opacity: number }
| {
/** The fill color to use when the point is dimmed. */
fill: Color | ColorVariant;
/** The stroke color to use when the point is dimmed. */
stroke: Color | ColorVariant;
};
}
/** @public */
export interface LineStyle {
/** is the line visible or hidden ? */
visible: boolean;
/** a static stroke color if defined, if not it will use the color of the series */
stroke?: Color | ColorVariant;
/** the stroke width of the line */
strokeWidth: number;
/** the opacity of each line on the theme/series */
opacity: number;
/** the dash array */
dash?: number[];
/**
* The style applied to the line when it is dimmed relative to other highlighted elements on the chart.
* This is typically used to visually de-emphasize the line, for example, when another series is highlighted.
*/
dimmed:
| { opacity: number }
| {
/** The stroke color to use when the line is dimmed. */
stroke: Color | ColorVariant;
/** The stroke width to use when the line is dimmed. */
strokeWidth: number;
};
focused: {
/** The stroke width to use when the line is focused. */
strokeWidth: number;
};
}
/** @public */
export const TextureShape = Object.freeze({
...PointShape,
Line: 'line' as const,
});
/** @public */
export type TextureShape = $Values<typeof TextureShape>;
/** @public */
export interface TexturedStylesBase {
/** polygon fill color for texture */
fill?: Color | ColorVariant;
/** polygon stroke color for texture */
stroke?: Color | ColorVariant;
/** polygon stroke width for texture */
strokeWidth?: number;
/** polygon opacity for texture */
opacity?: number;
/** polygon opacity for texture */
dash?: number[];
/** polygon opacity for texture */
size?: number;
/**
* The angle of rotation for entire texture
* in degrees
*/
rotation?: number;
/**
* The angle of rotation for polygons
* in degrees
*/
shapeRotation?: number;
/** texture spacing between polygons */
spacing?: Partial<Point> | number;
/** overall origin offset of pattern */
offset?: Partial<Point> & {
/** apply offset along global coordinate axes */
global?: boolean;
};
}
/** @public */
export interface TexturedShapeStyles extends TexturedStylesBase {
/** typed of texture designs currently supported */
shape: TextureShape;
}
/** @public */
export interface TexturedPathStyles extends TexturedStylesBase {
/** path for polygon texture */
path: string | Path2D;
}
/**
* @public
*
* Texture style config for area spec
*/
export type TexturedStyles = TexturedPathStyles | TexturedShapeStyles;
/** @public */
export interface AreaStyle {
/** applying textures to the area on the theme/series */
texture?: TexturedStyles;
/** is the area is visible or hidden ? */
visible: boolean;
/** a static fill color if defined, if not it will use the color of the series */
fill?: Color | ColorVariant;
/** the opacity of each area on the theme/series */
opacity: number;
/**
* The style applied to the area when it is dimmed relative to other highlighted elements on the chart.
* This is typically used to visually de-emphasize the area, for example, when another series is highlighted.
*/
dimmed:
| { opacity: number }
| {
/** The fill color to use when the area is dimmed. */
fill: Color | ColorVariant;
/** The opacity multiplier for the texture color when the area is dimmed */
texture: { opacity: number };
};
}
/** @public */
export interface ArcStyle {
/** is the arc is visible or hidden ? */
visible: boolean;
/** a static fill color if defined, if not it will use the color of the series */
fill?: Color | ColorVariant;
/** a static stroke color if defined, if not it will use the color of the series */
stroke?: Color | ColorVariant;
/** the stroke width of the line */
strokeWidth: number;
/** the opacity of each arc on the theme/series */
opacity: number;
}
/** @public */
export interface RectStyle {
/** a static fill color if defined, if not it will use the color of the series */
fill?: Color | ColorVariant;
/** the opacity of each rect on the theme/series */
opacity: number;
/** The width of the rect in pixel. If expressed together with `widthRatio` then the `widthRatio`
* will express the max available size, where the `widthPixel` express the derived/min width. */
widthPixel?: Pixels;
/** The ratio of the width limited to [0,1]. If expressed together with `widthPixel` then the `widthRatio`
* will express the max available size, where the `widthPixel` express the derived/min width. */
widthRatio?: Ratio;
/** applying textures to the bar on the theme/series */
texture?: TexturedStyles;
/**
* The style applied to the rect when it is dimmed relative to other highlighted elements on the chart.
* This is typically used to visually de-emphasize the rect, for example, when another series is highlighted.
*/
dimmed:
| { opacity: number }
| {
/** The fill color to use when the rect is dimmed. */
fill: Color | ColorVariant;
/** The opacity multiplier for the texture color when the rect is dimmed */
texture: { opacity: number };
};
}
/** @public */
export interface RectBorderStyle {
/**
* Border visibility
*/
visible: boolean;
/**
* Border stroke color
*/
stroke?: Color | ColorVariant;
/**
* Border stroke width
*/
strokeWidth: number;
/**
* Border stroke opacity
*/
strokeOpacity?: number;
}
/** @public */
export interface BarSeriesStyle {
rect: RectStyle;
rectBorder: RectBorderStyle;
displayValue: DisplayValueStyle;
}
/** @public */
export interface BubbleSeriesStyle {
point: PointStyle;
}
/**
* Styles for line chart
* @public
*/
export interface LineSeriesStyle {
/** Style for the line */
line: LineStyle;
/** Style for the points */
point: PointStyle;
/** Style for the isolated points */
isolatedPoint: { enabled: boolean } & Omit<PointStyle, 'radius' | 'dimmed'>;
/** Style for the fitted line */
fit: {
line: LineFitStyle;
};
/**
* The minimum distance in pixels between consecutive points before hiding them
* when the points are configured as visible: "auto"
*/
pointVisibilityMinDistance: Pixels;
}
/**
* Styles for area chart
* @public
*/
export interface AreaSeriesStyle {
/** Style for the area */
area: AreaStyle;
/** Style for the area line contour */
line: LineStyle;
/** Style for the points */
point: PointStyle;
/** Style for the isolated points */
isolatedPoint: { enabled: boolean } & Omit<PointStyle, 'radius' | 'dimmed'>;
/** Style for the fitted area */
fit: {
line: LineFitStyle;
area: AreaFitStyle;
};
/**
* The minimum distance in pixels between consecutive points before hiding them
* when the points are configured as visible: "auto"
*/
pointVisibilityMinDistance: Pixels;
}
/** @public */
export type AreaFitStyle = Visible &
Opacity & {
fill: Color | typeof ColorVariant.Series;
texture?: TexturedStyles;
};
/** @public */
export type LineFitStyle = Visible &
Opacity &
StrokeDashArray & {
stroke: Color | typeof ColorVariant.Series;
};
/** @public */
export interface ArcSeriesStyle {
arc: ArcStyle;
}
/** @public */
export interface CrosshairStyle {
band: FillStyle & Visible;
line: StrokeStyle & Visible & Partial<StrokeDashArray>;
crossLine: StrokeStyle & Visible & Partial<StrokeDashArray>;
}
/**
* The style for a linear annotation
* @public
*/
export interface LineAnnotationStyle {
/**
* The style for the line geometry
*/
line: StrokeStyle & Opacity & Partial<StrokeDashArray>;
}
/** @public */
export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity & Partial<StrokeDashArray>;
/** @public */
export interface HighlighterStyle {
point: {
fill: Color | ColorVariant;
stroke: Color | ColorVariant;
strokeWidth: Pixels;
opacity: Ratio;
radius: Pixels;
onHover: {
fill: Color | ColorVariant;
stroke: Color | ColorVariant;
strokeWidth: Pixels;
opacity: Ratio;
radius: Pixels;
};
};
}
/** @public */
export interface BrushStyle {
fill: Color;
stroke: Color;
strokeWidth: Pixels;
opacity: Ratio;
}