@cdc/map 4.24.9 → 4.24.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 (34) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cdcmap.js +26371 -25867
  3. package/examples/private/DEV-9644.json +184 -0
  4. package/package.json +3 -3
  5. package/src/CdcMap.tsx +25 -12
  6. package/src/_stories/CdcMap.stories.tsx +2 -6
  7. package/src/_stories/CdcMapLegend.stories.tsx +86 -0
  8. package/src/_stories/_mock/usa-state-gradient.json +238 -0
  9. package/src/_stories/_mock/wastewater-map.json +208 -0
  10. package/src/components/Annotation/AnnotationDropdown.styles.css +0 -1
  11. package/src/components/CityList.tsx +55 -10
  12. package/src/components/DataTable.tsx +94 -17
  13. package/src/components/EditorPanel/components/EditorPanel.tsx +118 -64
  14. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +27 -23
  15. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +75 -16
  16. package/src/components/Legend/components/Legend.tsx +23 -19
  17. package/src/components/Legend/components/index.scss +23 -10
  18. package/src/components/UsaMap/components/HexIcon.tsx +7 -1
  19. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +56 -11
  20. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +88 -15
  21. package/src/components/UsaMap/components/Territory/TerritoryShape.ts +13 -0
  22. package/src/components/UsaMap/components/UsaMap.County.tsx +49 -48
  23. package/src/components/UsaMap/components/UsaMap.State.tsx +5 -4
  24. package/src/components/UsaMap/helpers/shapes.ts +207 -0
  25. package/src/coreStyles_map.scss +3 -0
  26. package/src/data/initial-state.js +1 -0
  27. package/src/index.jsx +7 -1
  28. package/src/scss/editor-panel.scss +5 -13
  29. package/src/scss/filters.scss +2 -7
  30. package/src/scss/main.scss +4 -9
  31. package/src/scss/map.scss +6 -6
  32. package/src/scss/mixins.scss +47 -0
  33. package/src/types/MapConfig.ts +6 -3
  34. package/src/types/MapContext.ts +0 -1
@@ -11,7 +11,16 @@ import ErrorBoundary from '@cdc/core/components/ErrorBoundary'
11
11
 
12
12
  import useMapLayers from '../../../hooks/useMapLayers'
13
13
  import ConfigContext from '../../../context'
14
- import Annotation from '../../Annotation'
14
+ import {
15
+ drawCircle,
16
+ drawDiamond,
17
+ drawSquare,
18
+ drawTriangle,
19
+ drawPin,
20
+ drawStar,
21
+ drawShape,
22
+ createShapeProperties
23
+ } from '../helpers/shapes'
15
24
 
