@unovis/ts 1.3.0-beta.2 → 1.3.0

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 (113) hide show
  1. package/components/axis/config.d.ts +1 -1
  2. package/components/axis/config.js.map +1 -1
  3. package/components/axis/index.js +1 -1
  4. package/components/axis/index.js.map +1 -1
  5. package/components/chord-diagram/config.js +2 -2
  6. package/components/chord-diagram/config.js.map +1 -1
  7. package/components/chord-diagram/index.js +1 -1
  8. package/components/chord-diagram/index.js.map +1 -1
  9. package/components/donut/config.d.ts +1 -1
  10. package/components/donut/config.js +1 -3
  11. package/components/donut/config.js.map +1 -1
  12. package/components/free-brush/index.js +9 -9
  13. package/components/free-brush/index.js.map +1 -1
  14. package/components/graph/config.js +3 -3
  15. package/components/graph/config.js.map +1 -1
  16. package/components/graph/index.js +3 -2
  17. package/components/graph/index.js.map +1 -1
  18. package/components/graph/modules/layout.js +7 -2
  19. package/components/graph/modules/layout.js.map +1 -1
  20. package/components/graph/modules/link/index.js.map +1 -1
  21. package/components/graph/modules/node/helper.d.ts +1 -1
  22. package/components/graph/modules/node/helper.js.map +1 -1
  23. package/components/graph/modules/node/index.d.ts +3 -0
  24. package/components/graph/modules/node/index.js +5 -7
  25. package/components/graph/modules/node/index.js.map +1 -1
  26. package/components/graph/modules/shape.js +2 -2
  27. package/components/graph/modules/shape.js.map +1 -1
  28. package/components/grouped-bar/config.js +1 -3
  29. package/components/grouped-bar/config.js.map +1 -1
  30. package/components/grouped-bar/index.d.ts +1 -6
  31. package/components/grouped-bar/index.js +1 -12
  32. package/components/grouped-bar/index.js.map +1 -1
  33. package/components/leaflet-flow-map/config.js +1 -1
  34. package/components/leaflet-flow-map/config.js.map +1 -1
  35. package/components/leaflet-map/config.js +2 -2
  36. package/components/leaflet-map/config.js.map +1 -1
  37. package/components/leaflet-map/index.d.ts +1 -1
  38. package/components/leaflet-map/index.js.map +1 -1
  39. package/components/leaflet-map/modules/clusterBackground.d.ts +4 -2
  40. package/components/leaflet-map/modules/clusterBackground.js.map +1 -1
  41. package/components/leaflet-map/modules/map.d.ts +1 -1
  42. package/components/leaflet-map/modules/map.js +6 -6
  43. package/components/leaflet-map/modules/map.js.map +1 -1
  44. package/components/leaflet-map/modules/node.d.ts +3 -0
  45. package/components/leaflet-map/modules/node.js +8 -12
  46. package/components/leaflet-map/modules/node.js.map +1 -1
  47. package/components/leaflet-map/modules/utils.js.map +1 -1
  48. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
  49. package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +5 -1
  50. package/components/leaflet-map/renderer/mapboxgl-utils.js +3 -3
  51. package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
  52. package/components/leaflet-map/style.js.map +1 -1
  53. package/components/leaflet-map/types.d.ts +5 -1
  54. package/components/leaflet-map/types.js.map +1 -1
  55. package/components/line/index.d.ts +2 -2
  56. package/components/line/index.js +2 -2
  57. package/components/line/index.js.map +1 -1
  58. package/components/nested-donut/index.js +14 -5
  59. package/components/nested-donut/index.js.map +1 -1
  60. package/components/nested-donut/style.js.map +1 -1
  61. package/components/sankey/config.d.ts +1 -1
  62. package/components/sankey/config.js +2 -2
  63. package/components/sankey/config.js.map +1 -1
  64. package/components/sankey/index.js.map +1 -1
  65. package/components/sankey/modules/link.d.ts +10 -0
  66. package/components/sankey/modules/link.js +4 -8
  67. package/components/sankey/modules/link.js.map +1 -1
  68. package/components/scatter/config.d.ts +1 -1
  69. package/components/scatter/config.js +1 -3
  70. package/components/scatter/config.js.map +1 -1
  71. package/components/scatter/index.js +3 -3
  72. package/components/scatter/index.js.map +1 -1
  73. package/components/scatter/modules/point.js.map +1 -1
  74. package/components/stacked-bar/config.js +1 -3
  75. package/components/stacked-bar/config.js.map +1 -1
  76. package/components/timeline/config.js +1 -7
  77. package/components/timeline/config.js.map +1 -1
  78. package/components/tooltip/index.d.ts +2 -1
  79. package/components/tooltip/index.js +10 -3
  80. package/components/tooltip/index.js.map +1 -1
  81. package/components/tooltip/style.d.ts +6 -0
  82. package/components/tooltip/style.js +13 -14
  83. package/components/tooltip/style.js.map +1 -1
  84. package/components/topojson-map/config.js +1 -1
  85. package/components/topojson-map/config.js.map +1 -1
  86. package/components/topojson-map/index.js +0 -1
  87. package/components/topojson-map/index.js.map +1 -1
  88. package/components/xy-labels/config.js +1 -3
  89. package/components/xy-labels/config.js.map +1 -1
  90. package/containers/xy-container/config.js.map +1 -1
  91. package/containers/xy-container/index.js +7 -6
  92. package/containers/xy-container/index.js.map +1 -1
  93. package/core/component/index.js +6 -2
  94. package/core/component/index.js.map +1 -1
  95. package/core/xy-component/config.js +1 -5
  96. package/core/xy-component/config.js.map +1 -1
  97. package/data-models/map-graph.js +3 -6
  98. package/data-models/map-graph.js.map +1 -1
  99. package/package.json +3 -1
  100. package/styles/colors.d.ts +2 -2
  101. package/styles/index.d.ts +1 -1
  102. package/styles/patterns.js +2 -1
  103. package/styles/patterns.js.map +1 -1
  104. package/types/accessor.d.ts +5 -5
  105. package/types/component.js +2 -0
  106. package/types/component.js.map +1 -1
  107. package/utils/d3.d.ts +10 -1
  108. package/utils/d3.js.map +1 -1
  109. package/utils/data.d.ts +6 -6
  110. package/utils/data.js +2 -1
  111. package/utils/data.js.map +1 -1
  112. package/utils/text.js +2 -2
  113. package/utils/text.js.map +1 -1
@@ -3,7 +3,7 @@ import { Position } from '../../types/position.js';
3
3
  import { throttle, merge } from '../../utils/data.js';
4
4
  import { TooltipDefaultConfig } from './config.js';
5
5
  import * as style from './style.js';
6
- import { tooltip, show, positionFixed } from './style.js';
6
+ import { tooltip, hidden, show, positionFixed } from './style.js';
7
7
 
