Skip to content

Commit 3a8a68a

Browse files
committed
Merge pull request jacomyal#455 from qinfchen/hoverClass
SVG: add class for hover elements
2 parents 331ffac + ad9b82e commit 3a8a68a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/renderers/svg/sigma.svg.hovers.def.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
// Text
5757
text.innerHTML = node.label;
58+
text.setAttributeNS(null, 'class', settings('classPrefix') + '-hover-label')
5859
text.setAttributeNS(null, 'font-size', fontSize);
5960
text.setAttributeNS(null, 'font-family', settings('font'));
6061
text.setAttributeNS(null, 'fill', fontColor);
@@ -75,12 +76,14 @@
7576
e = Math.round(fontSize / 2 + 2);
7677

7778
// Circle
79+
circle.setAttributeNS(null, 'class', settings('classPrefix') + '-hover-area')
7880
circle.setAttributeNS(null, 'fill', '#fff');
7981
circle.setAttributeNS(null, 'cx', node[prefix + 'x']);
8082
circle.setAttributeNS(null, 'cy', node[prefix + 'y']);
8183
circle.setAttributeNS(null, 'r', e);
8284

8385
// Rectangle
86+
rectangle.setAttributeNS(null, 'class', settings('classPrefix') + '-hover-area')
8487
rectangle.setAttributeNS(null, 'fill', '#fff');
8588
rectangle.setAttributeNS(null, 'x', node[prefix + 'x'] + e / 4);
8689
rectangle.setAttributeNS(null, 'y', node[prefix + 'y'] - e);

0 commit comments

Comments
 (0)