16
25
  const getCountyTopoURL = year => {
17
26
  return `https://www.cdc.gov/TemplatePackage/contrib/data/county-topography/cb_${year}_us_county_20m.json`
@@ -265,7 +274,6 @@ const CountyMap = props => {
265
274
  // Redraw with focus on state
266
275
  setFocus({ id: clickedState.id, index: focusIndex, center: geoCentroid(clickedState), feature: clickedState })
267
276
  }
268
-
269
277
  if (state.general.type === 'us-geocode') {
270
278
  const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
271
279
  let clickedGeo
@@ -304,7 +312,7 @@ const CountyMap = props => {
304
312
  let pointCoordinates = topoData.projection.invert([x, y])
305
313
 
306
314
  const currentTooltipIndex = parseInt(tooltipRef.current.getAttribute('data-index'))
307
- const geoRadius = (state.visual.geoCodeCircleSize || 5) * 1
315
+ const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
308
316
 
309
317
  const context = canvas.getContext('2d')
310
318
  const path = geoPath(topoData.projection, context)
@@ -397,8 +405,9 @@ const CountyMap = props => {
397
405
  data[runtimeKeys[i]][state.columns.longitude.name],
398
406
  data[runtimeKeys[i]][state.columns.latitude.name]
399
407
  ])
408
+ let includedShapes = ['circle', 'diamond', 'star', 'triangle', 'square'].includes(state.visual.cityStyle)
400
409
  if (
401
- state.visual.cityStyle === 'circle' &&
410
+ includedShapes &&
402
411
  pixelCoords &&
403
412
  Math.sqrt(Math.pow(pixelCoords[0] - x, 2) + Math.pow(pixelCoords[1] - y, 2)) < geoRadius &&
404
413
  applyLegendToRow(data[runtimeKeys[i]])
@@ -530,59 +539,50 @@ const CountyMap = props => {
530
539
  })
531
540
  }
532
541
 
533
- const drawPin = (pin, ctx) => {
534
- ctx.save()
535
- ctx.translate(pin.x, pin.y)
536
- ctx.beginPath()
537
- ctx.moveTo(0, 0)
538
- ctx.bezierCurveTo(2, -10, -20, -25, 0, -30)
539
- ctx.bezierCurveTo(20, -25, -2, -10, 0, 0)
540
- ctx.fillStyle = pin.color
541
- ctx.fill()
542
- ctx.strokeStyle = 'black'
543
- ctx.lineWidth = 1.5
544
- ctx.stroke()
545
- ctx.beginPath()
546
- ctx.arc(0, -21, 3, 0, Math.PI * 2)
547
- ctx.closePath()
548
- ctx.fill()
549
- ctx.restore()
550
- }
551
-
552
- const drawCircle = (circle, context) => {
553
- const adjustedGeoRadius = Number(circle.geoRadius)
554
- context.lineWidth = lineWidth
555
- context.fillStyle = circle.color
556
- context.beginPath()
557
- context.arc(circle.x, circle.y, adjustedGeoRadius, 0, 2 * Math.PI)
558
- context.fill()
559
- context.stroke()
560
- }
561
-
562
542
  if (state.general.type === 'us-geocode') {
563
543
  context.strokeStyle = 'black'
564
- const geoRadius = state.visual.geoCodeCircleSize || 5
544
+ const geoRadius = (state.visual.geoCodeCircleSize || 5) * (focus.id ? 2 : 1)
545
+ const { additionalCityStyles } = state.visual || []
546
+ const cityStyles = Object.values(data)
547
+ .filter(d => additionalCityStyles.some(style => String(d[style.column]) === String(style.value)))
548
+ .map(d => {
549
+ const conditionsMatched = additionalCityStyles.find(
550
+ style => String(d[style.column]) === String(style.value)
551
+ )
552
+ return { ...conditionsMatched, ...d }
553
+ })
554
+
555
+ let cityPixelCoords = []
556
+ cityStyles.forEach(city => {
557
+ cityPixelCoords = topoData.projection([city[state.columns.longitude.name], city[state.columns.latitude.name]])
558
+
559
+ if (cityPixelCoords) {
560
+ const legendValues = applyLegendToRow(data[city?.value])
561
+ if (legendValues) {
562
+ const shapeType = city?.shape?.toLowerCase()
563
+ const shapeProperties = createShapeProperties(shapeType, cityPixelCoords, legendValues, state, geoRadius)
564
+ if (shapeProperties) {
565
+ drawShape(shapeProperties, context, state, lineWidth)
566
+ }
567
+ }
568
+ }
569
+ })
565
570
 
566
571
  runtimeKeys.forEach(key => {
572
+ const citiesList = new Set(cityStyles.map(item => item.value))
573
+
567
574
  const pixelCoords = topoData.projection([
568
575
  data[key][state.columns.longitude.name],
569
576
  data[key][state.columns.latitude.name]
570
577
  ])
571
-
572
- if (pixelCoords) {
578
+ if (pixelCoords && !citiesList.has(key)) {
573
579
  const legendValues = data[key] !== undefined ? applyLegendToRow(data[key]) : false
574
- if (legendValues && state.visual.cityStyle === 'circle') {
575
- const circle = {
576
- x: pixelCoords[0],
577
- y: pixelCoords[1],
578
- color: legendValues[0],
579
- geoRadius: geoRadius
580
+ if (legendValues) {
581
+ const shapeType = state.visual.cityStyle.toLowerCase()
582
+ const shapeProperties = createShapeProperties(shapeType, pixelCoords, legendValues, state, geoRadius)
583
+ if (shapeProperties) {
584
+ drawShape(shapeProperties, context, state, lineWidth)
580
585
  }
581
- drawCircle(circle, context)
582
- }
583
- if (legendValues && state.visual.cityStyle === 'pin') {
584
- const pin = { x: pixelCoords[0], y: pixelCoords[1], color: legendValues[0] }
585
- drawPin(pin, context)
586
586
  }
587
587
  }
588
588
  })
@@ -603,7 +603,8 @@ const CountyMap = props => {
603
603
  onClick={canvasClick}
604
604
  className='county-map-canvas'
605
605
  ></canvas>
606
- <button className={`btn btn--reset`} onClick={onReset} ref={resetButton} tabIndex='0'>
606
+
607
+ <button className={`btn btn-primary btn--reset`} onClick={onReset} ref={resetButton} tabIndex='0'>
607
608
  Reset Zoom
608
609
  </button>
609
610
  </ErrorBoundary>
@@ -195,9 +195,9 @@ const UsaMap = () => {
195
195
  text={styles.color}
196
196
  strokeWidth={1.5}
197
197
  textColor={textColor}
198
- onClick={() => geoClickHandler(territory, territoryData)}
199
- data-tooltip-id={`tooltip__${tooltipId}`}
200
- data-tooltip-html={toolTip}
198
+ handleShapeClick={() => geoClickHandler(territory, territoryData)}
199
+ dataTooltipId={`tooltip__${tooltipId}`}
200
+ dataTooltipHtml={toolTip}
201
201
  territory={territory}
202
202
  territoryData={territoryData}
203
203
  tabIndex={-1}
@@ -595,7 +595,8 @@ const UsaMap = () => {
595
595
 
596
596
  {territories.length > 0 && (
597
597
  <>
598
- <div className='two-col'>
598
+ {/* Temporarily make the max width fit the image width */}
599
+ <div className='two-col' style={{ maxWidth: 'calc(100% - 75px)' }}>
599
600
  <div>
600
601
  <span className='territories-label label'>{state.general.territoriesLabel}</span>
601
602
  </div>
@@ -0,0 +1,207 @@
1
+ export const drawCircle = (circle, context, state) => {
2
+ const percentOfOriginalSize = 0.75
3
+ const adjustedGeoRadius =
4
+ state.mapPosition.zoom > 1 ? Number(circle.geoRadius) * percentOfOriginalSize : circle.geoRadius
5
+ context.lineWidth = 1
6
+ context.fillStyle = circle.color
7
+ context.beginPath()
8
+ context.arc(circle.x, circle.y, adjustedGeoRadius, 0, 2 * Math.PI)
9
+ context.fill()
10
+ context.stroke()
11
+ }
12
+ export const drawSquare = (square, context, state) => {
13
+ const percentOfOriginalSize = 0.75
14
+ const sideLength = square.size
15
+
16
+ const adjustedSize = state.mapPosition.zoom > 1 ? sideLength * percentOfOriginalSize : sideLength
17
+
18
+ context.lineWidth = square.lineWidth
19
+ context.fillStyle = square.color
20
+ context.beginPath()
21
+
22
+ const halfSize = adjustedSize / 2
23
+ const topLeftX = square.x - halfSize
24
+ const topLeftY = square.y - halfSize
25
+
26
+ context.rect(topLeftX, topLeftY, adjustedSize, adjustedSize)
27
+ context.fill()
28
+ context.stroke()
29
+ }
30
+
31
+ export const drawDiamond = (diamond, context, state) => {
32
+ const percentOfOriginalSize = 0.75
33
+ const fullSize = diamond.size
34
+
35
+ const adjustedSize = state.mapPosition.zoom > 1 ? fullSize * percentOfOriginalSize : fullSize
36
+
37
+ context.lineWidth = diamond.lineWidth
38
+ context.fillStyle = diamond.color
39
+ context.beginPath()
40
+
41
+ // Calculate the vertices of the diamond
42
+
43
+ const Ax = diamond.x
44
+ const Ay = diamond.y - adjustedSize / 2
45
+
46
+ // Vertex B (right vertex)
47
+ const Bx = diamond.x + adjustedSize / 2
48
+ const By = diamond.y
49
+
50
+ // Vertex C (bottom vertex)
51
+ const Cx = diamond.x
52
+ const Cy = diamond.y + adjustedSize / 2
53
+
54
+ // Vertex D (left vertex)
55
+ const Dx = diamond.x - adjustedSize / 2
56
+ const Dy = diamond.y
57
+
58
+ // Draw the diamond
59
+ context.moveTo(Ax, Ay)
60
+ context.lineTo(Bx, By)
61
+ context.lineTo(Cx, Cy)
62
+ context.lineTo(Dx, Dy)
63
+ context.closePath()
64
+ context.fill()
65
+ context.stroke()
66
+ }
67
+ export const drawTriangle = (triangle, context, state) => {
68
+ const percentOfOriginalSize = 0.75
69
+ const baseLength = triangle.size
70
+
71
+ // Adjust the size
72
+ const adjustedSize = state.mapPosition.zoom > 1 ? baseLength * percentOfOriginalSize : baseLength
73
+
74
+ // Calculate height
75
+ const height = (adjustedSize * Math.sqrt(3)) / 2
76
+
77
+ context.lineWidth = triangle.lineWidth
78
+ context.fillStyle = triangle.color
79
+ context.beginPath()
80
+
81
+ // Calculatef the triangle
82
+ const Ax = triangle.x
83
+ const Ay = triangle.y - height / 2
84
+
85
+ const Bx = triangle.x - adjustedSize / 2
86
+ const By = triangle.y + height / 2
87
+
88
+ const Cx = triangle.x + adjustedSize / 2
89
+ const Cy = By
90
+
91
+ // Draw the triangle
92
+ context.moveTo(Ax, Ay)
93
+ context.lineTo(Bx, By)
94
+ context.lineTo(Cx, Cy)
95
+ context.closePath()
96
+ context.fill()
97
+ context.stroke()
98
+ }
99
+ export const drawStar = (star, context, state) => {
100
+ const percentOfOriginalSize = 0.75
101
+ const spikes = star.spikes
102
+ const outerRadius = star.outerRadius
103
+ const innerRadius = star.innerRadius
104
+
105
+ const adjustedOuterRadius = state.mapPosition.zoom > 1 ? outerRadius * percentOfOriginalSize : outerRadius
106
+ const adjustedInnerRadius = state.mapPosition.zoom > 1 ? innerRadius * percentOfOriginalSize : innerRadius
107
+
108
+ context.lineWidth = star.lineWidth
109
+ context.fillStyle = star.color
110
+ context.beginPath()
111
+
112
+ let rot = (Math.PI / 2) * 3
113
+ let step = Math.PI / spikes
114
+
115
+ // Starting coordinates for the first point
116
+ let x = star.x
117
+ let y = star.y
118
+ context.moveTo(x, y - adjustedOuterRadius)
119
+
120
+ for (let i = 0; i < spikes; i++) {
121
+ x = star.x + Math.cos(rot) * adjustedOuterRadius
122
+ y = star.y + Math.sin(rot) * adjustedOuterRadius
123
+ context.lineTo(x, y)
124
+ rot += step
125
+
126
+ x = star.x + Math.cos(rot) * adjustedInnerRadius
127
+ y = star.y + Math.sin(rot) * adjustedInnerRadius
128
+ context.lineTo(x, y)
129
+ rot += step
130
+ }
131
+
132
+ context.lineTo(star.x, star.y - adjustedOuterRadius)
133
+ context.closePath()
134
+ context.fill()
135
+ context.stroke()
136
+ }
137
+
138
+ export const drawPin = (pin, ctx) => {
139
+ ctx.save()
140
+ ctx.translate(pin.x, pin.y)
141
+ ctx.beginPath()
142
+ ctx.moveTo(0, 0)
143
+ ctx.bezierCurveTo(2, -10, -20, -25, 0, -30)
144
+ ctx.bezierCurveTo(20, -25, -2, -10, 0, 0)
145
+ ctx.fillStyle = pin.color
146
+ ctx.fill()
147
+ ctx.strokeStyle = 'black'
148
+ ctx.lineWidth = 1
149
+ ctx.stroke()
150
+ ctx.beginPath()
151
+ ctx.arc(0, -21, 3, 0, Math.PI * 2)
152
+ ctx.closePath()
153
+ ctx.fill()
154
+ ctx.restore()
155
+ }
156
+
157
+ export const drawShape = (shape, context, state, additionalParams) => {
158
+ const shapeMap = {
159
+ circle: drawCircle,
160
+ square: drawSquare,
161
+ diamond: drawDiamond,
162
+ triangle: drawTriangle,
163
+ star: drawStar,
164
+ pin: drawPin
165
+ }
166
+
167
+ const drawFunction = shapeMap[shape.type]
168
+
169
+ if (drawFunction) {
170
+ drawFunction(shape, context, state, additionalParams)
171
+ } else {
172
+ console.error('Shape type not recognized or draw function not available:', shape.type)
173
+ }
174
+ }
175
+
176
+ export const createShapeProperties = (type, pixelCoords, legendValues, state, geoRadius) => {
177
+ const baseProps = {
178
+ x: pixelCoords[0],
179
+ y: pixelCoords[1],
180
+ color: legendValues[0],
181
+ size: geoRadius,
182
+ lineWidth: 1
183
+ }
184
+
185
+ switch (type) {
186
+ case 'circle':
187
+ return { ...baseProps, geoRadius: geoRadius, type: 'circle' }
188
+ case 'pin':
189
+ return { ...baseProps, type: 'pin' }
190
+ case 'square':
191
+ return { ...baseProps, type: 'square' }
192
+ case 'triangle':
193
+ return { ...baseProps, type: 'triangle' }
194
+ case 'diamond':
195
+ return { ...baseProps, type: 'diamond' }
196
+ case 'star':
197
+ return {
198
+ ...baseProps,
199
+ spikes: 5,
200
+ outerRadius: state.visual.geoCodeCircleSize / 3,
201
+ innerRadius: (state.visual.geoCodeCircleSize / 3) * 2,
202
+ type: 'star'
203
+ }
204
+ default:
205
+ return null
206
+ }
207
+ }
@@ -0,0 +1,3 @@
1
+ @import '@cdc/core/styles/base';
2
+ @import '@cdc/core/styles/heading-colors';
3
+ @import '@cdc/core/styles/v2/components/ui/tooltip';
@@ -85,6 +85,7 @@ export default {
85
85
  caption: '',
86
86
  showDownloadUrl: false,
87
87
  showDataTableLink: true,
88
+ showDownloadLinkBelow: true,
88
89
  showFullGeoNameInCSV: false,
89
90
  forceDisplay: true,
90
91
  download: false,
package/src/index.jsx CHANGED
@@ -4,6 +4,7 @@ import ReactDOM from 'react-dom/client'
4
4
  import CdcMap from './CdcMap'
5
5
 
6
6
  import 'react-tooltip/dist/react-tooltip.css'
7
+ import './coreStyles_map.scss'
7
8
 
8
9
  let isEditor = window.location.href.includes('editor=true')
9
10
  let isDebug = window.location.href.includes('debug=true')
@@ -11,6 +12,11 @@ let domContainer = document.getElementsByClassName('react-container')[0]
11
12
 
12
13
  ReactDOM.createRoot(domContainer).render(
13
14
  <React.StrictMode>
14
- <CdcMap isEditor={isEditor} isDebug={isDebug} configUrl={domContainer.attributes['data-config'].value} containerEl={domContainer} />
15
+ <CdcMap
16
+ isEditor={isEditor}
17
+ isDebug={isDebug}
18
+ configUrl={domContainer.attributes['data-config'].value}
19
+ containerEl={domContainer}
20
+ />
15
21
  </React.StrictMode>
16
22
  )
@@ -18,7 +18,7 @@
18
18
  .geo-buttons {
19
19
  list-style: none;
20
20
  display: flex;
21
- color: $mediumGray;
21
+ color: var(--mediumGray);
22
22
  svg {
23
23
  display: block;
24
24
  max-width: 80px;
@@ -33,7 +33,7 @@
33
33
  background: transparent;
34
34
  padding: 0.3em 0.75em;
35
35
  display: flex;
36
- border: $lightGray 1px solid;
36
+ border: var(--lightGray) 1px solid;
37
37
  width: 40%;
38
38
  align-items: center;
39
39
  margin-right: 1em;
@@ -110,11 +110,6 @@
110
110
  }
111
111
 
112
112
  .editor-panel {
113
- //TODO: Remove after COVE refactor
114
- &.cove {
115
- @import '@cdc/core/styles/v2/layout/tooltip.scss';
116
- }
117
-
118
113
  .cove-input-group,
119
114
  .cove-accordion__small-inputs {
120
115
  position: relative;
@@ -191,10 +186,10 @@
191
186
  }
192
187
 
193
188
  .accordion__heading {
194
- background: $lightestGray;
189
+ background: var(--lightestGray);
195
190
  }
196
191
  .form-container {
197
- border-right: $lightGray 1px solid;
192
+ border-right: var(--lightGray) 1px solid;
198
193
  flex-grow: 1;
199
194
  }
200
195
  .guidance-link {
@@ -207,7 +202,7 @@
207
202
  }
208
203
  svg {
209
204
  width: 60px;
210
- color: $blue;
205
+ color: var(--blue);
211
206
  margin-right: 1rem;
212
207
  height: 60px; // IE11
213
208
  path {
@@ -551,9 +546,6 @@
551
546
  font-weight: normal;
552
547
  }
553
548
 
554
- .btn {
555
- margin-top: 1em;
556
- }
557
549
  .sort-list {
558
550
  list-style: none;
559
551
  > li {
@@ -1,7 +1,5 @@
1
1
  .cdc-open-viz-module .cdc-map-inner-container .filters-section,
2
2
  .cove .cdc-map-inner-container .filters-section {
3
- margin-left: 1rem;
4
- margin-right: 1rem;
5
3
 
6
4
  &__title {
7
5
  margin: 15px 0;
@@ -23,17 +21,14 @@
23
21
  @include breakpoint(md) {
24
22
  display: flex;
25
23
  gap: 30px;
24
+ flex-wrap: wrap;
26
25
  }
27
26
 
27
+
28
28
  label:not(:empty) {
29
29
  margin-right: 0.4em;
30
30
  }
31
31
 
32
- select {
33
- font-size: 1em;
34
- padding-right: 5px;
35
- }
36
-
37
32
  .single-filter {
38
33
  margin-bottom: 0.5em;
39
34
  }
@@ -1,9 +1,8 @@
1
- @import '@cdc/core/styles/base';
2
- @import '@cdc/core/styles/heading-colors';
1
+ @import 'mixins';
2
+
3
3
  @import 'variables';
4
4
  @import 'editor-panel';
5
5
  @import 'filters';
6
- @import '@cdc/core/styles/v2/components/ui/tooltip';
7
6
 
8
7
  .type-map--has-error {
9
8
  overflow: hidden !important;
@@ -39,7 +38,7 @@
39
38
 
40
39
  @include breakpointClass(md) {
41
40
  .map-container.modal-background::before {
42
- border-bottom: $lightGray 1px solid;
41
+ border-bottom: var(--lightGray) 1px solid;
43
42
  margin-bottom: -1px;
44
43
  bottom: 1px;
45
44
  }
@@ -56,10 +55,6 @@
56
55
  text-align: left;
57
56
  max-width: 100%;
58
57
  background-color: white;
59
- .btn {
60
- padding: 0.375em 0.75em;
61
- border-radius: 0.3em;
62
- }
63
58
 
64
59
  header.hidden {
65
60
  display: none;
@@ -194,7 +189,7 @@
194
189
  padding: 1em;
195
190
  z-index: 6;
196
191
  width: 100%;
197
- border-top: $lightGray 1px solid;
192
+ border-top: var(--lightGray) 1px solid;
198
193
  label {
199
194
  flex-grow: 1;
200
195
  > div.select-heading {
package/src/scss/map.scss CHANGED
@@ -31,7 +31,7 @@ header + .map-container.full-border {
31
31
  // World Specific Styles
32
32
  .map-container.world {
33
33
  &.data .geography-container {
34
- border-bottom: $lightGray 1px solid;
34
+ border-bottom: var(--lightGray) 1px solid;
35
35
  }
36
36
  .geography-container {
37
37
  cursor: move;
@@ -129,6 +129,7 @@ $medium: 768px;
129
129
  }
130
130
 
131
131
  .territories-label {
132
+ color: black;
132
133
  margin: 2em 5px 2em 1em;
133
134
  font-size: 1.1em;
134
135
  display: block;
@@ -158,13 +159,16 @@ $medium: 768px;
158
159
  &--mobile {
159
160
  @extend .territories;
160
161
  width: 60%;
162
+ svg {
163
+ margin-bottom: 0.5em;
164
+ }
161
165
  }
162
166
 
163
167
  &--tablet {
164
168
  @extend .territories;
165
169
  width: 70%;
166
170
  svg {
167
- margin-bottom: 0.2em;
171
+ margin-bottom: 0.5em;
168
172
  }
169
173
  }
170
174
  }
@@ -262,10 +266,6 @@ $medium: 768px;
262
266
  transition: none !important;
263
267
  }
264
268
 
265
- // .state {
266
- // display: none;
267
- // }
268
-
269
269
  .state {
270
270
  &--inactive:hover path {
271
271
  cursor: pointer;
@@ -0,0 +1,47 @@
1
+ @mixin breakpoint($class) {
2
+ @if $class == xs {
3
+ @media (max-width: 767px) {
4
+ @content;
5
+ }
6
+ } @else if $class == sm {
7
+ @media (min-width: 768px) {
8
+ @content;
9
+ }
10
+ } @else if $class == md {
11
+ @media (min-width: 960px) {
12
+ @content;
13
+ }
14
+ } @else if $class == lg {
15
+ @media (min-width: 1300px) {
16
+ @content;
17
+ }
18
+ } @else {
19
+ @warn "Breakpoint mixin supports: xs, sm, md, lg";
20
+ }
21
+ }
22
+
23
+ @mixin breakpointClass($class) {
24
+ @if $class == xs {
25
+ &.xs,
26
+ &.xxs {
27
+ @content;
28
+ }
29
+ } @else if $class == sm {
30
+ &.sm,
31
+ &.md,
32
+ &.lg {
33
+ @content;
34
+ }
35
+ } @else if $class == md {
36
+ &.md,
37
+ &.lg {
38
+ @content;
39
+ }
40
+ } @else if $class == lg {
41
+ &.lg {
42
+ @content;
43
+ }
44
+ } @else {
45
+ @warn "Breakpoint Class mixin supports: xs, sm, md, lg";
46
+ }
47
+ }
@@ -10,7 +10,7 @@ export type MapVisualSettings = {
10
10
  /** extraBubbleBorder - Bubble Maps > adds a white circle around the bubble to show contrast on other bubbles */
11
11
  extraBubbleBorder: boolean
12
12
  /** cityStyle - visual indicator of cities on state maps */
13
- cityStyle: 'circle' | 'pin'
13
+ cityStyle: 'circle' | 'pin' | 'star' | 'diamond' | 'triangle' | 'square'
14
14
  /** cityStyle - optional visual indicator of label on the Legend */
15
15
  cityStyleLabel: string
16
16
  /** geoCodeCircleSize - controls the size of the city style option (circle or pin) */
@@ -40,12 +40,15 @@ export type GeoColumnProperties = Pick<EditorColumnProperties, 'name' | 'label'
40
40
  export type LatitudeColumnProperties = Pick<EditorColumnProperties, 'name'>
41
41
  export type LongitudeColumnProperties = Pick<EditorColumnProperties, 'name'>
42
42
  export type NavigateColumnProperties = Pick<EditorColumnProperties, 'name'>
43
- export type PrimaryColumnProperties = Pick<EditorColumnProperties, 'dataTable' | 'label' | 'name' | 'prefix' | 'suffix' | 'tooltip'>
43
+ export type PrimaryColumnProperties = Pick<
44
+ EditorColumnProperties,
45
+ 'dataTable' | 'label' | 'name' | 'prefix' | 'suffix' | 'tooltip'
46
+ >
44
47
  export type ViewportSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'
45
48
  export type LegendShapeItem = {
46
49
  column: string
47
50
  key: string
48
- operator: string
51
+ operator: '=' | '≠' | '<' | '>' | '<=' | '>='
49
52
  shape: string
50
53
  value: string
51
54
  }
@@ -55,5 +55,4 @@ export type MapContext = {
55
55
  runtimeData: Object[]
56
56
  tooltipId: string
57
57
  setTopoData: Function
58
- getTextWidth: (text: string, font: string) => string | undefined
59
58
  }