eurostat-map 4.4.0 → 4.4.2

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.
Files changed (48) hide show
  1. package/README.md +54 -78
  2. package/build/215.eurostatmap.min.js +1 -1
  3. package/build/eurostatmap.js +2700 -353
  4. package/build/eurostatmap.min.js +2 -2
  5. package/build/eurostatmap.min.js.map +1 -1
  6. package/build/types/core/DorlingSettings.d.ts +29 -0
  7. package/build/types/core/GridCartogramSettings.d.ts +30 -0
  8. package/build/types/core/InsetConfig.d.ts +9 -1
  9. package/build/types/core/MapConfig.d.ts +124 -41
  10. package/build/types/core/MapInstance.d.ts +120 -32
  11. package/build/types/core/TooltipConfig.d.ts +3 -0
  12. package/build/types/core/decoration/CoastalMarginSettings.d.ts +21 -0
  13. package/build/types/core/geo/geometries.d.ts +15 -0
  14. package/build/types/core/geo/kosovo.d.ts +2 -0
  15. package/build/types/core/stat/StatData.d.ts +6 -0
  16. package/build/types/core/utils.d.ts +4 -0
  17. package/build/types/index.d.ts +28 -12
  18. package/build/types/legend/LegendConfig.d.ts +42 -17
  19. package/build/types/legend/SparklineLegendConfig.d.ts +6 -68
  20. package/build/types/legend/choropleth/ChoroplethLegendConfig.d.ts +80 -0
  21. package/build/types/legend/composition/CoxcombLegendConfig.d.ts +85 -0
  22. package/build/types/legend/composition/PieChartLegendConfig.d.ts +68 -0
  23. package/build/types/legend/composition/SparklineLegendConfig.d.ts +94 -0
  24. package/build/types/legend/composition/StripeCompositionLegendConfig.d.ts +11 -0
  25. package/build/types/legend/composition/WaffleLegendConfig.d.ts +74 -0
  26. package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +12 -0
  27. package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +15 -5
  28. package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +14 -0
  29. package/build/types/map-types/composition/CompositionStatConfig.d.ts +14 -1
  30. package/build/types/map-types/composition/bar/BarMap.d.ts +4 -3
  31. package/build/types/map-types/composition/bar/BarMapConfig.d.ts +25 -1
  32. package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +4 -0
  33. package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +14 -0
  34. package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +4 -2
  35. package/build/types/map-types/composition/pie/PieMap.d.ts +10 -3
  36. package/build/types/map-types/composition/pie/PieMapConfig.d.ts +19 -1
  37. package/build/types/map-types/composition/stripe/StripeMap.d.ts +9 -0
  38. package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +12 -0
  39. package/build/types/map-types/composition/waffle/WaffleMap.d.ts +10 -3
  40. package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +20 -1
  41. package/build/types/map-types/flow/FlowMapConfig.d.ts +55 -0
  42. package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +4 -11
  43. package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +0 -9
  44. package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +5 -0
  45. package/build/types/map-types/spark/SparkMap.d.ts +6 -2
  46. package/build/types/map-types/spark/SparkMapConfig.d.ts +17 -0
  47. package/build/types/map-types/spark/SparkStatConfig.d.ts +6 -0
  48. package/package.json +9 -2
@@ -101,10 +101,14 @@ export const flags: Record<string, string>
101
101
  * Executes a function for all insets recursively.
102
102
  */
103
103
  export function executeForAllInsets(
104
+ /** Insets. */
104
105
  insets: any,
106
+ /** Main svg id. */
105
107
  mainSvgId: string,
106
108
  functionToExecute: (inset: MapInstance, ...args: any[]) => void,
109
+ /** Parameter. */
107
110
  parameter?: any,
111
+ /** Parameter2. */
108
112
  parameter2?: any
109
113
  ): void
110
114
 
