@cdc/map 4.25.10 → 4.25.11

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 (88) hide show
  1. package/.claude/agents/typescript-organizer.md +118 -0
  2. package/dist/{cdcmap-fce76882.es.js → cdcmap-BnB1QM5d.es.js} +6 -13
  3. package/dist/{cdcmap-c55ac1ea.es.js → cdcmap-D6CG2-Hb.es.js} +5 -12
  4. package/dist/{cdcmap-31a33da1.es.js → cdcmap-MXgURbdZ.es.js} +6 -13
  5. package/dist/{cdcmap-1a1724a1.es.js → cdcmap-dgT_1dIT.es.js} +136 -151
  6. package/dist/cdcmap.js +27405 -25783
  7. package/examples/example-city-state.json +9 -1
  8. package/examples/multi-country-centering.json +45 -0
  9. package/examples/private/colors-2.json +221 -0
  10. package/examples/private/colors.json +221 -0
  11. package/index.html +2 -1
  12. package/package.json +4 -4
  13. package/src/CdcMapComponent.tsx +44 -20
  14. package/src/_stories/CdcMap.ColumnWrap.stories.tsx +31 -0
  15. package/src/_stories/CdcMap.DistrictOfColumbia.stories.tsx +320 -0
  16. package/src/_stories/CdcMap.Editor.stories.tsx +3371 -0
  17. package/src/_stories/CdcMap.SmallMultiples.stories.tsx +35 -0
  18. package/src/_stories/CdcMap.stories.tsx +22 -4
  19. package/src/_stories/_mock/column-wrap-test.json +265 -0
  20. package/src/_stories/_mock/multi-country-hide.json +78 -0
  21. package/src/_stories/_mock/multi-country.json +95 -0
  22. package/src/_stories/_mock/multi-state.json +887 -20403
  23. package/src/_stories/_mock/small_multiples/multi-state-small-multiples.json +8399 -0
  24. package/src/_stories/_mock/small_multiples/region-small-multiples.json +657 -0
  25. package/src/_stories/_mock/small_multiples/wastewater-map-small-multiples.json +221 -0
  26. package/src/_stories/_mock/usa-state-gradient.json +2 -4
  27. package/src/components/BubbleList.tsx +1 -1
  28. package/src/components/EditorPanel/components/EditorPanel.tsx +630 -564
  29. package/src/components/EditorPanel/components/HexShapeSettings.tsx +55 -93
  30. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +27 -37
  31. package/src/components/EditorPanel/components/Panels/Panel.SmallMultiples.tsx +354 -0
  32. package/src/components/EditorPanel/components/Panels/index.tsx +3 -1
  33. package/src/components/Geo.tsx +20 -3
  34. package/src/components/Legend/components/Legend.tsx +34 -34
  35. package/src/components/Legend/components/index.scss +1 -1
  36. package/src/components/NavigationMenu.tsx +16 -13
  37. package/src/components/SmallMultiples/SmallMultipleTile.tsx +163 -0
  38. package/src/components/SmallMultiples/SmallMultiples.css +32 -0
  39. package/src/components/SmallMultiples/SmallMultiples.tsx +150 -0
  40. package/src/components/SmallMultiples/SynchronizedTooltip.tsx +105 -0
  41. package/src/components/SmallMultiples/index.tsx +3 -0
  42. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +18 -3
  43. package/src/components/UsaMap/components/TerritoriesSection.tsx +26 -12
  44. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +30 -4
  45. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +23 -4
  46. package/src/components/UsaMap/components/Territory/TerritoryShape.ts +6 -0
  47. package/src/components/UsaMap/components/UsaMap.County.tsx +14 -2
  48. package/src/components/UsaMap/components/UsaMap.Region.tsx +14 -1
  49. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +25 -5
  50. package/src/components/UsaMap/components/UsaMap.State.tsx +26 -3
  51. package/src/components/UsaMap/helpers/map.ts +2 -2
  52. package/src/components/UsaMap/helpers/shapes.ts +9 -6
  53. package/src/components/WorldMap/WorldMap.tsx +81 -11
  54. package/src/data/initial-state.js +10 -0
  55. package/src/data/supported-geos.js +8 -76
  56. package/src/helpers/addUIDs.ts +13 -2
  57. package/src/helpers/applyColorToLegend.ts +25 -1
  58. package/src/helpers/constants.ts +1 -15
  59. package/src/helpers/displayGeoName.ts +19 -4
  60. package/src/helpers/generateRuntimeLegend.ts +0 -2
  61. package/src/helpers/getCountriesPicked.ts +103 -0
  62. package/src/helpers/getMapContainerClasses.ts +7 -0
  63. package/src/helpers/getPatternForRow.ts +2 -5
  64. package/src/helpers/index.ts +1 -9
  65. package/src/helpers/smallMultiplesHelpers.ts +359 -0
  66. package/src/helpers/tests/titleCase.test.ts +76 -0
  67. package/src/helpers/titleCase.ts +13 -13
  68. package/src/helpers/urlDataHelpers.ts +1 -1
  69. package/src/hooks/useCountryZoom.tsx +241 -0
  70. package/src/hooks/useGeoClickHandler.ts +1 -1
  71. package/src/hooks/useProgrammaticMapTooltip.ts +110 -0
  72. package/src/hooks/useResizeObserver.ts +5 -2
  73. package/src/hooks/useStateZoom.tsx +5 -2
  74. package/src/hooks/useSynchronizedGeographies.ts +56 -0
  75. package/src/index.jsx +1 -0
  76. package/src/scss/editor-panel.scss +4 -440
  77. package/src/scss/main.scss +1 -1
  78. package/src/scss/map.scss +12 -15
  79. package/src/store/map.actions.ts +7 -7
  80. package/src/types/MapConfig.ts +30 -11
  81. package/src/types/MapContext.ts +6 -0
  82. package/src/types/runtimeLegend.ts +1 -1
  83. package/src/components/DataTable.tsx +0 -413
  84. package/src/components/EditorPanel/components/Inputs.tsx +0 -59
  85. package/src/hooks/useActiveElement.ts +0 -19
  86. package/src/scss/mixins.scss +0 -47
  87. package/src/types/Annotations.ts +0 -24
  88. /package/dist/{cdcmap-548642e6.es.js → cdcmap-Ct2SB0vL.es.js} +0 -0
