@unovis/ts 1.5.1 → 1.5.2

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 (41) hide show
  1. package/components/area/config.d.ts +7 -3
  2. package/components/area/config.js +1 -1
  3. package/components/area/config.js.map +1 -1
  4. package/components/area/index.js +25 -9
  5. package/components/area/index.js.map +1 -1
  6. package/components/axis/config.d.ts +1 -1
  7. package/components/axis/config.js.map +1 -1
  8. package/components/axis/index.js.map +1 -1
  9. package/components/chord-diagram/index.js +3 -1
  10. package/components/chord-diagram/index.js.map +1 -1
  11. package/components/graph/config.d.ts +12 -4
  12. package/components/graph/config.js +3 -3
  13. package/components/graph/config.js.map +1 -1
  14. package/components/graph/index.d.ts +2 -2
  15. package/components/graph/index.js +56 -23
  16. package/components/graph/index.js.map +1 -1
  17. package/components/graph/modules/layout.js +2 -2
  18. package/components/graph/modules/layout.js.map +1 -1
  19. package/components/graph/modules/link/index.js +8 -6
  20. package/components/graph/modules/link/index.js.map +1 -1
  21. package/components/graph/modules/link/style.js +4 -1
  22. package/components/graph/modules/link/style.js.map +1 -1
  23. package/components/graph/types.d.ts +7 -0
  24. package/components/graph/types.js +10 -2
  25. package/components/graph/types.js.map +1 -1
  26. package/components/scatter/index.d.ts +1 -0
  27. package/components/scatter/index.js +11 -1
  28. package/components/scatter/index.js.map +1 -1
  29. package/components/tooltip/config.d.ts +6 -4
  30. package/components/tooltip/config.js +3 -1
  31. package/components/tooltip/config.js.map +1 -1
  32. package/components/tooltip/index.d.ts +7 -3
  33. package/components/tooltip/index.js +39 -9
  34. package/components/tooltip/index.js.map +1 -1
  35. package/components/xy-labels/index.js +1 -1
  36. package/components/xy-labels/index.js.map +1 -1
  37. package/index.js +1 -1
  38. package/package.json +8 -7
  39. package/types.js +1 -1
  40. package/utils/data.js +1 -1
  41. package/utils/data.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/scatter/index.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\nimport { max, min } from 'd3-array'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { isNumber, getExtent, getNumber, getString, isArray, flatten, getValue } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels } from 'utils/misc'\n\n// Types\nimport { Spacing } from 'types/spacing'\nimport { SymbolType } from 'types/symbol'\nimport { NumericAccessor } from 'types/accessor'\nimport { Position } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\n\n// Local Types\nimport { ScatterPointGroupNode, ScatterPoint } from './types'\n\n// Config\nimport { ScatterDefaultConfig, ScatterConfigInterface } from './config'\n\n// Modules\nimport { createPoints, updatePoints, removePoints } from './modules/point'\nimport { collideLabels, getEstimatedLabelBBox } from './modules/utils'\n\n// Styles\nimport * as s from './style'\n\n\nexport class Scatter<Datum> extends XYComponentCore<Datum, ScatterConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = ScatterDefaultConfig as ScatterConfigInterface<Datum>\n public config: ScatterConfigInterface<Datum> = this._defaultConfig\n\n events = {\n [Scatter.selectors.point]: {\n mouseenter: this._onPointMouseOver.bind(this),\n mouseleave: this._onPointMouseOut.bind(this),\n },\n }\n\n private _pointData: ScatterPoint<Datum>[][] = []\n private _points: Selection<SVGGElement, ScatterPoint<Datum>, SVGGElement, ScatterPoint<Datum>[]>\n private _sizeScale: ContinuousScale\n private _collideLabelsAnimFrameId: ReturnType<typeof requestAnimationFrame>\n\n constructor (config?: ScatterConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n setConfig (config: ScatterConfigInterface<Datum>): void {\n super.setConfig(config)\n this._updateSizeScale()\n }\n\n setData (data: Datum[]): void {\n super.setData(data)\n this._updateSizeScale()\n }\n\n get bleed (): Spacing {\n this._pointData = this._getOnScreenData()\n const pointDataFlat: ScatterPoint<Datum>[] = flatten(this._pointData)\n\n const yRangeStart = min(this.yScale.range())\n const yRangeEnd = max(this.yScale.range())\n const xRangeStart = this.xScale.range()[0]\n const xRangeEnd = this.xScale.range()[1]\n\n const fontSizePx = getCSSVariableValueInPixels('var(--vis-scatter-point-label-text-font-size)', this.element)\n\n const extent = pointDataFlat.reduce((ext, d) => {\n const x = this.xScale(d._point.xValue)\n const y = this.yScale(d._point.yValue)\n const r = d._point.sizePx / 2\n\n ext.minX = Math.min(ext.minX, x - r)\n ext.maxX = Math.max(ext.maxX, x + r)\n ext.minY = Math.min(ext.minY, y - r)\n ext.maxY = Math.max(ext.maxY, y + r)\n\n if (d._point.label) {\n const labelBBox = getEstimatedLabelBBox(d, d._point.labelPosition, this.xScale, this.yScale, fontSizePx)\n ext.minX = Math.min(ext.minX, labelBBox.x)\n ext.maxX = Math.max(ext.maxX, labelBBox.x + labelBBox.width)\n ext.minY = Math.min(ext.minY, labelBBox.y)\n ext.maxY = Math.max(ext.maxY, labelBBox.y + labelBBox.height)\n }\n return ext\n }, {\n minX: Number.POSITIVE_INFINITY,\n maxX: Number.NEGATIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n })\n\n const coeff = 1.2 // Multiplier to take into account subsequent scale range changes and shape irregularities\n const top = extent.minY < yRangeStart ? coeff * (yRangeStart - extent.minY) : 0\n const bottom = extent.maxY > yRangeEnd ? coeff * (extent.maxY - yRangeEnd) : 0\n const left = extent.minX < xRangeStart ? coeff * (xRangeStart - extent.minX) : 0\n const right = extent.maxX > xRangeEnd ? coeff * (extent.maxX - xRangeEnd) : 0\n\n return { top, bottom, left, right }\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n // Groups\n const pointGroups = this.g\n .selectAll<SVGGElement, ScatterPoint<Datum>[]>(`.${s.pointGroup}`)\n .data(this._pointData)\n\n const pointGroupsEnter = pointGroups\n .enter()\n .append('g')\n .attr('class', s.pointGroup)\n\n const pointGroupsMerged = pointGroupsEnter.merge(pointGroups)\n smartTransition(pointGroupsMerged, duration)\n .style('opacity', 1)\n\n const pointGroupExit = pointGroups.exit().attr('class', s.pointGroupExit)\n smartTransition(pointGroupExit, duration).style('opacity', 0).remove()\n\n // Points\n const points = pointGroupsMerged\n .selectAll<SVGGElement, ScatterPoint<Datum>>(`.${s.point}`)\n .data(\n d => d,\n d => `${getString(d, config.id, d._point.pointIndex) ?? d._point.pointIndex}`\n )\n\n const pointsEnter = points.enter().append('g')\n .attr('class', s.point)\n createPoints(pointsEnter, this.xScale, this.yScale)\n\n this._points = pointsEnter.merge(points)\n updatePoints(this._points, config, this.xScale, this.yScale, duration)\n\n removePoints(points.exit<ScatterPoint<Datum>>(), this.xScale, this.yScale, duration)\n\n // Take care of overlapping labels\n this._resolveLabelOverlap()\n }\n\n private _resolveLabelOverlap (): void {\n if (!this.config.labelHideOverlapping) {\n const label = this._points.selectAll<SVGTextElement, ScatterPoint<Datum>>('text')\n label.attr('opacity', null)\n return\n }\n\n cancelAnimationFrame(this._collideLabelsAnimFrameId)\n this._collideLabelsAnimFrameId = requestAnimationFrame(() => {\n collideLabels(this._points, this.config, this.xScale, this.yScale)\n })\n }\n\n private _updateSizeScale (): void {\n const { config, datamodel } = this\n\n this._sizeScale = config.sizeScale.copy()\n this._sizeScale.domain(getExtent(datamodel.data, config.size))\n this._sizeScale.range(config.sizeRange ?? [0, 0])\n }\n\n private _getOnScreenData (): ScatterPoint<Datum>[][] {\n const { config, datamodel: { data } } = this\n\n const xDomain = this.xScale.domain().map((d: number | Date) => +d) // Convert Date to number\n const yDomain = this.yScale.domain().map((d: number | Date) => +d) // Convert Date to number\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const maxSizeValue = max<number>(flatten(yAccessors.map((y, j) => data?.map(d => getNumber(d, config.size, j)))))\n const maxSizePx = config.sizeRange ? this._sizeScale(maxSizeValue) : maxSizeValue\n\n const maxSizeXDomain = (this.xScale.invert(maxSizePx) as number) - (this.xScale.invert(0) as number)\n const maxSizeYDomain = Math.abs((this.yScale.invert(maxSizePx) as number) - (this.yScale.invert(0) as number))\n\n return yAccessors.map((y, j) => {\n return data?.reduce<ScatterPoint<Datum>[]>((acc, d, i) => {\n const xValue = getNumber(d, config.x, i)\n const yValue = getNumber(d, y, j)\n const pointSize = getNumber(d, config.size, i)\n const pointSizeScaled = config.sizeRange ? this._sizeScale(pointSize) : pointSize\n const pointSizeXDomain = (this.xScale.invert(pointSizeScaled) as number) - (this.xScale.invert(0) as number)\n const pointSizeYDomain = Math.abs((this.yScale.invert(pointSizeScaled) as number) - (this.yScale.invert(0) as number))\n\n if (\n ((xValue - pointSizeXDomain / 2) >= (xDomain[0] - maxSizeXDomain / 2)) &&\n ((xValue + pointSizeXDomain / 2) <= (xDomain[1] + maxSizeXDomain / 2)) &&\n ((yValue - pointSizeYDomain / 2) >= (yDomain[0] - maxSizeYDomain / 2)) &&\n ((yValue + pointSizeYDomain / 2) <= (yDomain[1] + maxSizeYDomain / 2))\n ) {\n acc.push({\n ...d,\n _point: {\n xValue: xValue,\n yValue: yValue,\n sizePx: pointSizeScaled,\n color: getColor(d, config.color, j),\n strokeColor: getColor(d, config.strokeColor, j, true),\n strokeWidthPx: getNumber(d, config.strokeWidth, j),\n shape: getString(d, config.shape, j) as SymbolType,\n label: getString(d, config.label, j),\n labelColor: getColor(d, config.labelColor, j, true),\n labelPosition: getValue(d, config.labelPosition, i) as Position,\n cursor: getString(d, config.cursor, j),\n groupIndex: j,\n pointIndex: i,\n },\n })\n }\n\n return acc\n }, []) ?? []\n })\n }\n\n private _onPointMouseOver (d: ScatterPoint<Datum>, event: MouseEvent): void {\n const point = select(event.target as SVGGElement)\n const pointNode = point.node() as ScatterPointGroupNode | null\n if (pointNode) pointNode._forceShowLabel = true\n\n point.raise()\n this._resolveLabelOverlap()\n }\n\n private _onPointMouseOut (d: ScatterPoint<Datum>, event: MouseEvent): void {\n const pointNode = select(event.target as SVGGElement).node() as ScatterPointGroupNode | null\n if (pointNode) delete pointNode._forceShowLabel\n\n this._resolveLabelOverlap()\n }\n}\n"],"names":["s.pointGroup","pointGroupExit","s.pointGroupExit","s.point","s"],"mappings":";;;;;;;;;;;;;AAiCM,MAAO,OAAe,SAAQ,eAAqD,CAAA;AAiBvF,IAAA,WAAA,CAAa,MAAsC,EAAA;AACjD,QAAA,KAAK,EAAE,CAAA;QAhBC,IAAc,CAAA,cAAA,GAAG,oBAAqD,CAAA;AACzE,QAAA,IAAA,CAAA,MAAM,GAAkC,IAAI,CAAC,cAAc,CAAA;AAElE,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG;gBACzB,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC7C,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,aAAA;SACF,CAAA;QAEO,IAAU,CAAA,UAAA,GAA4B,EAAE,CAAA;AAO9C,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;AAED,IAAA,SAAS,CAAE,MAAqC,EAAA;AAC9C,QAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACvB,IAAI,CAAC,gBAAgB,EAAE,CAAA;KACxB;AAED,IAAA,OAAO,CAAE,IAAa,EAAA;AACpB,QAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACnB,IAAI,CAAC,gBAAgB,EAAE,CAAA;KACxB;AAED,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACzC,MAAM,aAAa,GAA0B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAErE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,C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AC5F,QAAA,IAAI,SAAS;YAAE,OAAO,SAAS,CAAC,eAAe,CAAA;QAE/C,IAAI,CAAC,oBAAoB,EAAE,CAAA;KAC5B;;AA9MM,OAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/scatter/index.ts"],"sourcesContent":["import { Selection, select } from 'd3-selection'\nimport { max, min } from 'd3-array'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { isNumber, getExtent, getNumber, getString, isArray, flatten, getValue } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { smartTransition } from 'utils/d3'\nimport { getCSSVariableValueInPixels } from 'utils/misc'\n\n// Types\nimport { Spacing } from 'types/spacing'\nimport { SymbolType } from 'types/symbol'\nimport { NumericAccessor } from 'types/accessor'\nimport { Position } from 'types/position'\nimport { ContinuousScale } from 'types/scale'\n\n// Local Types\nimport { ScatterPointGroupNode, ScatterPoint } from './types'\n\n// Config\nimport { ScatterDefaultConfig, ScatterConfigInterface } from './config'\n\n// Modules\nimport { createPoints, updatePoints, removePoints } from './modules/point'\nimport { collideLabels, getEstimatedLabelBBox } from './modules/utils'\n\n// Styles\nimport * as s from './style'\n\n\nexport class Scatter<Datum> extends XYComponentCore<Datum, ScatterConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = ScatterDefaultConfig as ScatterConfigInterface<Datum>\n public config: ScatterConfigInterface<Datum> = this._defaultConfig\n\n events = {\n [Scatter.selectors.point]: {\n mouseenter: this._onPointMouseOver.bind(this),\n mouseleave: this._onPointMouseOut.bind(this),\n },\n }\n\n private _pointData: ScatterPoint<Datum>[][] = []\n private _points: Selection<SVGGElement, ScatterPoint<Datum>, SVGGElement, ScatterPoint<Datum>[]>\n private _sizeScale: ContinuousScale\n private _collideLabelsAnimFrameId: ReturnType<typeof requestAnimationFrame>\n\n constructor (config?: ScatterConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n setConfig (config: ScatterConfigInterface<Datum>): void {\n super.setConfig(config)\n this._updateSizeScale()\n }\n\n setData (data: Datum[]): void {\n super.setData(data)\n this._updateSizeScale()\n }\n\n get bleed (): Spacing {\n this._pointData = this._getOnScreenData()\n const pointDataFlat: ScatterPoint<Datum>[] = flatten(this._pointData)\n\n const yRangeStart = min(this.yScale.range())\n const yRangeEnd = max(this.yScale.range())\n const xRangeStart = this.xScale.range()[0]\n const xRangeEnd = this.xScale.range()[1]\n\n const fontSizePx = getCSSVariableValueInPixels('var(--vis-scatter-point-label-text-font-size)', this.element)\n\n const extent = pointDataFlat.reduce((ext, d) => {\n const x = this.xScale(d._point.xValue)\n const y = this.yScale(d._point.yValue)\n const r = d._point.sizePx / 2\n\n ext.minX = Math.min(ext.minX, x - r)\n ext.maxX = Math.max(ext.maxX, x + r)\n ext.minY = Math.min(ext.minY, y - r)\n ext.maxY = Math.max(ext.maxY, y + r)\n\n if (d._point.label) {\n const labelBBox = getEstimatedLabelBBox(d, d._point.labelPosition, this.xScale, this.yScale, fontSizePx)\n ext.minX = Math.min(ext.minX, labelBBox.x)\n ext.maxX = Math.max(ext.maxX, labelBBox.x + labelBBox.width)\n ext.minY = Math.min(ext.minY, labelBBox.y)\n ext.maxY = Math.max(ext.maxY, labelBBox.y + labelBBox.height)\n }\n return ext\n }, {\n minX: Number.POSITIVE_INFINITY,\n maxX: Number.NEGATIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n })\n\n const coeff = 1.2 // Multiplier to take into account subsequent scale range changes and shape irregularities\n const top = extent.minY < yRangeStart ? coeff * (yRangeStart - extent.minY) : 0\n const bottom = extent.maxY > yRangeEnd ? coeff * (extent.maxY - yRangeEnd) : 0\n const left = extent.minX < xRangeStart ? coeff * (xRangeStart - extent.minX) : 0\n const right = extent.maxX > xRangeEnd ? coeff * (extent.maxX - xRangeEnd) : 0\n\n return { top, bottom, left, right }\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n // Groups\n const pointGroups = this.g\n .selectAll<SVGGElement, ScatterPoint<Datum>[]>(`.${s.pointGroup}`)\n .data(this._pointData)\n\n const pointGroupsEnter = pointGroups\n .enter()\n .append('g')\n .attr('class', s.pointGroup)\n\n const pointGroupsMerged = pointGroupsEnter.merge(pointGroups)\n smartTransition(pointGroupsMerged, duration)\n .style('opacity', 1)\n\n const pointGroupExit = pointGroups.exit().attr('class', s.pointGroupExit)\n smartTransition(pointGroupExit, duration).style('opacity', 0).remove()\n\n // Points\n const points = pointGroupsMerged\n .selectAll<SVGGElement, ScatterPoint<Datum>>(`.${s.point}`)\n .data(\n d => d,\n d => `${getString(d, config.id, d._point.pointIndex) ?? d._point.pointIndex}`\n )\n\n const pointsEnter = points.enter().append('g')\n .attr('class', s.point)\n createPoints(pointsEnter, this.xScale, this.yScale)\n\n this._points = pointsEnter.merge(points)\n updatePoints(this._points, config, this.xScale, this.yScale, duration)\n\n removePoints(points.exit<ScatterPoint<Datum>>(), this.xScale, this.yScale, duration)\n\n // Take care of overlapping labels\n if (this._hasLabels()) {\n this._resolveLabelOverlap()\n }\n }\n\n private _hasLabels (): boolean {\n // If label config is not defined, no labels will be shown\n if (!this.config.label) return false\n\n // Check if any point in the flattened data has a label\n const pointDataFlat: ScatterPoint<Datum>[] = flatten(this._pointData)\n return pointDataFlat.some(d => d._point.label)\n }\n\n private _resolveLabelOverlap (): void {\n if (!this.config.labelHideOverlapping) {\n const label = this._points.selectAll<SVGTextElement, ScatterPoint<Datum>>('text')\n label.attr('opacity', null)\n return\n }\n\n cancelAnimationFrame(this._collideLabelsAnimFrameId)\n this._collideLabelsAnimFrameId = requestAnimationFrame(() => {\n collideLabels(this._points, this.config, this.xScale, this.yScale)\n })\n }\n\n private _updateSizeScale (): void {\n const { config, datamodel } = this\n\n this._sizeScale = config.sizeScale.copy()\n this._sizeScale.domain(getExtent(datamodel.data, config.size))\n this._sizeScale.range(config.sizeRange ?? [0, 0])\n }\n\n private _getOnScreenData (): ScatterPoint<Datum>[][] {\n const { config, datamodel: { data } } = this\n\n const xDomain = this.xScale.domain().map((d: number | Date) => +d) // Convert Date to number\n const yDomain = this.yScale.domain().map((d: number | Date) => +d) // Convert Date to number\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const maxSizeValue = max<number>(flatten(yAccessors.map((y, j) => data?.map(d => getNumber(d, config.size, j)))))\n const maxSizePx = config.sizeRange ? this._sizeScale(maxSizeValue) : maxSizeValue\n\n const maxSizeXDomain = (this.xScale.invert(maxSizePx) as number) - (this.xScale.invert(0) as number)\n const maxSizeYDomain = Math.abs((this.yScale.invert(maxSizePx) as number) - (this.yScale.invert(0) as number))\n\n return yAccessors.map((y, j) => {\n return data?.reduce<ScatterPoint<Datum>[]>((acc, d, i) => {\n const xValue = getNumber(d, config.x, i)\n const yValue = getNumber(d, y, j)\n const pointSize = getNumber(d, config.size, i)\n const pointSizeScaled = config.sizeRange ? this._sizeScale(pointSize) : pointSize\n const pointSizeXDomain = (this.xScale.invert(pointSizeScaled) as number) - (this.xScale.invert(0) as number)\n const pointSizeYDomain = Math.abs((this.yScale.invert(pointSizeScaled) as number) - (this.yScale.invert(0) as number))\n\n if (\n ((xValue - pointSizeXDomain / 2) >= (xDomain[0] - maxSizeXDomain / 2)) &&\n ((xValue + pointSizeXDomain / 2) <= (xDomain[1] + maxSizeXDomain / 2)) &&\n ((yValue - pointSizeYDomain / 2) >= (yDomain[0] - maxSizeYDomain / 2)) &&\n ((yValue + pointSizeYDomain / 2) <= (yDomain[1] + maxSizeYDomain / 2))\n ) {\n acc.push({\n ...d,\n _point: {\n xValue: xValue,\n yValue: yValue,\n sizePx: pointSizeScaled,\n color: getColor(d, config.color, j),\n strokeColor: getColor(d, config.strokeColor, j, true),\n strokeWidthPx: getNumber(d, config.strokeWidth, j),\n shape: getString(d, config.shape, j) as SymbolType,\n label: getString(d, config.label, j),\n labelColor: getColor(d, config.labelColor, j, true),\n labelPosition: getValue(d, config.labelPosition, i) as Position,\n cursor: getString(d, config.cursor, j),\n groupIndex: j,\n pointIndex: i,\n },\n })\n }\n\n return acc\n }, []) ?? []\n })\n }\n\n private _onPointMouseOver (d: ScatterPoint<Datum>, event: MouseEvent): void {\n const point = select(event.target as SVGGElement)\n const pointNode = point.node() as ScatterPointGroupNode | null\n if (pointNode) pointNode._forceShowLabel = true\n\n point.raise()\n this._resolveLabelOverlap()\n }\n\n private _onPointMouseOut (d: ScatterPoint<Datum>, event: MouseEvent): void {\n const pointNode = select(event.target as SVGGElement).node() as ScatterPointGroupNode | null\n if (pointNode) delete pointNode._forceShowLabel\n\n this._resolveLabelOverlap()\n }\n}\n"],"names":["s.pointGroup","pointGroupExit","s.pointGroupExit","s.point","s"],"mappings":";;;;;;;;;;;;;AAiCM,MAAO,OAAe,SAAQ,eAAqD,CAAA;AAiBvF,IAAA,WAAA,CAAa,MAAsC,EAAA;AACjD,QAAA,KAAK,EAAE,CAAA;QAhBC,IAAc,CAAA,cAAA,GAAG,oBAAqD,CAAA;AACzE,QAAA,IAAA,CAAA,MAAM,GAAkC,IAAI,CAAC,cAAc,CAAA;AAElE,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG;gBACzB,UAAU,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC7C,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,aAAA;SACF,CAAA;QAEO,IAAU,CAAA,UAAA,GAA4B,EAAE,CAAA;AAO9C,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;AAED,IAAA,SAAS,CAAE,MAAqC,EAAA;AAC9C,QAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACvB,IAAI,CAAC,gBAAgB,EAAE,CAA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,EAAE,CAAC;AACb,4BAAA,UAAU,EAAE,CAAC;AACd,yBAAA,EAAA,CAAA,CACD,CAAA;AACH,iBAAA;AAED,gBAAA,OAAO,GAAG,CAAA;AACZ,aAAC,EAAE,EAAE,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,EAAE,CAAA;AACd,SAAC,CAAC,CAAA;KACH;IAEO,iBAAiB,CAAE,CAAsB,EAAE,KAAiB,EAAA;QAClE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAA;AACjD,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,EAAkC,CAAA;AAC9D,QAAA,IAAI,SAAS;AAAE,YAAA,SAAS,CAAC,eAAe,GAAG,IAAI,CAAA;QAE/C,KAAK,CAAC,KAAK,EAAE,CAAA;QACb,IAAI,CAAC,oBAAoB,EAAE,CAAA;KAC5B;IAEO,gBAAgB,CAAE,CAAsB,EAAE,KAAiB,EAAA;QACjE,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC,IAAI,EAAkC,CAAA;AAC5F,QAAA,IAAI,SAAS;YAAE,OAAO,SAAS,CAAC,eAAe,CAAA;QAE/C,IAAI,CAAC,oBAAoB,EAAE,CAAA;KAC5B;;AAzNM,OAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