@@ -59,25 +59,35 @@ export type { TooltipConfig } from './core/TooltipConfig'
59
59
  export type { LegendConfig } from './legend/LegendConfig'
60
60
  export type { StatConfig } from './core/stat/StatConfig'
61
61
  export type { InsetConfig } from './core/InsetConfig'
62
+ export type { CoastalMarginSettings } from './core/decoration/CoastalMarginSettings'
63
+ export type { GridCartogramSettings, GridCartogramMargins } from './core/GridCartogramSettings'
64
+ export type { DorlingSettings, DorlingStrength } from './core/DorlingSettings'
62
65
 
63
66
  // ==================== Legend Configuration Type Exports ====================
64
67
 
65
68
  // Main legend types
66
69
  export type { CategoricalLegendConfig } from './legend/CategoricalLegendConfig'
67
- export type { CoxcombLegendConfig } from './legend/CoxcombLegendConfig'
68
70
  export type { MushroomLegendConfig } from './legend/MushroomLegendConfig'
69
- export type { PieChartLegendConfig } from './legend/PieChartLegendConfig'
70
- export type { SparklineLegendConfig } from './legend/SparklineLegendConfig'
71
- export type { WaffleLegendConfig } from './legend/WaffleLegendConfig'
72
- export type { StripeCompositionLegendConfig } from './legend/StripeCompositionLegendConfig'
73
71
  export type { PatternFillLegendConfig } from './legend/PatternFillLegendConfig'
74
72
 
75
73
  // Choropleth legend types
74
+ export type { ChoroplethLegendConfig } from './legend/choropleth/ChoroplethLegendConfig'
76
75
  export type { BivariateLegendConfig } from './legend/choropleth/BivariateLegendConfig'
77
76
  export type { HistogramLegendConfig } from './legend/choropleth/HistogramLegendConfig'
77
+ export type { TrivariateLegendConfig } from './legend/choropleth/TrivariateLegendConfig'
78
78
 
79
79
  // Composition legend types
80
80
  export type { BarChartLegendConfig } from './legend/composition/BarChartLegendConfig'
81
+ export type { CoxcombLegendConfig } from './legend/composition/CoxcombLegendConfig'
82
+ export type { PieChartLegendConfig } from './legend/composition/PieChartLegendConfig'
83
+ export type { WaffleLegendConfig } from './legend/composition/WaffleLegendConfig'
84
+ export type { StripeCompositionLegendConfig } from './legend/composition/StripeCompositionLegendConfig'
85
+ export type {
86
+ SparklineLegendConfig,
87
+ SparklineScaleLegendConfig,
88
+ SparklineColorLegendConfig,
89
+ SparklineNoDataLegendConfig,
90
+ } from './legend/composition/SparklineLegendConfig'
81
91
 
82
92
  // Flow legend types
83
93
  export type { FlowMapLegendConfig } from './legend/flow/FlowMapLegendConfig'
@@ -133,11 +143,17 @@ export type { FlowMapConfig, FlowMap }
133
143
  * Options for fill pattern definitions
134
144
  */
135
145
  export interface FillPatternOptions {
146
+ /** Shape. */
136
147
  shape?: 'circle' | 'square'
148
+ /** Pattern size. */
137
149
  patternSize?: number
150
+ /** Min size. */
138
151
  minSize?: number
152
+ /** Max size. */
139
153
  maxSize?: number
154
+ /** Bck color. */
140
155
  bckColor?: string
156
+ /** Symb color. */
141
157
  symbColor?: string
142
158
  }
143
159
 
@@ -187,15 +203,10 @@ export function map(type: MapType, config?: MapConfig): MapInstance
187
203
  */
188
204
  export function getFillPatternDefinitionFunction(opts?: FillPatternOptions): (svg: any, numberOfClasses: number) => void
189
205
 
