eurostat-map 4.4.4 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +177 -148
  2. package/build/215.eurostatmap.min.js +1 -1
  3. package/build/eurostatmap.js +19934 -15872
  4. package/build/eurostatmap.min.js +2 -2
  5. package/build/eurostatmap.min.js.map +1 -1
  6. package/build/package.json +87 -87
  7. package/build/types/core/GridCartogramSettings.d.ts +33 -0
  8. package/build/types/core/MapConfig.d.ts +13 -2
  9. package/build/types/core/MapInstance.d.ts +80 -4
  10. package/build/types/core/encoding/EncodingConfig.d.ts +31 -0
  11. package/build/types/core/layer/Layer.d.ts +31 -0
  12. package/build/types/core/layer/LayerConfig.d.ts +19 -0
  13. package/build/types/core/layer/LayerRole.d.ts +1 -0
  14. package/build/types/core/locations.d.ts +44 -16
  15. package/build/types/core/stat/StatConfig.d.ts +7 -0
  16. package/build/types/index.d.ts +39 -33
  17. package/build/types/layers/CategoricalMap.d.ts +21 -0
  18. package/build/types/layers/CategoricalMapConfig.d.ts +11 -0
  19. package/build/types/layers/MapType.d.ts +34 -0
  20. package/build/types/layers/choropleth/BivariateChoroplethConfig.d.ts +27 -0
  21. package/build/types/layers/choropleth/BivariateChoroplethMap.d.ts +39 -0
  22. package/build/types/layers/choropleth/ChoroplethConfig.d.ts +39 -0
  23. package/build/types/layers/choropleth/ChoroplethMap.d.ts +48 -0
  24. package/build/types/layers/choropleth/TrivariateChoroplethConfig.d.ts +41 -0
  25. package/build/types/layers/choropleth/TrivariateChoroplethMap.d.ts +18 -0
  26. package/build/types/layers/choropleth/ValueByAlphaConfig.d.ts +8 -0
  27. package/build/types/layers/choropleth/ValueByAlphaMap.d.ts +9 -0
  28. package/build/types/layers/composition/CompositionStatConfig.d.ts +59 -0
  29. package/build/types/layers/composition/bar/BarMap.d.ts +97 -0
  30. package/build/types/layers/composition/bar/BarMapConfig.d.ts +76 -0
  31. package/build/types/layers/composition/coxcomb/CoxcombMap.d.ts +75 -0
  32. package/build/types/layers/composition/coxcomb/CoxcombMapConfig.d.ts +47 -0
  33. package/build/types/layers/composition/coxcomb/CoxcombStatConfig.d.ts +13 -0
  34. package/build/types/layers/composition/pie/PieMap.d.ts +84 -0
  35. package/build/types/layers/composition/pie/PieMapConfig.d.ts +50 -0
  36. package/build/types/layers/composition/stripe/StripeMap.d.ts +80 -0
  37. package/build/types/layers/composition/stripe/StripeMapConfig.d.ts +45 -0
  38. package/build/types/layers/composition/waffle/WaffleMap.d.ts +124 -0
  39. package/build/types/layers/composition/waffle/WaffleMapConfig.d.ts +58 -0
  40. package/build/types/layers/flow/FlowMap.d.ts +218 -0
  41. package/build/types/layers/flow/FlowMapConfig.d.ts +220 -0
  42. package/build/types/layers/proportional-symbol/ProportionalSymbolConfig.d.ts +47 -0
  43. package/build/types/layers/proportional-symbol/ProportionalSymbolMap.d.ts +94 -0
  44. package/build/types/layers/proportional-symbol/mushroom/MushroomMap.d.ts +67 -0
  45. package/build/types/layers/proportional-symbol/mushroom/MushroomMapConfig.d.ts +39 -0
  46. package/build/types/layers/spark/SparkMap.d.ts +56 -0
  47. package/build/types/layers/spark/SparkMapConfig.d.ts +75 -0
  48. package/build/types/layers/spark/SparkStatConfig.d.ts +33 -0
  49. package/build/types/legend/LegendConfig.d.ts +3 -0
  50. package/build/types/legend/choropleth/BivariateLegendConfig.d.ts +79 -0
  51. package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +25 -16
  52. package/build/types/map-types/choropleth/TrivariateChoroplethMap.d.ts +5 -2
  53. package/build/types/map-types/composition/CompositionStatConfig.d.ts +7 -0
  54. package/build/types/map-types/composition/bar/BarMap.d.ts +97 -79
  55. package/build/types/map-types/composition/bar/BarMapConfig.d.ts +76 -54
  56. package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +29 -0
  57. package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +15 -0
  58. package/build/types/map-types/composition/pie/PieMap.d.ts +5 -5
  59. package/build/types/map-types/composition/pie/PieMapConfig.d.ts +2 -0
  60. package/build/types/map-types/composition/stripe/StripeMap.d.ts +19 -2
  61. package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +11 -0
  62. package/build/types/map-types/composition/waffle/WaffleMap.d.ts +46 -0
  63. package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +24 -10
  64. package/build/types/map-types/flow/FlowMap.d.ts +121 -0
  65. package/build/types/map-types/flow/FlowMapConfig.d.ts +62 -0
  66. package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +30 -0
  67. package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +4 -0
  68. package/build/types/map-types/proportional-symbol/mushroom/MushroomMap.d.ts +37 -0
  69. package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +19 -0
  70. package/build/types/map-types/spark/SparkMap.d.ts +4 -0
  71. package/build/types/map-types/spark/SparkMapConfig.d.ts +32 -0
  72. package/package.json +6 -3
