@undp/data-viz 1.3.1 → 1.4.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 (104) hide show
  1. package/dist/DataCards.cjs +21 -1
  2. package/dist/DataCards.cjs.map +1 -1
  3. package/dist/DataCards.js +622 -12
  4. package/dist/DataCards.js.map +1 -1
  5. package/dist/GraphEl-B6SoGRFW.cjs +2 -0
  6. package/dist/GraphEl-B6SoGRFW.cjs.map +1 -0
  7. package/dist/{checkIfMultiple-BB7PlCNh.js → GraphEl-Cw2tDUb3.js} +129 -1163
  8. package/dist/GraphEl-Cw2tDUb3.js.map +1 -0
  9. package/dist/GriddedGraphs.cjs +1 -1
  10. package/dist/GriddedGraphs.cjs.map +1 -1
  11. package/dist/GriddedGraphs.d.ts +2 -4
  12. package/dist/GriddedGraphs.js +9 -8
  13. package/dist/GriddedGraphs.js.map +1 -1
  14. package/dist/GriddedGraphsFromConfig.d.ts +2 -4
  15. package/dist/MultiGraphDashboard.cjs +1 -1
  16. package/dist/MultiGraphDashboard.cjs.map +1 -1
  17. package/dist/MultiGraphDashboard.d.ts +16 -12
  18. package/dist/MultiGraphDashboard.js +2 -2
  19. package/dist/MultiGraphDashboardFromConfig.d.ts +16 -12
  20. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  21. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  22. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +2 -0
  23. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -0
  24. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +566 -0
  25. package/dist/PerformanceIntensiveMultiGraphDashboard.js +353 -0
  26. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -0
  27. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +2 -0
  28. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map +1 -0
  29. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +570 -0
  30. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +38 -0
  31. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -0
  32. package/dist/PerformanceIntensiveScrollStory.cjs +2 -0
  33. package/dist/PerformanceIntensiveScrollStory.cjs.map +1 -0
  34. package/dist/PerformanceIntensiveScrollStory.d.ts +493 -0
  35. package/dist/PerformanceIntensiveScrollStory.js +122 -0
  36. package/dist/PerformanceIntensiveScrollStory.js.map +1 -0
  37. package/dist/ScrollStory.cjs.map +1 -1
  38. package/dist/ScrollStory.d.ts +3 -5
  39. package/dist/ScrollStory.js.map +1 -1
  40. package/dist/SingleGraphDashboard.cjs +1 -1
  41. package/dist/SingleGraphDashboard.cjs.map +1 -1
  42. package/dist/SingleGraphDashboard.d.ts +2 -5
  43. package/dist/SingleGraphDashboard.js +194 -194
  44. package/dist/SingleGraphDashboard.js.map +1 -1
  45. package/dist/SingleGraphDashboardFromConfig.d.ts +2 -4
  46. package/dist/SingleGraphDashboardGeoHubMaps.cjs +2 -0
  47. package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -0
  48. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +428 -0
  49. package/dist/SingleGraphDashboardGeoHubMaps.js +185 -0
  50. package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -0
  51. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +2 -0
  52. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs.map +1 -0
  53. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +432 -0
  54. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +25 -0
  55. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -0
  56. package/dist/SingleGraphDashboardThreeDGraphs.cjs +2 -0
  57. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -0
  58. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +540 -0
  59. package/dist/SingleGraphDashboardThreeDGraphs.js +610 -0
  60. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -0
  61. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +2 -0
  62. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs.map +1 -0
  63. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +543 -0
  64. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +35 -0
  65. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -0
  66. package/dist/Types.d.ts +38 -11
  67. package/dist/checkIfMultiple-CYp3vADF.js +912 -0
  68. package/dist/checkIfMultiple-CYp3vADF.js.map +1 -0
  69. package/dist/checkIfMultiple-Do4kADNr.cjs +12 -0
  70. package/dist/checkIfMultiple-Do4kADNr.cjs.map +1 -0
  71. package/dist/getSchema.cjs.map +1 -1
  72. package/dist/getSchema.d.ts +7 -5
  73. package/dist/getSchema.js.map +1 -1
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.d.ts +330 -163
  76. package/dist/index.js +150 -136
  77. package/dist/index.js.map +1 -1
  78. package/dist/style.css +1 -1
  79. package/dist/transformData.cjs +1 -1
  80. package/dist/transformData.d.ts +5 -5
  81. package/dist/transformData.js +2 -2
  82. package/dist/{transformDataForAggregation-DAQJWGNL.js → transformDataForAggregation-CdcwlnNe.js} +2 -2
  83. package/dist/transformDataForAggregation-CdcwlnNe.js.map +1 -0
  84. package/dist/{transformDataForAggregation-BUGJnson.cjs → transformDataForAggregation-Du-Hei-W.cjs} +2 -2
  85. package/dist/transformDataForAggregation-Du-Hei-W.cjs.map +1 -0
  86. package/dist/{transformDataForGraphFromFile-DdNiOWeC.js → transformDataForGraphFromFile-CA0rw80A.js} +2 -2
  87. package/dist/{transformDataForGraphFromFile-DdNiOWeC.js.map → transformDataForGraphFromFile-CA0rw80A.js.map} +1 -1
  88. package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs → transformDataForGraphFromFile-D9G3ToQf.cjs} +2 -2
  89. package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs.map → transformDataForGraphFromFile-D9G3ToQf.cjs.map} +1 -1
  90. package/dist/transformDataForSelect-D8AuvYdf.js +14 -0
  91. package/dist/transformDataForSelect-D8AuvYdf.js.map +1 -0
  92. package/dist/transformDataForSelect-YmStusCI.cjs +2 -0
  93. package/dist/transformDataForSelect-YmStusCI.cjs.map +1 -0
  94. package/dist/validateSchema.d.ts +2 -4
  95. package/package.json +37 -2
  96. package/dist/checkIfMultiple-BB7PlCNh.js.map +0 -1
  97. package/dist/checkIfMultiple-D5ysrI7G.cjs +0 -12
  98. package/dist/checkIfMultiple-D5ysrI7G.cjs.map +0 -1
  99. package/dist/index-D9h2WYDS.cjs +0 -22
  100. package/dist/index-D9h2WYDS.cjs.map +0 -1
  101. package/dist/index-OCoyy1wG.js +0 -635
  102. package/dist/index-OCoyy1wG.js.map +0 -1
  103. package/dist/transformDataForAggregation-BUGJnson.cjs.map +0 -1
  104. package/dist/transformDataForAggregation-DAQJWGNL.js.map +0 -1