8
8
  class Tooltip {
9
9
  constructor(config = {}) {
@@ -57,12 +57,19 @@ class Tooltip {
57
57
  else {
58
58
  this.div.html(html);
59
59
  }
60
- this.div.classed(show, true);
60
+ this.div
61
+ .classed(hidden, false)
62
+ .classed(show, true);
61
63
  this._isShown = true;
62
64
  this.place(pos);
63
65
  }
64
66
  hide() {
65
- this.div.classed(show, false);
67
+ this.div.classed(show, false)
68
+ .on('transitionend', () => {
69
+ // We hide the element once the transition completes
70
+ // This ensures container overflow will not occur when the window is resized
71
+ this.div.classed(hidden, !this._isShown);
72
+ });
66
73
  this._isShown = false;
67
74
  }
68
75
  place(pos) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.ts"],"sourcesContent":["import { select, Selection, pointer } from 'd3-selection'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Types\nimport { Position } from 'types/position'\n\n// Utils\nimport { merge, throttle } from 'utils/data'\n\n// Config\nimport { TooltipDefaultConfig, TooltipConfigInterface } from './config'\n\n// Style\nimport * as s from './style'\n\nexport class Tooltip {\n element: HTMLElement\n div: Selection<HTMLElement, unknown, null, undefined>\n protected _defaultConfig = TooltipDefaultConfig as TooltipConfigInterface\n public config: TooltipConfigInterface = this._defaultConfig\n prevConfig: TooltipConfigInterface\n components: ComponentCore<unknown>[]\n static selectors = s\n private _setUpEventsThrottled = throttle(this._setUpEvents, 500)\n private _setContainerPositionThrottled = throttle(this._setContainerPosition, 500)\n private _isShown = false\n private _container: HTMLElement\n\n constructor (config: TooltipConfigInterface = {}) {\n this.element = document.createElement('div')\n this.div = select(this.element)\n .attr('class', s.tooltip)\n\n this.setConfig(config)\n this.components = this.config.components\n }\n\n public setConfig (config: TooltipConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n\n if (this.config.container && (this.config.container !== this.prevConfig?.container)) {\n this.setContainer(this.config.container)\n }\n\n this._setUpAttributes()\n }\n\n public setContainer (container: HTMLElement): void {\n this.element.parentNode?.removeChild(this.element)\n\n this._container = container\n this._container.appendChild(this.element)\n\n this._setContainerPositionThrottled()\n }\n\n public getContainer (): HTMLElement {\n return this._container\n }\n\n public hasContainer (): boolean {\n return !!this._container && this._container.isConnected\n }\n\n public setComponents (components: ComponentCore<unknown>[]): void {\n this.components = components\n }\n\n public update (): void {\n if (!this._container) return\n\n this._setUpEventsThrottled()\n }\n\n public show (html: string | HTMLElement, pos: { x: number; y: number }): void {\n if (html instanceof HTMLElement) {\n const node = this.div.select(':first-child').node()\n if (node !== html) this.div.html('').append(() => html)\n } else {\n this.div.html(html)\n }\n\n this.div.classed(s.show, true)\n this._isShown = true\n this.place(pos)\n }\n\n public hide (): void {\n this.div.classed(s.show, false)\n this._isShown = false\n }\n\n public place (pos: { x: number; y: number }): void {\n if (!this.hasContainer()) {\n console.warn('Unovis | Tooltip: Container was not set or is not initialized yet')\n return\n }\n const { config } = this\n const isContainerBody = this.isContainerBody()\n const width = this.element.offsetWidth\n const height = this.element.offsetHeight\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n\n const horizontalPlacement = config.horizontalPlacement === Position.Auto\n ? (pos.x > containerWidth / 2 ? Position.Left : Position.Right)\n : config.horizontalPlacement\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? (pos.y > containerHeight / 2 ? Position.Top : Position.Bottom)\n : config.verticalPlacement\n\n // dx and dy variables shift the tooltip from the default position (above the cursor, centred horizontally)\n const margin = 5\n const dx = horizontalPlacement === Position.Left ? -width - margin - config.horizontalShift\n : horizontalPlacement === Position.Center ? -width / 2\n : margin + config.horizontalShift\n const dy = verticalPlacement === Position.Bottom ? height + margin + config.verticalShift\n : verticalPlacement === Position.Center ? height / 2\n : -margin - config.verticalShift\n\n // Constraint to container\n const paddingX = 10\n const hitRight = pos.x > (containerWidth - width - dx - paddingX)\n const hitLeft = pos.x < -dx + paddingX\n const constraintX = hitRight ? (containerWidth - width - dx) - pos.x - paddingX\n : hitLeft ? -dx - pos.x + paddingX : 0\n\n const paddingY = 10\n const hitBottom = pos.y > (containerHeight - dy - paddingY)\n const hitTop = pos.y < (height - dy + paddingY)\n const constraintY = hitBottom ? containerHeight - dy - pos.y - paddingY\n : hitTop ? height - dy - pos.y + paddingY : 0\n\n // Placing\n // If the container size is smaller than the the tooltip size we just stick the tooltip to the top / left\n const x = containerWidth < width ? 0 : pos.x + constraintX + dx\n const y = containerHeight < height ? height : pos.y + constraintY + dy\n\n this.div\n .classed(s.positionFixed, isContainerBody)\n .style('top', isContainerBody ? `${y - height}px` : 'unset')\n .style('bottom', !isContainerBody ? `${containerHeight - y}px` : 'unset')\n .style('left', `${x}px`)\n }\n\n public isContainerBody (): boolean {\n return this._container === document.body\n }\n\n private _setContainerPosition (): void {\n // Tooltip position calculation relies on the parent position\n // If it's not set (static), we set it to `relative` (not a good practice)\n if (getComputedStyle(this._container)?.position === 'static') {\n this._container.style.position = 'relative'\n }\n }\n\n private _setUpEvents (): void {\n const { config: { triggers } } = this\n const isContainerBody = this.isContainerBody()\n\n // We use the Event Delegation pattern to set up Tooltip events\n // Every component will have single `mousemove` and `mouseleave` event listener functions, where we'll check\n // the `path` of the event and trigger corresponding callbacks\n this.components.forEach(component => {\n const selection = select(component.element)\n selection\n .on('mousemove.tooltip', (e: MouseEvent) => {\n const [x, y] = isContainerBody ? [e.clientX, e.clientY] : pointer(e, this._container)\n const path: (HTMLElement | SVGGElement)[] = (e.composedPath && e.composedPath()) || (e as any).path || [e.target]\n\n // Go through all of the configured triggers\n for (const className of Object.keys(triggers)) {\n const template = triggers[className]\n const els = selection.selectAll<HTMLElement | SVGGElement, unknown>(`.${className}`).nodes()\n\n // Go through all of the elements in the event path (from the deepest element upwards)\n for (const el of path) {\n if (el === selection.node()) break // Break on the component's level (usually the `<g>` element)\n if (el.classList.contains(className)) { // If there's a match, show the tooltip\n const i = els.indexOf(el)\n const d = select(el).datum()\n const content = template(d, i, els)\n if (content) this.show(content, { x, y })\n else this.hide()\n\n e.stopPropagation() // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n return // Stop looking for other matches\n }\n }\n }\n\n // Hide the tooltip if the event didn't pass through any of the configured triggers.\n // We use the `this._isShown` condition as a little performance optimization tweak\n // (we don't want the tooltip to update its class on every mouse movement, see `this.hide()`).\n if (this._isShown) this.hide()\n })\n .on('mouseleave.tooltip', (e: MouseEvent) => {\n e.stopPropagation() // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n this.hide()\n })\n })\n }\n\n private _setUpAttributes (): void {\n const attributesMap = this.config.attributes\n if (!attributesMap) return\n\n Object.keys(attributesMap).forEach(attr => {\n this.div.attr(attr, attributesMap[attr])\n })\n }\n\n public destroy (): void {\n this.div?.remove()\n }\n}\n"],"names":["s.tooltip","s.show","s.positionFixed","s"],"mappings":";;;;;;;MAiBa,OAAO,CAAA;AAalB,IAAA,WAAA,CAAa,SAAiC,EAAE,EAAA;QAVtC,IAAc,CAAA,cAAA,GAAG,oBAA8C,CAAA;AAClE,QAAA,IAAA,CAAA,MAAM,GAA2B,IAAI,CAAC,cAAc,CAAA;QAInD,IAAqB,CAAA,qBAAA,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;QACxD,IAA8B,CAAA,8BAAA,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAA;QAC1E,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAA;QAItB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAC5C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5B,aAAA,IAAI,CAAC,OAAO,EAAEA,OAAS,CAAC,CAAA;AAE3B,QAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAA;KACzC;AAEM,IAAA,SAAS,CAAE,MAA8B,EAAA;;AAC9C,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,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AAI,IAAG;AACxC,YAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;AAC1C,SAAC,CAAC,CAAA;KACH;IAEM,OAAO,GAAA;;AACZ,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,GAAG,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,EAAE,CAAA;KACnB;;AAnMM,OAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.ts"],"sourcesContent":["import { select, Selection, pointer } from 'd3-selection'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Types\nimport { Position } from 'types/position'\n\n// Utils\nimport { merge, throttle } from 'utils/data'\n\n// Config\nimport { TooltipDefaultConfig, TooltipConfigInterface } from './config'\n\n// Style\nimport * as s from './style'\n\nexport class Tooltip {\n element: HTMLElement\n div: Selection<HTMLElement, unknown, null, undefined>\n protected _defaultConfig = TooltipDefaultConfig as TooltipConfigInterface\n public config: TooltipConfigInterface = this._defaultConfig\n prevConfig: TooltipConfigInterface\n components: ComponentCore<unknown>[]\n static selectors = s\n private _setUpEventsThrottled = throttle(this._setUpEvents, 500)\n private _setContainerPositionThrottled = throttle(this._setContainerPosition, 500)\n private _isShown = false\n private _container: HTMLElement\n\n constructor (config: TooltipConfigInterface = {}) {\n this.element = document.createElement('div')\n this.div = select(this.element)\n .attr('class', s.tooltip)\n\n this.setConfig(config)\n this.components = this.config.components\n }\n\n public setConfig (config: TooltipConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n\n if (this.config.container && (this.config.container !== this.prevConfig?.container)) {\n this.setContainer(this.config.container)\n }\n\n this._setUpAttributes()\n }\n\n public setContainer (container: HTMLElement): void {\n this.element.parentNode?.removeChild(this.element)\n\n this._container = container\n this._container.appendChild(this.element)\n\n this._setContainerPositionThrottled()\n }\n\n public getContainer (): HTMLElement {\n return this._container\n }\n\n public hasContainer (): boolean {\n return !!this._container && this._container.isConnected\n }\n\n public setComponents (components: ComponentCore<unknown>[]): void {\n this.components = components\n }\n\n public update (): void {\n if (!this._container) return\n\n this._setUpEventsThrottled()\n }\n\n public show (html: string | HTMLElement, pos: { x: number; y: number }): void {\n if (html instanceof HTMLElement) {\n const node = this.div.select(':first-child').node()\n if (node !== html) this.div.html('').append(() => html)\n } else {\n this.div.html(html)\n }\n\n this.div\n .classed(s.hidden, false)\n .classed(s.show, true)\n\n this._isShown = true\n this.place(pos)\n }\n\n public hide (): void {\n this.div.classed(s.show, false)\n .on('transitionend', () => {\n // We hide the element once the transition completes\n // This ensures container overflow will not occur when the window is resized\n this.div.classed(s.hidden, !this._isShown)\n })\n\n this._isShown = false\n }\n\n public place (pos: { x: number; y: number }): void {\n if (!this.hasContainer()) {\n console.warn('Unovis | Tooltip: Container was not set or is not initialized yet')\n return\n }\n const { config } = this\n const isContainerBody = this.isContainerBody()\n const width = this.element.offsetWidth\n const height = this.element.offsetHeight\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n\n const horizontalPlacement = config.horizontalPlacement === Position.Auto\n ? (pos.x > containerWidth / 2 ? Position.Left : Position.Right)\n : config.horizontalPlacement\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? (pos.y > containerHeight / 2 ? Position.Top : Position.Bottom)\n : config.verticalPlacement\n\n // dx and dy variables shift the tooltip from the default position (above the cursor, centred horizontally)\n const margin = 5\n const dx = horizontalPlacement === Position.Left ? -width - margin - config.horizontalShift\n : horizontalPlacement === Position.Center ? -width / 2\n : margin + config.horizontalShift\n const dy = verticalPlacement === Position.Bottom ? height + margin + config.verticalShift\n : verticalPlacement === Position.Center ? height / 2\n : -margin - config.verticalShift\n\n // Constraint to container\n const paddingX = 10\n const hitRight = pos.x > (containerWidth - width - dx - paddingX)\n const hitLeft = pos.x < -dx + paddingX\n const constraintX = hitRight ? (containerWidth - width - dx) - pos.x - paddingX\n : hitLeft ? -dx - pos.x + paddingX : 0\n\n const paddingY = 10\n const hitBottom = pos.y > (containerHeight - dy - paddingY)\n const hitTop = pos.y < (height - dy + paddingY)\n const constraintY = hitBottom ? containerHeight - dy - pos.y - paddingY\n : hitTop ? height - dy - pos.y + paddingY : 0\n\n // Placing\n // If the container size is smaller than the the tooltip size we just stick the tooltip to the top / left\n const x = containerWidth < width ? 0 : pos.x + constraintX + dx\n const y = containerHeight < height ? height : pos.y + constraintY + dy\n\n this.div\n .classed(s.positionFixed, isContainerBody)\n .style('top', isContainerBody ? `${y - height}px` : 'unset')\n .style('bottom', !isContainerBody ? `${containerHeight - y}px` : 'unset')\n .style('left', `${x}px`)\n }\n\n public isContainerBody (): boolean {\n return this._container === document.body\n }\n\n private _setContainerPosition (): void {\n // Tooltip position calculation relies on the parent position\n // If it's not set (static), we set it to `relative` (not a good practice)\n if (getComputedStyle(this._container)?.position === 'static') {\n this._container.style.position = 'relative'\n }\n }\n\n private _setUpEvents (): void {\n const { config: { triggers } } = this\n const isContainerBody = this.isContainerBody()\n\n // We use the Event Delegation pattern to set up Tooltip events\n // Every component will have single `mousemove` and `mouseleave` event listener functions, where we'll check\n // the `path` of the event and trigger corresponding callbacks\n this.components.forEach(component => {\n const selection = select(component.element)\n selection\n .on('mousemove.tooltip', (e: MouseEvent) => {\n const [x, y] = isContainerBody ? [e.clientX, e.clientY] : pointer(e, this._container)\n const path: (HTMLElement | SVGGElement)[] = (e.composedPath && e.composedPath()) || (e as any).path || [e.target]\n\n // Go through all of the configured triggers\n for (const className of Object.keys(triggers)) {\n const template = triggers[className]\n const els = selection.selectAll<HTMLElement | SVGGElement, unknown>(`.${className}`).nodes()\n\n // Go through all of the elements in the event path (from the deepest element upwards)\n for (const el of path) {\n if (el === selection.node()) break // Break on the component's level (usually the `<g>` element)\n if (el.classList.contains(className)) { // If there's a match, show the tooltip\n const i = els.indexOf(el)\n const d = select(el).datum()\n const content = template(d, i, els)\n if (content) this.show(content, { x, y })\n else this.hide()\n\n e.stopPropagation() // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n return // Stop looking for other matches\n }\n }\n }\n\n // Hide the tooltip if the event didn't pass through any of the configured triggers.\n // We use the `this._isShown` condition as a little performance optimization tweak\n // (we don't want the tooltip to update its class on every mouse movement, see `this.hide()`).\n if (this._isShown) this.hide()\n })\n .on('mouseleave.tooltip', (e: MouseEvent) => {\n e.stopPropagation() // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n this.hide()\n })\n })\n }\n\n private _setUpAttributes (): void {\n const attributesMap = this.config.attributes\n if (!attributesMap) return\n\n Object.keys(attributesMap).forEach(attr => {\n this.div.attr(attr, attributesMap[attr])\n })\n }\n\n public destroy (): void {\n this.div?.remove()\n }\n}\n"],"names":["s.tooltip","s.hidden","s.show","s.positionFixed","s"],"mappings":";;;;;;;MAiBa,OAAO,CAAA;AAalB,IAAA,WAAA,CAAa,SAAiC,EAAE,EAAA;QAVtC,IAAc,CAAA,cAAA,GAAG,oBAA8C,CAAA;AAClE,QAAA,IAAA,CAAA,MAAM,GAA2B,IAAI,CAAC,cAAc,CAAA;QAInD,IAAqB,CAAA,qBAAA,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;QACxD,IAA8B,CAAA,8BAAA,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAA;QAC1E,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAA;QAItB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAC5C,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5B,aAAA,IAAI,CAAC,OAAO,EAAEA,OAAS,CAAC,CAAA;AAE3B,QAAA,IAAI,CAAC,SAAS,CAAC,MAAM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F,iBAAA;;;;gBAKD,IAAI,IAAI,CAAC,QAAQ;oBAAE,IAAI,CAAC,IAAI,EAAE,CAAA;AAChC,aAAC,CAAC;AACD,iBAAA,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAa,KAAI;AAC1C,gBAAA,CAAC,CAAC,eAAe,EAAE,CAAA;gBACnB,IAAI,CAAC,IAAI,EAAE,CAAA;AACb,aAAC,CAAC,CAAA;AACN,SAAC,CAAC,CAAA;KACH;IAEO,gBAAgB,GAAA;AACtB,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAA;AAC5C,QAAA,IAAI,CAAC,aAAa;YAAE,OAAM;QAE1B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,IAAI,IAAG;AACxC,YAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;AAC1C,SAAC,CAAC,CAAA;KACH;IAEM,OAAO,GAAA;;AACZ,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,GAAG,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,EAAE,CAAA;KACnB;;AA5MM,OAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
@@ -0,0 +1,6 @@
1
+ export declare const root: string;
2
+ export declare const variables: void;
3
+ export declare const tooltip: string;
4
+ export declare const positionFixed: string;
5
+ export declare const show: string;
6
+ export declare const hidden: string;
@@ -1,10 +1,9 @@
1
1
  import { css, injectGlobal } from '@emotion/css';
2
2
 
3
- const root = css`
3
+ const root = css `
4
4
  label: tooltip;
5
- `;
6
-
7
- const variables = injectGlobal`
5
+ `;
6
+ const variables = injectGlobal `
8
7
  :root {
9
8
  --vis-tooltip-background-color: rgba(255, 255, 255, 0.95);
10
9
  --vis-tooltip-border-color: #e5e9f7;
@@ -32,9 +31,8 @@ const variables = injectGlobal`
32
31
  --vis-tooltip-border-color: var(--vis-color-grey);
33
32
  --vis-tooltip-shadow-color: rgba(0,0,0, 0.95);
34
33
  }
35
- `;
36
-
37
- const tooltip = css`
34
+ `;
35
+ const tooltip = css `
38
36
  label: tooltip;
39
37
  display: inline-block;
40
38
  left: 0;
@@ -57,16 +55,17 @@ const tooltip = css`
57
55
  border: solid 1px var(--vis-tooltip-border-color);
58
56
  background-color: var(--vis-tooltip-background-color);
59
57
  backdrop-filter: var(--vis-tooltip-backdrop-filter);
60
- `;
61
-
62
- const positionFixed = css`
58
+ `;
59
+ const positionFixed = css `
63
60
  bottom: unset;
64
61
  position: fixed;
65
- `;
66
-
67
- const show = css`
62
+ `;
63
+ const show = css `
68
64
  opacity: 1;
65
+ `;
66
+ const hidden = css `
67
+ display: none;
69
68
  `;
70
69
 
71
- export { positionFixed, root, show, tooltip, variables };
70
+ export { hidden, positionFixed, root, show, tooltip, variables };
72
71
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../src/components/tooltip/style.js"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: tooltip;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-tooltip-background-color: rgba(255, 255, 255, 0.95);\n --vis-tooltip-border-color: #e5e9f7;\n --vis-tooltip-text-color: #000;\n --vis-tooltip-shadow-color: rgba(172, 179, 184, 0.35);\n --vis-tooltip-backdrop-filter: none;\n --vis-tooltip-padding: 10px 15px;\n\n --vis-dark-tooltip-background-color: rgba(30,30,30, 0.95);\n --vis-dark-tooltip-text-color: #e5e9f7;\n --vis-dark-tooltip-border-color: var(--vis-color-grey);\n --vis-dark-tooltip-shadow-color: rgba(0,0,0, 0.95);\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-tooltip-background-color: var(--vis-dark-tooltip-background-color);\n --vis-tooltip-text-color: var(--vis-dark-tooltip-text-color);\n --vis-tooltip-border-color: var(--vis-dark-tooltip-border-color);\n --vis-tooltip-shadow-color: var(--vis-dark-tooltip-shadow-color);\n }\n\n body.theme-dark {\n --vis-tooltip-background-color: rgba(30,30,30, 0.95);\n --vis-tooltip-text-color: #e5e9f7;\n --vis-tooltip-border-color: var(--vis-color-grey);\n --vis-tooltip-shadow-color: rgba(0,0,0, 0.95);\n }\n`\n\nexport const tooltip = css`\n label: tooltip;\n display: inline-block;\n left: 0;\n bottom: 0;\n min-width: max-content;\n position: absolute;\n pointer-events: none;\n opacity: 0;\n transition: opacity;\n transition-duration: 300ms;\n user-select: none;\n z-index: 999999;\n padding: var(--vis-tooltip-padding);\n transform: translate(0, -5px);\n color: var(--vis-tooltip-text-color);\n\n /* object-fit: contain; */\n border-radius: 5px;\n box-shadow: 0 13px 25px 0 var(--vis-tooltip-box-shadow);\n border: solid 1px var(--vis-tooltip-border-color);\n background-color: var(--vis-tooltip-background-color);\n backdrop-filter: var(--vis-tooltip-backdrop-filter);\n`\n\nexport const positionFixed = css`\n bottom: unset;\n position: fixed;\n`\n\nexport const show = css`\n opacity: 1;\n`\n"],"names":[],"mappings":";;AAEY,MAAC,IAAI,GAAG,GAAG,CAAC;AACxB;AACA,EAAC;AACD;AACY,MAAC,SAAS,GAAG,YAAY,CAAC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACY,MAAC,OAAO,GAAG,GAAG,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACY,MAAC,aAAa,GAAG,GAAG,CAAC;AACjC;AACA;AACA,EAAC;AACD;AACY,MAAC,IAAI,GAAG,GAAG,CAAC;AACxB;AACA;;;;"}
1
+ {"version":3,"file":"style.js","sources":["../../../src/components/tooltip/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n label: tooltip;\n`\n\nexport const variables = injectGlobal`\n :root {\n --vis-tooltip-background-color: rgba(255, 255, 255, 0.95);\n --vis-tooltip-border-color: #e5e9f7;\n --vis-tooltip-text-color: #000;\n --vis-tooltip-shadow-color: rgba(172, 179, 184, 0.35);\n --vis-tooltip-backdrop-filter: none;\n --vis-tooltip-padding: 10px 15px;\n\n --vis-dark-tooltip-background-color: rgba(30,30,30, 0.95);\n --vis-dark-tooltip-text-color: #e5e9f7;\n --vis-dark-tooltip-border-color: var(--vis-color-grey);\n --vis-dark-tooltip-shadow-color: rgba(0,0,0, 0.95);\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-tooltip-background-color: var(--vis-dark-tooltip-background-color);\n --vis-tooltip-text-color: var(--vis-dark-tooltip-text-color);\n --vis-tooltip-border-color: var(--vis-dark-tooltip-border-color);\n --vis-tooltip-shadow-color: var(--vis-dark-tooltip-shadow-color);\n }\n\n body.theme-dark {\n --vis-tooltip-background-color: rgba(30,30,30, 0.95);\n --vis-tooltip-text-color: #e5e9f7;\n --vis-tooltip-border-color: var(--vis-color-grey);\n --vis-tooltip-shadow-color: rgba(0,0,0, 0.95);\n }\n`\n\nexport const tooltip = css`\n label: tooltip;\n display: inline-block;\n left: 0;\n bottom: 0;\n min-width: max-content;\n position: absolute;\n pointer-events: none;\n opacity: 0;\n transition: opacity;\n transition-duration: 300ms;\n user-select: none;\n z-index: 999999;\n padding: var(--vis-tooltip-padding);\n transform: translate(0, -5px);\n color: var(--vis-tooltip-text-color);\n\n /* object-fit: contain; */\n border-radius: 5px;\n box-shadow: 0 13px 25px 0 var(--vis-tooltip-box-shadow);\n border: solid 1px var(--vis-tooltip-border-color);\n background-color: var(--vis-tooltip-background-color);\n backdrop-filter: var(--vis-tooltip-backdrop-filter);\n`\n\nexport const positionFixed = css`\n bottom: unset;\n position: fixed;\n`\n\nexport const show = css`\n opacity: 1;\n`\n\nexport const hidden = css`\n display: none;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;;AAejB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;;;;;;;;;;;EAa7B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBzB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;;EAG/B;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,MAAM,GAAG,GAAG,CAAA,CAAA;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { ComponentDefaultConfig } from '../../core/component/config.js';
2
2
  import { MapProjection, MapPointLabelPosition } from './types.js';
3
3
 
4
- const TopoJSONMapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { projection: MapProjection.Kavrayskiy7(), duration: 1500, topojson: undefined, mapFeatureName: 'countries', mapFitToPoints: false, zoomExtent: [0.5, 6], zoomDuration: 400, disableZoom: false, zoomFactor: undefined, linkWidth: (d) => { var _a; return (_a = d['width']) !== null && _a !== void 0 ? _a : 1; }, linkColor: (d) => { var _a; return (_a = d['color']) !== null && _a !== void 0 ? _a : null; }, linkCursor: null, linkId: (d, i) => { var _a; return `${(_a = d['id']) !== null && _a !== void 0 ? _a : i}`; }, linkSource: (d) => d['source'], linkTarget: (d) => d['target'], areaId: (d) => { var _a; return (_a = d['id']) !== null && _a !== void 0 ? _a : ''; }, areaColor: (d) => { var _a; return (_a = d['color']) !== null && _a !== void 0 ? _a : null; }, areaCursor: null, longitude: (d) => d['longitude'], latitude: (d) => d['latitude'], pointColor: (d) => { var _a; return (_a = d['color']) !== null && _a !== void 0 ? _a : null; }, pointRadius: (d) => { var _a; return (_a = d['radius']) !== null && _a !== void 0 ? _a : 8; }, pointStrokeWidth: (d) => { var _a; return (_a = d['strokeWidth']) !== null && _a !== void 0 ? _a : 0; }, pointCursor: null, pointLabel: undefined, pointLabelPosition: MapPointLabelPosition.Bottom, pointLabelTextBrightnessRatio: 0.65, pointId: (d) => d['id'], heatmapMode: false, heatmapModeBlurStdDeviation: 8, heatmapModeZoomLevelThreshold: 2.5 });
4
+ const TopoJSONMapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { projection: MapProjection.Kavrayskiy7(), duration: 1500, topojson: undefined, mapFeatureName: 'countries', mapFitToPoints: false, zoomExtent: [0.5, 6], zoomDuration: 400, disableZoom: false, zoomFactor: undefined, linkWidth: (d) => { var _a; return (_a = d.width) !== null && _a !== void 0 ? _a : 1; }, linkColor: (d) => { var _a; return (_a = d.color) !== null && _a !== void 0 ? _a : null; }, linkCursor: null, linkId: (d, i) => { var _a; return `${(_a = d.id) !== null && _a !== void 0 ? _a : i}`; }, linkSource: (d) => d.source, linkTarget: (d) => d.target, areaId: (d) => { var _a; return (_a = d.id) !== null && _a !== void 0 ? _a : ''; }, areaColor: (d) => { var _a; return (_a = d.color) !== null && _a !== void 0 ? _a : null; }, areaCursor: null, longitude: (d) => d.longitude, latitude: (d) => d.latitude, pointColor: (d) => { var _a; return (_a = d.color) !== null && _a !== void 0 ? _a : null; }, pointRadius: (d) => { var _a; return (_a = d.radius) !== null && _a !== void 0 ? _a : 8; }, pointStrokeWidth: (d) => { var _a; return (_a = d.strokeWidth) !== null && _a !== void 0 ? _a : 0; }, pointCursor: null, pointLabel: undefined, pointLabelPosition: MapPointLabelPosition.Bottom, pointLabelTextBrightnessRatio: 0.65, pointId: (d) => d.id, heatmapMode: false, heatmapModeBlurStdDeviation: 8, heatmapModeZoomLevelThreshold: 2.5 });
5
5
 
6
6
  export { TopoJSONMapDefaultConfig };
7
7
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/topojson-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation */\nimport { GeoProjection } from 'd3-geo'\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { MapProjection, MapPointLabelPosition } from './types'\n\nexport interface TopoJSONMapConfigInterface<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentConfigInterface {\n // General\n /** MapProjection (aka D3's GeoProjection) instance. Default: `MapProjection.Kavrayskiy7()` */\n projection?: GeoProjection;\n /** Map data in the TopoJSON topology format. Default: `undefined` */\n topojson?: TopoJSON.Topology;\n /** Name of the map features to be displayed, e.g. 'countries' or 'counties'. Default: `countries` */\n mapFeatureName?: string;\n /** Set initial map fit to points instead of topojson features. Default: `false` */\n mapFitToPoints?: boolean;\n /** Initial zoom level. Default: `undefined` */\n zoomFactor?: number;\n /** Disable pan / zoom interactions. Default: `false` */\n disableZoom?: boolean;\n /** Zoom extent. Default: `[0.5, 6]` */\n zoomExtent?: number[];\n /** Zoom animation duration. Default: `400` */\n zoomDuration?: number;\n\n /** Link width value or accessor function. Default: `d => d.width ?? 1` */\n linkWidth?: NumericAccessor<LinkDatum>;\n /** Link color value or accessor function. Default: `d => d.color ?? null` */\n linkColor?: ColorAccessor<LinkDatum>;\n /** Link cursor value or accessor function. Default: `null` */\n linkCursor?: StringAccessor<LinkDatum>;\n /** Link id accessor function. Default: `d => d.id` */\n linkId?: StringAccessor<LinkDatum>;\n /** Link source accessor function. Default: `d => d.source` */\n linkSource?: ((l: LinkDatum) => number | string | PointDatum);\n /** Link target accessor function. Default: `d => d.target` */\n linkTarget?: ((l: LinkDatum) => number | string | PointDatum);\n\n /** Area id accessor function corresponding to the feature id from TopoJSON. Default: `d => d.id ?? ''` */\n areaId?: StringAccessor<AreaDatum>;\n /** Area color value or accessor function. Default: `d => d.color ?? null` */\n areaColor?: ColorAccessor<AreaDatum>;\n /** Area cursor value or accessor function. Default: `null` */\n areaCursor?: StringAccessor<AreaDatum>;\n\n /** Point color accessor. Default: `d => d.color ?? null` */\n pointColor?: ColorAccessor<PointDatum>;\n /** Point radius accessor. Default: `d => d.radius ?? 8` */\n pointRadius?: NumericAccessor<PointDatum>;\n /** Point stroke width accessor. Default: `d => d.strokeWidth ?? null` */\n pointStrokeWidth?: NumericAccessor<PointDatum>;\n /** Point cursor constant value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<PointDatum>;\n /** Point longitude accessor function. Default: `d => d.longitude ?? null` */\n longitude?: NumericAccessor<PointDatum>;\n /** Point latitude accessor function. Default: `d => d.latitude ?? null` */\n latitude?: NumericAccessor<PointDatum>;\n /** Point label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<PointDatum>;\n /** Point label position. Default: `Position.Bottom` */\n pointLabelPosition?: MapPointLabelPosition;\n /** Point color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n pointLabelTextBrightnessRatio?: number;\n /** Point id accessor function. Default: `d => d.id` */\n pointId?: ((d: PointDatum, i: number) => string);\n\n /** Enables blur and blending between neighbouring points. Default: `false` */\n heatmapMode?: boolean;\n /** Heatmap blur filter stdDeviation value. Default: `10` */\n heatmapModeBlurStdDeviation?: number;\n /** Zoom level at which the heatmap mode will be disabled. Default: `2.5` */\n heatmapModeZoomLevelThreshold?: number;\n}\n\nexport const TopoJSONMapDefaultConfig: TopoJSONMapConfigInterface<unknown, unknown, unknown> = {\n ...ComponentDefaultConfig,\n projection: MapProjection.Kavrayskiy7(),\n duration: 1500,\n topojson: undefined,\n mapFeatureName: 'countries',\n mapFitToPoints: false,\n\n zoomExtent: [0.5, 6],\n zoomDuration: 400,\n disableZoom: false,\n zoomFactor: undefined,\n\n linkWidth: <LinkDatum>(d: LinkDatum): number => d['width'] ?? 1,\n linkColor: <LinkDatum>(d: LinkDatum): string => d['color'] ?? null,\n linkCursor: null,\n linkId: <LinkDatum>(d: LinkDatum, i: number | undefined): string => `${d['id'] ?? i}`,\n linkSource: <LinkDatum>(d: LinkDatum): (number | string | unknown) => d['source'],\n linkTarget: <LinkDatum>(d: LinkDatum): (number | string | unknown) => d['target'],\n\n areaId: <AreaDatum>(d: AreaDatum): string => d['id'] ?? '',\n areaColor: <AreaDatum>(d: AreaDatum): string => d['color'] ?? null,\n areaCursor: null,\n\n longitude: <PointDatum>(d: PointDatum): number => d['longitude'],\n latitude: <PointDatum>(d: PointDatum): number => d['latitude'],\n pointColor: <PointDatum>(d: PointDatum): string => d['color'] ?? null,\n pointRadius: <PointDatum>(d: PointDatum): number => d['radius'] ?? 8,\n pointStrokeWidth: <PointDatum>(d: PointDatum): number => d['strokeWidth'] ?? 0,\n pointCursor: null,\n pointLabel: undefined,\n pointLabelPosition: MapPointLabelPosition.Bottom,\n pointLabelTextBrightnessRatio: 0.65,\n pointId: <PointDatum>(d: PointDatum): string => d['id'],\n\n heatmapMode: false,\n heatmapModeBlurStdDeviation: 8,\n heatmapModeZoomLevelThreshold: 2.5,\n}\n\n"],"names":[],"mappings":";;;AAkFO,MAAM,wBAAwB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAChC,sBAAsB,CACzB,EAAA,EAAA,UAAU,EAAE,aAAa,CAAC,WAAW,EAAE,EACvC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,SAAS,EACnB,cAAc,EAAE,WAAW,EAC3B,cAAc,EAAE,KAAK,EAErB,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EACpB,YAAY,EAAE,GAAG,EACjB,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,SAAS,EAErB,SAAS,EAAE,CAAY,CAAY,KAAa,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,OAAO,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAC,CAAA,EAAA,EAC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AAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,IAAI,CAAA,EAAA,EACrE,WAAW,EAAE,CAAa,CAAa,KAAY,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,QAAQ,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,EAAA,EACpE,gBAAgB,EAAE,CAAa,CAAa,KAAY,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,aAAa,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,EAAA,EAC9E,WAAW,EAAE,IAAI,EACjB,UAAU,EAAE,SAAS,EACrB,kBAAkB,EAAE,qBAAqB,CAAC,MAAM,EAChD,6BAA6B,EAAE,IAAI,EACnC,OAAO,EAAE,CAAa,CAAa,KAAa,CAAC,CAAC,IAAI,CAAC,EAEvD,WAAW,EAAE,KAAK,EAClB,2BAA2B,EAAE,CAAC,EAC9B,6BAA6B,EAAE,GAAG;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/topojson-map/config.ts"],"sourcesContent":["import { GeoProjection } from 'd3-geo'\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { MapProjection, MapPointLabelPosition } from './types'\n\nexport interface TopoJSONMapConfigInterface<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentConfigInterface {\n // General\n /** MapProjection (aka D3's GeoProjection) instance. Default: `MapProjection.Kavrayskiy7()` */\n projection?: GeoProjection;\n /** Map data in the TopoJSON topology format. Default: `undefined` */\n topojson?: TopoJSON.Topology;\n /** Name of the map features to be displayed, e.g. 'countries' or 'counties'. Default: `countries` */\n mapFeatureName?: string;\n /** Set initial map fit to points instead of topojson features. Default: `false` */\n mapFitToPoints?: boolean;\n /** Initial zoom level. Default: `undefined` */\n zoomFactor?: number;\n /** Disable pan / zoom interactions. Default: `false` */\n disableZoom?: boolean;\n /** Zoom extent. Default: `[0.5, 6]` */\n zoomExtent?: number[];\n /** Zoom animation duration. Default: `400` */\n zoomDuration?: number;\n\n /** Link width value or accessor function. Default: `d => d.width ?? 1` */\n linkWidth?: NumericAccessor<LinkDatum>;\n /** Link color value or accessor function. Default: `d => d.color ?? null` */\n linkColor?: ColorAccessor<LinkDatum>;\n /** Link cursor value or accessor function. Default: `null` */\n linkCursor?: StringAccessor<LinkDatum>;\n /** Link id accessor function. Default: `d => d.id` */\n linkId?: StringAccessor<LinkDatum>;\n /** Link source accessor function. Default: `d => d.source` */\n linkSource?: ((l: LinkDatum) => number | string | PointDatum);\n /** Link target accessor function. Default: `d => d.target` */\n linkTarget?: ((l: LinkDatum) => number | string | PointDatum);\n\n /** Area id accessor function corresponding to the feature id from TopoJSON. Default: `d => d.id ?? ''` */\n areaId?: StringAccessor<AreaDatum>;\n /** Area color value or accessor function. Default: `d => d.color ?? null` */\n areaColor?: ColorAccessor<AreaDatum>;\n /** Area cursor value or accessor function. Default: `null` */\n areaCursor?: StringAccessor<AreaDatum>;\n\n /** Point color accessor. Default: `d => d.color ?? null` */\n pointColor?: ColorAccessor<PointDatum>;\n /** Point radius accessor. Default: `d => d.radius ?? 8` */\n pointRadius?: NumericAccessor<PointDatum>;\n /** Point stroke width accessor. Default: `d => d.strokeWidth ?? null` */\n pointStrokeWidth?: NumericAccessor<PointDatum>;\n /** Point cursor constant value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<PointDatum>;\n /** Point longitude accessor function. Default: `d => d.longitude ?? null` */\n longitude?: NumericAccessor<PointDatum>;\n /** Point latitude accessor function. Default: `d => d.latitude ?? null` */\n latitude?: NumericAccessor<PointDatum>;\n /** Point label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<PointDatum>;\n /** Point label position. Default: `Position.Bottom` */\n pointLabelPosition?: MapPointLabelPosition;\n /** Point color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n pointLabelTextBrightnessRatio?: number;\n /** Point id accessor function. Default: `d => d.id` */\n pointId?: ((d: PointDatum, i: number) => string);\n\n /** Enables blur and blending between neighbouring points. Default: `false` */\n heatmapMode?: boolean;\n /** Heatmap blur filter stdDeviation value. Default: `10` */\n heatmapModeBlurStdDeviation?: number;\n /** Zoom level at which the heatmap mode will be disabled. Default: `2.5` */\n heatmapModeZoomLevelThreshold?: number;\n}\n\nexport const TopoJSONMapDefaultConfig: TopoJSONMapConfigInterface<unknown, unknown, unknown> = {\n ...ComponentDefaultConfig,\n projection: MapProjection.Kavrayskiy7(),\n duration: 1500,\n topojson: undefined,\n mapFeatureName: 'countries',\n mapFitToPoints: false,\n\n zoomExtent: [0.5, 6],\n zoomDuration: 400,\n disableZoom: false,\n zoomFactor: undefined,\n\n linkWidth: (d: unknown): number => (d as { width: number }).width ?? 1,\n linkColor: (d: unknown): string => (d as { color: string }).color ?? null,\n linkCursor: null,\n linkId: (d: unknown, i: number | undefined): string => `${(d as { id: string }).id ?? i}`,\n linkSource: (d: unknown): (number | string | unknown) => (d as { source: string }).source,\n linkTarget: (d: unknown): (number | string | unknown) => (d as { target: string }).target,\n\n areaId: (d: unknown): string => (d as { id: string }).id ?? '',\n areaColor: (d: unknown): string => (d as { color: string }).color ?? null,\n areaCursor: null,\n\n longitude: (d: unknown): number => (d as { longitude: number }).longitude,\n latitude: (d: unknown): number => (d as { latitude: number }).latitude,\n pointColor: (d: unknown): string => (d as { color: string }).color ?? null,\n pointRadius: (d: unknown): number => (d as { radius: number }).radius ?? 8,\n pointStrokeWidth: (d: unknown): number => (d as { strokeWidth: number }).strokeWidth ?? 0,\n pointCursor: null,\n pointLabel: undefined,\n pointLabelPosition: MapPointLabelPosition.Bottom,\n pointLabelTextBrightnessRatio: 0.65,\n pointId: (d: unknown): string => (d as { id: string }).id,\n\n heatmap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
- geometries: [],
263
262
  };
264
263
  this._projection.fitExtent([
265
264
  [this._width * pad, this._height * pad],
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { D3ZoomEvent, zoom, ZoomBehavior, zoomIdentity, ZoomTransform } from 'd3-zoom'\nimport { timeout } from 'd3-timer'\nimport { geoPath, GeoProjection } from 'd3-geo'\nimport { color } from 'd3-color'\nimport { feature } from 'topojson-client'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { MapGraphDataModel } from 'data-models/map-graph'\n\n// Utils\nimport { clamp, getNumber, getString, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\n\n// Types\nimport { MapLink } from 'types/map'\n\n// Local Types\nimport { MapData, MapFeature, MapPointLabelPosition } from './types'\n\n// Config\nimport { TopoJSONMapDefaultConfig, TopoJSONMapConfigInterface } from './config'\n\n// Modules\nimport { arc, getLonLat } from './utils'\n\n// Styles\nimport * as s from './style'\n\nexport class TopoJSONMap<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentCore<\n MapData<AreaDatum, PointDatum, LinkDatum>,\n TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n > {\n static selectors = s\n protected _defaultConfig = TopoJSONMapDefaultConfig as TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n public config: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> = this._defaultConfig\n\n datamodel: MapGraphDataModel<AreaDatum, PointDatum, LinkDatum> = new MapGraphDataModel()\n g: Selection<SVGGElement, unknown, null, undefined>\n private _firstRender = true\n private _isResizing = false\n private _initialScale: number = undefined\n private _center: [number, number]\n private _currentZoomLevel: number = undefined\n private _transform: ZoomTransform\n private _path = geoPath()\n private _projection: GeoProjection\n private _prevWidth: number\n private _prevHeight: number\n private _animFrameId: number\n\n private _featureCollection: GeoJSON.FeatureCollection\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown> = zoom()\n private _backgroundRect = this.g.append('rect').attr('class', s.background)\n private _featuresGroup = this.g.append('g').attr('class', s.features)\n private _linksGroup = this.g.append('g').attr('class', s.links)\n private _pointsGroup = this.g.append('g').attr('class', s.points)\n\n events = {\n [TopoJSONMap.selectors.point]: {},\n [TopoJSONMap.selectors.feature]: {},\n }\n\n constructor (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>, data?: MapData<AreaDatum, PointDatum, LinkDatum>) {\n super()\n this._zoomBehavior.on('zoom', this._onZoom.bind(this))\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n\n this.g.append('defs')\n .append('filter')\n .attr('id', 'heatmapFilter')\n .html(`\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"${this.config.heatmapModeBlurStdDeviation}\" color-interpolation-filters=\"sRGB\" result=\"blur\"></feGaussianBlur>\n <feColorMatrix class=\"blurValues\" in=\"blur\" mode=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -4\"></feColorMatrix>\n `)\n }\n\n setData (data: MapData<AreaDatum, PointDatum, LinkDatum>): void {\n const { config } = this\n\n this.datamodel.pointId = config.pointId\n this.datamodel.linkSource = config.linkSource\n this.datamodel.linkTarget = config.linkTarget\n this.datamodel.data = data\n }\n\n setConfig (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>): void {\n super.setConfig(config)\n\n const newProjection = this.config.projection\n if (this._projection) {\n newProjection.scale(this._projection.scale()).translate(this._projection.translate())\n }\n this._projection = newProjection\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this._renderBackground()\n this._renderMap(duration)\n this._renderGroups(duration)\n this._renderLinks(duration)\n this._renderPoints(duration)\n\n // When animation is running we need to temporary disable zoom behaviour\n if (duration && !config.disableZoom) {\n this.g.on('.zoom', null)\n timeout(() => {\n this.g.call(this._zoomBehavior)\n }, duration)\n }\n\n // When zoom behaviour is active we assign the `draggable` class to show the grabbing cursor\n this.g.classed('draggable', !config.disableZoom)\n this._firstRender = false\n }\n\n _renderBackground (): void {\n this._backgroundRect\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('transform', `translate(${-this.bleed.left}, ${-this.bleed.top})`)\n }\n\n _renderGroups (duration: number): void {\n const transformString = this._transform.toString()\n smartTransition(this._featuresGroup, duration)\n .attr('transform', transformString)\n .attr('stroke-width', 1 / this._currentZoomLevel)\n\n smartTransition(this._linksGroup, duration)\n .attr('transform', transformString)\n\n smartTransition(this._pointsGroup, duration)\n .attr('transform', transformString)\n }\n\n _renderMap (duration: number): void {\n const { bleed, config, datamodel } = this\n\n this.g.attr('transform', `translate(${bleed.left}, ${bleed.top})`)\n const mapData: TopoJSON.Topology = config.topojson\n const featureName = config.mapFeatureName\n const featureObject = mapData?.objects?.[featureName]\n if (!featureObject) return\n\n this._featureCollection = feature(mapData, featureObject) as GeoJSON.FeatureCollection\n const featureData = (this._featureCollection?.features ?? []) as MapFeature<AreaDatum>[]\n\n if (this._firstRender) {\n // Rendering the map for the first time.\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = this._projection.translate()\n\n if (config.mapFitToPoints) {\n this._fitToPoints()\n }\n\n const zoomExtent = config.zoomExtent\n this._zoomBehavior.scaleExtent([zoomExtent[0] * this._initialScale, zoomExtent[1] * this._initialScale])\n this.setZoom(config.zoomFactor || 1)\n\n if (!config.disableZoom) {\n this.g.call(this._zoomBehavior)\n this._applyZoom()\n }\n\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n if (this._prevWidth !== this._width || this._prevHeight !== this._height) {\n this._onResize()\n }\n\n this._path.projection(this._projection)\n\n // Merge passed area data and map feature data\n const areaData = datamodel.areas\n areaData.forEach(a => {\n const feature = featureData.find(f => f.id.toString() === getString(a, config.areaId).toString())\n if (feature) feature.data = a\n else if (this._firstRender) console.warn(`Can't find feature by area code ${getString(a, config.areaId)}`)\n })\n\n const features = this._featuresGroup\n .selectAll<SVGPathElement, unknown>(`.${s.feature}`)\n .data(featureData)\n\n const featuresEnter = features.enter().append('path').attr('class', s.feature)\n smartTransition(featuresEnter.merge(features), duration)\n .attr('d', this._path)\n .style('fill', (d, i) => d.data ? getColor(d.data, config.areaColor, i) : null)\n .style('cursor', d => d.data ? getString(d.data, config.areaCursor) : null)\n features.exit().remove()\n }\n\n _renderLinks (duration: number): void {\n const { config, datamodel } = this\n const links = datamodel.links\n\n const edges = this._linksGroup\n .selectAll<SVGPathElement, MapLink<PointDatum, LinkDatum>>(`.${s.link}`)\n .data(links, (d, i) => getString(d, config.linkId, i))\n\n const edgesEnter = edges.enter().append('path').attr('class', s.link)\n .style('stroke-width', 0)\n\n smartTransition(edgesEnter.merge(edges), duration)\n .attr('d', link => {\n const source = this._projection(getLonLat(link.source, config.longitude, config.latitude))\n const target = this._projection(getLonLat(link.target, config.longitude, config.latitude))\n return arc(source, target)\n })\n .style('stroke-width', link => getNumber(link, config.linkWidth) / this._currentZoomLevel)\n .style('cursor', link => getString(link, config.linkCursor))\n .style('stroke', (link, i) => getColor(link, config.linkColor, i))\n edges.exit().remove()\n }\n\n _renderPoints (duration: number): void {\n const { config, datamodel } = this\n const pointData = datamodel.points\n\n const points = this._pointsGroup\n .selectAll<SVGGElement, PointDatum>(`.${s.point}`)\n .data(pointData, (d, i) => getString(d, config.pointId, i))\n\n // Enter\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n\n pointsEnter.append('circle').attr('class', s.pointCircle)\n .attr('r', 0)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth))\n\n pointsEnter.append('text').attr('class', s.pointLabel)\n .style('opacity', 0)\n\n // Update\n const pointsMerged = pointsEnter.merge(points)\n smartTransition(pointsMerged, duration)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n .style('cursor', d => getString(d, config.pointCursor))\n\n smartTransition(pointsMerged.select(`.${s.pointCircle}`), duration)\n .attr('r', d => getNumber(d, config.pointRadius) / this._currentZoomLevel)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth) / this._currentZoomLevel)\n\n const pointLabelsMerged = pointsMerged.select(`.${s.pointLabel}`)\n pointLabelsMerged\n .text(d => getString(d, config.pointLabel) ?? '')\n .style('font-size', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) {\n return `calc(var(--vis-map-point-label-font-size) / ${this._currentZoomLevel}`\n }\n const pointDiameter = 2 * getNumber(d, config.pointRadius)\n const pointLabelText = getString(d, config.pointLabel) || ''\n const textLength = pointLabelText.length\n const fontSize = 0.5 * pointDiameter / Math.pow(textLength, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n .attr('y', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Center) return null\n\n const pointRadius = getNumber(d, config.pointRadius) / this._currentZoomLevel\n return pointRadius\n })\n .attr('dy', config.pointLabelPosition === MapPointLabelPosition.Center ? '0.32em' : '1em')\n\n smartTransition(pointLabelsMerged, duration)\n .style('fill', (d, i) => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) return null\n\n const pointColor = getColor(d, config.pointColor, i)\n const hex = color(isStringCSSVariable(pointColor) ? getCSSVariableValue(pointColor, this.element) : pointColor)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > config.pointLabelTextBrightnessRatio ? 'var(--vis-map-point-label-text-color-dark)' : 'var(--vis-map-point-label-text-color-light)'\n })\n .style('opacity', 1)\n\n // Exit\n points.exit().remove()\n\n // Heatmap\n this._pointsGroup.style('filter', (config.heatmapMode && this._currentZoomLevel < config.heatmapModeZoomLevelThreshold) ? 'url(#heatmapFilter)' : null)\n this._pointsGroup.selectAll(`.${s.pointLabel}`).style('display', (config.heatmapMode && (this._currentZoomLevel < config.heatmapModeZoomLevelThreshold)) ? 'none' : null)\n }\n\n _fitToPoints (points?: PointDatum[], pad = 0.1): void {\n const { config, datamodel } = this\n const pointData = points || datamodel.points\n if (pointData.length === 0) return\n\n const featureCollection = {\n type: 'FeatureCollection',\n features: [{\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'MultiPoint',\n coordinates: pointData.map(p => {\n return [\n getNumber(p, d => getNumber(d, config.longitude)),\n getNumber(p, d => getNumber(d, config.latitude)),\n ]\n }),\n },\n }],\n geometries: [],\n }\n\n this._projection.fitExtent([\n [this._width * pad, this._height * pad],\n [this._width * (1 - pad), this._height * (1 - pad)],\n ], featureCollection)\n\n const maxScale = config.zoomExtent[1] * this._initialScale\n if (this._projection.scale() > maxScale) this._projection.scale(maxScale)\n\n this._applyZoom()\n }\n\n _applyZoom (): void {\n const translate = this._center ?? this._projection.translate()\n const scale = this._initialScale * this._currentZoomLevel\n this.g.call(this._zoomBehavior.transform, zoomIdentity.translate(translate[0], translate[1]).scale(scale))\n }\n\n _onResize (): void {\n this._isResizing = true\n const prevTranslate = this._projection.translate()\n\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = [\n this._projection.translate()[0] * this._center[0] / prevTranslate[0],\n this._projection.translate()[1] * this._center[1] / prevTranslate[1],\n ]\n this._applyZoom()\n\n this._isResizing = false\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n _onZoom (event: D3ZoomEvent<any, any>): void {\n if (this._firstRender) return // To prevent double render because of binding zoom behaviour\n const isMouseEvent = event.sourceEvent !== undefined\n const isExternalEvent = !event?.sourceEvent && !this._isResizing\n\n window.cancelAnimationFrame(this._animFrameId)\n this._animFrameId = window.requestAnimationFrame(this._onZoomHandler.bind(this, event.transform, isMouseEvent, isExternalEvent))\n\n if (isMouseEvent) {\n // Update the center coordinate so that the next call to _applyZoom()\n // will zoom with respect to the current view\n this._center = [event.transform.x, event.transform.y]\n }\n this._currentZoomLevel = (event?.transform.k / this._initialScale) || 1\n }\n\n _onZoomHandler (transform: ZoomTransform, isMouseEvent: boolean, isExternalEvent: boolean): void {\n const scale = transform.k / this._initialScale || 1\n const center = this._projection.translate()\n\n this._transform = zoomIdentity\n .translate(transform.x - center[0] * scale, transform.y - center[1] * scale)\n .scale(scale)\n\n const customDuration = isExternalEvent\n ? this.config.zoomDuration\n : (isMouseEvent ? 0 : null)\n\n // Call render functions that depend on this._transform\n this._renderGroups(customDuration)\n this._renderLinks(customDuration)\n this._renderPoints(customDuration)\n }\n\n public zoomIn (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel + increment)\n }\n\n public zoomOut (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const { config } = this\n this._currentZoomLevel = clamp(zoomLevel, config.zoomExtent[0], config.zoomExtent[1])\n this._transform = zoomIdentity\n .translate(this._center[0] * (1 - this._currentZoomLevel), this._center[1] * (1 - this._currentZoomLevel))\n .scale(this._currentZoomLevel)\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n public fitView (): void {\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._currentZoomLevel = (this._projection?.scale() / this._initialScale) || 1\n this._center = this._projection.translate()\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n destroy (): void {\n window.cancelAnimationFrame(this._animFrameId)\n }\n}\n"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,CAAC,CAAC,CAAC,CAAC,CAAA;QACrF,IAAI,CAAC,UAAU,GAAG,YAAY;AAC3B,aAAA,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACzG,aAAA,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;;;;QAIhC,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAEM,OAAO,GAAA;;QACZ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAC1F,QAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,EAAE,IAAG,IAAI,CAAC,aAAa,KAAK,CAAC,CAAA;QAC9E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAA;;;;QAI3C,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAED,OAAO,GAAA;AACL,QAAA,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;KAC/C;;AA3YM,WAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { D3ZoomEvent, zoom, ZoomBehavior, zoomIdentity, ZoomTransform } from 'd3-zoom'\nimport { timeout } from 'd3-timer'\nimport { geoPath, GeoProjection, ExtendedFeatureCollection } from 'd3-geo'\nimport { color } from 'd3-color'\nimport { feature } from 'topojson-client'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { MapGraphDataModel } from 'data-models/map-graph'\n\n// Utils\nimport { clamp, getNumber, getString, isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor, hexToBrightness } from 'utils/color'\nimport { getCSSVariableValue, isStringCSSVariable } from 'utils/misc'\n\n// Types\nimport { MapLink } from 'types/map'\n\n// Local Types\nimport { MapData, MapFeature, MapPointLabelPosition } from './types'\n\n// Config\nimport { TopoJSONMapDefaultConfig, TopoJSONMapConfigInterface } from './config'\n\n// Modules\nimport { arc, getLonLat } from './utils'\n\n// Styles\nimport * as s from './style'\n\nexport class TopoJSONMap<\n AreaDatum,\n PointDatum = unknown,\n LinkDatum = unknown,\n> extends ComponentCore<\n MapData<AreaDatum, PointDatum, LinkDatum>,\n TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n > {\n static selectors = s\n protected _defaultConfig = TopoJSONMapDefaultConfig as TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>\n public config: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> = this._defaultConfig\n\n datamodel: MapGraphDataModel<AreaDatum, PointDatum, LinkDatum> = new MapGraphDataModel()\n g: Selection<SVGGElement, unknown, null, undefined>\n private _firstRender = true\n private _isResizing = false\n private _initialScale: number = undefined\n private _center: [number, number]\n private _currentZoomLevel: number = undefined\n private _transform: ZoomTransform\n private _path = geoPath()\n private _projection: GeoProjection\n private _prevWidth: number\n private _prevHeight: number\n private _animFrameId: number\n\n private _featureCollection: GeoJSON.FeatureCollection\n private _zoomBehavior: ZoomBehavior<SVGGElement, unknown> = zoom()\n private _backgroundRect = this.g.append('rect').attr('class', s.background)\n private _featuresGroup = this.g.append('g').attr('class', s.features)\n private _linksGroup = this.g.append('g').attr('class', s.links)\n private _pointsGroup = this.g.append('g').attr('class', s.points)\n\n events = {\n [TopoJSONMap.selectors.point]: {},\n [TopoJSONMap.selectors.feature]: {},\n }\n\n constructor (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>, data?: MapData<AreaDatum, PointDatum, LinkDatum>) {\n super()\n this._zoomBehavior.on('zoom', this._onZoom.bind(this))\n\n if (config) this.setConfig(config)\n if (data) this.setData(data)\n\n this.g.append('defs')\n .append('filter')\n .attr('id', 'heatmapFilter')\n .html(`\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"${this.config.heatmapModeBlurStdDeviation}\" color-interpolation-filters=\"sRGB\" result=\"blur\"></feGaussianBlur>\n <feColorMatrix class=\"blurValues\" in=\"blur\" mode=\"matrix\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -4\"></feColorMatrix>\n `)\n }\n\n setData (data: MapData<AreaDatum, PointDatum, LinkDatum>): void {\n const { config } = this\n\n this.datamodel.pointId = config.pointId\n this.datamodel.linkSource = config.linkSource\n this.datamodel.linkTarget = config.linkTarget\n this.datamodel.data = data\n }\n\n setConfig (config?: TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum>): void {\n super.setConfig(config)\n\n const newProjection = this.config.projection\n if (this._projection) {\n newProjection.scale(this._projection.scale()).translate(this._projection.translate())\n }\n this._projection = newProjection\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n this._renderBackground()\n this._renderMap(duration)\n this._renderGroups(duration)\n this._renderLinks(duration)\n this._renderPoints(duration)\n\n // When animation is running we need to temporary disable zoom behaviour\n if (duration && !config.disableZoom) {\n this.g.on('.zoom', null)\n timeout(() => {\n this.g.call(this._zoomBehavior)\n }, duration)\n }\n\n // When zoom behaviour is active we assign the `draggable` class to show the grabbing cursor\n this.g.classed('draggable', !config.disableZoom)\n this._firstRender = false\n }\n\n _renderBackground (): void {\n this._backgroundRect\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('transform', `translate(${-this.bleed.left}, ${-this.bleed.top})`)\n }\n\n _renderGroups (duration: number): void {\n const transformString = this._transform.toString()\n smartTransition(this._featuresGroup, duration)\n .attr('transform', transformString)\n .attr('stroke-width', 1 / this._currentZoomLevel)\n\n smartTransition(this._linksGroup, duration)\n .attr('transform', transformString)\n\n smartTransition(this._pointsGroup, duration)\n .attr('transform', transformString)\n }\n\n _renderMap (duration: number): void {\n const { bleed, config, datamodel } = this\n\n this.g.attr('transform', `translate(${bleed.left}, ${bleed.top})`)\n const mapData: TopoJSON.Topology = config.topojson\n const featureName = config.mapFeatureName\n const featureObject = mapData?.objects?.[featureName]\n if (!featureObject) return\n\n this._featureCollection = feature(mapData, featureObject) as GeoJSON.FeatureCollection\n const featureData = (this._featureCollection?.features ?? []) as MapFeature<AreaDatum>[]\n\n if (this._firstRender) {\n // Rendering the map for the first time.\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = this._projection.translate()\n\n if (config.mapFitToPoints) {\n this._fitToPoints()\n }\n\n const zoomExtent = config.zoomExtent\n this._zoomBehavior.scaleExtent([zoomExtent[0] * this._initialScale, zoomExtent[1] * this._initialScale])\n this.setZoom(config.zoomFactor || 1)\n\n if (!config.disableZoom) {\n this.g.call(this._zoomBehavior)\n this._applyZoom()\n }\n\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n if (this._prevWidth !== this._width || this._prevHeight !== this._height) {\n this._onResize()\n }\n\n this._path.projection(this._projection)\n\n // Merge passed area data and map feature data\n const areaData = datamodel.areas\n areaData.forEach(a => {\n const feature = featureData.find(f => f.id.toString() === getString(a, config.areaId).toString())\n if (feature) feature.data = a\n else if (this._firstRender) console.warn(`Can't find feature by area code ${getString(a, config.areaId)}`)\n })\n\n const features = this._featuresGroup\n .selectAll<SVGPathElement, unknown>(`.${s.feature}`)\n .data(featureData)\n\n const featuresEnter = features.enter().append('path').attr('class', s.feature)\n smartTransition(featuresEnter.merge(features), duration)\n .attr('d', this._path)\n .style('fill', (d, i) => d.data ? getColor(d.data, config.areaColor, i) : null)\n .style('cursor', d => d.data ? getString(d.data, config.areaCursor) : null)\n features.exit().remove()\n }\n\n _renderLinks (duration: number): void {\n const { config, datamodel } = this\n const links = datamodel.links\n\n const edges = this._linksGroup\n .selectAll<SVGPathElement, MapLink<PointDatum, LinkDatum>>(`.${s.link}`)\n .data(links, (d, i) => getString(d, config.linkId, i))\n\n const edgesEnter = edges.enter().append('path').attr('class', s.link)\n .style('stroke-width', 0)\n\n smartTransition(edgesEnter.merge(edges), duration)\n .attr('d', link => {\n const source = this._projection(getLonLat(link.source, config.longitude, config.latitude))\n const target = this._projection(getLonLat(link.target, config.longitude, config.latitude))\n return arc(source, target)\n })\n .style('stroke-width', link => getNumber(link, config.linkWidth) / this._currentZoomLevel)\n .style('cursor', link => getString(link, config.linkCursor))\n .style('stroke', (link, i) => getColor(link, config.linkColor, i))\n edges.exit().remove()\n }\n\n _renderPoints (duration: number): void {\n const { config, datamodel } = this\n const pointData = datamodel.points\n\n const points = this._pointsGroup\n .selectAll<SVGGElement, PointDatum>(`.${s.point}`)\n .data(pointData, (d, i) => getString(d, config.pointId, i))\n\n // Enter\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n\n pointsEnter.append('circle').attr('class', s.pointCircle)\n .attr('r', 0)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth))\n\n pointsEnter.append('text').attr('class', s.pointLabel)\n .style('opacity', 0)\n\n // Update\n const pointsMerged = pointsEnter.merge(points)\n smartTransition(pointsMerged, duration)\n .attr('transform', d => {\n const pos = this._projection(getLonLat(d, config.longitude, config.latitude))\n return `translate(${pos[0]},${pos[1]})`\n })\n .style('cursor', d => getString(d, config.pointCursor))\n\n smartTransition(pointsMerged.select(`.${s.pointCircle}`), duration)\n .attr('r', d => getNumber(d, config.pointRadius) / this._currentZoomLevel)\n .style('fill', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke', (d, i) => getColor(d, config.pointColor, i))\n .style('stroke-width', d => getNumber(d, config.pointStrokeWidth) / this._currentZoomLevel)\n\n const pointLabelsMerged = pointsMerged.select(`.${s.pointLabel}`)\n pointLabelsMerged\n .text(d => getString(d, config.pointLabel) ?? '')\n .style('font-size', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) {\n return `calc(var(--vis-map-point-label-font-size) / ${this._currentZoomLevel}`\n }\n const pointDiameter = 2 * getNumber(d, config.pointRadius)\n const pointLabelText = getString(d, config.pointLabel) || ''\n const textLength = pointLabelText.length\n const fontSize = 0.5 * pointDiameter / Math.pow(textLength, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n .attr('y', d => {\n if (config.pointLabelPosition === MapPointLabelPosition.Center) return null\n\n const pointRadius = getNumber(d, config.pointRadius) / this._currentZoomLevel\n return pointRadius\n })\n .attr('dy', config.pointLabelPosition === MapPointLabelPosition.Center ? '0.32em' : '1em')\n\n smartTransition(pointLabelsMerged, duration)\n .style('fill', (d, i) => {\n if (config.pointLabelPosition === MapPointLabelPosition.Bottom) return null\n\n const pointColor = getColor(d, config.pointColor, i)\n const hex = color(isStringCSSVariable(pointColor) ? getCSSVariableValue(pointColor, this.element) : pointColor)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > config.pointLabelTextBrightnessRatio ? 'var(--vis-map-point-label-text-color-dark)' : 'var(--vis-map-point-label-text-color-light)'\n })\n .style('opacity', 1)\n\n // Exit\n points.exit().remove()\n\n // Heatmap\n this._pointsGroup.style('filter', (config.heatmapMode && this._currentZoomLevel < config.heatmapModeZoomLevelThreshold) ? 'url(#heatmapFilter)' : null)\n this._pointsGroup.selectAll(`.${s.pointLabel}`).style('display', (config.heatmapMode && (this._currentZoomLevel < config.heatmapModeZoomLevelThreshold)) ? 'none' : null)\n }\n\n _fitToPoints (points?: PointDatum[], pad = 0.1): void {\n const { config, datamodel } = this\n const pointData = points || datamodel.points\n if (pointData.length === 0) return\n\n const featureCollection: ExtendedFeatureCollection = {\n type: 'FeatureCollection',\n features: [{\n type: 'Feature',\n properties: {},\n geometry: {\n type: 'MultiPoint',\n coordinates: pointData.map(p => {\n return [\n getNumber(p, d => getNumber(d, config.longitude)),\n getNumber(p, d => getNumber(d, config.latitude)),\n ]\n }),\n },\n }],\n }\n\n this._projection.fitExtent([\n [this._width * pad, this._height * pad],\n [this._width * (1 - pad), this._height * (1 - pad)],\n ], featureCollection)\n\n const maxScale = config.zoomExtent[1] * this._initialScale\n if (this._projection.scale() > maxScale) this._projection.scale(maxScale)\n\n this._applyZoom()\n }\n\n _applyZoom (): void {\n const translate = this._center ?? this._projection.translate()\n const scale = this._initialScale * this._currentZoomLevel\n this.g.call(this._zoomBehavior.transform, zoomIdentity.translate(translate[0], translate[1]).scale(scale))\n }\n\n _onResize (): void {\n this._isResizing = true\n const prevTranslate = this._projection.translate()\n\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._initialScale = this._projection.scale()\n this._center = [\n this._projection.translate()[0] * this._center[0] / prevTranslate[0],\n this._projection.translate()[1] * this._center[1] / prevTranslate[1],\n ]\n this._applyZoom()\n\n this._isResizing = false\n this._prevWidth = this._width\n this._prevHeight = this._height\n }\n\n _onZoom (event: D3ZoomEvent<any, any>): void {\n if (this._firstRender) return // To prevent double render because of binding zoom behaviour\n const isMouseEvent = event.sourceEvent !== undefined\n const isExternalEvent = !event?.sourceEvent && !this._isResizing\n\n window.cancelAnimationFrame(this._animFrameId)\n this._animFrameId = window.requestAnimationFrame(this._onZoomHandler.bind(this, event.transform, isMouseEvent, isExternalEvent))\n\n if (isMouseEvent) {\n // Update the center coordinate so that the next call to _applyZoom()\n // will zoom with respect to the current view\n this._center = [event.transform.x, event.transform.y]\n }\n this._currentZoomLevel = (event?.transform.k / this._initialScale) || 1\n }\n\n _onZoomHandler (transform: ZoomTransform, isMouseEvent: boolean, isExternalEvent: boolean): void {\n const scale = transform.k / this._initialScale || 1\n const center = this._projection.translate()\n\n this._transform = zoomIdentity\n .translate(transform.x - center[0] * scale, transform.y - center[1] * scale)\n .scale(scale)\n\n const customDuration = isExternalEvent\n ? this.config.zoomDuration\n : (isMouseEvent ? 0 : null)\n\n // Call render functions that depend on this._transform\n this._renderGroups(customDuration)\n this._renderLinks(customDuration)\n this._renderPoints(customDuration)\n }\n\n public zoomIn (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel + increment)\n }\n\n public zoomOut (increment = 0.5): void {\n this.setZoom(this._currentZoomLevel - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const { config } = this\n this._currentZoomLevel = clamp(zoomLevel, config.zoomExtent[0], config.zoomExtent[1])\n this._transform = zoomIdentity\n .translate(this._center[0] * (1 - this._currentZoomLevel), this._center[1] * (1 - this._currentZoomLevel))\n .scale(this._currentZoomLevel)\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n public fitView (): void {\n this._projection.fitExtent([[0, 0], [this._width, this._height]], this._featureCollection)\n this._currentZoomLevel = (this._projection?.scale() / this._initialScale) || 1\n this._center = this._projection.translate()\n // We are using this._applyZoom() instead of directly calling this._render(config.zoomDuration) because\n // we've to \"attach\" new transform to the map group element. Otherwise zoomBehavior will not know\n // that the zoom state has changed\n this._applyZoom()\n }\n\n destroy (): void {\n window.cancelAnimationFrame(this._animFrameId)\n }\n}\n"],"names":["s.background","s.features","s.links","s.points","s.feature","s.link","s.point","s.pointCircle","s.pointLabel","s"],"mappings":";;;;;;;;;;;;;;;;;AAgCM,MAAO,WAIX,SAAQ,aAGP,CAAA;IA+BD,WAAa,CAAA,MAAqE,EAAE,IAAgD,EAAA;AAClI,QAAA,KAAK,EAAE,CAAA;QA9BC,IAAc,CAAA,cAAA,GAAG,wBAAwF,CAAA;AAC5G,QAAA,IAAA,CAAA,MAAM,GAAiE,IAAI,CAAC,cAAc,CA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I,CAAC,UAAU,EAAE,CAAA;KAClB;IAEM,OAAO,GAAA;;QACZ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;AAC1F,QAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,EAAE,IAAG,IAAI,CAAC,aAAa,KAAK,CAAC,CAAA;QAC9E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAA;;;;QAI3C,IAAI,CAAC,UAAU,EAAE,CAAA;KAClB;IAED,OAAO,GAAA;AACL,QAAA,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;KAC/C;;AA1YM,WAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
@@ -2,9 +2,7 @@ import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
2
2
  import { XYLabelPositioning } from './types.js';
3
3
 
4
4
  // Core
5
- const XYLabelsDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), {
6
- // eslint-disable-next-line dot-notation
7
- color: (d) => d['color'], y: undefined, xPositioning: XYLabelPositioning.DataSpace, yPositioning: XYLabelPositioning.DataSpace, labelFontSize: undefined, label: undefined, backgroundColor: undefined, cursor: null, labelTextBrightnessRatio: 0.65, clustering: true, clusterLabel: (records) => records.length.toString(), clusterFontSize: undefined, clusterBackgroundColor: undefined, clusterCursor: undefined, clusterLabelColor: null });
5
+ const XYLabelsDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { color: (d) => d.color, y: undefined, xPositioning: XYLabelPositioning.DataSpace, yPositioning: XYLabelPositioning.DataSpace, labelFontSize: undefined, label: undefined, backgroundColor: undefined, cursor: null, labelTextBrightnessRatio: 0.65, clustering: true, clusterLabel: (records) => records.length.toString(), clusterFontSize: undefined, clusterBackgroundColor: undefined, clusterCursor: undefined, clusterLabelColor: null });
8
6
 
9
7
  export { XYLabelsDefaultConfig };
10
8
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/xy-labels/config.ts"],"sourcesContent":["// Core\nimport { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { XYLabel, XYLabelPositioning } from './types'\n\nexport interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Label color accessor function. Default: `d => d.color` */\n color?: ColorAccessor<Datum>;\n /** Single Y accessor function. Default: `undefined` */\n y: NumericAccessor<Datum>;\n /** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n xPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Defines how to position the label vertically: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n yPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Font size accessor function or constant value in pixels. If not provided, the value of CSS variable `--vis-xy-label-font-size` will be used. Default: `undefined` */\n labelFontSize?: NumericAccessor<Datum>;\n /** Label accessor function or string. Default: `undefined` */\n label?: StringAccessor<Datum>;\n /** Label color. Default: `undefined` */\n backgroundColor?: ColorAccessor<Datum>;\n /** Optional label cursor. Default: `null` */\n cursor?: StringAccessor<Datum>;\n /** Label color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n labelTextBrightnessRatio?: number;\n /** Enable label clustering. Default: `true` */\n clustering?: boolean;\n /** Label accessor for clusters. Default: `undefined` */\n clusterLabel?: StringAccessor<XYLabel<Datum>[]>;\n /** Font size accessor for clusters, the value is in pixels. If not provided, the value of CSS variable `--vis-xy-label-cluster-font-size` will be used. Default: `undefined` */\n clusterFontSize?: NumericAccessor<XYLabel<Datum>[]>;\n /** Background color accessor for clusters. Default: `undefined` */\n clusterBackgroundColor?: ColorAccessor<XYLabel<Datum>[]>;\n /** Optional cluster cursor. Default: `null` */\n clusterCursor?: StringAccessor<XYLabel<Datum>[]>;\n /** Cluster label color accessor function. Default: `null` */\n clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;\n}\nexport const XYLabelsDefaultConfig: XYLabelsConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n // eslint-disable-next-line dot-notation\n color: (d: unknown): string => d['color'],\n y: undefined,\n xPositioning: XYLabelPositioning.DataSpace,\n yPositioning: XYLabelPositioning.DataSpace,\n labelFontSize: undefined,\n label: undefined,\n backgroundColor: undefined,\n cursor: null,\n labelTextBrightnessRatio: 0.65,\n\n clustering: true,\n clusterLabel: <Datum>(records: XYLabel<Datum>[]): string => records.length.toString(),\n clusterFontSize: undefined,\n clusterBackgroundColor: undefined,\n clusterCursor: undefined,\n clusterLabelColor: null,\n}\n\n"],"names":[],"mappings":";;;AAAA;AAyCO,MAAM,qBAAqB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC7B,wBAAwB,CAAA,EAAA;;AAE3B,IAAA,KAAK,EAAE,CAAC,CAAU,KAAa,CAAC,CAAC,OAAO,CAAC,EACzC,CAAC,EAAE,SAAS,EACZ,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,aAAa,EAAE,SAAS,EACxB,KAAK,EAAE,SAAS,EAChB,eAAe,EAAE,SAAS,EAC1B,MAAM,EAAE,IAAI,EACZ,wBAAwB,EAAE,IAAI,EAE9B,UAAU,EAAE,IAAI,EAChB,YAAY,EAAE,CAAQ,OAAyB,KAAa,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EACrF,eAAe,EAAE,SAAS,EAC1B,sBAAsB,EAAE,SAAS,EACjC,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,IAAI;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/xy-labels/config.ts"],"sourcesContent":["// Core\nimport { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\n// Local Types\nimport { XYLabel, XYLabelPositioning } from './types'\n\nexport interface XYLabelsConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Label color accessor function. Default: `d => d.color` */\n color?: ColorAccessor<Datum>;\n /** Single Y accessor function. Default: `undefined` */\n y: NumericAccessor<Datum>;\n /** Defines how to position the label horizontally: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n xPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Defines how to position the label vertically: in data space or in screen space. Default: `XYLabelPositioning.DataSpace` */\n yPositioning?: GenericAccessor<XYLabelPositioning | string, Datum>;\n /** Font size accessor function or constant value in pixels. If not provided, the value of CSS variable `--vis-xy-label-font-size` will be used. Default: `undefined` */\n labelFontSize?: NumericAccessor<Datum>;\n /** Label accessor function or string. Default: `undefined` */\n label?: StringAccessor<Datum>;\n /** Label color. Default: `undefined` */\n backgroundColor?: ColorAccessor<Datum>;\n /** Optional label cursor. Default: `null` */\n cursor?: StringAccessor<Datum>;\n /** Label color brightness ratio for switching between dark and light text label color. Default: `0.65` */\n labelTextBrightnessRatio?: number;\n /** Enable label clustering. Default: `true` */\n clustering?: boolean;\n /** Label accessor for clusters. Default: `undefined` */\n clusterLabel?: StringAccessor<XYLabel<Datum>[]>;\n /** Font size accessor for clusters, the value is in pixels. If not provided, the value of CSS variable `--vis-xy-label-cluster-font-size` will be used. Default: `undefined` */\n clusterFontSize?: NumericAccessor<XYLabel<Datum>[]>;\n /** Background color accessor for clusters. Default: `undefined` */\n clusterBackgroundColor?: ColorAccessor<XYLabel<Datum>[]>;\n /** Optional cluster cursor. Default: `null` */\n clusterCursor?: StringAccessor<XYLabel<Datum>[]>;\n /** Cluster label color accessor function. Default: `null` */\n clusterLabelColor?: ColorAccessor<XYLabel<Datum>[]>;\n}\nexport const XYLabelsDefaultConfig: XYLabelsConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n color: (d: unknown): string => (d as { color: string }).color,\n y: undefined,\n xPositioning: XYLabelPositioning.DataSpace,\n yPositioning: XYLabelPositioning.DataSpace,\n labelFontSize: undefined,\n label: undefined,\n backgroundColor: undefined,\n cursor: null,\n labelTextBrightnessRatio: 0.65,\n\n clustering: true,\n clusterLabel: <Datum>(records: XYLabel<Datum>[]): string => records.length.toString(),\n clusterFontSize: undefined,\n clusterBackgroundColor: undefined,\n clusterCursor: undefined,\n clusterLabelColor: null,\n}\n\n"],"names":[],"mappings":";;;AAAA;AAyCa,MAAA,qBAAqB,mCAC7B,wBAAwB,CAAA,EAAA,EAC3B,KAAK,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAC7D,CAAC,EAAE,SAAS,EACZ,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,YAAY,EAAE,kBAAkB,CAAC,SAAS,EAC1C,aAAa,EAAE,SAAS,EACxB,KAAK,EAAE,SAAS,EAChB,eAAe,EAAE,SAAS,EAC1B,MAAM,EAAE,IAAI,EACZ,wBAAwB,EAAE,IAAI,EAE9B,UAAU,EAAE,IAAI,EAChB,YAAY,EAAE,CAAQ,OAAyB,KAAa,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EACrF,eAAe,EAAE,SAAS,EAC1B,sBAAsB,EAAE,SAAS,EACjC,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,IAAI;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/containers/xy-container/config.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\nimport { ContainerDefaultConfig, ContainerConfigInterface } from 'core/container/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Components\nimport { Axis } from 'components/axis'\nimport { Crosshair } from 'components/crosshair'\n\n// Types\nimport { ContinuousScale } from 'types/scale'\nimport { Direction } from 'types/direction'\n\nexport interface XYContainerConfigInterface<Datum> extends ContainerConfigInterface {\n /** An array of visualization components. Default: `[]` */\n components?: XYComponentCore<Datum>[];\n\n /** Scale for X dimension, e.g. Scale.scaleLinear().\n * If set, this value will override the components' xScale and they will have a single shared xScale instance.\n * By default the components have their own scale instances but their `domain` and `range` values are synchronized.\n * Default: `undefined` */\n xScale?: ContinuousScale;\n /** Scale domain (data extent) for X dimension. By default this value is calculated automatically based on data. */\n xDomain?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.\n * For example, imagine that you have a chart with dynamic data that has negative values. When values are small\n * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can\n * be achieved by setting `xDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the\n * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`\n * Default: `undefined` */\n xDomainMinConstraint?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.\n * For example, imagine that you have a chart with dynamic data. When values are small\n * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can\n * be achieved by setting `xDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the\n * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`\n * Default: `undefined` */\n xDomainMaxConstraint?: [number | undefined, number | undefined];\n /** Force set the X scale range (in the screen space). By default the range is calculated automatically based on the\n * chart's set up */\n xRange?: [number, number];\n\n /** Scale for Y dimension, e.g. Scale.scaleLinear().\n * If set, this value will override the components' yScale and they will have a single shared yScale instance.\n * By default the components have their own scale instances but their `domain` and `range` values are synchronized.\n * Default: `undefined` */\n yScale?: ContinuousScale;\n /** Scale domain (data extent) for Y dimension. By default this value is calculated automatically based on data. */\n yDomain?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the Y scale domain.\n * For example, imagine that you have a chart with dynamic data that has negative values. When values are small\n * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can\n * be achieved by setting `yDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the\n * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`\n * Default: `undefined` */\n yDomainMinConstraint?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the Y scale domain.\n * For example, imagine that you have a chart with dynamic data. When values are small\n * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can\n * be achieved by setting `yDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the\n * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`\n * Default: `undefined` */\n yDomainMaxConstraint?: [number | undefined, number | undefined];\n /** Force set the Y scale range (in the screen space). By default the range is calculated automatically based on the\n * chart's set up */\n yRange?: [number, number];\n /** Y Axis direction. Default: `Direction.North` */\n yDirection?: Direction.South | Direction.North | string;\n\n /** X Axis component instance. Default: `undefined` */\n xAxis?: Axis<Datum>;\n /** Y Axis component instance. Default: `undefined` */\n yAxis?: Axis<Datum>;\n /** Enables automatic calculation of chart margins based on the size of the axes. Default: `true` */\n autoMargin?: boolean;\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip | undefined;\n /** Crosshair component. Default: `undefined` */\n crosshair?: Crosshair<Datum> | undefined;\n /** Prevents the chart domain from being empty (when domain's min and max values are equal).\n * That usually happens when all the data values are equal or when there's no data.\n * Setting to `true` will automatically extend the domain by `+1` when the domain is empty (domain start equals domain end).\n * Setting to `null` will extend the empty X domain, but only when there's no data.\n * Setting to `false` will keep the domain as is.\n * Default: `null` */\n preventEmptyDomain?: boolean | null;\n /** Sets the Y scale domain based on the current X scale domain (not the whole dataset). Default: `false` */\n scaleByDomain?: boolean;\n}\n\nexport const XYContainerDefaultConfig: XYContainerConfigInterface<unknown> = {\n ...ContainerDefaultConfig,\n components: [],\n tooltip: undefined,\n crosshair: undefined,\n xAxis: undefined,\n yAxis: undefined,\n autoMargin: true,\n\n xScale: undefined,\n xDomain: undefined,\n xDomainMinConstraint: undefined,\n xDomainMaxConstraint: undefined,\n xRange: undefined,\n\n yScale: undefined,\n yDomain: undefined,\n yDomainMinConstraint: undefined,\n yDomainMaxConstraint: undefined,\n yRange: undefined,\n yDirection: Direction.North,\n\n preventEmptyDomain: null,\n scaleByDomain: false,\n}\n\n"],"names":[],"mappings":";;;AA0Fa,MAAA,wBAAwB,mCAChC,sBAAsB,CAAA,EAAA,EACzB,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,IAAI,EAEhB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,SAAS,EAClB,oBAAoB,EAAE,SAAS,EAC/B,oBAAoB,EAAE,SAAS,EAC/B,MAAM,EAAE,SAAS,EAEjB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,SAAS,EAClB,oBAAoB,EAAE,SAAS,EAC/B,oBAAoB,EAAE,SAAS,EAC/B,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,SAAS,CAAC,KAAK,EAE3B,kBAAkB,EAAE,IAAI,EACxB,aAAa,EAAE,KAAK;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/containers/xy-container/config.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\nimport { ContainerDefaultConfig, ContainerConfigInterface } from 'core/container/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Components\nimport { Axis } from 'components/axis'\nimport { Crosshair } from 'components/crosshair'\n\n// Types\nimport { ContinuousScale } from 'types/scale'\nimport { Direction } from 'types/direction'\n\nexport interface XYContainerConfigInterface<Datum> extends ContainerConfigInterface {\n /** An array of visualization components. Default: `[]` */\n components?: XYComponentCore<Datum>[];\n\n /** Scale for X dimension, e.g. Scale.scaleLinear().\n * If set, this value will override the components' xScale and they will have a single shared xScale instance.\n * By default the components have their own scale instances but their `domain` and `range` values are synchronized.\n * Default: `undefined` */\n xScale?: ContinuousScale;\n /** Scale domain (data extent) for X dimension. By default this value is calculated automatically based on data. */\n xDomain?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.\n * For example, imagine that you have a chart with dynamic data that has negative values. When values are small\n * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can\n * be achieved by setting `xDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the\n * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`\n * Default: `undefined` */\n xDomainMinConstraint?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the X scale domain. Useful when the data is plotted along the X axis.\n * For example, imagine that you have a chart with dynamic data. When values are small\n * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can\n * be achieved by setting `xDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the\n * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`\n * Default: `undefined` */\n xDomainMaxConstraint?: [number | undefined, number | undefined];\n /** Force set the X scale range (in the screen space). By default the range is calculated automatically based on the\n * chart's set up */\n xRange?: [number, number];\n\n /** Scale for Y dimension, e.g. Scale.scaleLinear().\n * If set, this value will override the components' yScale and they will have a single shared yScale instance.\n * By default the components have their own scale instances but their `domain` and `range` values are synchronized.\n * Default: `undefined` */\n yScale?: ContinuousScale;\n /** Scale domain (data extent) for Y dimension. By default this value is calculated automatically based on data. */\n yDomain?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the Y scale domain.\n * For example, imagine that you have a chart with dynamic data that has negative values. When values are small\n * (let's say in the range of [-0.01, 0]), you might still want the chart to display some meaningful value range (e.g. [-1, 0]). That can\n * be achieved by setting `yDomainMinConstraint` to `[undefined, -1]`. In addition to that, if you want to cut off the\n * values that are too low (let's say lower than -100), you can set the constraint to `[-100, -1]`\n * Default: `undefined` */\n yDomainMinConstraint?: [number | undefined, number | undefined];\n /** Constraint the minimum value of the Y scale domain.\n * For example, imagine that you have a chart with dynamic data. When values are small\n * (let's say < 0.01), you might still want the chart to display some meaningful value range (e.g. [0, 1]). That can\n * be achieved by setting `yDomainMaxConstraint` to `[1, undefined]`. In addition to that, if you want to cut off the\n * values that are too high (let's say higher than 100), you can set the constraint to `[1, 100]`\n * Default: `undefined` */\n yDomainMaxConstraint?: [number | undefined, number | undefined];\n /** Force set the Y scale range (in the screen space). By default the range is calculated automatically based on the\n * chart's set up */\n yRange?: [number, number];\n /** Y Axis direction. Default: `Direction.North` */\n yDirection?: Direction.South | Direction.North | string;\n\n /** X Axis component instance. Default: `undefined` */\n xAxis?: Axis<Datum>;\n /** Y Axis component instance. Default: `undefined` */\n yAxis?: Axis<Datum>;\n /** Enables automatic calculation of chart margins based on the size of the axes. Default: `true` */\n autoMargin?: boolean;\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip | undefined;\n /** Crosshair component. Default: `undefined` */\n crosshair?: Crosshair<Datum> | undefined;\n /** Prevents the chart domain from being empty (when domain's min and max values are equal).\n * That usually happens when all the data values are equal or when there's no data.\n * Setting to `true` will automatically extend the domain by `+1` when the domain is empty (domain start equals domain end).\n * Setting to `null` will extend the empty X domain, but only when there's no data.\n * Setting to `false` will keep the domain as is.\n * Default: `null` */\n preventEmptyDomain?: boolean | null;\n /** Sets the Y scale domain based on the current X scale domain (not the whole dataset). Default: `false` */\n scaleByDomain?: boolean;\n}\n\n\nexport const XYContainerDefaultConfig: XYContainerConfigInterface<unknown> = {\n ...ContainerDefaultConfig,\n components: [],\n tooltip: undefined,\n crosshair: undefined,\n xAxis: undefined,\n yAxis: undefined,\n autoMargin: true,\n\n xScale: undefined,\n xDomain: undefined,\n xDomainMinConstraint: undefined,\n xDomainMaxConstraint: undefined,\n xRange: undefined,\n\n yScale: undefined,\n yDomain: undefined,\n yDomainMinConstraint: undefined,\n yDomainMaxConstraint: undefined,\n yRange: undefined,\n yDirection: Direction.North,\n\n preventEmptyDomain: null,\n scaleByDomain: false,\n}\n\n"],"names":[],"mappings":";;;AA2Fa,MAAA,wBAAwB,mCAChC,sBAAsB,CAAA,EAAA,EACzB,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,IAAI,EAEhB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,SAAS,EAClB,oBAAoB,EAAE,SAAS,EAC/B,oBAAoB,EAAE,SAAS,EAC/B,MAAM,EAAE,SAAS,EAEjB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,SAAS,EAClB,oBAAoB,EAAE,SAAS,EAC/B,oBAAoB,EAAE,SAAS,EAC/B,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,SAAS,CAAC,KAAK,EAE3B,kBAAkB,EAAE,IAAI,EACxB,aAAa,EAAE,KAAK;;;;"}
@@ -153,7 +153,7 @@ class XYContainer extends ContainerCore {
153
153
  this._updateScales(...this.components, config.xAxis, config.yAxis, config.crosshair);
154
154
  }
155
155
  _render(customDuration) {
156
- var _a, _b, _c;
156
+ var _a, _b;
157
157
  const { config } = this;
158
158
  super._render();
159
159
  // Get chart total margin after auto margin calculations
@@ -182,10 +182,10 @@ class XYContainer extends ContainerCore {
182
182
  // Pass accessors
183
183
  const yAccessors = this.components.filter(c => !c.stacked).map(c => c.config.y);
184
184
  const yStackedAccessors = this.components.filter(c => c.stacked).map(c => c.config.y);
185
- // eslint-disable-next-line dot-notation
186
- const baselineAccessor = (_b = this.components.find(c => c.config['baseline'])) === null || _b === void 0 ? void 0 : _b.config['baseline'];
185
+ const baselineComponentConfig = this.components.find(c => c.config.baseline).config;
186
+ const baselineAccessor = baselineComponentConfig.baseline;
187
187
  crosshair.accessors = {
188
- x: (_c = this.components[0]) === null || _c === void 0 ? void 0 : _c.config.x,
188
+ x: (_b = this.components[0]) === null || _b === void 0 ? void 0 : _b.config.x,
189
189
  y: flatten(yAccessors),
190
190
  yStacked: flatten(yStackedAccessors),
191
191
  baseline: baselineAccessor,
@@ -261,8 +261,9 @@ class XYContainer extends ContainerCore {
261
261
  // Get and combine bleed
262
262
  const bleed = components.map(c => c.bleed).reduce((bleed, b) => {
263
263
  for (const key of Object.keys(bleed)) {
264
- if (bleed[key] < b[key])
265
- bleed[key] = b[key];
264
+ const k = key;
265
+ if (bleed[k] < b[k])
266
+ bleed[k] = b[k];
266
267
  }
267
268
  return bleed;
268
269
  }, { top: 0, bottom: 0, left: 0, right: 0 });