@@ -1,3 +1,6 @@
1
+ // Map-specific Editor Panel Styles
2
+ // Common editor panel styles are imported from @cdc/core/styles/editor-panel-base via cove-main.scss
3
+
1
4
  .post-type-cdc_visualization {
2
5
  .cove {
3
6
  // Temp Radio button fix
@@ -14,8 +17,8 @@
14
17
  // End Temp Radio button fix
15
18
  }
16
19
  }
17
- .cdc-open-viz-module {
18
20
 
21
+ .cdc-open-viz-module {
19
22
  .editor-panel {
20
23
  .cove-input-group,
21
24
  .cove-accordion__small-inputs {
@@ -92,287 +95,9 @@
92
95
  margin-left: 0.3rem;
93
96
  }
94
97
 
95
-
96
- .form-container {
97
- border-right: var(--lightGray) 1px solid;
98
- flex-grow: 1;
99
- }
100
-
101
- .guidance-link {
102
- margin: 2em 1em 0;
103
- padding: 0.75em 1em;
104
- align-items: center;
105
- .heading-3 {
106
- font-weight: 600;
107
- font-size: 1.2em;
108
- }
109
- svg {
110
- width: 60px;
111
- color: var(--blue);
112
- margin-right: 1rem;
113
- height: 60px; // IE11
114
- path {
115
- fill: currentColor;
116
- }
117
- }
118
- }
119
- .warning {
120
- color: #d8000c;
121
- background-color: #ffd2d2;
122
- padding: 0.75em 1em;
123
- margin: 1em 0;
124
- font-size: 0.8em;
125
- border: #d8000c 1px solid;
126
- border-radius: 0.4em;
127
- strong {
128
- font-weight: 600;
129
- display: block;
130
- }
131
- }
132
- .accordion__button {
133
- cursor: pointer;
134
- font-size: 1em;
135
- padding: 0.3em 1em;
136
- width: 100%;
137
- text-align: left;
138
- position: relative;
139
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
140
- }
141
-
142
- .accordion__button:before {
143
- display: inline-block;
144
- content: '';
145
- height: 7px;
146
- width: 7px;
147
- margin-right: 1em;
148
- border-bottom: 2px solid currentColor;
149
- border-right: 2px solid currentColor;
150
- right: 0;
151
- position: absolute;
152
- top: 50%;
153
- transform: rotate(-45deg) translateY(-50%);
154
- transition: 0.1s all;
155
- }
156
-
157
- .accordion__button[aria-expanded='true']::before,
158
- .accordion__button[aria-selected='true']::before {
159
- top: 45%;
160
- transform: rotate(45deg) translateY(-50%);
161
- margin-right: 1.3em;
162
- transition: 0.1s all;
163
- }
164
-
165
- .accordion__panel {
166
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
167
- padding: 1em 1.25em 2em;
168
- animation: fadein 0.2s ease-in;
169
- span.h5 {
170
- font-size: 0.8em;
171
- }
172
- & p.layer-purpose-details {
173
- margin-top: 1em;
174
- }
175
- }
176
-
177
- .advanced {
178
- padding: 0 1em 1em;
179
- text-align: left;
180
- p {
181
- font-size: 0.8rem;
182
- }
183
- .advanced-toggle-link {
184
- padding-top: 1em;
185
- display: block;
186
- text-align: left;
187
- cursor: pointer;
188
- text-decoration: underline;
189
- span {
190
- text-decoration: none;
191
- display: inline-block;
192
- font-family: monospace;
193
- padding-right: 5px;
194
- }
195
- &:hover {
196
- color: rgba(0, 0, 0, 0.7);
197
- }
198
- }
199
- textarea {
200
- height: 400px;
201
- width: 100%;
202
- font-size: 0.9em;
203
- padding: 0.5em;
204
- font-family: monospace;
205
- box-sizing: border-box;
206
- }
207
- }
208
-
209
- @keyframes fadein {
210
- 0% {
211
- opacity: 0;
212
- }
213
-
214
- 100% {
215
- opacity: 1;
216
- }
217
- }
218
-
219
- .base-label {
220
- background: #565656;
221
- color: #fff;
222
- font-size: 1.1em;
223
- padding: 0.6em 1em;
224
- position: relative;
225
- border-bottom: #565656 3px solid;
226
- z-index: 3;
227
- }
228
-
229
- label {
230
- text-transform: uppercase;
231
- display: block;
232
- font-size: 0.8em;
233
- font-weight: 600;
234
- &:not(:first-child) {
235
- margin-top: 1em;
236
- }
237
- span.edit-label {
238
- margin-bottom: 0.3em;
239
- display: flex;
240
- }
241
- span.column-heading {
242
- font-size: 1em;
243
- }
244
- &.checkbox {
245
- margin-top: 0.5rem;
246
- display: flex;
247
-
248
- input {
249
- margin-left: 0;
250
- width: inherit;
251
- display: inline;
252
- }
253
- }
254
- }
255
- input[type='text'],
256
- input[role='combobox'],
257
- input[type='number'],
258
- textarea {
259
- min-width: 100%;
260
- max-width: 100%; // Doing this prevents width of textarea from being changed
261
- }
262
98
  textarea {
263
99
  min-height: 140px;
264
100
  }
265
- .header .color-palette li {
266
- width: 21px;
267
- height: 21px;
268
- border-radius: 40px;
269
- margin-right: 2.8px;
270
- }
271
- .color-palette {
272
- display: flex;
273
- max-width: 100%;
274
- padding: 0;
275
- margin: 0.5em 0 0 0;
276
- list-style: none;
277
- flex-wrap: wrap;
278
- li {
279
- width: 45px;
280
- height: 23px;
281
- margin-right: 4px;
282
- margin-bottom: 10px;
283
- display: flex;
284
- border-radius: 5px;
285
- overflow: hidden;
286
- cursor: pointer;
287
- position: relative;
288
- .click-target {
289
- position: absolute;
290
- top: 0;
291
- left: 0;
292
- right: 0;
293
- bottom: 0;
294
- }
295
- &.selected {
296
- border: rgba(0, 0, 0, 0.8) 2px solid;
297
- }
298
- span {
299
- width: 33.3%;
300
- }
301
- }
302
- }
303
-
304
- fieldset {
305
- display: block;
306
- }
307
-
308
- .primary-fieldset {
309
- padding: 0;
310
- margin: 0;
311
- border: 0;
312
- }
313
-
314
- ul.column-edit {
315
- list-style: none;
316
- li {
317
- margin-top: 1em;
318
- }
319
- .three-col {
320
- display: flex;
321
- justify-content: space-between;
322
- > label {
323
- margin-top: 0;
324
- width: 30%;
325
- display: inline-block;
326
- input[type='text'],
327
- input[type='number'] {
328
- width: 50px;
329
- }
330
- }
331
- }
332
- }
333
-
334
- &.hidden {
335
- display: none;
336
- }
337
-
338
- .emove-column {
339
- float: right;
340
- text-transform: uppercase;
341
- color: #c32b2b;
342
- font-size: 0.7em;
343
- line-height: 1.6em;
344
- border-radius: 5px;
345
- margin: 0 auto;
346
- transition: 0.1s all;
347
- border: 0;
348
- text-decoration: underline;
349
- outline: 0;
350
- cursor: pointer;
351
- font-weight: bold;
352
- }
353
-
354
- .edit-block {
355
- padding-left: 1em;
356
- border-left: rgba(0, 0, 0, 0.2) 4px solid;
357
- transition: 0.2s all;
358
- &:not(:first-child) {
359
- margin-top: 2em;
360
- }
361
- input[type='text'],
362
- input[type='number'] {
363
- font-size: 1em;
364
- }
365
- label {
366
- margin-top: 0;
367
- }
368
- label + label {
369
- margin-top: 1em;
370
- }
371
- &:hover {
372
- border-left: rgba(0, 0, 0, 0.7) 4px solid;
373
- transition: 0.2s all;
374
- }
375
- }
376
101
 
377
102
  .data-toggle {
378
103
  list-style: none;
@@ -443,167 +168,6 @@
443
168
  }
444
169
  }
445
170
  }
446
-
447
- span.subtext {
448
- display: block;
449
- color: rgba(0, 0, 0, 0.5);
450
- text-transform: none;
451
- font-weight: normal;
452
- }
453
-
454
- .sort-list {
455
- list-style: none;
456
- > li {
457
- margin-right: 0.3em;
458
- margin-bottom: 0.3em;
459
- }
460
- }
461
- .sort-list li > div {
462
- display: block;
463
- box-sizing: border-box;
464
- border: 1px solid #d1d1d1;
465
- border-radius: 2px;
466
- background: #f1f1f1;
467
- padding: 0.4em 0.6em;
468
- font-size: 0.8em;
469
- margin-bottom: 0.3em;
470
- cursor: move;
471
- z-index: 999;
472
- }
473
-
474
- .info {
475
- font-size: 0.8em;
476
- line-height: 1.4em;
477
- font-style: italic;
478
- padding-top: 10px;
479
- }
480
-
481
- .react-tags__search {
482
- width: 100%;
483
- }
484
-
485
- .react-tags {
486
- position: relative;
487
- input.react-tags__search-input {
488
- font-size: 0.8rem;
489
- }
490
- /* clicking anywhere will focus the input */
491
- cursor: text;
492
- span {
493
- display: inline;
494
- }
495
- }
496
-
497
- .react-tags.is-focused {
498
- border-color: rgba(0, 0, 0, 0.7);
499
- }
500
-
501
- .react-tags__selected {
502
- display: inline;
503
- }
504
-
505
- .react-tags__selected-tag {
506
- display: inline-block;
507
- box-sizing: border-box;
508
- border: 1px solid #d1d1d1;
509
- border-radius: 2px;
510
- background: #f1f1f1;
511
- padding: 0.4em 0.6em;
512
- font-size: 0.8em;
513
- margin-right: 0.3em;
514
- margin-bottom: 0.3em;
515
- }
516
-
517
- .react-tags__selected-tag:after {
518
- content: '\2715';
519
- color: #aaa;
520
- margin-left: 8px;
521
- }
522
-
523
- .react-tags__selected-tag:hover,
524
- .react-tags__selected-tag:focus {
525
- border-color: #b1b1b1;
526
- }
527
-
528
- .react-tags__search {
529
- display: inline-block;
530
-
531
- /* prevent autoresize overflowing the container */
532
- max-width: 100%;
533
- }
534
-
535
- @media screen and (min-width: 30em) {
536
- .react-tags__search {
537
- /* this will become the offsetParent for suggestions */
538
- position: relative;
539
- }
540
- }
541
-
542
- .react-tags__search input {
543
- /* prevent autoresize overflowing the container */
544
- max-width: 100%;
545
-
546
- /* emove styles and layout from this element */
547
- margin: 0;
548
- outline: none;
549
- padding: 0.5em 0.3em;
550
-
551
- /* match the font styles */
552
- font-size: inherit;
553
- line-height: inherit;
554
- }
555
-
556
- .react-tags__search input::-ms-clear {
557
- display: none;
558
- }
559
-
560
- .react-tags__suggestions {
561
- position: absolute;
562
- top: 100%;
563
- left: 0;
564
- width: 100%;
565
- }
566
-
567
- @media screen and (min-width: 30em) {
568
- .react-tags__suggestions {
569
- width: 240px;
570
- }
571
- }
572
-
573
- .react-tags__suggestions ul {
574
- margin: 4px -1px;
575
- padding: 0;
576
- list-style: none;
577
- background: white;
578
- border: 1px solid #d1d1d1;
579
- border-radius: 2px;
580
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
581
- }
582
-
583
- .react-tags__suggestions li {
584
- border-bottom: 1px solid #ddd;
585
- padding: 6px 8px;
586
- }
587
-
588
- .react-tags__suggestions li mark {
589
- text-decoration: underline;
590
- background: none;
591
- font-weight: 600;
592
- }
593
-
594
- .react-tags__suggestions li:hover {
595
- cursor: pointer;
596
- background: #eee;
597
- }
598
-
599
- .react-tags__suggestions li.is-active {
600
- background: #b7cfe0;
601
- }
602
-
603
- .react-tags__suggestions li.is-disabled {
604
- opacity: 0.5;
605
- cursor: auto;
606
- }
607
171
  }
