@icij/murmur-next 4.0.1 → 4.0.4

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 (62) hide show
  1. package/lib/components/AccordionStep.vue +53 -42
  2. package/lib/components/AccordionWrapper.vue +25 -24
  3. package/lib/components/ActiveTextTruncate.vue +44 -22
  4. package/lib/components/AdvancedLinkForm.vue +96 -46
  5. package/lib/components/Brand.vue +30 -23
  6. package/lib/components/BrandExpansion.vue +12 -3
  7. package/lib/components/ConfirmButton.vue +30 -26
  8. package/lib/components/ContentPlaceholder.vue +11 -7
  9. package/lib/components/CustomPagination.vue +50 -32
  10. package/lib/components/DigitsInput.vue +64 -60
  11. package/lib/components/DonateForm.vue +112 -83
  12. package/lib/components/EmbedForm.vue +37 -21
  13. package/lib/components/EmbeddableFooter.vue +14 -10
  14. package/lib/components/FollowUsPopover.vue +42 -40
  15. package/lib/components/GenericFooter.vue +98 -23
  16. package/lib/components/GenericHeader.vue +66 -29
  17. package/lib/components/HapticCopy.vue +41 -29
  18. package/lib/components/ImddbHeader.vue +113 -92
  19. package/lib/components/OrdinalLegend.vue +43 -20
  20. package/lib/components/RangePicker.vue +63 -42
  21. package/lib/components/ResponsiveIframe.vue +9 -2
  22. package/lib/components/ScaleLegend.vue +56 -18
  23. package/lib/components/SecretInput.vue +7 -8
  24. package/lib/components/SelectableDropdown.vue +120 -74
  25. package/lib/components/SharingOptions.vue +93 -36
  26. package/lib/components/SharingOptionsLink.vue +11 -5
  27. package/lib/components/SignUpForm.vue +44 -23
  28. package/lib/components/SlideUpDown.vue +7 -2
  29. package/lib/components/TexturedDeck.vue +24 -14
  30. package/lib/components/TinyPagination.vue +35 -22
  31. package/lib/composables/chart.ts +174 -157
  32. package/lib/composables/resizeObserver.ts +29 -29
  33. package/lib/composables/sendEmail.ts +53 -42
  34. package/lib/config.default.ts +17 -10
  35. package/lib/config.ts +34 -27
  36. package/lib/datavisualisations/BarChart.vue +48 -42
  37. package/lib/datavisualisations/ColumnChart.vue +133 -89
  38. package/lib/datavisualisations/LineChart.vue +79 -57
  39. package/lib/datavisualisations/StackedBarChart.vue +116 -68
  40. package/lib/datavisualisations/StackedColumnChart.vue +196 -115
  41. package/lib/enums.ts +25 -15
  42. package/lib/i18n.ts +3 -3
  43. package/lib/keys.ts +2 -2
  44. package/lib/main.ts +14 -10
  45. package/lib/maps/ChoroplethMap.vue +299 -160
  46. package/lib/maps/ChoroplethMapAnnotation.vue +29 -18
  47. package/lib/maps/SymbolMap.vue +194 -123
  48. package/lib/shims-bootstrap-vue.d.ts +1 -1
  49. package/lib/shims-vue.d.ts +3 -3
  50. package/lib/styles/functions.scss +10 -6
  51. package/lib/styles/lib.scss +2 -4
  52. package/lib/styles/mixins.scss +8 -8
  53. package/lib/styles/utilities.scss +1 -1
  54. package/lib/styles/variables.scss +24 -18
  55. package/lib/types.ts +26 -10
  56. package/lib/utils/animation.ts +4 -4
  57. package/lib/utils/assets.ts +31 -28
  58. package/lib/utils/clipboard.ts +16 -10
  59. package/lib/utils/iframe-resizer.ts +18 -13
  60. package/lib/utils/placeholder.ts +54 -23
  61. package/lib/utils/placeholderTypes.ts +3 -3
  62. package/package.json +7 -2
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
- import {values} from 'lodash'
3
- import {geoDistance, GeoProjection} from 'd3-geo'
4
- import {computed, defineComponent, inject, toRaw} from "vue";
5
- import {ParentKey} from "@/keys";
6
- import {ParentMap} from "@/types";
2
+ import { values } from 'lodash'
3
+ import { geoDistance, GeoProjection } from 'd3-geo'
4
+ import { computed, defineComponent, inject, toRaw } from 'vue'
5
+ import { ParentKey } from '@/keys'
6
+ import { ParentMap } from '@/types'
7
7
 
