eurostat-map 4.4.0 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +54 -78
  2. package/build/215.eurostatmap.min.js +1 -1
  3. package/build/eurostatmap.js +2700 -353
  4. package/build/eurostatmap.min.js +2 -2
  5. package/build/eurostatmap.min.js.map +1 -1
  6. package/build/types/core/DorlingSettings.d.ts +29 -0
  7. package/build/types/core/GridCartogramSettings.d.ts +30 -0
  8. package/build/types/core/InsetConfig.d.ts +9 -1
  9. package/build/types/core/MapConfig.d.ts +124 -41
  10. package/build/types/core/MapInstance.d.ts +120 -32
  11. package/build/types/core/TooltipConfig.d.ts +3 -0
  12. package/build/types/core/decoration/CoastalMarginSettings.d.ts +21 -0
  13. package/build/types/core/geo/geometries.d.ts +15 -0
  14. package/build/types/core/geo/kosovo.d.ts +2 -0
  15. package/build/types/core/stat/StatData.d.ts +6 -0
  16. package/build/types/core/utils.d.ts +4 -0
  17. package/build/types/index.d.ts +28 -12
  18. package/build/types/legend/LegendConfig.d.ts +42 -17
  19. package/build/types/legend/SparklineLegendConfig.d.ts +6 -68
  20. package/build/types/legend/choropleth/ChoroplethLegendConfig.d.ts +80 -0
  21. package/build/types/legend/composition/CoxcombLegendConfig.d.ts +85 -0
  22. package/build/types/legend/composition/PieChartLegendConfig.d.ts +68 -0
  23. package/build/types/legend/composition/SparklineLegendConfig.d.ts +94 -0
  24. package/build/types/legend/composition/StripeCompositionLegendConfig.d.ts +11 -0
  25. package/build/types/legend/composition/WaffleLegendConfig.d.ts +74 -0
  26. package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +12 -0
  27. package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +15 -5
  28. package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +14 -0
  29. package/build/types/map-types/composition/CompositionStatConfig.d.ts +14 -1
  30. package/build/types/map-types/composition/bar/BarMap.d.ts +4 -3
  31. package/build/types/map-types/composition/bar/BarMapConfig.d.ts +25 -1
  32. package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +4 -0
  33. package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +14 -0
  34. package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +4 -2
  35. package/build/types/map-types/composition/pie/PieMap.d.ts +10 -3
  36. package/build/types/map-types/composition/pie/PieMapConfig.d.ts +19 -1
  37. package/build/types/map-types/composition/stripe/StripeMap.d.ts +9 -0
  38. package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +12 -0
  39. package/build/types/map-types/composition/waffle/WaffleMap.d.ts +10 -3
  40. package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +20 -1
  41. package/build/types/map-types/flow/FlowMapConfig.d.ts +55 -0
  42. package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +4 -11
  43. package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +0 -9
  44. package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +5 -0
  45. package/build/types/map-types/spark/SparkMap.d.ts +6 -2
  46. package/build/types/map-types/spark/SparkMapConfig.d.ts +17 -0
  47. package/build/types/map-types/spark/SparkStatConfig.d.ts +6 -0
  48. package/package.json +9 -2
@@ -4,21 +4,14 @@ import type { MapConfig } from '../../core/MapConfig'
4
4
  * Configuration for proportional symbol maps
5
5
  */
6
6
  export interface ProportionalSymbolConfig extends MapConfig {
7
+ /** Symbol shape used for markers. */
7
8
  symbol?: 'circle' | 'square'
9
+ /** Base symbol size factor. */
8
10
  size?: number
9
- sizeMin?: number
10
- sizeMax?: number
11
- symbolFillStyle?: string
12
- symbolStrokeStyle?: string
13
- symbolStrokeWidth?: number
14
11
 
15
- // Dorling cartogram
12
+ /** Dorling cartogram. */
16
13
  dorling?: boolean
17
- dorlingIterations?: number
18
14
 
19
- // Size function
15
+ /** Size function. */
20
16
  psCustomSize?: (value: number) => number
21
-
22
- // Scaling
23
- psScale?: 'sqrt' | 'linear' | 'radial'
24
17
  }
