{"action":"closed","issue":{"url":"https://api.github.com/repos/d3/d3-sankey/issues/58","repository_url":"https://api.github.com/repos/d3/d3-sankey","labels_url":"https://api.github.com/repos/d3/d3-sankey/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/d3/d3-sankey/issues/58/comments","events_url":"https://api.github.com/repos/d3/d3-sankey/issues/58/events","html_url":"https://github.com/d3/d3-sankey/issues/58","id":329496844,"node_id":"MDU6SXNzdWUzMjk0OTY4NDQ=","number":58,"title":"d3-sankey not functioning with ES6 imports, or just not functioning,","user":{"login":"DDDgfx","id":1700366,"node_id":"MDQ6VXNlcjE3MDAzNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1700366?v=4","gravatar_id":"","url":"https://api.github.com/users/DDDgfx","html_url":"https://github.com/DDDgfx","followers_url":"https://api.github.com/users/DDDgfx/followers","following_url":"https://api.github.com/users/DDDgfx/following{/other_user}","gists_url":"https://api.github.com/users/DDDgfx/gists{/gist_id}","starred_url":"https://api.github.com/users/DDDgfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDDgfx/subscriptions","organizations_url":"https://api.github.com/users/DDDgfx/orgs","repos_url":"https://api.github.com/users/DDDgfx/repos","events_url":"https://api.github.com/users/DDDgfx/events{/privacy}","received_events_url":"https://api.github.com/users/DDDgfx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-05T14:59:16Z","updated_at":"2018-08-24T15:36:48Z","closed_at":"2018-08-24T15:36:47Z","author_association":"NONE","body":"Im trying to use d3-sankey and for the most part very faithfully to examples such as this: https://bl.ocks.org/d3noob/013054e8d7807dff76247b81b0e29030 \r\nThe one difference being I am using ES6 imports to pull in the plug in like so:\r\n \r\n`   import * as d3Sankey from \"d3-sankey\";`\r\n\r\nand I am currently using the actual data from the example:\r\n\r\n```\r\n        var testData = {\r\n    \"nodes\":[\r\n    {\"node\":0,\"name\":\"node0\"},\r\n    {\"node\":1,\"name\":\"node1\"},\r\n    {\"node\":2,\"name\":\"node2\"},\r\n    {\"node\":3,\"name\":\"node3\"},\r\n    {\"node\":4,\"name\":\"node4\"}\r\n    ],\r\n    \"links\":[\r\n    {\"source\":0,\"target\":2,\"value\":2},\r\n    {\"source\":1,\"target\":2,\"value\":2},\r\n    {\"source\":1,\"target\":3,\"value\":2},\r\n    {\"source\":0,\"target\":4,\"value\":2},\r\n    {\"source\":2,\"target\":3,\"value\":2},\r\n    {\"source\":2,\"target\":4,\"value\":2},\r\n    {\"source\":3,\"target\":4,\"value\":4}\r\n    ]}\r\n\r\n```\r\nLater on when I push my data through the sankey function, it emerges unchanged, yet no errors are thrown. And then of course the transforms all fail because properties like d.x and d.y that d3-sankey would be inserting are not being inserted. Strangely I'm not getting any errors, d3-sankey seems to be not getting hit at all even though Im pretty confident I have imported it properly and it is a function. Below is the code - Any help greatly appreciated:\r\n\r\n\r\n```\r\n    function update(data) {\r\n\r\n\r\n            // Set the sankey diagram properties.\r\n            //NOTHING SEEMS TO BE HAPPENING HERE\r\n            var aSankey = d3Sankey.sankey()\r\n                .size([gWidth, gHeight]);\r\n\r\n\r\n            var path = d3Sankey.sankeyLinkHorizontal();\r\n\r\n\r\n\r\n\r\n            aSankey\r\n                .nodes(testData.nodes)\r\n                .links(testData.links);\r\n\r\n\r\n                console.log(testData);\r\n            // add in the links\r\n            var link = dataLr.append(\"g\").selectAll(\".link\")\r\n                .data(testData.links)\r\n                .enter().append(\"path\")\r\n                .attr(\"class\", \"link\")\r\n                .attr(\"d\", path)\r\n                .style(\"stroke-width\", function(d) { return Math.max(1, d.dy); })\r\n                .sort(function(a, b) { return b.dy - a.dy; });\r\n\r\n\r\n            // add the link titles\r\n            link.append(\"title\")\r\n                .text(function(d) {\r\n                    //console.log(d);\r\n                    return d.source.name + \" → \" +\r\n                        d.target.name + \"\\n\" + format(d.value);\r\n                });\r\n\r\n\r\n            // add in the nodes\r\n            var node = dataLr.append(\"g\").selectAll(\".node\")\r\n                .data(testData.nodes)\r\n                .enter().append(\"g\")\r\n                .attr(\"class\", \"node\")\r\n                .attr(\"transform\", function(d) {\r\n                    //console.log(d);\r\n                  //THESE PROPERTIES ARE NOT PRESENT IN THE SANKEY DATA:\r\n                    return \"translate(\" + d.x + \",\" + d.y + \")\";\r\n                    //return \"translate(\" + 20 + \",\" + 50 + \")\";\r\n                });\r\n\r\n```"}}
{"actor":{"display_login":"mbostock"}}