eurostat-map 4.9.2 → 4.9.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.9.2",
3
+ "version": "4.9.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
6
  "eurostat",
@@ -1,7 +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
+ import type { RankedBarChartConfig } from './decoration/RankedBarChartConfig'
5
5
  import type { TooltipConfig } from './TooltipConfig'
6
6
  import type { InsetConfig } from './InsetConfig'
7
7
  import type { MapInstance as EurostatMap } from './MapInstance'
@@ -4,7 +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
+ import type { RankedBarChartConfig } from './decoration/RankedBarChartConfig'
8
8
  import type { TooltipConfig } from './TooltipConfig'
9
9
  import type { InsetConfig } from './InsetConfig'
10
10
  import type { CoastalMarginSettings } from './decoration/CoastalMarginSettings'
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Configuration for the ranked bar chart map element: one horizontal bar per region, sorted by
3
+ * value, labeled with its id and value. Colored by the region's own class color on map/layer types
4
+ * that classify regions into colored classes (choropleth, proportional symbols' color encoding),
5
+ * or a flat fallback color otherwise. Above an internal region-count threshold, falls back
6
+ * automatically to the histogram distribution view instead of drawing one bar per region.
7
+ *
8
+ * A standalone chart element - not a legend and not a sub-feature of one, and deliberately not an
9
+ * extension of LegendConfig: it has its own container/positioning and doesn't carry the
10
+ * legend-only concepts (no-data swatch, max/min labels, etc.) that don't apply to it. Set via
11
+ * `map.rankedBarChart(config)`, separately from `map.legend(config)`.
12
+ */
13
+ export interface RankedBarChartConfig {
14
+ /** Id of the SVG element to render the chart into. Can be a completely different container/
15
+ * SVG to the legend's. @default an internally-generated id */
16
+ svgId?: string
17
+ /** Chart origin x-coordinate in pixels. */
18
+ x?: number
19
+ /** Chart origin y-coordinate in pixels. */
20
+ y?: number
21
+ /** Automatically position the chart in a map corner. Manual x/y coordinates take precedence. */
22
+ position?: 'top right' | 'bottom right' | 'top left' | 'bottom left'
23
+ /** Approximate box width in pixels, used only as a fallback when auto-positioning in a corner
24
+ * without explicit x/y. @default 150 */
25
+ width?: number
26
+ /** Maximum total height in pixels for the rendered chart (title/subtitle + bars). When the
27
+ * natural height of all bars would exceed this, bar height and label font size are both
28
+ * scaled down proportionally so the chart never grows taller than this budget. Omit to let
29
+ * the chart grow to fit its content - its natural height with ~35 EU/EFTA/CC regions can
30
+ * easily exceed a map's own height. */
31
+ height?: number
32
+
33
+ /** Chart title text. */
34
+ title?: string
35
+ /** Chart subtitle text. */
36
+ subtitle?: string
37
+
38
+ /** Inner spacing around the chart content in pixels. @default 7 */
39
+ boxPadding?: number
40
+ /** Background opacity of the chart's box. @default 0.9 */
41
+ boxOpacity?: number
42
+ /** Apply the chart box's background opacity (boxOpacity) only while the map is currently
43
+ * zoomed in (scale != 1). Purely a box-opacity concern - does not affect hover interactions
44
+ * (e.g. hover-to-highlight), which always work regardless of zoom state. */
45
+ onlyApplyOpacityWhileZoomed?: boolean
46
+
47
+ /** Bar height in pixels, before any height-based scaling (see height). @default 20 */
48
+ shapeHeight?: number
49
+ /** Label font size in pixels, before any height-based scaling (see height).
50
+ * @default read from the .em-legend-label CSS class */
51
+ labelFontSize?: number
52
+ /** Custom formatter for each region's value label. */
53
+ labelFormatter?: ((value: number, index?: number) => string) | null
54
+ /** Number of decimal places for auto-formatted value labels. Auto-detected when undefined. */
55
+ decimals?: number
56
+
57
+ /** Sort bars in ascending order of value when true, descending when false. @default true */
58
+ ascending?: boolean
59
+
60
+ /** Limit which regions appear to a political grouping: EU member states, EU + EFTA, or
61
+ * EU + EFTA + EU candidate countries. Applied before the region-count threshold that
62
+ * triggers the histogram distribution fallback. Omit (default) to show every region with
63
+ * a value, unfiltered. */
64
+ countryGroup?: 'eu' | 'euEfta' | 'euEftaCc'
65
+ }
@@ -65,6 +65,7 @@ export type { CoastalMarginSettings } from './core/decoration/CoastalMarginSetti
65
65
  export type { ScalebarConfig } from './core/decoration/ScalebarConfig'
66
66
  export type { StampConfig } from './core/decoration/StampConfig'
67
67
  export type { LabelsConfig, Label } from './core/decoration/LabelsConfig'
68
+ export type { RankedBarChartConfig } from './core/decoration/RankedBarChartConfig'
68
69
  export type { GridCartogramSettings, GridCartogramMargins } from './core/GridCartogramSettings'
69
70
  export type { DorlingSettings, DorlingStrength } from './core/DorlingSettings'
70
71
  export type { MinimapConfig } from './core/minimaps'
@@ -87,7 +88,6 @@ export type { ChoroplethLegendConfig } from './legend/choropleth/ChoroplethLegen
87
88
  export type { BivariateLegendConfig } from './legend/choropleth/BivariateLegendConfig'
88
89
  export type { HistogramLegendConfig } from './legend/choropleth/HistogramLegendConfig'
89
90
  export type { TrivariateLegendConfig } from './legend/choropleth/TrivariateLegendConfig'
90
- export type { RankedBarChartConfig } from './legend/choropleth/RankedBarChartConfig'
91
91
 
92
92
  // Composition legend types
93
93
  export type { BarChartLegendConfig } from './legend/composition/BarChartLegendConfig'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eurostat-map",
3
- "version": "4.9.2",
3
+ "version": "4.9.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
6
  "cartography",
@@ -1,22 +0,0 @@
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
- }