@@ -5,51 +5,51 @@
5
5
  // ==================== Core Type Imports (needed for local use in function signatures) ====================
6
6
 
7
7
  import type { MapConfig } from './core/MapConfig'
8
- import type { MapType } from './map-types/MapType'
8
+ import type { MapType } from './layers/MapType'
9
9
  import type { MapInstance } from './core/MapInstance'
10
10
 
11
11
  // Choropleth map types
12
- import type { ChoroplethConfig } from './map-types/choropleth/ChoroplethConfig'
13
- import type { ChoroplethMap } from './map-types/choropleth/ChoroplethMap'
14
- import type { ValueByAlphaConfig } from './map-types/choropleth/ValueByAlphaConfig'
15
- import type { ValueByAlphaMap } from './map-types/choropleth/ValueByAlphaMap'
16
- import type { BivariateChoroplethConfig } from './map-types/choropleth/BivariateChoroplethConfig'
17
- import type { BivariateChoroplethMap } from './map-types/choropleth/BivariateChoroplethMap'
18
- import type { TrivariateChoroplethConfig } from './map-types/choropleth/TrivariateChoroplethConfig'
19
- import type { TrivariateChoroplethMap } from './map-types/choropleth/TrivariateChoroplethMap'
12
+ import type { ChoroplethConfig } from './layers/choropleth/ChoroplethConfig'
13
+ import type { ChoroplethMap } from './layers/choropleth/ChoroplethMap'
14
+ import type { ValueByAlphaConfig } from './layers/choropleth/ValueByAlphaConfig'
15
+ import type { ValueByAlphaMap } from './layers/choropleth/ValueByAlphaMap'
16
+ import type { BivariateChoroplethConfig } from './layers/choropleth/BivariateChoroplethConfig'
17
+ import type { BivariateChoroplethMap } from './layers/choropleth/BivariateChoroplethMap'
18
+ import type { TrivariateChoroplethConfig, TrivariateTernarySettings } from './layers/choropleth/TrivariateChoroplethConfig'
19
+ import type { TrivariateChoroplethMap } from './layers/choropleth/TrivariateChoroplethMap'
20
20
 
21
21
  // Categorical map types
22
- import type { CategoricalMapConfig } from './map-types/CategoricalMapConfig'
23
- import type { CategoricalMap } from './map-types/CategoricalMap'
22
+ import type { CategoricalMapConfig } from './layers/CategoricalMapConfig'
23
+ import type { CategoricalMap } from './layers/CategoricalMap'
24
24
 
25
25
  // Proportional symbol map types
