eurostat-map 4.4.3 → 4.4.5
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 +148 -147
- package/build/215.eurostatmap.min.js +1 -1
- package/build/215.eurostatmap.min.js.map +1 -1
- package/build/eurostatmap.js +2594 -1497
- package/build/eurostatmap.min.js +2 -2
- package/build/eurostatmap.min.js.map +1 -1
- package/build/package.json +87 -87
- package/build/types/core/MapConfig.d.ts +6 -0
- package/build/types/core/MapInstance.d.ts +8 -0
- package/build/types/index.d.ts +2 -1
- package/build/types/legend/choropleth/legend-choropleth-bivariate.d.ts +2 -2
- package/build/types/legend/choropleth/legend-choropleth-trivariate.d.ts +2 -2
- package/build/types/legend/choropleth/legend-choropleth.d.ts +2 -2
- package/build/types/legend/composition/legend-bar-chart.d.ts +2 -2
- package/build/types/legend/flow/legend-flow.d.ts +2 -2
- package/build/types/legend/legend-categorical.d.ts +2 -2
- package/build/types/legend/legend-continuous.d.ts +2 -2
- package/build/types/legend/legend-discrete.d.ts +2 -2
- package/build/types/legend/legend.d.ts +13 -13
- package/build/types/legend/proportional-symbol/legend-proportional-symbols.d.ts +2 -2
- package/build/types/map-types/CategoricalMapConfig.d.ts +11 -11
- package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +25 -16
- package/build/types/map-types/choropleth/TrivariateChoroplethMap.d.ts +5 -2
- package/build/types/map-types/choropleth/map-choropleth-bivariate.d.ts +4 -4
- package/build/types/map-types/choropleth/map-choropleth-trivariate.d.ts +4 -4
- package/build/types/map-types/choropleth/map-value-by-alpha.d.ts +4 -4
- 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/map-spark.d.ts +5 -5
- package/build/types/map-types/composition/map-stripe.d.ts +5 -5
- package/build/types/map-types/composition/pie/PieMap.d.ts +41 -22
- package/build/types/map-types/composition/pie/PieMapConfig.d.ts +24 -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/composition/waffle/WaffleMap.d.ts +45 -0
- package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +24 -10
- package/build/types/map-types/flow/map-flow.d.ts +5 -5
- package/build/types/map-types/spark/SparkStatConfig.d.ts +21 -5
- package/package.json +15 -15
|
@@ -5,16 +5,28 @@ 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
|
+
/** Radar wedge radius mode: share within symbol (default) or absolute values across map. */
|
|
16
|
+
radarValueMode?: 'share' | 'absolute'
|
|
17
|
+
minSize?: number
|
|
18
|
+
maxSize?: number
|
|
19
|
+
strokeFill?: string
|
|
20
|
+
strokeWidth?: number
|
|
21
|
+
reverseOrder?: boolean
|
|
22
|
+
/** Category code order for composition rendering. */
|
|
23
|
+
order?: string[]
|
|
24
|
+
stripesOrientation?: number
|
|
25
|
+
offsetAngle?: number
|
|
26
|
+
agePyramidHeightFactor?: number
|
|
27
|
+
otherColor?: string
|
|
28
|
+
otherText?: string
|
|
29
|
+
}
|
|
18
30
|
/** Tooltip pie radius. */
|
|
19
31
|
tooltipPieRadius?: number
|
|
20
32
|
/** Tooltip pie inner radius. */
|
|
@@ -23,18 +35,14 @@ export interface PieMapConfig extends MapConfig {
|
|
|
23
35
|
catColors?: Record<string, string>
|
|
24
36
|
/** Cat labels. */
|
|
25
37
|
catLabels?: Record<string, string>
|
|
26
|
-
/** Pie other color. */
|
|
27
|
-
pieOtherColor?: string
|
|
28
|
-
/** Pie other text. */
|
|
29
|
-
pieOtherText?: string
|
|
30
38
|
/** Show only when complete. */
|
|
31
39
|
showOnlyWhenComplete?: boolean
|
|
32
40
|
/** No data fill style. */
|
|
33
41
|
noDataFillStyle?: string
|
|
34
42
|
/** Dorling. */
|
|
35
43
|
dorling?: boolean
|
|
36
|
-
/**
|
|
37
|
-
|
|
44
|
+
/** Total code used to compute optional 'other' composition share. */
|
|
45
|
+
compositionTotalCode?: string
|
|
38
46
|
/** Stat codes. */
|
|
39
47
|
statCodes?: string[]
|
|
40
48
|
/** 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. */
|
|
@@ -21,34 +21,79 @@ export interface WaffleMap extends MapInstance {
|
|
|
21
21
|
noDataFillStyle(): string
|
|
22
22
|
noDataFillStyle(v: string): this
|
|
23
23
|
|
|
24
|
+
waffleSettings(): {
|
|
25
|
+
minSize?: number
|
|
26
|
+
maxSize?: number
|
|
27
|
+
gridSize?: number
|
|
28
|
+
cellPadding?: number
|
|
29
|
+
strokeFill?: string
|
|
30
|
+
strokeWidth?: number
|
|
31
|
+
roundedCorners?: number
|
|
32
|
+
tooltipSize?: number
|
|
33
|
+
otherColor?: string
|
|
34
|
+
otherText?: string
|
|
35
|
+
}
|
|
36
|
+
waffleSettings(v: {
|
|
37
|
+
minSize?: number
|
|
38
|
+
maxSize?: number
|
|
39
|
+
gridSize?: number
|
|
40
|
+
cellPadding?: number
|
|
41
|
+
strokeFill?: string
|
|
42
|
+
strokeWidth?: number
|
|
43
|
+
roundedCorners?: number
|
|
44
|
+
tooltipSize?: number
|
|
45
|
+
otherColor?: string
|
|
46
|
+
otherText?: string
|
|
47
|
+
}): this
|
|
48
|
+
|
|
49
|
+
/** @deprecated Use waffleSettings({ maxSize }) */
|
|
24
50
|
waffleMaxSize(): number
|
|
51
|
+
/** @deprecated Use waffleSettings({ maxSize }) */
|
|
25
52
|
waffleMaxSize(v: number): this
|
|
26
53
|
|
|
54
|
+
/** @deprecated Use waffleSettings({ minSize }) */
|
|
27
55
|
waffleMinSize(): number
|
|
56
|
+
/** @deprecated Use waffleSettings({ minSize }) */
|
|
28
57
|
waffleMinSize(v: number): this
|
|
29
58
|
|
|
59
|
+
/** @deprecated Use waffleSettings({ gridSize }) */
|
|
30
60
|
waffleGridSize(): number
|
|
61
|
+
/** @deprecated Use waffleSettings({ gridSize }) */
|
|
31
62
|
waffleGridSize(v: number): this
|
|
32
63
|
|
|
64
|
+
/** @deprecated Use waffleSettings({ cellPadding }) */
|
|
33
65
|
waffleCellPadding(): number
|
|
66
|
+
/** @deprecated Use waffleSettings({ cellPadding }) */
|
|
34
67
|
waffleCellPadding(v: number): this
|
|
35
68
|
|
|
69
|
+
/** @deprecated Use waffleSettings({ otherColor }) */
|
|
36
70
|
waffleOtherColor(): string
|
|
71
|
+
/** @deprecated Use waffleSettings({ otherColor }) */
|
|
37
72
|
waffleOtherColor(v: string): this
|
|
38
73
|
|
|
74
|
+
/** @deprecated Use waffleSettings({ otherText }) */
|
|
39
75
|
waffleOtherText(): string
|
|
76
|
+
/** @deprecated Use waffleSettings({ otherText }) */
|
|
40
77
|
waffleOtherText(v: string): this
|
|
41
78
|
|
|
79
|
+
/** @deprecated Use waffleSettings({ strokeFill }) */
|
|
42
80
|
waffleStrokeFill(): string
|
|
81
|
+
/** @deprecated Use waffleSettings({ strokeFill }) */
|
|
43
82
|
waffleStrokeFill(v: string): this
|
|
44
83
|
|
|
84
|
+
/** @deprecated Use waffleSettings({ strokeWidth }) */
|
|
45
85
|
waffleStrokeWidth(): number
|
|
86
|
+
/** @deprecated Use waffleSettings({ strokeWidth }) */
|
|
46
87
|
waffleStrokeWidth(v: number): this
|
|
47
88
|
|
|
89
|
+
/** @deprecated Use waffleSettings({ roundedCorners }) */
|
|
48
90
|
waffleRoundedCorners(): number
|
|
91
|
+
/** @deprecated Use waffleSettings({ roundedCorners }) */
|
|
49
92
|
waffleRoundedCorners(v: number): this
|
|
50
93
|
|
|
94
|
+
/** @deprecated Use waffleSettings({ tooltipSize }) */
|
|
51
95
|
waffleTooltipSize(): number
|
|
96
|
+
/** @deprecated Use waffleSettings({ tooltipSize }) */
|
|
52
97
|
waffleTooltipSize(v: number): this
|
|
53
98
|
|
|
54
99
|
dorling(): boolean
|
|
@@ -5,29 +5,43 @@ import type { WaffleLegendConfig } from '../../../legend/composition/WaffleLegen
|
|
|
5
5
|
* Configuration for waffle chart composition maps.
|
|
6
6
|
*/
|
|
7
7
|
export interface WaffleMapConfig extends MapConfig {
|
|
8
|
-
/**
|
|
8
|
+
/** Consolidated waffle chart settings. */
|
|
9
|
+
waffleSettings?: {
|
|
10
|
+
minSize?: number
|
|
11
|
+
maxSize?: number
|
|
12
|
+
gridSize?: number
|
|
13
|
+
cellPadding?: number
|
|
14
|
+
strokeFill?: string
|
|
15
|
+
strokeWidth?: number
|
|
16
|
+
roundedCorners?: number
|
|
17
|
+
tooltipSize?: number
|
|
18
|
+
otherColor?: string
|
|
19
|
+
otherText?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** @deprecated Use waffleSettings.minSize */
|
|
9
23
|
waffleMinSize?: number
|
|
10
|
-
/**
|
|
24
|
+
/** @deprecated Use waffleSettings.maxSize */
|
|
11
25
|
waffleMaxSize?: number
|
|
12
|
-
/**
|
|
26
|
+
/** @deprecated Use waffleSettings.gridSize */
|
|
13
27
|
waffleGridSize?: number
|
|
14
|
-
/**
|
|
28
|
+
/** @deprecated Use waffleSettings.cellPadding */
|
|
15
29
|
waffleCellPadding?: number
|
|
16
|
-
/**
|
|
30
|
+
/** @deprecated Use waffleSettings.strokeFill */
|
|
17
31
|
waffleStrokeFill?: string
|
|
18
|
-
/**
|
|
32
|
+
/** @deprecated Use waffleSettings.strokeWidth */
|
|
19
33
|
waffleStrokeWidth?: number
|
|
20
|
-
/**
|
|
34
|
+
/** @deprecated Use waffleSettings.roundedCorners */
|
|
21
35
|
waffleRoundedCorners?: number
|
|
22
|
-
/**
|
|
36
|
+
/** @deprecated Use waffleSettings.tooltipSize */
|
|
23
37
|
waffleTooltipSize?: number
|
|
24
38
|
/** Cat colors. */
|
|
25
39
|
catColors?: Record<string, string>
|
|
26
40
|
/** Cat labels. */
|
|
27
41
|
catLabels?: Record<string, string>
|
|
28
|
-
/**
|
|
42
|
+
/** @deprecated Use waffleSettings.otherColor */
|
|
29
43
|
waffleOtherColor?: string
|
|
30
|
-
/**
|
|
44
|
+
/** @deprecated Use waffleSettings.otherText */
|
|
31
45
|
waffleOtherText?: string
|
|
32
46
|
/** Show only when complete. */
|
|
33
47
|
showOnlyWhenComplete?: boolean
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MapInstance } from '../../core/MapInstance'
|
|
2
|
-
import type { FlowMapConfig } from './FlowMapConfig'
|
|
3
|
-
|
|
4
|
-
/** Creates a flow map instance */
|
|
5
|
-
export function map(config?: FlowMapConfig): MapInstance
|
|
1
|
+
import type { MapInstance } from '../../core/MapInstance'
|
|
2
|
+
import type { FlowMapConfig } from './FlowMapConfig'
|
|
3
|
+
|
|
4
|
+
/** Creates a flow map instance */
|
|
5
|
+
export function map(config?: FlowMapConfig): MapInstance
|
|
@@ -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.5",
|
|
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": "",
|
|
@@ -39,13 +38,14 @@
|
|
|
39
38
|
"build-prod-debug": "webpack --config webpack/webpack.config.debug-size.js",
|
|
40
39
|
"format": "prettier --write .",
|
|
41
40
|
"copy-types": "copyfiles -u 2 \"src/types/**/*.d.ts\" build/types",
|
|
42
|
-
"check:types:legend-config-sync": "node
|
|
41
|
+
"check:types:legend-config-sync": "node 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
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
43
|
+
"update-all": "npm run update-types && npm run update-docs && npm run update-examples",
|
|
44
|
+
"update-types": "node scripts/update-types.js",
|
|
45
|
+
"update-docs": "typedoc --options typedoc.json",
|
|
46
|
+
"update-examples": "npm run update-examples-manifest && npm run generate-previews",
|
|
47
47
|
"update-examples-manifest": "node examples/scripts/update-examples-manifest.js",
|
|
48
|
-
"
|
|
48
|
+
"generate-previews": "node examples/scripts/generate-previews.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"d3-array": "^3.2.4",
|