Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 26 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { NodeSelection } from '../../components/types'; |
||
2 | import { Colors } from '../../utils/AppConsts'; |
||
3 | import { selectTooltip } from '../../utils/helpers/Selectors'; |
||
4 | |||
5 | export function createTooltip(svgContainer: NodeSelection<SVGGElement>) { |
||
6 | const tooltipElement = svgContainer |
||
7 | .append('g') |
||
8 | .attr('id', 'tooltip') |
||
9 | .attr('data-test-id', 'tooltip') |
||
10 | .style('opacity', 0); |
||
11 | tooltipElement |
||
12 | .append('rect') |
||
13 | .attr('fill', Colors.BLACK) |
||
14 | .attr('rx', 5) |
||
15 | .attr('ry', 5); |
||
16 | tooltipElement.append('text').attr('fill', Colors.WHITE); |
||
17 | } |
||
18 | |||
19 | export function showTooltip() { |
||
20 | selectTooltip().attr('visibility', 'visible'); |
||
21 | } |
||
22 | |||
23 | export function hideTooltip() { |
||
24 | selectTooltip().attr('visibility', 'hidden'); |
||
25 | } |
||
26 |