{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/313","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project4","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/313/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/313/events","html_url":"https://github.com/ga-wdi-exercises/project4/issues/313","id":176948165,"number":313,"title":"D3 coordinates on click","user":{"login":"danielanoir","id":20133878,"avatar_url":"https://avatars.githubusercontent.com/u/20133878?v=3","gravatar_id":"","url":"https://api.github.com/users/danielanoir","html_url":"https://github.com/danielanoir","followers_url":"https://api.github.com/users/danielanoir/followers","following_url":"https://api.github.com/users/danielanoir/following{/other_user}","gists_url":"https://api.github.com/users/danielanoir/gists{/gist_id}","starred_url":"https://api.github.com/users/danielanoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielanoir/subscriptions","organizations_url":"https://api.github.com/users/danielanoir/orgs","repos_url":"https://api.github.com/users/danielanoir/repos","events_url":"https://api.github.com/users/danielanoir/events{/privacy}","received_events_url":"https://api.github.com/users/danielanoir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-14T16:00:52Z","updated_at":"2016-09-14T16:26:10Z","closed_at":null,"body":"I'm trying to get the coordinates of an element on click. Since the x and y coordinates on D3 are reversed, I'm not sure how to get the correct coordinates. This is my current code: \r\n\r\n```\r\nfunction printMousePos(event) {\r\n  document.body.textContent =\r\n    \"clientX: \" + event.clientX +\r\n    \" - clientY: \" + event.clientY;\r\n}\r\ndocument.addEventListener(\"click\", printMousePos);\r\n\r\n```\r\n\r\nI have also tried the following from stack overflow but it didn't work at all (I think because the of the jquery?):  \r\n\r\n```\r\n$(document).mousedown(function () {\r\n     console.log(d3.mouse(this));\r\n});\r\n```\r\n\r\nand \r\n\r\n```\r\nvar svg = d3.select(\"svg\");\r\nsvg.on(\"click\", function() {\r\n    console.log(d3.mouse(svg.node));\r\n})\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/comments/247071101","html_url":"https://github.com/ga-wdi-exercises/project4/issues/313#issuecomment-247071101","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project4/issues/313","id":247071101,"user":{"login":"danielanoir","id":20133878,"avatar_url":"https://avatars.githubusercontent.com/u/20133878?v=3","gravatar_id":"","url":"https://api.github.com/users/danielanoir","html_url":"https://github.com/danielanoir","followers_url":"https://api.github.com/users/danielanoir/followers","following_url":"https://api.github.com/users/danielanoir/following{/other_user}","gists_url":"https://api.github.com/users/danielanoir/gists{/gist_id}","starred_url":"https://api.github.com/users/danielanoir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielanoir/subscriptions","organizations_url":"https://api.github.com/users/danielanoir/orgs","repos_url":"https://api.github.com/users/danielanoir/repos","events_url":"https://api.github.com/users/danielanoir/events{/privacy}","received_events_url":"https://api.github.com/users/danielanoir/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T16:26:10Z","updated_at":"2016-09-14T16:26:10Z","body":"OH I figured it out!!! My x and y variables were trying to fix the positions. \r\n"}}
{"actor":{"display_login":"danielanoir"}}