608
172
 
609
173
  @include breakpointClass(md) {
@@ -1,4 +1,4 @@
1
- @import 'mixins';
1
+ @import '@cdc/core/styles/v2/utils/breakpoints';
2
2
  @import 'editor-panel';
3
3
  @import '@cdc/core/styles/accessibility';
4
4
 
package/src/scss/map.scss CHANGED
@@ -33,25 +33,28 @@ $medium: 768px;
33
33
  &:focus {
34
34
  outline: 0;
35
35
  }
36
+
37
+ // Multi-country map states - use higher specificity
38
+ &.hidden {
39
+ display: none !important;
40
+ }
41
+
42
+ &.grayed-out {
43
+ opacity: 0.3;
44
+ fill: #d3d3d3 !important;
45
+ }
36
46
  }
37
47
 
38
48
  .territories-label {
39
- font-size: 0.8rem;
40
49
  font-weight: 700;
41
50
  }
42
51
 
43
- @include breakpointClass(sm) {
44
- .territories-label {
45
- font-size: 1rem;
46
- }
47
- }
48
-
49
52
  // Cities and Territories
50
53
  .territories {
51
54
  gap: 0.5em;
52
55
  svg {
53
- max-width: 30px;
54
- min-width: 30px;
56
+ max-width: var(--territory-svg-max-width, 30px);
57
+ min-width: var(--territory-svg-min-width, 30px);
55
58
  transition: 0.3s all;
56
59
 
57
60
  text {
@@ -73,11 +76,6 @@ $medium: 768px;
73
76
  width: 2.5em;
74
77
  }
75
78
  }
76
- .territories {
77
- svg {
78
- max-width: 45px;
79
- }
80
- }
81
79
  }
