|
2 | 2 |
|
3 | 3 | [![License: MIT][mit-image]][mit-url] [![NPM Package][npm-image]][npm-url] [![Github Actions][github-actions-image]][github-actions-url] |
4 | 4 |
|
5 | | -This is a maintained fork of https://github.com/benfred/venn.js. |
| 5 | +This is a maintained fork of [https://github.com/benfred/venn.js](https://github.com/benfred/venn.js). |
6 | 6 |
|
7 | 7 | A javascript library for laying out area proportional venn and euler diagrams. |
8 | 8 |
|
@@ -98,16 +98,16 @@ d3.selectAll('input').on('change', function () { |
98 | 98 |
|
99 | 99 | ##### Making the diagram interactive |
100 | 100 |
|
101 | | -Making the diagram interactive is basically the same idea as changing the style: just add event listeners to the elements in the venn diagram. To change the text size and circle colours on mouseover: |
| 101 | +Making the diagram interactive is basically the same idea as changing the style: just add event listeners to the elements in the venn diagram. To change the text size and circle colours on mouseenter: |
102 | 102 |
|
103 | 103 | ```js |
104 | 104 | d3.selectAll('#rings .venn-circle') |
105 | | - .on('mouseover', function () { |
| 105 | + .on('mouseenter', function () { |
106 | 106 | const node = d3.select(this).transition(); |
107 | 107 | node.select('path').style('fill-opacity', 0.2); |
108 | 108 | node.select('text').style('font-weight', '100').style('font-size', '36px'); |
109 | 109 | }) |
110 | | - .on('mouseout', function () { |
| 110 | + .on('mouseleave', function () { |
111 | 111 | const node = d3.select(this).transition(); |
112 | 112 | node.select('path').style('fill-opacity', 0); |
113 | 113 | node.select('text').style('font-weight', '100').style('font-size', '24px'); |
@@ -139,10 +139,10 @@ div.datum(sets).call(venn.VennDiagram()); |
139 | 139 | // add a tooltip |
140 | 140 | const tooltip = d3.select('body').append('div').attr('class', 'venntooltip'); |
141 | 141 |
|
142 | | -// add listeners to all the groups to display tooltip on mouseover |
| 142 | +// add listeners to all the groups to display tooltip on mouseenter |
143 | 143 | div |
144 | 144 | .selectAll('g') |
145 | | - .on('mouseover', function (d) { |
| 145 | + .on('mouseenter', function (d) { |
146 | 146 | // sort all the areas relative to the current item |
147 | 147 | venn.sortAreas(div, d); |
148 | 148 |
|
|
163 | 163 | tooltip.style('left', d3.event.pageX + 'px').style('top', d3.event.pageY - 28 + 'px'); |
164 | 164 | }) |
165 | 165 |
|
166 | | - .on('mouseout', function (d) { |
| 166 | + .on('mouseleave', function (d) { |
167 | 167 | tooltip.transition().duration(400).style('opacity', 0); |
168 | 168 | const selection = d3.select(this).transition('tooltip').duration(400); |
169 | 169 | selection |
|
0 commit comments