@@ -5,11 +5,9 @@ export interface TooltipConfigInterface {
5
5
  components?: ComponentCore<unknown>[];
6
6
  /** Container to where the Tooltip component should be inserted. Default: `undefined` */
7
7
  container?: HTMLElement;
8
- /** Follow the mouse cursor. If `true`, the tooltip can't be hovered over
9
- * even when `allowHover` is set to `true`. Default: `true` */
8
+ /** Follow the mouse cursor. Default: `true` */
10
9
  followCursor?: boolean;
11
- /** Allow the tooltip to be hovered over and interacted with when `followCursor` is set to `false`.
12
- * Default: `true` */
10
+ /** Allow the tooltip to be hovered over and interacted with. Default: `false` */
13
11
  allowHover?: boolean;
14
12
  /** Horizontal placement of the tooltip. Default: `Position.Auto` */
15
13
  horizontalPlacement?: Position | string | undefined;
@@ -62,5 +60,9 @@ export interface TooltipConfigInterface {
62
60
  };
63
61
  /** Custom class name for the tooltip. Default: `undefined` */
64
62
  className?: string;
63
+ /** Hide delay in milliseconds. Default: `undefined` */
64
+ hideDelay?: number;
65
+ /** Show delay in milliseconds. Default: `undefined` */
66
+ showDelay?: number;
65
67
  }
