eurostat-map 4.4.3 → 4.4.4
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.
- package/README.md +9 -8
- package/build/215.eurostatmap.min.js +1 -1
- package/build/eurostatmap.js +2127 -1454
- package/build/eurostatmap.min.js +2 -2
- package/build/eurostatmap.min.js.map +1 -1
- package/build/package.json +1 -1
- package/build/types/core/MapConfig.d.ts +6 -0
- package/build/types/core/MapInstance.d.ts +8 -0
- package/build/types/map-types/composition/CompositionStatConfig.d.ts +19 -3
- package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +1 -4
- package/build/types/map-types/composition/pie/PieMap.d.ts +37 -22
- package/build/types/map-types/composition/pie/PieMapConfig.d.ts +22 -16
- package/build/types/map-types/composition/stripe/StripeMap.d.ts +12 -1
- package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +6 -0
- package/build/types/map-types/spark/SparkStatConfig.d.ts +21 -5
- package/package.json +12 -14
package/build/package.json
CHANGED
|
@@ -112,6 +112,9 @@ export interface MapConfig {
|
|
|
112
112
|
/** Show/hide inset map toggle button. */
|
|
113
113
|
insetsButton?: boolean
|
|
114
114
|
|
|
115
|
+
/** Show/hide legend toggle button. */
|
|
116
|
+
legendButton?: boolean
|
|
117
|
+
|
|
115
118
|
/** Show/hide placename labels. */
|
|
116
119
|
placenames?: boolean
|
|
117
120
|
|
|
@@ -151,6 +154,9 @@ export interface MapConfig {
|
|
|
151
154
|
/** Position adjustment for insets button: [x, y] */
|
|
152
155
|
insetsButtonPosition?: [number, number]
|
|
153
156
|
|
|
157
|
+
/** Position adjustment for legend button: [x, y] */
|
|
158
|
+
legendButtonPosition?: [number, number]
|
|
159
|
+
|
|
154
160
|
/** Pointer hover color for NUTS regions. */
|
|
155
161
|
hoverColor?: string
|
|
156
162
|
|
|
@@ -266,6 +266,10 @@ export interface MapInstance {
|
|
|
266
266
|
insetsButton(): boolean
|
|
267
267
|
insetsButton(show: boolean): this
|
|
268
268
|
|
|
269
|
+
/** Show/hide legend toggle button. */
|
|
270
|
+
legendButton(): boolean
|
|
271
|
+
legendButton(show: boolean): this
|
|
272
|
+
|
|
269
273
|
/** Filter function for placename labels. */
|
|
270
274
|
placenamesFilter(): ((name: any) => boolean) | undefined
|
|
271
275
|
placenamesFilter(fn: (name: any) => boolean): this
|
|
@@ -314,6 +318,10 @@ export interface MapInstance {
|
|
|
314
318
|
insetsButtonPosition(): [number, number] | undefined
|
|
315
319
|
insetsButtonPosition(pos: [number, number]): this
|
|
316
320
|
|
|
321
|
+
/** Position adjustment for legend button: [x, y] */
|
|
322
|
+
legendButtonPosition(): [number, number] | undefined
|
|
323
|
+
legendButtonPosition(pos: [number, number]): this
|
|
324
|
+
|
|
317
325
|
/** Pointer hover color for NUTS regions. */
|
|
318
326
|
hoverColor(): string
|
|
319
327
|
hoverColor(color: string): this
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Statistical configuration for composition maps (pie, bar, waffle, stripe).
|
|
3
|
+
*
|
|
4
|
+
* Either `eurostatDatasetCode` + `categoryParameter` (Eurostat API path)
|
|
5
|
+
* or `customData` (custom data path) must be provided.
|
|
3
6
|
*/
|
|
4
|
-
export interface CompositionStatConfig {
|
|
5
|
-
/**
|
|
7
|
+
export interface CompositionStatConfig<TCustomData = Record<string, Record<string, number>>> {
|
|
8
|
+
/**
|
|
9
|
+
* Custom data keyed by region ID then category code.
|
|
10
|
+
* Use instead of `eurostatDatasetCode` when supplying data directly.
|
|
11
|
+
* When `customData` is set, `eurostatDatasetCode` and `categoryParameter`
|
|
12
|
+
* are not required.
|
|
13
|
+
* @example
|
|
14
|
+
* customData: {
|
|
15
|
+
* ES: { cat1: 2, cat2: 3, cat3: 5 },
|
|
16
|
+
* DE: { cat1: 4, cat2: 1, cat3: 6 },
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
customData?: TCustomData
|
|
20
|
+
|
|
21
|
+
/** Eurostat dataset code. Required when not using `customData`. */
|
|
6
22
|
eurostatDatasetCode?: string
|
|
7
23
|
/** Filters. */
|
|
8
24
|
filters?: Record<string, any>
|
|
@@ -10,7 +26,7 @@ export interface CompositionStatConfig {
|
|
|
10
26
|
unitText?: string
|
|
11
27
|
transform?: (value: number) => number
|
|
12
28
|
|
|
13
|
-
/** Category parameter. */
|
|
29
|
+
/** Category parameter. Required when not using `customData`. */
|
|
14
30
|
categoryParameter?: string
|
|
15
31
|
/** Category codes. */
|
|
16
32
|
categoryCodes?: string[]
|
|
@@ -3,14 +3,11 @@ import { CompositionStatConfig } from '../CompositionStatConfig'
|
|
|
3
3
|
/**
|
|
4
4
|
* Statistical configuration for coxcomb maps.
|
|
5
5
|
*/
|
|
6
|
-
export interface CoxcombStatConfig extends CompositionStatConfig {
|
|
6
|
+
export interface CoxcombStatConfig extends CompositionStatConfig<Record<string, Record<string, Record<string, number>>>> {
|
|
7
7
|
/** Eurostat path. */
|
|
8
8
|
timeParameter?: string
|
|
9
9
|
/** Times. */
|
|
10
10
|
times: string[]
|
|
11
11
|
/** Time labels. */
|
|
12
12
|
timeLabels?: string[]
|
|
13
|
-
|
|
14
|
-
/** Custom data path. */
|
|
15
|
-
customData?: Record<string, Record<string, Record<string, number>>>
|
|
16
13
|
}
|
|
@@ -21,32 +21,47 @@ export interface PieMap extends MapInstance {
|
|
|
21
21
|
noDataFillStyle(): string
|
|
22
22
|
noDataFillStyle(v: string): this
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
pieSettings(): {
|
|
25
|
+
innerRadius?: number
|
|
26
|
+
}
|
|
27
|
+
pieSettings(v: { innerRadius?: number }): this
|
|
28
|
+
|
|
29
|
+
compositionSettings(): {
|
|
30
|
+
type?: 'flag' | 'pie' | 'ring' | 'segment' | 'radar' | 'agepyramid' | 'halftone'
|
|
31
|
+
minSize?: number
|
|
32
|
+
maxSize?: number
|
|
33
|
+
strokeFill?: string
|
|
34
|
+
strokeWidth?: number
|
|
35
|
+
reverseOrder?: boolean
|
|
36
|
+
/** Category code order for composition rendering. */
|
|
37
|
+
order?: string[]
|
|
38
|
+
stripesOrientation?: number
|
|
39
|
+
offsetAngle?: number
|
|
40
|
+
agePyramidHeightFactor?: number
|
|
41
|
+
otherColor?: string
|
|
42
|
+
otherText?: string
|
|
43
|
+
}
|
|
44
|
+
compositionSettings(v: {
|
|
45
|
+
type?: 'flag' | 'pie' | 'ring' | 'segment' | 'radar' | 'agepyramid' | 'halftone'
|
|
46
|
+
minSize?: number
|
|
47
|
+
maxSize?: number
|
|
48
|
+
strokeFill?: string
|
|
49
|
+
strokeWidth?: number
|
|
50
|
+
reverseOrder?: boolean
|
|
51
|
+
/** Category code order for composition rendering. */
|
|
52
|
+
order?: string[]
|
|
53
|
+
stripesOrientation?: number
|
|
54
|
+
offsetAngle?: number
|
|
55
|
+
agePyramidHeightFactor?: number
|
|
56
|
+
otherColor?: string
|
|
57
|
+
otherText?: string
|
|
58
|
+
}): this
|
|
44
59
|
|
|
45
60
|
dorling(): boolean
|
|
46
61
|
dorling(v: boolean): this
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
compositionTotalCode(): string | undefined
|
|
64
|
+
compositionTotalCode(v: string | undefined): this
|
|
50
65
|
|
|
51
66
|
statCodes(): string[] | undefined
|
|
52
67
|
statCodes(v: string[] | undefined): this
|
|
@@ -5,16 +5,26 @@ import type { PieChartLegendConfig } from '../../../legend/composition/PieChartL
|
|
|
5
5
|
* Configuration for pie chart composition maps.
|
|
6
6
|
*/
|
|
7
7
|
export interface PieMapConfig extends MapConfig {
|
|
8
|
-
/** Pie
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
/** Pie-specific rendering settings. */
|
|
9
|
+
pieSettings?: {
|
|
10
|
+
innerRadius?: number
|
|
11
|
+
}
|
|
12
|
+
/** Consolidated composition symbol settings. */
|
|
13
|
+
compositionSettings?: {
|
|
14
|
+
type?: 'flag' | 'pie' | 'ring' | 'segment' | 'radar' | 'agepyramid' | 'halftone'
|
|
15
|
+
minSize?: number
|
|
16
|
+
maxSize?: number
|
|
17
|
+
strokeFill?: string
|
|
18
|
+
strokeWidth?: number
|
|
19
|
+
reverseOrder?: boolean
|
|
20
|
+
/** Category code order for composition rendering. */
|
|
21
|
+
order?: string[]
|
|
22
|
+
stripesOrientation?: number
|
|
23
|
+
offsetAngle?: number
|
|
24
|
+
agePyramidHeightFactor?: number
|
|
25
|
+
otherColor?: string
|
|
26
|
+
otherText?: string
|
|
27
|
+
}
|
|
18
28
|
/** Tooltip pie radius. */
|
|
19
29
|
tooltipPieRadius?: number
|
|
20
30
|
/** Tooltip pie inner radius. */
|
|
@@ -23,18 +33,14 @@ export interface PieMapConfig extends MapConfig {
|
|
|
23
33
|
catColors?: Record<string, string>
|
|
24
34
|
/** Cat labels. */
|
|
25
35
|
catLabels?: Record<string, string>
|
|
26
|
-
/** Pie other color. */
|
|
27
|
-
pieOtherColor?: string
|
|
28
|
-
/** Pie other text. */
|
|
29
|
-
pieOtherText?: string
|
|
30
36
|
/** Show only when complete. */
|
|
31
37
|
showOnlyWhenComplete?: boolean
|
|
32
38
|
/** No data fill style. */
|
|
33
39
|
noDataFillStyle?: string
|
|
34
40
|
/** Dorling. */
|
|
35
41
|
dorling?: boolean
|
|
36
|
-
/**
|
|
37
|
-
|
|
42
|
+
/** Total code used to compute optional 'other' composition share. */
|
|
43
|
+
compositionTotalCode?: string
|
|
38
44
|
/** Stat codes. */
|
|
39
45
|
statCodes?: string[]
|
|
40
46
|
/** Legend. */
|
|
@@ -21,6 +21,12 @@ export interface StripeMap extends MapInstance {
|
|
|
21
21
|
catLabels(): any
|
|
22
22
|
catLabels(v: any): this
|
|
23
23
|
|
|
24
|
+
stripeOtherColor(): string
|
|
25
|
+
stripeOtherColor(v: string): this
|
|
26
|
+
|
|
27
|
+
stripeOtherText(): string
|
|
28
|
+
stripeOtherText(v: string): this
|
|
29
|
+
|
|
24
30
|
showOnlyWhenComplete(): boolean
|
|
25
31
|
showOnlyWhenComplete(v: boolean): this
|
|
26
32
|
|
|
@@ -33,6 +39,9 @@ export interface StripeMap extends MapInstance {
|
|
|
33
39
|
pieChartInnerRadius(): number
|
|
34
40
|
pieChartInnerRadius(v: number): this
|
|
35
41
|
|
|
42
|
+
stripeTotalCode(): string | undefined
|
|
43
|
+
stripeTotalCode(v: string | undefined): this
|
|
44
|
+
|
|
36
45
|
statCodes(): string[] | undefined
|
|
37
46
|
statCodes(v: string[] | undefined): this
|
|
38
47
|
|
|
@@ -47,6 +56,8 @@ export interface StripeMap extends MapInstance {
|
|
|
47
56
|
/** Category labels. */
|
|
48
57
|
categoryLabels?: string[],
|
|
49
58
|
/** Category colors. */
|
|
50
|
-
categoryColors?: string[]
|
|
59
|
+
categoryColors?: string[],
|
|
60
|
+
/** Total code. */
|
|
61
|
+
totalCode?: string
|
|
51
62
|
): this
|
|
52
63
|
}
|
|
@@ -13,6 +13,10 @@ export interface StripeMapConfig extends MapConfig {
|
|
|
13
13
|
catColors?: Record<string, string>
|
|
14
14
|
/** Cat labels. */
|
|
15
15
|
catLabels?: Record<string, string>
|
|
16
|
+
/** Stripe other color. */
|
|
17
|
+
stripeOtherColor?: string
|
|
18
|
+
/** Stripe other text. */
|
|
19
|
+
stripeOtherText?: string
|
|
16
20
|
/** Show only when complete. */
|
|
17
21
|
showOnlyWhenComplete?: boolean
|
|
18
22
|
/** No data fill style. */
|
|
@@ -21,6 +25,8 @@ export interface StripeMapConfig extends MapConfig {
|
|
|
21
25
|
pieChartRadius?: number
|
|
22
26
|
/** Pie chart inner radius. */
|
|
23
27
|
pieChartInnerRadius?: number
|
|
28
|
+
/** Stripe total code. */
|
|
29
|
+
stripeTotalCode?: string
|
|
24
30
|
/** Stat codes. */
|
|
25
31
|
statCodes?: string[]
|
|
26
32
|
/** Legend. */
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Statistical configuration for sparkline maps.
|
|
3
|
+
*
|
|
4
|
+
* Either `eurostatDatasetCode` + `dates` (Eurostat API path)
|
|
5
|
+
* or `customData` (custom data path) must be provided.
|
|
3
6
|
*/
|
|
4
7
|
export interface SparkStatConfig {
|
|
5
|
-
/**
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Custom data keyed by region ID then date string.
|
|
10
|
+
* Use instead of `eurostatDatasetCode` when supplying data directly.
|
|
11
|
+
* When `customData` is set, `eurostatDatasetCode` is not required;
|
|
12
|
+
* `dates` defaults to the key order of the first region's entries.
|
|
13
|
+
* @example
|
|
14
|
+
* customData: {
|
|
15
|
+
* ES: { '2020': 100, '2021': 120, '2022': 115 },
|
|
16
|
+
* DE: { '2020': 200, '2021': 190, '2022': 210 },
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
customData?: Record<string, Record<string, number>>
|
|
20
|
+
|
|
21
|
+
/** Eurostat dataset code. Required when not using `customData`. */
|
|
22
|
+
eurostatDatasetCode?: string
|
|
7
23
|
/** Filters. */
|
|
8
24
|
filters?: Record<string, any>
|
|
9
25
|
/** Unit text. */
|
|
10
26
|
unitText?: string
|
|
11
27
|
transform?: (value: number) => number
|
|
12
|
-
/**
|
|
13
|
-
dates
|
|
14
|
-
/**
|
|
28
|
+
/** Date keys to fetch. Required when not using `customData`. */
|
|
29
|
+
dates?: string[]
|
|
30
|
+
/** Display labels for each date. */
|
|
15
31
|
labels?: string[]
|
|
16
32
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eurostat-map",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.4",
|
|
4
4
|
"description": "Reusable library to quickly create and customise web maps showing Eurostat data directly retrieved from Eurostat database.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"cartography",
|
|
7
|
+
"data visualization",
|
|
8
|
+
"dataviz",
|
|
9
|
+
"maps",
|
|
10
|
+
"d3",
|
|
11
|
+
"europe",
|
|
6
12
|
"eurostat",
|
|
7
13
|
"statistics",
|
|
8
|
-
"europe",
|
|
9
14
|
"SVG",
|
|
10
15
|
"NUTS",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"cartography",
|
|
14
|
-
"thematic",
|
|
15
|
-
"mapping",
|
|
16
|
-
"eurostat-map",
|
|
17
|
-
"dataviz",
|
|
18
|
-
"data visualization"
|
|
16
|
+
"thematic-mapping",
|
|
17
|
+
"eurostat-map"
|
|
19
18
|
],
|
|
20
19
|
"homepage": "https://github.com/eurostat/eurostat-map",
|
|
21
20
|
"author": "",
|
|
@@ -41,11 +40,10 @@
|
|
|
41
40
|
"copy-types": "copyfiles -u 2 \"src/types/**/*.d.ts\" build/types",
|
|
42
41
|
"check:types:legend-config-sync": "node test/scripts/check-legend-config-sync.js",
|
|
43
42
|
"type-check": "npm run check:types:legend-config-sync && tsc --noEmit && tsc --noEmit test/typescript-test.ts",
|
|
44
|
-
"docs
|
|
45
|
-
"
|
|
46
|
-
"generate-previews": "node examples/scripts/generate-previews.js",
|
|
43
|
+
"update-docs": "typedoc --options typedoc.json",
|
|
44
|
+
"update-examples": "npm run update-examples-manifest && npm run generate-previews",
|
|
47
45
|
"update-examples-manifest": "node examples/scripts/update-examples-manifest.js",
|
|
48
|
-
"
|
|
46
|
+
"generate-previews": "node examples/scripts/generate-previews.js"
|
|
49
47
|
},
|
|
50
48
|
"dependencies": {
|
|
51
49
|
"d3-array": "^3.2.4",
|