@undp/data-viz 2.2.3 → 2.3.1

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.
Files changed (60) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.d.ts +4 -0
  4. package/dist/BiVariateChoroplethMap.js +328 -401
  5. package/dist/BiVariateChoroplethMap.js.map +1 -1
  6. package/dist/ChoroplethMap.cjs +1 -1
  7. package/dist/ChoroplethMap.cjs.map +1 -1
  8. package/dist/ChoroplethMap.d.ts +4 -0
  9. package/dist/ChoroplethMap.js +341 -416
  10. package/dist/ChoroplethMap.js.map +1 -1
  11. package/dist/Data/01.json +4042 -0
  12. package/dist/Data/mapData.json +4543 -0
  13. package/dist/Data/testMap.json +361 -0
  14. package/dist/DotDensityMap.cjs +1 -1
  15. package/dist/DotDensityMap.cjs.map +1 -1
  16. package/dist/DotDensityMap.d.ts +4 -0
  17. package/dist/DotDensityMap.js +297 -311
  18. package/dist/DotDensityMap.js.map +1 -1
  19. package/dist/{GraphEl-C1Rz1V__.js → GraphEl-L5hNe7wJ.js} +25 -17
  20. package/dist/GraphEl-L5hNe7wJ.js.map +1 -0
  21. package/dist/GraphEl-ic8C5Ksc.cjs +2 -0
  22. package/dist/GraphEl-ic8C5Ksc.cjs.map +1 -0
  23. package/dist/GriddedGraphs.cjs +1 -1
  24. package/dist/GriddedGraphs.d.ts +2 -0
  25. package/dist/GriddedGraphs.js +1 -1
  26. package/dist/GriddedGraphsFromConfig.d.ts +2 -0
  27. package/dist/HybridMap.cjs +1 -1
  28. package/dist/HybridMap.cjs.map +1 -1
  29. package/dist/HybridMap.d.ts +4 -0
  30. package/dist/HybridMap.js +398 -445
  31. package/dist/HybridMap.js.map +1 -1
  32. package/dist/MultiGraphDashboard.d.ts +2 -0
  33. package/dist/MultiGraphDashboardFromConfig.d.ts +2 -0
  34. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +2 -0
  35. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +2 -0
  36. package/dist/PerformanceIntensiveScrollStory.d.ts +2 -0
  37. package/dist/ScrollStory.d.ts +2 -0
  38. package/dist/SingleGraphDashboard.cjs +1 -1
  39. package/dist/SingleGraphDashboard.d.ts +2 -0
  40. package/dist/SingleGraphDashboard.js +1 -1
  41. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -0
  42. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +2 -0
  43. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +2 -0
  44. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +2 -0
  45. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +2 -0
  46. package/dist/Types.d.ts +2 -0
  47. package/dist/index-DLFt97gy.cjs +2 -0
  48. package/dist/index-DLFt97gy.cjs.map +1 -0
  49. package/dist/index-Dp_SfsUA.js +2344 -0
  50. package/dist/index-Dp_SfsUA.js.map +1 -0
  51. package/dist/index.d.ts +18 -0
  52. package/package.json +2 -1
  53. package/readme.md +0 -7
  54. package/dist/GraphEl-BZbunD1_.cjs +0 -2
  55. package/dist/GraphEl-BZbunD1_.cjs.map +0 -1
  56. package/dist/GraphEl-C1Rz1V__.js.map +0 -1
  57. package/dist/zoom-5AkJSuWO.js +0 -1864
  58. package/dist/zoom-5AkJSuWO.js.map +0 -1
  59. package/dist/zoom-ChcvXFIz.cjs +0 -2
  60. package/dist/zoom-ChcvXFIz.cjs.map +0 -1