8
8
  export const PLACEMENTS = {
9
9
  TOP: 'top',
@@ -87,21 +87,21 @@ export default defineComponent({
87
87
  placement: {
88
88
  type: String,
89
89
  default: null,
90
- validator: (p: null | string) => p === null || values(PLACEMENTS).includes(p)
90
+ validator: (p: null | string) =>
91
+ p === null || values(PLACEMENTS).includes(p)
91
92
  }
92
93
  },
93
94
  setup(props) {
94
-
95
95
  const parent = inject<ParentMap>(ParentKey)
96
96
 
97
97
  if (!parent) {
98
- throw new Error("parent is undefined")
98
+ throw new Error('parent is undefined')
99
99
  }
100
100
 
101
101
  const mapRect = parent.mapRect
102
102
  const mapTransform1 = parent.mapTransform
103
103
  const rotatingMapProjection = parent.rotatingMapProjection
104
- const mapTransform= computed(()=>{
104
+ const mapTransform = computed(() => {
105
105
  return toRaw(parent.mapTransform)
106
106
  })
107
107
 
@@ -112,7 +112,7 @@ export default defineComponent({
112
112
  if (isBottom.value) {
113
113
  return 0
114
114
  }
115
- return 0 - (props.height) / 2
115
+ return 0 - props.height / 2
116
116
  })
117
117
  const isTop = computed(() => {
118
118
  return [
@@ -143,7 +143,7 @@ export default defineComponent({
143
143
 
144
144
  const position = computed(() => {
145
145
  const [x, y] = projection.value(center.value)
146
- return {x, y}
146
+ return { x, y }
147
147
  })
148
148
 
149
149
  const mapK = computed(() => {
@@ -157,7 +157,7 @@ export default defineComponent({
157
157
  if (isLeft.value) {
158
158
  return 0 - props.width
159
159
  }
160
- return 0 - (props.width) / 2
160
+ return 0 - props.width / 2
161
161
  })
162
162
 
163
163
  const transform = computed(() => {
@@ -241,7 +241,10 @@ export default defineComponent({
241
241
  if (!projection.value?.invert) {
242
242
  return 0
243
243
  }
244
- const mapCenter = projection.value.invert([mapRect.value.width / 2, mapRect.value.height / 2])
244
+ const mapCenter = projection.value.invert([
245
+ mapRect.value.width / 2,
246
+ mapRect.value.height / 2
247
+ ])
245
248
  return geoDistance(center.value, mapCenter)
246
249
  } catch (_) {
247
250
  return 0
@@ -251,7 +254,6 @@ export default defineComponent({
251
254
  return geoDistanceFromCenter.value <= props.geoDistanceThreshold
252
255
  })
253
256
 
254
-
255
257
  return {
256
258
  classList,
257
259
  x,
@@ -273,16 +275,25 @@ export default defineComponent({
273
275
  mapTransform
274
276
  }
275
277
  }
276
-
277
278
  })
278
279
  </script>
279
280
 
280
281
  <template>
281
282
  <g :class="classList" class="choropleth-map-annotation">
282
- <foreignObject :height="height" :transform="transform" :width="width" :x="x" :y="y">
283
- <div v-show="isVisible" :style="wrapperStyle" class="choropleth-map-annotation__wrapper">
283
+ <foreignObject
284
+ :height="height"
285
+ :transform="transform"
286
+ :width="width"
287
+ :x="x"
288
+ :y="y"
289
+ >
290
+ <div
291
+ v-show="isVisible"
292
+ :style="wrapperStyle"
293
+ class="choropleth-map-annotation__wrapper"
294
+ >
284
295
  <div class="choropleth-map-annotation__wrapper__content">
285
- <slot/>
296
+ <slot />
286
297
  </div>
287
298
  </div>
288
299
  </foreignObject>
@@ -1,15 +1,39 @@
1
1
  <script lang="ts">
2
2
  import * as d3 from 'd3'
3
- import {GeoPermissibleObjects} from 'd3'
4
- import {geoRobinson} from 'd3-geo-projection'
5
- import {feature} from 'topojson'
6
- import {debounce, find, get, groupBy, isFunction, kebabCase, keys, pickBy, set, uniq, uniqueId} from 'lodash'
3
+ import { GeoPermissibleObjects } from 'd3'
4
+ import { geoRobinson } from 'd3-geo-projection'
5
+ import { feature } from 'topojson'
6
+ import {
7
+ debounce,
8
+ find,
9
+ get,
10
+ groupBy,
11
+ isFunction,
12
+ kebabCase,
13
+ keys,
14
+ pickBy,
15
+ set,
16
+ uniq,
17
+ uniqueId
18
+ } from 'lodash'
7
19
 
8
20
  import config from '../config'
9
21
  import OrdinalLegend from '../components/OrdinalLegend.vue'
10
- import {chartEmits, chartProps, getChartProps, useChart} from "@/composables/chart.js";
11
- import {ComponentPublicInstance, computed, defineComponent, PropType, ref, watch} from "vue";
12
- import {GeometryCollection} from "topojson-specification"
22
+ import {
23
+ chartEmits,
24
+ chartProps,
25
+ getChartProps,
26
+ useChart
27
+ } from '@/composables/chart.js'
28
+ import {
29
+ ComponentPublicInstance,
30
+ computed,
31
+ defineComponent,
32
+ PropType,
33
+ ref,
34
+ watch
35
+ } from 'vue'
36
+ import { GeometryCollection } from 'topojson-specification'
13
37
 
14
38
  export default defineComponent({
15
39
  components: {
@@ -55,7 +79,7 @@ export default defineComponent({
55
79
  markerPath: {
56
80
  type: [String, Function],
57
81
  default:
58
- 'M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256z'
82
+ 'M512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256z'
59
83
  },
60
84
  markerColor: {
61
85
  type: String,
@@ -109,8 +133,8 @@ export default defineComponent({
109
133
  },
110
134
  ...chartProps()
111
135
  },
112
- emits: ["click", 'reset', 'zoomed', ...chartEmits],
113
- setup(props, {emit}) {
136
+ emits: ['click', 'reset', 'zoomed', ...chartEmits],
137
+ setup(props, { emit }) {
114
138
  const el = ref<ComponentPublicInstance<HTMLElement> | null>(null)
115
139
  const topojson = ref<any>(null)
116
140
  const topojsonPromise = ref<Promise<void> | null>(null)
@@ -124,7 +148,14 @@ export default defineComponent({
124
148
  draw()
125
149
  }, 10)
126
150
 
127
- const {loadedData} = useChart(el, getChartProps(props), {emit}, isLoaded, debouncedDraw, afterLoaded)
151
+ const { loadedData } = useChart(
152
+ el,
153
+ getChartProps(props),
154
+ { emit },
155
+ isLoaded,
156
+ debouncedDraw,
157
+ afterLoaded
158
+ )
128
159
 
129
160
  function afterLoaded() {
130
161
  return new Promise<void>(async (resolve) => {
@@ -151,7 +182,11 @@ export default defineComponent({
151
182
  return props.fitToMarkers ? markersGeojson.value : featuresGeojson.value
152
183
  })
153
184
  const featuresGeojson = computed(() => {
154
- const object = get(topojson.value, ['objects', props.topojsonObjects], null)
185
+ const object = get(
186
+ topojson.value,
187
+ ['objects', props.topojsonObjects],
188
+ null
189
+ )
155
190
  return feature(topojson.value, object as GeometryCollection)
156
191
  })
157
192
  const markersGeojson = computed(() => {
@@ -164,7 +199,7 @@ export default defineComponent({
164
199
  }
165
200
  })
166
201
  const coordinates = computed(() => {
167
- return (loadedData.value || []).map(({longitude, latitude}) => {
202
+ return (loadedData.value || []).map(({ longitude, latitude }) => {
168
203
  return [longitude, latitude]
169
204
  })
170
205
  })
@@ -180,25 +215,25 @@ export default defineComponent({
180
215
  }
181
216
  })
182
217
  const mapProjection = computed(() => {
183
- const {height, width} = mapRect.value
218
+ const { height, width } = mapRect.value
184
219
  const padding = props.mapPadding
185
220
  return geoRobinson().fitExtent(
186
- [
187
- [padding, padding],
188
- [width - padding, height - padding]
189
- ],
190
- geojson.value
221
+ [
222
+ [padding, padding],
223
+ [width - padding, height - padding]
224
+ ],
225
+ geojson.value
191
226
  )
192
227
  })
193
228
  const mapZoom = computed(() => {
194
229
  return d3
195
- .zoom()
196
- .scaleExtent([props.zoomMin, props.zoomMax])
197
- .translateExtent([
198
- [0, 0],
199
- [mapWidth.value, mapHeight.value]
200
- ])
201
- .on('zoom', mapZoomed)
230
+ .zoom()
231
+ .scaleExtent([props.zoomMin, props.zoomMax])
232
+ .translateExtent([
233
+ [0, 0],
234
+ [mapWidth.value, mapHeight.value]
235
+ ])
236
+ .on('zoom', mapZoomed)
202
237
  })
203
238
  const mapHeight = computed(() => {
204
239
  return mapRect.value.height
@@ -207,9 +242,11 @@ export default defineComponent({
207
242
  return mapRect.value.width
208
243
  })
209
244
  const map = computed(() => {
210
- const selection = d3.select(el.value).select<SVGElement>('.symbol-map__main');
245
+ const selection = d3
246
+ .select(el.value)
247
+ .select<SVGElement>('.symbol-map__main')
211
248
  if (!selection) {
212
- throw new Error("Empty SVG selection")
249
+ throw new Error('Empty SVG selection')
213
250
  }
214
251
  return selection
215
252
  })
@@ -237,29 +274,26 @@ export default defineComponent({
237
274
  return get(d, props.categoryObjectsPath)
238
275
  })
239
276
  return Object.entries(categories).map((entry) => {
240
- const [label, [{color: firstColor}]] = entry
277
+ const [label, [{ color: firstColor }]] = entry
241
278
  const color = firstColor || categoryColor(label)
242
- return {label, color}
279
+ return { label, color }
243
280
  })
244
281
  })
245
282
  const hasTooltip = computed(() => {
246
283
  return !props.hideTooltip && loadedData.value && markerCursor.value
247
284
  })
248
285
  const tooltipTarget = computed(() => {
249
- if (hasTooltip.value) {
250
- return markerId(markerCursor.value)
251
- }
252
- return null
253
- }
254
- )
255
-
286
+ if (hasTooltip.value) {
287
+ return markerId(markerCursor.value)
288
+ }
289
+ return null
290
+ })
256
291
 
257
292
  //methods
258
293
 
259
-
260
294
  function prepare() {
261
295
  if (!map.value) {
262
- throw new Error("Map is null")
296
+ throw new Error('Map is null')
263
297
  }
264
298
  // Set the map sizes
265
299
  mapRect.value = map.value.node()?.getBoundingClientRect() as DOMRect
@@ -287,24 +321,25 @@ export default defineComponent({
287
321
  function draw() {
288
322
  prepare()
289
323
  if (!map.value) {
290
- throw new Error("map is not defined")
324
+ throw new Error('map is not defined')
291
325
  }
292
326
  update()
293
327
  // Bind a group for marker paths
294
- map.value?.append('g')
295
- .attr('class', 'symbol-map__main__markers')
296
- .selectAll('.symbol-map__main__markers__item')
297
- .data(loadedDataWithIds.value)
298
- .enter()
299
- .append('g')
300
- .attr('id', markerId)
301
- .attr('class', markerClass)
302
- .attr('transform', markerTransform)
303
- .append('path')
304
- .on('mouseover', markerMouseOver)
305
- .on('mouseleave', markerMouseLeave)
306
- .attr('d', markerPathFunction)
307
- .attr('fill', markerColorFunction)
328
+ map.value
329
+ ?.append('g')
330
+ .attr('class', 'symbol-map__main__markers')
331
+ .selectAll('.symbol-map__main__markers__item')
332
+ .data(loadedDataWithIds.value)
333
+ .enter()
334
+ .append('g')
335
+ .attr('id', markerId)
336
+ .attr('class', markerClass)
337
+ .attr('transform', markerTransform)
338
+ .append('path')
339
+ .on('mouseover', markerMouseOver)
340
+ .on('mouseleave', markerMouseLeave)
341
+ .attr('d', markerPathFunction)
342
+ .attr('fill', markerColorFunction)
308
343
  prepareZoom()
309
344
  }
310
345
 
@@ -325,7 +360,7 @@ export default defineComponent({
325
360
  async function loadTopojson() {
326
361
  if (!topojsonPromise.value) {
327
362
  if (!props.topojsonUrl?.length) {
328
- throw new Error("Empty topojsonUrl")
363
+ throw new Error('Empty topojsonUrl')
329
364
  }
330
365
  topojsonPromise.value = d3.json(props.topojsonUrl)
331
366
  topojson.value = await topojsonPromise.value
@@ -333,11 +368,12 @@ export default defineComponent({
333
368
  return topojsonPromise.value
334
369
  }
335
370
 
336
- function mapZoomed({transform}) {
371
+ function mapZoomed({ transform }) {
337
372
  markerCursor.value = null
338
- map.value?.style('--map-scale', transform.k)
339
- .selectAll('.symbol-map__main__features, .symbol-map__main__markers')
340
- .attr('transform', transform)
373
+ map.value
374
+ ?.style('--map-scale', transform.k)
375
+ .selectAll('.symbol-map__main__features, .symbol-map__main__markers')
376
+ .attr('transform', transform)
341
377
  }
342
378
 
343
379
  function markerBoundingClientRect(d) {
@@ -380,15 +416,24 @@ export default defineComponent({
380
416
  }
381
417
 
382
418
  function markerPathFunction(d) {
383
- return isFunction(props.markerPath) ? props.markerPath(d) : props.markerPath
419
+ return isFunction(props.markerPath)
420
+ ? props.markerPath(d)
421
+ : props.markerPath
384
422
  }
385
423
 
386
- function markerColorFunction({color, ...d}) {
387
- return color || (isFunction(props.markerColor) ? props.markerColor(d) : props.markerColor)
424
+ function markerColorFunction({ color, ...d }) {
425
+ return (
426
+ color ||
427
+ (isFunction(props.markerColor)
428
+ ? props.markerColor(d)
429
+ : props.markerColor)
430
+ )
388
431
  }
389
432
 
390
433
  function markerWidthFunction(d) {
391
- return isFunction(props.markerWidth) ? props.markerWidth(d) : props.markerWidth
434
+ return isFunction(props.markerWidth)
435
+ ? props.markerWidth(d)
436
+ : props.markerWidth
392
437
  }
393
438
 
394
439
  function markerLabel(d) {
@@ -396,8 +441,8 @@ export default defineComponent({
396
441
  }
397
442
 
398
443
  function markerTransform(d) {
399
- const {latitude, longitude} = d
400
- const {height, width} = markerBoundingClientRect(d)
444
+ const { latitude, longitude } = d
445
+ const { height, width } = markerBoundingClientRect(d)
401
446
  const [x, y] = mapProjection.value([longitude, latitude])
402
447
  const scale = markerWidthFunction(d) / Math.max(1, width)
403
448
  const cx = x - (width / 2) * scale
@@ -405,7 +450,10 @@ export default defineComponent({
405
450
  return `translate(${cx}, ${cy}) scale(${scale})`
406
451
  }
407
452
 
408
- async function featureClicked(event: MouseEvent, d: d3.GeoPermissibleObjects) {
453
+ async function featureClicked(
454
+ event: MouseEvent,
455
+ d: d3.GeoPermissibleObjects
456
+ ) {
409
457
  /**
410
458
  * A click on a feature
411
459
  * @event click
@@ -429,10 +477,11 @@ export default defineComponent({
429
477
  }
430
478
 
431
479
  function resetZoom(_event: MouseEvent, _d: number) {
432
- map.value?.style('--map-scale', 1)
433
- .transition()
434
- .duration(props.transitionDuration)
435
- .call(mapZoom.value.transform, d3.zoomIdentity)
480
+ map.value
481
+ ?.style('--map-scale', 1)
482
+ .transition()
483
+ .duration(props.transitionDuration)
484
+ .call(mapZoom.value.transform, d3.zoomIdentity)
436
485
  featureZoom.value = null
437
486
 
438
487
  /**
@@ -443,7 +492,9 @@ export default defineComponent({
443
492
  }
444
493
 
445
494
  function setMarkersClasses() {
446
- map.value?.selectAll('.symbol-map__main__markers__item').attr('class', markerClass)
495
+ map.value
496
+ ?.selectAll('.symbol-map__main__markers__item')
497
+ .attr('class', markerClass)
447
498
  }
448
499
 
449
500
  function setFeatureZoom(d: GeoPermissibleObjects, pointer = [0, 0]) {
@@ -452,20 +503,24 @@ export default defineComponent({
452
503
  }
453
504
  featureZoom.value = get(d, props.topojsonObjectsPath)
454
505
 
455
- const {height, width} = mapRect.value
506
+ const { height, width } = mapRect.value
456
507
  const [[x0, y0], [x1, y1]] = featurePath.value.bounds(d)
457
- const scale = Math.min(8, 0.9 / Math.max((x1 - x0) / width, (y1 - y0) / height))
508
+ const scale = Math.min(
509
+ 8,
510
+ 0.9 / Math.max((x1 - x0) / width, (y1 - y0) / height)
511
+ )
458
512
  const x = -(x0 + x1) / 2
459
513
  const y = -(y0 + y1) / 2
460
514
  const zoomIdentity = d3.zoomIdentity
461
- .translate(width / 2, height / 2)
462
- .scale(scale)
463
- .translate(x, y)
464
- return map.value?.style('--map-scale', scale)
465
- .transition()
466
- .duration(props.transitionDuration)
467
- .call(mapZoom.value?.transform, zoomIdentity, pointer)
468
- .end()
515
+ .translate(width / 2, height / 2)
516
+ .scale(scale)
517
+ .translate(x, y)
518
+ return map.value
519
+ ?.style('--map-scale', scale)
520
+ .transition()
521
+ .duration(props.transitionDuration)
522
+ .call(mapZoom.value?.transform, zoomIdentity, pointer)
523
+ .end()
469
524
  }
470
525
 
471
526
  function update() {
@@ -474,34 +529,47 @@ export default defineComponent({
474
529
  return
475
530
  }
476
531
  // Bind a group for geojson features to path
477
- map.value?.append('g')
478
- .attr('class', 'symbol-map__main__features')
479
- .selectAll('.symbol-map__main__features__item')
480
- .data(featuresGeojson.value.features)
481
- // Add the path with the correct class
482
- .enter()
483
- .append('path')
484
- .attr('class', featureClass)
485
- .attr('d', featurePath.value)
486
- .on('click', featureClicked)
487
- .style('color', props.featureColor)
532
+ map.value
533
+ ?.append('g')
534
+ .attr('class', 'symbol-map__main__features')
535
+ .selectAll('.symbol-map__main__features__item')
536
+ .data(featuresGeojson.value.features)
537
+ // Add the path with the correct class
538
+ .enter()
539
+ .append('path')
540
+ .attr('class', featureClass)
541
+ .attr('d', featurePath.value)
542
+ .on('click', featureClicked)
543
+ .style('color', props.featureColor)
488
544
  }
489
545
 
490
546
  //watch
491
- watch(() => props.data, () => {
492
- //draw()
493
- update()
494
- })
495
- watch(() => props.socialMode, () => {
496
- draw()
497
- })
498
- watch(() => markerCursor.value, () => {
499
- setMarkersClasses()
500
- })
547
+ watch(
548
+ () => props.data,
549
+ () => {
550
+ //draw()
551
+ update()
552
+ }
553
+ )
554
+ watch(
555
+ () => props.socialMode,
556
+ () => {
557
+ draw()
558
+ }
559
+ )
560
+ watch(
561
+ () => markerCursor.value,
562
+ () => {
563
+ setMarkersClasses()
564
+ }
565
+ )
501
566
 
502
- watch(() => categoryHighlight.value, () => {
503
- setMarkersClasses()
504
- })
567
+ watch(
568
+ () => categoryHighlight.value,
569
+ () => {
570
+ setMarkersClasses()
571
+ }
572
+ )
505
573
 
506
574
  return {
507
575
  el,
@@ -516,36 +584,35 @@ export default defineComponent({
516
584
  }
517
585
  }
518
586
  })
519
-
520
587
  </script>
521
588
 
522
589
  <template>
523
590
  <div ref="el" :class="mapClass" class="symbol-map">
524
591
  <slot name="legend" v-bind="{ legendData }">
525
592
  <ordinal-legend
526
- v-if="!hideLegend && legendData"
527
- v-model:highlight="categoryHighlight"
528
- :data="legendData"
529
- :horizontal="horizontalLegend"
530
- :marker-path="markerPath"
531
- category-objects-path="label"
593
+ v-if="!hideLegend && legendData"
594
+ v-model:highlight="categoryHighlight"
595
+ :data="legendData"
596
+ :horizontal="horizontalLegend"
597
+ :marker-path="markerPath"
598
+ category-objects-path="label"
532
599
  >
533
600
  <template #marker="d">
534
- <slot name="legend-marker" v-bind="d"/>
601
+ <slot name="legend-marker" v-bind="d" />
535
602
  </template>
536
603
  <template #label="d">
537
- <slot name="legend-label" v-bind="d"/>
604
+ <slot name="legend-label" v-bind="d" />
538
605
  </template>
539
606
  </ordinal-legend>
540
607
  </slot>
541
- <svg class="symbol-map__main"/>
608
+ <svg class="symbol-map__main" />
542
609
  <b-tooltip
543
- v-if="tooltipTarget"
544
- ref="marker-tooltip"
545
- :custom-class="tooltipCustomClass"
546
- :fallback-placement="tooltipFallbackPlacement"
547
- :placement="tooltipPlacement"
548
- :target="tooltipTarget"
610
+ v-if="tooltipTarget"
611
+ ref="marker-tooltip"
612
+ :custom-class="tooltipCustomClass"
613
+ :fallback-placement="tooltipFallbackPlacement"
614
+ :placement="tooltipPlacement"
615
+ :target="tooltipTarget"
549
616
  >
550
617
  <slot name="tooltip" v-bind="{ markerCursor, ...markerCursorValue }">
551
618
  {{ markerLabel(markerCursorValue) }}
@@ -561,7 +628,9 @@ export default defineComponent({
561
628
  .symbol-map {
562
629
  $muted-item-opacity: 0.2;
563
630
  $muted-item-filter: grayscale(30%) brightness(10%);
564
- $muted-item-transition: opacity 0.2s, filter 0.2s;
631
+ $muted-item-transition:
632
+ opacity 0.2s,
633
+ filter 0.2s;
565
634
 
566
635
  $colors: $primary, $info, $warning, $danger;
567
636
  $quantile: 2;
@@ -590,7 +659,9 @@ export default defineComponent({
590
659
  stroke: currentColor;
591
660
  stroke-width: calc(1px / var(--map-scale, 1));
592
661
  fill: currentColor;
593
- transition: opacity 750ms, filter 750ms;
662
+ transition:
663
+ opacity 750ms,
664
+ filter 750ms;
594
665
  }
595
666
 
596
667
  &:deep(.symbol-map__main__markers) {
@@ -2,4 +2,4 @@ declare module 'bootstrap-vue/esm/components/dropdown/dropdown-item'
2
2
  declare module 'bootstrap-vue/esm/components/modal/modal'
3
3
  declare module 'bootstrap-vue/esm/components/nav/nav-item-dropdown'
4
4
  declare module 'bootstrap-vue/esm/components/popover/popover'
5
- declare module 'bootstrap-vue/esm/components/tooltip/tooltip'
5
+ declare module 'bootstrap-vue/esm/components/tooltip/tooltip'
@@ -8,7 +8,7 @@ declare module 'vue' {
8
8
  }
9
9
 
10
10
  declare module '*.vue' {
11
- import type {DefineComponent} from 'vue';
12
- const component: DefineComponent<{}, {}, any>;
13
- export default component;
11
+ import type { DefineComponent } from 'vue'
12
+ const component: DefineComponent<{}, {}, any>
13
+ export default component
14
14
  }
@@ -1,4 +1,4 @@
1
- @use "sass:math";
1
+ @use 'sass:math';
2
2
  /*------------------------
3
3
  mixin that calculates if text needs to be light or dark
4
4
  depending on the background color passed.
@@ -8,13 +8,17 @@ Color brightness is determined by the following formula:
8
8
  ------------------------*/
9
9
 
10
10
  @function text-contrast($n) {
11
- $color-brightness: round((red($n) * 299) + (green($n) * 587) + math.div(blue($n) * 114, 1000));
12
- $light-color: round((red(#ffffff) * 299) + (green(#ffffff) * 587) + math.div(blue(#ffffff) * 114, 1000));
11
+ $color-brightness: round(
12
+ (red($n) * 299) + (green($n) * 587) + math.div(blue($n) * 114, 1000)
13
+ );
14
+ $light-color: round(
15
+ (red(#ffffff) * 299) + (green(#ffffff) * 587) +
16
+ math.div(blue(#ffffff) * 114, 1000)
17
+ );
13
18
 
14
- @if abs($color-brightness) < ($light-color * 0.5){
19
+ @if abs($color-brightness) < ($light-color * 0.5) {
15
20
  @return white;
16
- }
17
- @else {
21
+ } @else {
18
22
  @return black;
19
23
  }
20
24
  }