@@ -0,0 +1,493 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+
3
+ declare interface AnimateDataType {
4
+ duration: number;
5
+ once: boolean;
6
+ amount: 'some' | 'all' | number;
7
+ }
8
+
9
+ declare interface AnnotationSettingsDataType {
10
+ text: string;
11
+ maxWidth?: number;
12
+ xCoordinate?: number | string;
13
+ yCoordinate?: number | string;
14
+ xOffset?: number;
15
+ yOffset?: number;
16
+ align?: 'center' | 'left' | 'right';
17
+ color?: string;
18
+ fontWeight?: 'regular' | 'bold' | 'medium';
19
+ showConnector?: boolean | number;
20
+ connectorRadius?: number;
21
+ classNames?: {
22
+ connector?: string;
23
+ text?: string;
24
+ };
25
+ styles?: {
26
+ connector?: React.CSSProperties;
27
+ text?: React.CSSProperties;
28
+ };
29
+ }
30
+
31
+ declare interface AxesClassNameObject {
32
+ gridLines?: string;
33
+ labels?: string;
34
+ title?: string;
35
+ axis?: string;
36
+ }
37
+
38
+ declare interface AxesStyleObject {
39
+ gridLines?: React.CSSProperties;
40
+ labels?: React.CSSProperties;
41
+ title?: React.CSSProperties;
42
+ axis?: React.CSSProperties;
43
+ }
44
+
45
+ declare interface ClassNameObject {
46
+ title?: string;
47
+ footnote?: string;
48
+ source?: string;
49
+ description?: string;
50
+ tooltip?: string;
51
+ xAxis?: AxesClassNameObject;
52
+ yAxis?: AxesClassNameObject;
53
+ legend?: string;
54
+ graphContainer?: string;
55
+ graphObjectValues?: string;
56
+ dataConnectors?: string;
57
+ mouseOverLine?: string;
58
+ regLine?: string;
59
+ dataCards?: string;
60
+ }
61
+
62
+ declare interface ColumnConfigurationDataType {
63
+ column: string;
64
+ delimiter?: string;
65
+ }
66
+
67
+ declare type CurveTypes = 'linear' | 'curve' | 'step' | 'stepAfter' | 'stepBefore';
68
+
69
+ declare interface CustomHighlightAreaSettingsDataType {
70
+ coordinates: (number | string)[];
71
+ closePath?: boolean;
72
+ style?: React.CSSProperties;
73
+ className?: string;
74
+ color?: string;
75
+ strokeWidth?: number;
76
+ }
77
+
78
+ declare interface CustomLayerDataType {
79
+ position: 'before' | 'after';
80
+ layer: React.ReactNode;
81
+ }
82
+
83
+ declare interface DataSettingsDataType {
84
+ dataURL?: string | FileSettingsDataType[];
85
+ fileType?: 'csv' | 'json' | 'api';
86
+ delimiter?: string;
87
+ columnsToArray?: ColumnConfigurationDataType[];
88
+ apiHeaders?: any;
89
+ dataTransformation?: string;
90
+ idColumnTitle?: string;
91
+ data?: any;
92
+ }
93
+
94
+ declare interface DataTableColumnDataType {
95
+ columnTitle?: string;
96
+ columnId: string;
97
+ sortable?: boolean;
98
+ filterOptions?: string[];
99
+ chip?: boolean;
100
+ chipColumnId?: string;
101
+ chipColors?: {
102
+ value: string;
103
+ color: string;
104
+ }[];
105
+ separator?: string;
106
+ align?: 'left' | 'right' | 'center';
107
+ suffix?: string;
108
+ prefix?: string;
109
+ columnWidth?: number;
110
+ }
111
+
112
+ declare interface FileSettingsDataType {
113
+ dataURL: string;
114
+ idColumnName: string;
115
+ fileType?: 'csv' | 'json' | 'api';
116
+ delimiter?: string;
117
+ columnsToArray?: ColumnConfigurationDataType[];
118
+ apiHeaders?: any;
119
+ dataTransformation?: string;
120
+ }
121
+
122
+ declare type GeoHubGraphType = 'geoHubCompareMap' | 'geoHubMap' | 'geoHubMapWithLayerSelection';
123
+
124
+ declare interface GraphConfigurationDataType {
125
+ columnId: string | string[];
126
+ chartConfigId: string;
127
+ }
128
+
129
+ declare interface GraphSettingsDataType {
130
+ colors?: string | string[] | string[][];
131
+ orientation?: 'horizontal' | 'vertical';
132
+ axisTitles?: [string, string];
133
+ graphTitle?: string | React.ReactNode;
134
+ labelOrder?: string[];
135
+ graphDescription?: string | React.ReactNode;
136
+ footNote?: string | React.ReactNode;
137
+ height?: number;
138
+ width?: number;
139
+ suffix?: string;
140
+ prefix?: string;
141
+ sources?: SourcesDataType[];
142
+ barPadding?: number;
143
+ showTicks?: boolean;
144
+ leftMargin?: number;
145
+ rightMargin?: number;
146
+ truncateBy?: number;
147
+ colorDomain?: string[] | number[];
148
+ colorLegendTitle?: string;
149
+ backgroundColor?: string | boolean;
150
+ padding?: string;
151
+ topMargin?: number;
152
+ bottomMargin?: number;
153
+ relativeHeight?: number;
154
+ showColorScale?: boolean;
155
+ maxValue?: number;
156
+ minValue?: number;
157
+ tooltip?: string | ((_d: any) => React.ReactNode);
158
+ refValues?: ReferenceDataType[];
159
+ graphID?: string;
160
+ highlightedDataPoints?: (string | number)[];
161
+ graphDownload?: boolean;
162
+ sortData?: 'desc' | 'asc';
163
+ dataDownload?: boolean;
164
+ maxRadiusValue?: number;
165
+ leftBarTitle?: string;
166
+ rightBarTitle?: string;
167
+ barColors?: [string, string];
168
+ centerGap?: number;
169
+ columnData?: DataTableColumnDataType[];
170
+ mainText?: string;
171
+ subNote?: string;
172
+ radius?: number;
173
+ strokeWidth?: number;
174
+ showValues?: boolean;
175
+ scaleType?: ScaleDataType;
176
+ showColumnLabels?: boolean;
177
+ showRowLabels?: boolean;
178
+ noDataColor?: string;
179
+ fillContainer?: boolean;
180
+ numberOfBins?: number;
181
+ donutStrokeWidth?: number;
182
+ barGraphLayout?: 'horizontal' | 'vertical';
183
+ graphType?: 'circlePacking' | 'treeMap' | 'barGraph' | 'donutChart';
184
+ donutColorDomain?: string[];
185
+ lineTitles?: [string, string];
186
+ noOfXTicks?: number;
187
+ dateFormat?: string;
188
+ lineColors?: string[];
189
+ sameAxes?: boolean;
190
+ highlightAreaSettings?: HighlightAreaSettingsDataType[] | HighlightAreaSettingsForScatterPlotDataType[];
191
+ labels?: (string | number)[];
192
+ showColorLegendAtTop?: boolean;
193
+ highlightedLines?: (string | number)[];
194
+ area?: boolean;
195
+ mapData?: any;
196
+ xColorLegendTitle?: string;
197
+ yColorLegendTitle?: string;
198
+ xDomain?: [number, number, number, number];
199
+ yDomain?: [number, number, number, number];
200
+ scale?: number;
201
+ centerPoint?: [number, number];
202
+ mapBorderWidth?: number;
203
+ mapNoDataColor?: string;
204
+ mapBorderColor?: string;
205
+ isWorldMap?: boolean;
206
+ zoomScaleExtend?: [number, number];
207
+ zoomTranslateExtend?: [[number, number], [number, number]];
208
+ highlightedIds?: string[];
209
+ mapProperty?: string;
210
+ showAntarctica?: boolean;
211
+ mapStyles?: [string, string];
212
+ center?: [number, number];
213
+ zoomLevel?: number;
214
+ mapStyle?: string | {
215
+ style: string;
216
+ name: string;
217
+ }[];
218
+ barTitle?: string;
219
+ lineTitle?: string;
220
+ barColor?: string;
221
+ lineColor?: string;
222
+ showLabels?: boolean;
223
+ xAxisTitle?: string;
224
+ yAxisTitle?: string;
225
+ refXValues?: ReferenceDataType[];
226
+ refYValues?: ReferenceDataType[];
227
+ customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];
228
+ maxXValue?: number;
229
+ minXValue?: number;
230
+ maxYValue?: number;
231
+ minYValue?: number;
232
+ axisTitle?: [string, string];
233
+ year?: number | string;
234
+ aggregationMethod?: 'count' | 'max' | 'min' | 'average' | 'sum';
235
+ stripType?: 'strip' | 'dot';
236
+ language?: Languages;
237
+ animate?: boolean | AnimateDataType;
238
+ highlightColor?: string;
239
+ dotOpacity?: number;
240
+ sortParameter?: number | 'diff' | 'total';
241
+ arrowConnector?: boolean;
242
+ connectorStrokeWidth?: number;
243
+ countOnly?: (string | number)[];
244
+ value?: number;
245
+ gridSize?: number;
246
+ unitPadding?: number;
247
+ size?: number;
248
+ totalNoOfDots?: number;
249
+ showStrokeForWhiteDots?: boolean;
250
+ note?: string;
251
+ showNAColor?: boolean;
252
+ minHeight?: number;
253
+ autoPlay?: boolean;
254
+ autoSort?: boolean;
255
+ showOnlyActiveDate?: boolean;
256
+ showDots?: boolean;
257
+ diffAreaColors?: [string, string];
258
+ theme?: 'dark' | 'light';
259
+ uiMode?: 'light' | 'normal';
260
+ maxBarThickness?: number;
261
+ minBarThickness?: number;
262
+ maxNumberOfBars?: number;
263
+ includeLayers?: string[];
264
+ excludeLayers?: string[];
265
+ layerSelection?: {
266
+ layerID: string;
267
+ name: string[];
268
+ }[];
269
+ annotations?: AnnotationSettingsDataType[];
270
+ regressionLine?: boolean | string;
271
+ ariaLabel?: string;
272
+ nodePadding?: number;
273
+ nodeWidth?: number;
274
+ highlightedSourceDataPoints?: string[];
275
+ highlightedTargetDataPoints?: string[];
276
+ defaultLinkOpacity?: number;
277
+ sourceTitle?: string;
278
+ targetTitle?: string;
279
+ sortNodes?: 'asc' | 'desc' | 'mostReadable' | 'none';
280
+ sourceColors?: string[] | string;
281
+ targetColors?: string[] | string;
282
+ sourceColorDomain?: string[];
283
+ targetColorDomain?: string[];
284
+ showIntervalDots?: boolean;
285
+ showIntervalValues?: boolean;
286
+ intervalLineStrokeWidth?: number;
287
+ intervalLineColors?: [string, string];
288
+ intervalAreaColor?: string;
289
+ cardTemplate?: string | ((_d: any) => React.ReactNode);
290
+ cardBackgroundColor?: string;
291
+ legendMaxWidth?: string;
292
+ cardFilters?: {
293
+ column: string;
294
+ label?: string;
295
+ defaultValue?: string | number;
296
+ excludeValues?: (string | number)[];
297
+ width?: string;
298
+ }[];
299
+ cardSortingOptions?: {
300
+ defaultValue?: string;
301
+ options: {
302
+ value: string;
303
+ label: string;
304
+ type: 'asc' | 'desc';
305
+ }[];
306
+ width?: string;
307
+ };
308
+ cardSearchColumns?: string[];
309
+ cardMinWidth?: number;
310
+ textBackground?: boolean;
311
+ headingFontSize?: string;
312
+ centerAlign?: boolean;
313
+ verticalAlign?: 'center' | 'top' | 'bottom';
314
+ resetSelectionOnDoubleClick?: boolean;
315
+ intervalAreaOpacity?: number;
316
+ detailsOnClick?: string | ((_d: any) => React.ReactNode);
317
+ valueColor?: string;
318
+ labelColor?: string;
319
+ noOfYTicks?: number;
320
+ noOfTicks?: number;
321
+ minDate?: string | number;
322
+ maxDate?: string | number;
323
+ colorLegendColors?: string[];
324
+ colorLegendDomain?: string[];
325
+ barAxisTitle?: string;
326
+ barSuffix?: string;
327
+ barPrefix?: string;
328
+ lineSuffix?: string;
329
+ linePrefix?: string;
330
+ xSuffix?: string;
331
+ xPrefix?: string;
332
+ ySuffix?: string;
333
+ yPrefix?: string;
334
+ lineSuffixes?: [string, string];
335
+ linePrefixes?: [string, string];
336
+ allowDataDownloadOnDetail?: string | boolean;
337
+ noOfItemsInAPage?: number;
338
+ curveType?: CurveTypes;
339
+ styles?: StyleObject;
340
+ classNames?: ClassNameObject;
341
+ mapProjection?: MapProjectionTypes;
342
+ filterNA?: boolean;
343
+ fillShape?: boolean;
344
+ colorScaleMaxWidth?: string;
345
+ axisLabels?: (string | number)[];
346
+ minWidth?: string;
347
+ zoomInteraction?: ZoomInteractionTypes;
348
+ layout?: 'primary' | 'secondary';
349
+ qualitativeRangeColors?: string[];
350
+ targetStyle?: 'background' | 'line';
351
+ targetColor?: 'string';
352
+ measureBarWidthFactor?: number;
353
+ mapLegend?: string | React.ReactNode | MapLegendDataType[];
354
+ dimmedOpacity?: number;
355
+ precision?: number;
356
+ customLayers?: CustomLayerDataType[];
357
+ dashedLines?: (string | number)[];
358
+ dashSettings?: string[];
359
+ labelsToBeHidden?: (string | number)[];
360
+ autoRotate?: boolean;
361
+ enableZoom?: boolean;
362
+ globeMaterial?: MaterialDataType;
363
+ categorical?: boolean;
364
+ atmosphereColor?: string;
365
+ lineAxisTitle?: string;
366
+ timeline?: TimelineDataType;
367
+ naLabel?: string;
368
+ globeOffset?: [number, number];
369
+ polygonAltitude?: number;
370
+ }
371
+
372
+ declare type GraphType = GraphTypeForGriddedGraph;
373
+
374
+ declare type GraphTypeForGriddedGraph = 'barChart' | 'stackedBarChart' | 'groupedBarChart' | 'lineChart' | 'dualAxisLineChart' | 'multiLineChart' | 'multiLineAltChart' | 'differenceLineChart' | 'stackedAreaChart' | 'choroplethMap' | 'biVariateChoroplethMap' | 'dotDensityMap' | 'donutChart' | 'slopeChart' | 'scatterPlot' | 'dumbbellChart' | 'treeMap' | 'circlePacking' | 'heatMap' | 'stripChart' | 'beeSwarmChart' | 'butterflyChart' | 'histogram' | 'sparkLine' | 'paretoChart' | 'dataTable' | 'statCard' | 'unitChart' | 'sankeyChart' | 'lineChartWithConfidenceInterval' | 'dataCards' | 'radarChart' | 'bulletChart';
375
+
376
+ declare interface HighlightAreaSettingsDataType {
377
+ coordinates: [number | string | null, number | string | null];
378
+ style?: React.CSSProperties;
379
+ className?: string;
380
+ color?: string;
381
+ strokeWidth?: number;
382
+ }
383
+
384
+ declare interface HighlightAreaSettingsForScatterPlotDataType {
385
+ coordinates: [number | null, number | null, number | null, number | null];
386
+ style?: React.CSSProperties;
387
+ className?: string;
388
+ color?: string;
389
+ strokeWidth?: number;
390
+ }
391
+
392
+ declare interface InfoBoxDataType {
393
+ title?: string | React.ReactNode;
394
+ description?: string | React.ReactNode;
395
+ }
396
+
397
+ declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
398
+
399
+ declare interface MapLegendDataType {
400
+ mapStyleName: string;
401
+ legend: string | React.ReactNode;
402
+ }
403
+
404
+ declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
405
+
406
+ declare interface MaterialDataType {
407
+ color: string;
408
+ opacity: number;
409
+ transparent: boolean;
410
+ }
411
+
412
+ declare interface PerformanceIntensiveChaptersDataType {
413
+ dataSettings: DataSettingsDataType;
414
+ graphSettings: GraphSettingsDataType;
415
+ graphType: GraphType | GeoHubGraphType | ThreeDGraphType;
416
+ graphDataConfiguration?: GraphConfigurationDataType[];
417
+ sections: SectionsDataType[];
418
+ }
419
+
420
+ /** ScrollStory is a scrollytelling container component that reveals content step-by-step as the user scrolls through the page. */
421
+ export declare function PerformanceIntensiveScrollStory(props: Props): JSX.Element;
422
+
423
+ declare interface Props {
424
+ /** Defines if the information is shown as overlay or on the side */
425
+ mode?: 'overlay' | 'side';
426
+ /** Defines the width of the info section */
427
+ infoWidth?: string;
428
+ /** Defined the different chapters for the story and different sections within the story */
429
+ chapters: PerformanceIntensiveChaptersDataType[];
430
+ /** Position of info on the page */
431
+ infoPosition?: 'left' | 'right' | 'center';
432
+ /** Sets how much of the element (from 0 to 1) must be visible before it's considered in view and it trigger the animation in the scrollytelling */
433
+ visibilityThreshold?: number;
434
+ /** Sets background color of the info box. */
435
+ infoBackgroundColor?: string;
436
+ }
437
+
438
+ declare interface ReferenceDataType {
439
+ value: number | null;
440
+ text: string;
441
+ color?: string;
442
+ styles?: {
443
+ line?: React.CSSProperties;
444
+ text?: React.CSSProperties;
445
+ };
446
+ classNames?: {
447
+ line?: string;
448
+ text?: string;
449
+ };
450
+ }
451
+
452
+ declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
453
+
454
+ declare interface SectionsDataType {
455
+ graphSettings?: GraphSettingsDataType;
456
+ graphDataConfiguration?: GraphConfigurationDataType[];
457
+ infoBox: InfoBoxDataType;
458
+ }
459
+
460
+ declare interface SourcesDataType {
461
+ source: string;
462
+ link?: string;
463
+ }
464
+
465
+ declare interface StyleObject {
466
+ title?: React.CSSProperties;
467
+ footnote?: React.CSSProperties;
468
+ source?: React.CSSProperties;
469
+ description?: React.CSSProperties;
470
+ graphContainer?: React.CSSProperties;
471
+ tooltip?: React.CSSProperties;
472
+ xAxis?: AxesStyleObject;
473
+ yAxis?: AxesStyleObject;
474
+ graphObjectValues?: React.CSSProperties;
475
+ dataConnectors?: React.CSSProperties;
476
+ mouseOverLine?: React.CSSProperties;
477
+ regLine?: React.CSSProperties;
478
+ dataCards?: React.CSSProperties;
479
+ }
480
+
481
+ declare type ThreeDGraphType = 'threeDGlobe';
482
+
483
+ declare interface TimelineDataType {
484
+ autoplay: boolean;
485
+ enabled: boolean;
486
+ showOnlyActiveDate: boolean;
487
+ speed?: number;
488
+ dateFormat?: string;
489
+ }
490
+
491
+ declare type ZoomInteractionTypes = 'scroll' | 'ctrlScroll' | 'button' | 'noZoom';
492
+
493
+ export { }
@@ -0,0 +1,122 @@
1
+ import { j as i } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
+ import { useState as y, useRef as S } from "react";
3
+ import { SingleGraphDashboard as x } from "./SingleGraphDashboard.js";
4
+ import { SingleGraphDashboardThreeDGraphs as j } from "./SingleGraphDashboardThreeDGraphs.js";
5
+ import { SingleGraphDashboardGeoHubMaps as v } from "./SingleGraphDashboardGeoHubMaps.js";
6
+ import { m as D } from "./proxy-DJxJg1kD.js";
7
+ import { u as b } from "./use-in-view-BAHrBy6b.js";
8
+ function B(n) {
9
+ const {
10
+ chapters: h,
11
+ visibilityThreshold: g = 0.5,
12
+ mode: r = "overlay",
13
+ infoWidth: o = "320px",
14
+ infoPosition: s = "left",
15
+ infoBackgroundColor: c = "rgba(255,255,255,0.8)"
16
+ } = n, [t, p] = y(0), u = ["threeDGlobe"], d = ["geoHubCompareMap", "geoHubMap", "geoHubMapWithLayerSelection"], a = [];
17
+ return h.forEach((e, l) => {
18
+ e.sections.forEach((f, m) => {
19
+ a.push({
20
+ chapter: l,
21
+ dataSettings: e.dataSettings,
22
+ section: m,
23
+ graphType: e.graphType,
24
+ infoBox: f.infoBox,
25
+ graphSettings: { ...e.graphSettings, ...f.graphSettings || {}, animate: !0 },
26
+ graphDataConfiguration: f.graphDataConfiguration || e.graphDataConfiguration || []
27
+ });
28
+ });
29
+ }), /* @__PURE__ */ i.jsxs("div", { className: "relative w-full h-full", children: [
30
+ /* @__PURE__ */ i.jsx(
31
+ D.div,
32
+ {
33
+ className: "fixed top-0 h-full -z-10",
34
+ initial: { opacity: 0 },
35
+ animate: { opacity: 1 },
36
+ transition: { duration: 0.5 },
37
+ style: {
38
+ left: r === "overlay" || s === "right" ? 0 : o,
39
+ width: r === "overlay" ? "100%" : `calc(100% - ${o})`
40
+ },
41
+ children: u.includes(a[t].graphType) ? /* @__PURE__ */ i.jsx(
42
+ j,
43
+ {
44
+ graphType: a[t].graphType,
45
+ dataSettings: a[t].dataSettings,
46
+ graphSettings: a[t].graphSettings,
47
+ graphDataConfiguration: a[t].graphDataConfiguration
48
+ }
49
+ ) : d.includes(a[t].graphType) ? /* @__PURE__ */ i.jsx(
50
+ v,
51
+ {
52
+ graphType: a[t].graphType,
53
+ graphSettings: a[t].graphSettings
54
+ }
55
+ ) : /* @__PURE__ */ i.jsx(
56
+ x,
57
+ {
58
+ graphType: a[t].graphType,
59
+ dataSettings: a[t].dataSettings,
60
+ graphSettings: a[t].graphSettings,
61
+ graphDataConfiguration: a[t].graphDataConfiguration
62
+ }
63
+ )
64
+ },
65
+ a[t].chapter
66
+ ),
67
+ /* @__PURE__ */ i.jsx("div", { children: a.map((e, l) => /* @__PURE__ */ i.jsx(
68
+ T,
69
+ {
70
+ width: o,
71
+ index: l,
72
+ infoBox: e.infoBox,
73
+ setActiveIndex: p,
74
+ position: s,
75
+ mode: r,
76
+ visibilityThreshold: g,
77
+ backgroundColor: c
78
+ },
79
+ `${e.chapter}-${e.section}`
80
+ )) })
81
+ ] });
82
+ }
83
+ function T({
84
+ infoBox: n,
85
+ index: h,
86
+ setActiveIndex: g,
87
+ position: r,
88
+ mode: o,
89
+ visibilityThreshold: s,
90
+ backgroundColor: c,
91
+ width: t
92
+ }) {
93
+ const p = S(null);
94
+ return b(p, {
95
+ once: !1,
96
+ amount: s
97
+ }) && g(h), /* @__PURE__ */ i.jsx(
98
+ "section",
99
+ {
100
+ ref: p,
101
+ className: `min-h-screen flex ${r === "center" ? "justify-center" : r === "right" ? "justify-end" : "justify-start"}`,
102
+ children: /* @__PURE__ */ i.jsxs(
103
+ "div",
104
+ {
105
+ className: `p-8 ${o === "overlay" ? "h-fit mx-10 " : ""}`,
106
+ style: {
107
+ backgroundColor: c,
108
+ width: t
109
+ },
110
+ children: [
111
+ n.title,
112
+ n.description
113
+ ]
114
+ }
115
+ )
116
+ }
117
+ );
118
+ }
119
+ export {
120
+ B as PerformanceIntensiveScrollStory
121
+ };
122
+ //# sourceMappingURL=PerformanceIntensiveScrollStory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceIntensiveScrollStory.js","sources":["../src/Components/Dashboard/PerformanceIntensive/ScrollStory.tsx"],"sourcesContent":["// Scrollytelling.tsx\r\nimport { motion, useInView } from 'motion/react';\r\nimport { useRef, useState } from 'react';\r\n\r\nimport { SingleGraphDashboard } from '../SingleGraphDashboard';\r\n\r\nimport { SingleGraphDashboardThreeDGraphs } from './SingleGraphDashboardThreeDGraphs';\r\nimport { SingleGraphDashboardGeoHubMaps } from './SingleGraphDashboardGeoHubMaps';\r\n\r\nimport {\r\n PerformanceIntensiveChaptersDataType,\r\n InfoBoxDataType,\r\n SectionsArrDataType,\r\n ThreeDGraphType,\r\n GeoHubGraphType,\r\n GraphType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n /** Defines if the information is shown as overlay or on the side */\r\n mode?: 'overlay' | 'side';\r\n /** Defines the width of the info section */\r\n infoWidth?: string;\r\n /** Defined the different chapters for the story and different sections within the story */\r\n chapters: PerformanceIntensiveChaptersDataType[];\r\n /** Position of info on the page */\r\n infoPosition?: 'left' | 'right' | 'center';\r\n /** Sets how much of the element (from 0 to 1) must be visible before it's considered in view and it trigger the animation in the scrollytelling */\r\n visibilityThreshold?: number;\r\n /** Sets background color of the info box. */\r\n infoBackgroundColor?: string;\r\n}\r\n\r\n/** ScrollStory is a scrollytelling container component that reveals content step-by-step as the user scrolls through the page. */\r\nexport function PerformanceIntensiveScrollStory(props: Props) {\r\n const {\r\n chapters,\r\n visibilityThreshold = 0.5,\r\n mode = 'overlay',\r\n infoWidth = '320px',\r\n infoPosition = 'left',\r\n infoBackgroundColor = 'rgba(255,255,255,0.8)',\r\n } = props;\r\n const [activeIndex, setActiveIndex] = useState(0);\r\n const threeDGraphs = ['threeDGlobe'];\r\n const geoHubMaps = ['geoHubCompareMap', 'geoHubMap', 'geoHubMapWithLayerSelection'];\r\n const sectionsArr: SectionsArrDataType[] = [];\r\n chapters.forEach((d, i) => {\r\n d.sections.forEach((s, j) => {\r\n sectionsArr.push({\r\n chapter: i,\r\n dataSettings: d.dataSettings,\r\n section: j,\r\n graphType: d.graphType,\r\n infoBox: s.infoBox,\r\n graphSettings: { ...d.graphSettings, ...(s.graphSettings || {}), animate: true },\r\n graphDataConfiguration: s.graphDataConfiguration || d.graphDataConfiguration || [],\r\n });\r\n });\r\n });\r\n return (\r\n <div className='relative w-full h-full'>\r\n {/* Background Layer */}\r\n <motion.div\r\n key={sectionsArr[activeIndex].chapter}\r\n className='fixed top-0 h-full -z-10'\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n transition={{ duration: 0.5 }}\r\n style={{\r\n left: mode === 'overlay' ? 0 : infoPosition === 'right' ? 0 : infoWidth,\r\n width: mode === 'overlay' ? '100%' : `calc(100% - ${infoWidth})`,\r\n }}\r\n >\r\n {threeDGraphs.includes(sectionsArr[activeIndex].graphType) ? (\r\n <SingleGraphDashboardThreeDGraphs\r\n graphType={sectionsArr[activeIndex].graphType as ThreeDGraphType}\r\n dataSettings={sectionsArr[activeIndex].dataSettings}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n graphDataConfiguration={sectionsArr[activeIndex].graphDataConfiguration}\r\n />\r\n ) : geoHubMaps.includes(sectionsArr[activeIndex].graphType) ? (\r\n <SingleGraphDashboardGeoHubMaps\r\n graphType={sectionsArr[activeIndex].graphType as GeoHubGraphType}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n />\r\n ) : (\r\n <SingleGraphDashboard\r\n graphType={sectionsArr[activeIndex].graphType as GraphType}\r\n dataSettings={sectionsArr[activeIndex].dataSettings}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n graphDataConfiguration={sectionsArr[activeIndex].graphDataConfiguration}\r\n />\r\n )}\r\n </motion.div>\r\n <div>\r\n {sectionsArr.map((section, idx) => (\r\n <ScrollySection\r\n width={infoWidth}\r\n key={`${section.chapter}-${section.section}`}\r\n index={idx}\r\n infoBox={section.infoBox}\r\n setActiveIndex={setActiveIndex}\r\n position={infoPosition}\r\n mode={mode}\r\n visibilityThreshold={visibilityThreshold}\r\n backgroundColor={infoBackgroundColor}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nfunction ScrollySection({\r\n infoBox,\r\n index,\r\n setActiveIndex,\r\n position,\r\n mode,\r\n visibilityThreshold,\r\n backgroundColor,\r\n width,\r\n}: {\r\n infoBox: InfoBoxDataType;\r\n index: number;\r\n setActiveIndex: (idx: number) => void;\r\n position: 'left' | 'right' | 'center';\r\n mode: 'overlay' | 'side';\r\n visibilityThreshold: number;\r\n backgroundColor: string;\r\n width: string;\r\n}) {\r\n const ref = useRef(null);\r\n const isInView = useInView(ref, {\r\n once: false,\r\n amount: visibilityThreshold,\r\n });\r\n if (isInView) setActiveIndex(index);\r\n return (\r\n <section\r\n ref={ref}\r\n className={`min-h-screen flex ${position === 'center' ? 'justify-center' : position === 'right' ? 'justify-end' : 'justify-start'}`}\r\n >\r\n <div\r\n className={`p-8 ${mode === 'overlay' ? 'h-fit mx-10 ' : ''}`}\r\n style={{\r\n backgroundColor,\r\n width,\r\n }}\r\n >\r\n {infoBox.title}\r\n {infoBox.description}\r\n </div>\r\n </section>\r\n );\r\n}\r\n"],"names":["PerformanceIntensiveScrollStory","props","chapters","visibilityThreshold","mode","infoWidth","infoPosition","infoBackgroundColor","activeIndex","setActiveIndex","useState","threeDGraphs","geoHubMaps","sectionsArr","d","i","s","j","jsxs","jsx","motion","SingleGraphDashboardThreeDGraphs","SingleGraphDashboardGeoHubMaps","SingleGraphDashboard","section","idx","ScrollySection","infoBox","index","position","backgroundColor","width","ref","useRef","useInView"],"mappings":";;;;;;;AAkCO,SAASA,EAAgCC,GAAc;AAC5D,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,cAAAC,IAAe;AAAA,IACf,qBAAAC,IAAsB;AAAA,EAAA,IACpBN,GACE,CAACO,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1CC,IAAe,CAAC,aAAa,GAC7BC,IAAa,CAAC,oBAAoB,aAAa,6BAA6B,GAC5EC,IAAqC,CAAA;AAC3C,SAAAX,EAAS,QAAQ,CAACY,GAAGC,MAAM;AACzB,IAAAD,EAAE,SAAS,QAAQ,CAACE,GAAGC,MAAM;AAC3B,MAAAJ,EAAY,KAAK;AAAA,QACf,SAASE;AAAA,QACT,cAAcD,EAAE;AAAA,QAChB,SAASG;AAAA,QACT,WAAWH,EAAE;AAAA,QACb,SAASE,EAAE;AAAA,QACX,eAAe,EAAE,GAAGF,EAAE,eAAe,GAAIE,EAAE,iBAAiB,CAAA,GAAK,SAAS,GAAA;AAAA,QAC1E,wBAAwBA,EAAE,0BAA0BF,EAAE,0BAA0B,CAAA;AAAA,MAAC,CAClF;AAAA,IACH,CAAC;AAAA,EACH,CAAC,GAECI,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,0BAEb,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;AAAA,QACP,SAASD,EAAQ;AAAA,QACjB,gBAAAf;AAAA,QACA,UAAUH;AAAA,QACV,MAAAF;AAAA,QACA,qBAAAD;AAAA,QACA,iBAAiBI;AAAA,MAAA;AAAA,MAPZ,GAAGiB,EAAQ,OAAO,IAAIA,EAAQ,OAAO;AAAA,IAAA,CAS7C,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;AAEA,SAASE,EAAe;AAAA,EACtB,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAnB;AAAA,EACA,UAAAoB;AAAA,EACA,MAAAzB;AAAA,EACA,qBAAAD;AAAA,EACA,iBAAA2B;AAAA,EACA,OAAAC;AACF,GASG;AACD,QAAMC,IAAMC,EAAO,IAAI;AAKvB,SAJiBC,EAAUF,GAAK;AAAA,IAC9B,MAAM;AAAA,IACN,QAAQ7B;AAAA,EAAA,CACT,OAC4ByB,CAAK,GAEhCT,gBAAAA,EAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAa;AAAA,MACA,WAAW,qBAAqBH,MAAa,WAAW,mBAAmBA,MAAa,UAAU,gBAAgB,eAAe;AAAA,MAEjI,UAAAX,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,OAAOd,MAAS,YAAY,iBAAiB,EAAE;AAAA,UAC1D,OAAO;AAAA,YACL,iBAAA0B;AAAA,YACA,OAAAC;AAAA,UAAA;AAAA,UAGD,UAAA;AAAA,YAAAJ,EAAQ;AAAA,YACRA,EAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACX;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollStory.cjs","sources":["../src/Components/Dashboard/ScrollStory.tsx"],"sourcesContent":["// Scrollytelling.tsx\r\nimport { motion, useInView } from 'motion/react';\r\nimport { useRef, useState } from 'react';\r\n\r\nimport { SingleGraphDashboard } from './SingleGraphDashboard';\r\n\r\nimport { ChaptersDataType, InfoBoxDataType, SectionsArrDataType } from '@/Types';\r\n\r\ninterface Props {\r\n /** Defines if the information is shown as overlay or on the side */\r\n mode?: 'overlay' | 'side';\r\n /** Defines the width of the info section */\r\n infoWidth?: string;\r\n /** Defined the different chapters for the story and different sections within the story */\r\n chapters: ChaptersDataType[];\r\n /** Position of info on the page */\r\n infoPosition?: 'left' | 'right' | 'center';\r\n /** Sets how much of the element (from 0 to 1) must be visible before it's considered in view and it trigger the animation in the scrollytelling */\r\n visibilityThreshold?: number;\r\n /** Sets background color of the info box. */\r\n infoBackgroundColor?: string;\r\n}\r\n\r\n/** ScrollStory is a scrollytelling container component that reveals content step-by-step as the user scrolls through the page. */\r\nexport function ScrollStory(props: Props) {\r\n const {\r\n chapters,\r\n visibilityThreshold = 0.5,\r\n mode = 'overlay',\r\n infoWidth = '320px',\r\n infoPosition = 'left',\r\n infoBackgroundColor = 'rgba(255,255,255,0.8)',\r\n } = props;\r\n const [activeIndex, setActiveIndex] = useState(0);\r\n const sectionsArr: SectionsArrDataType[] = [];\r\n chapters.forEach((d, i) => {\r\n d.sections.forEach((s, j) => {\r\n sectionsArr.push({\r\n chapter: i,\r\n dataSettings: d.dataSettings,\r\n section: j,\r\n graphType: d.graphType,\r\n infoBox: s.infoBox,\r\n graphSettings: { ...d.graphSettings, ...(s.graphSettings || {}), animate: true },\r\n graphDataConfiguration: s.graphDataConfiguration || d.graphDataConfiguration || [],\r\n });\r\n });\r\n });\r\n return (\r\n <div className='relative w-full h-full'>\r\n {/* Background Layer */}\r\n <motion.div\r\n key={sectionsArr[activeIndex].chapter}\r\n className='fixed top-0 h-full -z-10'\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n transition={{ duration: 0.5 }}\r\n style={{\r\n left: mode === 'overlay' ? 0 : infoPosition === 'right' ? 0 : infoWidth,\r\n width: mode === 'overlay' ? '100%' : `calc(100% - ${infoWidth})`,\r\n }}\r\n >\r\n <SingleGraphDashboard\r\n graphType={sectionsArr[activeIndex].graphType}\r\n dataSettings={sectionsArr[activeIndex].dataSettings}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n graphDataConfiguration={sectionsArr[activeIndex].graphDataConfiguration}\r\n />\r\n </motion.div>\r\n <div>\r\n {sectionsArr.map((section, idx) => (\r\n <ScrollySection\r\n width={infoWidth}\r\n key={`${section.chapter}-${section.section}`}\r\n index={idx}\r\n infoBox={section.infoBox}\r\n setActiveIndex={setActiveIndex}\r\n position={infoPosition}\r\n mode={mode}\r\n visibilityThreshold={visibilityThreshold}\r\n backgroundColor={infoBackgroundColor}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nfunction ScrollySection({\r\n infoBox,\r\n index,\r\n setActiveIndex,\r\n position,\r\n mode,\r\n visibilityThreshold,\r\n backgroundColor,\r\n width,\r\n}: {\r\n infoBox: InfoBoxDataType;\r\n index: number;\r\n setActiveIndex: (idx: number) => void;\r\n position: 'left' | 'right' | 'center';\r\n mode: 'overlay' | 'side';\r\n visibilityThreshold: number;\r\n backgroundColor: string;\r\n width: string;\r\n}) {\r\n const ref = useRef(null);\r\n const isInView = useInView(ref, {\r\n once: false,\r\n amount: visibilityThreshold,\r\n });\r\n if (isInView) setActiveIndex(index);\r\n return (\r\n <section\r\n ref={ref}\r\n className={`min-h-screen flex ${position === 'center' ? 'justify-center' : position === 'right' ? 'justify-end' : 'justify-start'}`}\r\n >\r\n <div\r\n className={`p-8 ${mode === 'overlay' ? 'h-fit mx-10 ' : ''}`}\r\n style={{\r\n backgroundColor,\r\n width,\r\n }}\r\n >\r\n {infoBox.title}\r\n {infoBox.description}\r\n </div>\r\n </section>\r\n );\r\n}\r\n"],"names":["ScrollStory","props","chapters","visibilityThreshold","mode","infoWidth","infoPosition","infoBackgroundColor","activeIndex","setActiveIndex","useState","sectionsArr","d","i","s","j","jsxs","jsx","motion","SingleGraphDashboard","section","idx","ScrollySection","infoBox","index","position","backgroundColor","width","ref","useRef","useInView"],"mappings":"sQAwBO,SAASA,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jB,EAEP,MAAOgB,EACP,QAASD,EAAQ,QACjB,eAAAX,EACA,SAAUH,EACV,KAAAF,EACA,oBAAAD,EACA,gBAAiBI,CAAA,EAPZ,GAAGa,EAAQ,OAAO,IAAIA,EAAQ,OAAO,EAAA,CAS7C,CAAA,CACH,CAAA,EACF,CAEJ,CAEA,SAASE,EAAe,CACtB,QAAAC,EACA,MAAAC,EACA,eAAAf,EACA,SAAAgB,EACA,KAAArB,EACA,oBAAAD,EACA,gBAAAuB,EACA,MAAAC,CACF,EASG,CACD,MAAMC,EAAMC,EAAAA,OAAO,IAAI,EAKvB,OAJiBC,EAAAA,UAAUF,EAAK,CAC9B,KAAM,GACN,OAAQzB,CAAA,CACT,KAC4BqB,CAAK,EAEhCP,EAAAA,kBAAAA,IAAC,UAAA,CACC,IAAAW,EACA,UAAW,qBAAqBH,IAAa,SAAW,iBAAmBA,IAAa,QAAU,cAAgB,eAAe,GAEjI,SAAAT,EAAAA,kBAAAA,KAAC,MAAA,CACC,UAAW,OAAOZ,IAAS,UAAY,eAAiB,EAAE,GAC1D,MAAO,CACL,gBAAAsB,EACA,MAAAC,CAAA,EAGD,SAAA,CAAAJ,EAAQ,MACRA,EAAQ,WAAA,CAAA,CAAA,CACX,CAAA,CAGN"}
1
+ {"version":3,"file":"ScrollStory.cjs","sources":["../src/Components/Dashboard/ScrollStory.tsx"],"sourcesContent":["// Scrollytelling.tsx\r\nimport { motion, useInView } from 'motion/react';\r\nimport { useRef, useState } from 'react';\r\n\r\nimport { SingleGraphDashboard } from './SingleGraphDashboard';\r\n\r\nimport {\r\n ChaptersDataType,\r\n GraphTypeForGriddedGraph,\r\n InfoBoxDataType,\r\n SectionsArrDataType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n /** Defines if the information is shown as overlay or on the side */\r\n mode?: 'overlay' | 'side';\r\n /** Defines the width of the info section */\r\n infoWidth?: string;\r\n /** Defined the different chapters for the story and different sections within the story */\r\n chapters: ChaptersDataType[];\r\n /** Position of info on the page */\r\n infoPosition?: 'left' | 'right' | 'center';\r\n /** Sets how much of the element (from 0 to 1) must be visible before it's considered in view and it trigger the animation in the scrollytelling */\r\n visibilityThreshold?: number;\r\n /** Sets background color of the info box. */\r\n infoBackgroundColor?: string;\r\n}\r\n\r\n/** ScrollStory is a scrollytelling container component that reveals content step-by-step as the user scrolls through the page. This does not include GeoHub maps and 3-D graph; for those please use `PerformanceIntensiveScrollStory`. */\r\nexport function ScrollStory(props: Props) {\r\n const {\r\n chapters,\r\n visibilityThreshold = 0.5,\r\n mode = 'overlay',\r\n infoWidth = '320px',\r\n infoPosition = 'left',\r\n infoBackgroundColor = 'rgba(255,255,255,0.8)',\r\n } = props;\r\n const [activeIndex, setActiveIndex] = useState(0);\r\n const sectionsArr: SectionsArrDataType[] = [];\r\n chapters.forEach((d, i) => {\r\n d.sections.forEach((s, j) => {\r\n sectionsArr.push({\r\n chapter: i,\r\n dataSettings: d.dataSettings,\r\n section: j,\r\n graphType: d.graphType,\r\n infoBox: s.infoBox,\r\n graphSettings: { ...d.graphSettings, ...(s.graphSettings || {}), animate: true },\r\n graphDataConfiguration: s.graphDataConfiguration || d.graphDataConfiguration || [],\r\n });\r\n });\r\n });\r\n return (\r\n <div className='relative w-full h-full'>\r\n {/* Background Layer */}\r\n <motion.div\r\n key={sectionsArr[activeIndex].chapter}\r\n className='fixed top-0 h-full -z-10'\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n transition={{ duration: 0.5 }}\r\n style={{\r\n left: mode === 'overlay' ? 0 : infoPosition === 'right' ? 0 : infoWidth,\r\n width: mode === 'overlay' ? '100%' : `calc(100% - ${infoWidth})`,\r\n }}\r\n >\r\n <SingleGraphDashboard\r\n graphType={sectionsArr[activeIndex].graphType as GraphTypeForGriddedGraph}\r\n dataSettings={sectionsArr[activeIndex].dataSettings}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n graphDataConfiguration={sectionsArr[activeIndex].graphDataConfiguration}\r\n />\r\n </motion.div>\r\n <div>\r\n {sectionsArr.map((section, idx) => (\r\n <ScrollySection\r\n width={infoWidth}\r\n key={`${section.chapter}-${section.section}`}\r\n index={idx}\r\n infoBox={section.infoBox}\r\n setActiveIndex={setActiveIndex}\r\n position={infoPosition}\r\n mode={mode}\r\n visibilityThreshold={visibilityThreshold}\r\n backgroundColor={infoBackgroundColor}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nfunction ScrollySection({\r\n infoBox,\r\n index,\r\n setActiveIndex,\r\n position,\r\n mode,\r\n visibilityThreshold,\r\n backgroundColor,\r\n width,\r\n}: {\r\n infoBox: InfoBoxDataType;\r\n index: number;\r\n setActiveIndex: (idx: number) => void;\r\n position: 'left' | 'right' | 'center';\r\n mode: 'overlay' | 'side';\r\n visibilityThreshold: number;\r\n backgroundColor: string;\r\n width: string;\r\n}) {\r\n const ref = useRef(null);\r\n const isInView = useInView(ref, {\r\n once: false,\r\n amount: visibilityThreshold,\r\n });\r\n if (isInView) setActiveIndex(index);\r\n return (\r\n <section\r\n ref={ref}\r\n className={`min-h-screen flex ${position === 'center' ? 'justify-center' : position === 'right' ? 'justify-end' : 'justify-start'}`}\r\n >\r\n <div\r\n className={`p-8 ${mode === 'overlay' ? 'h-fit mx-10 ' : ''}`}\r\n style={{\r\n backgroundColor,\r\n width,\r\n }}\r\n >\r\n {infoBox.title}\r\n {infoBox.description}\r\n </div>\r\n </section>\r\n );\r\n}\r\n"],"names":["ScrollStory","props","chapters","visibilityThreshold","mode","infoWidth","infoPosition","infoBackgroundColor","activeIndex","setActiveIndex","useState","sectionsArr","d","i","s","j","jsxs","jsx","motion","SingleGraphDashboard","section","idx","ScrollySection","infoBox","index","position","backgroundColor","width","ref","useRef","useInView"],"mappings":"sQA6BO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,SAAAC,EACA,oBAAAC,EAAsB,GACtB,KAAAC,EAAO,UACP,UAAAC,EAAY,QACZ,aAAAC,EAAe,OACf,oBAAAC,E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