This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // when the user click on the map, find what objects are under the mouse pointer. | |
| // inspired by: https://bl.ocks.org/mbostock/444757cc9f0fde320a5f469cd36860f4 | |
| clickSubject:()=>{ | |
| // check if data are loaded | |
| if( internal.data.json ){ | |
| // compute the pointer position, relative to the canvas origin | |
| let eventX = d3.event.x-internal.canvas.bb.left, eventY = d3.event.y-internal.canvas.bb.top | |
| // if a zoom transformation has been applied, compute the mouse position in data space coordinates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: gpl-3.0 | |
| height: 500 | |
| border: no |