ethiopia-map 0.1.6 → 0.2.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/dist/index.d.ts CHANGED
@@ -9,4 +9,4 @@ export { EthiopiaMapProvider, EthiopiaMapRoot, useEthiopiaMap, } from "./context
9
9
  export { defaultLocations, defaultRegionData, defaultRegionServiceStats, } from "./data/defaultData";
10
10
  export { regionPathMap, type RegionPathMapping } from "./data/regionPaths";
11
11
  export { ETHIOPIA_AUTO_TOUR_SEQUENCE, ETHIOPIA_REGION_IDS } from "./types";
12
- export type { AutoTourStep, ComparisonDirection, ComparisonOutcome, EthiopiaLocationsPanelProps, EthiopiaMapConfig, EthiopiaMapHandle, EthiopiaMapLayer, EthiopiaMapEra, EthiopiaMapLegendProps, EthiopiaMapProps, EthiopiaMapProviderProps, EthiopiaMapSelection, EthiopiaRegionId, EthiopiaServiceRowsIncrementalConfig, EthiopiaSelectedRegionCardProps, EthiopiaTheme, EthiopiaViewMode, ExportVideoOptions, LatLngLocation, PartialRegionRecord, RegionDatum, RegionRecord, RegionSummaryStat, RegionServiceStats, SelectionAnimationMode, ServiceComparison, ServiceStat, ServiceValueKind, } from "./types";
12
+ export type { AutoTourStep, ComparisonDirection, ComparisonOutcome, EthiopiaLocationsPanelProps, EthiopiaMapConfig, EthiopiaMapHandle, EthiopiaMapLayer, EthiopiaMapEra, EthiopiaMapLegendProps, EthiopiaMapProps, EthiopiaMapProviderProps, EthiopiaMapSelection, EthiopiaRegionId, EthiopiaServiceRowsIncrementalConfig, EthiopiaSelectedRegionCardProps, EthiopiaTheme, EthiopiaViewMode, ExportVideoOptions, FormatRegionValue, LatLngLocation, PartialRegionRecord, RegionDatum, RegionRecord, RegionSummaryStat, RegionServiceStats, SelectionAnimationMode, ServiceComparison, ServiceStat, ServiceValueKind, ValueCalloutOffset, } from "./types";
package/dist/types.d.ts CHANGED
@@ -66,6 +66,12 @@ export interface EthiopiaMapSelection {
66
66
  regionId: EthiopiaRegionId | null;
67
67
  region: RegionDatum | null;
68
68
  }
69
+ /** Where a small region's callout label sits, relative to the region's centre (map units). */
70
+ export interface ValueCalloutOffset {
71
+ dx: number;
72
+ dy: number;
73
+ }
74
+ export type FormatRegionValue = (value: number, regionId: EthiopiaRegionId, region: RegionDatum) => string;
69
75
  export interface EthiopiaMapConfig {
70
76
  theme?: EthiopiaTheme;
71
77
  era?: EthiopiaMapEra;
@@ -76,6 +82,21 @@ export interface EthiopiaMapConfig {
76
82
  viewMode?: EthiopiaViewMode;
77
83
  selectionAnimation?: SelectionAnimationMode;
78
84
  showLabels?: boolean;
85
+ /**
86
+ * Font for region names, values and bars. Default: the page's own font
87
+ * (the map inherits it). Also settable with the `--ethiopia-map-font` CSS variable.
88
+ */
89
+ fontFamily?: string;
90
+ /** Print each region's value on the map, under its name. */
91
+ showValues?: boolean;
92
+ /** How values are written on the map and in the bars view. Default: compact number (e.g. 62.3, 40.9M). */
93
+ formatValue?: FormatRegionValue;
94
+ /**
95
+ * Leader-line labels for regions too small to hold their own label.
96
+ * `true` (default) uses built-in positions for Addis Ababa, Dire Dawa and
97
+ * Harari; pass offsets to move or add regions, or `false` to turn them off.
98
+ */
99
+ valueCallouts?: boolean | PartialRegionRecord<ValueCalloutOffset>;
79
100
  showMarkers?: boolean;
80
101
  showInMapStats?: boolean;
81
102
  autoTour?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ethiopia-map",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Interactive Ethiopian map components for React and Next.js applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",