eurostat-map 4.3.58 → 4.4.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.
- package/build/215.eurostatmap.min.js +1 -1
- package/build/eurostatmap.js +14318 -17933
- package/build/eurostatmap.min.js +2 -4
- package/build/eurostatmap.min.js.map +1 -1
- package/build/package.json +87 -0
- package/build/types/core/InsetConfig.d.ts +15 -0
- package/build/types/core/MapConfig.d.ts +85 -0
- package/build/types/core/MapInstance.d.ts +354 -0
- package/build/types/core/MinimapConfig.d.ts +11 -0
- package/build/types/core/TooltipConfig.d.ts +13 -0
- package/build/types/core/decoration/ScalebarConfig.d.ts +48 -0
- package/build/types/core/decoration/StampConfig.d.ts +71 -0
- package/build/types/core/geo/centroids.d.ts +33 -0
- package/build/types/core/geo/geometries.d.ts +56 -0
- package/build/types/core/geo/kosovo.d.ts +10 -0
- package/build/types/core/geo/proj4.d.ts +26 -0
- package/build/types/core/geo/projection.d.ts +29 -0
- package/build/types/core/insets.d.ts +16 -0
- package/build/types/core/layout.d.ts +23 -0
- package/build/types/core/locations.d.ts +55 -0
- package/build/types/core/minimaps.d.ts +20 -0
- package/build/types/core/scale.d.ts +30 -0
- package/build/types/core/stat/StatConfig.d.ts +27 -0
- package/build/types/core/stat/StatData.d.ts +107 -0
- package/build/types/core/utils.d.ts +194 -0
- package/build/types/core/zoom.d.ts +21 -0
- package/build/types/index.d.ts +237 -0
- package/build/types/legend/CategoricalLegendConfig.d.ts +13 -0
- package/build/types/legend/CoxcombLegendConfig.d.ts +85 -0
- package/build/types/legend/LegendConfig.d.ts +43 -0
- package/build/types/legend/MushroomLegendConfig.d.ts +56 -0
- package/build/types/legend/PatternFillLegendConfig.d.ts +11 -0
- package/build/types/legend/PieChartLegendConfig.d.ts +68 -0
- package/build/types/legend/SparklineLegendConfig.d.ts +68 -0
- package/build/types/legend/StripeCompositionLegendConfig.d.ts +11 -0
- package/build/types/legend/WaffleLegendConfig.d.ts +74 -0
- package/build/types/legend/choropleth/BivariateLegendConfig.d.ts +59 -0
- package/build/types/legend/choropleth/ChoroplethLegendConfig.d.ts +0 -0
- package/build/types/legend/choropleth/HistogramLegendConfig.d.ts +26 -0
- package/build/types/legend/choropleth/TrivariateLegendConfig.d.ts +32 -0
- package/build/types/legend/choropleth/legend-choropleth-bivariate.d.ts +2 -0
- package/build/types/legend/choropleth/legend-choropleth-trivariate.d.ts +2 -0
- package/build/types/legend/choropleth/legend-choropleth.d.ts +2 -0
- package/build/types/legend/composition/BarChartLegendConfig.d.ts +68 -0
- package/build/types/legend/composition/legend-bar-chart.d.ts +2 -0
- package/build/types/legend/flow/FlowLegendConfig.d.ts +0 -0
- package/build/types/legend/flow/FlowMapLegendConfig.d.ts +117 -0
- package/build/types/legend/flow/legend-flow.d.ts +2 -0
- package/build/types/legend/legend-categorical.d.ts +2 -0
- package/build/types/legend/legend-continuous.d.ts +2 -0
- package/build/types/legend/legend-discrete.d.ts +2 -0
- package/build/types/legend/legend.d.ts +13 -0
- package/build/types/legend/proportional-symbol/PropSymbolLegendConfig.d.ts +0 -0
- package/build/types/legend/proportional-symbol/ProportionalSymbolsLegendConfig.d.ts +134 -0
- package/build/types/legend/proportional-symbol/legend-proportional-symbols.d.ts +2 -0
- package/build/types/map-types/CategoricalMap.d.ts +21 -0
- package/build/types/map-types/CategoricalMapConfig.d.ts +11 -0
- package/build/types/map-types/CateogricalMapConfig.d.ts +11 -0
- package/build/types/map-types/MapType.d.ts +34 -0
- package/build/types/map-types/choropleth/BivariateChoroplethConfig.d.ts +15 -0
- package/build/types/map-types/choropleth/BivariateChoroplethMap.d.ts +39 -0
- package/build/types/map-types/choropleth/ChoroplethConfig.d.ts +29 -0
- package/build/types/map-types/choropleth/ChoroplethMap.d.ts +48 -0
- package/build/types/map-types/choropleth/TrivariateChoroplethConfig.d.ts +18 -0
- package/build/types/map-types/choropleth/TrivariateChoroplethMap.d.ts +15 -0
- package/build/types/map-types/choropleth/ValueByAlphaConfig.d.ts +8 -0
- package/build/types/map-types/choropleth/ValueByAlphaMap.d.ts +9 -0
- package/build/types/map-types/choropleth/map-choropleth-bivariate.d.ts +4 -0
- package/build/types/map-types/choropleth/map-choropleth-trivariate.d.ts +4 -0
- package/build/types/map-types/choropleth/map-choropleth.d.ts +47 -0
- package/build/types/map-types/choropleth/map-value-by-alpha.d.ts +4 -0
- package/build/types/map-types/composition/BarMap.d.ts +86 -0
- package/build/types/map-types/composition/BarMapConfig.d.ts +30 -0
- package/build/types/map-types/composition/CompositionStatConfig.d.ts +21 -0
- package/build/types/map-types/composition/CoxcombMap.d.ts +42 -0
- package/build/types/map-types/composition/CoxcombMapConfig.d.ts +18 -0
- package/build/types/map-types/composition/PieMap.d.ts +62 -0
- package/build/types/map-types/composition/PieMapConfig.d.ts +24 -0
- package/build/types/map-types/composition/SparkMap.d.ts +46 -0
- package/build/types/map-types/composition/SparkMapConfig.d.ts +25 -0
- package/build/types/map-types/composition/StripeMap.d.ts +43 -0
- package/build/types/map-types/composition/StripeMapConfig.d.ts +16 -0
- package/build/types/map-types/composition/WaffleMap.d.ts +71 -0
- package/build/types/map-types/composition/WaffleMapConfig.d.ts +25 -0
- package/build/types/map-types/composition/bar/BarMap.d.ts +78 -0
- package/build/types/map-types/composition/bar/BarMapConfig.d.ts +30 -0
- package/build/types/map-types/composition/composition-map.d.ts +25 -0
- package/build/types/map-types/composition/coxcomb/CoxcombMap.d.ts +42 -0
- package/build/types/map-types/composition/coxcomb/CoxcombMapConfig.d.ts +18 -0
- package/build/types/map-types/composition/coxcomb/CoxcombStatConfig.d.ts +14 -0
- package/build/types/map-types/composition/map-bar.d.ts +5 -0
- package/build/types/map-types/composition/map-coxcomb.d.ts +5 -0
- package/build/types/map-types/composition/map-pie.d.ts +10 -0
- package/build/types/map-types/composition/map-spark.d.ts +5 -0
- package/build/types/map-types/composition/map-stripe.d.ts +5 -0
- package/build/types/map-types/composition/map-waffle.d.ts +5 -0
- package/build/types/map-types/composition/pie/PieMap.d.ts +62 -0
- package/build/types/map-types/composition/pie/PieMapConfig.d.ts +24 -0
- package/build/types/map-types/composition/stripe/StripeMap.d.ts +43 -0
- package/build/types/map-types/composition/stripe/StripeMapConfig.d.ts +16 -0
- package/build/types/map-types/composition/waffle/WaffleMap.d.ts +71 -0
- package/build/types/map-types/composition/waffle/WaffleMapConfig.d.ts +25 -0
- package/build/types/map-types/flow/FlowMap.d.ts +97 -0
- package/build/types/map-types/flow/FlowMapConfig.d.ts +103 -0
- package/build/types/map-types/flow/map-flow.d.ts +5 -0
- package/build/types/map-types/map-categorical.d.ts +19 -0
- package/build/types/map-types/proportional-symbol/ProportionalSymbolConfig.d.ts +24 -0
- package/build/types/map-types/proportional-symbol/ProportionalSymbolMap.d.ts +99 -0
- package/build/types/map-types/proportional-symbol/map-proportional-symbols.d.ts +35 -0
- package/build/types/map-types/proportional-symbol/mushroom/MushroomMap.d.ts +30 -0
- package/build/types/map-types/proportional-symbol/mushroom/MushroomMapConfig.d.ts +15 -0
- package/build/types/map-types/spark/SparkMap.d.ts +48 -0
- package/build/types/map-types/spark/SparkMapConfig.d.ts +25 -0
- package/build/types/map-types/spark/SparkStatConfig.d.ts +10 -0
- package/build/types/utils/FillPatternOptions.d.ts +17 -0
- package/package.json +8 -5
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript definitions for eurostat-map
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// ==================== Core Type Imports (needed for local use in function signatures) ====================
|
|
6
|
+
|
|
7
|
+
import type { MapConfig } from './core/MapConfig'
|
|
8
|
+
import type { MapType } from './map-types/MapType'
|
|
9
|
+
import type { MapInstance } from './core/MapInstance'
|
|
10
|
+
|
|
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'
|
|
20
|
+
|
|
21
|
+
// Categorical map types
|
|
22
|
+
import type { CategoricalMapConfig } from './map-types/CategoricalMapConfig'
|
|
23
|
+
import type { CategoricalMap } from './map-types/CategoricalMap'
|
|
24
|
+
|
|
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'
|
|
30
|
+
|
|
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'
|
|
44
|
+
|
|
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'
|
|
49
|
+
|
|
50
|
+
// Flow map types
|
|
51
|
+
import type { FlowMapConfig } from './map-types/flow/FlowMapConfig'
|
|
52
|
+
import type { FlowMap } from './map-types/flow/FlowMap'
|
|
53
|
+
|
|
54
|
+
// ==================== Core Type Exports ====================
|
|
55
|
+
|
|
56
|
+
export type { MapConfig, MapType, MapInstance }
|
|
57
|
+
export type EurostatMap = MapInstance
|
|
58
|
+
export type { TooltipConfig } from './core/TooltipConfig'
|
|
59
|
+
export type { LegendConfig } from './legend/LegendConfig'
|
|
60
|
+
export type { StatConfig } from './core/stat/StatConfig'
|
|
61
|
+
export type { InsetConfig } from './core/InsetConfig'
|
|
62
|
+
|
|
63
|
+
// ==================== Legend Configuration Type Exports ====================
|
|
64
|
+
|
|
65
|
+
// Main legend types
|
|
66
|
+
export type { CategoricalLegendConfig } from './legend/CategoricalLegendConfig'
|
|
67
|
+
export type { CoxcombLegendConfig } from './legend/CoxcombLegendConfig'
|
|
68
|
+
export type { MushroomLegendConfig } from './legend/MushroomLegendConfig'
|
|
69
|
+
export type { PieChartLegendConfig } from './legend/PieChartLegendConfig'
|
|
70
|
+
export type { SparklineLegendConfig } from './legend/SparklineLegendConfig'
|
|
71
|
+
export type { WaffleLegendConfig } from './legend/WaffleLegendConfig'
|
|
72
|
+
export type { StripeCompositionLegendConfig } from './legend/StripeCompositionLegendConfig'
|
|
73
|
+
export type { PatternFillLegendConfig } from './legend/PatternFillLegendConfig'
|
|
74
|
+
|
|
75
|
+
// Choropleth legend types
|
|
76
|
+
export type { BivariateLegendConfig } from './legend/choropleth/BivariateLegendConfig'
|
|
77
|
+
export type { HistogramLegendConfig } from './legend/choropleth/HistogramLegendConfig'
|
|
78
|
+
|
|
79
|
+
// Composition legend types
|
|
80
|
+
export type { BarChartLegendConfig } from './legend/composition/BarChartLegendConfig'
|
|
81
|
+
|
|
82
|
+
// Flow legend types
|
|
83
|
+
export type { FlowMapLegendConfig } from './legend/flow/FlowMapLegendConfig'
|
|
84
|
+
|
|
85
|
+
// Proportional symbol legend types
|
|
86
|
+
export type { ProportionalSymbolsLegendConfig } from './legend/proportional-symbol/ProportionalSymbolsLegendConfig'
|
|
87
|
+
|
|
88
|
+
// ==================== Map Type Exports ====================
|
|
89
|
+
|
|
90
|
+
// Choropleth map types
|
|
91
|
+
export type {
|
|
92
|
+
ChoroplethConfig,
|
|
93
|
+
ChoroplethMap,
|
|
94
|
+
ValueByAlphaConfig,
|
|
95
|
+
ValueByAlphaMap,
|
|
96
|
+
BivariateChoroplethConfig,
|
|
97
|
+
BivariateChoroplethMap,
|
|
98
|
+
TrivariateChoroplethConfig,
|
|
99
|
+
TrivariateChoroplethMap,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Categorical map types
|
|
103
|
+
export type { CategoricalMapConfig, CategoricalMap }
|
|
104
|
+
|
|
105
|
+
// Proportional symbol map types
|
|
106
|
+
export type { ProportionalSymbolConfig, ProportionalSymbolMap, MushroomMapConfig, MushroomMap }
|
|
107
|
+
|
|
108
|
+
// Composition map types
|
|
109
|
+
export type {
|
|
110
|
+
CompositionStatConfig,
|
|
111
|
+
CoxcombMapConfig,
|
|
112
|
+
CoxcombMap,
|
|
113
|
+
CoxcombStatConfig,
|
|
114
|
+
BarMapConfig,
|
|
115
|
+
BarMap,
|
|
116
|
+
PieMapConfig,
|
|
117
|
+
PieMap,
|
|
118
|
+
StripeMapConfig,
|
|
119
|
+
StripeMap,
|
|
120
|
+
WaffleMapConfig,
|
|
121
|
+
WaffleMap,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Spark map types
|
|
125
|
+
export type { SparkMapConfig, SparkMap, SparkStatConfig }
|
|
126
|
+
|
|
127
|
+
// Flow map types
|
|
128
|
+
export type { FlowMapConfig, FlowMap }
|
|
129
|
+
|
|
130
|
+
// ==================== Pattern Fill Options ====================
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Options for fill pattern definitions
|
|
134
|
+
*/
|
|
135
|
+
export interface FillPatternOptions {
|
|
136
|
+
shape?: 'circle' | 'square'
|
|
137
|
+
patternSize?: number
|
|
138
|
+
minSize?: number
|
|
139
|
+
maxSize?: number
|
|
140
|
+
bckColor?: string
|
|
141
|
+
symbColor?: string
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ==================== Main Factory Function ====================
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Main factory function to create maps
|
|
148
|
+
*
|
|
149
|
+
* @param type - The type of map to create
|
|
150
|
+
* @param config - Configuration object
|
|
151
|
+
* @returns A map object with builder pattern methods
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* import eurostatmap from 'eurostatmap';
|
|
156
|
+
*
|
|
157
|
+
* const map = eurostatmap.map('choropleth', {
|
|
158
|
+
* title: 'Population Density',
|
|
159
|
+
* stat: { eurostatDatasetCode: 'demo_r_d3dens' }
|
|
160
|
+
* });
|
|
161
|
+
* map.build();
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export function map(type: 'choropleth' | 'ch', config?: ChoroplethConfig): ChoroplethMap
|
|
165
|
+
export function map(type: 'proportionalSymbol' | 'proportionalSymbols' | 'ps', config?: ProportionalSymbolConfig): ProportionalSymbolMap
|
|
166
|
+
export function map(type: 'categorical' | 'ct', config?: CategoricalMapConfig): CategoricalMap
|
|
167
|
+
export function map(type: 'bivariateChoropleth' | 'chbi', config?: BivariateChoroplethConfig): BivariateChoroplethMap
|
|
168
|
+
export function map(type: 'trivariateChoropleth' | 'ternary' | 'chtri', config?: TrivariateChoroplethConfig): TrivariateChoroplethMap
|
|
169
|
+
export function map(type: 'alpha' | 'valueByAlpha', config?: ValueByAlphaConfig): ValueByAlphaMap
|
|
170
|
+
export function map(type: 'coxcomb' | 'polar', config?: CoxcombMapConfig): CoxcombMap
|
|
171
|
+
export function map(type: 'bar' | 'barComposition', config?: BarMapConfig): BarMap
|
|
172
|
+
export function map(type: 'stripeComposition' | 'scomp' | 'stripe', config?: StripeMapConfig): StripeMap
|
|
173
|
+
export function map(type: 'waffle', config?: WaffleMapConfig): WaffleMap
|
|
174
|
+
export function map(type: 'mushroom', config?: MushroomMapConfig): MushroomMap
|
|
175
|
+
export function map(type: 'pieChart' | 'pie', config?: PieMapConfig): PieMap
|
|
176
|
+
export function map(type: 'sparkline' | 'spark' | 'sparklines', config?: SparkMapConfig): SparkMap
|
|
177
|
+
export function map(type: 'flow' | 'flowmap', config?: FlowMapConfig): FlowMap
|
|
178
|
+
export function map(type: MapType, config?: MapConfig): MapInstance
|
|
179
|
+
|
|
180
|
+
// ==================== Utility Functions ====================
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Get a function that defines fill patterns for legends
|
|
184
|
+
*
|
|
185
|
+
* @param opts - Pattern options
|
|
186
|
+
* @returns Function that creates pattern definitions
|
|
187
|
+
*/
|
|
188
|
+
export function getFillPatternDefinitionFunction(opts?: FillPatternOptions): (svg: any, numberOfClasses: number) => void
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated Use getFillPatternDefinitionFunction instead
|
|
192
|
+
*/
|
|
193
|
+
export function getFillPatternDefinitionFun(opts?: FillPatternOptions): (svg: any, numberOfClasses: number) => void
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Get default labels for the map
|
|
197
|
+
*/
|
|
198
|
+
export function getDefaultLabels(): { [key: string]: string }
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Project coordinates from map pixel space to geographic coordinates
|
|
202
|
+
*
|
|
203
|
+
* @param map - The map object
|
|
204
|
+
* @param x - X pixel coordinate
|
|
205
|
+
* @param y - Y pixel coordinate
|
|
206
|
+
* @returns [longitude, latitude]
|
|
207
|
+
*/
|
|
208
|
+
export function projectFromMap(map: MapInstance, x: number, y: number): [number, number]
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Project geographic coordinates to map pixel space
|
|
212
|
+
*
|
|
213
|
+
* @param map - The map object
|
|
214
|
+
* @param lon - Longitude
|
|
215
|
+
* @param lat - Latitude
|
|
216
|
+
* @returns [x, y] pixel coordinates
|
|
217
|
+
*/
|
|
218
|
+
export function projectToMap(map: MapInstance, lon: number, lat: number): [number, number]
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Library version
|
|
222
|
+
*/
|
|
223
|
+
export const version: string
|
|
224
|
+
|
|
225
|
+
// ==================== Default Export ====================
|
|
226
|
+
|
|
227
|
+
declare const eurostatmap: {
|
|
228
|
+
map: typeof map
|
|
229
|
+
getFillPatternDefinitionFunction: typeof getFillPatternDefinitionFunction
|
|
230
|
+
getFillPatternDefinitionFun: typeof getFillPatternDefinitionFun
|
|
231
|
+
getDefaultLabels: typeof getDefaultLabels
|
|
232
|
+
projectFromMap: typeof projectFromMap
|
|
233
|
+
projectToMap: typeof projectToMap
|
|
234
|
+
version: typeof version
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export default eurostatmap
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for categorical map legends.
|
|
5
|
+
* Used to display a legend with colored rectangles representing different categories.
|
|
6
|
+
*/
|
|
7
|
+
export interface CategoricalLegendConfig extends LegendConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Custom order for legend elements. If not specified, uses the domain order from the classifier.
|
|
10
|
+
* Provide an array of category codes in the desired display order.
|
|
11
|
+
*/
|
|
12
|
+
order?: string[]
|
|
13
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for size legend in coxcomb (polar area) charts.
|
|
5
|
+
*/
|
|
6
|
+
export interface CoxcombSizeLegendConfig {
|
|
7
|
+
/** Title for the size legend. */
|
|
8
|
+
title?: string | null
|
|
9
|
+
|
|
10
|
+
/** Padding between title and legend content in pixels. @default 15 */
|
|
11
|
+
titlePadding?: number
|
|
12
|
+
|
|
13
|
+
/** Custom values to display in the size legend. If not specified, values are auto-generated. */
|
|
14
|
+
values?: number[] | null
|
|
15
|
+
|
|
16
|
+
/** Custom labels for the size legend values. */
|
|
17
|
+
labels?: string[] | null
|
|
18
|
+
|
|
19
|
+
/** Custom formatter function for legend labels. */
|
|
20
|
+
labelFormatter?: ((value: number) => string) | null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for color legend in coxcomb (polar area) charts.
|
|
25
|
+
*/
|
|
26
|
+
export interface CoxcombColorLegendConfig {
|
|
27
|
+
/** Title for the color legend. */
|
|
28
|
+
title?: string | null
|
|
29
|
+
|
|
30
|
+
/** Padding between title and legend content in pixels. @default 15 */
|
|
31
|
+
titlePadding?: number
|
|
32
|
+
|
|
33
|
+
/** Top margin for the color legend in pixels. @default 23 */
|
|
34
|
+
marginTop?: number
|
|
35
|
+
|
|
36
|
+
/** Offset adjustments for labels. @default { x: 5, y: 5 } */
|
|
37
|
+
labelOffsets?: { x: number; y: number }
|
|
38
|
+
|
|
39
|
+
/** Width of color swatches in pixels. @default 25 */
|
|
40
|
+
shapeWidth?: number
|
|
41
|
+
|
|
42
|
+
/** Height of color swatches in pixels. @default 20 */
|
|
43
|
+
shapeHeight?: number
|
|
44
|
+
|
|
45
|
+
/** Padding between swatches in pixels. @default 1 */
|
|
46
|
+
shapePadding?: number
|
|
47
|
+
|
|
48
|
+
/** Whether to show a "no data" item. @default true */
|
|
49
|
+
noData?: boolean
|
|
50
|
+
|
|
51
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
52
|
+
noDataText?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Configuration for time legend in coxcomb (polar area) charts.
|
|
57
|
+
*/
|
|
58
|
+
export interface CoxcombTimeLegendConfig {
|
|
59
|
+
/** Title for the time legend. */
|
|
60
|
+
title?: string | null
|
|
61
|
+
|
|
62
|
+
/** Padding between title and legend content in pixels. @default 15 */
|
|
63
|
+
titlePadding?: number
|
|
64
|
+
|
|
65
|
+
/** Top margin for the time legend in pixels. @default 20 */
|
|
66
|
+
marginTop?: number
|
|
67
|
+
|
|
68
|
+
/** Radius of the time legend circle in pixels. @default 35 */
|
|
69
|
+
radius?: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Configuration for coxcomb (polar area) chart legends.
|
|
74
|
+
* Supports separate sub-legends for size, color, and time dimensions.
|
|
75
|
+
*/
|
|
76
|
+
export interface CoxcombLegendConfig extends LegendConfig {
|
|
77
|
+
/** Configuration for the wedge size legend. */
|
|
78
|
+
sizeLegend?: Partial<CoxcombSizeLegendConfig>
|
|
79
|
+
|
|
80
|
+
/** Configuration for the color/category legend. */
|
|
81
|
+
colorLegend?: Partial<CoxcombColorLegendConfig>
|
|
82
|
+
|
|
83
|
+
/** Configuration for the time period legend. */
|
|
84
|
+
timeLegend?: Partial<CoxcombTimeLegendConfig>
|
|
85
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent configuration for map legends. Each map type will extend this with its own specific properties, but these are the common ones that apply to all legend types.
|
|
3
|
+
*/
|
|
4
|
+
export interface LegendConfig {
|
|
5
|
+
x?: number
|
|
6
|
+
y?: number
|
|
7
|
+
width?: number
|
|
8
|
+
height?: number
|
|
9
|
+
|
|
10
|
+
title?: string
|
|
11
|
+
titleWidth?: number
|
|
12
|
+
titleFontSize?: number
|
|
13
|
+
|
|
14
|
+
// Box styling
|
|
15
|
+
boxWidth?: number
|
|
16
|
+
boxHeight?: number
|
|
17
|
+
boxPadding?: number
|
|
18
|
+
boxCornerRadius?: number
|
|
19
|
+
|
|
20
|
+
// Shape styling (for proportional symbol legends)
|
|
21
|
+
shapeWidth?: number
|
|
22
|
+
shapeHeight?: number
|
|
23
|
+
shapePadding?: number
|
|
24
|
+
|
|
25
|
+
// Label styling
|
|
26
|
+
labelFontSize?: number
|
|
27
|
+
labelOffset?: number
|
|
28
|
+
labelWrap?: number
|
|
29
|
+
labelDecimalPlaces?: number
|
|
30
|
+
|
|
31
|
+
// Orientation
|
|
32
|
+
orientation?: 'vertical' | 'horizontal'
|
|
33
|
+
ascending?: boolean
|
|
34
|
+
|
|
35
|
+
// Cells (for manual legend specification)
|
|
36
|
+
cells?: any[]
|
|
37
|
+
|
|
38
|
+
// No data label
|
|
39
|
+
noData?: boolean
|
|
40
|
+
noDataText?: string
|
|
41
|
+
|
|
42
|
+
[key: string]: any
|
|
43
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for size legend in mushroom (dual semi-circle) charts.
|
|
5
|
+
*/
|
|
6
|
+
export interface MushroomSizeLegendConfig {
|
|
7
|
+
/** Top margin for the size legend in pixels. @default 15 */
|
|
8
|
+
marginTop?: number
|
|
9
|
+
|
|
10
|
+
/** Custom values to display in the size legend (when using single scale). Raw data values. */
|
|
11
|
+
values?: number[]
|
|
12
|
+
|
|
13
|
+
/** Custom values for variable 1 side (when using independent scales). Raw data values. */
|
|
14
|
+
valuesV1?: number[]
|
|
15
|
+
|
|
16
|
+
/** Custom values for variable 2 side (when using independent scales). Raw data values. */
|
|
17
|
+
valuesV2?: number[]
|
|
18
|
+
|
|
19
|
+
/** Custom labels for the size legend values. */
|
|
20
|
+
labels?: string[] | null
|
|
21
|
+
|
|
22
|
+
/** Custom labels for variable 1 side. */
|
|
23
|
+
labelsV1?: string[] | null
|
|
24
|
+
|
|
25
|
+
/** Custom labels for variable 2 side. */
|
|
26
|
+
labelsV2?: string[] | null
|
|
27
|
+
|
|
28
|
+
/** Vertical spacing between legend items in pixels. @default 2 */
|
|
29
|
+
shapePadding?: number
|
|
30
|
+
|
|
31
|
+
/** Offset adjustments for labels. @default { x: 5, y: 0 } */
|
|
32
|
+
labelOffsets?: { x: number; y: number }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Configuration for color legend in mushroom (dual semi-circle) charts.
|
|
37
|
+
*/
|
|
38
|
+
export interface MushroomColorLegendConfig {
|
|
39
|
+
/** Top margin for the color legend in pixels. @default 5 */
|
|
40
|
+
marginTop?: number
|
|
41
|
+
|
|
42
|
+
/** Offset adjustments for labels. @default { x: 5, y: 5 } */
|
|
43
|
+
labelOffsets?: { x: number; y: number }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for mushroom (dual semi-circle) chart legends.
|
|
48
|
+
* Mushroom charts show two variables as semi-circles forming a circle, with size and color dimensions.
|
|
49
|
+
*/
|
|
50
|
+
export interface MushroomLegendConfig extends LegendConfig {
|
|
51
|
+
/** Configuration for the mushroom size legend. */
|
|
52
|
+
sizeLegend?: Partial<MushroomSizeLegendConfig>
|
|
53
|
+
|
|
54
|
+
/** Configuration for the color/category legend. */
|
|
55
|
+
colorLegend?: Partial<MushroomColorLegendConfig>
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for pattern fill legends.
|
|
5
|
+
* Used to display a legend showing hatching/pattern options for regions.
|
|
6
|
+
* The pattern fill legend is typically appended below the main choropleth legend.
|
|
7
|
+
*/
|
|
8
|
+
export interface PatternFillLegendConfig extends LegendConfig {
|
|
9
|
+
// Inherits all properties from LegendConfig
|
|
10
|
+
// Pattern fill legends use the base configuration for display
|
|
11
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for size legend in pie chart maps.
|
|
5
|
+
*/
|
|
6
|
+
export interface PieChartSizeLegendConfig {
|
|
7
|
+
/** Title for the size legend. */
|
|
8
|
+
title?: string | null
|
|
9
|
+
|
|
10
|
+
/** Padding between title and legend content in pixels. @default 10 */
|
|
11
|
+
titlePadding?: number
|
|
12
|
+
|
|
13
|
+
/** Custom values to display in the size legend. If not specified, values are auto-generated. */
|
|
14
|
+
values?: number[] | null
|
|
15
|
+
|
|
16
|
+
/** Custom formatter function for legend labels. */
|
|
17
|
+
labelFormatter?: ((value: number) => string) | undefined
|
|
18
|
+
|
|
19
|
+
/** Whether to show a "no data" item. @default false */
|
|
20
|
+
noData?: boolean
|
|
21
|
+
|
|
22
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
23
|
+
noDataText?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for color legend in pie chart maps.
|
|
28
|
+
*/
|
|
29
|
+
export interface PieChartColorLegendConfig {
|
|
30
|
+
/** Title for the color legend. */
|
|
31
|
+
title?: string | null
|
|
32
|
+
|
|
33
|
+
/** Padding between title and legend content in pixels. @default 10 */
|
|
34
|
+
titlePadding?: number
|
|
35
|
+
|
|
36
|
+
/** Top margin (distance from size legend) in pixels. @default 33 */
|
|
37
|
+
marginTop?: number
|
|
38
|
+
|
|
39
|
+
/** Offset adjustments for labels. @default { x: 5, y: 5 } */
|
|
40
|
+
labelOffsets?: { x: number; y: number }
|
|
41
|
+
|
|
42
|
+
/** Width of color swatches in pixels. @default 25 */
|
|
43
|
+
shapeWidth?: number
|
|
44
|
+
|
|
45
|
+
/** Height of color swatches in pixels. @default 20 */
|
|
46
|
+
shapeHeight?: number
|
|
47
|
+
|
|
48
|
+
/** Padding between swatches in pixels. @default 1 */
|
|
49
|
+
shapePadding?: number
|
|
50
|
+
|
|
51
|
+
/** Whether to show a "no data" item. @default true */
|
|
52
|
+
noData?: boolean
|
|
53
|
+
|
|
54
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
55
|
+
noDataText?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Configuration for pie chart map legends.
|
|
60
|
+
* Supports separate legends for pie size and slice colors.
|
|
61
|
+
*/
|
|
62
|
+
export interface PieChartLegendConfig extends LegendConfig {
|
|
63
|
+
/** Configuration for the pie size legend. Set to false to hide. */
|
|
64
|
+
sizeLegend?: Partial<PieChartSizeLegendConfig> | false
|
|
65
|
+
|
|
66
|
+
/** Configuration for the color/category legend. Set to false to hide. */
|
|
67
|
+
colorLegend?: Partial<PieChartColorLegendConfig> | false
|
|
68
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for scale legend in sparkline maps.
|
|
5
|
+
*/
|
|
6
|
+
export interface SparklineScaleLegendConfig {
|
|
7
|
+
/** Title for the scale legend section. */
|
|
8
|
+
title?: string | null
|
|
9
|
+
|
|
10
|
+
/** Padding between title and chart in pixels. @default 5 */
|
|
11
|
+
titlePadding?: number
|
|
12
|
+
|
|
13
|
+
/** Whether to show an example sparkline with averaged data. @default false */
|
|
14
|
+
showExampleChart?: boolean
|
|
15
|
+
|
|
16
|
+
/** Whether to show the region with maximum value. @default true */
|
|
17
|
+
showMaxRegion?: boolean
|
|
18
|
+
|
|
19
|
+
/** Custom example data for the sparkline. If null, uses averaged data. */
|
|
20
|
+
exampleData?: number[] | null
|
|
21
|
+
|
|
22
|
+
/** Number of ticks on Y axis. @default 5 */
|
|
23
|
+
tickCount?: number
|
|
24
|
+
|
|
25
|
+
/** Custom tick format function for Y axis values. */
|
|
26
|
+
tickFormat?: ((value: number) => string) | null
|
|
27
|
+
|
|
28
|
+
/** Whether to show X axis with date labels. @default true */
|
|
29
|
+
showXAxis?: boolean
|
|
30
|
+
|
|
31
|
+
/** Rotation angle for X axis labels in degrees. @default -45 */
|
|
32
|
+
xAxisRotation?: number
|
|
33
|
+
|
|
34
|
+
/** Step for showing X axis ticks (1 = every tick, 2 = every other, etc.). @default 1 */
|
|
35
|
+
xAxisTickStep?: number
|
|
36
|
+
|
|
37
|
+
/** Margins around the sparkline cell. Defaults to match the map's sparkline chart margin. */
|
|
38
|
+
margin?: { top: number; right: number; bottom: number; left: number }
|
|
39
|
+
|
|
40
|
+
/** Opacity of the sparkline. @default 0.5 */
|
|
41
|
+
lineOpacity?: number
|
|
42
|
+
|
|
43
|
+
/** Stroke width of the sparkline. @default 1 */
|
|
44
|
+
lineStrokeWidth?: number
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Configuration for no data legend in sparkline maps.
|
|
49
|
+
*/
|
|
50
|
+
export interface SparklineNoDataLegendConfig {
|
|
51
|
+
/** Whether to show the no data legend item. @default true */
|
|
52
|
+
show?: boolean
|
|
53
|
+
|
|
54
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
55
|
+
text?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Configuration for sparkline map legends.
|
|
60
|
+
* Shows the Y-axis scale and optionally an example sparkline chart.
|
|
61
|
+
*/
|
|
62
|
+
export interface SparklineLegendConfig extends LegendConfig {
|
|
63
|
+
/** Configuration for the scale legend showing Y-axis range. */
|
|
64
|
+
scaleLegend?: Partial<SparklineScaleLegendConfig>
|
|
65
|
+
|
|
66
|
+
/** Configuration for the no data legend. Set to false to hide. */
|
|
67
|
+
noDataLegend?: Partial<SparklineNoDataLegendConfig> | false
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for stripe composition map legends.
|
|
5
|
+
* Used to display a legend with colored rectangles representing different categories
|
|
6
|
+
* in stripe composition maps (regions divided into colored stripes showing composition).
|
|
7
|
+
*/
|
|
8
|
+
export interface StripeCompositionLegendConfig extends LegendConfig {
|
|
9
|
+
// Inherits all properties from LegendConfig
|
|
10
|
+
// No additional specific properties beyond the base legend configuration
|
|
11
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LegendConfig } from './LegendConfig'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for size legend in waffle chart maps.
|
|
5
|
+
*/
|
|
6
|
+
export interface WaffleSizeLegendConfig {
|
|
7
|
+
/** Title for the size legend. */
|
|
8
|
+
title?: string | null
|
|
9
|
+
|
|
10
|
+
/** Padding between title and legend content in pixels. @default 10 */
|
|
11
|
+
titlePadding?: number
|
|
12
|
+
|
|
13
|
+
/** Custom values to display in the size legend. If not specified, values are auto-generated. */
|
|
14
|
+
values?: number[] | null
|
|
15
|
+
|
|
16
|
+
/** Custom formatter function for legend labels. */
|
|
17
|
+
labelFormatter?: ((value: number) => string) | undefined
|
|
18
|
+
|
|
19
|
+
/** Simplified grid size for size legend examples (e.g., 5 means 5x5 = 25 cells). @default 5 */
|
|
20
|
+
gridSize?: number
|
|
21
|
+
|
|
22
|
+
/** Padding between cells in size legend in pixels. @default 0.5 */
|
|
23
|
+
cellPadding?: number
|
|
24
|
+
|
|
25
|
+
/** Whether to show a "no data" item. @default false */
|
|
26
|
+
noData?: boolean
|
|
27
|
+
|
|
28
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
29
|
+
noDataText?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Configuration for color legend in waffle chart maps.
|
|
34
|
+
*/
|
|
35
|
+
export interface WaffleColorLegendConfig {
|
|
36
|
+
/** Title for the color legend. */
|
|
37
|
+
title?: string | null
|
|
38
|
+
|
|
39
|
+
/** Padding between title and legend content in pixels. @default 10 */
|
|
40
|
+
titlePadding?: number
|
|
41
|
+
|
|
42
|
+
/** Top margin (distance from size legend) in pixels. @default 33 */
|
|
43
|
+
marginTop?: number
|
|
44
|
+
|
|
45
|
+
/** Offset adjustments for labels. @default { x: 5, y: 5 } */
|
|
46
|
+
labelOffsets?: { x: number; y: number }
|
|
47
|
+
|
|
48
|
+
/** Width of color swatches in pixels. @default 25 */
|
|
49
|
+
shapeWidth?: number
|
|
50
|
+
|
|
51
|
+
/** Height of color swatches in pixels. @default 20 */
|
|
52
|
+
shapeHeight?: number
|
|
53
|
+
|
|
54
|
+
/** Padding between swatches in pixels. @default 1 */
|
|
55
|
+
shapePadding?: number
|
|
56
|
+
|
|
57
|
+
/** Whether to show a "no data" item. @default true */
|
|
58
|
+
noData?: boolean
|
|
59
|
+
|
|
60
|
+
/** Text label for "no data" item. @default 'No data' */
|
|
61
|
+
noDataText?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Configuration for waffle chart map legends.
|
|
66
|
+
* Waffle charts display data as grids of small squares, with colors representing categories.
|
|
67
|
+
*/
|
|
68
|
+
export interface WaffleLegendConfig extends LegendConfig {
|
|
69
|
+
/** Configuration for the waffle size legend. */
|
|
70
|
+
sizeLegend?: Partial<WaffleSizeLegendConfig>
|
|
71
|
+
|
|
72
|
+
/** Configuration for the color/category legend. Set to false to hide. */
|
|
73
|
+
colorLegend?: Partial<WaffleColorLegendConfig> | false
|
|
74
|
+
}
|