Passed
Push — master ( e14e22...172c7d )
by
unknown
03:44
created

src/overview/tooltip/tooltip.ts   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 25
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 21
mnd 0
bc 0
fnc 3
dl 0
loc 25
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A tooltip.ts ➔ hideTooltip 0 3 1
A tooltip.ts ➔ createTooltip 0 12 1
A tooltip.ts ➔ showTooltip 0 3 1
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
        .style('opacity', 0);
10
    tooltipElement
11
        .append('rect')
12
        .attr('fill', Colors.BLACK)
13
        .attr('rx', 5)
14
        .attr('ry', 5);
15
    tooltipElement.append('text').attr('fill', Colors.WHITE);
16
}
17
18
export function showTooltip() {
19
    selectTooltip().attr('visibility', 'visible');
20
}
21
22
export function hideTooltip() {
23
    selectTooltip().attr('visibility', 'hidden');
24
}
25