26
- import type { ProportionalSymbolConfig } from './map-types/proportional-symbol/ProportionalSymbolConfig'
27
- import type { ProportionalSymbolMap } from './map-types/proportional-symbol/ProportionalSymbolMap'
28
- import type { MushroomMapConfig } from './map-types/proportional-symbol/mushroom/MushroomMapConfig'
29
- import type { MushroomMap } from './map-types/proportional-symbol/mushroom/MushroomMap'
26
+ import type { ProportionalSymbolConfig } from './layers/proportional-symbol/ProportionalSymbolConfig'
27
+ import type { ProportionalSymbolMap } from './layers/proportional-symbol/ProportionalSymbolMap'
28
+ import type { MushroomMapConfig } from './layers/proportional-symbol/mushroom/MushroomMapConfig'
29
+ import type { MushroomMap } from './layers/proportional-symbol/mushroom/MushroomMap'
30
30
 
31
31
  // Composition map types
32
- import type { CompositionStatConfig } from './map-types/composition/CompositionStatConfig'
33
- import type { CoxcombMapConfig } from './map-types/composition/coxcomb/CoxcombMapConfig'
34
- import type { CoxcombMap } from './map-types/composition/coxcomb/CoxcombMap'
35
- import type { CoxcombStatConfig } from './map-types/composition/coxcomb/CoxcombStatConfig'
36
- import type { BarMapConfig } from './map-types/composition/bar/BarMapConfig'
37
- import type { BarMap } from './map-types/composition/bar/BarMap'
38
- import type { PieMapConfig } from './map-types/composition/pie/PieMapConfig'
39
- import type { PieMap } from './map-types/composition/pie/PieMap'
40
- import type { StripeMapConfig } from './map-types/composition/stripe/StripeMapConfig'
41
- import type { StripeMap } from './map-types/composition/stripe/StripeMap'
42
- import type { WaffleMapConfig } from './map-types/composition/waffle/WaffleMapConfig'
43
- import type { WaffleMap } from './map-types/composition/waffle/WaffleMap'
32
+ import type { CompositionStatConfig } from './layers/composition/CompositionStatConfig'
33
+ import type { CoxcombMapConfig } from './layers/composition/coxcomb/CoxcombMapConfig'
34
+ import type { CoxcombMap } from './layers/composition/coxcomb/CoxcombMap'
35
+ import type { CoxcombStatConfig } from './layers/composition/coxcomb/CoxcombStatConfig'
36
+ import type { BarMapConfig } from './layers/composition/bar/BarMapConfig'
37
+ import type { BarMap } from './layers/composition/bar/BarMap'
38
+ import type { PieMapConfig } from './layers/composition/pie/PieMapConfig'
39
+ import type { PieMap } from './layers/composition/pie/PieMap'
40
+ import type { StripeMapConfig } from './layers/composition/stripe/StripeMapConfig'
41
+ import type { StripeMap } from './layers/composition/stripe/StripeMap'
42
+ import type { WaffleMapConfig } from './layers/composition/waffle/WaffleMapConfig'
43
+ import type { WaffleMap } from './layers/composition/waffle/WaffleMap'
44
44
 
45
45
  // Spark map types
46
- import type { SparkMapConfig } from './map-types/spark/SparkMapConfig'
47
- import type { SparkMap } from './map-types/spark/SparkMap'
48
- import type { SparkStatConfig } from './map-types/spark/SparkStatConfig'
46
+ import type { SparkMapConfig } from './layers/spark/SparkMapConfig'
47
+ import type { SparkMap } from './layers/spark/SparkMap'
48
+ import type { SparkStatConfig } from './layers/spark/SparkStatConfig'
49
49
 
50
50
  // Flow map types
51
- import type { FlowMapConfig } from './map-types/flow/FlowMapConfig'
52
- import type { FlowMap } from './map-types/flow/FlowMap'
51
+ import type { FlowMapConfig } from './layers/flow/FlowMapConfig'
52
+ import type { FlowMap } from './layers/flow/FlowMap'
53
53
 
54
54
  // ==================== Core Type Exports ====================
55
55
 
@@ -58,6 +58,7 @@ export type EurostatMap = MapInstance
58
58
  export type { TooltipConfig } from './core/TooltipConfig'
59
59
  export type { LegendConfig } from './legend/LegendConfig'
60
60
  export type { StatConfig } from './core/stat/StatConfig'
61
+ export type { EncodingConfig } from './core/encoding/EncodingConfig'
61
62
  export type { StatData } from './core/stat/StatData'
62
63
  export type { InsetConfig } from './core/InsetConfig'
63
64
  export type { CoastalMarginSettings } from './core/decoration/CoastalMarginSettings'
