eurostat-map 4.10.9 → 4.10.11

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 (120) hide show
  1. package/build/215.eurostatmap.min.js +1 -1
  2. package/build/eurostatmap.js +2757 -2689
  3. package/build/eurostatmap.min.js +2 -2
  4. package/build/eurostatmap.min.js.map +1 -1
  5. package/build/package.json +1 -1
  6. package/build/types/core/InsetConfig.d.ts +92 -71
  7. package/build/types/core/MapConfig.d.ts +103 -12
  8. package/build/types/core/MapInstance.d.ts +624 -555
  9. package/build/types/core/TooltipConfig.d.ts +33 -5
  10. package/build/types/core/decoration/PatternFillConfig.d.ts +34 -0
  11. package/build/types/core/geo/geometries.d.ts +13 -1
  12. package/build/types/core/layer/Layer.d.ts +49 -31
  13. package/build/types/core/minimaps.d.ts +11 -3
  14. package/build/types/core/stat/StatData.d.ts +2 -2
  15. package/build/types/core/utils.d.ts +44 -0
  16. package/build/types/index.d.ts +37 -6
  17. package/build/types/layers/CategoricalMap.d.ts +9 -9
  18. package/build/types/layers/choropleth/BivariateChoroplethConfig.d.ts +3 -0
  19. package/build/types/layers/choropleth/BivariateChoroplethMap.d.ts +9 -6
  20. package/build/types/layers/choropleth/ChoroplethConfig.d.ts +3 -3
  21. package/build/types/layers/choropleth/ChoroplethMap.d.ts +16 -4
  22. package/build/types/layers/choropleth/TrivariateChoroplethMap.d.ts +4 -0
  23. package/build/types/layers/choropleth/ValueByAlphaMap.d.ts +4 -3
  24. package/build/types/layers/composition/bar/BarMap.d.ts +170 -97
  25. package/build/types/layers/composition/bar/BarMapConfig.d.ts +83 -76
  26. package/build/types/layers/composition/coxcomb/CoxcombMap.d.ts +7 -6
  27. package/build/types/layers/composition/coxcomb/CoxcombMapConfig.d.ts +2 -2
  28. package/build/types/layers/composition/pie/PieMap.d.ts +8 -4
  29. package/build/types/layers/composition/pie/PieMapConfig.d.ts +0 -4
  30. package/build/types/layers/composition/stripe/StripeMap.d.ts +4 -4
  31. package/build/types/layers/composition/waffle/WaffleMap.d.ts +4 -4
  32. package/build/types/layers/flow/FlowMap.d.ts +8 -8
  33. package/build/types/layers/proportional-symbol/ProportionalSymbolConfig.d.ts +105 -52
  34. package/build/types/layers/proportional-symbol/ProportionalSymbolMap.d.ts +104 -100
  35. package/build/types/layers/proportional-symbol/mushroom/MushroomMap.d.ts +16 -12
  36. package/build/types/layers/spark/SparkMap.d.ts +14 -8
  37. package/build/types/layers/spark/SparkMapConfig.d.ts +8 -12
  38. package/build/types/legend/LegendConfig.d.ts +72 -73
  39. package/build/types/legend/MushroomLegendConfig.d.ts +15 -0
  40. package/build/types/legend/choropleth/BivariateLegendConfig.d.ts +6 -6
  41. package/build/types/legend/choropleth/TrivariateLegendConfig.d.ts +5 -5
  42. package/build/types/legend/composition/BarChartLegendConfig.d.ts +32 -0
  43. package/build/types/legend/composition/StripeCompositionLegendConfig.d.ts +34 -2
  44. package/package.json +1 -1
  45. package/build/types/core/MinimapConfig.d.ts +0 -11
  46. package/build/types/legend/CoxcombLegendConfig.d.ts +0 -85
  47. package/build/types/legend/PieChartLegendConfig.d.ts +0 -68
  48. package/build/types/legend/SparklineLegendConfig.d.ts +0 -6
  49. package/build/types/legend/StripeCompositionLegendConfig.d.ts +0 -11
  50. package/build/types/legend/WaffleLegendConfig.d.ts +0 -74
  51. package/build/types/legend/choropleth/legend-choropleth-bivariate.d.ts +0 -2
  52. package/build/types/legend/choropleth/legend-choropleth-trivariate.d.ts +0 -2
  53. package/build/types/legend/choropleth/legend-choropleth.d.ts +0 -2
  54. package/build/types/legend/composition/legend-bar-chart.d.ts +0 -2
  55. package/build/types/legend/flow/legend-flow.d.ts +0 -2
  56. package/build/types/legend/legend-categorical.d.ts +0 -2
  57. package/build/types/legend/legend-continuous.d.ts +0 -2
  58. package/build/types/legend/legend-discrete.d.ts +0 -2
  59. package/build/types/legend/legend.d.ts +0 -13
  60. package/build/types/legend/proportional-symbol/PropSymbolLegendConfig.d.ts +0 -0
  61. package/build/types/legend/proportional-symbol/legend-proportional-symbols.d.ts +0 -2
  62. package/build/types/map-types/CategoricalMap.d.ts +0 -21
  63. package/build/types/map-types/CategoricalMapConfig.d.ts +0 -11
  64. package/build/types/map-types/CateogricalMapConfig.d.ts +0 -11
  65. package/build/types/map-types/MapType.d.ts +0 -34
  66. package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +0 -27
  67. package/build/types/map-types/choropleth/BivariateChoroplethMap.d.ts +0 -39
  68. package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +0 -39
  69. package/build/types/map-types/choropleth/ChoroplethMap.d.ts +0 -48
  70. package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +0 -41
  71. package/build/types/map-types/choropleth/TrivariateChoroplethMap.d.ts +0 -18
  72. package/build/types/map-types/choropleth/ValueByAlphaConfig.d.ts +0 -8
  73. package/build/types/map-types/choropleth/ValueByAlphaMap.d.ts +0 -9
  74. package/build/types/map-types/choropleth/map-choropleth-bivariate.d.ts +0 -4
  75. package/build/types/map-types/choropleth/map-choropleth-trivariate.d.ts +0 -4
  76. package/build/types/map-types/choropleth/map-choropleth.d.ts +0 -47
  77. package/build/types/map-types/choropleth/map-value-by-alpha.d.ts +0 -4
  78. package/build/types/map-types/composition/BarMap.d.ts +0 -86
  79. package/build/types/map-types/composition/BarMapConfig.d.ts +0 -30
  80. package/build/types/map-types/composition/CompositionStatConfig.d.ts +0 -57
  81. package/build/types/map-types/composition/CoxcombMap.d.ts +0 -42
  82. package/build/types/map-types/composition/CoxcombMapConfig.d.ts +0 -18
  83. package/build/types/map-types/composition/PieMap.d.ts +0 -62
  84. package/build/types/map-types/composition/PieMapConfig.d.ts +0 -24
  85. package/build/types/map-types/composition/SparkMap.d.ts +0 -46
  86. package/build/types/map-types/composition/SparkMapConfig.d.ts +0 -25
  87. package/build/types/map-types/composition/StripeMap.d.ts +0 -43
  88. package/build/types/map-types/composition/StripeMapConfig.d.ts +0 -16
  89. package/build/types/map-types/composition/WaffleMap.d.ts +0 -71
  90. package/build/types/map-types/composition/WaffleMapConfig.d.ts +0 -25
  91. package/build/types/map-types/composition/bar/BarMap.d.ts +0 -97
  92. package/build/types/map-types/composition/bar/BarMapConfig.d.ts +0 -76
  93. package/build/types/map-types/composition/composition-map.d.ts +0 -25
  94. package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +0 -75
  95. package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +0 -47
  96. package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +0 -13
  97. package/build/types/map-types/composition/map-bar.d.ts +0 -5
  98. package/build/types/map-types/composition/map-coxcomb.d.ts +0 -5
  99. package/build/types/map-types/composition/map-pie.d.ts +0 -10
  100. package/build/types/map-types/composition/map-spark.d.ts +0 -5
  101. package/build/types/map-types/composition/map-stripe.d.ts +0 -5
  102. package/build/types/map-types/composition/map-waffle.d.ts +0 -5
  103. package/build/types/map-types/composition/pie/PieMap.d.ts +0 -84
  104. package/build/types/map-types/composition/pie/PieMapConfig.d.ts +0 -50
  105. package/build/types/map-types/composition/stripe/StripeMap.d.ts +0 -80
  106. package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +0 -45
  107. package/build/types/map-types/composition/waffle/WaffleMap.d.ts +0 -124
  108. package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +0 -58
  109. package/build/types/map-types/flow/FlowMap.d.ts +0 -218
  110. package/build/types/map-types/flow/FlowMapConfig.d.ts +0 -220
  111. package/build/types/map-types/flow/map-flow.d.ts +0 -5
  112. package/build/types/map-types/map-categorical.d.ts +0 -19
  113. package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +0 -47
  114. package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +0 -94
  115. package/build/types/map-types/proportional-symbol/map-proportional-symbols.d.ts +0 -35
  116. package/build/types/map-types/proportional-symbol/mushroom/MushroomMap.d.ts +0 -67
  117. package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +0 -39
  118. package/build/types/map-types/spark/SparkMap.d.ts +0 -56
  119. package/build/types/map-types/spark/SparkMapConfig.d.ts +0 -74
  120. package/build/types/map-types/spark/SparkStatConfig.d.ts +0 -32
