{"action":"opened","issue":{"url":"https://api.github.com/repos/cytoscape/cytoscape.js/issues/2250","repository_url":"https://api.github.com/repos/cytoscape/cytoscape.js","labels_url":"https://api.github.com/repos/cytoscape/cytoscape.js/issues/2250/labels{/name}","comments_url":"https://api.github.com/repos/cytoscape/cytoscape.js/issues/2250/comments","events_url":"https://api.github.com/repos/cytoscape/cytoscape.js/issues/2250/events","html_url":"https://github.com/cytoscape/cytoscape.js/issues/2250","id":393783549,"node_id":"MDU6SXNzdWUzOTM3ODM1NDk=","number":2250,"title":"Edge midpoint is undefined immediately after edge is added","user":{"login":"jri","id":120337,"node_id":"MDQ6VXNlcjEyMDMzNw==","avatar_url":"https://avatars0.githubusercontent.com/u/120337?v=4","gravatar_id":"","url":"https://api.github.com/users/jri","html_url":"https://github.com/jri","followers_url":"https://api.github.com/users/jri/followers","following_url":"https://api.github.com/users/jri/following{/other_user}","gists_url":"https://api.github.com/users/jri/gists{/gist_id}","starred_url":"https://api.github.com/users/jri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jri/subscriptions","organizations_url":"https://api.github.com/users/jri/orgs","repos_url":"https://api.github.com/users/jri/repos","events_url":"https://api.github.com/users/jri/events{/privacy}","received_events_url":"https://api.github.com/users/jri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-23T22:02:01Z","updated_at":"2018-12-23T22:02:01Z","closed_at":null,"author_association":"NONE","body":"Immediately after adding an edge to the graph its midpoint (as well as endpoints) are undefined.\r\n```\r\nconst edge = cy.add({data: {source: ..., target: ...}})\r\nconsole.log(edge.midpoint(), edge.sourceEndpoint(), edge.targetEndpoint())\r\n```\r\nOutput is:\r\n```\r\n{x: undefined, y: undefined}\r\n{x: undefined, y: undefined}\r\n{x: undefined, y: undefined}\r\n```\r\n\r\nThe node positions are known however:\r\n```\r\nconst p1 = cy.getElementById(edge.data(\"source\")).position()\r\nconst p2 = cy.getElementById(edge.data(\"target\")).position()\r\n```\r\n\r\nOutput is:\r\n```\r\n{x: 124, y: 293}\r\n{x: 134, y: 145}\r\n```\r\n\r\nHow can I get the edge midpoint after adding an edge to the graph?\r\n"}}
{"actor":{"display_login":"jri"}}