@@ -68,6 +69,9 @@ export type { DorlingSettings, DorlingStrength } from './core/DorlingSettings'
68
69
  export type { MinimapConfig } from './core/minimaps'
69
70
  export type { LocationConfig } from './core/locations'
70
71
  export type { GeometriesClass } from './core/geo/geometries'
72
+ export type { Layer } from './core/layer/Layer'
73
+ export type { LayerConfig } from './core/layer/LayerConfig'
74
+ export type { LayerRole } from './core/layer/LayerRole'
71
75
 
72
76
  // ==================== Legend Configuration Type Exports ====================
73
77
 
@@ -122,6 +126,7 @@ export type {
122
126
  BivariateChoroplethConfig,
123
127
  BivariateChoroplethMap,
124
128
  TrivariateChoroplethConfig,
129
+ TrivariateTernarySettings,
125
130
  TrivariateChoroplethMap,
126
131
  }
127
132
 
@@ -159,7 +164,7 @@ export type {
159
164
  FlowCurvatureSettings,
160
165
  FlowWidthGradientSettings,
161
166
  FlowBundleSettings,
162
- } from './map-types/flow/FlowMapConfig'
167
+ } from './layers/flow/FlowMapConfig'
163
168
 
164
169
  // ==================== Pattern Fill Options ====================
165
170
 
