This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathd3.chart.sankey.min.map
1 lines (1 loc) · 63 KB
/
d3.chart.sankey.min.map
1
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///d3.chart.sankey.min.js","webpack:///webpack/bootstrap c25385569b4e1a3fa497","webpack:///./index.js","webpack:///./sankey.js","webpack:///external \"d3\"","webpack:///../~/d3-plugins-sankey/sankey.js","webpack:///./base.js","webpack:///external {\"root\":[\"d3\",\"chart\"],\"commonjs\":\"d3.chart\",\"commonjs2\":\"d3.chart\",\"amd\":\"d3.chart\"}","webpack:///./selection.js","webpack:///./path.js"],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE_2__","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","Sankey","Base","Selection","Path","d3","sankey","extend","initialize","textAnchor","node","align","chart","features","alignLabel","x","width","colorNodes","name","colorLinks","link","path","size","height","spread","iterations","nodeWidth","nodePadding","layers","links","base","append","classed","nodes","on","layer","dataBind","data","selectAll","insert","events","enter","e","trigger","merge","attr","style","d","Math","max","dy","sort","b","exit","remove","y","select","rgb","darker","text","transform","layout","_spreadNodes","relayout","_","arguments","length","draw","nodesByBreadth","nest","key","entries","map","values","forEach","sum","o","padding","y0","computeNodeLinks","sourceLinks","targetLinks","source","target","push","computeNodeValues","value","computeNodeBreadths","nextNodes","remainingNodes","dx","moveSinksRight","scaleNodeBreadths","kx","computeNodeDepths","initializeNodeDepth","ky","min","relaxLeftToRight","alpha","weightedSource","center","breadth","relaxRightToLeft","weightedTarget","slice","reverse","resolveCollisions","n","ascendingDepth","sortKeys","ascending","computeLinkDepths","ascendingSourceDepth","ascendingTargetDepth","sy","ty","x0","x1","xi","interpolateNumber","x2","curvature","x3","y1","Chart","parentNode","clientWidth","clientHeight","margins","top","right","bottom","left","scale","category20c","update","selection","indexOf","unselectedOpacity","updateTransition","transition","delay","apply","duration","Array","getConnections","direction","getConnectionsLink","getConnectionsNode","concat"],"mappings":";;;;;CAAA,SAAAA,EAAAC,GACA,mBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,MAAAA,QAAA,iBACA,sBAAAC,gBAAAC,IACAD,QAAA,iBAAAJ,OACA,CACA,GAAAM,GAAA,gBAAAL,SAAAD,EAAAG,QAAA,MAAAA,QAAA,aAAAH,EAAAD,EAAA,GAAAA,EAAA,SACA,QAAAQ,KAAAD,IAAA,gBAAAL,iBAAAF,GAAAQ,GAAAD,EAAAC,KAECC,KAAA,SAAAC,EAAAC,GACD,MCKgB,UAAUC,GCX1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAZ,OAGA,IAAAC,GAAAY,EAAAD,IACAZ,WACAc,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAf,EAAAD,QAAAC,IAAAD,QAAAW,GAGAV,EAAAc,QAAA,EAGAd,EAAAD,QAvBA,GAAAa,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDqBM,SAASV,EAAQD,EAASW,GE3DhC,YAGA,IAAAS,GAAAT,EAAA,EAEAS,YACAA,EAAAC,KAAAV,EAAA,GACAS,EAAAE,UAAAX,EAAA,GACAS,EAAAG,KAAAZ,EAAA,GAEAV,EAAAD,QAAAoB,GFkEM,SAASnB,EAAQD,EAASW,GG5EhC,YAGA,IAAAa,GAAAb,EAAA,GAEAc,EAAAd,EAAA,GACAU,EAAAV,EAAA,EAEAV,GAAAD,QAAAqB,EAAAK,OAAA,UAEAC,WAAA,WAiGA,QAAAC,GAAAC,GACA,GAAAC,GAAAC,EAAAC,SAAAC,UAOA,OANA,uBACAH,IAAAD,IAEA,SAAAC,IACAA,EAAAD,EAAAK,EAAAH,EAAAC,SAAAG,MAAA,iBAE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ApJ,EAAAmJ,OAErC,UAAAA,GAAAvE,EAAAK,YAAAf,OAAA,WAAAiF,IACAvE,EAAAI,YAAAN,QAAA,SAAA1E,GAAqC6B,IAAAyH,OAAAF,EAAApJ,EAAAmJ,MAGrCtH,EAjEA,GAAA1B,GAAAX,EAAA,EAGAV,GAAAD,QAAAsB,EAAAI,OAAA,eAEAkI,UAAA,SAAAzE,GACA,GAAApD,GAAAxB,IAEA,OAAA6E,WAAAC,QACAtD,EAAAC,SAAA4H,WAAAzE,eAAAiF,OAAAjF,MAGApD,EAAAC,SAAA4H,WACA7H,EAAAC,SAAA4H,UAAA/D,QAAA,SAAAE,GACAsE,EAAAtE,GAAAF,QAAA,SAAA1E,GACAY,EAAAC,SAAA4H,UAAArD,KAAApF,OAKAY,EAAA+B,QAAA,oBAEA/B,GAd0BA,EAAAC,SAAA4H","file":"d3.chart.sankey.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"d3\"), require(\"d3.chart\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"d3\", \"d3.chart\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"d3\"), require(\"d3.chart\")) : factory(root[\"d3\"], root[\"d3\"][\"chart\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * d3.chart.sankey - v0.4.0\n * License: MIT\n * Date: 2017-00-16\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"d3\"), require(\"d3.chart\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"d3\", \"d3.chart\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"d3\"), require(\"d3.chart\")) : factory(root[\"d3\"], root[\"d3\"][\"chart\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t/*jshint node: true */\n\t\n\tvar Sankey = __webpack_require__(1);\n\t\n\tSankey.Sankey = Sankey;\n\tSankey.Base = __webpack_require__(4);\n\tSankey.Selection = __webpack_require__(6);\n\tSankey.Path = __webpack_require__(7);\n\t\n\tmodule.exports = Sankey;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t/*jshint node: true */\n\t\n\tvar d3 = __webpack_require__(2);\n\t//var sankey = require(\"d3-plugins-sankey\"); // @todo move loader to config and make it work\n\tvar sankey = __webpack_require__(3);\n\tvar Base = __webpack_require__(4);\n\t\n\tmodule.exports = Base.extend(\"Sankey\", {\n\t\n\t\tinitialize: function() {\n\t\t\tvar chart = this;\n\t\n\t\t\tchart.d3.sankey = sankey();\n\t\t\tchart.d3.path = chart.d3.sankey.link();\n\t\t\tchart.d3.sankey.size([chart.features.width, chart.features.height]);\n\t\n\t\t\tchart.features.spread = false;\n\t\t\tchart.features.iterations = 32;\n\t\t\tchart.features.nodeWidth = chart.d3.sankey.nodeWidth();\n\t\t\tchart.features.nodePadding = chart.d3.sankey.nodePadding();\n\t\t\tchart.features.alignLabel = \"auto\";\n\t\n\t\t\tchart.layers.links = chart.layers.base.append(\"g\").classed(\"links\", true);\n\t\t\tchart.layers.nodes = chart.layers.base.append(\"g\").classed(\"nodes\", true);\n\t\n\t\n\t\t\tchart.on(\"change:sizes\", function() {\n\t\t\t\tchart.d3.sankey.nodeWidth(chart.features.nodeWidth);\n\t\t\t\tchart.d3.sankey.nodePadding(chart.features.nodePadding);\n\t\t\t});\n\t\n\t\t\tchart.layer(\"links\", chart.layers.links, {\n\t\t\t\tdataBind: function(data) {\n\t\t\t\t\treturn this.selectAll(\".link\").data(data.links);\n\t\t\t\t},\n\t\n\t\t\t\tinsert: function() {\n\t\t\t\t\treturn this.append(\"path\").classed(\"link\", true);\n\t\t\t\t},\n\t\n\t\t\t\tevents: {\n\t\t\t\t\t\"enter\": function() {\n\t\t\t\t\t\tthis.on(\"mouseover\", function(e) { chart.trigger(\"link:mouseover\", e); });\n\t\t\t\t\t\tthis.on(\"mouseout\", function(e) { chart.trigger(\"link:mouseout\", e); });\n\t\t\t\t\t\tthis.on(\"click\", function(e) { chart.trigger(\"link:click\", e); });\n\t\t\t\t\t},\n\t\n\t\t\t\t\t\"merge\": function() {\n\t\t\t\t\t\tthis\n\t\t\t\t\t\t\t.attr(\"d\", chart.d3.path)\n\t\t\t\t\t\t\t.style(\"stroke\", colorLinks)\n\t\t\t\t\t\t\t.style(\"stroke-width\", function(d) { return Math.max(1, d.dy); })\n\t\t\t\t\t\t\t.sort(function(a, b) { return b.dy - a.dy; });\n\t\t\t\t\t},\n\t\n\t\t\t\t\t\"exit\": function() {\n\t\t\t\t\t\tthis.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\n\t\t\tchart.layer(\"nodes\", chart.layers.nodes, {\n\t\t\t\tdataBind: function(data) {\n\t\t\t\t\treturn this.selectAll(\".node\").data(data.nodes);\n\t\t\t\t},\n\t\n\t\t\t\tinsert: function() {\n\t\t\t\t\treturn this.append(\"g\").classed(\"node\", true).attr(\"data-node-id\", function(d) {\n\t\t\t\t\t\treturn d.id;\n\t\t\t\t\t});\n\t\t\t\t},\n\t\n\t\t\t\tevents: {\n\t\t\t\t\t\"enter\": function() {\n\t\t\t\t\t\tthis.append(\"rect\");\n\t\t\t\t\t\tthis.append(\"text\")\n\t\t\t\t\t\t\t.attr(\"dy\", \".35em\")\n\t\t\t\t\t\t\t.attr(\"transform\", null);\n\t\n\t\t\t\t\t\tthis.on(\"mouseover\", function(e) { chart.trigger(\"node:mouseover\", e); });\n\t\t\t\t\t\tthis.on(\"mouseout\", function(e) { chart.trigger(\"node:mouseout\", e); });\n\t\t\t\t\t\tthis.on(\"click\", function(e) { chart.trigger(\"node:click\", e); });\n\t\t\t\t\t},\n\t\n\t\t\t\t\t\"merge\": function() {\n\t\t\t\t\t\tthis.attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\t\n\t\t\t\t\t\tthis.select(\"rect\")\n\t\t\t\t\t\t\t.attr(\"height\", function(d) { return d.dy; })\n\t\t\t\t\t\t\t.attr(\"width\", chart.features.nodeWidth)\n\t\t\t\t\t\t\t.style(\"fill\", colorNodes)\n\t\t\t\t\t\t\t.style(\"stroke\", function(d) { return d3.rgb(colorNodes(d)).darker(2); });\n\t\n\t\t\t\t\t\tthis.select(\"text\")\n\t\t\t\t\t\t\t.text(chart.features.name)\n\t\t\t\t\t\t\t.attr(\"y\", function(d) { return d.dy / 2; })\n\t\t\t\t\t\t\t.attr(\"x\", function(d) { return textAnchor(d) === \"start\" ? (6 + chart.features.nodeWidth) : -6; })\n\t\t\t\t\t\t\t.attr(\"text-anchor\", textAnchor);\n\t\t\t\t\t},\n\t\n\t\t\t\t\t\"exit\": function() {\n\t\t\t\t\t\tthis.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\n\t\t\tfunction textAnchor(node) {\n\t\t\t\tvar align = chart.features.alignLabel;\n\t\t\t\tif (typeof(align) === \"function\") {\n\t\t\t\t\talign = align(node);\n\t\t\t\t}\n\t\t\t\tif (align === \"auto\") {\n\t\t\t\t\talign = node.x < chart.features.width / 2 ? \"start\" : \"end\";\n\t\t\t\t}\n\t\t\t\treturn align;\n\t\t\t}\n\t\n\t\t\tfunction colorNodes(node) {\n\t\t\t\tif (typeof chart.features.colorNodes === \"function\") {\n\t\t\t\t\t// allow using d3 scales, but also custom function with node as 2nd argument\n\t\t\t\t\treturn chart.features.colorNodes(chart.features.name(node), node);\n\t\t\t\t} else {\n\t\t\t\t\treturn chart.features.colorNodes;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tfunction colorLinks(link) {\n\t\t\t\tif (typeof chart.features.colorLinks === \"function\") {\n\t\t\t\t\t// always expect custom function, there\"s no sensible default with d3 scales here\n\t\t\t\t\treturn chart.features.colorLinks(link);\n\t\t\t\t} else {\n\t\t\t\t\treturn chart.features.colorLinks;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\n\t\n\t\ttransform: function(data) {\n\t\t\tvar chart = this;\n\t\n\t\t\tchart.data = data;\n\t\n\t\t\tchart.d3.sankey\n\t\t\t\t.nodes(data.nodes)\n\t\t\t\t.links(data.links)\n\t\t\t\t.layout(chart.features.iterations);\n\t\n\t\t\tif (this.features.spread) {\n\t\t\t\tthis._spreadNodes(data);\n\t\t\t\tchart.d3.sankey.relayout();\n\t\t\t}\n\t\n\t\t\treturn data;\n\t\t},\n\t\n\t\n\t\titerations: function(_) {\n\t\t\tif (!arguments.length) { return this.features.iterations; }\n\t\t\tthis.features.iterations = _;\n\t\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\tnodeWidth: function(_) {\n\t\t\tif (!arguments.length) { return this.features.nodeWidth; }\n\t\t\tthis.features.nodeWidth = _;\n\t\n\t\t\tthis.trigger(\"change:sizes\");\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\tnodePadding: function(_) {\n\t\t\tif (!arguments.length) { return this.features.nodePadding; }\n\t\t\tthis.features.nodePadding = _;\n\t\n\t\t\tthis.trigger(\"change:sizes\");\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\tspread: function(_) {\n\t\t\tif (!arguments.length) { return this.features.spread; }\n\t\t\tthis.features.spread = _;\n\t\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\n\t\talignLabel: function(_) {\n\t\t\tif (!arguments.length) { return this.features.alignLabel; }\n\t\t\tthis.features.alignLabel = _;\n\t\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\t_spreadNodes: function(data) {\n\t\t\tvar chart = this,\n\t\t\t\t\tnodesByBreadth = d3.nest()\n\t\t\t\t\t.key(function(d) { return d.x; })\n\t\t\t\t\t.entries(data.nodes)\n\t\t\t\t\t.map(function(d) { return d.values; });\n\t\n\t\t\tnodesByBreadth.forEach(function(nodes) {\n\t\t\t\tvar i,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tsum = d3.sum(nodes, function(o) { return o.dy; }),\n\t\t\t\t\t\tpadding = (chart.features.height - sum) / nodes.length,\n\t\t\t\t\t\ty0 = 0;\n\t\t\t\tnodes.sort(function(a, b) { return a.y - b.y; });\n\t\t\t\tfor (i = 0; i < nodes.length; ++i) {\n\t\t\t\t\tnode = nodes[i];\n\t\t\t\t\tnode.y = y0;\n\t\t\t\t\ty0 += node.dy + padding;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\n\t});\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*** IMPORTS FROM imports-loader ***/\n\tvar d3 = __webpack_require__(2);\n\t\n\td3.sankey = function() {\n\t var sankey = {},\n\t nodeWidth = 24,\n\t nodePadding = 8,\n\t size = [1, 1],\n\t nodes = [],\n\t links = [];\n\t\n\t sankey.nodeWidth = function(_) {\n\t if (!arguments.length) return nodeWidth;\n\t nodeWidth = +_;\n\t return sankey;\n\t };\n\t\n\t sankey.nodePadding = function(_) {\n\t if (!arguments.length) return nodePadding;\n\t nodePadding = +_;\n\t return sankey;\n\t };\n\t\n\t sankey.nodes = function(_) {\n\t if (!arguments.length) return nodes;\n\t nodes = _;\n\t return sankey;\n\t };\n\t\n\t sankey.links = function(_) {\n\t if (!arguments.length) return links;\n\t links = _;\n\t return sankey;\n\t };\n\t\n\t sankey.size = function(_) {\n\t if (!arguments.length) return size;\n\t size = _;\n\t return sankey;\n\t };\n\t\n\t sankey.layout = function(iterations) {\n\t computeNodeLinks();\n\t computeNodeValues();\n\t computeNodeBreadths();\n\t computeNodeDepths(iterations);\n\t computeLinkDepths();\n\t return sankey;\n\t };\n\t\n\t sankey.relayout = function() {\n\t computeLinkDepths();\n\t return sankey;\n\t };\n\t\n\t sankey.link = function() {\n\t var curvature = .5;\n\t\n\t function link(d) {\n\t var x0 = d.source.x + d.source.dx,\n\t x1 = d.target.x,\n\t xi = d3.interpolateNumber(x0, x1),\n\t x2 = xi(curvature),\n\t x3 = xi(1 - curvature),\n\t y0 = d.source.y + d.sy + d.dy / 2,\n\t y1 = d.target.y + d.ty + d.dy / 2;\n\t return \"M\" + x0 + \",\" + y0\n\t + \"C\" + x2 + \",\" + y0\n\t + \" \" + x3 + \",\" + y1\n\t + \" \" + x1 + \",\" + y1;\n\t }\n\t\n\t link.curvature = function(_) {\n\t if (!arguments.length) return curvature;\n\t curvature = +_;\n\t return link;\n\t };\n\t\n\t return link;\n\t };\n\t\n\t // Populate the sourceLinks and targetLinks for each node.\n\t // Also, if the source and target are not objects, assume they are indices.\n\t function computeNodeLinks() {\n\t nodes.forEach(function(node) {\n\t node.sourceLinks = [];\n\t node.targetLinks = [];\n\t });\n\t links.forEach(function(link) {\n\t var source = link.source,\n\t target = link.target;\n\t if (typeof source === \"number\") source = link.source = nodes[link.source];\n\t if (typeof target === \"number\") target = link.target = nodes[link.target];\n\t source.sourceLinks.push(link);\n\t target.targetLinks.push(link);\n\t });\n\t }\n\t\n\t // Compute the value (size) of each node by summing the associated links.\n\t function computeNodeValues() {\n\t nodes.forEach(function(node) {\n\t node.value = Math.max(\n\t d3.sum(node.sourceLinks, value),\n\t d3.sum(node.targetLinks, value)\n\t );\n\t });\n\t }\n\t\n\t // Iteratively assign the breadth (x-position) for each node.\n\t // Nodes are assigned the maximum breadth of incoming neighbors plus one;\n\t // nodes with no incoming links are assigned breadth zero, while\n\t // nodes with no outgoing links are assigned the maximum breadth.\n\t function computeNodeBreadths() {\n\t var remainingNodes = nodes,\n\t nextNodes,\n\t x = 0;\n\t\n\t while (remainingNodes.length) {\n\t nextNodes = [];\n\t remainingNodes.forEach(function(node) {\n\t node.x = x;\n\t node.dx = nodeWidth;\n\t node.sourceLinks.forEach(function(link) {\n\t nextNodes.push(link.target);\n\t });\n\t });\n\t remainingNodes = nextNodes;\n\t ++x;\n\t }\n\t\n\t //\n\t moveSinksRight(x);\n\t scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n\t }\n\t\n\t function moveSourcesRight() {\n\t nodes.forEach(function(node) {\n\t if (!node.targetLinks.length) {\n\t node.x = d3.min(node.sourceLinks, function(d) { return d.target.x; }) - 1;\n\t }\n\t });\n\t }\n\t\n\t function moveSinksRight(x) {\n\t nodes.forEach(function(node) {\n\t if (!node.sourceLinks.length) {\n\t node.x = x - 1;\n\t }\n\t });\n\t }\n\t\n\t function scaleNodeBreadths(kx) {\n\t nodes.forEach(function(node) {\n\t node.x *= kx;\n\t });\n\t }\n\t\n\t function computeNodeDepths(iterations) {\n\t var nodesByBreadth = d3.nest()\n\t .key(function(d) { return d.x; })\n\t .sortKeys(d3.ascending)\n\t .entries(nodes)\n\t .map(function(d) { return d.values; });\n\t\n\t //\n\t initializeNodeDepth();\n\t resolveCollisions();\n\t for (var alpha = 1; iterations > 0; --iterations) {\n\t relaxRightToLeft(alpha *= .99);\n\t resolveCollisions();\n\t relaxLeftToRight(alpha);\n\t resolveCollisions();\n\t }\n\t\n\t function initializeNodeDepth() {\n\t var ky = d3.min(nodesByBreadth, function(nodes) {\n\t return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n\t });\n\t\n\t nodesByBreadth.forEach(function(nodes) {\n\t nodes.forEach(function(node, i) {\n\t node.y = i;\n\t node.dy = node.value * ky;\n\t });\n\t });\n\t\n\t links.forEach(function(link) {\n\t link.dy = link.value * ky;\n\t });\n\t }\n\t\n\t function relaxLeftToRight(alpha) {\n\t nodesByBreadth.forEach(function(nodes, breadth) {\n\t nodes.forEach(function(node) {\n\t if (node.targetLinks.length) {\n\t var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\t\n\t function weightedSource(link) {\n\t return center(link.source) * link.value;\n\t }\n\t }\n\t\n\t function relaxRightToLeft(alpha) {\n\t nodesByBreadth.slice().reverse().forEach(function(nodes) {\n\t nodes.forEach(function(node) {\n\t if (node.sourceLinks.length) {\n\t var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n\t node.y += (y - center(node)) * alpha;\n\t }\n\t });\n\t });\n\t\n\t function weightedTarget(link) {\n\t return center(link.target) * link.value;\n\t }\n\t }\n\t\n\t function resolveCollisions() {\n\t nodesByBreadth.forEach(function(nodes) {\n\t var node,\n\t dy,\n\t y0 = 0,\n\t n = nodes.length,\n\t i;\n\t\n\t // Push any overlapping nodes down.\n\t nodes.sort(ascendingDepth);\n\t for (i = 0; i < n; ++i) {\n\t node = nodes[i];\n\t dy = y0 - node.y;\n\t if (dy > 0) node.y += dy;\n\t y0 = node.y + node.dy + nodePadding;\n\t }\n\t\n\t // If the bottommost node goes outside the bounds, push it back up.\n\t dy = y0 - nodePadding - size[1];\n\t if (dy > 0) {\n\t y0 = node.y -= dy;\n\t\n\t // Push any overlapping nodes back up.\n\t for (i = n - 2; i >= 0; --i) {\n\t node = nodes[i];\n\t dy = node.y + node.dy + nodePadding - y0;\n\t if (dy > 0) node.y -= dy;\n\t y0 = node.y;\n\t }\n\t }\n\t });\n\t }\n\t\n\t function ascendingDepth(a, b) {\n\t return a.y - b.y;\n\t }\n\t }\n\t\n\t function computeLinkDepths() {\n\t nodes.forEach(function(node) {\n\t node.sourceLinks.sort(ascendingTargetDepth);\n\t node.targetLinks.sort(ascendingSourceDepth);\n\t });\n\t nodes.forEach(function(node) {\n\t var sy = 0, ty = 0;\n\t node.sourceLinks.forEach(function(link) {\n\t link.sy = sy;\n\t sy += link.dy;\n\t });\n\t node.targetLinks.forEach(function(link) {\n\t link.ty = ty;\n\t ty += link.dy;\n\t });\n\t });\n\t\n\t function ascendingSourceDepth(a, b) {\n\t return a.source.y - b.source.y;\n\t }\n\t\n\t function ascendingTargetDepth(a, b) {\n\t return a.target.y - b.target.y;\n\t }\n\t }\n\t\n\t function center(node) {\n\t return node.y + node.dy / 2;\n\t }\n\t\n\t function value(link) {\n\t return link.value;\n\t }\n\t\n\t return sankey;\n\t};\n\t\n\t/*** EXPORTS FROM exports-loader ***/\n\tmodule.exports = d3.sankey;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t/*jshint node: true */\n\t\n\tvar d3 = __webpack_require__(2);\n\tvar Chart = __webpack_require__(5);\n\t\n\t/*jshint newcap: false */\n\tmodule.exports = Chart(\"Sankey.Base\", {\n\t\n\t\tinitialize: function() {\n\t\t\tvar chart = this;\n\t\n\t\t\t// Inspired by d3.chart.layout.hierarchy's hierarchy.js, though also different\n\t\t\tchart.features\t= {};\n\t\t\tchart.d3\t\t\t\t= {};\n\t\t\tchart.layers\t\t= {};\n\t\n\t\t\t// when using faux-dom, be sure to set the width and height attributes\n\t\t\tif (!chart.base.attr(\"width\"))\t{ chart.base.attr(\"width\",\tchart.base.node().parentNode.clientWidth);\t}\n\t\t\tif (!chart.base.attr(\"height\")) { chart.base.attr(\"height\", chart.base.node().parentNode.clientHeight); }\n\t\n\t\t\t// dimensions, with space for node stroke and labels (smallest at bottom)\n\t\t\tchart.features.margins = {top: 1, right: 1, bottom: 6, left: 1};\n\t\t\tchart.features.width = chart.base.attr(\"width\") - chart.features.margins.left - chart.features.margins.right;\n\t\t\tchart.features.height = chart.base.attr(\"height\") - chart.features.margins.top - chart.features.margins.bottom;\n\t\n\t\t\tchart.features.name = function(d) { return d.name; };\n\t\t\t// there is no value property, because we also need to set it on parents\n\t\t\tchart.features.colorNodes = d3.scale.category20c();\n\t\t\tchart.features.colorLinks = null; // css styles by default\n\t\n\t\t\tchart.layers.base = chart.base.append(\"g\")\n\t\t\t\t.attr(\"transform\", \"translate(\" + chart.features.margins.left + \",\" + chart.features.margins.top + \")\");\n\t\t},\n\t\n\t\n\t\tname: function(_) {\n\t\t\tif (!arguments.length) { return this.features.name; }\n\t\t\tthis.features.name = _;\n\t\n\t\t\tthis.trigger(\"change:name\");\n\t\t\tif (this.root) { this.draw(this.root); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\tcolorNodes: function(_) {\n\t\t\tif (!arguments.length) { return this.features.colorNodes; }\n\t\t\tthis.features.colorNodes = _;\n\t\n\t\t\tthis.trigger(\"change:color\");\n\t\t\tif (this.root) { this.draw(this.root); }\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\n\t\tcolorLinks: function(_) {\n\t\t\tif (!arguments.length) { return this.features.colorLinks; }\n\t\t\tthis.features.colorLinks = _;\n\t\n\t\t\tthis.trigger(\"change:color\");\n\t\t\tif (this.data) { this.draw(this.data); }\n\t\n\t\t\treturn this;\n\t\t}\n\t\n\t});\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t/*jshint node: true */\n\t\n\tvar Sankey = __webpack_require__(1);\n\t\n\t// Sankey diagram with a hoverable selection\n\tmodule.exports = Sankey.extend(\"Sankey.Selection\", {\n\t\n\t\tinitialize: function() {\n\t\t\tvar chart = this;\n\t\n\t\t\tchart.features.selection = null;\n\t\t\tchart.features.unselectedOpacity = 0.2;\n\t\n\t\t\tchart.on(\"link:mouseover\", chart.selection);\n\t\t\tchart.on(\"link:mouseout\", function() { chart.selection(null); });\n\t\t\tchart.on(\"node:mouseover\", chart.selection);\n\t\t\tchart.on(\"node:mouseout\", function() { chart.selection(null); });\n\t\n\t\t\t// going through the whole draw cycle can be a little slow, so we use\n\t\t\t// a selection changed event to update existing nodes directly\n\t\t\tchart.on(\"change:selection\", updateTransition);\n\t\t\tthis.layer(\"links\").on(\"enter\", update);\n\t\t\tthis.layer(\"nodes\").on(\"enter\", update);\n\t\n\t\t\tfunction update() {\n\t\t\t\t/*jshint validthis:true */\n\t\t\t\tif (chart.features.selection && chart.features.selection.length) {\n\t\t\t\t\treturn this.style(\"opacity\", function(o) {\n\t\t\t\t\t\treturn chart.features.selection.indexOf(o) >= 0 ? 1 : chart.features.unselectedOpacity;\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturn this.style(\"opacity\", 1);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tfunction updateTransition() {\n\t\t\t\tvar transition = chart.layers.base.selectAll(\".node, .link\").transition();\n\t\t\t\tif (!chart.features.selection || !chart.features.selection.length) {\n\t\t\t\t\t// short delay for the deselect transition to avoid flicker\n\t\t\t\t\ttransition = transition.delay(100);\n\t\t\t\t}\n\t\t\t\tupdate.apply(transition.duration(50));\n\t\t\t}\n\t\t},\n\t\n\t\tselection: function(_) {\n\t\t\tif (!arguments.length) { return this.features.selection; }\n\t\t\tthis.features.selection = (!_ || _ instanceof Array) ? _ : [_];\n\t\n\t\t\tthis.trigger(\"change:selection\");\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\tunselectedOpacity: function(_) {\n\t\t\tif (!arguments.length) { return this.features.unselectedOpacity; }\n\t\t\tthis.features.unselectedOpacity = _;\n\t\n\t\t\tthis.trigger(\"change:selection\");\n\t\n\t\t\treturn this;\n\t\t}\n\t\n\t});\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t/*jshint node: true */\n\t\n\tvar Selection = __webpack_require__(6);\n\t\n\t// Sankey diagram with a path-hover effect\n\tmodule.exports = Selection.extend(\"Sankey.Path\", {\n\t\n\t\tselection: function(_) {\n\t\t\tvar chart = this;\n\t\n\t\t\tif (!arguments.length) { return chart.features.selection; }\n\t\t\tchart.features.selection = (!_ || _ instanceof Array) ? _ : [_];\n\t\n\t\t\t// expand selection with connections\n\t\t\tif (chart.features.selection) {\n\t\t\t\tchart.features.selection.forEach(function(o) {\n\t\t\t\t\tgetConnections(o).forEach(function(p) {\n\t\t\t\t\t\tchart.features.selection.push(p);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\n\t\t\tchart.trigger(\"change:selection\");\n\t\n\t\t\treturn chart;\n\t\t}\n\t\n\t});\n\t\n\tfunction getConnections(o, direction) {\n\t\tif (o.source && o.target) {\n\t\t\treturn getConnectionsLink(o, direction);\n\t\t} else {\n\t\t\treturn getConnectionsNode(o, direction);\n\t\t}\n\t}\n\t\n\t// Return the link and its connected nodes with their links etc.\n\tfunction getConnectionsLink(o, direction) {\n\t\tvar links = [o];\n\t\tdirection = direction || \"both\";\n\t\n\t\tif (direction == \"source\" || direction == \"both\") {\n\t\t\tlinks = links.concat(getConnectionsNode(o.source, \"source\"));\n\t\t}\n\t\tif (direction == \"target\" || direction == \"both\") {\n\t\t\tlinks = links.concat(getConnectionsNode(o.target, \"target\"));\n\t\t}\n\t\n\t\treturn links;\n\t}\n\t\n\t// Return the node and its connected links. If direction is \"both\", just return\n\t// all links; if direction is \"source\", only return the source link when there\n\t// is one target link (or none, in which case the node is an endnode); if\n\t// direction is \"target\" vice versa. Open the product example to see why.\n\tfunction getConnectionsNode(o, direction) {\n\t\tvar links = [o];\n\t\tdirection = direction || \"both\";\n\t\n\t\tif ((direction == \"source\" && o.sourceLinks.length < 2) || direction == \"both\") {\n\t\t\to.targetLinks.forEach(function(p) { links = links.concat(getConnectionsLink(p, direction)); });\n\t\t}\n\t\tif ((direction == \"target\" && o.targetLinks.length < 2) || direction == \"both\") {\n\t\t\to.sourceLinks.forEach(function(p) { links = links.concat(getConnectionsLink(p, direction)); });\n\t\t}\n\t\n\t\treturn links;\n\t}\n\n\n/***/ }\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// d3.chart.sankey.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c25385569b4e1a3fa497","\"use strict\";\n/*jshint node: true */\n\nvar Sankey = require(\"./sankey\");\n\nSankey.Sankey = Sankey;\nSankey.Base = require(\"./base\");\nSankey.Selection = require(\"./selection\");\nSankey.Path = require(\"./path\");\n\nmodule.exports = Sankey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","\"use strict\";\n/*jshint node: true */\n\nvar d3 = require(\"d3\");\n//var sankey = require(\"d3-plugins-sankey\"); // @todo move loader to config and make it work\nvar sankey = require(\"imports?d3!exports?d3.sankey!d3-plugins-sankey\");\nvar Base = require(\"./base\");\n\nmodule.exports = Base.extend(\"Sankey\", {\n\n\tinitialize: function() {\n\t\tvar chart = this;\n\n\t\tchart.d3.sankey = sankey();\n\t\tchart.d3.path = chart.d3.sankey.link();\n\t\tchart.d3.sankey.size([chart.features.width, chart.features.height]);\n\n\t\tchart.features.spread = false;\n\t\tchart.features.iterations = 32;\n\t\tchart.features.nodeWidth = chart.d3.sankey.nodeWidth();\n\t\tchart.features.nodePadding = chart.d3.sankey.nodePadding();\n\t\tchart.features.alignLabel = \"auto\";\n\n\t\tchart.layers.links = chart.layers.base.append(\"g\").classed(\"links\", true);\n\t\tchart.layers.nodes = chart.layers.base.append(\"g\").classed(\"nodes\", true);\n\n\n\t\tchart.on(\"change:sizes\", function() {\n\t\t\tchart.d3.sankey.nodeWidth(chart.features.nodeWidth);\n\t\t\tchart.d3.sankey.nodePadding(chart.features.nodePadding);\n\t\t});\n\n\t\tchart.layer(\"links\", chart.layers.links, {\n\t\t\tdataBind: function(data) {\n\t\t\t\treturn this.selectAll(\".link\").data(data.links);\n\t\t\t},\n\n\t\t\tinsert: function() {\n\t\t\t\treturn this.append(\"path\").classed(\"link\", true);\n\t\t\t},\n\n\t\t\tevents: {\n\t\t\t\t\"enter\": function() {\n\t\t\t\t\tthis.on(\"mouseover\", function(e) { chart.trigger(\"link:mouseover\", e); });\n\t\t\t\t\tthis.on(\"mouseout\", function(e) { chart.trigger(\"link:mouseout\", e); });\n\t\t\t\t\tthis.on(\"click\", function(e) { chart.trigger(\"link:click\", e); });\n\t\t\t\t},\n\n\t\t\t\t\"merge\": function() {\n\t\t\t\t\tthis\n\t\t\t\t\t\t.attr(\"d\", chart.d3.path)\n\t\t\t\t\t\t.style(\"stroke\", colorLinks)\n\t\t\t\t\t\t.style(\"stroke-width\", function(d) { return Math.max(1, d.dy); })\n\t\t\t\t\t\t.sort(function(a, b) { return b.dy - a.dy; });\n\t\t\t\t},\n\n\t\t\t\t\"exit\": function() {\n\t\t\t\t\tthis.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tchart.layer(\"nodes\", chart.layers.nodes, {\n\t\t\tdataBind: function(data) {\n\t\t\t\treturn this.selectAll(\".node\").data(data.nodes);\n\t\t\t},\n\n\t\t\tinsert: function() {\n\t\t\t\treturn this.append(\"g\").classed(\"node\", true).attr(\"data-node-id\", function(d) {\n\t\t\t\t\treturn d.id;\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tevents: {\n\t\t\t\t\"enter\": function() {\n\t\t\t\t\tthis.append(\"rect\");\n\t\t\t\t\tthis.append(\"text\")\n\t\t\t\t\t\t.attr(\"dy\", \".35em\")\n\t\t\t\t\t\t.attr(\"transform\", null);\n\n\t\t\t\t\tthis.on(\"mouseover\", function(e) { chart.trigger(\"node:mouseover\", e); });\n\t\t\t\t\tthis.on(\"mouseout\", function(e) { chart.trigger(\"node:mouseout\", e); });\n\t\t\t\t\tthis.on(\"click\", function(e) { chart.trigger(\"node:click\", e); });\n\t\t\t\t},\n\n\t\t\t\t\"merge\": function() {\n\t\t\t\t\tthis.attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n\t\t\t\t\tthis.select(\"rect\")\n\t\t\t\t\t\t.attr(\"height\", function(d) { return d.dy; })\n\t\t\t\t\t\t.attr(\"width\", chart.features.nodeWidth)\n\t\t\t\t\t\t.style(\"fill\", colorNodes)\n\t\t\t\t\t\t.style(\"stroke\", function(d) { return d3.rgb(colorNodes(d)).darker(2); });\n\n\t\t\t\t\tthis.select(\"text\")\n\t\t\t\t\t\t.text(chart.features.name)\n\t\t\t\t\t\t.attr(\"y\", function(d) { return d.dy / 2; })\n\t\t\t\t\t\t.attr(\"x\", function(d) { return textAnchor(d) === \"start\" ? (6 + chart.features.nodeWidth) : -6; })\n\t\t\t\t\t\t.attr(\"text-anchor\", textAnchor);\n\t\t\t\t},\n\n\t\t\t\t\"exit\": function() {\n\t\t\t\t\tthis.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfunction textAnchor(node) {\n\t\t\tvar align = chart.features.alignLabel;\n\t\t\tif (typeof(align) === \"function\") {\n\t\t\t\talign = align(node);\n\t\t\t}\n\t\t\tif (align === \"auto\") {\n\t\t\t\talign = node.x < chart.features.width / 2 ? \"start\" : \"end\";\n\t\t\t}\n\t\t\treturn align;\n\t\t}\n\n\t\tfunction colorNodes(node) {\n\t\t\tif (typeof chart.features.colorNodes === \"function\") {\n\t\t\t\t// allow using d3 scales, but also custom function with node as 2nd argument\n\t\t\t\treturn chart.features.colorNodes(chart.features.name(node), node);\n\t\t\t} else {\n\t\t\t\treturn chart.features.colorNodes;\n\t\t\t}\n\t\t}\n\n\t\tfunction colorLinks(link) {\n\t\t\tif (typeof chart.features.colorLinks === \"function\") {\n\t\t\t\t// always expect custom function, there\"s no sensible default with d3 scales here\n\t\t\t\treturn chart.features.colorLinks(link);\n\t\t\t} else {\n\t\t\t\treturn chart.features.colorLinks;\n\t\t\t}\n\t\t}\n\t},\n\n\n\ttransform: function(data) {\n\t\tvar chart = this;\n\n\t\tchart.data = data;\n\n\t\tchart.d3.sankey\n\t\t\t.nodes(data.nodes)\n\t\t\t.links(data.links)\n\t\t\t.layout(chart.features.iterations);\n\n\t\tif (this.features.spread) {\n\t\t\tthis._spreadNodes(data);\n\t\t\tchart.d3.sankey.relayout();\n\t\t}\n\n\t\treturn data;\n\t},\n\n\n\titerations: function(_) {\n\t\tif (!arguments.length) { return this.features.iterations; }\n\t\tthis.features.iterations = _;\n\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t},\n\n\n\tnodeWidth: function(_) {\n\t\tif (!arguments.length) { return this.features.nodeWidth; }\n\t\tthis.features.nodeWidth = _;\n\n\t\tthis.trigger(\"change:sizes\");\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t},\n\n\n\tnodePadding: function(_) {\n\t\tif (!arguments.length) { return this.features.nodePadding; }\n\t\tthis.features.nodePadding = _;\n\n\t\tthis.trigger(\"change:sizes\");\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t},\n\n\n\tspread: function(_) {\n\t\tif (!arguments.length) { return this.features.spread; }\n\t\tthis.features.spread = _;\n\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t},\n\n\n\n\talignLabel: function(_) {\n\t\tif (!arguments.length) { return this.features.alignLabel; }\n\t\tthis.features.alignLabel = _;\n\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t},\n\n\n\t_spreadNodes: function(data) {\n\t\tvar chart = this,\n\t\t\t\tnodesByBreadth = d3.nest()\n\t\t\t\t.key(function(d) { return d.x; })\n\t\t\t\t.entries(data.nodes)\n\t\t\t\t.map(function(d) { return d.values; });\n\n\t\tnodesByBreadth.forEach(function(nodes) {\n\t\t\tvar i,\n\t\t\t\t\tnode,\n\t\t\t\t\tsum = d3.sum(nodes, function(o) { return o.dy; }),\n\t\t\t\t\tpadding = (chart.features.height - sum) / nodes.length,\n\t\t\t\t\ty0 = 0;\n\t\t\tnodes.sort(function(a, b) { return a.y - b.y; });\n\t\t\tfor (i = 0; i < nodes.length; ++i) {\n\t\t\t\tnode = nodes[i];\n\t\t\t\tnode.y = y0;\n\t\t\t\ty0 += node.dy + padding;\n\t\t\t}\n\t\t});\n\t}\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./sankey.js\n// module id = 1\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"d3\"\n// module id = 2\n// module chunks = 0","/*** IMPORTS FROM imports-loader ***/\nvar d3 = require(\"d3\");\n\nd3.sankey = function() {\n var sankey = {},\n nodeWidth = 24,\n nodePadding = 8,\n size = [1, 1],\n nodes = [],\n links = [];\n\n sankey.nodeWidth = function(_) {\n if (!arguments.length) return nodeWidth;\n nodeWidth = +_;\n return sankey;\n };\n\n sankey.nodePadding = function(_) {\n if (!arguments.length) return nodePadding;\n nodePadding = +_;\n return sankey;\n };\n\n sankey.nodes = function(_) {\n if (!arguments.length) return nodes;\n nodes = _;\n return sankey;\n };\n\n sankey.links = function(_) {\n if (!arguments.length) return links;\n links = _;\n return sankey;\n };\n\n sankey.size = function(_) {\n if (!arguments.length) return size;\n size = _;\n return sankey;\n };\n\n sankey.layout = function(iterations) {\n computeNodeLinks();\n computeNodeValues();\n computeNodeBreadths();\n computeNodeDepths(iterations);\n computeLinkDepths();\n return sankey;\n };\n\n sankey.relayout = function() {\n computeLinkDepths();\n return sankey;\n };\n\n sankey.link = function() {\n var curvature = .5;\n\n function link(d) {\n var x0 = d.source.x + d.source.dx,\n x1 = d.target.x,\n xi = d3.interpolateNumber(x0, x1),\n x2 = xi(curvature),\n x3 = xi(1 - curvature),\n y0 = d.source.y + d.sy + d.dy / 2,\n y1 = d.target.y + d.ty + d.dy / 2;\n return \"M\" + x0 + \",\" + y0\n + \"C\" + x2 + \",\" + y0\n + \" \" + x3 + \",\" + y1\n + \" \" + x1 + \",\" + y1;\n }\n\n link.curvature = function(_) {\n if (!arguments.length) return curvature;\n curvature = +_;\n return link;\n };\n\n return link;\n };\n\n // Populate the sourceLinks and targetLinks for each node.\n // Also, if the source and target are not objects, assume they are indices.\n function computeNodeLinks() {\n nodes.forEach(function(node) {\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n links.forEach(function(link) {\n var source = link.source,\n target = link.target;\n if (typeof source === \"number\") source = link.source = nodes[link.source];\n if (typeof target === \"number\") target = link.target = nodes[link.target];\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }\n\n // Compute the value (size) of each node by summing the associated links.\n function computeNodeValues() {\n nodes.forEach(function(node) {\n node.value = Math.max(\n d3.sum(node.sourceLinks, value),\n d3.sum(node.targetLinks, value)\n );\n });\n }\n\n // Iteratively assign the breadth (x-position) for each node.\n // Nodes are assigned the maximum breadth of incoming neighbors plus one;\n // nodes with no incoming links are assigned breadth zero, while\n // nodes with no outgoing links are assigned the maximum breadth.\n function computeNodeBreadths() {\n var remainingNodes = nodes,\n nextNodes,\n x = 0;\n\n while (remainingNodes.length) {\n nextNodes = [];\n remainingNodes.forEach(function(node) {\n node.x = x;\n node.dx = nodeWidth;\n node.sourceLinks.forEach(function(link) {\n nextNodes.push(link.target);\n });\n });\n remainingNodes = nextNodes;\n ++x;\n }\n\n //\n moveSinksRight(x);\n scaleNodeBreadths((size[0] - nodeWidth) / (x - 1));\n }\n\n function moveSourcesRight() {\n nodes.forEach(function(node) {\n if (!node.targetLinks.length) {\n node.x = d3.min(node.sourceLinks, function(d) { return d.target.x; }) - 1;\n }\n });\n }\n\n function moveSinksRight(x) {\n nodes.forEach(function(node) {\n if (!node.sourceLinks.length) {\n node.x = x - 1;\n }\n });\n }\n\n function scaleNodeBreadths(kx) {\n nodes.forEach(function(node) {\n node.x *= kx;\n });\n }\n\n function computeNodeDepths(iterations) {\n var nodesByBreadth = d3.nest()\n .key(function(d) { return d.x; })\n .sortKeys(d3.ascending)\n .entries(nodes)\n .map(function(d) { return d.values; });\n\n //\n initializeNodeDepth();\n resolveCollisions();\n for (var alpha = 1; iterations > 0; --iterations) {\n relaxRightToLeft(alpha *= .99);\n resolveCollisions();\n relaxLeftToRight(alpha);\n resolveCollisions();\n }\n\n function initializeNodeDepth() {\n var ky = d3.min(nodesByBreadth, function(nodes) {\n return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);\n });\n\n nodesByBreadth.forEach(function(nodes) {\n nodes.forEach(function(node, i) {\n node.y = i;\n node.dy = node.value * ky;\n });\n });\n\n links.forEach(function(link) {\n link.dy = link.value * ky;\n });\n }\n\n function relaxLeftToRight(alpha) {\n nodesByBreadth.forEach(function(nodes, breadth) {\n nodes.forEach(function(node) {\n if (node.targetLinks.length) {\n var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedSource(link) {\n return center(link.source) * link.value;\n }\n }\n\n function relaxRightToLeft(alpha) {\n nodesByBreadth.slice().reverse().forEach(function(nodes) {\n nodes.forEach(function(node) {\n if (node.sourceLinks.length) {\n var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);\n node.y += (y - center(node)) * alpha;\n }\n });\n });\n\n function weightedTarget(link) {\n return center(link.target) * link.value;\n }\n }\n\n function resolveCollisions() {\n nodesByBreadth.forEach(function(nodes) {\n var node,\n dy,\n y0 = 0,\n n = nodes.length,\n i;\n\n // Push any overlapping nodes down.\n nodes.sort(ascendingDepth);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dy = y0 - node.y;\n if (dy > 0) node.y += dy;\n y0 = node.y + node.dy + nodePadding;\n }\n\n // If the bottommost node goes outside the bounds, push it back up.\n dy = y0 - nodePadding - size[1];\n if (dy > 0) {\n y0 = node.y -= dy;\n\n // Push any overlapping nodes back up.\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.y + node.dy + nodePadding - y0;\n if (dy > 0) node.y -= dy;\n y0 = node.y;\n }\n }\n });\n }\n\n function ascendingDepth(a, b) {\n return a.y - b.y;\n }\n }\n\n function computeLinkDepths() {\n nodes.forEach(function(node) {\n node.sourceLinks.sort(ascendingTargetDepth);\n node.targetLinks.sort(ascendingSourceDepth);\n });\n nodes.forEach(function(node) {\n var sy = 0, ty = 0;\n node.sourceLinks.forEach(function(link) {\n link.sy = sy;\n sy += link.dy;\n });\n node.targetLinks.forEach(function(link) {\n link.ty = ty;\n ty += link.dy;\n });\n });\n\n function ascendingSourceDepth(a, b) {\n return a.source.y - b.source.y;\n }\n\n function ascendingTargetDepth(a, b) {\n return a.target.y - b.target.y;\n }\n }\n\n function center(node) {\n return node.y + node.dy / 2;\n }\n\n function value(link) {\n return link.value;\n }\n\n return sankey;\n};\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = d3.sankey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/imports-loader?d3!../~/exports-loader?d3.sankey!../~/d3-plugins-sankey/sankey.js\n// module id = 3\n// module chunks = 0","\"use strict\";\n/*jshint node: true */\n\nvar d3 = require(\"d3\");\nvar Chart = require(\"d3.chart\");\n\n/*jshint newcap: false */\nmodule.exports = Chart(\"Sankey.Base\", {\n\n\tinitialize: function() {\n\t\tvar chart = this;\n\n\t\t// Inspired by d3.chart.layout.hierarchy's hierarchy.js, though also different\n\t\tchart.features\t= {};\n\t\tchart.d3\t\t\t\t= {};\n\t\tchart.layers\t\t= {};\n\n\t\t// when using faux-dom, be sure to set the width and height attributes\n\t\tif (!chart.base.attr(\"width\"))\t{ chart.base.attr(\"width\",\tchart.base.node().parentNode.clientWidth);\t}\n\t\tif (!chart.base.attr(\"height\")) { chart.base.attr(\"height\", chart.base.node().parentNode.clientHeight); }\n\n\t\t// dimensions, with space for node stroke and labels (smallest at bottom)\n\t\tchart.features.margins = {top: 1, right: 1, bottom: 6, left: 1};\n\t\tchart.features.width = chart.base.attr(\"width\") - chart.features.margins.left - chart.features.margins.right;\n\t\tchart.features.height = chart.base.attr(\"height\") - chart.features.margins.top - chart.features.margins.bottom;\n\n\t\tchart.features.name = function(d) { return d.name; };\n\t\t// there is no value property, because we also need to set it on parents\n\t\tchart.features.colorNodes = d3.scale.category20c();\n\t\tchart.features.colorLinks = null; // css styles by default\n\n\t\tchart.layers.base = chart.base.append(\"g\")\n\t\t\t.attr(\"transform\", \"translate(\" + chart.features.margins.left + \",\" + chart.features.margins.top + \")\");\n\t},\n\n\n\tname: function(_) {\n\t\tif (!arguments.length) { return this.features.name; }\n\t\tthis.features.name = _;\n\n\t\tthis.trigger(\"change:name\");\n\t\tif (this.root) { this.draw(this.root); }\n\n\t\treturn this;\n\t},\n\n\n\tcolorNodes: function(_) {\n\t\tif (!arguments.length) { return this.features.colorNodes; }\n\t\tthis.features.colorNodes = _;\n\n\t\tthis.trigger(\"change:color\");\n\t\tif (this.root) { this.draw(this.root); }\n\n\t\treturn this;\n\t},\n\n\n\tcolorLinks: function(_) {\n\t\tif (!arguments.length) { return this.features.colorLinks; }\n\t\tthis.features.colorLinks = _;\n\n\t\tthis.trigger(\"change:color\");\n\t\tif (this.data) { this.draw(this.data); }\n\n\t\treturn this;\n\t}\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./base.js\n// module id = 4\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":[\"d3\",\"chart\"],\"commonjs\":\"d3.chart\",\"commonjs2\":\"d3.chart\",\"amd\":\"d3.chart\"}\n// module id = 5\n// module chunks = 0","\"use strict\";\n/*jshint node: true */\n\nvar Sankey = require(\"./sankey\");\n\n// Sankey diagram with a hoverable selection\nmodule.exports = Sankey.extend(\"Sankey.Selection\", {\n\n\tinitialize: function() {\n\t\tvar chart = this;\n\n\t\tchart.features.selection = null;\n\t\tchart.features.unselectedOpacity = 0.2;\n\n\t\tchart.on(\"link:mouseover\", chart.selection);\n\t\tchart.on(\"link:mouseout\", function() { chart.selection(null); });\n\t\tchart.on(\"node:mouseover\", chart.selection);\n\t\tchart.on(\"node:mouseout\", function() { chart.selection(null); });\n\n\t\t// going through the whole draw cycle can be a little slow, so we use\n\t\t// a selection changed event to update existing nodes directly\n\t\tchart.on(\"change:selection\", updateTransition);\n\t\tthis.layer(\"links\").on(\"enter\", update);\n\t\tthis.layer(\"nodes\").on(\"enter\", update);\n\n\t\tfunction update() {\n\t\t\t/*jshint validthis:true */\n\t\t\tif (chart.features.selection && chart.features.selection.length) {\n\t\t\t\treturn this.style(\"opacity\", function(o) {\n\t\t\t\t\treturn chart.features.selection.indexOf(o) >= 0 ? 1 : chart.features.unselectedOpacity;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn this.style(\"opacity\", 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction updateTransition() {\n\t\t\tvar transition = chart.layers.base.selectAll(\".node, .link\").transition();\n\t\t\tif (!chart.features.selection || !chart.features.selection.length) {\n\t\t\t\t// short delay for the deselect transition to avoid flicker\n\t\t\t\ttransition = transition.delay(100);\n\t\t\t}\n\t\t\tupdate.apply(transition.duration(50));\n\t\t}\n\t},\n\n\tselection: function(_) {\n\t\tif (!arguments.length) { return this.features.selection; }\n\t\tthis.features.selection = (!_ || _ instanceof Array) ? _ : [_];\n\n\t\tthis.trigger(\"change:selection\");\n\n\t\treturn this;\n\t},\n\n\tunselectedOpacity: function(_) {\n\t\tif (!arguments.length) { return this.features.unselectedOpacity; }\n\t\tthis.features.unselectedOpacity = _;\n\n\t\tthis.trigger(\"change:selection\");\n\n\t\treturn this;\n\t}\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./selection.js\n// module id = 6\n// module chunks = 0","\"use strict\";\n/*jshint node: true */\n\nvar Selection = require(\"./selection\");\n\n// Sankey diagram with a path-hover effect\nmodule.exports = Selection.extend(\"Sankey.Path\", {\n\n\tselection: function(_) {\n\t\tvar chart = this;\n\n\t\tif (!arguments.length) { return chart.features.selection; }\n\t\tchart.features.selection = (!_ || _ instanceof Array) ? _ : [_];\n\n\t\t// expand selection with connections\n\t\tif (chart.features.selection) {\n\t\t\tchart.features.selection.forEach(function(o) {\n\t\t\t\tgetConnections(o).forEach(function(p) {\n\t\t\t\t\tchart.features.selection.push(p);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tchart.trigger(\"change:selection\");\n\n\t\treturn chart;\n\t}\n\n});\n\nfunction getConnections(o, direction) {\n\tif (o.source && o.target) {\n\t\treturn getConnectionsLink(o, direction);\n\t} else {\n\t\treturn getConnectionsNode(o, direction);\n\t}\n}\n\n// Return the link and its connected nodes with their links etc.\nfunction getConnectionsLink(o, direction) {\n\tvar links = [o];\n\tdirection = direction || \"both\";\n\n\tif (direction == \"source\" || direction == \"both\") {\n\t\tlinks = links.concat(getConnectionsNode(o.source, \"source\"));\n\t}\n\tif (direction == \"target\" || direction == \"both\") {\n\t\tlinks = links.concat(getConnectionsNode(o.target, \"target\"));\n\t}\n\n\treturn links;\n}\n\n// Return the node and its connected links. If direction is \"both\", just return\n// all links; if direction is \"source\", only return the source link when there\n// is one target link (or none, in which case the node is an endnode); if\n// direction is \"target\" vice versa. Open the product example to see why.\nfunction getConnectionsNode(o, direction) {\n\tvar links = [o];\n\tdirection = direction || \"both\";\n\n\tif ((direction == \"source\" && o.sourceLinks.length < 2) || direction == \"both\") {\n\t\to.targetLinks.forEach(function(p) { links = links.concat(getConnectionsLink(p, direction)); });\n\t}\n\tif ((direction == \"target\" && o.targetLinks.length < 2) || direction == \"both\") {\n\t\to.sourceLinks.forEach(function(p) { links = links.concat(getConnectionsLink(p, direction)); });\n\t}\n\n\treturn links;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./path.js\n// module id = 7\n// module chunks = 0"],"sourceRoot":""}