@@ -79,15 +79,6 @@ export interface ProportionalSymbolMap extends MapInstance {
79
79
  dorling(): boolean
80
80
  dorling(v: boolean): this
81
81
 
82
- dorlingStrength(): any
83
- dorlingStrength(v: any): this
84
-
85
- dorlingIterations(): number
86
- dorlingIterations(v: number): this
87
-
88
- animateDorling(): boolean
89
- animateDorling(v: boolean): this
90
-
91
82
  psSpikeWidth(): number
92
83
  psSpikeWidth(v: number): this
93
84
 
@@ -4,10 +4,15 @@ import type { MapConfig } from '../../../core/MapConfig'
4
4
  * Configuration for mushroom maps.
5
5
  */
6
6
  export interface MushroomMapConfig extends MapConfig {
7
+ /** Mushroom codes. */
7
8
  mushroomCodes?: [string, string]
9
+ /** Mushroom min size. */
8
10
  mushroomMinSize?: number
11
+ /** Mushroom max size. */
9
12
  mushroomMaxSize?: number
13
+ /** Mushroom colors. */
10
14
  mushroomColors?: [string, string]
15
+ /** Mushroom orientation. */
11
16
  mushroomOrientation?: 'horizontal' | 'vertical'
12
17
  mushroomSizeScaleFunction?: (value: number) => number
13
18
  mushroomSizeScaleFunctionV1?: (value: number) => number
@@ -1,10 +1,14 @@
1
1
  import type { MapInstance } from '../../core/MapInstance'
2
2
  import type { SparkStatConfig } from './SparkStatConfig'
3
+ import type { SparklineLegendConfig } from '../../legend/composition/SparklineLegendConfig'
3
4
 
4
5
  /**
5
6
  * Spark map type.
6
7
  */
7
8
  export interface SparkMap extends MapInstance {
9
+ legend(): SparklineLegendConfig
10
+ legend(config: SparklineLegendConfig | false): this
11
+
8
12
  sparkLineColor(): any
9
13
  sparkLineColor(v: any): this
10
14
 
@@ -41,8 +45,8 @@ export interface SparkMap extends MapInstance {
41
45
  sparkLineOffsets(): { x: number; y: number }
42
46
  sparkLineOffsets(v: { x: number; y: number }): this
43
47
 
44
- //manually set the data for the sparkline, instead of fetching it from Eurostat
48
+ /** Manually set sparkline data instead of fetching it from Eurostat. */
45
49
  sparklineData(dataObject: Record<string, Record<string, number>>): this
46
- //configuration for fetching the data from Eurostat and generating the sparkline
50
+ /** Configure fetching data from Eurostat and generating spark lines. */
47
51
  statSpark(config: SparkStatConfig): this
48
52
  }
@@ -1,25 +1,42 @@
1
1
  import type { MapConfig } from '../../core/MapConfig'
2
+ import type { SparklineLegendConfig } from '../../legend/composition/SparklineLegendConfig'
2
3
 
3
4
  /**
4
5
  * Configuration for sparkline maps.
5
6
  */
6
7
  export interface SparkMapConfig extends MapConfig {
8
+ /** Spark type. */
7
9
  sparkType?: 'line' | 'area' | 'bar'
8
10
  sparkLineColor?: string | ((value: number, index: number, data: any[]) => string)
9
11
  sparkAreaColor?: string | ((value: number, index: number, data: any[]) => string)
12
+ /** Spark line width. */
10
13
  sparkLineWidth?: number
14
+ /** Spark line height. */
11
15
  sparkLineHeight?: number
16
+ /** Spark line stroke width. */
12
17
  sparkLineStrokeWidth?: number
18
+ /** Spark line opacity. */
13
19
  sparkLineOpacity?: number
20
+ /** Spark line circle radius. */
14
21
  sparkLineCircleRadius?: number
22
+ /** Spark tooltip chart. */
15
23
  sparkTooltipChart?: {
24
+ /** Width. */
16
25
  width: number
26
+ /** Height. */
17
27
  height: number
28
+ /** Margin. */
18
29
  margin: { left: number; right: number; top: number; bottom: number }
30
+ /** Circle radius. */
19
31
  circleRadius: number
20
32
  }
33
+ /** Spark line offsets. */
21
34
  sparkLineOffsets?: { x: number; y: number }
35
+ /** Show only when complete. */
22
36
  showOnlyWhenComplete?: boolean
23
37
  sparkLineChartFunction?: (node: any, data: any[], width: number, height: number, isForTooltip?: boolean) => void
38
+ /** Spark yscale. */
24
39
  sparkYScale?: any
40
+ /** Legend. */
41
+ legend?: SparklineLegendConfig | false
25
42
  }
@@ -2,9 +2,15 @@
2
2
  * Statistical configuration for sparkline maps.
3
3
  */
4
4
  export interface SparkStatConfig {
5
+ /** Eurostat dataset code. */
5
6
  eurostatDatasetCode: string
7
+ /** Filters. */
6
8
  filters?: Record<string, any>
9
+ /** Unit text. */
7
10
  unitText?: string
11
+ transform?: (value: number) => number
12
+ /** Dates. */
8
13
  dates: string[]
14
+ /** Labels. */
9
15
  labels?: string[]
10
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.4.0",
3
+ "version": "4.4.2",
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",
@@ -39,7 +39,11 @@
39
39
  "build-prod-debug": "webpack --config webpack/webpack.config.debug-size.js",
40
40
  "format": "prettier --write .",
41
41
  "copy-types": "copyfiles -u 2 \"src/types/**/*.d.ts\" build/types",
42
- "type-check": "tsc --noEmit && tsc --noEmit test/typescript-test.ts"
42
+ "check:types:legend-config-sync": "node test/scripts/check-legend-config-sync.js",
43
+ "type-check": "npm run check:types:legend-config-sync && tsc --noEmit && tsc --noEmit test/typescript-test.ts",
44
+ "docs:api": "typedoc --options typedoc.json",
45
+ "docs": "npm run docs:api",
46
+ "generate-previews": "node examples/scripts/generate-previews.js"
43
47
  },
44
48
  "dependencies": {
45
49
  "d3-array": "^3.2.4",
@@ -73,9 +77,12 @@
73
77
  "babel-loader": "^9.1.2",
74
78
  "copyfiles": "^2.4.1",
75
79
  "css-loader": "^7.1.2",
80
+ "playwright": "^1.60.0",
76
81
  "prettier": "^3.4.1",
77
82
  "style-loader": "^4.0.0",
78
83
  "ts-loader": "^9.5.4",
84
+ "typedoc": "^0.28.12",
85
+ "typedoc-plugin-missing-exports": "^4.0.0",
79
86
  "typescript": "^5.9.3",
80
87
  "webpack": "^5.88.1",
81
88
  "webpack-bundle-analyzer": "^4.10.2",