eurostat-map 4.8.3 → 4.8.6

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.8.3",
3
+ "version": "4.8.6",
4
4
  "description": "Reusable library to quickly create and customise web maps showing Eurostat data directly retrieved from Eurostat database.",
5
5
  "keywords": [
6
6
  "eurostat",
@@ -1,73 +1,73 @@
1
- /**
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
- */
4
- export interface LegendConfig {
5
- /** Legend origin x-coordinate in pixels. */
6
- x?: number
7
- /** Legend origin y-coordinate in pixels. */
8
- y?: number
9
- /** Automatically position the legend in a map corner. Manual x/y coordinates take precedence. */
10
- position?: 'top right' | 'bottom right' | 'top left' | 'bottom left'
11
- /** Legend width in pixels. */
12
- width?: number
13
- /** Legend height in pixels. */
14
- height?: number
15
-
16
- /** Legend title text. */
17
- title?: string
18
- /** Legend subtitle text. */
19
- subtitle?: string
20
- /** Legend title font size in pixels. */
21
- titleFontSize?: number
22
-
23
- /** Box styling. */
24
- /** Inner spacing around legend content. */
25
- boxPadding?: number
26
- /** Background opacity of the legend box. */
27
- boxOpacity?: number
28
- /** Apply legend hover opacity/highlighting only while the map is currently zoomed in (scale != 1); disabled again once zoomed back out to the initial view. */
29
- onlyApplyOpacityWhileZoomed?: boolean
30
- /** Padding between the title block and legend body. */
31
- titlePadding?: number
32
-
33
- /** Shape styling (for proportional symbol legends). */
34
- /** Symbol swatch width in pixels. */
35
- shapeWidth?: number
36
- /** Symbol swatch height in pixels. */
37
- shapeHeight?: number
38
- /** Horizontal gap between shape and label. */
39
- shapePadding?: number
40
- /** Length of separator lines in discrete legends. */
41
- sepLineLength?: number
42
-
43
- /** Label styling. */
44
- /** Label font size in pixels. */
45
- labelFontSize?: number
46
- /** Pixel offsets applied to labels. */
47
- labelOffsets?: { x: number; y: number }
48
- /** Custom formatter for legend labels. */
49
- labelFormatter?: ((value: number, index?: number) => string) | null
50
- /** Number of decimal places for auto-formatted labels. */
51
- decimals?: number
52
-
53
- /** Legend layout direction. */
54
- orientation?: 'vertical' | 'horizontal'
55
- /** Sort legend entries in ascending order when true. */
56
- ascending?: boolean
57
- /** Whether to display the no-data legend item. */
58
- noData?: boolean
59
- /** Label used for no-data legend item. */
60
- noDataText?: string
61
- /** Vertical gap before the no-data swatch in pixels. */
62
- noDataPadding?: number
63
- /** Width of the no-data swatch in pixels. */
64
- noDataShapeWidth?: number
65
- /** Height of the no-data swatch in pixels. */
66
- noDataShapeHeight?: number
67
-
68
- /** Whether to show dataset min/max labels when supported. */
69
- maxMin?: boolean
70
- /** Text affixes for min/max labels as [minSuffix, maxSuffix]. */
71
- maxMinLabels?: [string, string]
72
- layer?: any
73
- }
1
+ /**
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
+ */
4
+ export interface LegendConfig {
5
+ /** Legend origin x-coordinate in pixels. */
6
+ x?: number
7
+ /** Legend origin y-coordinate in pixels. */
8
+ y?: number
9
+ /** Automatically position the legend in a map corner. Manual x/y coordinates take precedence. */
10
+ position?: 'top right' | 'bottom right' | 'top left' | 'bottom left'
11
+ /** Legend width in pixels. */
12
+ width?: number
13
+ /** Legend height in pixels. */
14
+ height?: number
15
+
16
+ /** Legend title text. */
17
+ title?: string
18
+ /** Legend subtitle text. */
19
+ subtitle?: string
20
+ /** Legend title font size in pixels. */
21
+ titleFontSize?: number
22
+
23
+ /** Box styling. */
24
+ /** Inner spacing around legend content. */
25
+ boxPadding?: number
26
+ /** Background opacity of the legend box. */
27
+ boxOpacity?: number
28
+ /** Apply the legend box's background opacity (boxOpacity) only while the map is currently zoomed in (scale != 1). The legend box is transparent at the initial view and returns to its configured opacity while zoomed. Purely a box-opacity concern - does not affect legend hover interactions (e.g. hover-to-highlight), which always work regardless of zoom state. */
29
+ onlyApplyOpacityWhileZoomed?: boolean
30
+ /** Padding between the title block and legend body. */
31
+ titlePadding?: number
32
+
33
+ /** Shape styling (for proportional symbol legends). */
34
+ /** Symbol swatch width in pixels. */
35
+ shapeWidth?: number
36
+ /** Symbol swatch height in pixels. */
37
+ shapeHeight?: number
38
+ /** Horizontal gap between shape and label. */
39
+ shapePadding?: number
40
+ /** Length of separator lines in discrete legends. */
41
+ sepLineLength?: number
42
+
43
+ /** Label styling. */
44
+ /** Label font size in pixels. */
45
+ labelFontSize?: number
46
+ /** Pixel offsets applied to labels. */
47
+ labelOffsets?: { x: number; y: number }
48
+ /** Custom formatter for legend labels. */
49
+ labelFormatter?: ((value: number, index?: number) => string) | null
50
+ /** Number of decimal places for auto-formatted labels. */
51
+ decimals?: number
52
+
53
+ /** Legend layout direction. */
54
+ orientation?: 'vertical' | 'horizontal'
55
+ /** Sort legend entries in ascending order when true. */
56
+ ascending?: boolean
57
+ /** Whether to display the no-data legend item. */
58
+ noData?: boolean
59
+ /** Label used for no-data legend item. */
60
+ noDataText?: string
61
+ /** Vertical gap before the no-data swatch in pixels. */
62
+ noDataPadding?: number
63
+ /** Width of the no-data swatch in pixels. */
64
+ noDataShapeWidth?: number
65
+ /** Height of the no-data swatch in pixels. */
66
+ noDataShapeHeight?: number
67
+
68
+ /** Whether to show dataset min/max labels when supported. */
69
+ maxMin?: boolean
70
+ /** Text affixes for min/max labels as [minSuffix, maxSuffix]. */
71
+ maxMinLabels?: [string, string]
72
+ layer?: any
73
+ }
@@ -1,135 +1,126 @@
1
- import { LegendConfig } from '../LegendConfig'
2
-
3
- /**
4
- * Configuration for bivariate choropleth map legends.
5
- * Displays a 2D grid showing the relationship between two variables,
6
- * with color squares representing different class combinations.
7
- */
8
- export interface BivariateLegendConfig extends LegendConfig {
9
- /** Size of the legend square grid in pixels. @default 100 */
10
- squareSize?: number
11
-
12
- /** Rotation angle of the legend in degrees. @default 0 */
13
- rotation?: number
14
-
15
- /** Label for the first variable (x-axis). Supports `\\n` and `<br>` line breaks. @default 'Variable 1' */
16
- label1?: string
17
-
18
- /** Label for the second variable (y-axis). Supports `\\n` and `<br>` line breaks. @default 'Variable 2' */
19
- label2?: string
20
-
21
- /** Break labels for the first variable. Omit to hide first-axis break labels. */
22
- breaks1?: Array<number | string>
23
-
24
- /** Break labels for the second variable. Omit to hide second-axis break labels. */
25
- breaks2?: Array<number | string>
26
-
27
- /** Length of axis tick marks in pixels. @default 5 */
28
- tickLength?: number
29
-
30
- /** Offset adjustments for y-axis labels. @default { x: 0, y: 0 } */
31
- yAxisLabelsOffset?: { x: number; y: number }
32
-
33
- /** Offset adjustments for x-axis labels. @default { x: 0, y: 0 } */
34
- xAxisLabelsOffset?: { x: number; y: number }
35
-
36
- /** Offset adjustments for y-axis title. @default { x: 0, y: 0 } */
37
- yAxisTitleOffset?: { x: number; y: number }
38
-
39
- /** Offset adjustments for x-axis title. @default { x: 0, y: 0 } */
40
- xAxisTitleOffset?: { x: number; y: number }
41
-
42
- /** Extra vertical offset for the "no data" legend item in pixels. @default 30 */
43
- noDataYOffset?: number
44
-
45
- /** Whether to show arrows at the end of both axes, or for each axis independently. @default true */
46
- axisArrows?: boolean | { x?: boolean; y?: boolean }
47
-
48
- /** Height of axis arrows in pixels. @default 15 */
49
- arrowHeight?: number
50
-
51
- /** Width of axis arrows in pixels. @default 14 */
52
- arrowWidth?: number
53
-
54
- /** Padding between arrow and axis label in pixels. @default 10 */
55
- arrowPadding?: number
56
-
57
- /**
58
- * Labels displayed at low/high ends of each axis.
59
- * @default { x: { low: 'Low', high: 'High' }, y: { low: 'Low', high: 'High' } }
60
- */
61
- axisExtremes?: {
62
- x?: { low?: string; high?: string }
63
- y?: { low?: string; high?: string }
64
- }
65
-
66
- /** Whether to show low/high endpoint labels on both axes, or for each axis independently. @default true */
67
- showAxisExtremes?: boolean | { x?: boolean; y?: boolean }
68
-
69
- /**
70
- * Optional text annotations for each corner of the bivariate square.
71
- * Add text for any combination of topRight, bottomRight, bottomLeft, topLeft.
72
- * Supports line breaks using '<br>'/'<br/>' or '\\n'.
73
- */
74
- annotations?: {
75
- topRight?: string
76
- bottomRight?: string
77
- bottomLeft?: string
78
- topLeft?: string
79
- }
80
-
81
- /**
82
- * Length of corner annotation callout lines in pixels.
83
- * Can be a single number for all corners, or per-corner values.
84
- * @default 18
85
- */
86
- annotationLineLength?:
87
- | number
88
- | {
89
- topRight?: number
90
- bottomRight?: number
91
- bottomLeft?: number
92
- topLeft?: number
93
- }
94
-
95
- /**
96
- * Annotation text offsets in pixels.
97
- * Use global `{ x, y }` or per-corner values.
98
- * @default auto (based on corner direction)
99
- */
100
- annotationOffsets?:
101
- | { x?: number; y?: number }
102
- | {
103
- topRight?: { x?: number; y?: number }
104
- bottomRight?: { x?: number; y?: number }
105
- bottomLeft?: { x?: number; y?: number }
106
- topLeft?: { x?: number; y?: number }
107
- }
108
-
109
- /**
110
- * Extra offset applied to the leader-line endpoint where it meets the annotation label.
111
- * Use global `{ x, y }` or per-corner values.
112
- * @default { x: 0, y: 0 }
113
- */
114
- annotationLineEndOffset?:
115
- | { x?: number; y?: number }
116
- | {
117
- topRight?: { x?: number; y?: number }
118
- bottomRight?: { x?: number; y?: number }
119
- bottomLeft?: { x?: number; y?: number }
120
- topLeft?: { x?: number; y?: number }
121
- }
122
-
123
- /**
124
- * @deprecated Use annotationOffsets instead.
125
- * Radial padding between corner annotation callout line end and text in pixels.
126
- */
127
- annotationPadding?:
128
- | number
129
- | {
130
- topRight?: number
131
- bottomRight?: number
132
- bottomLeft?: number
133
- topLeft?: number
134
- }
1
+ import { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for bivariate choropleth map legends.
5
+ * Displays a 2D grid showing the relationship between two variables,
6
+ * with color squares representing different class combinations.
7
+ */
8
+ export interface BivariateLegendConfig extends LegendConfig {
9
+ /** Size of the legend square grid in pixels. @default 100 */
10
+ squareSize?: number
11
+
12
+ /** Rotation angle of the legend in degrees. @default 0 */
13
+ rotation?: number
14
+
15
+ /** Label for the first variable (x-axis). Supports `\\n` and `<br>` line breaks. @default 'Variable 1' */
16
+ label1?: string
17
+
18
+ /** Label for the second variable (y-axis). Supports `\\n` and `<br>` line breaks. @default 'Variable 2' */
19
+ label2?: string
20
+
21
+ /** Break labels for the first variable. Omit to hide first-axis break labels. */
22
+ breaks1?: Array<number | string>
23
+
24
+ /** Break labels for the second variable. Omit to hide second-axis break labels. */
25
+ breaks2?: Array<number | string>
26
+
27
+ /** Length of axis tick marks in pixels. @default 5 */
28
+ tickLength?: number
29
+
30
+ /** Offset adjustments for y-axis labels. @default { x: 0, y: 0 } */
31
+ yAxisLabelsOffset?: { x: number; y: number }
32
+
33
+ /** Offset adjustments for x-axis labels. @default { x: 0, y: 0 } */
34
+ xAxisLabelsOffset?: { x: number; y: number }
35
+
36
+ /** Offset adjustments for y-axis title. @default { x: 0, y: 0 } */
37
+ yAxisTitleOffset?: { x: number; y: number }
38
+
39
+ /** Offset adjustments for x-axis title. @default { x: 0, y: 0 } */
40
+ xAxisTitleOffset?: { x: number; y: number }
41
+
42
+ /** Font size of the axis titles in pixels. Defaults to the value defined by the legend CSS. */
43
+ axisTitleFontSize?: number
44
+
45
+ /** Extra vertical offset for the "no data" legend item in pixels. @default 30 */
46
+ noDataYOffset?: number
47
+
48
+ /** Whether to show arrows at the end of both axes, or for each axis independently. @default true */
49
+ axisArrows?: boolean | { x?: boolean; y?: boolean }
50
+
51
+ /** Height of axis arrows in pixels. @default 15 */
52
+ arrowHeight?: number
53
+
54
+ /** Width of axis arrows in pixels. @default 14 */
55
+ arrowWidth?: number
56
+
57
+ /** Padding between arrow and axis label in pixels. @default 10 */
58
+ arrowPadding?: number
59
+
60
+ /**
61
+ * Labels displayed at low/high ends of each axis.
62
+ * @default { x: { low: 'Low', high: 'High' }, y: { low: 'Low', high: 'High' } }
63
+ */
64
+ axisExtremes?: {
65
+ x?: { low?: string; high?: string }
66
+ y?: { low?: string; high?: string }
67
+ }
68
+
69
+ /** Whether to show low/high endpoint labels on both axes, or for each axis independently. @default true */
70
+ showAxisExtremes?: boolean | { x?: boolean; y?: boolean }
71
+
72
+ /**
73
+ * Optional text annotations for each corner of the bivariate square.
74
+ * Add text for any combination of topRight, bottomRight, bottomLeft, topLeft.
75
+ * Supports line breaks using '<br>'/'<br/>' or '\\n'.
76
+ */
77
+ annotations?: {
78
+ topRight?: string
79
+ bottomRight?: string
80
+ bottomLeft?: string
81
+ topLeft?: string
82
+ }
83
+
84
+ /**
85
+ * Length of corner annotation callout lines in pixels.
86
+ * Can be a single number for all corners, or per-corner values.
87
+ * @default 18
88
+ */
89
+ annotationLineLength?:
90
+ | number
91
+ | {
92
+ topRight?: number
93
+ bottomRight?: number
94
+ bottomLeft?: number
95
+ topLeft?: number
96
+ }
97
+
98
+ /**
99
+ * Annotation text offsets in pixels.
100
+ * Use global `{ x, y }` or per-corner values.
101
+ * @default auto (based on corner direction)
102
+ */
103
+ annotationOffsets?:
104
+ | { x?: number; y?: number }
105
+ | {
106
+ topRight?: { x?: number; y?: number }
107
+ bottomRight?: { x?: number; y?: number }
108
+ bottomLeft?: { x?: number; y?: number }
109
+ topLeft?: { x?: number; y?: number }
110
+ }
111
+
112
+ /**
113
+ * Extra offset applied to the leader-line endpoint where it meets the annotation label.
114
+ * Use global `{ x, y }` or per-corner values.
115
+ * @default { x: 0, y: 0 }
116
+ */
117
+ annotationLineEndOffsets?:
118
+ | { x?: number; y?: number }
119
+ | {
120
+ topRight?: { x?: number; y?: number }
121
+ bottomRight?: { x?: number; y?: number }
122
+ bottomLeft?: { x?: number; y?: number }
123
+ topLeft?: { x?: number; y?: number }
124
+ }
125
+
135
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.8.3",
3
+ "version": "4.8.6",
4
4
  "description": "Reusable library to quickly create and customise web maps showing Eurostat data directly retrieved from Eurostat database.",
5
5
  "keywords": [
6
6
  "cartography",