190
- /**
191
- * @deprecated Use getFillPatternDefinitionFunction instead
192
- */
193
- export function getFillPatternDefinitionFun(opts?: FillPatternOptions): (svg: any, numberOfClasses: number) => void
194
-
195
206
  /**
196
207
  * Get default labels for the map
197
208
  */
198
- export function getDefaultLabels(): { [key: string]: string }
209
+ export function getDefaultLabels(): { [key: string]: any }
199
210
 
200
211
  /**
201
212
  * Project coordinates from map pixel space to geographic coordinates
@@ -225,12 +236,17 @@ export const version: string
225
236
  // ==================== Default Export ====================
226
237
 
227
238
  declare const eurostatmap: {
239
+ /** Map. */
228
240
  map: typeof map
241
+ /** Get fill pattern definition function. */
229
242
  getFillPatternDefinitionFunction: typeof getFillPatternDefinitionFunction
230
- getFillPatternDefinitionFun: typeof getFillPatternDefinitionFun
243
+ /** Get default labels. */
231
244
  getDefaultLabels: typeof getDefaultLabels
245
+ /** Project from map. */
232
246
  projectFromMap: typeof projectFromMap
247
+ /** Project to map. */
233
248
  projectToMap: typeof projectToMap
249
+ /** Version. */
234
250
  version: typeof version
235
251
  }
236
252
 
@@ -2,42 +2,67 @@
2
2
  * Parent configuration for map legends. Each map type will extend this with its own specific properties, but these are the common ones that apply to all legend types.
3
3
  */
4
4
  export interface LegendConfig {
5
+ /** Legend origin x-coordinate in pixels. */
5
6
  x?: number
7
+ /** Legend origin y-coordinate in pixels. */
6
8
  y?: number
9
+ /** Legend width in pixels. */
7
10
  width?: number
11
+ /** Legend height in pixels. */
8
12
  height?: number
9
13
 
14
+ /** Legend title text. */
10
15
  title?: string
11
- titleWidth?: number
16
+ /** Legend subtitle text. */
17
+ subtitle?: string
18
+ /** Legend title font size in pixels. */
12
19
  titleFontSize?: number
13
20
 
14
- // Box styling
15
- boxWidth?: number
16
- boxHeight?: number
21
+ /** Box styling. */
22
+ /** Inner spacing around legend content. */
17
23
  boxPadding?: number
18
- boxCornerRadius?: number
24
+ /** Background opacity of the legend box. */
25
+ boxOpacity?: number
26
+ /** Padding between the title block and legend body. */
27
+ titlePadding?: number
19
28
 
20
- // Shape styling (for proportional symbol legends)
29
+ /** Shape styling (for proportional symbol legends). */
30
+ /** Symbol swatch width in pixels. */
21
31
  shapeWidth?: number
32
+ /** Symbol swatch height in pixels. */
22
33
  shapeHeight?: number
34
+ /** Horizontal gap between shape and label. */
23
35
  shapePadding?: number
36
+ /** Length of separator lines in discrete legends. */
37
+ sepLineLength?: number
24
38
 
25
- // Label styling
39
+ /** Label styling. */
40
+ /** Label font size in pixels. */
26
41
  labelFontSize?: number
27
- labelOffset?: number
28
- labelWrap?: number
29
- labelDecimalPlaces?: number
42
+ /** Pixel offsets applied to labels. */
43
+ labelOffsets?: { x: number; y: number }
44
+ /** Custom formatter for legend labels. */
45
+ labelFormatter?: ((value: number, index?: number) => string) | null
46
+ /** Number of decimal places for auto-formatted labels. */
47
+ decimals?: number
30
48
 
31
- // Orientation
49
+ /** Legend layout direction. */
32
50
  orientation?: 'vertical' | 'horizontal'
51
+ /** Sort legend entries in ascending order when true. */
33
52
  ascending?: boolean
34
-
35
- // Cells (for manual legend specification)
36
- cells?: any[]
37
-
38
- // No data label
53
+ /** Whether to display the no-data legend item. */
39
54
  noData?: boolean
55
+ /** Label used for no-data legend item. */
40
56
  noDataText?: string
57
+ /** Vertical gap before the no-data swatch in pixels. */
58
+ noDataPadding?: number
59
+ /** Width of the no-data swatch in pixels. */
60
+ noDataShapeWidth?: number
61
+ /** Height of the no-data swatch in pixels. */
62
+ noDataShapeHeight?: number
41
63
 
42
- [key: string]: any
64
+ /** Whether to show dataset min/max labels when supported. */
65
+ maxMin?: boolean
66
+ /** Text affixes for min/max labels as [minSuffix, maxSuffix]. */
67
+ maxMinLabels?: [string, string]
43
68
  }