66
68
  export declare const TooltipDefaultConfig: TooltipConfigInterface;
@@ -5,7 +5,7 @@ const TooltipDefaultConfig = {
5
5
  components: [],
6
6
  container: undefined,
7
7
  followCursor: true,
8
- allowHover: true,
8
+ allowHover: false,
9
9
  horizontalPlacement: Position.Auto,
10
10
  horizontalShift: 0,
11
11
  verticalPlacement: Position.Top,
@@ -13,6 +13,8 @@ const TooltipDefaultConfig = {
13
13
  attributes: {},
14
14
  triggers: {},
15
15
  className: undefined,
16
+ showDelay: undefined,
17
+ hideDelay: undefined,
16
18
  };
17
19
 
18
20
  export { TooltipDefaultConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/tooltip/config.ts"],"sourcesContent":["/* eslint-disable no-irregular-whitespace */\nimport { ComponentCore } from 'core/component'\n\n// Types\nimport { Position } from 'types/position'\n\nexport interface TooltipConfigInterface {\n /** An array of visualization components to interact with. Default: `[]` */\n components?: ComponentCore<unknown>[];\n /** Container to where the Tooltip component should be inserted. Default: `undefined` */\n container?: HTMLElement;\n /** Follow the mouse cursor. If `true`, the tooltip can't be hovered over\n * even when `allowHover` is set to `true`. Default: `true` */\n followCursor?: boolean;\n /** Allow the tooltip to be hovered over and interacted with when `followCursor` is set to `false`.\n * Default: `true` */\n allowHover?: boolean;\n /** Horizontal placement of the tooltip. Default: `Position.Auto` */\n horizontalPlacement?: Position | string | undefined;\n /** Horizontal shift of the tooltip in pixels. Works only with\n * `horizontalPlacement` set to `Position.Left` or `Position.Right`.\n * Default: `0` */\n horizontalShift?: number;\n /** Vertical placement of the tooltip. Default: `Position.Top` */\n verticalPlacement?: Position | string | undefined;\n /** Vertical shift of the tooltip in pixels. Works only with\n * `verticalPlacement` set to `Position.Top` or `Position.Bottom`.\n * Default: `0` */\n verticalShift?: number;\n /** Defines the content of the tooltip and hovering over which elements should trigger it.\n * An object containing properties in the following format:\n *\n * ```\n * {\n *  [selectorString]: (d: unknown) => string | HTMLElement\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  [Area.selectors.area]: (d: AreaDatum[]) => `<div>${d.value.toString()}</div>\n * }\n * ```\n */\n triggers?: {\n [selector: string]: ((data: any, i: number, elements: (HTMLElement | SVGElement)[]) => string | HTMLElement | undefined | null | void) | undefined | null;\n };\n /** Custom DOM attributes for the tooltip. Useful when you need to refer to a specific tooltip instance\n * by using a CSS selector. Attributes configuration object has the following structure:\n *\n * ```\n * {\n *  [attributeName]: attribute value\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  'type': 'area-tooltip',\n *  'value': 42\n * }\n * ```\n */\n attributes?: { [attr: string]: string | number | boolean };\n /** Custom class name for the tooltip. Default: `undefined` */\n className?: string;\n}\n\nexport const TooltipDefaultConfig: TooltipConfigInterface = {\n components: [],\n container: undefined,\n followCursor: true,\n allowHover: true,\n horizontalPlacement: Position.Auto,\n horizontalShift: 0,\n verticalPlacement: Position.Top,\n verticalShift: 0,\n attributes: {},\n triggers: {},\n className: undefined,\n}\n\n"],"names":[],"mappings":";;AAGA;AAiEa,MAAA,oBAAoB,GAA2B;AAC1D,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,QAAQ,CAAC,IAAI;AAClC,IAAA,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,QAAQ,CAAC,GAAG;AAC/B,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,SAAS,EAAE,SAAS;;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/tooltip/config.ts"],"sourcesContent":["/* eslint-disable no-irregular-whitespace */\nimport { ComponentCore } from 'core/component'\n\n// Types\nimport { Position } from 'types/position'\n\nexport interface TooltipConfigInterface {\n /** An array of visualization components to interact with. Default: `[]` */\n components?: ComponentCore<unknown>[];\n /** Container to where the Tooltip component should be inserted. Default: `undefined` */\n container?: HTMLElement;\n /** Follow the mouse cursor. Default: `true` */\n followCursor?: boolean;\n /** Allow the tooltip to be hovered over and interacted with. Default: `false` */\n allowHover?: boolean;\n /** Horizontal placement of the tooltip. Default: `Position.Auto` */\n horizontalPlacement?: Position | string | undefined;\n /** Horizontal shift of the tooltip in pixels. Works only with\n * `horizontalPlacement` set to `Position.Left` or `Position.Right`.\n * Default: `0` */\n horizontalShift?: number;\n /** Vertical placement of the tooltip. Default: `Position.Top` */\n verticalPlacement?: Position | string | undefined;\n /** Vertical shift of the tooltip in pixels. Works only with\n * `verticalPlacement` set to `Position.Top` or `Position.Bottom`.\n * Default: `0` */\n verticalShift?: number;\n /** Defines the content of the tooltip and hovering over which elements should trigger it.\n * An object containing properties in the following format:\n *\n * ```\n * {\n *  [selectorString]: (d: unknown) => string | HTMLElement\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  [Area.selectors.area]: (d: AreaDatum[]) => `<div>${d.value.toString()}</div>\n * }\n * ```\n */\n triggers?: {\n [selector: string]: ((data: any, i: number, elements: (HTMLElement | SVGElement)[]) => string | HTMLElement | undefined | null | void) | undefined | null;\n };\n /** Custom DOM attributes for the tooltip. Useful when you need to refer to a specific tooltip instance\n * by using a CSS selector. Attributes configuration object has the following structure:\n *\n * ```\n * {\n *  [attributeName]: attribute value\n * }\n * ```\n * e.g.:\n * ```\n * {\n *  'type': 'area-tooltip',\n *  'value': 42\n * }\n * ```\n */\n attributes?: { [attr: string]: string | number | boolean };\n /** Custom class name for the tooltip. Default: `undefined` */\n className?: string;\n /** Hide delay in milliseconds. Default: `undefined` */\n hideDelay?: number;\n /** Show delay in milliseconds. Default: `undefined` */\n showDelay?: number;\n}\n\nexport const TooltipDefaultConfig: TooltipConfigInterface = {\n components: [],\n container: undefined,\n followCursor: true,\n allowHover: false,\n horizontalPlacement: Position.Auto,\n horizontalShift: 0,\n verticalPlacement: Position.Top,\n verticalShift: 0,\n attributes: {},\n triggers: {},\n className: undefined,\n showDelay: undefined,\n hideDelay: undefined,\n}\n\n"],"names":[],"mappings":";;AAGA;AAmEa,MAAA,oBAAoB,GAA2B;AAC1D,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,UAAU,EAAE,KAAK;IACjB,mBAAmB,EAAE,QAAQ,CAAC,IAAI;AAClC,IAAA,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,QAAQ,CAAC,GAAG;AAC/B,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,SAAS;;;;;"}
@@ -19,6 +19,8 @@ export declare class Tooltip {
19
19
  private _hoveredElement;
20
20
  private _position;
21
21
  private _overriddenHorizontalPlacement;
22
+ private _hideDelayTimeoutId;
23
+ private _showDelayTimeoutId;
22
24
  constructor(config?: TooltipConfigInterface);
23
25
  setConfig(config: TooltipConfigInterface): void;
24
26
  setContainer(container: HTMLElement): void;
@@ -26,14 +28,16 @@ export declare class Tooltip {
26
28
  hasContainer(): boolean;
27
29
  setComponents(components: ComponentCore<unknown>[]): void;
28
30
  update(): void;
29
- /** Show the tooltip by providing content and position */
31
+ /** Show the tooltip immediately by providing content and position */
30
32
  show(html: string | HTMLElement | null | void, pos: {
31
33
  x: number;
32
34
  y: number;
33
35
  }): void;
34
- /** Hide the tooltip */
36
+ private _hide;
37
+ /** Hides the tooltip after `hideDelay` */
35
38
  hide(): void;
36
- /** Simply displays the tooltip with its previous content on position */
39
+ private _display;
40
+ /** Simply display the tooltip with its previous content on position, taking into account `showDelay` */
37
41
  display(): void;
38
42
  place(pos: {
39
43
  x: number;
@@ -13,7 +13,10 @@ class Tooltip {
13
13
  this._setContainerPositionThrottled = throttle(this._setContainerPosition, 500);
14
14
  this._isShown = false;
15
15
  this.element = document.createElement('div');
16
- this.div = select(this.element).attr('class', root);
16
+ this.div = select(this.element)
17
+ .attr('class', root)
18
+ .classed(show, false)
19
+ .classed(hidden, true);
17
20
  this.setConfig(config);
18
21
  this.components = this.config.components;
19
22
  // Set up MutationObserver to automatically re-position the tooltip
@@ -66,13 +69,12 @@ class Tooltip {
66
69
  return;
67
70
  this._setUpEventsThrottled();
68
71
  }
69
- /** Show the tooltip by providing content and position */
72
+ /** Show the tooltip immediately by providing content and position */
70
73
  show(html, pos) {
71
74
  this.render(html);
72
75
  this.place(pos);
73
76
  }
74
- /** Hide the tooltip */
75
- hide() {
77
+ _hide() {
76
78
  this.div
77
79
  .classed(show, false) // The `show` class triggers the opacity transition
78
80
  .on('transitionend', () => {
@@ -82,13 +84,39 @@ class Tooltip {
82
84
  });
83
85
  this._isShown = false;
84
86
  }
85
- /** Simply displays the tooltip with its previous content on position */
86
- display() {
87
+ /** Hides the tooltip after `hideDelay` */
88
+ hide() {
89
+ window.clearTimeout(this._showDelayTimeoutId);
90
+ if (this.config.hideDelay) {
91
+ window.clearTimeout(this._hideDelayTimeoutId);
92
+ this._hideDelayTimeoutId = setTimeout(() => this._hide(), this.config.hideDelay);
93
+ }
94
+ else {
95
+ this._hide();
96
+ }
97
+ }
98
+ _display() {
99
+ window.clearTimeout(this._hideDelayTimeoutId);
87
100
  this.div
88
101
  .classed(hidden, false) // The `hidden` class sets `display: none;`
89
102
  .classed(show, true); // The `show` class triggers the opacity transition
90
103
  this._isShown = true;
91
104
  }
105
+ /** Simply display the tooltip with its previous content on position, taking into account `showDelay` */
106
+ display() {
107
+ if (this._isShown)
108
+ return;
109
+ if (this.config.showDelay) {
110
+ window.clearTimeout(this._showDelayTimeoutId);
111
+ this._showDelayTimeoutId = setTimeout(() => {
112
+ this._display();
113
+ this.place({ x: this._position[0], y: this._position[1] });
114
+ }, this.config.showDelay);
115
+ }
116
+ else {
117
+ this._display();
118
+ }
119
+ }
92
120
  place(pos) {
93
121
  this._position = [pos.x, pos.y];
94
122
  if (!this.hasContainer()) {
@@ -202,7 +230,7 @@ class Tooltip {
202
230
  }
203
231
  this.div
204
232
  .classed((_a = config.className) !== null && _a !== void 0 ? _a : '', Boolean(config.className))
205
- .classed(nonInteractive, !config.allowHover || config.followCursor);
233
+ .classed(nonInteractive, !config.allowHover);
206
234
  // Remove the previous class name if it was set
207
235
  if ((prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.className) && prevConfig.className !== config.className) {
208
236
  this.div.classed(prevConfig.className, false);
@@ -303,9 +331,9 @@ class Tooltip {
303
331
  });
304
332
  });
305
333
  // Set up Tooltip hover
306
- if (config.allowHover && !config.followCursor) {
334
+ if (config.allowHover) {
307
335
  this.div
308
- .on('mouseenter.tooltip', this.display.bind(this))
336
+ .on('mouseenter.tooltip', this._display.bind(this))
309
337
  .on('mouseleave.tooltip', this.hide.bind(this));
310
338
  }
311
339
  else {
@@ -325,6 +353,8 @@ class Tooltip {
325
353
  destroy() {
326
354
  var _a;
327
355
  this._mutationObserver.disconnect();
356
+ window.clearTimeout(this._hideDelayTimeoutId);
357
+ window.clearTimeout(this._showDelayTimeoutId);
328
358
  (_a = this.div) === null || _a === void 0 ? void 0 : _a.remove();
329
359
  }
330
360
  }
@@ -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 private _mutationObserver: MutationObserver\n private _hoveredElement: HTMLElement | SVGElement\n private _position: [number, number]\n private _overriddenHorizontalPlacement: Position.Left | Position.Right | string | undefined\n\n constructor (config: TooltipConfigInterface = {}) {\n this.element = document.createElement('div')\n this.div = select(this.element).attr('class', s.root)\n\n this.setConfig(config)\n this.components = this.config.components\n\n // Set up MutationObserver to automatically re-position the tooltip\n // if the content has been dynamically changed\n this._mutationObserver = new MutationObserver(() => {\n if (!this._isShown) return\n\n // Handle changes to the content of this.div\n // Add your logic here\n if (!this.config.followCursor && this._hoveredElement) {\n this.placeByElement(this._hoveredElement)\n } else if (this._position) {\n this.place({ x: this._position[0], y: this._position[1] })\n }\n })\n\n this._mutationObserver.observe(this.div.node(), { childList: true, subtree: true })\n }\n\n public setConfig (config: TooltipConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n\n // Reset `this._overriddenHorizontalPlacement` if the `horizontalPlacement` has changed\n if (this.prevConfig.horizontalPlacement !== this.config.horizontalPlacement) {\n this.overrideHorizontalPlacement(undefined)\n }\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 /** Show the tooltip by providing content and position */\n public show (html: string | HTMLElement | null | void, pos: { x: number; y: number }): void {\n this.render(html)\n this.place(pos)\n }\n\n /** Hide the tooltip */\n public hide (): void {\n this.div\n .classed(s.show, false) // The `show` class triggers the opacity transition\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 /** Simply displays the tooltip with its previous content on position */\n public display (): void {\n this.div\n .classed(s.hidden, false) // The `hidden` class sets `display: none;`\n .classed(s.show, true) // The `show` class triggers the opacity transition\n\n this._isShown = true\n }\n\n public place (pos: { x: number; y: number }): void {\n this._position = [pos.x, pos.y]\n\n if (!this.hasContainer()) {\n console.warn('Unovis | Tooltip: Container was not set or is not initialized yet')\n return\n }\n\n const { config } = this\n const tooltipWidth = this.element.offsetWidth\n const tooltipHeight = this.element.offsetHeight\n\n const horizontalPlacement = this._overriddenHorizontalPlacement ||\n (config.horizontalPlacement === Position.Auto\n ? Position.Center\n : config.horizontalPlacement)\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? ((pos.y - tooltipHeight) < 0 ? Position.Bottom : Position.Top)\n : config.verticalPlacement\n\n // Todo: Get rid of the hardcoded margin in version 2.0\n // Can be simply replaced with `verticalShift` and `horizontalShift`\n // but it'll be a breaking change\n const margin = 5\n const translateX = horizontalPlacement === Position.Left ? -tooltipWidth - margin - config.horizontalShift\n : horizontalPlacement === Position.Center ? -tooltipWidth / 2\n : margin + config.horizontalShift\n\n const translateY = verticalPlacement === Position.Bottom ? margin + config.verticalShift\n : verticalPlacement === Position.Center ? -tooltipHeight / 2\n : -margin - config.verticalShift - tooltipHeight\n\n // translateX and translateY variables shift the tooltip from the default position (above the cursor, centred horizontally)\n const [top, left] = this._constraintPosToContainer(pos.x + translateX, pos.y + translateY, tooltipWidth, tooltipHeight)\n this._applyPosition(top, left, tooltipHeight)\n }\n\n public placeByElement (hoveredElement: SVGElement | HTMLElement): void {\n const { config } = this\n\n // Store the hovered element and the event for future reference,\n // i.e. to re-position the tooltip if the content has been changed\n // by something else and it was captured by the MutationObserver\n this._hoveredElement = hoveredElement\n\n // Todo: Get rid of the hardcoded margin in version 2.0\n // Can be simply replaced with `verticalShift` and `horizontalShift`\n // but it'll be a breaking change\n const margin = 5\n const tooltipWidth = this.element.offsetWidth\n const tooltipHeight = this.element.offsetHeight\n const isContainerBody = this.isContainerBody()\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n const hoveredElementRect = hoveredElement.getBoundingClientRect()\n\n // We use D3's point transformation to get the correct position of the element by pretending it's a pointer event\n // See more: https://github.com/d3/d3-selection/blob/main/src/pointer.js\n const elementPos = isContainerBody ? [hoveredElementRect.x, hoveredElementRect.y] : pointer({\n clientX: hoveredElementRect.x,\n clientY: hoveredElementRect.y,\n pageX: hoveredElementRect.x,\n pageY: hoveredElementRect.y,\n }, this._container)\n\n const horizontalPlacement = this._overriddenHorizontalPlacement || (\n config.horizontalPlacement === Position.Auto\n ? (elementPos[0] - tooltipWidth < 0 ? Position.Right\n : elementPos[0] + tooltipWidth > containerWidth ? Position.Left : Position.Center)\n : config.horizontalPlacement\n )\n\n let translateX = 0\n switch (horizontalPlacement) {\n case Position.Left:\n translateX = -tooltipWidth - margin - config.horizontalShift\n break\n case Position.Right:\n translateX = hoveredElementRect.width + margin + config.horizontalShift\n break\n case Position.Center:\n default:\n translateX = (-tooltipWidth + hoveredElementRect.width) / 2\n break\n }\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? (horizontalPlacement !== Position.Center ? Position.Center\n : elementPos[1] - tooltipHeight < 0 ? Position.Bottom : Position.Top)\n : config.verticalPlacement\n\n let translateY = -tooltipHeight\n switch (verticalPlacement) {\n case Position.Center:\n translateY += (tooltipHeight + hoveredElementRect.height) / 2\n break\n case Position.Bottom:\n translateY += tooltipHeight + hoveredElementRect.height + margin + config.verticalShift\n break\n case Position.Top:\n default:\n translateY += -margin - config.verticalShift\n break\n }\n\n const [top, left] = this._constraintPosToContainer(elementPos[0] + translateX, elementPos[1] + translateY, tooltipWidth, tooltipHeight)\n this._applyPosition(top, left, tooltipHeight)\n }\n\n public isContainerBody (): boolean {\n return this._container === document.body\n }\n\n /** Allows to override the horizontal placement of the tooltip which is useful when you want to define custom positioning behavior.\n * This method has been added for Crosshair to allow it position tooltip left or right of the crosshair line\n * (see the `_showTooltip` method of the Crosshair component).\n */\n public overrideHorizontalPlacement (placement: Position.Left | Position.Right | string | undefined): void {\n this._overriddenHorizontalPlacement = placement\n }\n\n public render (html: string | HTMLElement | null | void): void {\n const { config, prevConfig } = this\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 if (html) {\n this.div.html(html)\n }\n\n this.div\n .classed(config.className ?? '', Boolean(config.className))\n .classed(s.nonInteractive, !config.allowHover || config.followCursor)\n\n // Remove the previous class name if it was set\n if (prevConfig?.className && prevConfig.className !== config.className) {\n this.div.classed(prevConfig.className, false)\n }\n\n this.display()\n }\n\n private _applyPosition (x: number, y: number, tooltipHeight: number): void {\n const isContainerBody = this.isContainerBody()\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n\n this.div\n .classed(s.positionFixed, isContainerBody)\n .style('top', isContainerBody ? `${y}px` : 'unset')\n .style('bottom', !isContainerBody ? `${containerHeight - y - tooltipHeight}px` : 'unset')\n .style('left', `${x}px`)\n }\n\n private _constraintPosToContainer (top: number, left: number, tooltipWidth: number, tooltipHeight: number): [number, number] {\n const isContainerBody = this.isContainerBody()\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n\n // // Constraint to container\n const paddingX = 10\n const hitRight = top > (containerWidth - tooltipWidth - paddingX)\n const hitLeft = top < paddingX\n const constrainedLeft = hitRight ? containerWidth - tooltipWidth - paddingX\n : hitLeft ? paddingX : top\n\n const paddingY = 10\n const hitBottom = left > (containerHeight - tooltipHeight - paddingY)\n const hitTop = left < paddingY\n const constrainedTop = hitBottom ? containerHeight - tooltipHeight - paddingY\n : hitTop ? paddingY : left\n\n return [\n containerWidth < tooltipWidth ? 0 : constrainedLeft,\n containerHeight < tooltipHeight ? 0 : constrainedTop,\n ]\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 (this._container !== document.body && getComputedStyle(this._container)?.position === 'static') {\n this._container.style.position = 'relative'\n }\n }\n\n private _setUpEvents (): void {\n const { config } = this\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 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(config.triggers)) {\n const template = config.triggers[className]\n if (!template) continue // Skip if the trigger is not configured\n\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 const [x, y] = this.isContainerBody() ? [e.clientX, e.clientY] : pointer(e, this._container)\n if (content === null) {\n // If the content is `null`, we hide the tooltip\n this.hide()\n } else {\n // Otherwise we show the tooltip, but don't render the content if it's `undefined` or\n // an empty string. This way we can allow it to work with things like `createPortal` in React\n this.render(content)\n if (config.followCursor) this.place({ x, y })\n else this.placeByElement(el)\n }\n\n // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n e.stopPropagation()\n\n // Stop looking for other matches\n return\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 // Set up Tooltip hover\n if (config.allowHover && !config.followCursor) {\n this.div\n .on('mouseenter.tooltip', this.display.bind(this))\n .on('mouseleave.tooltip', this.hide.bind(this))\n } else {\n this.div\n .on('mouseenter.tooltip', null)\n .on('mouseleave.tooltip', null)\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._mutationObserver.disconnect()\n this.div?.remove()\n }\n}\n"],"names":["s.root","s.show","s.hidden","s.nonInteractive","s.positionFixed","s"],"mappings":";;;;;;;MAiBa,OAAO,CAAA;AAiBlB,IAAA,WAAA,CAAa,SAAiC,EAAE,EAAA;QAdtC,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;QAQtB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;AAC5C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iB,CAAC,UAAU,EAAE,CAAA;AACnC,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,GAAG,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,EAAE,CAAA;KACnB;;AApXM,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 private _mutationObserver: MutationObserver\n private _hoveredElement: HTMLElement | SVGElement\n private _position: [number, number]\n private _overriddenHorizontalPlacement: Position.Left | Position.Right | string | undefined\n private _hideDelayTimeoutId: ReturnType<typeof setTimeout> | undefined\n private _showDelayTimeoutId: ReturnType<typeof setTimeout> | undefined\n\n constructor (config: TooltipConfigInterface = {}) {\n this.element = document.createElement('div')\n this.div = select(this.element)\n .attr('class', s.root)\n .classed(s.show, false)\n .classed(s.hidden, true)\n\n this.setConfig(config)\n this.components = this.config.components\n\n // Set up MutationObserver to automatically re-position the tooltip\n // if the content has been dynamically changed\n this._mutationObserver = new MutationObserver(() => {\n if (!this._isShown) return\n\n // Handle changes to the content of this.div\n // Add your logic here\n if (!this.config.followCursor && this._hoveredElement) {\n this.placeByElement(this._hoveredElement)\n } else if (this._position) {\n this.place({ x: this._position[0], y: this._position[1] })\n }\n })\n\n this._mutationObserver.observe(this.div.node(), { childList: true, subtree: true })\n }\n\n public setConfig (config: TooltipConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n\n // Reset `this._overriddenHorizontalPlacement` if the `horizontalPlacement` has changed\n if (this.prevConfig.horizontalPlacement !== this.config.horizontalPlacement) {\n this.overrideHorizontalPlacement(undefined)\n }\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 /** Show the tooltip immediately by providing content and position */\n public show (html: string | HTMLElement | null | void, pos: { x: number; y: number }): void {\n this.render(html)\n this.place(pos)\n }\n\n private _hide (): void {\n this.div\n .classed(s.show, false) // The `show` class triggers the opacity transition\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 /** Hides the tooltip after `hideDelay` */\n public hide (): void {\n window.clearTimeout(this._showDelayTimeoutId)\n if (this.config.hideDelay) {\n window.clearTimeout(this._hideDelayTimeoutId)\n this._hideDelayTimeoutId = setTimeout(() => this._hide(), this.config.hideDelay)\n } else {\n this._hide()\n }\n }\n\n private _display (): void {\n window.clearTimeout(this._hideDelayTimeoutId)\n this.div\n .classed(s.hidden, false) // The `hidden` class sets `display: none;`\n .classed(s.show, true) // The `show` class triggers the opacity transition\n\n this._isShown = true\n }\n\n /** Simply display the tooltip with its previous content on position, taking into account `showDelay` */\n public display (): void {\n if (this._isShown) return\n\n if (this.config.showDelay) {\n window.clearTimeout(this._showDelayTimeoutId)\n this._showDelayTimeoutId = setTimeout(() => {\n this._display()\n this.place({ x: this._position[0], y: this._position[1] })\n }, this.config.showDelay)\n } else {\n this._display()\n }\n }\n\n public place (pos: { x: number; y: number }): void {\n this._position = [pos.x, pos.y]\n\n if (!this.hasContainer()) {\n console.warn('Unovis | Tooltip: Container was not set or is not initialized yet')\n return\n }\n\n const { config } = this\n const tooltipWidth = this.element.offsetWidth\n const tooltipHeight = this.element.offsetHeight\n\n const horizontalPlacement = this._overriddenHorizontalPlacement ||\n (config.horizontalPlacement === Position.Auto\n ? Position.Center\n : config.horizontalPlacement)\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? ((pos.y - tooltipHeight) < 0 ? Position.Bottom : Position.Top)\n : config.verticalPlacement\n\n // Todo: Get rid of the hardcoded margin in version 2.0\n // Can be simply replaced with `verticalShift` and `horizontalShift`\n // but it'll be a breaking change\n const margin = 5\n const translateX = horizontalPlacement === Position.Left ? -tooltipWidth - margin - config.horizontalShift\n : horizontalPlacement === Position.Center ? -tooltipWidth / 2\n : margin + config.horizontalShift\n\n const translateY = verticalPlacement === Position.Bottom ? margin + config.verticalShift\n : verticalPlacement === Position.Center ? -tooltipHeight / 2\n : -margin - config.verticalShift - tooltipHeight\n\n // translateX and translateY variables shift the tooltip from the default position (above the cursor, centred horizontally)\n const [top, left] = this._constraintPosToContainer(pos.x + translateX, pos.y + translateY, tooltipWidth, tooltipHeight)\n this._applyPosition(top, left, tooltipHeight)\n }\n\n public placeByElement (hoveredElement: SVGElement | HTMLElement): void {\n const { config } = this\n\n // Store the hovered element and the event for future reference,\n // i.e. to re-position the tooltip if the content has been changed\n // by something else and it was captured by the MutationObserver\n this._hoveredElement = hoveredElement\n\n // Todo: Get rid of the hardcoded margin in version 2.0\n // Can be simply replaced with `verticalShift` and `horizontalShift`\n // but it'll be a breaking change\n const margin = 5\n const tooltipWidth = this.element.offsetWidth\n const tooltipHeight = this.element.offsetHeight\n const isContainerBody = this.isContainerBody()\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n const hoveredElementRect = hoveredElement.getBoundingClientRect()\n\n // We use D3's point transformation to get the correct position of the element by pretending it's a pointer event\n // See more: https://github.com/d3/d3-selection/blob/main/src/pointer.js\n const elementPos = isContainerBody ? [hoveredElementRect.x, hoveredElementRect.y] : pointer({\n clientX: hoveredElementRect.x,\n clientY: hoveredElementRect.y,\n pageX: hoveredElementRect.x,\n pageY: hoveredElementRect.y,\n }, this._container)\n\n const horizontalPlacement = this._overriddenHorizontalPlacement || (\n config.horizontalPlacement === Position.Auto\n ? (elementPos[0] - tooltipWidth < 0 ? Position.Right\n : elementPos[0] + tooltipWidth > containerWidth ? Position.Left : Position.Center)\n : config.horizontalPlacement\n )\n\n let translateX = 0\n switch (horizontalPlacement) {\n case Position.Left:\n translateX = -tooltipWidth - margin - config.horizontalShift\n break\n case Position.Right:\n translateX = hoveredElementRect.width + margin + config.horizontalShift\n break\n case Position.Center:\n default:\n translateX = (-tooltipWidth + hoveredElementRect.width) / 2\n break\n }\n\n const verticalPlacement = config.verticalPlacement === Position.Auto\n ? (horizontalPlacement !== Position.Center ? Position.Center\n : elementPos[1] - tooltipHeight < 0 ? Position.Bottom : Position.Top)\n : config.verticalPlacement\n\n let translateY = -tooltipHeight\n switch (verticalPlacement) {\n case Position.Center:\n translateY += (tooltipHeight + hoveredElementRect.height) / 2\n break\n case Position.Bottom:\n translateY += tooltipHeight + hoveredElementRect.height + margin + config.verticalShift\n break\n case Position.Top:\n default:\n translateY += -margin - config.verticalShift\n break\n }\n\n const [top, left] = this._constraintPosToContainer(elementPos[0] + translateX, elementPos[1] + translateY, tooltipWidth, tooltipHeight)\n this._applyPosition(top, left, tooltipHeight)\n }\n\n public isContainerBody (): boolean {\n return this._container === document.body\n }\n\n /** Allows to override the horizontal placement of the tooltip which is useful when you want to define custom positioning behavior.\n * This method has been added for Crosshair to allow it position tooltip left or right of the crosshair line\n * (see the `_showTooltip` method of the Crosshair component).\n */\n public overrideHorizontalPlacement (placement: Position.Left | Position.Right | string | undefined): void {\n this._overriddenHorizontalPlacement = placement\n }\n\n public render (html: string | HTMLElement | null | void): void {\n const { config, prevConfig } = this\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 if (html) {\n this.div.html(html)\n }\n\n this.div\n .classed(config.className ?? '', Boolean(config.className))\n .classed(s.nonInteractive, !config.allowHover)\n\n // Remove the previous class name if it was set\n if (prevConfig?.className && prevConfig.className !== config.className) {\n this.div.classed(prevConfig.className, false)\n }\n\n this.display()\n }\n\n private _applyPosition (x: number, y: number, tooltipHeight: number): void {\n const isContainerBody = this.isContainerBody()\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n\n this.div\n .classed(s.positionFixed, isContainerBody)\n .style('top', isContainerBody ? `${y}px` : 'unset')\n .style('bottom', !isContainerBody ? `${containerHeight - y - tooltipHeight}px` : 'unset')\n .style('left', `${x}px`)\n }\n\n private _constraintPosToContainer (top: number, left: number, tooltipWidth: number, tooltipHeight: number): [number, number] {\n const isContainerBody = this.isContainerBody()\n const containerHeight = isContainerBody ? window.innerHeight : this._container.scrollHeight\n const containerWidth = isContainerBody ? window.innerWidth : this._container.scrollWidth\n\n // // Constraint to container\n const paddingX = 10\n const hitRight = top > (containerWidth - tooltipWidth - paddingX)\n const hitLeft = top < paddingX\n const constrainedLeft = hitRight ? containerWidth - tooltipWidth - paddingX\n : hitLeft ? paddingX : top\n\n const paddingY = 10\n const hitBottom = left > (containerHeight - tooltipHeight - paddingY)\n const hitTop = left < paddingY\n const constrainedTop = hitBottom ? containerHeight - tooltipHeight - paddingY\n : hitTop ? paddingY : left\n\n return [\n containerWidth < tooltipWidth ? 0 : constrainedLeft,\n containerHeight < tooltipHeight ? 0 : constrainedTop,\n ]\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 (this._container !== document.body && getComputedStyle(this._container)?.position === 'static') {\n this._container.style.position = 'relative'\n }\n }\n\n private _setUpEvents (): void {\n const { config } = this\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 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(config.triggers)) {\n const template = config.triggers[className]\n if (!template) continue // Skip if the trigger is not configured\n\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 const [x, y] = this.isContainerBody() ? [e.clientX, e.clientY] : pointer(e, this._container)\n if (content === null) {\n // If the content is `null`, we hide the tooltip\n this.hide()\n } else {\n // Otherwise we show the tooltip, but don't render the content if it's `undefined` or\n // an empty string. This way we can allow it to work with things like `createPortal` in React\n this.render(content)\n if (config.followCursor) this.place({ x, y })\n else this.placeByElement(el)\n }\n\n // Stop propagation to prevent other interfering events from being triggered, e.g. Crosshair\n e.stopPropagation()\n\n // Stop looking for other matches\n return\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 // Set up Tooltip hover\n if (config.allowHover) {\n this.div\n .on('mouseenter.tooltip', this._display.bind(this))\n .on('mouseleave.tooltip', this.hide.bind(this))\n } else {\n this.div\n .on('mouseenter.tooltip', null)\n .on('mouseleave.tooltip', null)\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._mutationObserver.disconnect()\n window.clearTimeout(this._hideDelayTimeoutId)\n window.clearTimeout(this._showDelayTimeoutId)\n this.div?.remove()\n }\n}\n"],"names":["s.root","s.show","s.hidden","s.nonInteractive","s.positionFixed","s"],"mappings":";;;;;;;MAiBa,OAAO,CAAA;AAmBlB,IAAA,WAAA,CAAa,SAAiC,EAAE,EAAA;QAhBtC,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;QAUtB,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,IAAM,CAAC;AACrB,aAAA,OAAO,CAACC,IAAM,EAAE,KAAK,CAAC;AACtB,aAAA,OAAO,CAACC,MAAQ,EAAE,IAAI,CAAC,CAAA;AAE1B,QAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACtB,IAAI,CAAC,UAA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  const { config, datamodel } = this;
43
43
  const xRange = this.xScale.range();
44
- const yRange = this.xScale.range();
44
+ const yRange = this.yScale.range();
45
45
  const labels = (_b = (_a = datamodel.data) === null || _a === void 0 ? void 0 : _a.reduce((acc, d) => {
46
46
  const xPositioning = getValue(d, config.xPositioning);
47
47
  const yPositioning = getValue(d, config.yPositioning);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getValue, isNumber, isNumberWithinRange } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'\n\n// Config\nimport { XYLabelsDefaultConfig, XYLabelsConfigInterface } from './config'\n\n// Modules\nimport { createLabels, updateLabels, removeLabels, getLabelRenderProps } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfigInterface<Datum>> {\n static selectors = s\n clippable = false\n protected _defaultConfig = XYLabelsDefaultConfig as XYLabelsConfigInterface<Datum>\n public config: XYLabelsConfigInterface<Datum> = this._defaultConfig\n\n events = {\n [XYLabels.selectors.label]: {},\n }\n\n constructor (config?: XYLabelsConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const labelGroups = this.g\n .selectAll<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>>(`.${s.labelGroup}`)\n .data(this._getDataToRender())\n\n const labelGroupsExit = labelGroups.exit<XYLabel<Datum> | XYLabelCluster<Datum>>()\n removeLabels(labelGroupsExit, duration)\n\n const labelGroupsEnter = labelGroups.enter().append('g')\n .attr('class', s.labelGroup)\n .call(createLabels)\n\n const labelGroupsMerged = labelGroupsEnter\n .merge(labelGroups)\n .classed(s.cluster, d => !!(d as XYLabelCluster<Datum>).records)\n .classed(s.label, d => !(d as XYLabelCluster<Datum>).records)\n\n labelGroupsMerged.call(updateLabels, config, duration)\n }\n\n private _getDataToRender (): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const { config, datamodel } = this\n\n const xRange = this.xScale.range() as [number, number]\n const yRange = this.xScale.range() as [number, number]\n\n const labels = datamodel.data?.reduce<XYLabel<Datum>[]>((acc, d) => {\n const xPositioning = getValue<Datum, XYLabelPositioning>(d, config.xPositioning)\n const yPositioning = getValue<Datum, XYLabelPositioning>(d, config.yPositioning)\n const props = getLabelRenderProps(d, this.element, config, this.xScale, this.yScale)\n\n if (\n ((xPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.x, xRange)) &&\n ((yPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.y, yRange))\n ) {\n acc.push({ ...d, _screen: props })\n }\n\n return acc\n }, []) ?? []\n\n return config.clustering ? this._getClusteredLabels(labels) : labels\n }\n\n private _getClusteredLabels (labels: XYLabel<Datum>[]): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const labelsNonOverlapping = [...labels]\n const clusterMap = new Map<XYLabel<Datum>, XYLabel<Datum>[]>()\n for (let i = 0; i < labelsNonOverlapping.length; i += 1) {\n const label1 = labelsNonOverlapping[i]\n for (let j = i + 1; j < labelsNonOverlapping.length; j += 1) {\n const label2 = labelsNonOverlapping[j]\n const isIntersecting = rectIntersect(label1._screen, label2._screen)\n if (isIntersecting) {\n if (!clusterMap.has(label1)) clusterMap.set(label1, [label1])\n clusterMap.get(label1).push(label2)\n labelsNonOverlapping.splice(j, 1)\n j -= 1\n }\n }\n\n if (clusterMap.has(label1)) {\n labelsNonOverlapping.splice(i, 1)\n i -= 1\n }\n }\n\n const clusters = Array.from(clusterMap.values()).map(records => ({\n _screen: getLabelRenderProps(records, this.element, this.config, this.xScale, this.yScale),\n records,\n }))\n\n return [...labelsNonOverlapping, ...clusters]\n }\n}\n"],"names":["s.labelGroup","s.cluster","s.label","s"],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CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBACjC,CAAC,IAAI,CAAC,CAAA;AACP,iBAAA;AACF,aAAA;AAED,YAAA,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC1B,gBAAA,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBACjC,CAAC,IAAI,CAAC,CAAA;AACP,aAAA;AACF,SAAA;AAED,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,KAAK;YAC/D,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAC1F,OAAO;AACR,SAAA,CAAC,CAAC,CAAA;AAEH,QAAA,OAAO,CAAC,GAAG,oBAAoB,EAAE,GAAG,QAAQ,CAAC,CAAA;KAC9C;;AAzFM,QAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.ts"],"sourcesContent":["// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getValue, isNumber, isNumberWithinRange } from 'utils/data'\nimport { rectIntersect } from 'utils/misc'\n\n// Local Types\nimport { XYLabelCluster, XYLabel, XYLabelPositioning } from './types'\n\n// Config\nimport { XYLabelsDefaultConfig, XYLabelsConfigInterface } from './config'\n\n// Modules\nimport { createLabels, updateLabels, removeLabels, getLabelRenderProps } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class XYLabels<Datum> extends XYComponentCore<Datum, XYLabelsConfigInterface<Datum>> {\n static selectors = s\n clippable = false\n protected _defaultConfig = XYLabelsDefaultConfig as XYLabelsConfigInterface<Datum>\n public config: XYLabelsConfigInterface<Datum> = this._defaultConfig\n\n events = {\n [XYLabels.selectors.label]: {},\n }\n\n constructor (config?: XYLabelsConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const labelGroups = this.g\n .selectAll<SVGGElement, XYLabel<Datum> | XYLabelCluster<Datum>>(`.${s.labelGroup}`)\n .data(this._getDataToRender())\n\n const labelGroupsExit = labelGroups.exit<XYLabel<Datum> | XYLabelCluster<Datum>>()\n removeLabels(labelGroupsExit, duration)\n\n const labelGroupsEnter = labelGroups.enter().append('g')\n .attr('class', s.labelGroup)\n .call(createLabels)\n\n const labelGroupsMerged = labelGroupsEnter\n .merge(labelGroups)\n .classed(s.cluster, d => !!(d as XYLabelCluster<Datum>).records)\n .classed(s.label, d => !(d as XYLabelCluster<Datum>).records)\n\n labelGroupsMerged.call(updateLabels, config, duration)\n }\n\n private _getDataToRender (): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const { config, datamodel } = this\n\n const xRange = this.xScale.range() as [number, number]\n const yRange = this.yScale.range() as [number, number]\n\n const labels = datamodel.data?.reduce<XYLabel<Datum>[]>((acc, d) => {\n const xPositioning = getValue<Datum, XYLabelPositioning>(d, config.xPositioning)\n const yPositioning = getValue<Datum, XYLabelPositioning>(d, config.yPositioning)\n const props = getLabelRenderProps(d, this.element, config, this.xScale, this.yScale)\n\n if (\n ((xPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.x, xRange)) &&\n ((yPositioning !== XYLabelPositioning.DataSpace) || isNumberWithinRange(props.y, yRange))\n ) {\n acc.push({ ...d, _screen: props })\n }\n\n return acc\n }, []) ?? []\n\n return config.clustering ? this._getClusteredLabels(labels) : labels\n }\n\n private _getClusteredLabels (labels: XYLabel<Datum>[]): (XYLabel<Datum> | XYLabelCluster<Datum>)[] {\n const labelsNonOverlapping = [...labels]\n const clusterMap = new Map<XYLabel<Datum>, XYLabel<Datum>[]>()\n for (let i = 0; i < labelsNonOverlapping.length; i += 1) {\n const label1 = labelsNonOverlapping[i]\n for (let j = i + 1; j < labelsNonOverlapping.length; j += 1) {\n const label2 = labelsNonOverlapping[j]\n const isIntersecting = rectIntersect(label1._screen, label2._screen)\n if (isIntersecting) {\n if (!clusterMap.has(label1)) clusterMap.set(label1, [label1])\n clusterMap.get(label1).push(label2)\n labelsNonOverlapping.splice(j, 1)\n j -= 1\n }\n }\n\n if (clusterMap.has(label1)) {\n labelsNonOverlapping.splice(i, 1)\n i -= 1\n }\n }\n\n const clusters = Array.from(clusterMap.values()).map(records => ({\n _screen: getLabelRenderProps(records, this.element, this.config, this.xScale, this.yScale),\n records,\n }))\n\n return [...labelsNonOverlapping, ...clusters]\n }\n}\n"],"names":["s.labelGroup","s.cluster","s.label","s"],"mappings":";;;;;;;;;AAAA;AAmBM,MAAO,QAAgB,SAAQ,eAAsD,CAAA;AAUzF,IAAA,WAAA,CAAa,MAAuC,EAAA;AAClD,QAAA,KAAK,EAAE,CAAA;QATT,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;QACP,IAAc,CAAA,cAAA,GAAG,qBAAuD,CAAA;AAC3E,QAAA,IAAA,CAAA,MAAM,GAAmC,IAAI,CAAC,cAAc,CAAA;AAEnE,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,GAAG,EAAE;SAC/B,CAAA;AAIC,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;AAED,IAAA,OAAO,CAAE,cAAuB,EAAA;AAC9B,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AACvB,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;AAE5E,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC;AACvB,aAAA,SAAS,CAAsD,CAAI,CAAA,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/axis/types.js';
52
52
  export { ChordLabelAlignment } from './components/chord-diagram/types.js';
53
53
  export { MapPointLabelPosition, MapProjection, MapProjectionKind } from './components/topojson-map/types.js';
54
54
  export { LeafletMapPointShape, LeafletMapRenderer } from './components/leaflet-map/types.js';
55
- export { GraphLayoutType, GraphLinkArrowStyle, GraphLinkStyle, GraphNodeSelectionHighlightMode, GraphNodeShape } from './components/graph/types.js';
55
+ export { GraphFitViewAlignment, GraphLayoutType, GraphLinkArrowStyle, GraphLinkStyle, GraphNodeSelectionHighlightMode, GraphNodeShape } from './components/graph/types.js';
56
56
  export { SankeyEnterTransitionType, SankeyExitTransitionType, SankeyLayout, SankeyNodeAlign, SankeySubLabelPlacement } from './components/sankey/types.js';
57
57
  export { VisControlsOrientation } from './components/vis-controls/types.js';
58
58
  export { FreeBrushMode } from './components/free-brush/types.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unovis/ts",
3
3
  "description": "Modular data visualization framework for React, Angular, Svelte, Vue, Solid, and vanilla TypeScript or JavaScript",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "packageManager": "npm@10.9.1",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,7 +22,8 @@
22
22
  "author": "Nikita Rokotyan, F5 Inc. <nikita@f5.com> (https://rokotyan.com)",
23
23
  "maintainers": [
24
24
  "Nikita Rokotyan <nikita@f5.com> (https://rokotyan.com)",
25
- "Rebecca Bol <r.bol@f5.com>"
25
+ "Qian Liu <qi.liu@f5.com>",
26
+ "Surya Hanumandla <s.hanumandla@f5.com>"
26
27
  ],
27
28
  "license": "Apache-2.0",
28
29
  "main": "./index.js",
@@ -31,12 +32,12 @@
31
32
  "type": "module",
32
33
  "sideEffects": [
33
34
  "styles/index.js",
34
- "lib/styles/index.js"
35
+ "dist/styles/index.js"
35
36
  ],
36
37
  "scripts": {
37
- "build": "sha=$(tar cf - ./src | shasum); if [[ $(echo $sha) == $(< .srcsha) ]] && [[ -d \"./lib\" ]]; then echo \"Lib Build Exists\"; else npm run forcebuild; echo $sha > .srcsha; fi",
38
- "forcebuild": "rimraf lib; rollup -c",
39
- "publish:dist": "rm -rf lib/.cache; cp ./{LICENSE,README.md,package.json} ./lib; cd ./lib; npm publish"
38
+ "build": "sha=$(tar cf - ./src | shasum); if [[ $(echo $sha) == $(< .srcsha) ]] && [[ -d \"./dist\" ]]; then echo \"Lib Build Exists\"; else npm run forcebuild; echo $sha > .srcsha; fi",
39
+ "forcebuild": "rimraf dist; rollup -c; rm -rf dist/.cache; cp LICENSE README.md package.json ./dist",
40
+ "publish:dist": "cd ./dist; npm publish"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@rollup/plugin-json": "^4.1.0",
@@ -74,7 +75,7 @@
74
75
  "d3-geo-projection": "^4.0.0",
75
76
  "d3-interpolate-path": "^2.2.3",
76
77
  "d3-sankey": "^0.12.3",
77
- "elkjs": "^0.8.2",
78
+ "elkjs": "^0.10.0",
78
79
  "geojson": "^0.5.0",
79
80
  "leaflet": "1.7.1",
80
81
  "maplibre-gl": "^2.1.9",
package/types.js CHANGED
@@ -18,7 +18,7 @@ export { ChordLabelAlignment } from './components/chord-diagram/types.js';
18
18
  export { MapPointLabelPosition, MapProjection, MapProjectionKind } from './components/topojson-map/types.js';
19
19
  export { LeafletMapPointShape, LeafletMapRenderer } from './components/leaflet-map/types.js';
20
20
  export { MapLibreArcticDark, MapLibreArcticLight } from './components/leaflet-map/renderer/map-style.js';
21
- export { GraphLayoutType, GraphLinkArrowStyle, GraphLinkStyle, GraphNodeSelectionHighlightMode, GraphNodeShape } from './components/graph/types.js';
21
+ export { GraphFitViewAlignment, GraphLayoutType, GraphLinkArrowStyle, GraphLinkStyle, GraphNodeSelectionHighlightMode, GraphNodeShape } from './components/graph/types.js';
22
22
  export { SankeyEnterTransitionType, SankeyExitTransitionType, SankeyLayout, SankeyNodeAlign, SankeySubLabelPlacement } from './components/sankey/types.js';
23
23
  export { VisControlsOrientation } from './components/vis-controls/types.js';
24
24
  export { FreeBrushMode } from './components/free-brush/types.js';
package/utils/data.js CHANGED
@@ -267,7 +267,7 @@ function filterDataByRange(data, range, accessor) {
267
267
  return filteredData;
268
268
  }
269
269
  function isNumberWithinRange(value, range) {
270
- return (value >= range[0]) && (value <= range[1]);
270
+ return (value >= range[0] && value <= range[1]) || (value >= range[1] && value <= range[0]);
271
271
  }
272
272
  const ensureArray = (value) => {
273
273
  if (value === null || value === undefined) {