@@ -201,6 +206,7 @@ export interface FillPatternOptions {
201
206
  * map.build();
202
207
  * ```
203
208
  */
209
+ export function map(): MapInstance
204
210
  export function map(type: 'choropleth' | 'ch', config?: ChoroplethConfig): ChoroplethMap
205
211
  export function map(type: 'proportionalSymbol' | 'proportionalSymbols' | 'ps', config?: ProportionalSymbolConfig): ProportionalSymbolMap
206
212
  export function map(type: 'categorical' | 'ct', config?: CategoricalMapConfig): CategoricalMap
@@ -0,0 +1,21 @@
1
+ import type { MapInstance } from '../core/MapInstance'
2
+
3
+ /**
4
+ * Categorical map type.
5
+ */
6
+ export interface CategoricalMap extends MapInstance {
7
+ classToFillStyle(): any
8
+ classToFillStyle(v: any): this
9
+
10
+ classToText(): any
11
+ classToText(v: any): this
12
+
13
+ noDataFillStyle(): string
14
+ noDataFillStyle(v: string): this
15
+
16
+ tooltipText(): any
17
+ tooltipText(v: any): this
18
+
19
+ classifier(): any
20
+ classifier(v: any): this
21
+ }
@@ -0,0 +1,11 @@
1
+ import type { MapConfig } from '../core/MapConfig'
2
+
3
+ /**
4
+ * Configuration for categorical map
5
+ */
6
+ export interface CategoricalMapConfig extends MapConfig {
7
+ /** Category-to-color mapping */
8
+ classToFillStyle?: Record<string, string>
9
+ /** Fill style for regions with no data */
10
+ noDataFillStyle?: string
11
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * All supported map types
3
+ */
4
+ export type MapType =
5
+ | 'choropleth'
6
+ | 'ch'
7
+ | 'proportionalSymbol'
8
+ | 'proportionalSymbols'
9
+ | 'ps'
10
+ | 'categorical'
11
+ | 'ct'
12
+ | 'bivariateChoropleth'
13
+ | 'chbi'
14
+ | 'trivariateChoropleth'
15
+ | 'ternary'
16
+ | 'chtri'
17
+ | 'stripeComposition'
18
+ | 'scomp'
19
+ | 'stripe'
20
+ | 'pieChart'
21
+ | 'pie'
22
+ | 'sparkline'
23
+ | 'spark'
24
+ | 'sparklines'
25
+ | 'flow'
26
+ | 'flowmap'
27
+ | 'coxcomb'
28
+ | 'polar'
29
+ | 'alpha'
30
+ | 'valueByAlpha'
31
+ | 'mushroom'
32
+ | 'waffle'
33
+ | 'bar'
34
+ | 'barComposition'
@@ -0,0 +1,27 @@
1
+ import type { MapConfig } from '../../core/MapConfig'
2
+ import type { BivariateLegendConfig } from '../../legend/choropleth/BivariateLegendConfig'
3
+
4
+ /**
5
+ * Configuration for bivariate choropleth maps.
6
+ */
7
+ export interface BivariateChoroplethConfig extends MapConfig {
8
+ /** Bivariate choropleth legend configuration. */
9
+ legend?: BivariateLegendConfig | false
10
+
11
+ /** Number of classes. */
12
+ numberOfClasses?: number
13
+ /** Breaks1. */
14
+ breaks1?: number[]
15
+ /** Breaks2. */
16
+ breaks2?: number[]
17
+ /** Start color. */
18
+ startColor?: string
19
+ /** Color1. */
20
+ color1?: string
21
+ /** Color2. */
22
+ color2?: string
23
+ /** End color. */
24
+ endColor?: string
25
+ /** No data fill style. */
26
+ noDataFillStyle?: string
27
+ }
@@ -0,0 +1,39 @@
1
+ import type { MapInstance } from '../../core/MapInstance'
2
+
3
+ /**
4
+ * Bivariate choropleth map type.
5
+ */
6
+ export interface BivariateChoroplethMap extends MapInstance {
7
+ numberOfClasses(): number
8
+ numberOfClasses(v: number): this
9
+
10
+ breaks1(): number[] | undefined
11
+ breaks1(v: number[] | undefined): this
12
+
13
+ breaks2(): number[] | undefined
14
+ breaks2(v: number[] | undefined): this
15
+
16
+ startColor(): string
17
+ startColor(v: string): this
18
+
19
+ color1(): string
20
+ color1(v: string): this
21
+
22
+ color2(): string
23
+ color2(v: string): this
24
+
25
+ endColor(): string
26
+ endColor(v: string): this
27
+
28
+ classToFillStyle(): any
29
+ classToFillStyle(v: any): this
30
+
31
+ noDataFillStyle(): string
32
+ noDataFillStyle(v: string): this
33
+
34
+ classifier1(): any
35
+ classifier1(v: any): this
36
+
37
+ classifier2(): any
38
+ classifier2(v: any): this
39
+ }
@@ -0,0 +1,39 @@
1
+ import { MapConfig } from '../../core/MapConfig'
2
+ import type { ChoroplethLegendConfig } from '../../legend/choropleth/ChoroplethLegendConfig'
3
+
4
+ /**
5
+ * Configuration specific to choropleth maps
6
+ */
7
+ export interface ChoroplethConfig extends MapConfig {
8
+ /** Choropleth legend configuration. */
9
+ legend?: ChoroplethLegendConfig | false
10
+
11
+ /** Classification. */
12
+ numberOfClasses?: number
13
+ /** Classification method. */
14
+ classificationMethod?: 'quantile' | 'ckmeans' | 'jenks' | 'equinter' | 'threshold'
15
+ /** Thresholds. */
16
+ thresholds?: number[]
17
+ /** Make classif nice. */
18
+ makeClassifNice?: boolean
19
+
20
+ /** Colors. */
21
+ colors?: string[]
22
+ colorFunction?: (t: number) => string
23
+ /** Color scheme type. */
24
+ colorSchemeType?: 'discrete' | 'continuous'
25
+ /** Class to fill style. */
26
+ classToFillStyle?: { [classIndex: number]: string }
27
+
28
+ /** No-data styling. */
29
+ noDataFillStyle?: string
30
+
31
+ /** Value transformation (for continuous schemes). */
32
+ valueTransform?: (x: number) => number
33
+ valueUntransform?: (x: number) => number
34
+ /** Skip normalization. */
35
+ skipNormalization?: boolean
36
+
37
+ /** Diverging schemes. */
38
+ pointOfDivergence?: number
39
+ }
@@ -0,0 +1,48 @@
1
+ import { MapInstance } from '../../core/MapInstance'
2
+
3
+ /**
4
+ * Choropleth map object
5
+ */
6
+ export interface ChoroplethMap extends MapInstance {
7
+ numberOfClasses(): number
8
+ numberOfClasses(n: number): this
9
+
10
+ classificationMethod(): string
11
+ classificationMethod(method: 'quantile' | 'ckmeans' | 'jenks' | 'equinter' | 'threshold'): this
12
+
13
+ thresholds(): number[]
14
+ thresholds(t: number[]): this
15
+
16
+ colors(): string[]
17
+ colors(c: string[]): this
18
+
19
+ colorFunction(): (t: number) => string
20
+ colorFunction(fn: (t: number) => string): this
21
+
22
+ makeClassifNice(): boolean
23
+ makeClassifNice(v: boolean): this
24
+
25
+ classToFillStyle(): any
26
+ classToFillStyle(v: any): this
27
+
28
+ classifier(): any
29
+ classifier(v: any): this
30
+
31
+ colorSchemeType(): string
32
+ colorSchemeType(type: 'discrete' | 'continuous'): this
33
+
34
+ valueTransform(): (x: number) => number
35
+ valueTransform(v: (x: number) => number): this
36
+
37
+ valueUntransform(): (x: number) => number
38
+ valueUntransform(v: (x: number) => number): this
39
+
40
+ pointOfDivergence(): number | null
41
+ pointOfDivergence(v: number | null): this
42
+
43
+ skipNormalization(): boolean
44
+ skipNormalization(v: boolean): this
45
+
46
+ noDataFillStyle(): string
47
+ noDataFillStyle(style: string): this
48
+ }
@@ -0,0 +1,41 @@
1
+ import type { MapConfig } from '../../core/MapConfig'
2
+ import type { TrivariateLegendConfig } from '../../legend/choropleth/TrivariateLegendConfig'
3
+
4
+ /**
5
+ * Ternary color settings for trivariate choropleth maps.
6
+ */
7
+ export interface TrivariateTernarySettings {
8
+ /** Use sextant color mapping instead of continuous tricolore. */
9
+ sextant?: boolean
10
+ /** Array of 6 colors used when sextant mode is enabled. */
11
+ sextantColors?: [string, string, string, string, string, string]
12
+ /** Hue. */
13
+ hue?: number
14
+ /** Chroma. */
15
+ chroma?: number
16
+ /** Lightness. */
17
+ lightness?: number
18
+ /** Contrast. */
19
+ contrast?: number
20
+ /** Spread. */
21
+ spread?: number
22
+ /** Breaks. */
23
+ breaks?: number
24
+ /** Mean centering. */
25
+ meanCentering?: boolean
26
+ }
27
+
28
+ /**
29
+ * Configuration for trivariate choropleth maps.
30
+ */
31
+ export interface TrivariateChoroplethConfig extends MapConfig {
32
+ /** Trivariate choropleth legend configuration. */
33
+ legend?: TrivariateLegendConfig | false
34
+
35
+ /** Ternary codes. */
36
+ ternaryCodes?: [string, string, string]
37
+ /** No data fill style. */
38
+ noDataFillStyle?: string
39
+ /** Ternary settings. */
40
+ ternarySettings?: TrivariateTernarySettings
41
+ }
@@ -0,0 +1,18 @@
1
+ import type { MapInstance } from '../../core/MapInstance'
2
+ import type { TrivariateChoroplethConfig, TrivariateTernarySettings } from './TrivariateChoroplethConfig'
3
+
4
+ type TernarySettings = TrivariateTernarySettings
5
+
6
+ /**
7
+ * Trivariate choropleth map type.
8
+ */
9
+ export interface TrivariateChoroplethMap extends MapInstance {
10
+ ternaryCodes(): string[]
11
+ ternaryCodes(v: string[]): this
12
+
13
+ noDataFillStyle(): string
14
+ noDataFillStyle(v: string): this
15
+
16
+ ternarySettings(): TernarySettings
17
+ ternarySettings(v: Partial<TernarySettings>): this
18
+ }
@@ -0,0 +1,8 @@
1
+ import type { ChoroplethConfig } from './ChoroplethConfig'
2
+
3
+ /**
4
+ * Configuration for value-by-alpha choropleth maps.
5
+ */
6
+ export interface ValueByAlphaConfig extends ChoroplethConfig {
7
+ opacityScale?: (value: number) => number
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { MapInstance } from '../../core/MapInstance'
2
+
3
+ /**
4
+ * Value-by-alpha choropleth map type.
5
+ */
6
+ export interface ValueByAlphaMap extends MapInstance {
7
+ opacityScale(): ((value: number) => number) | null
8
+ opacityScale(v: ((value: number) => number) | null): this
9
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Statistical configuration for composition maps (pie, bar, waffle, stripe).
3
+ *
4
+ * Preferred API:
5
+ * - `map.stat('composition', { ... })`
6
+ * - `map.encoding('composition', { stat: 'composition' })`
7
+ *
8
+ * Either `eurostatDatasetCode` + `categoryParameter` (Eurostat API path)
9
+ * or `customData` (custom data path) must be provided.
10
+ *
11
+ * Legacy positional signatures in `statPie/statWaffle/statBar/statStripe` and
12
+ * `map.stat('composition', config, categoryParameter, ...)` remain supported.
13
+ */
14
+ export interface CompositionStatConfig<TCustomData = Record<string, Record<string, number>>> {
15
+ /**
16
+ * Custom data keyed by region ID then category code.
17
+ * Use instead of `eurostatDatasetCode` when supplying data directly.
18
+ * When `customData` is set, `eurostatDatasetCode` and `categoryParameter`
19
+ * are not required.
20
+ * @example
21
+ * customData: {
22
+ * ES: { cat1: 2, cat2: 3, cat3: 5 },
23
+ * DE: { cat1: 4, cat2: 1, cat3: 6 },
24
+ * }
25
+ */
26
+ customData?: TCustomData
27
+
28
+ /** Eurostat dataset code. Required when not using `customData`. */
29
+ eurostatDatasetCode?: string
30
+ /** Filters. */
31
+ filters?: Record<string, any>
32
+ /** Unit text. */
33
+ unitText?: string
34
+ preprocess?: (regionId: string, value: any) => any
35
+ transform?: (value: number) => number
36
+
37
+ /** Category parameter. Required when not using `customData`. */
38
+ categoryParameter?: string
39
+ /** Category codes. */
40
+ categoryCodes?: string[]
41
+ /** Category labels. */
42
+ categoryLabels?: string[]
43
+ /** Category colors. */
44
+ categoryColors?: string[]
45
+ /** Total code. */
46
+ totalCode?: string
47
+
48
+ /** Legacy nested API supported by buildStatCompositionMethod. */
49
+ stat?: {
50
+ /** Eurostat dataset code. */
51
+ eurostatDatasetCode?: string
52
+ /** Filters. */
53
+ filters?: Record<string, any>
54
+ /** Unit text. */
55
+ unitText?: string
56
+ preprocess?: (regionId: string, value: any) => any
57
+ transform?: (value: number) => number
58
+ }
59
+ }
@@ -0,0 +1,97 @@
1
+ import type { MapInstance } from '../../../core/MapInstance'
2
+ import type { CompositionStatConfig } from '../CompositionStatConfig'
3
+ import type { BarChartLegendConfig } from '../../../legend/composition/BarChartLegendConfig'
4
+
5
+ /**
6
+ * Bar map type.
7
+ */
8
+ export interface BarMap extends MapInstance {
9
+ legend(): BarChartLegendConfig | false
10
+ legend(config: BarChartLegendConfig | false): this
11
+
12
+ barType(): 'stacked' | 'grouped'
13
+ barType(v: 'stacked' | 'grouped'): this
14
+
15
+ catColors(): any
16
+ catColors(v: any): this
17
+
18
+ catLabels(): any
19
+ catLabels(v: any): this
20
+
21
+ showOnlyWhenComplete(): boolean
22
+ showOnlyWhenComplete(v: boolean): this
23
+
24
+ noDataFillStyle(): string
25
+ noDataFillStyle(v: string): this
26
+
27
+ barMaxWidth(): number
28
+ barMaxWidth(v: number): this
29
+
30
+ barMinWidth(): number
31
+ barMinWidth(v: number): this
32
+
33
+ barHeight(): number
34
+ barHeight(v: number): this
35
+
36
+ barGroupWidth(): number
37
+ barGroupWidth(v: number): this
38
+
39
+ barSettings(): any
40
+ barSettings(v: any): this
41
+
42
+ barGroupGap(): number
43
+ barGroupGap(v: number): this
44
+
45
+ barGroupMinHeight(): number
46
+ barGroupMinHeight(v: number): this
47
+
48
+ barGroupMaxHeight(): number
49
+ barGroupMaxHeight(v: number): this
50
+
51
+ barStrokeFill(): string
52
+ barStrokeFill(v: string): this
53
+
54
+ barStrokeWidth(): number
55
+ barStrokeWidth(v: number): this
56
+
57
+ barCornerRadius(): number
58
+ barCornerRadius(v: number): this
59
+
60
+ barOtherColor(): string
61
+ barOtherColor(v: string): this
62
+
63
+ barOtherText(): string
64
+ barOtherText(v: string): this
65
+
66
+ barTooltipWidth(): number
67
+ barTooltipWidth(v: number): this
68
+
69
+ barTooltipHeight(): number
70
+ barTooltipHeight(v: number): this
71
+
72
+ dorling(): boolean
73
+ dorling(v: boolean): this
74
+
75
+ barTotalCode(): string | undefined
76
+ barTotalCode(v: string | undefined): this
77
+
78
+ statCodes(): string[] | undefined
79
+ statCodes(v: string[] | undefined): this
80
+
81
+ statBar(config: CompositionStatConfig): this
82
+ /** @deprecated Legacy positional signature. Prefer statBar({ categoryParameter, categoryCodes, ... }). */
83
+ statBar(
84
+ /** Config. */
85
+ config: CompositionStatConfig,
86
+ /** Category parameter. */
87
+ categoryParameter?: string,
88
+ /** Category codes. */
89
+ categoryCodes?: string[],
90
+ /** Category labels. */
91
+ categoryLabels?: string[],
92
+ /** Category colors. */
93
+ categoryColors?: string[],
94
+ /** Total code. */
95
+ totalCode?: string
96
+ ): this
97
+ }
@@ -0,0 +1,76 @@
1
+ import type { MapConfig } from '../../../core/MapConfig'
2
+ import type { BarChartLegendConfig } from '../../../legend/composition/BarChartLegendConfig'
3
+
4
+ /**
5
+ * Configuration for bar chart composition maps.
6
+ */
7
+ export interface BarMapConfig extends MapConfig {
8
+ /** Bar type. */
9
+ barType?: 'stacked' | 'grouped'
10
+ /** Cat colors. */
11
+ catColors?: Record<string, string>
12
+ /** Cat labels. */
13
+ catLabels?: Record<string, string>
14
+ /** Show only when complete. */
15
+ showOnlyWhenComplete?: boolean
16
+ /** No data fill style. */
17
+ noDataFillStyle?: string
18
+ /** Bar min width. */
19
+ barMinWidth?: number
20
+ /** Bar max width. */
21
+ barMaxWidth?: number
22
+ /** Bar height. */
23
+ barHeight?: number
24
+ /** Bar group width. */
25
+ barGroupWidth?: number
26
+ /** Grouped bar settings object. */
27
+ barSettings?: {
28
+ type?: 'stacked' | 'grouped'
29
+ minWidth?: number
30
+ maxWidth?: number
31
+ height?: number
32
+ groupWidth?: number
33
+ groupMinWidth?: number
34
+ groupMaxWidth?: number
35
+ groupGap?: number
36
+ groupMinHeight?: number
37
+ groupMaxHeight?: number
38
+ groupMaxValue?: number
39
+ groupMaxWidthValue?: number
40
+ strokeFill?: string
41
+ strokeWidth?: number
42
+ cornerRadius?: number
43
+ otherColor?: string
44
+ otherText?: string
45
+ tooltipWidth?: number
46
+ tooltipHeight?: number
47
+ }
48
+ /** Bar group gap. */
49
+ barGroupGap?: number
50
+ /** Bar group min height. */
51
+ barGroupMinHeight?: number
52
+ /** Bar group max height. */
53
+ barGroupMaxHeight?: number
54
+ /** Bar stroke fill. */
55
+ barStrokeFill?: string
56
+ /** Bar stroke width. */
57
+ barStrokeWidth?: number
58
+ /** Bar corner radius. */
59
+ barCornerRadius?: number
60
+ /** Bar other color. */
61
+ barOtherColor?: string
62
+ /** Bar other text. */
63
+ barOtherText?: string
64
+ /** Bar tooltip width. */
65
+ barTooltipWidth?: number
66
+ /** Bar tooltip height. */
67
+ barTooltipHeight?: number
68
+ /** Dorling. */
69
+ dorling?: boolean
70
+ /** Bar total code. */
71
+ barTotalCode?: string
72
+ /** Stat codes. */
73
+ statCodes?: string[]
74
+ /** Legend. */
75
+ legend?: BarChartLegendConfig | false
76
+ }