@@ -1,68 +1,6 @@
1
- import { LegendConfig } from './LegendConfig'
2
-
3
- /**
4
- * Configuration for scale legend in sparkline maps.
5
- */
6
- export interface SparklineScaleLegendConfig {
7
- /** Title for the scale legend section. */
8
- title?: string | null
9
-
10
- /** Padding between title and chart in pixels. @default 5 */
11
- titlePadding?: number
12
-
13
- /** Whether to show an example sparkline with averaged data. @default false */
14
- showExampleChart?: boolean
15
-
16
- /** Whether to show the region with maximum value. @default true */
17
- showMaxRegion?: boolean
18
-
19
- /** Custom example data for the sparkline. If null, uses averaged data. */
20
- exampleData?: number[] | null
21
-
22
- /** Number of ticks on Y axis. @default 5 */
23
- tickCount?: number
24
-
25
- /** Custom tick format function for Y axis values. */
26
- tickFormat?: ((value: number) => string) | null
27
-
28
- /** Whether to show X axis with date labels. @default true */
29
- showXAxis?: boolean
30
-
31
- /** Rotation angle for X axis labels in degrees. @default -45 */
32
- xAxisRotation?: number
33
-
34
- /** Step for showing X axis ticks (1 = every tick, 2 = every other, etc.). @default 1 */
35
- xAxisTickStep?: number
36
-
37
- /** Margins around the sparkline cell. Defaults to match the map's sparkline chart margin. */
38
- margin?: { top: number; right: number; bottom: number; left: number }
39
-
40
- /** Opacity of the sparkline. @default 0.5 */
41
- lineOpacity?: number
42
-
43
- /** Stroke width of the sparkline. @default 1 */
44
- lineStrokeWidth?: number
45
- }
46
-
47
- /**
48
- * Configuration for no data legend in sparkline maps.
49
- */
50
- export interface SparklineNoDataLegendConfig {
51
- /** Whether to show the no data legend item. @default true */
52
- show?: boolean
53
-
54
- /** Text label for "no data" item. @default 'No data' */
55
- text?: string
56
- }
57
-
58
- /**
59
- * Configuration for sparkline map legends.
60
- * Shows the Y-axis scale and optionally an example sparkline chart.
61
- */
62
- export interface SparklineLegendConfig extends LegendConfig {
63
- /** Configuration for the scale legend showing Y-axis range. */
64
- scaleLegend?: Partial<SparklineScaleLegendConfig>
65
-
66
- /** Configuration for the no data legend. Set to false to hide. */
67
- noDataLegend?: Partial<SparklineNoDataLegendConfig> | false
68
- }
1
+ export type {
2
+ SparklineScaleLegendConfig,
3
+ SparklineColorLegendConfig,
4
+ SparklineNoDataLegendConfig,
5
+ SparklineLegendConfig,
6
+ } from './composition/SparklineLegendConfig'
@@ -0,0 +1,80 @@
1
+ import type { LegendConfig } from '../LegendConfig'
2
+ import type { HistogramLegendConfig } from './HistogramLegendConfig'
3
+
4
+ /**
5
+ * Configuration for choropleth map legends.
6
+ * Supports discrete, continuous, diverging, and histogram legend variants.
7
+ */
8
+ export interface ChoroplethLegendConfig extends LegendConfig {
9
+ /** Padding between the legend title and the legend body in pixels. @default 5 */
10
+ titlePadding?: number
11
+
12
+ /** Label style for discrete legends. @default 'thresholds' */
13
+ labelType?: 'thresholds' | 'ranges'
14
+
15
+ /** Length of the separator line in pixels for discrete legends. @default shapeWidth */
16
+ sepLineLength?: number
17
+
18
+ /** Length of threshold tick marks in pixels. @default 4 */
19
+ tickLength?: number
20
+
21
+ /** Number of decimal places for auto-formatted labels. Auto-detected when undefined. */
22
+ decimals?: number
23
+
24
+ /** Offset adjustments for labels. @default { x: 3, y: 0 } */
25
+ labelOffsets?: { x: number; y: number }
26
+
27
+ /** Custom formatter for legend labels. */
28
+ labelFormatter?: ((value: number, classIndex?: number) => string) | null
29
+
30
+ /** User-defined labels for classes in discrete legends. */
31
+ labels?: string[] | null
32
+
33
+ /** Histogram legend configuration. Set to null/undefined to disable histogram mode. */
34
+ histogram?: Partial<HistogramLegendConfig> | null
35
+
36
+ /** Label shown at the divergence point for diverging legends. */
37
+ pointOfDivergenceLabel?: string
38
+
39
+ /** Class index/value position used for diverging legends. */
40
+ pointOfDivergence?: number
41
+
42
+ /** Extra padding around the divergence marker in pixels. @default 7 */
43
+ pointOfDivergencePadding?: number
44
+
45
+ /** Explicit diverging guide line length in pixels. */
46
+ divergingLineLength?: number
47
+
48
+ /** Explicit diverging arrow length in pixels. */
49
+ divergingArrowLength?: number
50
+
51
+ /** Label shown at the low end of continuous legends. @default 'Low' */
52
+ lowLabel?: string
53
+
54
+ /** Label shown at the high end of continuous legends. @default 'High' */
55
+ highLabel?: string
56
+
57
+ /** Number of ticks to show on continuous legends. Use 0 to disable. @default 0 */
58
+ ticks?: number
59
+
60
+ /** Explicit tick values for continuous legends. */
61
+ tickValues?: number[]
62
+
63
+ /** Explicit tick labels for continuous legends. */
64
+ tickLabels?: Array<string | number>
65
+
66
+ /** Pixel tolerance used when hovering continuous legends to highlight nearby regions. @default 10 */
67
+ highlightTolerance?: number
68
+
69
+ /** Whether to show dataset min/max labels where supported. @default true */
70
+ maxMin?: boolean
71
+
72
+ /** Text affixes for min/max labels as [minSuffix, maxSuffix]. @default ['', ''] */
73
+ maxMinLabels?: [string, string]
74
+
75
+ /** Length of min/max tick marks in pixels. Defaults to tickLength when omitted. */
76
+ maxMinTickLength?: number
77
+
78
+ /** Whether to append region names to min/max labels. */
79
+ maxMinRegionLabels?: boolean
80
+ }
@@ -0,0 +1,85 @@
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for size legend in coxcomb (polar area) charts.
5
+ */
6
+ export interface CoxcombSizeLegendConfig {
7
+ /** Title for the size legend. */
8
+ title?: string | null
9
+
10
+ /** Padding between title and legend content in pixels. @default 15 */
11
+ titlePadding?: number
12
+
13
+ /** Custom values to display in the size legend. If not specified, values are auto-generated. */
14
+ values?: number[] | null
15
+
16
+ /** Custom labels for the size legend values. */
17
+ labels?: string[] | null
18
+
19
+ /** Custom formatter function for legend labels. */
20
+ labelFormatter?: ((value: number) => string) | null
21
+ }
22
+
23
+ /**
24
+ * Configuration for color legend in coxcomb (polar area) charts.
25
+ */
26
+ export interface CoxcombColorLegendConfig {
27
+ /** Title for the color legend. */
28
+ title?: string | null
29
+
30
+ /** Padding between title and legend content in pixels. @default 15 */
31
+ titlePadding?: number
32
+
33
+ /** Top margin for the color legend in pixels. @default 23 */
34
+ marginTop?: number
35
+
36
+ /** Offset adjustments for labels. @default { x: 5, y: 5 } */
37
+ labelOffsets?: { x: number; y: number }
38
+
39
+ /** Width of color swatches in pixels. @default 25 */
40
+ shapeWidth?: number
41
+
42
+ /** Height of color swatches in pixels. @default 20 */
43
+ shapeHeight?: number
44
+
45
+ /** Padding between swatches in pixels. @default 1 */
46
+ shapePadding?: number
47
+
48
+ /** Whether to show a "no data" item. @default true */
49
+ noData?: boolean
50
+
51
+ /** Text label for "no data" item. @default 'No data' */
52
+ noDataText?: string
53
+ }
54
+
55
+ /**
56
+ * Configuration for time legend in coxcomb (polar area) charts.
57
+ */
58
+ export interface CoxcombTimeLegendConfig {
59
+ /** Title for the time legend. */
60
+ title?: string | null
61
+
62
+ /** Padding between title and legend content in pixels. @default 15 */
63
+ titlePadding?: number
64
+
65
+ /** Top margin for the time legend in pixels. @default 20 */
66
+ marginTop?: number
67
+
68
+ /** Radius of the time legend circle in pixels. @default 35 */
69
+ radius?: number
70
+ }
71
+
72
+ /**
73
+ * Configuration for coxcomb (polar area) chart legends.
74
+ * Supports separate sub-legends for size, color, and time dimensions.
75
+ */
76
+ export interface CoxcombLegendConfig extends LegendConfig {
77
+ /** Configuration for the wedge size legend. */
78
+ sizeLegend?: Partial<CoxcombSizeLegendConfig>
79
+
80
+ /** Configuration for the color/category legend. */
81
+ colorLegend?: Partial<CoxcombColorLegendConfig>
82
+
83
+ /** Configuration for the time period legend. */
84
+ timeLegend?: Partial<CoxcombTimeLegendConfig>
85
+ }
@@ -0,0 +1,68 @@
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for size legend in pie chart maps.
5
+ */
6
+ export interface PieChartSizeLegendConfig {
7
+ /** Title for the size legend. */
8
+ title?: string | null
9
+
10
+ /** Padding between title and legend content in pixels. @default 10 */
11
+ titlePadding?: number
12
+
13
+ /** Custom values to display in the size legend. If not specified, values are auto-generated. */
14
+ values?: number[] | null
15
+
16
+ /** Custom formatter function for legend labels. */
17
+ labelFormatter?: ((value: number) => string) | undefined
18
+
19
+ /** Whether to show a "no data" item. @default false */
20
+ noData?: boolean
21
+
22
+ /** Text label for "no data" item. @default 'No data' */
23
+ noDataText?: string
24
+ }
25
+
26
+ /**
27
+ * Configuration for color legend in pie chart maps.
28
+ */
29
+ export interface PieChartColorLegendConfig {
30
+ /** Title for the color legend. */
31
+ title?: string | null
32
+
33
+ /** Padding between title and legend content in pixels. @default 10 */
34
+ titlePadding?: number
35
+
36
+ /** Top margin (distance from size legend) in pixels. @default 33 */
37
+ marginTop?: number
38
+
39
+ /** Offset adjustments for labels. @default { x: 5, y: 5 } */
40
+ labelOffsets?: { x: number; y: number }
41
+
42
+ /** Width of color swatches in pixels. @default 25 */
43
+ shapeWidth?: number
44
+
45
+ /** Height of color swatches in pixels. @default 20 */
46
+ shapeHeight?: number
47
+
48
+ /** Padding between swatches in pixels. @default 1 */
49
+ shapePadding?: number
50
+
51
+ /** Whether to show a "no data" item. @default true */
52
+ noData?: boolean
53
+
54
+ /** Text label for "no data" item. @default 'No data' */
55
+ noDataText?: string
56
+ }
57
+
58
+ /**
59
+ * Configuration for pie chart map legends.
60
+ * Supports separate legends for pie size and slice colors.
61
+ */
62
+ export interface PieChartLegendConfig extends LegendConfig {
63
+ /** Configuration for the pie size legend. Set to false to hide. */
64
+ sizeLegend?: Partial<PieChartSizeLegendConfig> | false
65
+
66
+ /** Configuration for the color/category legend. Set to false to hide. */
67
+ colorLegend?: Partial<PieChartColorLegendConfig> | false
68
+ }
@@ -0,0 +1,94 @@
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for scale legend in sparkline maps.
5
+ */
6
+ export interface SparklineScaleLegendConfig {
7
+ /** Title for the scale legend section. */
8
+ title?: string | null
9
+
10
+ /** Padding between title and chart in pixels. @default 5 */
11
+ titlePadding?: number
12
+
13
+ /** Whether to show an example sparkline with averaged data. @default false */
14
+ showExampleChart?: boolean
15
+
16
+ /** Whether to show the region with maximum value. @default true */
17
+ showMaxRegion?: boolean
18
+
19
+ /** Custom example data for the sparkline. If null, uses averaged data. */
20
+ exampleData?: number[] | null
21
+
22
+ /** Number of ticks on Y axis. @default 5 */
23
+ tickCount?: number
24
+
25
+ /** Custom tick format function for Y axis values. */
26
+ tickFormat?: ((value: number) => string) | null
27
+
28
+ /** Whether to show X axis with date labels. @default true */
29
+ showXAxis?: boolean
30
+
31
+ /** Rotation angle for X axis labels in degrees. @default -45 */
32
+ xAxisRotation?: number
33
+
34
+ /** Step for showing X axis ticks (1 = every tick, 2 = every other, etc.). @default 1 */
35
+ xAxisTickStep?: number
36
+
37
+ /** Margins around the sparkline cell. Defaults to match the map's sparkline chart margin. */
38
+ margin?: { top: number; right: number; bottom: number; left: number }
39
+
40
+ /** Opacity of the sparkline. @default 0.5 */
41
+ lineOpacity?: number
42
+
43
+ /** Stroke width of the sparkline. @default 1 */
44
+ lineStrokeWidth?: number
45
+ }
46
+
47
+ /**
48
+ * Configuration for sparkline color legend (explains sparkLineColor/sparkAreaColor rules).
49
+ */
50
+ export interface SparklineColorLegendConfig {
51
+ /** Show. */
52
+ show?: boolean
53
+ /** Title. */
54
+ title?: string | null
55
+ /** Title padding. */
56
+ titlePadding?: number
57
+ /** Margin top. */
58
+ marginTop?: number
59
+ /** Item gap. */
60
+ itemGap?: number
61
+ /** Swatch width. */
62
+ swatchWidth?: number
63
+ /** Swatch height. */
64
+ swatchHeight?: number
65
+ /** Label offset x. */
66
+ labelOffsetX?: number
67
+ /** Items. */
68
+ items?: Array<{ color: string; label: string }>
69
+ }
70
+
71
+ /**
72
+ * Configuration for no data legend in sparkline maps.
73
+ */
74
+ export interface SparklineNoDataLegendConfig {
75
+ /** Whether to show the no data legend item. @default true */
76
+ show?: boolean
77
+
78
+ /** Text label for "no data" item. @default 'No data' */
79
+ text?: string
80
+ }
81
+
82
+ /**
83
+ * Configuration for sparkline map legends.
84
+ */
85
+ export interface SparklineLegendConfig extends LegendConfig {
86
+ /** Configuration for the scale legend showing Y-axis range. */
87
+ scaleLegend?: Partial<SparklineScaleLegendConfig>
88
+
89
+ /** Optional categorical color legend for spark colors. */
90
+ colorLegend?: Partial<SparklineColorLegendConfig> | false
91
+
92
+ /** Configuration for the no data legend. Set to false to hide. */
93
+ noDataLegend?: Partial<SparklineNoDataLegendConfig> | false
94
+ }
@@ -0,0 +1,11 @@
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for stripe composition map legends.
5
+ * Used to display a legend with colored rectangles representing different categories
6
+ * in stripe composition maps (regions divided into colored stripes showing composition).
7
+ */
8
+ export interface StripeCompositionLegendConfig extends LegendConfig {
9
+ // Inherits all properties from LegendConfig
10
+ // No additional specific properties beyond the base legend configuration
11
+ }
@@ -0,0 +1,74 @@
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for size legend in waffle chart maps.
5
+ */
6
+ export interface WaffleSizeLegendConfig {
7
+ /** Title for the size legend. */
8
+ title?: string | null
9
+
10
+ /** Padding between title and legend content in pixels. @default 10 */
11
+ titlePadding?: number
12
+
13
+ /** Custom values to display in the size legend. If not specified, values are auto-generated. */
14
+ values?: number[] | null
15
+
16
+ /** Custom formatter function for legend labels. */
17
+ labelFormatter?: ((value: number) => string) | undefined
18
+
19
+ /** Simplified grid size for size legend examples (e.g., 5 means 5x5 = 25 cells). @default 5 */
20
+ gridSize?: number
21
+
22
+ /** Padding between cells in size legend in pixels. @default 0.5 */
23
+ cellPadding?: number
24
+
25
+ /** Whether to show a "no data" item. @default false */
26
+ noData?: boolean
27
+
28
+ /** Text label for "no data" item. @default 'No data' */
29
+ noDataText?: string
30
+ }
31
+
32
+ /**
33
+ * Configuration for color legend in waffle chart maps.
34
+ */
35
+ export interface WaffleColorLegendConfig {
36
+ /** Title for the color legend. */
37
+ title?: string | null
38
+
39
+ /** Padding between title and legend content in pixels. @default 10 */
40
+ titlePadding?: number
41
+
42
+ /** Top margin (distance from size legend) in pixels. @default 33 */
43
+ marginTop?: number
44
+
45
+ /** Offset adjustments for labels. @default { x: 5, y: 5 } */
46
+ labelOffsets?: { x: number; y: number }
47
+
48
+ /** Width of color swatches in pixels. @default 25 */
49
+ shapeWidth?: number
50
+
51
+ /** Height of color swatches in pixels. @default 20 */
52
+ shapeHeight?: number
53
+
54
+ /** Padding between swatches in pixels. @default 1 */
55
+ shapePadding?: number
56
+
57
+ /** Whether to show a "no data" item. @default true */
58
+ noData?: boolean
59
+
60
+ /** Text label for "no data" item. @default 'No data' */
61
+ noDataText?: string
62
+ }
63
+
64
+ /**
65
+ * Configuration for waffle chart map legends.
66
+ * Waffle charts display data as grids of small squares, with colors representing categories.
67
+ */
68
+ export interface WaffleLegendConfig extends LegendConfig {
69
+ /** Configuration for the waffle size legend. */
70
+ sizeLegend?: Partial<WaffleSizeLegendConfig>
71
+
72
+ /** Configuration for the color/category legend. Set to false to hide. */
73
+ colorLegend?: Partial<WaffleColorLegendConfig> | false
74
+ }