@@ -0,0 +1,361 @@
1
+ {
2
+ "type": "FeatureCollection",
3
+ "features": [
4
+ {
5
+ "type": "Feature",
6
+ "geometry": {
7
+ "type": "MultiPolygon",
8
+ "coordinates": [
9
+ [
10
+ [
11
+ [
12
+ 16.5967051279,
13
+ 46.4758203254
14
+ ],
15
+ [
16
+ 16.2770767108,
17
+ 46.5186831293
18
+ ],
19
+ [
20
+ 15.6462970697,
21
+ 46.2154655364
22
+ ],
23
+ [
24
+ 15.6808362073,
25
+ 45.8438195183
26
+ ],
27
+ [
28
+ 15.2567298987,
29
+ 45.7218521503
30
+ ],
31
+ [
32
+ 15.3404331083,
33
+ 45.4562048762
34
+ ],
35
+ [
36
+ 14.8179041738,
37
+ 45.459940686
38
+ ],
39
+ [
40
+ 14.5967207577,
41
+ 45.6686980121
42
+ ],
43
+ [
44
+ 14.3266522743,
45
+ 45.4690556369
46
+ ],
47
+ [
48
+ 13.585806,
49
+ 45.4784814996
50
+ ],
51
+ [
52
+ 13.6175911573,
53
+ 45.1095277441
54
+ ],
55
+ [
56
+ 13.8969984103,
57
+ 44.7868698384
58
+ ],
59
+ [
60
+ 14.3083722722,
61
+ 45.3369769052
62
+ ],
63
+ [
64
+ 14.4780235396,
65
+ 45.3145671146
66
+ ],
67
+ [
68
+ 14.8453236361,
69
+ 45.1114106151
70
+ ],
71
+ [
72
+ 14.9891032338,
73
+ 44.5750356294
74
+ ],
75
+ [
76
+ 15.6262534394,
77
+ 44.1451014198
78
+ ],
79
+ [
80
+ 15.126583667,
81
+ 44.2770982422
82
+ ],
83
+ [
84
+ 15.2289734326,
85
+ 44.110361254
86
+ ],
87
+ [
88
+ 15.7189706826,
89
+ 43.7645069728
90
+ ],
91
+ [
92
+ 15.9910791008,
93
+ 43.850626328
94
+ ],
95
+ [
96
+ 15.8459619162,
97
+ 43.7767586781
98
+ ],
99
+ [
100
+ 15.9618876783,
101
+ 43.5023887751
102
+ ],
103
+ [
104
+ 16.474348688,
105
+ 43.5382615399
106
+ ],
107
+ [
108
+ 16.8943758464,
109
+ 43.38986332
110
+ ],
111
+ [
112
+ 17.5812103602,
113
+ 42.9383565347
114
+ ],
115
+ [
116
+ 17.6403244971,
117
+ 43.0894956436
118
+ ],
119
+ [
120
+ 16.1729585004,
121
+ 44.2098469036
122
+ ],
123
+ [
124
+ 16.0124817991,
125
+ 44.6532116426
126
+ ],
127
+ [
128
+ 15.72995142,
129
+ 44.8229421681
130
+ ],
131
+ [
132
+ 15.7739053578,
133
+ 45.1798834453
134
+ ],
135
+ [
136
+ 16.0101611031,
137
+ 45.2193436417
138
+ ],
139
+ [
140
+ 16.2905604819,
141
+ 44.9959673699
142
+ ],
143
+ [
144
+ 16.5326323622,
145
+ 45.2268946608
146
+ ],
147
+ [
148
+ 17.8515675736,
149
+ 45.0441033612
150
+ ],
151
+ [
152
+ 18.0130785609,
153
+ 45.1514903149
154
+ ],
155
+ [
156
+ 18.6040096199,
157
+ 45.0806343857
158
+ ],
159
+ [
160
+ 19.0221720664,
161
+ 44.8553667416
162
+ ],
163
+ [
164
+ 18.9896944267,
165
+ 44.9069936942
166
+ ],
167
+ [
168
+ 19.1379862181,
169
+ 45.1239982837
170
+ ],
171
+ [
172
+ 19.4151165406,
173
+ 45.2335343482
174
+ ],
175
+ [
176
+ 18.970709089,
177
+ 45.3902562092
178
+ ],
179
+ [
180
+ 18.97425858,
181
+ 45.4050630871
182
+ ],
183
+ [
184
+ 18.9873371714,
185
+ 45.4607395736
186
+ ],
187
+ [
188
+ 18.9876862747,
189
+ 45.485407801
190
+ ],
191
+ [
192
+ 18.8938423016,
193
+ 45.5735155186
194
+ ],
195
+ [
196
+ 18.9335112046,
197
+ 45.6489866508
198
+ ],
199
+ [
200
+ 18.8654053967,
201
+ 45.8063502626
202
+ ],
203
+ [
204
+ 18.8564438603,
205
+ 45.9094211027
206
+ ],
207
+ [
208
+ 18.4004061727,
209
+ 45.7500756748
210
+ ],
211
+ [
212
+ 17.8683160024,
213
+ 45.771074528
214
+ ],
215
+ [
216
+ 17.3441466434,
217
+ 45.9441876888
218
+ ],
219
+ [
220
+ 16.5967051279,
221
+ 46.4758203254
222
+ ]
223
+ ],
224
+ [
225
+ [
226
+ 14.8804905824,
227
+ 44.5785936226
228
+ ],
229
+ [
230
+ 14.7341616521,
231
+ 44.7031519104
232
+ ],
233
+ [
234
+ 15.2500422818,
235
+ 44.325391158
236
+ ],
237
+ [
238
+ 14.8804905824,
239
+ 44.5785936226
240
+ ]
241
+ ]
242
+ ],
243
+ [
244
+ [
245
+ [
246
+ 17.6490649811,
247
+ 42.888852635
248
+ ],
249
+ [
250
+ 17.0157507671,
251
+ 43.0135997229
252
+ ],
253
+ [
254
+ 18.5246595067,
255
+ 42.4204890994
256
+ ],
257
+ [
258
+ 18.4375961538,
259
+ 42.5565023804
260
+ ],
261
+ [
262
+ 17.6490649811,
263
+ 42.888852635
264
+ ]
265
+ ]
266
+ ],
267
+ [
268
+ [
269
+ [
270
+ 14.7465559872,
271
+ 44.9379536524
272
+ ],
273
+ [
274
+ 14.5559483946,
275
+ 45.244895784
276
+ ],
277
+ [
278
+ 14.4328046081,
279
+ 45.0745928553
280
+ ],
281
+ [
282
+ 14.7465559872,
283
+ 44.9379536524
284
+ ]
285
+ ]
286
+ ],
287
+ [
288
+ [
289
+ [
290
+ 14.4339451023,
291
+ 44.984282394
292
+ ],
293
+ [
294
+ 14.3189269837,
295
+ 45.175288603
296
+ ],
297
+ [
298
+ 14.4937608777,
299
+ 44.6075051914
300
+ ],
301
+ [
302
+ 14.4339451023,
303
+ 44.984282394
304
+ ]
305
+ ]
306
+ ],
307
+ [
308
+ [
309
+ [
310
+ 16.6852462603,
311
+ 43.2565094
312
+ ],
313
+ [
314
+ 16.8969675927,
315
+ 43.3135106589
316
+ ],
317
+ [
318
+ 16.4377940653,
319
+ 43.3903459151
320
+ ],
321
+ [
322
+ 16.6852462603,
323
+ 43.2565094
324
+ ]
325
+ ]
326
+ ],
327
+ [
328
+ [
329
+ [
330
+ 16.8607643414,
331
+ 42.9567246632
332
+ ],
333
+ [
334
+ 16.6272544773,
335
+ 42.983273883
336
+ ],
337
+ [
338
+ 17.2004177377,
339
+ 42.9179513321
340
+ ],
341
+ [
342
+ 16.8607643414,
343
+ 42.9567246632
344
+ ]
345
+ ]
346
+ ]
347
+ ]
348
+ },
349
+ "properties": {
350
+ "fid_1": 91,
351
+ "OBJECTID": 366,
352
+ "ISO2": "HR",
353
+ "NAME": "Croatia",
354
+ "LON": 16.39578378,
355
+ "LAT": 45.0320184,
356
+ "ISO3": "HRV",
357
+ "Shape_Area": 6.45023163203919
358
+ }
359
+ }
360
+ ]
361
+ }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),c=require("react"),ct=require("./parse-xYI9yrvL.cjs"),ut=require("./getSliderMarks-CIuSoedo.cjs"),gt=require("./Spinner-jTMOLuw_.cjs"),ft=require("./index-DQA8q5sC.cjs"),X=require("./zoom-ChcvXFIz.cjs"),yt=require("./Typography-sa1UE0oF.cjs"),vt=require("./index-C5K--w8d.cjs"),bt=require("./Tooltip-BLa2EfMs.cjs"),R=require("./Colors.cjs"),st=require("./index-C6er0ety.cjs"),jt=require("./DetailsModal-DHttOA80.cjs"),Et=require("./pow-BnyPO-NX.cjs"),it=require("./select-Bnfk0lJx.cjs"),Ye=require("./proxy-C4-uo6nS.cjs"),wt=require("./use-in-view-C3o_ntMv.cjs"),Ct=require("./index-CoobIWNj.cjs"),Dt=require("./GraphFooter.cjs"),Rt=require("./GraphHeader.cjs"),St=require("./fetchAndParseData-QTF6tjij.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Nt=require("./uniqBy-O05lp2S5.cjs"),dt=require("./GraphContainer-B1EDxJ0S.cjs");function Ot(n){const{data:e,colors:r,mapData:Y,colorLegendTitle:P,colorDomain:f,radius:k,height:x,width:p,scale:h,centerPoint:z,tooltip:K,showLabels:xe,mapBorderWidth:ge,mapBorderColor:fe,mapNoDataColor:Z,onSeriesMouseOver:J,showColorScale:$e,zoomScaleExtend:qe,zoomTranslateExtend:Me,highlightedDataPoints:ye,onSeriesMouseClick:Q,resetSelectionOnDoubleClick:ve,detailsOnClick:b,styles:ee,classNames:A,mapProjection:F,zoomInteraction:S,animate:E,dimmedOpacity:te,customLayers:W,maxRadiusValue:be,collapseColorScaleByDefault:je}=n,[Ee,we]=c.useState(void 0),[Pe,Ce]=c.useState(je===void 0?!(p<680):!je),oe=c.useRef(null),[T,re]=c.useState(void 0),[ae,u]=c.useState(void 0),[m,G]=c.useState(void 0),[De,ne]=c.useState(void 0),I=c.useRef(null),L=wt.useInView(I,{once:E.once,amount:E.amount}),H=c.useRef(null),C=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?Et.sqrt().domain([0,be]).range([.25,k]).nice():void 0;c.useEffect(()=>{const t=it.select(H.current),g=it.select(I.current),a=s=>{if(S==="noZoom")return!1;if(S==="button")return!s.type.includes("wheel");const w=s.type==="wheel",j=s.type.startsWith("touch"),v=s.type==="mousedown"||s.type==="mousemove";return j?!0:w?S==="scroll"?!0:s.ctrlKey:v&&!s.button&&!s.ctrlKey},D=X.zoom().scaleExtent(qe).translateExtent(Me||[[-20,-20],[p+20,x+20]]).filter(a).on("zoom",({transform:s})=>{t.attr("transform",s)});g.call(D),oe.current=D},[x,p,S]);const V=X.index_default(Y),y=vt.index_default(Y),ie=V[2]-V[0],Re=V[3]-V[1],Se=p*190/960*360/ie,ke=x*190/678*180/Re,N=h*Math.min(Se,ke),_=F==="mercator"?X.geoMercator().rotate([0,0]).center(z||y.geometry.coordinates).translate([p/2,x/2]).scale(N):F==="equalEarth"?X.geoEqualEarth().rotate([0,0]).center(z||y.geometry.coordinates).translate([p/2,x/2]).scale(N):F==="naturalEarth"?X.geoNaturalEarth1().rotate([0,0]).center(z||y.geometry.coordinates).translate([p/2,x/2]).scale(N):F==="orthographic"?X.geoOrthographic().rotate([0,0]).center(z||y.geometry.coordinates).translate([p/2,x/2]).scale(N):X.geoAlbersUsa().rotate([0,0]).center(z||y.geometry.coordinates).translate([p/2,x/2]).scale(N),se=t=>{if(!I.current||!oe.current)return;it.select(I.current).call(oe.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Ye.motion.svg,{width:`${p}px`,height:`${x}px`,viewBox:`0 0 ${p} ${x}`,ref:I,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:H,children:[W.filter(t=>t.position==="before").map(t=>t.layer),Y.features.map((t,g)=>o.jsxRuntimeExports.jsx("g",{children:t.geometry.type==="MultiPolygon"?t.geometry.coordinates.map((a,D)=>{let s="";return a.forEach(w=>{let j=" M";w.forEach((v,le)=>{const B=_([v[0],v[1]]);le!==w.length-1?j=`${j}${B[0]} ${B[1]}L`:j=`${j}${B[0]} ${B[1]}`}),s+=j}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:ge,fill:Z}},D)}):t.geometry.coordinates.map((a,D)=>{let s="M";return a.forEach((w,j)=>{const v=_([w[0],w[1]]);j!==a.length-1?s=`${s}${v[0]} ${v[1]}L`:s=`${s}${v[0]} ${v[1]}`}),o.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:fe,strokeWidth:ge,fill:Z}},D)})},g)),o.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:e.map(t=>{const g=e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray;return o.jsxRuntimeExports.jsxs(Ye.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Ee?Ee===g?1:te:ye.length!==0?ye.indexOf(t.label||"")!==-1?1:te:1,transition:{duration:E.duration}}},initial:"initial",animate:L?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:a=>{u(t),ne(a.clientY),G(a.clientX),J?.(t)},onMouseMove:a=>{u(t),ne(a.clientY),G(a.clientX)},onMouseLeave:()=>{u(void 0),G(void 0),ne(void 0),J?.(void 0)},onClick:()=>{(Q||b)&&(ft.isEqual(T,t)&&ve?(re(void 0),Q?.(void 0)):(re(t),Q?.(t)))},transform:`translate(${_([t.long,t.lat])[0]},${_([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Ye.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray},whileInView:{r:C?C(t.radius||0):k,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray,stroke:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray,transition:{duration:E.duration}}},initial:"initial",animate:L?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8}}),xe&&t.label?o.jsxRuntimeExports.jsx(Ye.motion.text,{variants:{initial:{opacity:0,x:C?C(t.radius||0):k,fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray},whileInView:{opacity:1,x:C?C(t.radius||0):k,transition:{duration:E.duration},fill:e.filter(a=>a.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:R.Colors.gray}},initial:"initial",animate:L?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:o.mo("graph-value text-sm",A?.graphObjectValues),style:{textAnchor:"start",...ee?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),W.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||$e===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",A?.colorLegend),children:Pe?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ce(!1)},children:o.jsxRuntimeExports.jsx(st.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[P&&P!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:P}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:f.map((t,g)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{we(r[g%r.length])},onMouseLeave:()=>{we(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[g%r.length]}}),o.jsxRuntimeExports.jsx(yt.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},g))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Ce(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),S==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>se("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>se("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),b&&T!==void 0?o.jsxRuntimeExports.jsx(jt.DetailsModal,{body:b,data:T,setData:re,className:A?.modal}):null,ae&&K&&m&&De?o.jsxRuntimeExports.jsx(bt.Tooltip,{data:ae,body:K,xPos:m,yPos:De,backgroundStyle:ee?.tooltip,className:A?.tooltip}):null]})}function $t(n){const e=o.compilerRuntimeExports.c(117),{data:r,mapData:Y,graphTitle:P,colors:f,sources:k,graphDescription:x,height:p,width:h,footNote:z,colorLegendTitle:K,colorDomain:xe,radius:ge,scale:fe,centerPoint:Z,padding:J,mapBorderWidth:$e,mapNoDataColor:qe,backgroundColor:Me,showLabels:ye,mapBorderColor:Q,tooltip:ve,relativeHeight:b,onSeriesMouseOver:ee,isWorldMap:A,showColorScale:F,zoomScaleExtend:S,zoomTranslateExtend:E,graphID:te,highlightedDataPoints:W,onSeriesMouseClick:be,graphDownload:je,dataDownload:Ee,showAntarctica:we,language:Pe,minHeight:Ce,theme:oe,ariaLabel:T,resetSelectionOnDoubleClick:re,detailsOnClick:ae,styles:u,classNames:m,mapProjection:G,zoomInteraction:De,animate:ne,dimmedOpacity:I,customLayers:L,maxRadiusValue:H,timeline:C,collapseColorScaleByDefault:V}=n,y=Y===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":Y,ie=z===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":z,Re=ge===void 0?5:ge,Se=fe===void 0?.95:fe,ke=$e===void 0?.5:$e,N=qe===void 0?R.Colors.light.graphNoData:qe,_=Me===void 0?!1:Me,se=ye===void 0?!1:ye,t=Q===void 0?R.Colors.light.grays["gray-500"]:Q,g=A===void 0?!0:A,a=F===void 0?!0:F;let D;e[0]!==S?(D=S===void 0?[.8,6]:S,e[0]=S,e[1]=D):D=e[1];const s=D;let w;e[2]!==W?(w=W===void 0?[]:W,e[2]=W,e[3]=w):w=e[3];const j=w,v=je===void 0?!1:je,le=Ee===void 0?!1:Ee,B=we===void 0?!1:we,Ke=Pe===void 0?"en":Pe,O=Ce===void 0?0:Ce,ce=oe===void 0?"light":oe,Ze=re===void 0?!0:re,Je=De===void 0?"button":De,ze=ne===void 0?!1:ne,Qe=I===void 0?.3:I;let Ie;e[4]!==L?(Ie=L===void 0?[]:L,e[4]=L,e[5]=Ie):Ie=e[5];const et=Ie;let Le;e[6]!==C?(Le=C===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:C,e[6]=C,e[7]=Le):Le=e[7];const i=Le,[U,mt]=c.useState(0),[Ne,pt]=c.useState(0),[$,ht]=c.useState(i.autoplay);let Oe;if(e[8]!==r||e[9]!==i.dateFormat){let d;e[11]!==i.dateFormat?(d=M=>ct.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[11]=i.dateFormat,e[12]=d):d=e[12],Oe=[...new Set(r.filter(Wt).map(d))],Oe.sort(Ft),e[8]=r,e[9]=i.dateFormat,e[10]=Oe}else Oe=e[10];const l=Oe,[q,tt]=c.useState(i.autoplay?0:l.length-1),[ue,xt]=c.useState(void 0),ot=c.useRef(null),lt=c.useRef(null);let Ve,_e;e[13]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>{const d=new ResizeObserver(M=>{mt(M[0].target.clientWidth||620),pt(M[0].target.clientHeight||480)});return ot.current&&d.observe(ot.current),()=>d.disconnect()},_e=[],e[13]=Ve,e[14]=_e):(Ve=e[13],_e=e[14]),c.useEffect(Ve,_e);let Be;e[15]===Symbol.for("react.memo_cache_sentinel")?(Be=d=>{xt(d)},e[15]=Be):Be=e[15];const Ae=c.useEffectEvent(Be);let Fe;e[16]!==y||e[17]!==Ae?(Fe=()=>{typeof y=="string"?St.fetchAndParseJSON(y).then(M=>{Ae(M)}):Ae(y)},e[16]=y,e[17]=Ae,e[18]=Fe):Fe=e[18];let We;e[19]!==y?(We=[y],e[19]=y,e[20]=We):We=e[20],c.useEffect(Fe,We);let Te,Ge;e[21]!==$||e[22]!==i.speed||e[23]!==l?(Te=()=>{const d=setInterval(()=>{tt(M=>M<l.length-1?M+1:0)},(i.speed||2)*1e3);return $||clearInterval(d),()=>clearInterval(d)},Ge=[l,$,i.speed],e[21]=$,e[22]=i.speed,e[23]=l,e[24]=Te,e[25]=Ge):(Te=e[24],Ge=e[25]),c.useEffect(Te,Ge);const rt=i.dateFormat||"yyyy";let He;e[26]!==q||e[27]!==rt||e[28]!==i.showOnlyActiveDate||e[29]!==l?(He=ut.getSliderMarks(l,q,i.showOnlyActiveDate,rt),e[26]=q,e[27]=rt,e[28]=i.showOnlyActiveDate,e[29]=l,e[30]=He):He=e[30];const Ue=He,at=m?.graphContainer,nt=u?.graphContainer;let de;e[31]!==m?.description||e[32]!==m?.title||e[33]!==r||e[34]!==le||e[35]!==x||e[36]!==v||e[37]!==P||e[38]!==u?.description||e[39]!==u?.title||e[40]!==h?(de=P||x||v||le?o.jsxRuntimeExports.jsx(Rt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:m?.title,description:m?.description},graphTitle:P,graphDescription:x,width:h,graphDownload:v?lt:void 0,dataDownload:le?r.map(At).filter(Bt).length>0?r.map(_t).filter(Vt):r.filter(Lt):null}):null,e[31]=m?.description,e[32]=m?.title,e[33]=r,e[34]=le,e[35]=x,e[36]=v,e[37]=P,e[38]=u?.description,e[39]=u?.title,e[40]=h,e[41]=de):de=e[41];let me;e[42]!==q||e[43]!==Ue||e[44]!==$||e[45]!==i.enabled||e[46]!==l?(me=i.enabled&&l.length>0&&Ue?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ht(!$)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":$?"Click to pause animation":"Click to play animation",children:$?o.jsxRuntimeExports.jsx(st.Pause,{}):o.jsxRuntimeExports.jsx(st.Play,{})}),o.jsxRuntimeExports.jsx(ut.Nr,{min:l[0],max:l[l.length-1],marks:Ue,step:null,defaultValue:l[l.length-1],value:l[q],onChangeComplete:d=>{tt(l.indexOf(d))},onChange:d=>{tt(l.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[42]=q,e[43]=Ue,e[44]=$,e[45]=i.enabled,e[46]=l,e[47]=me):me=e[47];let pe;e[48]!==ze||e[49]!==Z||e[50]!==m||e[51]!==V||e[52]!==xe||e[53]!==K||e[54]!==f||e[55]!==et||e[56]!==r||e[57]!==ae||e[58]!==Qe||e[59]!==p||e[60]!==j||e[61]!==q||e[62]!==g||e[63]!==t||e[64]!==ke||e[65]!==N||e[66]!==G||e[67]!==ue||e[68]!==H||e[69]!==O||e[70]!==be||e[71]!==ee||e[72]!==Re||e[73]!==b||e[74]!==Ze||e[75]!==Se||e[76]!==B||e[77]!==a||e[78]!==se||e[79]!==u||e[80]!==Ne||e[81]!==U||e[82]!==ce||e[83]!==i.dateFormat||e[84]!==i.enabled||e[85]!==ve||e[86]!==l||e[87]!==h||e[88]!==Je||e[89]!==s||e[90]!==E?(pe=o.jsxRuntimeExports.jsx(dt.GraphArea,{ref:ot,children:U&&Ne&&ue?o.jsxRuntimeExports.jsx(Ot,{data:r.filter(d=>i.enabled?d.date===ct.format(new Date(l[q]),i.dateFormat||"yyyy"):d),mapData:B?ue:{...ue,features:ue.features.filter(It)},colorDomain:r.filter(zt).length===0?[]:xe||Nt.uniqBy(r,"color",!0),width:U,height:Ne,scale:Se,centerPoint:Z,colors:r.filter(Pt).length===0?f?[f]:[R.Colors.primaryColors["blue-600"]]:f||R.Colors[ce].categoricalColors.colors,colorLegendTitle:K,radius:Re,mapBorderWidth:ke,mapNoDataColor:N,mapBorderColor:t,tooltip:ve,onSeriesMouseOver:ee,showLabels:se,isWorldMap:g,showColorScale:a,zoomScaleExtend:s,zoomTranslateExtend:E,onSeriesMouseClick:be,highlightedDataPoints:j,resetSelectionOnDoubleClick:Ze,styles:u,classNames:m,zoomInteraction:Je,detailsOnClick:ae,mapProjection:G||(g?"naturalEarth":"mercator"),animate:ze===!0?{duration:.5,once:!0,amount:.5}:ze||{duration:0,once:!0,amount:0},dimmedOpacity:Qe,customLayers:et,maxRadiusValue:kt.checkIfNullOrUndefined(H)?Math.max(...r.map(Mt).filter(qt)):H,collapseColorScaleByDefault:V}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(O,p||(b?O?(h||U)*b>O?(h||U)*b:O:(h||U)*b:Ne))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(gt.w,{"aria-label":"Loading graph"})})}),e[48]=ze,e[49]=Z,e[50]=m,e[51]=V,e[52]=xe,e[53]=K,e[54]=f,e[55]=et,e[56]=r,e[57]=ae,e[58]=Qe,e[59]=p,e[60]=j,e[61]=q,e[62]=g,e[63]=t,e[64]=ke,e[65]=N,e[66]=G,e[67]=ue,e[68]=H,e[69]=O,e[70]=be,e[71]=ee,e[72]=Re,e[73]=b,e[74]=Ze,e[75]=Se,e[76]=B,e[77]=a,e[78]=se,e[79]=u,e[80]=Ne,e[81]=U,e[82]=ce,e[83]=i.dateFormat,e[84]=i.enabled,e[85]=ve,e[86]=l,e[87]=h,e[88]=Je,e[89]=s,e[90]=E,e[91]=pe):pe=e[91];let he;e[92]!==m?.footnote||e[93]!==m?.source||e[94]!==ie||e[95]!==k||e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==h?(he=k||ie?o.jsxRuntimeExports.jsx(Dt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:k,footNote:ie,width:h}):null,e[92]=m?.footnote,e[93]=m?.source,e[94]=ie,e[95]=k,e[96]=u?.footnote,e[97]=u?.source,e[98]=h,e[99]=he):he=e[99];let Xe;return e[100]!==T||e[101]!==_||e[102]!==te||e[103]!==p||e[104]!==Ke||e[105]!==O||e[106]!==J||e[107]!==b||e[108]!==at||e[109]!==nt||e[110]!==de||e[111]!==me||e[112]!==pe||e[113]!==he||e[114]!==ce||e[115]!==h?(Xe=o.jsxRuntimeExports.jsxs(dt.GraphContainer,{className:at,style:nt,id:te,ref:lt,"aria-label":T,backgroundColor:_,theme:ce,language:Ke,minHeight:O,width:h,height:p,relativeHeight:b,padding:J,children:[de,me,pe,he]}),e[100]=T,e[101]=_,e[102]=te,e[103]=p,e[104]=Ke,e[105]=O,e[106]=J,e[107]=b,e[108]=at,e[109]=nt,e[110]=de,e[111]=me,e[112]=pe,e[113]=he,e[114]=ce,e[115]=h,e[116]=Xe):Xe=e[116],Xe}function qt(n){return n!=null}function Mt(n){return n.radius}function Pt(n){return n.color}function zt(n){return n.color}function It(n){return n.properties.NAME!=="Antarctica"}function Lt(n){return n!==void 0}function Vt(n){return n!==void 0}function _t(n){return n.data}function Bt(n){return n!==void 0}function At(n){return n.data}function Ft(n,e){return n-e}function Wt(n){return n.date}exports.DotDensityMap=$t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-6v2a2njQ.cjs"),l=require("react"),ht=require("./parse-xYI9yrvL.cjs"),ft=require("./getSliderMarks-CIuSoedo.cjs"),Et=require("./Spinner-jTMOLuw_.cjs"),wt=require("./index-DQA8q5sC.cjs"),q=require("./index-DLFt97gy.cjs"),Ct=require("./Typography-sa1UE0oF.cjs"),Dt=require("./index-C5K--w8d.cjs"),Rt=require("./Tooltip-BLa2EfMs.cjs"),b=require("./Colors.cjs"),pt=require("./index-C6er0ety.cjs"),St=require("./DetailsModal-DHttOA80.cjs"),kt=require("./pow-BnyPO-NX.cjs"),mt=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),Nt=require("./use-in-view-C3o_ntMv.cjs"),Ot=require("./index-CoobIWNj.cjs"),Mt=require("./GraphFooter.cjs"),qt=require("./GraphHeader.cjs"),Pt=require("./fetchAndParseData-QTF6tjij.cjs"),$t=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),It=require("./uniqBy-O05lp2S5.cjs"),gt=require("./GraphContainer-B1EDxJ0S.cjs");function zt(a){const{data:e,colors:r,mapData:X,colorLegendTitle:P,colorDomain:f,radius:D,height:x,width:m,scale:p,centerPoint:$,tooltip:Y,showLabels:de,mapBorderWidth:qe,mapBorderColor:Pe,mapNoDataColor:me,onSeriesMouseOver:K,showColorScale:$e,zoomScaleExtend:Ie,zoomTranslateExtend:ze,highlightedDataPoints:pe,onSeriesMouseClick:Z,resetSelectionOnDoubleClick:xe,detailsOnClick:y,styles:J,classNames:L,mapProjection:V,zoomInteraction:E,animate:j,dimmedOpacity:Q,customLayers:_,maxRadiusValue:he,collapseColorScaleByDefault:fe,projectionRotate:I,rewindCoordinatesInMapData:ge}=a,ee=l.useMemo(()=>ge?q.index_default(X,{reverse:!0}):X,[X,ge]),[ye,ve]=l.useState(void 0),[je,be]=l.useState(fe===void 0?!(m<680):!fe),B=l.useRef(null),[c,u]=l.useState(void 0),[Ee,te]=l.useState(void 0),[we,oe]=l.useState(void 0),[A,z]=l.useState(void 0),w=l.useRef(null),F=Nt.useInView(w,{once:j.once,amount:j.amount}),T=l.useRef(null),R=e.filter(t=>t.radius===void 0||t.radius===null).length!==e.length?kt.sqrt().domain([0,he]).range([.25,D]).nice():void 0;l.useEffect(()=>{const t=mt.select(T.current),h=mt.select(w.current),n=g=>{if(E==="noZoom")return!1;if(E==="button")return!g.type.includes("wheel");const re=g.type==="wheel",ae=g.type.startsWith("touch"),Ne=g.type==="mousedown"||g.type==="mousemove";return ae?!0:re?E==="scroll"?!0:g.ctrlKey:Ne&&!g.button&&!g.ctrlKey},H=q.zoom().scaleExtent(Ie).translateExtent(ze||[[-20,-20],[m+20,x+20]]).filter(n).on("zoom",({transform:g})=>{t.attr("transform",g)});h.call(H),B.current=H},[x,m,E]);const v=q.index_default$1(ee),C=Dt.index_default(ee),Ce=v[2]-v[0],De=v[3]-v[1],Re=m*190/960*360/Ce,Se=x*190/678*180/De,S=p*Math.min(Re,Se),W=V==="mercator"?q.geoMercator().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="equalEarth"?q.geoEqualEarth().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="naturalEarth"?q.geoNaturalEarth1().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):V==="orthographic"?q.geoOrthographic().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S):q.geoAlbersUsa().rotate(I).center($||C.geometry.coordinates).translate([m/2,x/2]).scale(S),ke=q.geoPath().projection(W),G=t=>{if(!w.current||!B.current)return;mt.select(w.current).call(B.current.scaleBy,t==="in"?1.2:1/1.2)};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${m}px`,height:`${x}px`,viewBox:`0 0 ${m} ${x}`,ref:w,direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{ref:T,children:[_.filter(t=>t.position==="before").map(t=>t.layer),ee.features.map((t,h)=>{const n=ke(t);return n?o.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:Pe,strokeWidth:qe,fill:me}},h):null}),o.jsxRuntimeExports.jsx(Ot.AnimatePresence,{children:e.map(t=>{const h=e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray;return o.jsxRuntimeExports.jsxs(Je.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:ye?ye===h?1:Q:pe.length!==0?pe.indexOf(t.label||"")!==-1?1:Q:1,transition:{duration:j.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:n=>{te(t),z(n.clientY),oe(n.clientX),K?.(t)},onMouseMove:n=>{te(t),z(n.clientY),oe(n.clientX)},onMouseLeave:()=>{te(void 0),oe(void 0),z(void 0),K?.(void 0)},onClick:()=>{(Z||y)&&(wt.isEqual(c,t)&&xe?(u(void 0),Z?.(void 0)):(u(t),Z?.(t)))},transform:`translate(${W([t.long,t.lat])[0]},${W([t.long,t.lat])[1]})`,children:[o.jsxRuntimeExports.jsx(Je.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray},whileInView:{r:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray,stroke:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray,transition:{duration:j.duration}}},initial:"initial",animate:F?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),de&&t.label?o.jsxRuntimeExports.jsx(Je.motion.text,{variants:{initial:{opacity:0,x:R?R(t.radius||0):D,fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray},whileInView:{opacity:1,x:R?R(t.radius||0):D,transition:{duration:j.duration},fill:e.filter(n=>n.color).length===0?r[0]:t.color?r[f.indexOf(`${t.color}`)]:b.Colors.gray}},initial:"initial",animate:F?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:o.mo("graph-value text-sm",L?.graphObjectValues),style:{textAnchor:"start",...J?.graphObjectValues||{}},dx:4,dy:5,children:t.label}):null]},t.label||`${t.lat}-${t.long}`)})}),_.filter(t=>t.position==="after").map(t=>t.layer)]})}),e.filter(t=>t.color).length===0||$e===!1?null:o.jsxRuntimeExports.jsx("div",{className:o.mo("absolute left-4 bottom-4 map-color-legend",L?.colorLegend),children:je?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{be(!1)},children:o.jsxRuntimeExports.jsx(pt.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[P&&P!==""?o.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:P}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:f.map((t,h)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{ve(r[h%r.length])},onMouseLeave:()=>{ve(void 0)},children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[h%r.length]}}),o.jsxRuntimeExports.jsx(Ct.j,{size:"sm",marginBottom:"none",leading:"none",children:t})]},h))})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{be(!0)},children:o.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),E==="button"&&o.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[o.jsxRuntimeExports.jsx("button",{onClick:()=>G("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),o.jsxRuntimeExports.jsx("button",{onClick:()=>G("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),y&&c!==void 0?o.jsxRuntimeExports.jsx(St.DetailsModal,{body:y,data:c,setData:u,className:L?.modal}):null,Ee&&Y&&we&&A?o.jsxRuntimeExports.jsx(Rt.Tooltip,{data:Ee,body:Y,xPos:we,yPos:A,backgroundStyle:J?.tooltip,className:L?.tooltip}):null]})}function Lt(a){const e=o.compilerRuntimeExports.c(121),{data:r,mapData:X,graphTitle:P,colors:f,sources:D,graphDescription:x,height:m,width:p,footNote:$,colorLegendTitle:Y,colorDomain:de,radius:qe,scale:Pe,centerPoint:me,padding:K,mapBorderWidth:$e,mapNoDataColor:Ie,backgroundColor:ze,showLabels:pe,mapBorderColor:Z,tooltip:xe,relativeHeight:y,onSeriesMouseOver:J,isWorldMap:L,showColorScale:V,zoomScaleExtend:E,zoomTranslateExtend:j,graphID:Q,highlightedDataPoints:_,onSeriesMouseClick:he,graphDownload:fe,dataDownload:I,showAntarctica:ge,language:ee,minHeight:ye,theme:ve,ariaLabel:je,resetSelectionOnDoubleClick:be,detailsOnClick:B,styles:c,classNames:u,mapProjection:Ee,zoomInteraction:te,animate:we,dimmedOpacity:oe,customLayers:A,maxRadiusValue:z,timeline:w,collapseColorScaleByDefault:F,projectionRotate:T,rewindCoordinatesInMapData:R}=a,v=X===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":X,C=$===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":$,Ce=qe===void 0?5:qe,De=Pe===void 0?.95:Pe,Re=$e===void 0?.5:$e,Se=Ie===void 0?b.Colors.light.graphNoData:Ie,S=ze===void 0?!1:ze,W=pe===void 0?!1:pe,ke=Z===void 0?b.Colors.light.grays["gray-500"]:Z,G=L===void 0?!0:L,t=V===void 0?!0:V;let h;e[0]!==E?(h=E===void 0?[.8,6]:E,e[0]=E,e[1]=h):h=e[1];const n=h;let H;e[2]!==_?(H=_===void 0?[]:_,e[2]=_,e[3]=H):H=e[3];const g=H,re=fe===void 0?!1:fe,ae=I===void 0?!1:I,Ne=ge===void 0?!1:ge,Qe=ee===void 0?"en":ee,k=ye===void 0?0:ye,ne=ve===void 0?"light":ve,et=be===void 0?!0:be,tt=Ee===void 0?"naturalEarth":Ee,ot=te===void 0?"button":te,Le=we===void 0?!1:we,rt=oe===void 0?.3:oe;let Ve;e[4]!==A?(Ve=A===void 0?[]:A,e[4]=A,e[5]=Ve):Ve=e[5];const at=Ve;let _e;e[6]!==w?(_e=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,e[6]=w,e[7]=_e):_e=e[7];const i=_e;let Be;e[8]!==T?(Be=T===void 0?[0,0]:T,e[8]=T,e[9]=Be):Be=e[9];const nt=Be,it=R===void 0?!0:R,[U,yt]=l.useState(0),[Oe,vt]=l.useState(0),[N,jt]=l.useState(i.autoplay);let Me;if(e[10]!==r||e[11]!==i.dateFormat){let d;e[13]!==i.dateFormat?(d=M=>ht.parse(`${M.date}`,i.dateFormat||"yyyy",new Date).getTime(),e[13]=i.dateFormat,e[14]=d):d=e[14],Me=[...new Set(r.filter(Yt).map(d))],Me.sort(Xt),e[10]=r,e[11]=i.dateFormat,e[12]=Me}else Me=e[12];const s=Me,[O,st]=l.useState(i.autoplay?0:s.length-1),[ie,bt]=l.useState(void 0),lt=l.useRef(null),xt=l.useRef(null);let Ae,Fe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{const d=new ResizeObserver(M=>{yt(M[0].target.clientWidth||620),vt(M[0].target.clientHeight||480)});return lt.current&&d.observe(lt.current),()=>d.disconnect()},Fe=[],e[15]=Ae,e[16]=Fe):(Ae=e[15],Fe=e[16]),l.useEffect(Ae,Fe);let Te;e[17]===Symbol.for("react.memo_cache_sentinel")?(Te=d=>{bt(d)},e[17]=Te):Te=e[17];const We=l.useEffectEvent(Te);let Ge;e[18]!==v||e[19]!==We?(Ge=()=>{typeof v=="string"?Pt.fetchAndParseJSON(v).then(M=>{We(M)}):We(v)},e[18]=v,e[19]=We,e[20]=Ge):Ge=e[20];let He;e[21]!==v?(He=[v],e[21]=v,e[22]=He):He=e[22],l.useEffect(Ge,He);let Ue,Xe;e[23]!==N||e[24]!==i.speed||e[25]!==s?(Ue=()=>{const d=setInterval(()=>{st(M=>M<s.length-1?M+1:0)},(i.speed||2)*1e3);return N||clearInterval(d),()=>clearInterval(d)},Xe=[s,N,i.speed],e[23]=N,e[24]=i.speed,e[25]=s,e[26]=Ue,e[27]=Xe):(Ue=e[26],Xe=e[27]),l.useEffect(Ue,Xe);const ct=i.dateFormat||"yyyy";let Ye;e[28]!==O||e[29]!==ct||e[30]!==i.showOnlyActiveDate||e[31]!==s?(Ye=ft.getSliderMarks(s,O,i.showOnlyActiveDate,ct),e[28]=O,e[29]=ct,e[30]=i.showOnlyActiveDate,e[31]=s,e[32]=Ye):Ye=e[32];const Ke=Ye,ut=u?.graphContainer,dt=c?.graphContainer;let se;e[33]!==u?.description||e[34]!==u?.title||e[35]!==r||e[36]!==ae||e[37]!==x||e[38]!==re||e[39]!==P||e[40]!==c?.description||e[41]!==c?.title||e[42]!==p?(se=P||x||re||ae?o.jsxRuntimeExports.jsx(qt.GraphHeader,{styles:{title:c?.title,description:c?.description},classNames:{title:u?.title,description:u?.description},graphTitle:P,graphDescription:x,width:p,graphDownload:re?xt:void 0,dataDownload:ae?r.map(Ut).filter(Ht).length>0?r.map(Gt).filter(Wt):r.filter(Tt):null}):null,e[33]=u?.description,e[34]=u?.title,e[35]=r,e[36]=ae,e[37]=x,e[38]=re,e[39]=P,e[40]=c?.description,e[41]=c?.title,e[42]=p,e[43]=se):se=e[43];let le;e[44]!==O||e[45]!==Ke||e[46]!==N||e[47]!==i.enabled||e[48]!==s?(le=i.enabled&&s.length>0&&Ke?o.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[o.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{jt(!N)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":N?"Click to pause animation":"Click to play animation",children:N?o.jsxRuntimeExports.jsx(pt.Pause,{}):o.jsxRuntimeExports.jsx(pt.Play,{})}),o.jsxRuntimeExports.jsx(ft.Nr,{min:s[0],max:s[s.length-1],marks:Ke,step:null,defaultValue:s[s.length-1],value:s[O],onChangeComplete:d=>{st(s.indexOf(d))},onChange:d=>{st(s.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[44]=O,e[45]=Ke,e[46]=N,e[47]=i.enabled,e[48]=s,e[49]=le):le=e[49];let ce;e[50]!==Le||e[51]!==me||e[52]!==u||e[53]!==F||e[54]!==de||e[55]!==Y||e[56]!==f||e[57]!==at||e[58]!==r||e[59]!==B||e[60]!==rt||e[61]!==m||e[62]!==g||e[63]!==O||e[64]!==G||e[65]!==ke||e[66]!==Re||e[67]!==Se||e[68]!==tt||e[69]!==ie||e[70]!==z||e[71]!==k||e[72]!==he||e[73]!==J||e[74]!==nt||e[75]!==Ce||e[76]!==y||e[77]!==et||e[78]!==it||e[79]!==De||e[80]!==Ne||e[81]!==t||e[82]!==W||e[83]!==c||e[84]!==Oe||e[85]!==U||e[86]!==ne||e[87]!==i.dateFormat||e[88]!==i.enabled||e[89]!==xe||e[90]!==s||e[91]!==p||e[92]!==ot||e[93]!==n||e[94]!==j?(ce=o.jsxRuntimeExports.jsx(gt.GraphArea,{ref:lt,children:U&&Oe&&ie?o.jsxRuntimeExports.jsx(zt,{data:r.filter(d=>i.enabled?d.date===ht.format(new Date(s[O]),i.dateFormat||"yyyy"):d),mapData:Ne?ie:{...ie,features:ie.features.filter(Ft)},colorDomain:r.filter(At).length===0?[]:de||It.uniqBy(r,"color",!0),width:U,height:Oe,scale:De,centerPoint:me,colors:r.filter(Bt).length===0?f?[f]:[b.Colors.primaryColors["blue-600"]]:f||b.Colors[ne].categoricalColors.colors,colorLegendTitle:Y,radius:Ce,mapBorderWidth:Re,mapNoDataColor:Se,mapBorderColor:ke,tooltip:xe,onSeriesMouseOver:J,showLabels:W,isWorldMap:G,showColorScale:t,zoomScaleExtend:n,zoomTranslateExtend:j,onSeriesMouseClick:he,highlightedDataPoints:g,resetSelectionOnDoubleClick:et,styles:c,classNames:u,zoomInteraction:ot,detailsOnClick:B,mapProjection:tt||(G?"naturalEarth":"mercator"),animate:Le===!0?{duration:.5,once:!0,amount:.5}:Le||{duration:0,once:!0,amount:0},dimmedOpacity:rt,customLayers:at,maxRadiusValue:$t.checkIfNullOrUndefined(z)?Math.max(...r.map(_t).filter(Vt)):z,collapseColorScaleByDefault:F,projectionRotate:nt,rewindCoordinatesInMapData:it}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(k,m||(y?k?(p||U)*y>k?(p||U)*y:k:(p||U)*y:Oe))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(Et.w,{"aria-label":"Loading graph"})})}),e[50]=Le,e[51]=me,e[52]=u,e[53]=F,e[54]=de,e[55]=Y,e[56]=f,e[57]=at,e[58]=r,e[59]=B,e[60]=rt,e[61]=m,e[62]=g,e[63]=O,e[64]=G,e[65]=ke,e[66]=Re,e[67]=Se,e[68]=tt,e[69]=ie,e[70]=z,e[71]=k,e[72]=he,e[73]=J,e[74]=nt,e[75]=Ce,e[76]=y,e[77]=et,e[78]=it,e[79]=De,e[80]=Ne,e[81]=t,e[82]=W,e[83]=c,e[84]=Oe,e[85]=U,e[86]=ne,e[87]=i.dateFormat,e[88]=i.enabled,e[89]=xe,e[90]=s,e[91]=p,e[92]=ot,e[93]=n,e[94]=j,e[95]=ce):ce=e[95];let ue;e[96]!==u?.footnote||e[97]!==u?.source||e[98]!==C||e[99]!==D||e[100]!==c?.footnote||e[101]!==c?.source||e[102]!==p?(ue=D||C?o.jsxRuntimeExports.jsx(Mt.GraphFooter,{styles:{footnote:c?.footnote,source:c?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:D,footNote:C,width:p}):null,e[96]=u?.footnote,e[97]=u?.source,e[98]=C,e[99]=D,e[100]=c?.footnote,e[101]=c?.source,e[102]=p,e[103]=ue):ue=e[103];let Ze;return e[104]!==je||e[105]!==S||e[106]!==Q||e[107]!==m||e[108]!==Qe||e[109]!==k||e[110]!==K||e[111]!==y||e[112]!==ut||e[113]!==dt||e[114]!==se||e[115]!==le||e[116]!==ce||e[117]!==ue||e[118]!==ne||e[119]!==p?(Ze=o.jsxRuntimeExports.jsxs(gt.GraphContainer,{className:ut,style:dt,id:Q,ref:xt,"aria-label":je,backgroundColor:S,theme:ne,language:Qe,minHeight:k,width:p,height:m,relativeHeight:y,padding:K,children:[se,le,ce,ue]}),e[104]=je,e[105]=S,e[106]=Q,e[107]=m,e[108]=Qe,e[109]=k,e[110]=K,e[111]=y,e[112]=ut,e[113]=dt,e[114]=se,e[115]=le,e[116]=ce,e[117]=ue,e[118]=ne,e[119]=p,e[120]=Ze):Ze=e[120],Ze}function Vt(a){return a!=null}function _t(a){return a.radius}function Bt(a){return a.color}function At(a){return a.color}function Ft(a){return a.properties.NAME!=="Antarctica"}function Tt(a){return a!==void 0}function Wt(a){return a!==void 0}function Gt(a){return a.data}function Ht(a){return a!==void 0}function Ut(a){return a.data}function Xt(a,e){return a-e}function Yt(a){return a.date}exports.DotDensityMap=Lt;
2
2
  //# sourceMappingURL=DotDensityMap.cjs.map