eurostat-map 4.8.6 → 4.9.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.8.6",
3
+ "version": "4.9.0",
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",
@@ -1,6 +1,7 @@
1
1
  import type { StatConfig } from './stat/StatConfig'
2
2
  import type { CompositionStatConfig } from '../layers/composition/CompositionStatConfig'
3
3
  import type { LegendConfig } from '../legend/LegendConfig'
4
+ import type { RankedBarChartConfig } from '../legend/choropleth/RankedBarChartConfig'
4
5
  import type { TooltipConfig } from './TooltipConfig'
5
6
  import type { InsetConfig } from './InsetConfig'
6
7
  import type { MapInstance as EurostatMap } from './MapInstance'
@@ -73,6 +74,13 @@ export interface MapConfig {
73
74
  /** Legend configuration. */
74
75
  legend?: LegendConfig | false
75
76
 
77
+ /**
78
+ * Ranked bar chart configuration (choropleth-classified map types only). Independent of the
79
+ * legend - has its own positioning and can render into an entirely different container/SVG
80
+ * to the legend's, rather than being a sub-feature of it.
81
+ */
82
+ rankedBarChart?: RankedBarChartConfig | false
83
+
76
84
  /** Tooltip configuration. */
77
85
  tooltip?: TooltipConfig
78
86
 
@@ -4,6 +4,7 @@ import type { Layer } from './layer/Layer'
4
4
  import type { LayerConfig } from './layer/LayerConfig'
5
5
  import type { CompositionStatConfig } from '../layers/composition/CompositionStatConfig'
6
6
  import type { LegendConfig } from '../legend/LegendConfig'
7
+ import type { RankedBarChartConfig } from '../legend/choropleth/RankedBarChartConfig'
7
8
  import type { TooltipConfig } from './TooltipConfig'
8
9
  import type { InsetConfig } from './InsetConfig'
9
10
  import type { CoastalMarginSettings } from './decoration/CoastalMarginSettings'
@@ -204,6 +205,20 @@ export interface MapInstance {
204
205
  /** Force-update the legend after data or style changes. */
205
206
  updateLegend(): this
206
207
 
208
+ /** Ranked bar chart. */
209
+
210
+ /**
211
+ * Get or set ranked bar chart configuration (choropleth-classified map types only). Pass
212
+ * false to remove it. Independent of the legend - has its own positioning and can render
213
+ * into an entirely different container/SVG to the legend's.
214
+ * @example map.rankedBarChart({ svgId: 'my-bar-chart-container' })
215
+ */
216
+ rankedBarChart(): RankedBarChartConfig | false
217
+ rankedBarChart(config: RankedBarChartConfig | false): this
218
+
219
+ /** Force-update the ranked bar chart after data or style changes. */
220
+ updateRankedBarChart(): this
221
+
207
222
  /** Tooltip. */
208
223
 
209
224
  /** Get or set tooltip configuration. */
@@ -87,6 +87,7 @@ export type { ChoroplethLegendConfig } from './legend/choropleth/ChoroplethLegen
87
87
  export type { BivariateLegendConfig } from './legend/choropleth/BivariateLegendConfig'
88
88
  export type { HistogramLegendConfig } from './legend/choropleth/HistogramLegendConfig'
89
89
  export type { TrivariateLegendConfig } from './legend/choropleth/TrivariateLegendConfig'
90
+ export type { RankedBarChartConfig } from './legend/choropleth/RankedBarChartConfig'
90
91
 
91
92
  // Composition legend types
92
93
  export type { BarChartLegendConfig } from './legend/composition/BarChartLegendConfig'
@@ -0,0 +1,22 @@
1
+ import type { LegendConfig } from '../LegendConfig'
2
+
3
+ /**
4
+ * Configuration for the ranked bar chart element on choropleth-classified maps: one horizontal
5
+ * bar per region, sorted by value, colored by the region's own class color, labeled with its id
6
+ * and value. Above an internal region-count threshold, falls back automatically to the histogram
7
+ * distribution view instead of drawing one bar per region.
8
+ *
9
+ * Independent of the legend - has its own positioning (inherited from LegendConfig's x/y/
10
+ * position/width fields) and can render into an entirely different container/SVG to the
11
+ * legend's, rather than being a sub-feature of it. Set via `map.rankedBarChart(config)`,
12
+ * separately from `map.legend(config)`.
13
+ */
14
+ export interface RankedBarChartConfig extends LegendConfig {
15
+ /**
16
+ * Limit which regions appear to a political grouping: EU member states, EU + EFTA, or
17
+ * EU + EFTA + EU candidate countries. Applied before the region-count threshold that
18
+ * triggers the histogram distribution fallback. Omit (default) to show every region with
19
+ * a value, unfiltered.
20
+ */
21
+ countryGroup?: 'eu' | 'euEfta' | 'euEftaCc'
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.8.6",
3
+ "version": "4.9.0",
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
  "cartography",