@@ -1,555 +1,624 @@
1
- import type { StatConfig } from './stat/StatConfig'
2
- import type { StatData } from './stat/StatData'
3
- import type { Layer } from './layer/Layer'
4
- import type { LayerConfig } from './layer/LayerConfig'
5
- import type { CompositionStatConfig } from '../layers/composition/CompositionStatConfig'
6
- import type { LegendConfig } from '../legend/LegendConfig'
7
- import type { RankedBarChartConfig } from './decoration/RankedBarChartConfig'
8
- import type { TooltipConfig } from './TooltipConfig'
9
- import type { InsetConfig } from './InsetConfig'
10
- import type { CoastalMarginSettings } from './decoration/CoastalMarginSettings'
11
- import type { GridCartogramSettings } from './GridCartogramSettings'
12
- import type { DorlingSettings } from './DorlingSettings'
13
- import type { ScalebarConfig } from './decoration/ScalebarConfig'
14
- import type { EncodingConfig } from './encoding/EncodingConfig'
15
- import type { LocationConfig } from './locations'
16
- import type { LabelsConfig } from './decoration/LabelsConfig'
17
-
18
- /**
19
- * A eurostat-map instance. Created by eurostatmap.map() and extended
20
- * by each concrete map type. All getter/setter methods follow the same
21
- * pattern: call with no argument to get, call with a value to set and
22
- * return the instance for chaining.
23
- */
24
- export interface MapInstance {
25
- /** Container. */
26
-
27
- /** ID of the target SVG element. @default 'map' */
28
- svgId(): string
29
- svgId(id: string): this
30
-
31
- /** ID of the wrapper container element. */
32
- containerId(): string
33
- containerId(id: string): this
34
-
35
- /** Dimensions. */
36
-
37
- /** Map width in pixels. @default min(795, window.innerWidth) */
38
- width(): number
39
- width(w: number): this
40
-
41
- /** Map height in pixels. 0 = auto (85% of width). */
42
- height(): number
43
- height(h: number): this
44
-
45
- /** Geography. */
46
-
47
- /**
48
- * NUTS2JSON geographic focus area.
49
- * @example 'EUR' | 'WORLD' | 'PT' | 'MT' | 'IC'
50
- */
51
- geo(): string
52
- geo(g: string): this
53
-
54
- /**
55
- * EPSG projection code for NUTS2JSON geometries.
56
- * Use '4326' when setting a custom projectionFunction.
57
- * @default '3035'
58
- */
59
- proj(): string
60
- proj(p: string): this
61
-
62
- /**
63
- * NUTS2JSON geometry resolution.
64
- * @default '20M'
65
- */
66
- scale(): string
67
- scale(s: '60M' | '20M' | '10M' | '03M' | '01M'): this
68
-
69
- /** NUTS level to display. @default 3 */
70
- nutsLevel(): number | 'mixed'
71
- nutsLevel(level: number | 'mixed'): this
72
-
73
- /** NUTS boundaries year. @default 2024 */
74
- nutsYear(): number
75
- nutsYear(year: number): this
76
-
77
- /**
78
- * Initial map viewport. x/y in projected coordinates, z is pixel size
79
- * (map units per screen pixel — smaller = more zoomed in).
80
- * @example map.position({ x: 4800000, y: 3400000, z: 6000 })
81
- */
82
- position(v: { x?: number; y?: number; z?: number }): this
83
- position(): { x: number; y: number; z: number }
84
-
85
- /**
86
- * Custom D3 projection function. When set, also call proj('4326').
87
- * @example map.projectionFunction(d3.geoAzimuthalEquidistant().rotate([-10, -52]))
88
- */
89
- projectionFunction(): any
90
- projectionFunction(fn: any): this
91
-
92
- /** Text and labels. */
93
-
94
- /** Map title. */
95
- title(): string
96
- title(t: string): this
97
-
98
- /** Map subtitle. */
99
- subtitle(): string
100
- subtitle(t: string): this
101
-
102
- /**
103
- * Footnote text shown at the bottom of the map.
104
- * Defaults to the standard EuroGeographics copyright notice.
105
- */
106
- footnote(): string | false
107
- footnote(text: string | false): this
108
-
109
- /** Tooltip text shown when hovering over the footnote. */
110
- footnoteTooltipText(): string | false
111
- footnoteTooltipText(text: string | false): this
112
-
113
- /** Wrap footnote text at this many characters. */
114
- footnoteWrap(): number | false
115
- footnoteWrap(chars: number | false): this
116
-
117
- /** Statistical data. */
118
-
119
- /**
120
- * Get or set statistical data configuration.
121
- * - `map.stat()` → returns the default stat config
122
- * - `map.stat(config)` → sets the default stat config
123
- * - `map.stat('v1')` → returns the stat config for key 'v1'
124
- * - `map.stat('v1', config)` → sets the stat config for key 'v1'
125
- * @example map.stat({ eurostatDatasetCode: 'demo_r_d3dens', filters: { TIME: '2024' } })
126
- */
127
- stat(): StatConfig | CompositionStatConfig | undefined
128
- stat(config: StatConfig | CompositionStatConfig): this
129
- stat(key: string): StatConfig | CompositionStatConfig | undefined
130
- stat(key: string, config: StatConfig | CompositionStatConfig): this
131
- /**
132
- * Legacy compatibility overload for composition channels.
133
- * Preferred: pass category fields directly inside config.
134
- */
135
- stat(
136
- key: string,
137
- config: StatConfig | CompositionStatConfig,
138
- categoryParameter: string,
139
- categoryCodes?: string[],
140
- categoryLabels?: string[],
141
- categoryColors?: string[],
142
- totalCode?: string
143
- ): this
144
-
145
- /**
146
- * Get or set visual encodings that map named stats to visual variables.
147
- * @example map.encoding('size', { stat: 'population', scale: 'sqrt', range: [4, 30] })
148
- */
149
- encoding(): Record<string, EncodingConfig>
150
- encoding(channel: string): EncodingConfig | undefined
151
- encoding(channel: string, config: EncodingConfig): this
152
- encoding(configs: Record<string, EncodingConfig>): this
153
-
154
- /** Returns the stat name for an encoding channel, or fallback when unset. */
155
- getEncodingStat(channel: string, fallback?: string): string | undefined
156
-
157
- /** Returns stat names for an encoding channel (`stats` or single `stat`). */
158
- getEncodingStats(channel: string, fallback?: string[]): string[] | undefined
159
-
160
- /** Returns the concrete statData key for a channel/category combination. */
161
- getEncodingStatKey(channel: string, categoryCode?: string, fallbackStat?: string): string | undefined
162
-
163
- /** Returns the StatData source bound to a channel/category. */
164
- getEncodingStatData(channel: string, categoryCode?: string, fallbackStat?: string): StatData | undefined
165
-
166
- /** Returns a region value through encoding lookup. */
167
- getEncodingValue(channel: string, regionId: string, categoryCode?: string, fallbackStat?: string): number | string | undefined
168
-
169
- /** Returns unit text through encoding lookup. */
170
- getEncodingUnitText(channel: string, categoryCode?: string, fallbackStat?: string): string
171
-
172
- /**
173
- * Get or set the StatData instance for a given key.
174
- * Use setData() on the returned instance to supply custom data.
175
- * @example map.statData().setData({ DE: 120, FR: 95 })
176
- */
177
- statData(): StatData
178
- statData(key: string): StatData
179
- statData(key: string, data: StatData): this
180
-
181
- /**
182
- * Returns the time dimension value from the loaded Eurostat dataset.
183
- * Useful for displaying the data period in the map title.
184
- * @example map.onBuild(() => map.title('Population ' + map.getTime()))
185
- */
186
- getTime(): string | undefined
187
-
188
- /** Text shown for regions with no data. @default 'No data available' */
189
- noDataText(): string
190
- noDataText(text: string): this
191
-
192
- /** BCP 47 language tag for Eurostat API labels. @default 'en' */
193
- language(): string
194
- language(lang: string): this
195
-
196
- /** Legend. */
197
-
198
- /**
199
- * Get or set legend configuration. Pass false to remove the legend.
200
- * @example map.legend({ x: 10, y: 90, title: 'Density, people/km²' })
201
- */
202
- legend(): LegendConfig | false
203
- legend(config: LegendConfig | false): this
204
-
205
- /** Force-update the legend after data or style changes. */
206
- updateLegend(): this
207
-
208
- /** Ranked bar chart. */
209
-
210
- /**
211
- * Get or set ranked bar chart configuration (choropleth-classified map types only). Pass
212
- * false to remove it. Independent of the legend - has its own positioning and can render
213
- * into an entirely different container/SVG to the legend's.
214
- * @example map.rankedBarChart({ svgId: 'my-bar-chart-container' })
215
- */
216
- rankedBarChart(): RankedBarChartConfig | false
217
- rankedBarChart(config: RankedBarChartConfig | false): this
218
-
219
- /** Force-update the ranked bar chart after data or style changes. */
220
- updateRankedBarChart(): this
221
-
222
- /** Tooltip. */
223
-
224
- /** Get or set tooltip configuration. */
225
- tooltip(): TooltipConfig
226
- tooltip(config: TooltipConfig): this
227
-
228
- /** Zoom and pan. */
229
-
230
- /**
231
- * D3 zoom scale extent [min, max].
232
- * @example map.zoomExtent([1, 10])
233
- */
234
- zoomExtent(): [number, number]
235
- zoomExtent(extent: [number, number]): this
236
-
237
- /** Show zoom +/- buttons. @default true */
238
- zoomButtons(): boolean
239
- zoomButtons(show: boolean): this
240
-
241
- /** Grid cartogram settings (shape, margins, cell padding, layout positions). */
242
- gridCartogramSettings(): GridCartogramSettings
243
- gridCartogramSettings(settings: Partial<GridCartogramSettings>): this
244
-
245
- /** Insets. */
246
-
247
- /**
248
- * Inset map configurations. Pass a named preset string, or a custom array, or false to
249
- * disable. Passing true is an alias for 'default'.
250
- * - 'default': simple grid layout of overseas territories.
251
- * - 'image': Malta, Liechtenstein and EU/EFTA overseas/remote territories, hand-tuned
252
- * layout with connecting decoration (background box, separator lines, blur gradients).
253
- * - 'eu': simple grid layout of EU overseas/outermost territories, no decoration.
254
- * - 'euEfta': like 'eu', plus Liechtenstein and Svalbard, no decoration.
255
- * @example map.insets('default')
256
- * @example map.insets('image')
257
- * @example map.insets(true)
258
- * @example map.insets([{ geo: 'MT' }, { geo: 'LI' }])
259
- */
260
- insets(): InsetConfig[] | 'default' | 'image' | 'eu' | 'euEfta' | false
261
- insets(config: InsetConfig[] | 'default' | 'image' | 'eu' | 'euEfta' | true | false): this
262
-
263
- /** Decoration. */
264
-
265
- /** Show/hide the graticule (coordinate grid lines). */
266
- drawGraticule(): boolean
267
- drawGraticule(show: boolean): this
268
-
269
- /** Show/hide the coastal margin shadow effect. */
270
- drawCoastalMargin(): boolean
271
- drawCoastalMargin(show: boolean): this
272
-
273
- /** Coastal margin appearance settings. */
274
- coastalMarginSettings(): CoastalMarginSettings
275
- coastalMarginSettings(settings: Partial<CoastalMarginSettings>): this
276
-
277
- /** Show/hide placename labels loaded from the placenames layer. */
278
- placenames(): boolean
279
- placenames(show: boolean): this
280
-
281
- /**
282
- * Get or set label configuration for country names, statistical values, etc.
283
- * @example map.labels({ values: true, backgrounds: true, backgroundFill: '#B19122', statLabelTextColor: '#fff', backgroundPadding: { x: 6, y: 3 }, backgroundBorderRadius: 4 })
284
- */
285
- labels(): LabelsConfig | undefined
286
- labels(config: LabelsConfig): this
287
-
288
- /** Annotation configuration for d3-svg-annotation. */
289
- annotations(): any
290
- annotations(config: any): this
291
-
292
- /** Stamp/watermark annotation. @example { x: 10, y: 10, text: 'DRAFT', size: 40 } */
293
- stamp(): object | undefined
294
- stamp(config: { x: number; y: number; text: string; size?: number }): this
295
-
296
- /** Scalebar configuration. */
297
- scalebar(): ScalebarConfig | null
298
- scalebar(config: ScalebarConfig | boolean): this
299
-
300
- /** Scalebar visibility. */
301
- showScalebar(): boolean
302
- showScalebar(show: boolean): this
303
-
304
- /** Scalebar position [x, y] in pixels. */
305
- scalebarPosition(): [number, number]
306
- scalebarPosition(pos: [number, number]): this
307
-
308
- /** Show the Eurostat logo. */
309
- showEstatLogo(): boolean
310
- showEstatLogo(show: boolean): this
311
-
312
- /** Show the Eurostat ribbon banner. */
313
- showEstatRibbon(): boolean
314
- showEstatRibbon(show: boolean): this
315
-
316
- /** Returns the D3 selection of the SVG element. */
317
- svg(): any
318
- svg(s: any): this
319
-
320
- /** Add or replace a custom point location marker. */
321
- addLocation(config: LocationConfig): this
322
-
323
- /** Remove a custom point location marker by id. */
324
- removeLocation(id: string): this
325
-
326
- /** Remove all custom point location markers. */
327
- clearLocations(): this
328
-
329
- /** Get or replace all custom point location markers. */
330
- locations(): LocationConfig[]
331
- locations(configs: LocationConfig[] | null | undefined): this
332
-
333
- /** Redraw custom point location markers. */
334
- updateLocations(): this
335
-
336
- /** Custom geometry filtering function. */
337
- filterGeometriesFunction(): ((geometry: any) => boolean) | undefined
338
- filterGeometriesFunction(fn: (geometry: any) => boolean): this
339
-
340
- /** Grid cartogram enabled or disabled. */
341
- gridCartogram(): boolean
342
- gridCartogram(enable: boolean): this
343
-
344
- /** Toggle background map rendering (sea, country boundaries, etc.). */
345
- backgroundMap(): boolean
346
- backgroundMap(show: boolean): this
347
-
348
- /** Minimap configuration. */
349
- minimap(): any
350
- minimap(config: any): this
351
-
352
- /**
353
- * Show/hide inset map toggle button.
354
- * When enabled and no insets are configured, the map automatically uses insets('default').
355
- */
356
- insetsButton(): boolean
357
- insetsButton(show: boolean): this
358
-
359
- /** Show/hide legend toggle button. */
360
- legendButton(): boolean
361
- legendButton(show: boolean): this
362
-
363
- /** Filter function for placename labels. */
364
- placenamesFilter(): ((name: any) => boolean) | undefined
365
- placenamesFilter(fn: (name: any) => boolean): this
366
-
367
- /** Use a separate header section for titles. */
368
- header(): boolean
369
- header(show: boolean): this
370
-
371
- /** Use a separate footer section for footnotes. */
372
- footer(): boolean
373
- footer(show: boolean): this
374
-
375
- /** Padding between the map and footer in pixels. */
376
- footerPadding(): number | undefined
377
- footerPadding(padding: number): this
378
-
379
- /** Padding between the header and map in pixels. */
380
- headerPadding(): number | undefined
381
- headerPadding(padding: number): this
382
-
383
- /** Position adjustment for map title: [x, y] */
384
- titlePosition(): [number, number] | undefined
385
- titlePosition(pos: [number, number]): this
386
-
387
- /** Position adjustment for map subtitle: [x, y] */
388
- subtitlePosition(): [number, number] | undefined
389
- subtitlePosition(pos: [number, number]): this
390
-
391
- /** Position adjustment for footnote text: [x, y] */
392
- footnotePosition(): [number, number] | undefined
393
- footnotePosition(pos: [number, number]): this
394
-
395
- /** Position adjustment for Eurostat logo: [x, y] */
396
- logoPosition(): [number, number] | undefined
397
- logoPosition(pos: [number, number]): this
398
-
399
- /** Position adjustment for ribbon banner: [x, y] */
400
- ribbonPosition(): [number, number] | undefined
401
- ribbonPosition(pos: [number, number]): this
402
-
403
- /** Position adjustment for zoom buttons: [x, y] */
404
- zoomButtonsPosition(): [number, number] | undefined
405
- zoomButtonsPosition(pos: [number, number]): this
406
-
407
- /** Position adjustment for insets button: [x, y] */
408
- insetsButtonPosition(): [number, number] | undefined
409
- insetsButtonPosition(pos: [number, number]): this
410
-
411
- /** Position adjustment for legend button: [x, y] */
412
- legendButtonPosition(): [number, number] | undefined
413
- legendButtonPosition(pos: [number, number]): this
414
-
415
- /** Pointer hover color for NUTS regions. */
416
- hoverColor(): string
417
- hoverColor(color: string): this
418
-
419
- /** Base fill color for regions with no statistical data. */
420
- noDataFillStyle(): string
421
- noDataFillStyle(style: string): this
422
-
423
- /** Show the link to the remote Eurostat statistical dataset. */
424
- showSourceLink(): boolean
425
- showSourceLink(show: boolean): this
426
-
427
- /** Pattern fill configurations. */
428
- patternFill(): any
429
- patternFill(config: any): this
430
-
431
- /** Dorling. */
432
-
433
- /** Enable Dorling cartogram layout for proportional symbol maps. */
434
- dorling(): boolean
435
- dorling(enable: boolean): this
436
-
437
- /** Dorling simulation settings. */
438
- dorlingSettings(): DorlingSettings
439
- dorlingSettings(settings: Partial<DorlingSettings>): this
440
-
441
- /** Events. */
442
-
443
- /** Called when the user finishes a zoom gesture. */
444
- onZoomEnd(): ((event: any) => void) | undefined
445
- onZoomEnd(fn: (event: any) => void): this
446
-
447
- /** Called continuously while the user is zooming. */
448
- onZoom(): ((event: any) => void) | undefined
449
- onZoom(fn: (event: any) => void): this
450
-
451
- /** Called when the pointer enters a NUTS region. */
452
- onRegionMouseOver(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
453
- onRegionMouseOver(fn: (event: MouseEvent, regionId: string, props: any) => void): this
454
-
455
- /** Called when the pointer moves over a NUTS region. */
456
- onRegionMouseMove(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
457
- onRegionMouseMove(fn: (event: MouseEvent, regionId: string, props: any) => void): this
458
-
459
- /** Called when the pointer leaves a NUTS region. */
460
- onRegionMouseOut(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
461
- onRegionMouseOut(fn: (event: MouseEvent, regionId: string, props: any) => void): this
462
-
463
- /** Called when a NUTS region is clicked. */
464
- onRegionClick(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
465
- onRegionClick(fn: (event: MouseEvent, regionId: string, props: any) => void): this
466
-
467
- /**
468
- * Callback fired once after the map has fully built (geo + stat data loaded).
469
- * Receives the map instance as its only argument.
470
- * @example map.onBuild(m => console.log('Map ready', m))
471
- */
472
- onBuild(): ((map: MapInstance) => void) | undefined
473
- onBuild(callback: (map: MapInstance) => void): this
474
-
475
- /** Build and update. */
476
-
477
- /**
478
- * Builds the map from scratch. Call once after initial configuration.
479
- * @example
480
- * eurostatmap.map('choropleth')
481
- * .stat({ eurostatDatasetCode: 'demo_r_d3dens' })
482
- * .build()
483
- */
484
- build(): this
485
-
486
- /** Re-fetches geo data and rebuilds map geometry. */
487
- updateGeoData(): this
488
-
489
- /** Re-fetches all stat datasets and refreshes the map. */
490
- updateStatData(): this
491
-
492
- /** Re-applies classification and styling from currently loaded data. */
493
- updateStatValues(): this
494
-
495
- /** Updates data classification (class breaks, thresholds). */
496
- updateClassification(): this
497
-
498
- /** Re-applies visual styling (colors, symbol sizes). */
499
- updateStyle(): this
500
-
501
- /** Recalculates header/footer layout and resizes the SVG. */
502
- recalculateLayout(): void
503
-
504
- /** Export. */
505
-
506
- /**
507
- * Exports the map as an SVG file and triggers a browser download.
508
- * Computed CSS styles are inlined before export.
509
- */
510
- exportMapToSVG(): this
511
-
512
- /**
513
- * Exports the map as a PNG file and triggers a browser download.
514
- * @param width - Output width in pixels. Defaults to SVG width.
515
- * @param height - Output height in pixels. Defaults to SVG height.
516
- */
517
- exportMapToPNG(width?: number, height?: number): Promise<this>
518
-
519
- /** Misc. */
520
-
521
- /**
522
- * Sets map attributes from URL parameters.
523
- * Supported params: w, h, x, y, z, s, lvl, time, proj, geo, ny, language, numberOfClasses
524
- */
525
- setFromURL(): this
526
-
527
- /** D3 transition duration in milliseconds for map updates. @default 500 */
528
- transitionDuration(): number
529
- transitionDuration(ms: number): this
530
-
531
- /** SVG filter/pattern definition function for fill patterns. */
532
- filtersDefinitionFunction(): ((svg: any, numberOfClasses: number) => void) | undefined
533
- filtersDefinitionFunction(fn: (svg: any, numberOfClasses: number) => void): this
534
-
535
- /** Returns region centroids as an array of projected coordinate pairs. */
536
- regionCentroids(): Array<{ id: string; x: number; y: number }>
537
-
538
- /** Ordered thematic layer stack (bottom → top). */
539
- layers_: Layer[]
540
- activeLayerIndex_: number
541
-
542
- activeLayer(): Layer
543
- layer(ref?: number | string): Layer | undefined
544
- layers(): Layer[]
545
- layers(configs: LayerConfig[]): this
546
- addLayer(type: string, config?: LayerConfig): Layer
547
- addLayer(config: LayerConfig): Layer
548
- removeLayer(ref: number | string): this
549
- activeLayerIndex(): number
550
- activeLayerIndex(i: number): this
551
- updateAllLayers(): this
552
-
553
- /** Allow additional map-type-specific properties and methods. */
554
- [key: string]: any
555
- }
1
+ import type { StatConfig } from './stat/StatConfig'
2
+ import type { StatData } from './stat/StatData'
3
+ import type { Layer } from './layer/Layer'
4
+ import type { LayerConfig } from './layer/LayerConfig'
5
+ import type { CompositionStatConfig } from '../layers/composition/CompositionStatConfig'
6
+ import type { LegendConfig } from '../legend/LegendConfig'
7
+ import type { RankedBarChartConfig } from './decoration/RankedBarChartConfig'
8
+ import type { TooltipConfig } from './TooltipConfig'
9
+ import type { InsetConfig } from './InsetConfig'
10
+ import type { CoastalMarginSettings } from './decoration/CoastalMarginSettings'
11
+ import type { GridCartogramSettings } from './GridCartogramSettings'
12
+ import type { DorlingSettings } from './DorlingSettings'
13
+ import type { ScalebarConfig } from './decoration/ScalebarConfig'
14
+ import type { EncodingConfig } from './encoding/EncodingConfig'
15
+ import type { LocationConfig } from './locations'
16
+ import type { LabelsConfig } from './decoration/LabelsConfig'
17
+ import type { PatternFillConfig } from './decoration/PatternFillConfig'
18
+ import type { MinimapConfig } from './minimaps'
19
+ import type { StampConfig } from './decoration/StampConfig'
20
+
21
+ /**
22
+ * A eurostat-map instance. Created by eurostatmap.map() and extended
23
+ * by each concrete map type. All getter/setter methods follow the same
24
+ * pattern: call with no argument to get, call with a value to set and
25
+ * return the instance for chaining.
26
+ */
27
+ export interface MapInstance {
28
+ /** Container. */
29
+
30
+ /** ID of the target SVG element. @default 'map' */
31
+ svgId(): string
32
+ svgId(id: string): this
33
+
34
+ /** ID of the wrapper container element. */
35
+ containerId(): string
36
+ containerId(id: string): this
37
+
38
+ /** Dimensions. */
39
+
40
+ /** Map width in pixels. @default min(795, window.innerWidth) */
41
+ width(): number
42
+ width(w: number): this
43
+
44
+ /** Map height in pixels. 0 = auto (85% of width). */
45
+ height(): number
46
+ height(h: number): this
47
+
48
+ /** Geography. */
49
+
50
+ /**
51
+ * NUTS2JSON geographic focus area.
52
+ * @example 'EUR' | 'WORLD' | 'PT' | 'MT' | 'IC'
53
+ */
54
+ geo(): string
55
+ geo(g: string): this
56
+
57
+ /**
58
+ * EPSG projection code for NUTS2JSON geometries.
59
+ * Use '4326' when setting a custom projectionFunction.
60
+ * @default '3035'
61
+ */
62
+ proj(): string
63
+ proj(p: string): this
64
+
65
+ /**
66
+ * NUTS2JSON geometry resolution.
67
+ * @default '20M'
68
+ */
69
+ scale(): string
70
+ scale(s: '60M' | '20M' | '10M' | '03M' | '01M'): this
71
+
72
+ /** NUTS level to display. @default 3 */
73
+ nutsLevel(): number | 'mixed'
74
+ nutsLevel(level: number | 'mixed'): this
75
+
76
+ /** NUTS boundaries year. @default 2024 */
77
+ nutsYear(): number
78
+ nutsYear(year: number): this
79
+
80
+ /**
81
+ * Initial map viewport. x/y in projected coordinates, z is pixel size
82
+ * (map units per screen pixel — smaller = more zoomed in).
83
+ * @example map.position({ x: 4800000, y: 3400000, z: 6000 })
84
+ */
85
+ position(v: { x?: number; y?: number; z?: number }): this
86
+ position(): { x: number; y: number; z: number }
87
+
88
+ /**
89
+ * Custom D3 projection function. When set, also call proj('4326').
90
+ * @example map.projectionFunction(d3.geoAzimuthalEquidistant().rotate([-10, -52]))
91
+ */
92
+ projectionFunction(): any
93
+ projectionFunction(fn: any): this
94
+
95
+ /** Text and labels. */
96
+
97
+ /** Map title. */
98
+ title(): string
99
+ title(t: string): this
100
+
101
+ /** Map subtitle. */
102
+ subtitle(): string
103
+ subtitle(t: string): this
104
+
105
+ /**
106
+ * Footnote text shown at the bottom of the map.
107
+ * Defaults to the standard EuroGeographics copyright notice.
108
+ */
109
+ footnote(): string | false
110
+ footnote(text: string | false): this
111
+
112
+ /** Tooltip text shown when hovering over the footnote. */
113
+ footnoteTooltipText(): string | false
114
+ footnoteTooltipText(text: string | false): this
115
+
116
+ /** Wrap footnote text at this many characters. */
117
+ footnoteWrap(): number | false
118
+ footnoteWrap(chars: number | false): this
119
+
120
+ /** Statistical data. */
121
+
122
+ /**
123
+ * Get or set statistical data configuration.
124
+ * - `map.stat()` → returns the default stat config
125
+ * - `map.stat(config)` → sets the default stat config
126
+ * - `map.stat('v1')` → returns the stat config for key 'v1'
127
+ * - `map.stat('v1', config)` → sets the stat config for key 'v1'
128
+ * @example map.stat({ eurostatDatasetCode: 'demo_r_d3dens', filters: { TIME: '2024' } })
129
+ */
130
+ stat(): StatConfig | CompositionStatConfig | undefined
131
+ stat(config: StatConfig | CompositionStatConfig): this
132
+ stat(key: string): StatConfig | CompositionStatConfig | undefined
133
+ stat(key: string, config: StatConfig | CompositionStatConfig): this
134
+ /**
135
+ * Legacy compatibility overload for composition channels.
136
+ * Preferred: pass category fields directly inside config.
137
+ */
138
+ stat(
139
+ key: string,
140
+ config: StatConfig | CompositionStatConfig,
141
+ categoryParameter: string,
142
+ categoryCodes?: string[],
143
+ categoryLabels?: string[],
144
+ categoryColors?: string[],
145
+ totalCode?: string
146
+ ): this
147
+
148
+ /**
149
+ * Get or set visual encodings that map named stats to visual variables.
150
+ * @example map.encoding('size', { stat: 'population', scale: 'sqrt', range: [4, 30] })
151
+ */
152
+ encoding(): Record<string, EncodingConfig>
153
+ encoding(channel: string): EncodingConfig | undefined
154
+ encoding(channel: string, config: EncodingConfig): this
155
+ encoding(configs: Record<string, EncodingConfig>): this
156
+
157
+ /** Returns the stat name for an encoding channel, or fallback when unset. */
158
+ getEncodingStat(channel: string, fallback?: string): string | undefined
159
+
160
+ /** Returns stat names for an encoding channel (`stats` or single `stat`). */
161
+ getEncodingStats(channel: string, fallback?: string[]): string[] | undefined
162
+
163
+ /** Returns the concrete statData key for a channel/category combination. */
164
+ getEncodingStatKey(channel: string, categoryCode?: string, fallbackStat?: string): string | undefined
165
+
166
+ /** Returns the StatData source bound to a channel/category. */
167
+ getEncodingStatData(channel: string, categoryCode?: string, fallbackStat?: string): StatData | undefined
168
+
169
+ /** Returns a region value through encoding lookup. */
170
+ getEncodingValue(channel: string, regionId: string, categoryCode?: string, fallbackStat?: string): number | string | undefined
171
+
172
+ /** Returns unit text through encoding lookup. */
173
+ getEncodingUnitText(channel: string, categoryCode?: string, fallbackStat?: string): string
174
+
175
+ /**
176
+ * Get or set the StatData instance for a given key.
177
+ * Use setData() on the returned instance to supply custom data.
178
+ * @example map.statData().setData({ DE: 120, FR: 95 })
179
+ */
180
+ statData(): StatData
181
+ statData(key: string): StatData
182
+ statData(key: string, data: StatData): this
183
+
184
+ /**
185
+ * Returns the time dimension value from the loaded Eurostat dataset.
186
+ * Useful for displaying the data period in the map title.
187
+ * @example map.onBuild(() => map.title('Population ' + map.getTime()))
188
+ */
189
+ getTime(): string | undefined
190
+
191
+ /** Text shown for regions with no data. @default 'No data available' */
192
+ noDataText(): string
193
+ noDataText(text: string): this
194
+
195
+ /** BCP 47 language tag for Eurostat API labels. @default 'en' */
196
+ language(): string
197
+ language(lang: string): this
198
+
199
+ /** Legend. */
200
+
201
+ /**
202
+ * Get or set legend configuration. Pass false to remove the legend.
203
+ * @example map.legend({ x: 10, y: 90, title: 'Density, people/km²' })
204
+ */
205
+ legend(): LegendConfig | false
206
+ legend(config: LegendConfig | false): this
207
+
208
+ /** Force-update the legend after data or style changes. */
209
+ updateLegend(): this
210
+
211
+ /** Ranked bar chart. */
212
+
213
+ /**
214
+ * Get or set ranked bar chart configuration (choropleth-classified map types only). Pass
215
+ * false to remove it. Independent of the legend - has its own positioning and can render
216
+ * into an entirely different container/SVG to the legend's.
217
+ * @example map.rankedBarChart({ svgId: 'my-bar-chart-container' })
218
+ */
219
+ rankedBarChart(): RankedBarChartConfig | false
220
+ rankedBarChart(config: RankedBarChartConfig | false): this
221
+
222
+ /** Force-update the ranked bar chart after data or style changes. */
223
+ updateRankedBarChart(): this
224
+
225
+ /** Tooltip. */
226
+
227
+ /** Get or set tooltip configuration. */
228
+ tooltip(): TooltipConfig
229
+ tooltip(config: TooltipConfig): this
230
+
231
+ /** Zoom and pan. */
232
+
233
+ /**
234
+ * D3 zoom scale extent [min, max].
235
+ * @example map.zoomExtent([1, 10])
236
+ */
237
+ zoomExtent(): [number, number]
238
+ zoomExtent(extent: [number, number]): this
239
+
240
+ /** Show zoom +/- buttons. @default true */
241
+ zoomButtons(): boolean
242
+ zoomButtons(show: boolean): this
243
+
244
+ /** D3 zoom translate extent (pan boundaries), as [[x0, y0], [x1, y1]]. */
245
+ translateExtent(): [[number, number], [number, number]] | undefined
246
+ translateExtent(extent: [[number, number], [number, number]]): this
247
+
248
+ /** If true, panning is disabled until the user has zoomed at least once. @default true */
249
+ lockPanUntilZoom(): boolean
250
+ lockPanUntilZoom(lock: boolean): this
251
+
252
+ /** Grid cartogram settings (shape, margins, cell padding, layout positions). */
253
+ gridCartogramSettings(): GridCartogramSettings
254
+ gridCartogramSettings(settings: Partial<GridCartogramSettings>): this
255
+
256
+ /** Insets. */
257
+
258
+ /**
259
+ * Inset map configurations. Pass a named preset string, or a custom array, or false to
260
+ * disable. Passing true is an alias for 'default'.
261
+ * - 'default': simple grid layout of overseas territories.
262
+ * - 'image': Malta, Liechtenstein and EU/EFTA overseas/remote territories, hand-tuned
263
+ * layout with connecting decoration (background box, separator lines, blur gradients).
264
+ * - 'eu': simple grid layout of EU overseas/outermost territories, no decoration.
265
+ * - 'euEfta': like 'eu', plus Liechtenstein and Svalbard, no decoration.
266
+ * @example map.insets('default')
267
+ * @example map.insets('image')
268
+ * @example map.insets(true)
269
+ * @example map.insets([{ geo: 'MT' }, { geo: 'LI' }])
270
+ */
271
+ insets(): InsetConfig[] | 'default' | 'image' | 'eu' | 'euEfta' | false
272
+ insets(config: InsetConfig[] | 'default' | 'image' | 'eu' | 'euEfta' | true | false): this
273
+
274
+ /** Position [x, y] of the box containing the default/named-preset insets layout. */
275
+ insetBoxPosition(): [number, number] | undefined
276
+ insetBoxPosition(pos: [number, number]): this
277
+
278
+ /** Padding in pixels around/between insets in the default insets box layout. @default 5 */
279
+ insetBoxPadding(): number
280
+ insetBoxPadding(px: number): this
281
+
282
+ /** Width in pixels of each inset in the default insets box layout. @default 210 */
283
+ insetBoxWidth(): number
284
+ insetBoxWidth(px: number): this
285
+
286
+ /** Default NUTS2JSON scale used for insets that don't specify their own. @default '03M' */
287
+ insetScale(): string
288
+ insetScale(scale: string): this
289
+
290
+ /** Default D3 zoom scale extent for insets. `null` disables zoom on insets. */
291
+ insetZoomExtent(): [number, number] | null
292
+ insetZoomExtent(extent: [number, number] | null): this
293
+
294
+ /** Decoration. */
295
+
296
+ /** Show/hide the graticule (coordinate grid lines). */
297
+ drawGraticule(): boolean
298
+ drawGraticule(show: boolean): this
299
+
300
+ /** Show/hide the coastal margin shadow effect. */
301
+ drawCoastalMargin(): boolean
302
+ drawCoastalMargin(show: boolean): this
303
+
304
+ /** Coastal margin appearance settings. */
305
+ coastalMarginSettings(): CoastalMarginSettings
306
+ coastalMarginSettings(settings: Partial<CoastalMarginSettings>): this
307
+
308
+ /** Show/hide placename labels loaded from the placenames layer. */
309
+ placenames(): boolean
310
+ placenames(show: boolean): this
311
+
312
+ /**
313
+ * Get or set label configuration for country names, statistical values, etc.
314
+ * @example map.labels({ values: true, backgrounds: true, backgroundFill: '#B19122', statLabelTextColor: '#fff', backgroundPadding: { x: 6, y: 3 }, backgroundBorderRadius: 4 })
315
+ */
316
+ labels(): LabelsConfig | undefined
317
+ labels(config: LabelsConfig): this
318
+
319
+ /**
320
+ * Annotation configuration, rendered via the d3-svg-annotation library.
321
+ * `annotations` is an array of d3-svg-annotation annotation objects; each object's `type`
322
+ * may be one of 'annotationLabel' (default), 'annotationCallout', 'annotationCalloutRect',
323
+ * 'annotationCalloutCircle', 'annotationXYThreshold', resolved to the matching d3-svg-annotation
324
+ * function internally.
325
+ */
326
+ annotations(): { annotations: any[]; editMode?: boolean } | undefined
327
+ annotations(config: { annotations: any[]; editMode?: boolean }): this
328
+
329
+ /** Stamp/watermark annotation. @example { x: 10, y: 10, text: 'DRAFT', size: 40 } */
330
+ stamp(): StampConfig | undefined
331
+ stamp(config: StampConfig): this
332
+
333
+ /** Scalebar configuration. */
334
+ scalebar(): ScalebarConfig | null
335
+ scalebar(config: ScalebarConfig | boolean): this
336
+
337
+ /** Scalebar visibility. */
338
+ showScalebar(): boolean
339
+ showScalebar(show: boolean): this
340
+
341
+ /** Scalebar position [x, y] in pixels. */
342
+ scalebarPosition(): [number, number]
343
+ scalebarPosition(pos: [number, number]): this
344
+
345
+ /** Show the Eurostat logo. */
346
+ showEstatLogo(): boolean
347
+ showEstatLogo(show: boolean): this
348
+
349
+ /** Width in pixels of the Eurostat logo. @default 200 */
350
+ logoWidth(): number | undefined
351
+ logoWidth(px: number): this
352
+
353
+ /** Height in pixels of the Eurostat logo. @default 40 */
354
+ logoHeight(): number | undefined
355
+ logoHeight(px: number): this
356
+
357
+ /** Show the Eurostat ribbon banner. */
358
+ showEstatRibbon(): boolean
359
+ showEstatRibbon(show: boolean): this
360
+
361
+ /** Width in pixels of the Eurostat ribbon banner. @default 200 */
362
+ ribbonWidth(): number | undefined
363
+ ribbonWidth(px: number): this
364
+
365
+ /** Height in pixels of the Eurostat ribbon banner. @default 40 */
366
+ ribbonHeight(): number | undefined
367
+ ribbonHeight(px: number): this
368
+
369
+ /** Returns the D3 selection of the SVG element. */
370
+ svg(): any
371
+ svg(s: any): this
372
+
373
+ /** Add or replace a custom point location marker. */
374
+ addLocation(config: LocationConfig): this
375
+
376
+ /** Remove a custom point location marker by id. */
377
+ removeLocation(id: string): this
378
+
379
+ /** Remove all custom point location markers. */
380
+ clearLocations(): this
381
+
382
+ /** Get or replace all custom point location markers. */
383
+ locations(): LocationConfig[]
384
+ locations(configs: LocationConfig[] | null | undefined): this
385
+
386
+ /** Redraw custom point location markers. */
387
+ updateLocations(): this
388
+
389
+ /** Custom geometry filtering function. */
390
+ filterGeometriesFunction(): ((geometry: any) => boolean) | undefined
391
+ filterGeometriesFunction(fn: (geometry: any) => boolean): this
392
+
393
+ /** Grid cartogram enabled or disabled. */
394
+ gridCartogram(): boolean
395
+ gridCartogram(enable: boolean): this
396
+
397
+ /** Toggle background map rendering (sea, country boundaries, etc.). */
398
+ backgroundMap(): boolean
399
+ backgroundMap(show: boolean): this
400
+
401
+ /** Minimap (globe inset showing current viewport) configuration. */
402
+ minimap(): MinimapConfig | undefined
403
+ minimap(config: MinimapConfig): this
404
+
405
+ /**
406
+ * Show/hide inset map toggle button.
407
+ * When enabled and no insets are configured, the map automatically uses insets('default').
408
+ */
409
+ insetsButton(): boolean
410
+ insetsButton(show: boolean): this
411
+
412
+ /** Show/hide legend toggle button. */
413
+ legendButton(): boolean
414
+ legendButton(show: boolean): this
415
+
416
+ /** Filter function for placename labels. */
417
+ placenamesFilter(): ((name: any) => boolean) | undefined
418
+ placenamesFilter(fn: (name: any) => boolean): this
419
+
420
+ /** Use a separate header section for titles. */
421
+ header(): boolean
422
+ header(show: boolean): this
423
+
424
+ /** Use a separate footer section for footnotes. */
425
+ footer(): boolean
426
+ footer(show: boolean): this
427
+
428
+ /** Padding between the map and footer in pixels. */
429
+ footerPadding(): number | undefined
430
+ footerPadding(padding: number): this
431
+
432
+ /** Padding between the header and map in pixels. */
433
+ headerPadding(): number | undefined
434
+ headerPadding(padding: number): this
435
+
436
+ /** Position adjustment for map title: [x, y] */
437
+ titlePosition(): [number, number] | undefined
438
+ titlePosition(pos: [number, number]): this
439
+
440
+ /** Position adjustment for map subtitle: [x, y] */
441
+ subtitlePosition(): [number, number] | undefined
442
+ subtitlePosition(pos: [number, number]): this
443
+
444
+ /** Position adjustment for footnote text: [x, y] */
445
+ footnotePosition(): [number, number] | undefined
446
+ footnotePosition(pos: [number, number]): this
447
+
448
+ /** Position adjustment for Eurostat logo: [x, y] */
449
+ logoPosition(): [number, number] | undefined
450
+ logoPosition(pos: [number, number]): this
451
+
452
+ /** Position adjustment for ribbon banner: [x, y] */
453
+ ribbonPosition(): [number, number] | undefined
454
+ ribbonPosition(pos: [number, number]): this
455
+
456
+ /** Position adjustment for zoom buttons: [x, y] */
457
+ zoomButtonsPosition(): [number, number] | undefined
458
+ zoomButtonsPosition(pos: [number, number]): this
459
+
460
+ /** Position adjustment for insets button: [x, y] */
461
+ insetsButtonPosition(): [number, number] | undefined
462
+ insetsButtonPosition(pos: [number, number]): this
463
+
464
+ /**
465
+ * Viewport width (px) at/below which insets start hidden (behind the insets button) unless
466
+ * insetsButton was set explicitly. @default 768
467
+ */
468
+ insetsVisibilityBreakpoint(): number
469
+ insetsVisibilityBreakpoint(px: number): this
470
+
471
+ /** Position adjustment for legend button: [x, y] */
472
+ legendButtonPosition(): [number, number] | undefined
473
+ legendButtonPosition(pos: [number, number]): this
474
+
475
+ /**
476
+ * Viewport width (px) at/below which the legend starts hidden (behind the legend button)
477
+ * when legendButton is enabled. @default 768
478
+ */
479
+ legendVisibilityBreakpoint(): number
480
+ legendVisibilityBreakpoint(px: number): this
481
+
482
+ /** Pointer hover color for NUTS regions. */
483
+ hoverColor(): string
484
+ hoverColor(color: string): this
485
+
486
+ /** Base fill color for regions with no statistical data. */
487
+ noDataFillStyle(): string
488
+ noDataFillStyle(style: string): this
489
+
490
+ /** Show the link to the remote Eurostat statistical dataset. */
491
+ showSourceLink(): boolean
492
+ showSourceLink(show: boolean): this
493
+
494
+ /** Pattern fill (hatching/dots/crosshatch) overlays for specific regions. */
495
+ patternFill(): PatternFillConfig | PatternFillConfig[] | undefined
496
+ patternFill(config: PatternFillConfig | PatternFillConfig[]): this
497
+
498
+ /** Dorling. */
499
+
500
+ /** Enable Dorling cartogram layout for proportional symbol maps. */
501
+ dorling(): boolean
502
+ dorling(enable: boolean): this
503
+
504
+ /** Dorling simulation settings. */
505
+ dorlingSettings(): DorlingSettings
506
+ dorlingSettings(settings: Partial<DorlingSettings>): this
507
+
508
+ /** Events. */
509
+
510
+ /** Called when the user finishes a zoom gesture. */
511
+ onZoomEnd(): ((event: any) => void) | undefined
512
+ onZoomEnd(fn: (event: any) => void): this
513
+
514
+ /** Called continuously while the user is zooming. */
515
+ onZoom(): ((event: any) => void) | undefined
516
+ onZoom(fn: (event: any) => void): this
517
+
518
+ /** Called when the pointer enters a NUTS region. */
519
+ onRegionMouseOver(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
520
+ onRegionMouseOver(fn: (event: MouseEvent, regionId: string, props: any) => void): this
521
+
522
+ /** Called when the pointer moves over a NUTS region. */
523
+ onRegionMouseMove(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
524
+ onRegionMouseMove(fn: (event: MouseEvent, regionId: string, props: any) => void): this
525
+
526
+ /** Called when the pointer leaves a NUTS region. */
527
+ onRegionMouseOut(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
528
+ onRegionMouseOut(fn: (event: MouseEvent, regionId: string, props: any) => void): this
529
+
530
+ /** Called when a NUTS region is clicked. */
531
+ onRegionClick(): ((event: MouseEvent, regionId: string, props: any) => void) | undefined
532
+ onRegionClick(fn: (event: MouseEvent, regionId: string, props: any) => void): this
533
+
534
+ /**
535
+ * Callback fired once after the map has fully built (geo + stat data loaded).
536
+ * Receives the map instance as its only argument.
537
+ * @example map.onBuild(m => console.log('Map ready', m))
538
+ */
539
+ onBuild(): ((map: MapInstance) => void) | undefined
540
+ onBuild(callback: (map: MapInstance) => void): this
541
+
542
+ /** Build and update. */
543
+
544
+ /**
545
+ * Builds the map from scratch. Call once after initial configuration.
546
+ * @example
547
+ * eurostatmap.map('choropleth')
548
+ * .stat({ eurostatDatasetCode: 'demo_r_d3dens' })
549
+ * .build()
550
+ */
551
+ build(): this
552
+
553
+ /** Re-fetches geo data and rebuilds map geometry. */
554
+ updateGeoData(): this
555
+
556
+ /** Re-fetches all stat datasets and refreshes the map. */
557
+ updateStatData(): this
558
+
559
+ /** Re-applies classification and styling from currently loaded data. */
560
+ updateStatValues(): this
561
+
562
+ /** Updates data classification (class breaks, thresholds). */
563
+ updateClassification(): this
564
+
565
+ /** Re-applies visual styling (colors, symbol sizes). */
566
+ updateStyle(): this
567
+
568
+ /** Recalculates header/footer layout and resizes the SVG. */
569
+ recalculateLayout(): void
570
+
571
+ /** Export. */
572
+
573
+ /**
574
+ * Exports the map as an SVG file and triggers a browser download.
575
+ * Computed CSS styles are inlined before export.
576
+ * @param filename - Download filename without extension. @default 'eurostatmap'
577
+ */
578
+ exportMapToSVG(filename?: string): this
579
+
580
+ /**
581
+ * Exports the map as a PNG file and triggers a browser download.
582
+ * @param width - Output width in pixels. Defaults to SVG width.
583
+ * @param height - Output height in pixels. Defaults to SVG height.
584
+ * @param filename - Download filename without extension. @default 'eurostatmap'
585
+ */
586
+ exportMapToPNG(width?: number, height?: number, filename?: string): Promise<this>
587
+
588
+ /** Misc. */
589
+
590
+ /**
591
+ * Sets map attributes from URL parameters.
592
+ * Supported params: w, h, x, y, z, s, lvl, time, proj, geo, ny, language, numberOfClasses
593
+ */
594
+ setFromURL(): this
595
+
596
+ /** D3 transition duration in milliseconds for map updates. @default 500 */
597
+ transitionDuration(): number
598
+ transitionDuration(ms: number): this
599
+
600
+ /** SVG filter/pattern definition function for fill patterns. */
601
+ filtersDefinitionFunction(): ((svg: any, numberOfClasses: number) => void) | undefined
602
+ filtersDefinitionFunction(fn: (svg: any, numberOfClasses: number) => void): this
603
+
604
+ /** Returns a Map of region id -> projected [x, y] centroid coordinate pair. */
605
+ regionCentroids(): Map<string, [number, number]>
606
+
607
+ /** Ordered thematic layer stack (bottom → top). */
608
+ layers_: Layer[]
609
+ activeLayerIndex_: number
610
+
611
+ activeLayer(): Layer
612
+ layer(ref?: number | string): Layer | undefined
613
+ layers(): Layer[]
614
+ layers(configs: LayerConfig[]): this
615
+ addLayer(type: string, config?: LayerConfig): Layer
616
+ addLayer(config: LayerConfig): Layer
617
+ removeLayer(ref: number | string): this
618
+ activeLayerIndex(): number
619
+ activeLayerIndex(i: number): this
620
+ updateAllLayers(): this
621
+
622
+ /** Allow additional map-type-specific properties and methods. */
623
+ [key: string]: any
624
+ }