82
80
 
83
81
  .state {
@@ -98,7 +96,6 @@ $medium: 768px;
98
96
  display: none;
99
97
  }
100
98
 
101
-
102
99
  .county-borders {
103
100
  fill: none;
104
101
  stroke-width: 1px;
@@ -1,9 +1,9 @@
1
- import { MapConfig, Coordinate } from '../types/MapConfig'
2
- import { GeneratedLegend } from '../hooks/useGenerateRuntimeLegend'
3
- import { VizFilter } from '@cdc/core/types/VizFilter'
1
+ import { type MapConfig, type Coordinate } from '../types/MapConfig'
2
+ import { type RuntimeLegend } from '../types/runtimeLegend'
3
+ import { type VizFilter } from '@cdc/core/types/VizFilter'
4
4
  import { type Action } from '@cdc/core/types/Action'
5
- import { RuntimeData } from '../types/RuntimeData'
6
- import { Modal } from '../types/Modal'
5
+ import { type RuntimeData } from '../types/RuntimeData'
6
+ import { type Modal } from '../types/Modal'
7
7
 
8
8
  // Action Types
9
9
  type SET_ACCESSIBLE_STATUS = Action<'SET_ACCESSIBLE_STATUS', string>
@@ -18,13 +18,13 @@ type SET_POSITION = Action<'SET_POSITION', { coordinates: Coordinate; zoom: numb
18
18
  type SET_REQUIRED_COLUMNS = Action<'SET_REQUIRED_COLUMNS', string[]>
19
19
  type SET_RUNTIME_DATA = Action<'SET_RUNTIME_DATA', RuntimeData>
20
20
  type SET_RUNTIME_FILTERS = Action<'SET_RUNTIME_FILTERS', VizFilter[]>
21
- type SET_RUNTIME_LEGEND = Action<'SET_RUNTIME_LEGEND', GeneratedLegend | []>
21
+ type SET_RUNTIME_LEGEND = Action<'SET_RUNTIME_LEGEND', RuntimeLegend | []>
22
22
  type SET_SCALE = Action<'SET_SCALE', number>
23
23
  type SET_STATES_TO_SHOW = Action<'SET_STATES_TO_SHOW', string[]>
24
24
  type SET_TOPO_DATA = Action<'SET_TOPO_DATA', any>
25
25
  type SET_TRANSLATE = Action<'SET_TRANSLATE', [number, number]>
26
26
 
27
- export type MapActions =
27
+ type MapActions =
28
28
  | SET_ACCESSIBLE_STATUS
29
29
  | SET_CONFIG
30
30
  | SET_COVE_LOADED_HAS_RAN
@@ -3,12 +3,13 @@ import { type Visualization } from '@cdc/core/types/Visualization'
3
3
  import { type EditorColumnProperties } from '@cdc/core/types/EditorColumnProperties'
4
4
  import { type Version } from '@cdc/core/types/Version'
5
5
  import { type VizFilter } from '@cdc/core/types/VizFilter'
6
+ import { type Annotation } from '@cdc/core/types/Annotation'
6
7
  import { MarkupConfig } from '@cdc/core/types/MarkupVariable'
7
8
 
8
9
  // Runtime data types
9
10
  export type RuntimeFilters = VizFilter[] & { fromHash?: number }
10
11
 
11
- export type MapVisualSettings = {
12
+ type MapVisualSettings = {
12
13
  /** minBubbleSize - Minimum Circle Size when the map has a type of bubble */
13
14
  minBubbleSize: number
14
15
  /** maxBubbleSize - Maximum Circle Size when the map has a type of bubble */
@@ -43,20 +44,20 @@ export type PatternSelection = {
43
44
  }
44
45
 
45
46
  // Base column properties with name required, all others optional
46
- export type BaseColumnProperties = Pick<EditorColumnProperties, 'name'> &
47
+ type BaseColumnProperties = Pick<EditorColumnProperties, 'name'> &
47
48
  Partial<Pick<EditorColumnProperties, 'label' | 'tooltip' | 'dataTable' | 'prefix' | 'suffix'>>
48
49
 
49
50
  // Simple column type for name-only columns
50
- export type SimpleColumnProperties = Pick<EditorColumnProperties, 'name'>
51
+ type SimpleColumnProperties = Pick<EditorColumnProperties, 'name'>
51
52
 
52
53
  // Specific column types for better semantics
53
- export type GeoColumnProperties = BaseColumnProperties
54
- export type LatitudeColumnProperties = SimpleColumnProperties
55
- export type LongitudeColumnProperties = SimpleColumnProperties
56
- export type NavigateColumnProperties = SimpleColumnProperties
57
- export type PrimaryColumnProperties = BaseColumnProperties
54
+ type GeoColumnProperties = BaseColumnProperties
55
+ type LatitudeColumnProperties = SimpleColumnProperties
56
+ type LongitudeColumnProperties = SimpleColumnProperties
57
+ type NavigateColumnProperties = SimpleColumnProperties
58
+ type PrimaryColumnProperties = BaseColumnProperties
58
59
 
59
- export type LegendShapeItem = {
60
+ type LegendShapeItem = {
60
61
  column: string
61
62
  key: string
62
63
  operator: '=' | '≠' | '<' | '>' | '<=' | '>='
@@ -64,13 +65,13 @@ export type LegendShapeItem = {
64
65
  value: string
65
66
  }
66
67
 
67
- export type LegendGrouping = {
68
+ type LegendGrouping = {
68
69
  legendTitle: string
69
70
  legendDescription: string
70
71
  items: LegendShapeItem[]
71
72
  }
72
73
 
73
- export type HexMapSettings = {
74
+ type HexMapSettings = {
74
75
  type: 'shapes' | 'standard'
75
76
  shapeGroups: LegendGrouping[]
76
77
  }
@@ -82,6 +83,17 @@ export type DataRow = {
82
83
  [key: string]: string | number | boolean | null | undefined // allowing primitive data types for dynamic columns
83
84
  }
84
85
 
86
+ export type SmallMultiples = {
87
+ mode?: 'by-column'
88
+ tileColumn?: string
89
+ tilesPerRowDesktop?: number
90
+ tilesPerRowMobile?: number
91
+ tileOrderType?: 'asc' | 'desc' | 'custom'
92
+ tileOrder?: string[]
93
+ tileTitles?: { [key: string]: string }
94
+ synchronizedTooltips?: boolean
95
+ }
96
+
85
97
  export type MapConfig = Visualization & {
86
98
  annotations: Annotation[]
87
99
  // map color palette
@@ -132,6 +144,7 @@ export type MapConfig = Visualization & {
132
144
  name: string
133
145
  version: string
134
146
  customColors?: string[]
147
+ customColorsOrdered?: string[]
135
148
  }
136
149
  showDownloadMediaButton: boolean
137
150
  showDownloadImgButton: boolean
@@ -142,6 +155,11 @@ export type MapConfig = Visualization & {
142
155
  fipsCode: string
143
156
  stateName: string
144
157
  }[]
158
+ countriesPicked?: {
159
+ iso: string
160
+ name: string
161
+ }[]
162
+ hideUnselectedCountries?: boolean // When true, hide unselected countries; when false (default), gray them out
145
163
  territoriesAlwaysShow: boolean
146
164
  territoriesLabel: string
147
165
  title: string
@@ -201,6 +219,7 @@ export type MapConfig = Visualization & {
201
219
  filterBehavior: string
202
220
  filterIntro: string
203
221
  visual: MapVisualSettings
222
+ smallMultiples?: SmallMultiples
204
223
  // visualization type
205
224
  type: 'map'
206
225
  // version of the map
@@ -2,9 +2,12 @@ import { DataRow, type MapConfig } from './MapConfig'
2
2
  import { type ViewPort } from '@cdc/core/types/ViewPort'
3
3
  import { DimensionsType } from '@cdc/core/types/Dimensions'
4
4
  import { VizFilter } from '@cdc/core/types/VizFilter'
5
+ import { MapRefInterface } from '../hooks/useProgrammaticMapTooltip'
6
+ import { MutableRefObject } from 'react'
5
7
 
6
8
  export type MapContext = {
7
9
  currentViewport: ViewPort
10
+ vizViewport?: ViewPort
8
11
  content: { geoName: string; keyedData: Record<string, any> }
9
12
  dimensions: DimensionsType
10
13
  displayDataAsText: string | number
@@ -23,6 +26,7 @@ export type MapContext = {
23
26
  isDashboard: boolean
24
27
  isEditor: boolean
25
28
  isFilterValueSupported: boolean
29
+ useDynamicViewbox?: boolean
26
30
  loadConfig: (configObj: MapConfig) => void
27
31
  logo: string
28
32
  mapId: string
@@ -43,4 +47,6 @@ export type MapContext = {
43
47
  runtimeData: Object[]
44
48
  tooltipId: string
45
49
  interactionLabel?: string
50
+ handleSmallMultipleHover?: (geoId: string | null, yCoordinate?: number) => void
51
+ mapRefForSync?: MutableRefObject<MapRefInterface | null>
46
52
  }
@@ -1,4 +1,4 @@
1
- export type RuntimeLegendItem = {
1
+ type RuntimeLegendItem = {
2
2
  disabled?: boolean
3
3
  bin?: number
4
4
  color?: string