diff --git a/.gitignore b/.gitignore index 09dd4e2..7d0baf7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .DS_Store* -build/ node_modules .idea *.swp diff --git a/README.md b/README.md index 89c5cf5..db3091a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ SKD3 requires [d3.js](http://d3js.org/) version **[4.9.0](https://github.com/d3/ ## Installing -If you use NPM, `npm install skd3`. Otherwise, download the [latest release](https://github.com/fabriciorhs/skd3/releases/latest). You can also load directly from [unpkg.com](https://cdn.rawgit.com/): +If you use NPM, `npm install skd3`. Otherwise, download the [latest release](https://github.com/fabriciorhs/skd3/releases/latest). You can also load directly from [rawgit.com](https://cdn.rawgit.com/): ```html diff --git a/build/sk.d3.css b/build/sk.d3.css new file mode 100644 index 0000000..515e2f6 --- /dev/null +++ b/build/sk.d3.css @@ -0,0 +1,100 @@ +/* skd3 version 0.1.0 (https://github.com/fabriciorhs/skd3) 2017-09-03 */ + +.sk-svg { + font-family: sans-serif; +} + +/* disable text selection in sankey */ +.sk-svg text { + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.sk-svg text::-moz-selection { + background: none; +} +.sk-svg text::selection { + background: none; +} +.sk-node rect { + cursor: move; + fill-opacity: .9; + shape-rendering: crispEdges; +} +.sk-node text { + pointer-events: none; + font-size: 13px; +} +.sk-link { + fill: none; + stroke: #000; + stroke-opacity: .16; + transition-property: stroke-opacity; + transition-duration: 0.5s; +} +.sk-link:hover { + stroke-opacity: .5; +} + +/* tooltip styles */ +.d3-tip h1 { + line-height: 12px !important; + font-weight: bold !important; + font-size: 14px; + padding: 0; + margin-top: 5px !important; + margin-bottom: 5px; + width: 100%; +} +.d3-tip h2 { + line-height: 12px !important; + font-weight: bold; + font-size: 12px; + padding-right: inherit; + padding-left: inherit; + padding-top: 2px; + padding-bottom: 2px; + margin: 0px; +} +.d3-tip h3 { + line-height: 12px !important; + font-weight: normal; + font-size: 8px; + margin: 0; + padding: 0; +} +.d3-tip table { + font-weight: normal; + font-size: 12px; + padding: none; + margin: 0; + width: 100%; + border: none; + border-collapse: collapse; +} +.d3-tip td { + padding-top: 2px; + padding-bottom: 2px; +} +.d3-tip .col-left { + padding-right: 8px; +} +.d3-tip .table-wrapper { + margin: 0; + padding: inherit; + border: none; +} +.d3-tip { + line-height: 12px !important; + font-family: sans-serif; + font-weight: normal; + padding: 4px; + background: white; + color: black; + border-radius: 2px; + pointer-events: none; + background: white; + box-shadow: 1px 1px 4px grey; +} \ No newline at end of file diff --git a/build/sk.d3.js b/build/sk.d3.js new file mode 100644 index 0000000..57e9899 --- /dev/null +++ b/build/sk.d3.js @@ -0,0 +1,741 @@ +/* skd3 version 0.1.0 (https://github.com/fabriciorhs/skd3) 2017-09-03 */ +(function(){ +// set up main sk object +var sk = {}; +sk.alertVersion = function () { alert(this.version);} + +// Node/CommonJS - require D3 +if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') { + d3 = require('d3'); +} + +// Node/CommonJS exports +if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') { + module.exports = sk; +} + +if (typeof(window) !== 'undefined') { + window.sk = sk; +} +// https://github.com/d3/d3-sankey Version 0.5.0. Copyright 2017 Mike Bostock. +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array"),require("d3-collection"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-collection","d3-shape"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3)}(this,function(n,t,e,r){"use strict";function o(n){return function(){return n}}function u(n,t){return n.source.y-t.source.y}function i(n,t){return n.target.y-t.target.y}function c(n,t){return n.y-t.y}function f(n){return n.value}function s(n){return n.y+n.dy/2}function a(n){return s(n.source)*n.value}function d(n){return s(n.target)*n.value}function y(n){return n.nodes}function l(n){return n.links}function h(n){return[n.source.x+n.source.dx,n.source.y+n.sy+n.dy/2]}function g(n){return[n.target.x,n.target.y+n.ty+n.dy/2]}var k=function(){function n(){var n={nodes:j.apply(null,arguments),links:H.apply(null,arguments)};return r(n),h(n),g(n),v(n),E(n),n}function r(n){n.nodes.forEach(function(n){n.sourceLinks=[],n.targetLinks=[]}),n.links.forEach(function(t){var e=t.source,r=t.target;"number"==typeof e&&(e=t.source=n.nodes[t.source]),"number"==typeof r&&(r=t.target=n.nodes[t.target]),e.sourceLinks.push(t),r.targetLinks.push(t)})}function h(n){n.nodes.forEach(function(n){n.value=Math.max(t.sum(n.sourceLinks,f),t.sum(n.targetLinks,f))})}function g(n){for(var t,e=n.nodes,r=0;e.length;)t=[],e.forEach(function(n){n.x=r,n.dx=q,n.sourceLinks.forEach(function(n){t.indexOf(n.target)<0&&t.push(n.target)})}),e=t,++r;k(n,r),p(n,(m-L-q)/(r-1))}function k(n,t){n.nodes.forEach(function(n){n.sourceLinks.length||(n.x=t-1)})}function p(n,t){n.nodes.forEach(function(n){n.x=L+n.x*t})}function v(n){function r(){o.forEach(function(n){var t,e,r,o=x,u=n.length;for(n.sort(c),r=0;r0&&(t.y+=e),o=t.y+t.dy+z;if((e=o-z-b)>0)for(o=t.y-=e,r=u-2;r>=0;--r)t=n[r],e=t.y+t.dy+z-o,e>0&&(t.y-=e),o=t.y})}var o=e.nest().key(function(n){return n.x}).sortKeys(t.ascending).entries(n.nodes).map(function(n){return n.values});!function(){var e=t.min(o,function(n){return(b-x-(n.length-1)*z)/t.sum(n,f)});o.forEach(function(n){n.forEach(function(n,t){n.y=t,n.dy=n.value*e})}),n.links.forEach(function(n){n.dy=n.value*e})}(),r();for(var u=1,i=M;i>0;--i)!function(n){o.slice().reverse().forEach(function(e){e.forEach(function(e){e.sourceLinks.length&&(e.y+=(t.sum(e.sourceLinks,d)/t.sum(e.sourceLinks,f)-s(e))*n)})})}(u*=.99),r(),function(n){o.forEach(function(e){e.forEach(function(e){e.targetLinks.length&&(e.y+=(t.sum(e.targetLinks,a)/t.sum(e.targetLinks,f)-s(e))*n)})})}(u),r()}function E(n){n.nodes.forEach(function(n){n.sourceLinks.sort(i),n.targetLinks.sort(u)}),n.nodes.forEach(function(n){var t=0,e=0;n.sourceLinks.forEach(function(n){n.sy=t,t+=n.dy}),n.targetLinks.forEach(function(n){n.ty=e,e+=n.dy})})}var L=0,x=0,m=1,b=1,q=24,z=8,j=y,H=l,M=32;return n.update=function(n){return E(n),n},n.nodeWidth=function(t){return arguments.length?(q=+t,n):q},n.nodePadding=function(t){return arguments.length?(z=+t,n):z},n.nodes=function(t){return arguments.length?(j="function"==typeof t?t:o(t),n):j},n.links=function(t){return arguments.length?(H="function"==typeof t?t:o(t),n):H},n.size=function(t){return arguments.length?(L=x=0,m=+t[0],b=+t[1],n):[m-L,b-x]},n.extent=function(t){return arguments.length?(L=+t[0][0],m=+t[1][0],x=+t[0][1],b=+t[1][1],n):[[L,x],[m,b]]},n.iterations=function(t){return arguments.length?(M=+t,n):M},n},p=function(){return r.linkHorizontal().source(h).target(g)};n.sankey=k,n.sankeyLinkHorizontal=p,Object.defineProperty(n,"__esModule",{value:!0})});/** + * d3.tip + * Copyright (c) 2013-2017 Justin Palmer + * + * Tooltips for d3.js SVG visualizations + */ +// eslint-disable-next-line no-extra-semi +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module with d3 as a dependency. + define([ + 'd3-collection', + 'd3-selection' + ], factory) + } else if (typeof module === 'object' && module.exports) { + /* eslint-disable global-require */ + // CommonJS + var d3Collection = require('d3-collection'), + d3Selection = require('d3-selection') + module.exports = factory(d3Collection, d3Selection) + /* eslint-enable global-require */ + } else { + // Browser global. + var d3 = root.d3 + // eslint-disable-next-line no-param-reassign + root.d3.tip = factory(d3, d3) + } +}(this, function(d3Collection, d3Selection) { + // Public - contructs a new tooltip + // + // Returns a tip + return function() { + var direction = d3TipDirection, + offset = d3TipOffset, + html = d3TipHTML, + rootElement = document.body, + node = initNode(), + svg = null, + point = null, + target = null + + function tip(vis) { + svg = getSVGNode(vis) + if (!svg) return + point = svg.createSVGPoint() + rootElement.appendChild(node) + } + + // Public - show the tooltip on the screen + // + // Returns a tip + tip.show = function() { + var args = Array.prototype.slice.call(arguments) + if (args[args.length - 1] instanceof SVGElement) target = args.pop() + + var content = html.apply(this, args), + poffset = offset.apply(this, args), + dir = direction.apply(this, args), + nodel = getNodeEl(), + i = directions.length, + coords, + scrollTop = document.documentElement.scrollTop || + rootElement.scrollTop, + scrollLeft = document.documentElement.scrollLeft || + rootElement.scrollLeft + + nodel.html(content) + .style('opacity', 1).style('pointer-events', 'all') + + while (i--) nodel.classed(directions[i], false) + coords = directionCallbacks.get(dir).apply(this) + nodel.classed(dir, true) + .style('top', (coords.top + poffset[0]) + scrollTop + 'px') + .style('left', (coords.left + poffset[1]) + scrollLeft + 'px') + + return tip + } + + // Public - hide the tooltip + // + // Returns a tip + tip.hide = function() { + var nodel = getNodeEl() + nodel.style('opacity', 0).style('pointer-events', 'none') + return tip + } + + // Public: Proxy attr calls to the d3 tip container. + // Sets or gets attribute value. + // + // n - name of the attribute + // v - value of the attribute + // + // Returns tip or attribute value + // eslint-disable-next-line no-unused-vars + tip.attr = function(n, v) { + if (arguments.length < 2 && typeof n === 'string') { + return getNodeEl().attr(n) + } + + var args = Array.prototype.slice.call(arguments) + d3Selection.selection.prototype.attr.apply(getNodeEl(), args) + return tip + } + + // Public: Proxy style calls to the d3 tip container. + // Sets or gets a style value. + // + // n - name of the property + // v - value of the property + // + // Returns tip or style property value + // eslint-disable-next-line no-unused-vars + tip.style = function(n, v) { + if (arguments.length < 2 && typeof n === 'string') { + return getNodeEl().style(n) + } + + var args = Array.prototype.slice.call(arguments) + d3Selection.selection.prototype.style.apply(getNodeEl(), args) + return tip + } + + // Public: Set or get the direction of the tooltip + // + // v - One of n(north), s(south), e(east), or w(west), nw(northwest), + // sw(southwest), ne(northeast) or se(southeast) + // + // Returns tip or direction + tip.direction = function(v) { + if (!arguments.length) return direction + direction = v == null ? v : functor(v) + + return tip + } + + // Public: Sets or gets the offset of the tip + // + // v - Array of [x, y] offset + // + // Returns offset or + tip.offset = function(v) { + if (!arguments.length) return offset + offset = v == null ? v : functor(v) + + return tip + } + + // Public: sets or gets the html value of the tooltip + // + // v - String value of the tip + // + // Returns html value or tip + tip.html = function(v) { + if (!arguments.length) return html + html = v == null ? v : functor(v) + + return tip + } + + // Public: sets or gets the root element anchor of the tooltip + // + // v - root element of the tooltip + // + // Returns root node of tip + tip.rootElement = function(v) { + if (!arguments.length) return rootElement + rootElement = v == null ? v : functor(v) + + return tip + } + + // Public: destroys the tooltip and removes it from the DOM + // + // Returns a tip + tip.destroy = function() { + if (node) { + getNodeEl().remove() + node = null + } + return tip + } + + function d3TipDirection() { return 'n' } + function d3TipOffset() { return [0, 0] } + function d3TipHTML() { return ' ' } + + var directionCallbacks = d3Collection.map({ + n: directionNorth, + s: directionSouth, + e: directionEast, + w: directionWest, + nw: directionNorthWest, + ne: directionNorthEast, + sw: directionSouthWest, + se: directionSouthEast + }), + directions = directionCallbacks.keys() + + function directionNorth() { + var bbox = getScreenBBox() + return { + top: bbox.n.y - node.offsetHeight, + left: bbox.n.x - node.offsetWidth / 2 + } + } + + function directionSouth() { + var bbox = getScreenBBox() + return { + top: bbox.s.y, + left: bbox.s.x - node.offsetWidth / 2 + } + } + + function directionEast() { + var bbox = getScreenBBox() + return { + top: bbox.e.y - node.offsetHeight / 2, + left: bbox.e.x + } + } + + function directionWest() { + var bbox = getScreenBBox() + return { + top: bbox.w.y - node.offsetHeight / 2, + left: bbox.w.x - node.offsetWidth + } + } + + function directionNorthWest() { + var bbox = getScreenBBox() + return { + top: bbox.nw.y - node.offsetHeight, + left: bbox.nw.x - node.offsetWidth + } + } + + function directionNorthEast() { + var bbox = getScreenBBox() + return { + top: bbox.ne.y - node.offsetHeight, + left: bbox.ne.x + } + } + + function directionSouthWest() { + var bbox = getScreenBBox() + return { + top: bbox.sw.y, + left: bbox.sw.x - node.offsetWidth + } + } + + function directionSouthEast() { + var bbox = getScreenBBox() + return { + top: bbox.se.y, + left: bbox.se.x + } + } + + function initNode() { + var div = d3Selection.select(document.createElement('div')) + div + .style('position', 'absolute') + .style('top', 0) + .style('opacity', 0) + .style('pointer-events', 'none') + .style('box-sizing', 'border-box') + + return div.node() + } + + function getSVGNode(element) { + var svgNode = element.node() + if (!svgNode) return null + if (svgNode.tagName.toLowerCase() === 'svg') return svgNode + return svgNode.ownerSVGElement + } + + function getNodeEl() { + if (node == null) { + node = initNode() + // re-add node to DOM + rootElement.appendChild(node) + } + return d3Selection.select(node) + } + + // Private - gets the screen coordinates of a shape + // + // Given a shape on the screen, will return an SVGPoint for the directions + // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), + // nw(northwest), sw(southwest). + // + // +-+-+ + // | | + // + + + // | | + // +-+-+ + // + // Returns an Object {n, s, e, w, nw, sw, ne, se} + function getScreenBBox() { + var targetel = target || d3Selection.event.target + + while (targetel.getScreenCTM == null && targetel.parentNode == null) { + targetel = targetel.parentNode + } + + var bbox = {}, + matrix = targetel.getScreenCTM(), + tbbox = targetel.getBBox(), + width = tbbox.width, + height = tbbox.height, + x = tbbox.x, + y = tbbox.y + + point.x = x + point.y = y + bbox.nw = point.matrixTransform(matrix) + point.x += width + bbox.ne = point.matrixTransform(matrix) + point.y += height + bbox.se = point.matrixTransform(matrix) + point.x -= width + bbox.sw = point.matrixTransform(matrix) + point.y -= height / 2 + bbox.w = point.matrixTransform(matrix) + point.x += width + bbox.e = point.matrixTransform(matrix) + point.x -= width / 2 + point.y -= height / 2 + bbox.n = point.matrixTransform(matrix) + point.y += height + bbox.s = point.matrixTransform(matrix) + + return bbox + } + + // Private - replace D3JS 3.X d3.functor() function + function functor(v) { + return typeof v === 'function' ? v : function() { + return v + } + } + + return tip + } +// eslint-disable-next-line semi +})); +sk.createSankey = function(containerId, configSankey, dataSankey) { + + // to prevent NaN value, related https://github.com/d3/d3-sankey/issues/39 + var _safeValueToLink = function(v) { return Math.max(v, Number.MIN_VALUE); } + + var _dataSankey = { + nodes: [], + links: [] + }; + + //load data + dataSankey.nodes.map(function(d) { + _dataSankey.nodes.push({ + name: d.name, + color: d.color, + id: d.id + }); + }); + dataSankey.links.map(function(l) { + _dataSankey.links.push({ + source: l.source, + target: l.target, + id: l.id, + value: _safeValueToLink(l.value) + }); + }); + + //var _dataSankey = Object.assign({}, dataSankey); + + var _updateLinksId = function(linkData) { + for (var i = 0; i < linkData.length; i++) + if (linkData[i].id == undefined) + linkData[i].id = linkData[i].source + " -> " + linkData[i].target; + }; + //update links id + _updateLinksId(_dataSankey.links); + + //removing old svg and tips + d3.select('.d3-tip-nodes').remove(); + d3.select('.d3-tip').remove(); + d3.select(containerId + ' svg').remove() + + var container = d3.select(containerId); + + function _getDimensions(container, margin) { + var bbox = container.node().getBoundingClientRect(); + return { + width: bbox.width - margin.left - margin.right, + height: bbox.height - margin.top - margin.bottom + }; + } + var dimensions = _getDimensions(container, configSankey.margin); + + var svg_base = container.append("svg") + .attr('width', dimensions.width + configSankey.margin.left + configSankey.margin.right) + .attr('height', dimensions.height + configSankey.margin.top + configSankey.margin.bottom) + .attr("class", "sk-svg"); + var svg = svg_base.append("g") + .attr('transform', "translate(" + configSankey.margin.left + "," + configSankey.margin.top + ")"); + + var sankey = d3.sankey() + .nodeWidth(15) + .nodePadding(10) + .extent([ + [0, 0], + [dimensions.width, dimensions.height] + ]); + + var path = d3.sankeyLinkHorizontal(); + + //Fonts + var _getFontSize = function(d) { + return configSankey.nodes.fontSize; + }; //For default + var _dynamicFontSize; + var _updateRangeFontData = function(d) {}; //For default + if (configSankey.nodes.dynamicSizeFontNode.enabled) { + _dynamicFontSize = d3.scaleLinear().range( + [configSankey.nodes.dynamicSizeFontNode.minSize, + configSankey.nodes.dynamicSizeFontNode.maxSize + ]); + _updateRangeFontData = function(nodeData) { + _dynamicFontSize.domain(d3.extent(nodeData, function(d) { + return d.value + })); + }; + _getFontSize = function(d) { + return Math.floor(_dynamicFontSize(d.value)); + }; + } + + //Colors + //set color in nodes, case not exists + for (var i = 0; i < _dataSankey.nodes.length; i++) + if (_dataSankey.nodes[i].color == undefined) + _dataSankey.nodes[i].color = configSankey.nodes.colors(_dataSankey.nodes[i].name.replace(/ .*/, "")); + + //Tooltip function: + //D3 sankey diagram with view options (Austin Czarnecki�s Block cc6371af0b726e61b9ab) + //https://bl.ocks.org/austinczarnecki/cc6371af0b726e61b9ab + var linkTooltipOffset = 65, + nodeTooltipOffset = 130; + var tipLinks = d3.tip().attr("class", "d3-tip").offset([-10, 0]); + var tipNodes = d3.tip().attr("class", "d3-tip d3-tip-nodes").offset([-10, 0]); + + function _formatValueTooltip(val) { + if (configSankey.links.formatValue) + return configSankey.links.formatValue(val); + else + return val + ' ' + configSankey.links.unit; + } + + tipLinks.html(function(d) { + var title, candidate; + if (_dataSankey.links.indexOf(d.source.name) > -1) { + candidate = d.source.name; + title = d.target.name; + } else { + candidate = d.target.name; + title = d.source.name; + } + var html = '
' + + '

' + title + '

' + + '' + + '' + + '' + + '' + + '' + + '
' + candidate + '' + _formatValueTooltip(d.value) + '
' + + '
'; + return html; + }); + var topContentSVG = d3.select('.sk-svg').node().getBoundingClientRect().top; + tipLinks.move = function(event) { + tipLinks + .style("top", function() { + if (d3.event.pageY - topContentSVG - linkTooltipOffset >= 0) + return (d3.event.pageY - linkTooltipOffset) + "px"; + else + return d3.event.pageY + 20 + "px"; + }) + .style("left", function() { + var left = (Math.max(d3.event.pageX - linkTooltipOffset, 10)); + left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20) + return left + "px"; + }) + }; + + tipNodes.html(function(d) { + var nodeName = d.name; + var linksFrom = d.targetLinks; //invert for reference + var linksTo = d.sourceLinks; + var html; + + html = '
' + + '

' + nodeName + '

' + + ''; + if (linksFrom.length > 0 & linksTo.length > 0) { + html += '' + } + for (i = 0; i < linksFrom.length; ++i) { + html += '' + + '' + + '' + + ''; + } + if (linksFrom.length > 0 & linksTo.length > 0) { + html += '' + } + for (i = 0; i < linksTo.length; ++i) { + html += '' + + '' + + '' + + ''; + } + html += '

' + configSankey.tooltip.labelSource + '

' + linksFrom[i].source.name + '' + _formatValueTooltip(linksFrom[i].value) + '

' + configSankey.tooltip.labelTarget + '

' + linksTo[i].target.name + '' + _formatValueTooltip(linksTo[i].value) + '
'; + return html; + }); + tipNodes.move = function(event) { + tipNodes.boxInfo = d3.select('.d3-tip-nodes').node().getBoundingClientRect(); + tipNodes + .style("top", + function() { + if ((d3.event.pageY - topContentSVG - tipNodes.boxInfo.height - 20) >= 0) + return (d3.event.pageY - tipNodes.boxInfo.height - 20) + "px"; + else + return d3.event.pageY + 20 + "px"; + } + ) + .style("left", function() { + var left = (Math.max(d3.event.pageX - nodeTooltipOffset, 10)); + left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20) + return left + "px"; + }) + }; + + svg.call(tipLinks); + svg.call(tipNodes); + var _stopTooltips = function() { + if (tipLinks) tipLinks.hide(); + if (tipNodes) tipNodes.hide(); + }; + + //Load data + sankey(_dataSankey); + + //update range font data + _updateRangeFontData(_dataSankey.nodes); + + + var link = svg.append("g").selectAll(".sk-link") + .data(_dataSankey.links, function(d) { + return d.id; + }) + .enter().append("path") + .attr("class", "sk-link") + .attr("d", path) + .style("stroke", function(d) { + return d.source.color; + }) + .style("stroke-width", function(d) { + return Math.max(1, d.dy) + "px"; + }) + .sort(function(a, b) { + return b.dy - a.dy; + }); + if (configSankey.tooltip.infoDiv) + link.on('mousemove', tipLinks.move).on('mouseover', tipLinks.show).on('mouseout', tipLinks.hide); + else + link.append("title").text(function(d) { + return d.source.name + " -> " + d.target.name + "\n" + _formatValueTooltip(d.value); + }); + + // the function for moving the nodes + function _dragmove(d) { + _stopTooltips(); + d3.select(this).attr("transform", "translate(" + d.x + "," + (d.y = Math.max(0, Math.min(dimensions.height - d.dy, d3.event.y))) + ")"); + sankey.update(_dataSankey); + link.attr("d", path); + } + + var node = svg.append("g").selectAll(".sk-node") + .data(_dataSankey.nodes, function(d) { + return d.name; + }) + .enter().append("g") + .attr("class", "sk-node") + .attr("transform", function(d) { + return "translate(" + d.x + "," + d.y + ")"; + }) + if (configSankey.tooltip.infoDiv) + node.on('mousemove', tipNodes.move).on('mouseover', tipNodes.show).on('mouseout', tipNodes.hide); + else + node.append("title").text(function(d) { + return d.name + "\n" + _formatValueTooltip(d.value); + }); + //Drag nodes + if (configSankey.nodes.canDragNodes) + node.call(d3.drag().subject(function(d) { + return d; + }).on("start", function() { + d3.event.sourceEvent.stopPropagation(); + this.parentNode.appendChild(this); + }).on("drag", _dragmove)); + + node.append("rect") + .attr("height", function(d) { + return d.dy; + }) + .attr("width", sankey.nodeWidth()) + .style("fill", function(d) { + return d.color; + }) + .style("stroke", function(d) { + return d3.rgb(d.color).darker(1.8); + }); + + node.append("text") + .attr("x", -6) + .attr("y", function(d) { + return d.dy / 2; + }) + .attr("dy", ".35em") + .attr("text-anchor", "end") + .attr("transform", null) + .style("fill", function(d) { + return d3.rgb(d.color).darker(2.4); + }) + .text(function(d) { + return d.name; + }) + .style("font-size", function(d) { + return _getFontSize(d) + "px"; + }) + .filter(function(d) { + return d.x < dimensions.width / 2; + }) + .attr("x", 6 + sankey.nodeWidth()) + .attr("text-anchor", "start"); + + //https://bl.ocks.org/syntagmatic/77c7f7e8802e8824eed473dd065c450b + var _updateLinksValues = function(dataUpdated) { + _stopTooltips(); + sankey(dataUpdated); + sankey.update(dataUpdated); + + //update range font data + _updateRangeFontData(dataUpdated.nodes); + + svg.selectAll(".sk-link") + .data(dataUpdated.links, function(d) { + return d.id; + }) + .sort(function(a, b) { + return b.dy - a.dy; + }) + .transition() + .duration(1300) + .attr("d", path) + .style("stroke-width", function(d) { + return Math.max(1, d.dy) + "px"; + }); + + svg.selectAll(".sk-node") + .data(dataUpdated.nodes, function(d) { + return d.name; + }) + .transition() + .duration(1300) + .attr("transform", function(d) { + return "translate(" + d.x + "," + d.y + ")"; + }); + + svg.selectAll(".sk-node rect") + .transition() + .duration(1300) + .attr("height", function(d) { + return d.dy; + }); + + svg.selectAll(".sk-node text") + .transition() + .duration(1300) + .attr("y", function(d) { + return d.dy / 2; + }) + .style("font-size", function(d) { + return _getFontSize(d) + "px"; + }); + }; + + //Update value of links, for call the function '_updateLinksValues' transition values (old to new) + //This function only update values from links + this.updateData = function(dataUpdated) { + for (var i = 0; i < dataUpdated.links.length; i++) { + var idLinkUpdate = dataUpdated.links[i].id || dataUpdated.links[i].source + " -> " + dataUpdated.links[i].target; + var linkToUpdate = _dataSankey.links.filter(function(l) { + return l.id == idLinkUpdate + })[0]; + if (linkToUpdate) linkToUpdate.value = _safeValueToLink(dataUpdated.links[i].value); + } + _updateLinksValues(_dataSankey); + }; + + return this; +}; +sk.version = "0.1.0"; +})(); +//# sourceMappingURL=sk.d3.js.map \ No newline at end of file diff --git a/build/sk.d3.js.map b/build/sk.d3.js.map new file mode 100644 index 0000000..889351b --- /dev/null +++ b/build/sk.d3.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/init.js","../node_modules/d3-sankey/build/d3-sankey.min.js","../node_modules/d3-tip/index.js","../src/core.js"],"names":[],"mappings":";;AAAA,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM;AACxB,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;AACZ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG;AACrD;AACA,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;AAC7B,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,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eof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {\n d3 = require('d3');\n}\n\n// Node/CommonJS exports\nif (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') {\n module.exports = sk;\n}\n\nif (typeof(window) !== 'undefined') {\n window.sk = sk;\n}\n","// https://github.com/d3/d3-sankey Version 0.5.0. Copyright 2017 Mike Bostock.\n!function(n,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports,require(\"d3-array\"),require(\"d3-collection\"),require(\"d3-shape\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"d3-array\",\"d3-collection\",\"d3-shape\"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3)}(this,function(n,t,e,r){\"use strict\";function o(n){return function(){return n}}function u(n,t){return n.source.y-t.source.y}function i(n,t){return n.target.y-t.target.y}function c(n,t){return n.y-t.y}function f(n){return n.value}function s(n){return n.y+n.dy/2}function a(n){return s(n.source)*n.value}function d(n){return s(n.target)*n.value}function y(n){return n.nodes}function l(n){return n.links}function h(n){return[n.source.x+n.source.dx,n.source.y+n.sy+n.dy/2]}function g(n){return[n.target.x,n.target.y+n.ty+n.dy/2]}var k=function(){function n(){var n={nodes:j.apply(null,arguments),links:H.apply(null,arguments)};return r(n),h(n),g(n),v(n),E(n),n}function r(n){n.nodes.forEach(function(n){n.sourceLinks=[],n.targetLinks=[]}),n.links.forEach(function(t){var e=t.source,r=t.target;\"number\"==typeof e&&(e=t.source=n.nodes[t.source]),\"number\"==typeof r&&(r=t.target=n.nodes[t.target]),e.sourceLinks.push(t),r.targetLinks.push(t)})}function h(n){n.nodes.forEach(function(n){n.value=Math.max(t.sum(n.sourceLinks,f),t.sum(n.targetLinks,f))})}function g(n){for(var t,e=n.nodes,r=0;e.length;)t=[],e.forEach(function(n){n.x=r,n.dx=q,n.sourceLinks.forEach(function(n){t.indexOf(n.target)<0&&t.push(n.target)})}),e=t,++r;k(n,r),p(n,(m-L-q)/(r-1))}function k(n,t){n.nodes.forEach(function(n){n.sourceLinks.length||(n.x=t-1)})}function p(n,t){n.nodes.forEach(function(n){n.x=L+n.x*t})}function v(n){function r(){o.forEach(function(n){var t,e,r,o=x,u=n.length;for(n.sort(c),r=0;r0&&(t.y+=e),o=t.y+t.dy+z;if((e=o-z-b)>0)for(o=t.y-=e,r=u-2;r>=0;--r)t=n[r],e=t.y+t.dy+z-o,e>0&&(t.y-=e),o=t.y})}var o=e.nest().key(function(n){return n.x}).sortKeys(t.ascending).entries(n.nodes).map(function(n){return n.values});!function(){var e=t.min(o,function(n){return(b-x-(n.length-1)*z)/t.sum(n,f)});o.forEach(function(n){n.forEach(function(n,t){n.y=t,n.dy=n.value*e})}),n.links.forEach(function(n){n.dy=n.value*e})}(),r();for(var u=1,i=M;i>0;--i)!function(n){o.slice().reverse().forEach(function(e){e.forEach(function(e){e.sourceLinks.length&&(e.y+=(t.sum(e.sourceLinks,d)/t.sum(e.sourceLinks,f)-s(e))*n)})})}(u*=.99),r(),function(n){o.forEach(function(e){e.forEach(function(e){e.targetLinks.length&&(e.y+=(t.sum(e.targetLinks,a)/t.sum(e.targetLinks,f)-s(e))*n)})})}(u),r()}function E(n){n.nodes.forEach(function(n){n.sourceLinks.sort(i),n.targetLinks.sort(u)}),n.nodes.forEach(function(n){var t=0,e=0;n.sourceLinks.forEach(function(n){n.sy=t,t+=n.dy}),n.targetLinks.forEach(function(n){n.ty=e,e+=n.dy})})}var L=0,x=0,m=1,b=1,q=24,z=8,j=y,H=l,M=32;return n.update=function(n){return E(n),n},n.nodeWidth=function(t){return arguments.length?(q=+t,n):q},n.nodePadding=function(t){return arguments.length?(z=+t,n):z},n.nodes=function(t){return arguments.length?(j=\"function\"==typeof t?t:o(t),n):j},n.links=function(t){return arguments.length?(H=\"function\"==typeof t?t:o(t),n):H},n.size=function(t){return arguments.length?(L=x=0,m=+t[0],b=+t[1],n):[m-L,b-x]},n.extent=function(t){return arguments.length?(L=+t[0][0],m=+t[1][0],x=+t[0][1],b=+t[1][1],n):[[L,x],[m,b]]},n.iterations=function(t){return arguments.length?(M=+t,n):M},n},p=function(){return r.linkHorizontal().source(h).target(g)};n.sankey=k,n.sankeyLinkHorizontal=p,Object.defineProperty(n,\"__esModule\",{value:!0})});","/**\r\n * d3.tip\r\n * Copyright (c) 2013-2017 Justin Palmer\r\n *\r\n * Tooltips for d3.js SVG visualizations\r\n */\r\n// eslint-disable-next-line no-extra-semi\r\n;(function(root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module with d3 as a dependency.\r\n define([\r\n 'd3-collection',\r\n 'd3-selection'\r\n ], factory)\r\n } else if (typeof module === 'object' && module.exports) {\r\n /* eslint-disable global-require */\r\n // CommonJS\r\n var d3Collection = require('d3-collection'),\r\n d3Selection = require('d3-selection')\r\n module.exports = factory(d3Collection, d3Selection)\r\n /* eslint-enable global-require */\r\n } else {\r\n // Browser global.\r\n var d3 = root.d3\r\n // eslint-disable-next-line no-param-reassign\r\n root.d3.tip = factory(d3, d3)\r\n }\r\n}(this, function(d3Collection, d3Selection) {\r\n // Public - contructs a new tooltip\r\n //\r\n // Returns a tip\r\n return function() {\r\n var direction = d3TipDirection,\r\n offset = d3TipOffset,\r\n html = d3TipHTML,\r\n rootElement = document.body,\r\n node = initNode(),\r\n svg = null,\r\n point = null,\r\n target = null\r\n\r\n function tip(vis) {\r\n svg = getSVGNode(vis)\r\n if (!svg) return\r\n point = svg.createSVGPoint()\r\n rootElement.appendChild(node)\r\n }\r\n\r\n // Public - show the tooltip on the screen\r\n //\r\n // Returns a tip\r\n tip.show = function() {\r\n var args = Array.prototype.slice.call(arguments)\r\n if (args[args.length - 1] instanceof SVGElement) target = args.pop()\r\n\r\n var content = html.apply(this, args),\r\n poffset = offset.apply(this, args),\r\n dir = direction.apply(this, args),\r\n nodel = getNodeEl(),\r\n i = directions.length,\r\n coords,\r\n scrollTop = document.documentElement.scrollTop ||\r\n rootElement.scrollTop,\r\n scrollLeft = document.documentElement.scrollLeft ||\r\n rootElement.scrollLeft\r\n\r\n nodel.html(content)\r\n .style('opacity', 1).style('pointer-events', 'all')\r\n\r\n while (i--) nodel.classed(directions[i], false)\r\n coords = directionCallbacks.get(dir).apply(this)\r\n nodel.classed(dir, true)\r\n .style('top', (coords.top + poffset[0]) + scrollTop + 'px')\r\n .style('left', (coords.left + poffset[1]) + scrollLeft + 'px')\r\n\r\n return tip\r\n }\r\n\r\n // Public - hide the tooltip\r\n //\r\n // Returns a tip\r\n tip.hide = function() {\r\n var nodel = getNodeEl()\r\n nodel.style('opacity', 0).style('pointer-events', 'none')\r\n return tip\r\n }\r\n\r\n // Public: Proxy attr calls to the d3 tip container.\r\n // Sets or gets attribute value.\r\n //\r\n // n - name of the attribute\r\n // v - value of the attribute\r\n //\r\n // Returns tip or attribute value\r\n // eslint-disable-next-line no-unused-vars\r\n tip.attr = function(n, v) {\r\n if (arguments.length < 2 && typeof n === 'string') {\r\n return getNodeEl().attr(n)\r\n }\r\n\r\n var args = Array.prototype.slice.call(arguments)\r\n d3Selection.selection.prototype.attr.apply(getNodeEl(), args)\r\n return tip\r\n }\r\n\r\n // Public: Proxy style calls to the d3 tip container.\r\n // Sets or gets a style value.\r\n //\r\n // n - name of the property\r\n // v - value of the property\r\n //\r\n // Returns tip or style property value\r\n // eslint-disable-next-line no-unused-vars\r\n tip.style = function(n, v) {\r\n if (arguments.length < 2 && typeof n === 'string') {\r\n return getNodeEl().style(n)\r\n }\r\n\r\n var args = Array.prototype.slice.call(arguments)\r\n d3Selection.selection.prototype.style.apply(getNodeEl(), args)\r\n return tip\r\n }\r\n\r\n // Public: Set or get the direction of the tooltip\r\n //\r\n // v - One of n(north), s(south), e(east), or w(west), nw(northwest),\r\n // sw(southwest), ne(northeast) or se(southeast)\r\n //\r\n // Returns tip or direction\r\n tip.direction = function(v) {\r\n if (!arguments.length) return direction\r\n direction = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: Sets or gets the offset of the tip\r\n //\r\n // v - Array of [x, y] offset\r\n //\r\n // Returns offset or\r\n tip.offset = function(v) {\r\n if (!arguments.length) return offset\r\n offset = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: sets or gets the html value of the tooltip\r\n //\r\n // v - String value of the tip\r\n //\r\n // Returns html value or tip\r\n tip.html = function(v) {\r\n if (!arguments.length) return html\r\n html = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: sets or gets the root element anchor of the tooltip\r\n //\r\n // v - root element of the tooltip\r\n //\r\n // Returns root node of tip\r\n tip.rootElement = function(v) {\r\n if (!arguments.length) return rootElement\r\n rootElement = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: destroys the tooltip and removes it from the DOM\r\n //\r\n // Returns a tip\r\n tip.destroy = function() {\r\n if (node) {\r\n getNodeEl().remove()\r\n node = null\r\n }\r\n return tip\r\n }\r\n\r\n function d3TipDirection() { return 'n' }\r\n function d3TipOffset() { return [0, 0] }\r\n function d3TipHTML() { return ' ' }\r\n\r\n var directionCallbacks = d3Collection.map({\r\n n: directionNorth,\r\n s: directionSouth,\r\n e: directionEast,\r\n w: directionWest,\r\n nw: directionNorthWest,\r\n ne: directionNorthEast,\r\n sw: directionSouthWest,\r\n se: directionSouthEast\r\n }),\r\n directions = directionCallbacks.keys()\r\n\r\n function directionNorth() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.n.y - node.offsetHeight,\r\n left: bbox.n.x - node.offsetWidth / 2\r\n }\r\n }\r\n\r\n function directionSouth() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.s.y,\r\n left: bbox.s.x - node.offsetWidth / 2\r\n }\r\n }\r\n\r\n function directionEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.e.y - node.offsetHeight / 2,\r\n left: bbox.e.x\r\n }\r\n }\r\n\r\n function directionWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.w.y - node.offsetHeight / 2,\r\n left: bbox.w.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionNorthWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.nw.y - node.offsetHeight,\r\n left: bbox.nw.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionNorthEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.ne.y - node.offsetHeight,\r\n left: bbox.ne.x\r\n }\r\n }\r\n\r\n function directionSouthWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.sw.y,\r\n left: bbox.sw.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionSouthEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.se.y,\r\n left: bbox.se.x\r\n }\r\n }\r\n\r\n function initNode() {\r\n var div = d3Selection.select(document.createElement('div'))\r\n div\r\n .style('position', 'absolute')\r\n .style('top', 0)\r\n .style('opacity', 0)\r\n .style('pointer-events', 'none')\r\n .style('box-sizing', 'border-box')\r\n\r\n return div.node()\r\n }\r\n\r\n function getSVGNode(element) {\r\n var svgNode = element.node()\r\n if (!svgNode) return null\r\n if (svgNode.tagName.toLowerCase() === 'svg') return svgNode\r\n return svgNode.ownerSVGElement\r\n }\r\n\r\n function getNodeEl() {\r\n if (node == null) {\r\n node = initNode()\r\n // re-add node to DOM\r\n rootElement.appendChild(node)\r\n }\r\n return d3Selection.select(node)\r\n }\r\n\r\n // Private - gets the screen coordinates of a shape\r\n //\r\n // Given a shape on the screen, will return an SVGPoint for the directions\r\n // n(north), s(south), e(east), w(west), ne(northeast), se(southeast),\r\n // nw(northwest), sw(southwest).\r\n //\r\n // +-+-+\r\n // | |\r\n // + +\r\n // | |\r\n // +-+-+\r\n //\r\n // Returns an Object {n, s, e, w, nw, sw, ne, se}\r\n function getScreenBBox() {\r\n var targetel = target || d3Selection.event.target\r\n\r\n while (targetel.getScreenCTM == null && targetel.parentNode == null) {\r\n targetel = targetel.parentNode\r\n }\r\n\r\n var bbox = {},\r\n matrix = targetel.getScreenCTM(),\r\n tbbox = targetel.getBBox(),\r\n width = tbbox.width,\r\n height = tbbox.height,\r\n x = tbbox.x,\r\n y = tbbox.y\r\n\r\n point.x = x\r\n point.y = y\r\n bbox.nw = point.matrixTransform(matrix)\r\n point.x += width\r\n bbox.ne = point.matrixTransform(matrix)\r\n point.y += height\r\n bbox.se = point.matrixTransform(matrix)\r\n point.x -= width\r\n bbox.sw = point.matrixTransform(matrix)\r\n point.y -= height / 2\r\n bbox.w = point.matrixTransform(matrix)\r\n point.x += width\r\n bbox.e = point.matrixTransform(matrix)\r\n point.x -= width / 2\r\n point.y -= height / 2\r\n bbox.n = point.matrixTransform(matrix)\r\n point.y += height\r\n bbox.s = point.matrixTransform(matrix)\r\n\r\n return bbox\r\n }\r\n\r\n // Private - replace D3JS 3.X d3.functor() function\r\n function functor(v) {\r\n return typeof v === 'function' ? v : function() {\r\n return v\r\n }\r\n }\r\n\r\n return tip\r\n }\r\n// eslint-disable-next-line semi\r\n}));\r\n","sk.createSankey = function(containerId, configSankey, dataSankey) {\r\n\r\n\t// to prevent NaN value, related https://github.com/d3/d3-sankey/issues/39\r\n\tvar _safeValueToLink = function(v) { return Math.max(v, Number.MIN_VALUE); }\r\n\r\n var _dataSankey = {\r\n nodes: [],\r\n links: []\r\n };\r\n\r\n //load data\r\n dataSankey.nodes.map(function(d) {\r\n _dataSankey.nodes.push({\r\n name: d.name,\r\n color: d.color,\r\n id: d.id\r\n });\r\n });\r\n dataSankey.links.map(function(l) {\r\n _dataSankey.links.push({\r\n source: l.source,\r\n target: l.target,\r\n id: l.id,\r\n value: _safeValueToLink(l.value)\r\n });\r\n });\r\n\r\n //var _dataSankey = Object.assign({}, dataSankey);\r\n\r\n var _updateLinksId = function(linkData) {\r\n for (var i = 0; i < linkData.length; i++)\r\n if (linkData[i].id == undefined)\r\n linkData[i].id = linkData[i].source + \" -> \" + linkData[i].target;\r\n };\r\n //update links id\r\n _updateLinksId(_dataSankey.links);\r\n\r\n //removing old svg and tips\r\n d3.select('.d3-tip-nodes').remove();\r\n d3.select('.d3-tip').remove();\r\n d3.select(containerId + ' svg').remove()\r\n\r\n var container = d3.select(containerId);\r\n\r\n function _getDimensions(container, margin) {\r\n var bbox = container.node().getBoundingClientRect();\r\n return {\r\n width: bbox.width - margin.left - margin.right,\r\n height: bbox.height - margin.top - margin.bottom\r\n };\r\n }\r\n var dimensions = _getDimensions(container, configSankey.margin);\r\n\r\n var svg_base = container.append(\"svg\")\r\n .attr('width', dimensions.width + configSankey.margin.left + configSankey.margin.right)\r\n .attr('height', dimensions.height + configSankey.margin.top + configSankey.margin.bottom)\r\n .attr(\"class\", \"sk-svg\");\r\n var svg = svg_base.append(\"g\")\r\n .attr('transform', \"translate(\" + configSankey.margin.left + \",\" + configSankey.margin.top + \")\");\r\n\r\n var sankey = d3.sankey()\r\n .nodeWidth(15)\r\n .nodePadding(10)\r\n .extent([\r\n [0, 0],\r\n [dimensions.width, dimensions.height]\r\n ]);\r\n\r\n var path = d3.sankeyLinkHorizontal();\r\n\r\n //Fonts\r\n var _getFontSize = function(d) {\r\n return configSankey.nodes.fontSize;\r\n }; //For default\r\n var _dynamicFontSize;\r\n var _updateRangeFontData = function(d) {}; //For default\r\n if (configSankey.nodes.dynamicSizeFontNode.enabled) {\r\n _dynamicFontSize = d3.scaleLinear().range(\r\n [configSankey.nodes.dynamicSizeFontNode.minSize,\r\n configSankey.nodes.dynamicSizeFontNode.maxSize\r\n ]);\r\n _updateRangeFontData = function(nodeData) {\r\n _dynamicFontSize.domain(d3.extent(nodeData, function(d) {\r\n return d.value\r\n }));\r\n };\r\n _getFontSize = function(d) {\r\n return Math.floor(_dynamicFontSize(d.value));\r\n };\r\n }\r\n\r\n //Colors\r\n //set color in nodes, case not exists\r\n for (var i = 0; i < _dataSankey.nodes.length; i++)\r\n if (_dataSankey.nodes[i].color == undefined)\r\n _dataSankey.nodes[i].color = configSankey.nodes.colors(_dataSankey.nodes[i].name.replace(/ .*/, \"\"));\r\n\r\n //Tooltip function:\r\n //D3 sankey diagram with view options (Austin Czarnecki�s Block cc6371af0b726e61b9ab)\r\n //https://bl.ocks.org/austinczarnecki/cc6371af0b726e61b9ab\r\n var linkTooltipOffset = 65,\r\n nodeTooltipOffset = 130;\r\n var tipLinks = d3.tip().attr(\"class\", \"d3-tip\").offset([-10, 0]);\r\n var tipNodes = d3.tip().attr(\"class\", \"d3-tip d3-tip-nodes\").offset([-10, 0]);\r\n\r\n function _formatValueTooltip(val) {\r\n if (configSankey.links.formatValue)\r\n return configSankey.links.formatValue(val);\r\n else\r\n return val + ' ' + configSankey.links.unit;\r\n }\r\n\r\n tipLinks.html(function(d) {\r\n var title, candidate;\r\n if (_dataSankey.links.indexOf(d.source.name) > -1) {\r\n candidate = d.source.name;\r\n title = d.target.name;\r\n } else {\r\n candidate = d.target.name;\r\n title = d.source.name;\r\n }\r\n var html = '
' +\r\n '

' + title + '

' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '
' + candidate + '' + _formatValueTooltip(d.value) + '
' +\r\n '
';\r\n return html;\r\n });\r\n var topContentSVG = d3.select('.sk-svg').node().getBoundingClientRect().top;\r\n tipLinks.move = function(event) {\r\n tipLinks\r\n .style(\"top\", function() {\r\n if (d3.event.pageY - topContentSVG - linkTooltipOffset >= 0)\r\n return (d3.event.pageY - linkTooltipOffset) + \"px\";\r\n else\r\n return d3.event.pageY + 20 + \"px\";\r\n })\r\n .style(\"left\", function() {\r\n var left = (Math.max(d3.event.pageX - linkTooltipOffset, 10));\r\n left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20)\r\n return left + \"px\";\r\n })\r\n };\r\n\r\n tipNodes.html(function(d) {\r\n var nodeName = d.name;\r\n var linksFrom = d.targetLinks; //invert for reference\r\n var linksTo = d.sourceLinks;\r\n var html;\r\n\r\n html = '
' +\r\n '

' + nodeName + '

' +\r\n '';\r\n if (linksFrom.length > 0 & linksTo.length > 0) {\r\n html += ''\r\n }\r\n for (i = 0; i < linksFrom.length; ++i) {\r\n html += '' +\r\n '' +\r\n '' +\r\n '';\r\n }\r\n if (linksFrom.length > 0 & linksTo.length > 0) {\r\n html += ''\r\n }\r\n for (i = 0; i < linksTo.length; ++i) {\r\n html += '' +\r\n '' +\r\n '' +\r\n '';\r\n }\r\n html += '

' + configSankey.tooltip.labelSource + '

' + linksFrom[i].source.name + '' + _formatValueTooltip(linksFrom[i].value) + '

' + configSankey.tooltip.labelTarget + '

' + linksTo[i].target.name + '' + _formatValueTooltip(linksTo[i].value) + '
';\r\n return html;\r\n });\r\n tipNodes.move = function(event) {\r\n tipNodes.boxInfo = d3.select('.d3-tip-nodes').node().getBoundingClientRect();\r\n tipNodes\r\n .style(\"top\",\r\n function() {\r\n if ((d3.event.pageY - topContentSVG - tipNodes.boxInfo.height - 20) >= 0)\r\n return (d3.event.pageY - tipNodes.boxInfo.height - 20) + \"px\";\r\n else\r\n return d3.event.pageY + 20 + \"px\";\r\n }\r\n )\r\n .style(\"left\", function() {\r\n var left = (Math.max(d3.event.pageX - nodeTooltipOffset, 10));\r\n left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20)\r\n return left + \"px\";\r\n })\r\n };\r\n\r\n svg.call(tipLinks);\r\n svg.call(tipNodes);\r\n var _stopTooltips = function() {\r\n if (tipLinks) tipLinks.hide();\r\n if (tipNodes) tipNodes.hide();\r\n };\r\n\r\n //Load data\r\n sankey(_dataSankey);\r\n\r\n //update range font data\r\n _updateRangeFontData(_dataSankey.nodes);\r\n\r\n\r\n var link = svg.append(\"g\").selectAll(\".sk-link\")\r\n .data(_dataSankey.links, function(d) {\r\n return d.id;\r\n })\r\n .enter().append(\"path\")\r\n .attr(\"class\", \"sk-link\")\r\n .attr(\"d\", path)\r\n .style(\"stroke\", function(d) {\r\n return d.source.color;\r\n })\r\n .style(\"stroke-width\", function(d) {\r\n return Math.max(1, d.dy) + \"px\";\r\n })\r\n .sort(function(a, b) {\r\n return b.dy - a.dy;\r\n });\r\n if (configSankey.tooltip.infoDiv)\r\n link.on('mousemove', tipLinks.move).on('mouseover', tipLinks.show).on('mouseout', tipLinks.hide);\r\n else\r\n link.append(\"title\").text(function(d) {\r\n return d.source.name + \" -> \" + d.target.name + \"\\n\" + _formatValueTooltip(d.value);\r\n });\r\n\r\n // the function for moving the nodes\r\n function _dragmove(d) {\r\n _stopTooltips();\r\n d3.select(this).attr(\"transform\", \"translate(\" + d.x + \",\" + (d.y = Math.max(0, Math.min(dimensions.height - d.dy, d3.event.y))) + \")\");\r\n sankey.update(_dataSankey);\r\n link.attr(\"d\", path);\r\n }\r\n\r\n var node = svg.append(\"g\").selectAll(\".sk-node\")\r\n .data(_dataSankey.nodes, function(d) {\r\n return d.name;\r\n })\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"sk-node\")\r\n .attr(\"transform\", function(d) {\r\n return \"translate(\" + d.x + \",\" + d.y + \")\";\r\n })\r\n if (configSankey.tooltip.infoDiv)\r\n node.on('mousemove', tipNodes.move).on('mouseover', tipNodes.show).on('mouseout', tipNodes.hide);\r\n else\r\n node.append(\"title\").text(function(d) {\r\n return d.name + \"\\n\" + _formatValueTooltip(d.value);\r\n });\r\n //Drag nodes\t\r\n if (configSankey.nodes.canDragNodes)\r\n node.call(d3.drag().subject(function(d) {\r\n return d;\r\n }).on(\"start\", function() {\r\n d3.event.sourceEvent.stopPropagation();\r\n this.parentNode.appendChild(this);\r\n }).on(\"drag\", _dragmove));\r\n\r\n node.append(\"rect\")\r\n .attr(\"height\", function(d) {\r\n return d.dy;\r\n })\r\n .attr(\"width\", sankey.nodeWidth())\r\n .style(\"fill\", function(d) {\r\n return d.color;\r\n })\r\n .style(\"stroke\", function(d) {\r\n return d3.rgb(d.color).darker(1.8);\r\n });\r\n\r\n node.append(\"text\")\r\n .attr(\"x\", -6)\r\n .attr(\"y\", function(d) {\r\n return d.dy / 2;\r\n })\r\n .attr(\"dy\", \".35em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .attr(\"transform\", null)\r\n .style(\"fill\", function(d) {\r\n return d3.rgb(d.color).darker(2.4);\r\n })\r\n .text(function(d) {\r\n return d.name;\r\n })\r\n .style(\"font-size\", function(d) {\r\n return _getFontSize(d) + \"px\";\r\n })\r\n .filter(function(d) {\r\n return d.x < dimensions.width / 2;\r\n })\r\n .attr(\"x\", 6 + sankey.nodeWidth())\r\n .attr(\"text-anchor\", \"start\");\r\n\r\n //https://bl.ocks.org/syntagmatic/77c7f7e8802e8824eed473dd065c450b\r\n var _updateLinksValues = function(dataUpdated) {\r\n _stopTooltips();\r\n sankey(dataUpdated);\r\n sankey.update(dataUpdated);\r\n\r\n //update range font data\r\n _updateRangeFontData(dataUpdated.nodes);\r\n\r\n svg.selectAll(\".sk-link\")\r\n .data(dataUpdated.links, function(d) {\r\n return d.id;\r\n })\r\n .sort(function(a, b) {\r\n return b.dy - a.dy;\r\n })\r\n .transition()\r\n .duration(1300)\r\n .attr(\"d\", path)\r\n .style(\"stroke-width\", function(d) {\r\n return Math.max(1, d.dy) + \"px\";\r\n });\r\n\r\n svg.selectAll(\".sk-node\")\r\n .data(dataUpdated.nodes, function(d) {\r\n return d.name;\r\n })\r\n .transition()\r\n .duration(1300)\r\n .attr(\"transform\", function(d) {\r\n return \"translate(\" + d.x + \",\" + d.y + \")\";\r\n });\r\n\r\n svg.selectAll(\".sk-node rect\")\r\n .transition()\r\n .duration(1300)\r\n .attr(\"height\", function(d) {\r\n return d.dy;\r\n });\r\n\r\n svg.selectAll(\".sk-node text\")\r\n .transition()\r\n .duration(1300)\r\n .attr(\"y\", function(d) {\r\n return d.dy / 2;\r\n })\r\n .style(\"font-size\", function(d) {\r\n return _getFontSize(d) + \"px\";\r\n });\r\n };\r\n\r\n\t//Update value of links, for call the function '_updateLinksValues' transition values (old to new)\r\n\t//This function only update values from links\r\n this.updateData = function(dataUpdated) {\r\n for (var i = 0; i < dataUpdated.links.length; i++) {\r\n var idLinkUpdate = dataUpdated.links[i].id || dataUpdated.links[i].source + \" -> \" + dataUpdated.links[i].target;\r\n var linkToUpdate = _dataSankey.links.filter(function(l) {\r\n return l.id == idLinkUpdate\r\n })[0];\r\n if (linkToUpdate) linkToUpdate.value = _safeValueToLink(dataUpdated.links[i].value);\r\n }\r\n _updateLinksValues(_dataSankey);\r\n };\r\n\r\n return this;\r\n};"]} \ No newline at end of file diff --git a/build/sk.d3.min.css b/build/sk.d3.min.css new file mode 100644 index 0000000..8204383 --- /dev/null +++ b/build/sk.d3.min.css @@ -0,0 +1,2 @@ +.d3-tip,.d3-tip h1,.d3-tip h2,.d3-tip h3{line-height:12px!important}.d3-tip,.sk-svg{font-family:sans-serif}.sk-svg text{cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.sk-svg text::-moz-selection{background:0 0}.sk-svg text::selection{background:0 0}.sk-node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges}.sk-node text{pointer-events:none;font-size:13px}.sk-link{fill:none;stroke:#000;stroke-opacity:.16;transition-property:stroke-opacity;transition-duration:.5s}.sk-link:hover{stroke-opacity:.5}.d3-tip h1{font-weight:700!important;font-size:14px;padding:0;margin-top:5px!important;margin-bottom:5px;width:100%}.d3-tip h2{font-weight:700;font-size:12px;padding-right:inherit;padding-left:inherit;padding-top:2px;padding-bottom:2px;margin:0}.d3-tip h3{font-weight:400;font-size:8px;margin:0;padding:0}.d3-tip table{font-weight:400;font-size:12px;padding:none;margin:0;width:100%;border:none;border-collapse:collapse}.d3-tip td{padding-top:2px;padding-bottom:2px}.d3-tip .col-left{padding-right:8px}.d3-tip .table-wrapper{margin:0;padding:inherit;border:none}.d3-tip{font-weight:400;padding:4px;color:#000;border-radius:2px;pointer-events:none;background:#fff;box-shadow:1px 1px 4px grey} +/*# sourceMappingURL=sk.d3.min.css.map */ \ No newline at end of file diff --git a/build/sk.d3.min.css.map b/build/sk.d3.min.css.map new file mode 100644 index 0000000..bc18e41 --- /dev/null +++ b/build/sk.d3.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["build/sk.d3.css"],"names":[],"mappings":"AAwFA,QA/CA,WASA,WAUA,WA6BI,YAAa,eADjB,QAtFA,QAwFI,YAAa,WAnFjB,aACI,OAAQ,QACR,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEjB,6BACI,eAEJ,wBACI,eAEJ,cACI,OAAQ,KACR,aAAc,GACd,gBAAiB,WAErB,cACI,eAAgB,KAChB,UAAW,KAEf,SACI,KAAM,KACN,OAAQ,KACR,eAAgB,IAChB,oBAAqB,eACrB,oBAAqB,IAEzB,eACI,eAAgB,GAIpB,WAEC,YAAa,cACV,UAAW,KACX,QAAS,EACZ,WAAY,cACT,cAAe,IACf,MAAO,KAEX,WAEI,YAAa,IACb,UAAW,KACX,cAAe,QACf,aAAc,QACd,YAAa,IACb,eAAgB,IAChB,OAAQ,EAEZ,WAEI,YAAa,IACb,UAAW,IACX,OAAQ,EACR,QAAS,EAEb,cACI,YAAa,IACb,UAAW,KACX,QAAS,KACT,OAAQ,EACR,MAAO,KACP,OAAQ,KACR,gBAAiB,SAErB,WACI,YAAa,IACb,eAAgB,IAEpB,kBACI,cAAe,IAEnB,uBACI,OAAQ,EACR,QAAS,QACT,OAAQ,KAEZ,QAGI,YAAa,IACb,QAAS,IAET,MAAO,KACP,cAAe,IACf,eAAgB,KAChB,WAAY,KACZ,WAAY,IAAI,IAAI,IAAI"} \ No newline at end of file diff --git a/build/sk.d3.min.js b/build/sk.d3.min.js new file mode 100644 index 0000000..af14857 --- /dev/null +++ b/build/sk.d3.min.js @@ -0,0 +1,4 @@ +/* skd3 version 0.1.0 (https://github.com/fabriciorhs/skd3) 2017-09-03 */ + +!function(){var a={};a.alertVersion=function(){alert(this.version)},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=a),"undefined"!=typeof window&&(window.sk=a),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-array"),require("d3-collection"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-collection","d3-shape"],b):b(a.d3=a.d3||{},a.d3,a.d3,a.d3)}(this,function(a,b,c,d){"use strict";function e(a){return function(){return a}}function f(a,b){return a.source.y-b.source.y}function g(a,b){return a.target.y-b.target.y}function h(a,b){return a.y-b.y}function i(a){return a.value}function j(a){return a.y+a.dy/2}function k(a){return j(a.source)*a.value}function l(a){return j(a.target)*a.value}function m(a){return a.nodes}function n(a){return a.links}function o(a){return[a.source.x+a.source.dx,a.source.y+a.sy+a.dy/2]}function p(a){return[a.target.x,a.target.y+a.ty+a.dy/2]}var q=function(){function a(){var a={nodes:A.apply(null,arguments),links:B.apply(null,arguments)};return d(a),o(a),p(a),s(a),t(a),a}function d(a){a.nodes.forEach(function(a){a.sourceLinks=[],a.targetLinks=[]}),a.links.forEach(function(b){var c=b.source,d=b.target;"number"==typeof c&&(c=b.source=a.nodes[b.source]),"number"==typeof d&&(d=b.target=a.nodes[b.target]),c.sourceLinks.push(b),d.targetLinks.push(b)})}function o(a){a.nodes.forEach(function(a){a.value=Math.max(b.sum(a.sourceLinks,i),b.sum(a.targetLinks,i))})}function p(a){for(var b,c=a.nodes,d=0;c.length;)b=[],c.forEach(function(a){a.x=d,a.dx=y,a.sourceLinks.forEach(function(a){b.indexOf(a.target)<0&&b.push(a.target)})}),c=b,++d;q(a,d),r(a,(w-u-y)/(d-1))}function q(a,b){a.nodes.forEach(function(a){a.sourceLinks.length||(a.x=b-1)})}function r(a,b){a.nodes.forEach(function(a){a.x=u+a.x*b})}function s(a){function d(){e.forEach(function(a){var b,c,d,e=v,f=a.length;for(a.sort(h),d=0;d0&&(b.y+=c),e=b.y+b.dy+z;if((c=e-z-x)>0)for(e=b.y-=c,d=f-2;d>=0;--d)b=a[d],c=b.y+b.dy+z-e,c>0&&(b.y-=c),e=b.y})}var e=c.nest().key(function(a){return a.x}).sortKeys(b.ascending).entries(a.nodes).map(function(a){return a.values});!function(){var c=b.min(e,function(a){return(x-v-(a.length-1)*z)/b.sum(a,i)});e.forEach(function(a){a.forEach(function(a,b){a.y=b,a.dy=a.value*c})}),a.links.forEach(function(a){a.dy=a.value*c})}(),d();for(var f=1,g=C;g>0;--g)!function(a){e.slice().reverse().forEach(function(c){c.forEach(function(c){c.sourceLinks.length&&(c.y+=(b.sum(c.sourceLinks,l)/b.sum(c.sourceLinks,i)-j(c))*a)})})}(f*=.99),d(),function(a){e.forEach(function(c){c.forEach(function(c){c.targetLinks.length&&(c.y+=(b.sum(c.targetLinks,k)/b.sum(c.targetLinks,i)-j(c))*a)})})}(f),d()}function t(a){a.nodes.forEach(function(a){a.sourceLinks.sort(g),a.targetLinks.sort(f)}),a.nodes.forEach(function(a){var b=0,c=0;a.sourceLinks.forEach(function(a){a.sy=b,b+=a.dy}),a.targetLinks.forEach(function(a){a.ty=c,c+=a.dy})})}var u=0,v=0,w=1,x=1,y=24,z=8,A=m,B=n,C=32;return a.update=function(a){return t(a),a},a.nodeWidth=function(b){return arguments.length?(y=+b,a):y},a.nodePadding=function(b){return arguments.length?(z=+b,a):z},a.nodes=function(b){return arguments.length?(A="function"==typeof b?b:e(b),a):A},a.links=function(b){return arguments.length?(B="function"==typeof b?b:e(b),a):B},a.size=function(b){return arguments.length?(u=v=0,w=+b[0],x=+b[1],a):[w-u,x-v]},a.extent=function(b){return arguments.length?(u=+b[0][0],w=+b[1][0],v=+b[0][1],x=+b[1][1],a):[[u,v],[w,x]]},a.iterations=function(b){return arguments.length?(C=+b,a):C},a},r=function(){return d.linkHorizontal().source(o).target(p)};a.sankey=q,a.sankeyLinkHorizontal=r,Object.defineProperty(a,"__esModule",{value:!0})}),function(a,b){if("function"==typeof define&&define.amd)define(["d3-collection","d3-selection"],b);else if("object"==typeof module&&module.exports){var c=require("d3-collection"),d=require("d3-selection");module.exports=b(c,d)}else{var e=a.d3;a.d3.tip=b(e,e)}}(this,function(a,b){return function(){function c(a){(y=p(a))&&(z=y.createSVGPoint(),w.appendChild(x))}function d(){return"n"}function e(){return[0,0]}function f(){return" "}function g(){var a=r();return{top:a.n.y-x.offsetHeight,left:a.n.x-x.offsetWidth/2}}function h(){var a=r();return{top:a.s.y,left:a.s.x-x.offsetWidth/2}}function i(){var a=r();return{top:a.e.y-x.offsetHeight/2,left:a.e.x}}function j(){var a=r();return{top:a.w.y-x.offsetHeight/2,left:a.w.x-x.offsetWidth}}function k(){var a=r();return{top:a.nw.y-x.offsetHeight,left:a.nw.x-x.offsetWidth}}function l(){var a=r();return{top:a.ne.y-x.offsetHeight,left:a.ne.x}}function m(){var a=r();return{top:a.sw.y,left:a.sw.x-x.offsetWidth}}function n(){var a=r();return{top:a.se.y,left:a.se.x}}function o(){var a=b.select(document.createElement("div"));return a.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),a.node()}function p(a){var b=a.node();return b?"svg"===b.tagName.toLowerCase()?b:b.ownerSVGElement:null}function q(){return null==x&&(x=o(),w.appendChild(x)),b.select(x)}function r(){for(var a=A||b.event.target;null==a.getScreenCTM&&null==a.parentNode;)a=a.parentNode;var c={},d=a.getScreenCTM(),e=a.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return z.x=h,z.y=i,c.nw=z.matrixTransform(d),z.x+=f,c.ne=z.matrixTransform(d),z.y+=g,c.se=z.matrixTransform(d),z.x-=f,c.sw=z.matrixTransform(d),z.y-=g/2,c.w=z.matrixTransform(d),z.x+=f,c.e=z.matrixTransform(d),z.x-=f/2,z.y-=g/2,c.n=z.matrixTransform(d),z.y+=g,c.s=z.matrixTransform(d),c}function s(a){return"function"==typeof a?a:function(){return a}}var t=d,u=e,v=f,w=document.body,x=o(),y=null,z=null,A=null;c.show=function(){var a=Array.prototype.slice.call(arguments);a[a.length-1]instanceof SVGElement&&(A=a.pop());var b,d=v.apply(this,a),e=u.apply(this,a),f=t.apply(this,a),g=q(),h=C.length,i=document.documentElement.scrollTop||w.scrollTop,j=document.documentElement.scrollLeft||w.scrollLeft;for(g.html(d).style("opacity",1).style("pointer-events","all");h--;)g.classed(C[h],!1);return b=B.get(f).apply(this),g.classed(f,!0).style("top",b.top+e[0]+i+"px").style("left",b.left+e[1]+j+"px"),c},c.hide=function(){return q().style("opacity",0).style("pointer-events","none"),c},c.attr=function(a,d){if(arguments.length<2&&"string"==typeof a)return q().attr(a);var e=Array.prototype.slice.call(arguments);return b.selection.prototype.attr.apply(q(),e),c},c.style=function(a,d){if(arguments.length<2&&"string"==typeof a)return q().style(a);var e=Array.prototype.slice.call(arguments);return b.selection.prototype.style.apply(q(),e),c},c.direction=function(a){return arguments.length?(t=null==a?a:s(a),c):t},c.offset=function(a){return arguments.length?(u=null==a?a:s(a),c):u},c.html=function(a){return arguments.length?(v=null==a?a:s(a),c):v},c.rootElement=function(a){return arguments.length?(w=null==a?a:s(a),c):w},c.destroy=function(){return x&&(q().remove(),x=null),c};var B=a.map({n:g,s:h,e:i,w:j,nw:k,ne:l,sw:m,se:n}),C=B.keys();return c}}),a.createSankey=function(a,b,c){function d(a,b){var c=a.node().getBoundingClientRect();return{width:c.width-b.left-b.right,height:c.height-b.top-b.bottom}}function e(a){return b.links.formatValue?b.links.formatValue(a):a+" "+b.links.unit}function f(a){x(),d3.select(this).attr("transform","translate("+a.x+","+(a.y=Math.max(0,Math.min(k.height-a.dy,d3.event.y)))+")"),n.update(h),y.attr("d",o)}var g=function(a){return Math.max(a,Number.MIN_VALUE)},h={nodes:[],links:[]};c.nodes.map(function(a){h.nodes.push({name:a.name,color:a.color,id:a.id})}),c.links.map(function(a){h.links.push({source:a.source,target:a.target,id:a.id,value:g(a.value)})}),function(a){for(var b=0;b "+a[b].target)}(h.links),d3.select(".d3-tip-nodes").remove(),d3.select(".d3-tip").remove(),d3.select(a+" svg").remove();var i,j=d3.select(a),k=d(j,b.margin),l=j.append("svg").attr("width",k.width+b.margin.left+b.margin.right).attr("height",k.height+b.margin.top+b.margin.bottom).attr("class","sk-svg"),m=l.append("g").attr("transform","translate("+b.margin.left+","+b.margin.top+")"),n=d3.sankey().nodeWidth(15).nodePadding(10).extent([[0,0],[k.width,k.height]]),o=d3.sankeyLinkHorizontal(),p=function(a){return b.nodes.fontSize},q=function(a){};b.nodes.dynamicSizeFontNode.enabled&&(i=d3.scaleLinear().range([b.nodes.dynamicSizeFontNode.minSize,b.nodes.dynamicSizeFontNode.maxSize]),q=function(a){i.domain(d3.extent(a,function(a){return a.value}))},p=function(a){return Math.floor(i(a.value))});for(var r=0;r-1?(c=a.source.name,b=a.target.name):(c=a.target.name,b=a.source.name),'

'+b+'

'+c+''+e(a.value)+"
"});var w=d3.select(".sk-svg").node().getBoundingClientRect().top;u.move=function(a){u.style("top",function(){return d3.event.pageY-w-s>=0?d3.event.pageY-s+"px":d3.event.pageY+20+"px"}).style("left",function(){var a=Math.max(d3.event.pageX-s,10);return(a=Math.min(a,window.innerWidth-d3.select(".d3-tip").node().getBoundingClientRect().width-20))+"px"})},v.html(function(a){var c,d=a.name,f=a.targetLinks,g=a.sourceLinks;for(c='

'+d+"

",f.length>0&g.length>0&&(c+=""),r=0;r";for(f.length>0&g.length>0&&(c+=""),r=0;r";return c+="

"+b.tooltip.labelSource+"

'+f[r].source.name+''+e(f[r].value)+"

"+b.tooltip.labelTarget+"

'+g[r].target.name+''+e(g[r].value)+"
"}),v.move=function(a){v.boxInfo=d3.select(".d3-tip-nodes").node().getBoundingClientRect(),v.style("top",function(){return d3.event.pageY-w-v.boxInfo.height-20>=0?d3.event.pageY-v.boxInfo.height-20+"px":d3.event.pageY+20+"px"}).style("left",function(){var a=Math.max(d3.event.pageX-t,10);return(a=Math.min(a,window.innerWidth-d3.select(".d3-tip").node().getBoundingClientRect().width-20))+"px"})},m.call(u),m.call(v);var x=function(){u&&u.hide(),v&&v.hide()};n(h),q(h.nodes);var y=m.append("g").selectAll(".sk-link").data(h.links,function(a){return a.id}).enter().append("path").attr("class","sk-link").attr("d",o).style("stroke",function(a){return a.source.color}).style("stroke-width",function(a){return Math.max(1,a.dy)+"px"}).sort(function(a,b){return b.dy-a.dy});b.tooltip.infoDiv?y.on("mousemove",u.move).on("mouseover",u.show).on("mouseout",u.hide):y.append("title").text(function(a){return a.source.name+" -> "+a.target.name+"\n"+e(a.value)});var z=m.append("g").selectAll(".sk-node").data(h.nodes,function(a){return a.name}).enter().append("g").attr("class","sk-node").attr("transform",function(a){return"translate("+a.x+","+a.y+")"});b.tooltip.infoDiv?z.on("mousemove",v.move).on("mouseover",v.show).on("mouseout",v.hide):z.append("title").text(function(a){return a.name+"\n"+e(a.value)}),b.nodes.canDragNodes&&z.call(d3.drag().subject(function(a){return a}).on("start",function(){d3.event.sourceEvent.stopPropagation(),this.parentNode.appendChild(this)}).on("drag",f)),z.append("rect").attr("height",function(a){return a.dy}).attr("width",n.nodeWidth()).style("fill",function(a){return a.color}).style("stroke",function(a){return d3.rgb(a.color).darker(1.8)}),z.append("text").attr("x",-6).attr("y",function(a){return a.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).style("fill",function(a){return d3.rgb(a.color).darker(2.4)}).text(function(a){return a.name}).style("font-size",function(a){return p(a)+"px"}).filter(function(a){return a.x "+a.links[b].target,d=h.links.filter(function(a){return a.id==c})[0];d&&(d.value=g(a.links[b].value))}A(h)},this},a.version="0.1.0"}(); +//# sourceMappingURL=sk.d3.min.js.map \ No newline at end of file diff --git a/build/sk.d3.min.js.map b/build/sk.d3.min.js.map new file mode 100644 index 0000000..84ecfe0 --- /dev/null +++ b/build/sk.d3.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/init.js","../node_modules/d3-sankey/build/d3-sankey.min.js","../node_modules/d3-tip/index.js","../src/core.js"],"names":["sk","alertVersion","alert","this","version","d3","require","module","exports","window","n","t","define","amd","e","r","o","u","source","y","i","target","c","f","value","s","dy","a","d","nodes","l","links","h","x","dx","sy","g","ty","k","j","apply","arguments","H","v","E","forEach","sourceLinks","targetLinks","push","Math","max","sum","length","q","indexOf","p","m","L","sort","z","b","nest","key","sortKeys","ascending","entries","map","values","min","M","slice","reverse","update","nodeWidth","nodePadding","size","extent","iterations","linkHorizontal","sankey","sankeyLinkHorizontal","Object","defineProperty","root","factory","d3Collection","d3Selection","tip","vis","svg","getSVGNode","point","createSVGPoint","rootElement","appendChild","node","d3TipDirection","d3TipOffset","d3TipHTML","directionNorth","bbox","getScreenBBox","top","offsetHeight","left","offsetWidth","directionSouth","directionEast","directionWest","w","directionNorthWest","nw","directionNorthEast","ne","directionSouthWest","sw","directionSouthEast","se","initNode","div","select","document","createElement","style","element","svgNode","tagName","toLowerCase","ownerSVGElement","getNodeEl","targetel","event","getScreenCTM","parentNode","matrix","tbbox","getBBox","width","height","matrixTransform","functor","direction","offset","html","body","show","args","Array","prototype","call","SVGElement","pop","coords","content","poffset","dir","nodel","directions","scrollTop","documentElement","scrollLeft","classed","directionCallbacks","get","hide","attr","selection","destroy","remove","keys","createSankey","containerId","configSankey","dataSankey","_getDimensions","container","margin","getBoundingClientRect","right","bottom","_formatValueTooltip","val","formatValue","unit","_dragmove","_stopTooltips","dimensions","_dataSankey","link","path","_safeValueToLink","Number","MIN_VALUE","name","color","id","linkData","undefined","_dynamicFontSize","svg_base","append","_getFontSize","fontSize","_updateRangeFontData","dynamicSizeFontNode","enabled","scaleLinear","range","minSize","maxSize","nodeData","domain","floor","colors","replace","linkTooltipOffset","nodeTooltipOffset","tipLinks","tipNodes","title","candidate","topContentSVG","move","pageY","pageX","innerWidth","nodeName","linksFrom","linksTo","tooltip","labelSource","labelTarget","boxInfo","selectAll","data","enter","infoDiv","on","text","canDragNodes","drag","subject","sourceEvent","stopPropagation","rgb","darker","filter","_updateLinksValues","dataUpdated","transition","duration","updateData","idLinkUpdate","linkToUpdate"],"mappings":";;YACA,GAAIA,KACJA,GAAGC,aAAe,WAAcC,MAAMC,KAAKC,UAGpB,mBAAb,SAAgD,mBAAd,UAA2C,mBAAR,MAC3EC,GAAKC,QAAO,OAIO,mBAAb,SAAgD,mBAAd,WAC1CC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AAMX,GAAG+K,IAAMqD,EAAYzN,MAAMX,GAAGF,OAAS,OAASsO,EAAYzN,MAAMX,GAAGC,OACtGwO,EAAelE,EAAY5J,MAAMuN,OAAO,SAASxN,GACjD,MAAOA,GAAEqK,IAAMyD,IAChB,EACCC,KAAcA,EAAarO,MAAQsK,EAAiB0D,EAAYzN,MAAMX,GAAGI,QAEjF+N,EAAmB5D,IAGhBxL","file":"sk.d3.min.js","sourcesContent":["// set up main sk object\nvar sk = {};\nsk.alertVersion = function () { alert(this.version);}\n\n// Node/CommonJS - require D3\nif (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined' && typeof(d3) == 'undefined') {\n d3 = require('d3');\n}\n\n// Node/CommonJS exports\nif (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') {\n module.exports = sk;\n}\n\nif (typeof(window) !== 'undefined') {\n window.sk = sk;\n}\n","// https://github.com/d3/d3-sankey Version 0.5.0. Copyright 2017 Mike Bostock.\n!function(n,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports,require(\"d3-array\"),require(\"d3-collection\"),require(\"d3-shape\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"d3-array\",\"d3-collection\",\"d3-shape\"],t):t(n.d3=n.d3||{},n.d3,n.d3,n.d3)}(this,function(n,t,e,r){\"use strict\";function o(n){return function(){return n}}function u(n,t){return n.source.y-t.source.y}function i(n,t){return n.target.y-t.target.y}function c(n,t){return n.y-t.y}function f(n){return n.value}function s(n){return n.y+n.dy/2}function a(n){return s(n.source)*n.value}function d(n){return s(n.target)*n.value}function y(n){return n.nodes}function l(n){return n.links}function h(n){return[n.source.x+n.source.dx,n.source.y+n.sy+n.dy/2]}function g(n){return[n.target.x,n.target.y+n.ty+n.dy/2]}var k=function(){function n(){var n={nodes:j.apply(null,arguments),links:H.apply(null,arguments)};return r(n),h(n),g(n),v(n),E(n),n}function r(n){n.nodes.forEach(function(n){n.sourceLinks=[],n.targetLinks=[]}),n.links.forEach(function(t){var e=t.source,r=t.target;\"number\"==typeof e&&(e=t.source=n.nodes[t.source]),\"number\"==typeof r&&(r=t.target=n.nodes[t.target]),e.sourceLinks.push(t),r.targetLinks.push(t)})}function h(n){n.nodes.forEach(function(n){n.value=Math.max(t.sum(n.sourceLinks,f),t.sum(n.targetLinks,f))})}function g(n){for(var t,e=n.nodes,r=0;e.length;)t=[],e.forEach(function(n){n.x=r,n.dx=q,n.sourceLinks.forEach(function(n){t.indexOf(n.target)<0&&t.push(n.target)})}),e=t,++r;k(n,r),p(n,(m-L-q)/(r-1))}function k(n,t){n.nodes.forEach(function(n){n.sourceLinks.length||(n.x=t-1)})}function p(n,t){n.nodes.forEach(function(n){n.x=L+n.x*t})}function v(n){function r(){o.forEach(function(n){var t,e,r,o=x,u=n.length;for(n.sort(c),r=0;r0&&(t.y+=e),o=t.y+t.dy+z;if((e=o-z-b)>0)for(o=t.y-=e,r=u-2;r>=0;--r)t=n[r],e=t.y+t.dy+z-o,e>0&&(t.y-=e),o=t.y})}var o=e.nest().key(function(n){return n.x}).sortKeys(t.ascending).entries(n.nodes).map(function(n){return n.values});!function(){var e=t.min(o,function(n){return(b-x-(n.length-1)*z)/t.sum(n,f)});o.forEach(function(n){n.forEach(function(n,t){n.y=t,n.dy=n.value*e})}),n.links.forEach(function(n){n.dy=n.value*e})}(),r();for(var u=1,i=M;i>0;--i)!function(n){o.slice().reverse().forEach(function(e){e.forEach(function(e){e.sourceLinks.length&&(e.y+=(t.sum(e.sourceLinks,d)/t.sum(e.sourceLinks,f)-s(e))*n)})})}(u*=.99),r(),function(n){o.forEach(function(e){e.forEach(function(e){e.targetLinks.length&&(e.y+=(t.sum(e.targetLinks,a)/t.sum(e.targetLinks,f)-s(e))*n)})})}(u),r()}function E(n){n.nodes.forEach(function(n){n.sourceLinks.sort(i),n.targetLinks.sort(u)}),n.nodes.forEach(function(n){var t=0,e=0;n.sourceLinks.forEach(function(n){n.sy=t,t+=n.dy}),n.targetLinks.forEach(function(n){n.ty=e,e+=n.dy})})}var L=0,x=0,m=1,b=1,q=24,z=8,j=y,H=l,M=32;return n.update=function(n){return E(n),n},n.nodeWidth=function(t){return arguments.length?(q=+t,n):q},n.nodePadding=function(t){return arguments.length?(z=+t,n):z},n.nodes=function(t){return arguments.length?(j=\"function\"==typeof t?t:o(t),n):j},n.links=function(t){return arguments.length?(H=\"function\"==typeof t?t:o(t),n):H},n.size=function(t){return arguments.length?(L=x=0,m=+t[0],b=+t[1],n):[m-L,b-x]},n.extent=function(t){return arguments.length?(L=+t[0][0],m=+t[1][0],x=+t[0][1],b=+t[1][1],n):[[L,x],[m,b]]},n.iterations=function(t){return arguments.length?(M=+t,n):M},n},p=function(){return r.linkHorizontal().source(h).target(g)};n.sankey=k,n.sankeyLinkHorizontal=p,Object.defineProperty(n,\"__esModule\",{value:!0})});","/**\r\n * d3.tip\r\n * Copyright (c) 2013-2017 Justin Palmer\r\n *\r\n * Tooltips for d3.js SVG visualizations\r\n */\r\n// eslint-disable-next-line no-extra-semi\r\n;(function(root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module with d3 as a dependency.\r\n define([\r\n 'd3-collection',\r\n 'd3-selection'\r\n ], factory)\r\n } else if (typeof module === 'object' && module.exports) {\r\n /* eslint-disable global-require */\r\n // CommonJS\r\n var d3Collection = require('d3-collection'),\r\n d3Selection = require('d3-selection')\r\n module.exports = factory(d3Collection, d3Selection)\r\n /* eslint-enable global-require */\r\n } else {\r\n // Browser global.\r\n var d3 = root.d3\r\n // eslint-disable-next-line no-param-reassign\r\n root.d3.tip = factory(d3, d3)\r\n }\r\n}(this, function(d3Collection, d3Selection) {\r\n // Public - contructs a new tooltip\r\n //\r\n // Returns a tip\r\n return function() {\r\n var direction = d3TipDirection,\r\n offset = d3TipOffset,\r\n html = d3TipHTML,\r\n rootElement = document.body,\r\n node = initNode(),\r\n svg = null,\r\n point = null,\r\n target = null\r\n\r\n function tip(vis) {\r\n svg = getSVGNode(vis)\r\n if (!svg) return\r\n point = svg.createSVGPoint()\r\n rootElement.appendChild(node)\r\n }\r\n\r\n // Public - show the tooltip on the screen\r\n //\r\n // Returns a tip\r\n tip.show = function() {\r\n var args = Array.prototype.slice.call(arguments)\r\n if (args[args.length - 1] instanceof SVGElement) target = args.pop()\r\n\r\n var content = html.apply(this, args),\r\n poffset = offset.apply(this, args),\r\n dir = direction.apply(this, args),\r\n nodel = getNodeEl(),\r\n i = directions.length,\r\n coords,\r\n scrollTop = document.documentElement.scrollTop ||\r\n rootElement.scrollTop,\r\n scrollLeft = document.documentElement.scrollLeft ||\r\n rootElement.scrollLeft\r\n\r\n nodel.html(content)\r\n .style('opacity', 1).style('pointer-events', 'all')\r\n\r\n while (i--) nodel.classed(directions[i], false)\r\n coords = directionCallbacks.get(dir).apply(this)\r\n nodel.classed(dir, true)\r\n .style('top', (coords.top + poffset[0]) + scrollTop + 'px')\r\n .style('left', (coords.left + poffset[1]) + scrollLeft + 'px')\r\n\r\n return tip\r\n }\r\n\r\n // Public - hide the tooltip\r\n //\r\n // Returns a tip\r\n tip.hide = function() {\r\n var nodel = getNodeEl()\r\n nodel.style('opacity', 0).style('pointer-events', 'none')\r\n return tip\r\n }\r\n\r\n // Public: Proxy attr calls to the d3 tip container.\r\n // Sets or gets attribute value.\r\n //\r\n // n - name of the attribute\r\n // v - value of the attribute\r\n //\r\n // Returns tip or attribute value\r\n // eslint-disable-next-line no-unused-vars\r\n tip.attr = function(n, v) {\r\n if (arguments.length < 2 && typeof n === 'string') {\r\n return getNodeEl().attr(n)\r\n }\r\n\r\n var args = Array.prototype.slice.call(arguments)\r\n d3Selection.selection.prototype.attr.apply(getNodeEl(), args)\r\n return tip\r\n }\r\n\r\n // Public: Proxy style calls to the d3 tip container.\r\n // Sets or gets a style value.\r\n //\r\n // n - name of the property\r\n // v - value of the property\r\n //\r\n // Returns tip or style property value\r\n // eslint-disable-next-line no-unused-vars\r\n tip.style = function(n, v) {\r\n if (arguments.length < 2 && typeof n === 'string') {\r\n return getNodeEl().style(n)\r\n }\r\n\r\n var args = Array.prototype.slice.call(arguments)\r\n d3Selection.selection.prototype.style.apply(getNodeEl(), args)\r\n return tip\r\n }\r\n\r\n // Public: Set or get the direction of the tooltip\r\n //\r\n // v - One of n(north), s(south), e(east), or w(west), nw(northwest),\r\n // sw(southwest), ne(northeast) or se(southeast)\r\n //\r\n // Returns tip or direction\r\n tip.direction = function(v) {\r\n if (!arguments.length) return direction\r\n direction = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: Sets or gets the offset of the tip\r\n //\r\n // v - Array of [x, y] offset\r\n //\r\n // Returns offset or\r\n tip.offset = function(v) {\r\n if (!arguments.length) return offset\r\n offset = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: sets or gets the html value of the tooltip\r\n //\r\n // v - String value of the tip\r\n //\r\n // Returns html value or tip\r\n tip.html = function(v) {\r\n if (!arguments.length) return html\r\n html = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: sets or gets the root element anchor of the tooltip\r\n //\r\n // v - root element of the tooltip\r\n //\r\n // Returns root node of tip\r\n tip.rootElement = function(v) {\r\n if (!arguments.length) return rootElement\r\n rootElement = v == null ? v : functor(v)\r\n\r\n return tip\r\n }\r\n\r\n // Public: destroys the tooltip and removes it from the DOM\r\n //\r\n // Returns a tip\r\n tip.destroy = function() {\r\n if (node) {\r\n getNodeEl().remove()\r\n node = null\r\n }\r\n return tip\r\n }\r\n\r\n function d3TipDirection() { return 'n' }\r\n function d3TipOffset() { return [0, 0] }\r\n function d3TipHTML() { return ' ' }\r\n\r\n var directionCallbacks = d3Collection.map({\r\n n: directionNorth,\r\n s: directionSouth,\r\n e: directionEast,\r\n w: directionWest,\r\n nw: directionNorthWest,\r\n ne: directionNorthEast,\r\n sw: directionSouthWest,\r\n se: directionSouthEast\r\n }),\r\n directions = directionCallbacks.keys()\r\n\r\n function directionNorth() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.n.y - node.offsetHeight,\r\n left: bbox.n.x - node.offsetWidth / 2\r\n }\r\n }\r\n\r\n function directionSouth() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.s.y,\r\n left: bbox.s.x - node.offsetWidth / 2\r\n }\r\n }\r\n\r\n function directionEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.e.y - node.offsetHeight / 2,\r\n left: bbox.e.x\r\n }\r\n }\r\n\r\n function directionWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.w.y - node.offsetHeight / 2,\r\n left: bbox.w.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionNorthWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.nw.y - node.offsetHeight,\r\n left: bbox.nw.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionNorthEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.ne.y - node.offsetHeight,\r\n left: bbox.ne.x\r\n }\r\n }\r\n\r\n function directionSouthWest() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.sw.y,\r\n left: bbox.sw.x - node.offsetWidth\r\n }\r\n }\r\n\r\n function directionSouthEast() {\r\n var bbox = getScreenBBox()\r\n return {\r\n top: bbox.se.y,\r\n left: bbox.se.x\r\n }\r\n }\r\n\r\n function initNode() {\r\n var div = d3Selection.select(document.createElement('div'))\r\n div\r\n .style('position', 'absolute')\r\n .style('top', 0)\r\n .style('opacity', 0)\r\n .style('pointer-events', 'none')\r\n .style('box-sizing', 'border-box')\r\n\r\n return div.node()\r\n }\r\n\r\n function getSVGNode(element) {\r\n var svgNode = element.node()\r\n if (!svgNode) return null\r\n if (svgNode.tagName.toLowerCase() === 'svg') return svgNode\r\n return svgNode.ownerSVGElement\r\n }\r\n\r\n function getNodeEl() {\r\n if (node == null) {\r\n node = initNode()\r\n // re-add node to DOM\r\n rootElement.appendChild(node)\r\n }\r\n return d3Selection.select(node)\r\n }\r\n\r\n // Private - gets the screen coordinates of a shape\r\n //\r\n // Given a shape on the screen, will return an SVGPoint for the directions\r\n // n(north), s(south), e(east), w(west), ne(northeast), se(southeast),\r\n // nw(northwest), sw(southwest).\r\n //\r\n // +-+-+\r\n // | |\r\n // + +\r\n // | |\r\n // +-+-+\r\n //\r\n // Returns an Object {n, s, e, w, nw, sw, ne, se}\r\n function getScreenBBox() {\r\n var targetel = target || d3Selection.event.target\r\n\r\n while (targetel.getScreenCTM == null && targetel.parentNode == null) {\r\n targetel = targetel.parentNode\r\n }\r\n\r\n var bbox = {},\r\n matrix = targetel.getScreenCTM(),\r\n tbbox = targetel.getBBox(),\r\n width = tbbox.width,\r\n height = tbbox.height,\r\n x = tbbox.x,\r\n y = tbbox.y\r\n\r\n point.x = x\r\n point.y = y\r\n bbox.nw = point.matrixTransform(matrix)\r\n point.x += width\r\n bbox.ne = point.matrixTransform(matrix)\r\n point.y += height\r\n bbox.se = point.matrixTransform(matrix)\r\n point.x -= width\r\n bbox.sw = point.matrixTransform(matrix)\r\n point.y -= height / 2\r\n bbox.w = point.matrixTransform(matrix)\r\n point.x += width\r\n bbox.e = point.matrixTransform(matrix)\r\n point.x -= width / 2\r\n point.y -= height / 2\r\n bbox.n = point.matrixTransform(matrix)\r\n point.y += height\r\n bbox.s = point.matrixTransform(matrix)\r\n\r\n return bbox\r\n }\r\n\r\n // Private - replace D3JS 3.X d3.functor() function\r\n function functor(v) {\r\n return typeof v === 'function' ? v : function() {\r\n return v\r\n }\r\n }\r\n\r\n return tip\r\n }\r\n// eslint-disable-next-line semi\r\n}));\r\n","sk.createSankey = function(containerId, configSankey, dataSankey) {\r\n\r\n\t// to prevent NaN value, related https://github.com/d3/d3-sankey/issues/39\r\n\tvar _safeValueToLink = function(v) { return Math.max(v, Number.MIN_VALUE); }\r\n\r\n var _dataSankey = {\r\n nodes: [],\r\n links: []\r\n };\r\n\r\n //load data\r\n dataSankey.nodes.map(function(d) {\r\n _dataSankey.nodes.push({\r\n name: d.name,\r\n color: d.color,\r\n id: d.id\r\n });\r\n });\r\n dataSankey.links.map(function(l) {\r\n _dataSankey.links.push({\r\n source: l.source,\r\n target: l.target,\r\n id: l.id,\r\n value: _safeValueToLink(l.value)\r\n });\r\n });\r\n\r\n //var _dataSankey = Object.assign({}, dataSankey);\r\n\r\n var _updateLinksId = function(linkData) {\r\n for (var i = 0; i < linkData.length; i++)\r\n if (linkData[i].id == undefined)\r\n linkData[i].id = linkData[i].source + \" -> \" + linkData[i].target;\r\n };\r\n //update links id\r\n _updateLinksId(_dataSankey.links);\r\n\r\n //removing old svg and tips\r\n d3.select('.d3-tip-nodes').remove();\r\n d3.select('.d3-tip').remove();\r\n d3.select(containerId + ' svg').remove()\r\n\r\n var container = d3.select(containerId);\r\n\r\n function _getDimensions(container, margin) {\r\n var bbox = container.node().getBoundingClientRect();\r\n return {\r\n width: bbox.width - margin.left - margin.right,\r\n height: bbox.height - margin.top - margin.bottom\r\n };\r\n }\r\n var dimensions = _getDimensions(container, configSankey.margin);\r\n\r\n var svg_base = container.append(\"svg\")\r\n .attr('width', dimensions.width + configSankey.margin.left + configSankey.margin.right)\r\n .attr('height', dimensions.height + configSankey.margin.top + configSankey.margin.bottom)\r\n .attr(\"class\", \"sk-svg\");\r\n var svg = svg_base.append(\"g\")\r\n .attr('transform', \"translate(\" + configSankey.margin.left + \",\" + configSankey.margin.top + \")\");\r\n\r\n var sankey = d3.sankey()\r\n .nodeWidth(15)\r\n .nodePadding(10)\r\n .extent([\r\n [0, 0],\r\n [dimensions.width, dimensions.height]\r\n ]);\r\n\r\n var path = d3.sankeyLinkHorizontal();\r\n\r\n //Fonts\r\n var _getFontSize = function(d) {\r\n return configSankey.nodes.fontSize;\r\n }; //For default\r\n var _dynamicFontSize;\r\n var _updateRangeFontData = function(d) {}; //For default\r\n if (configSankey.nodes.dynamicSizeFontNode.enabled) {\r\n _dynamicFontSize = d3.scaleLinear().range(\r\n [configSankey.nodes.dynamicSizeFontNode.minSize,\r\n configSankey.nodes.dynamicSizeFontNode.maxSize\r\n ]);\r\n _updateRangeFontData = function(nodeData) {\r\n _dynamicFontSize.domain(d3.extent(nodeData, function(d) {\r\n return d.value\r\n }));\r\n };\r\n _getFontSize = function(d) {\r\n return Math.floor(_dynamicFontSize(d.value));\r\n };\r\n }\r\n\r\n //Colors\r\n //set color in nodes, case not exists\r\n for (var i = 0; i < _dataSankey.nodes.length; i++)\r\n if (_dataSankey.nodes[i].color == undefined)\r\n _dataSankey.nodes[i].color = configSankey.nodes.colors(_dataSankey.nodes[i].name.replace(/ .*/, \"\"));\r\n\r\n //Tooltip function:\r\n //D3 sankey diagram with view options (Austin Czarnecki�s Block cc6371af0b726e61b9ab)\r\n //https://bl.ocks.org/austinczarnecki/cc6371af0b726e61b9ab\r\n var linkTooltipOffset = 65,\r\n nodeTooltipOffset = 130;\r\n var tipLinks = d3.tip().attr(\"class\", \"d3-tip\").offset([-10, 0]);\r\n var tipNodes = d3.tip().attr(\"class\", \"d3-tip d3-tip-nodes\").offset([-10, 0]);\r\n\r\n function _formatValueTooltip(val) {\r\n if (configSankey.links.formatValue)\r\n return configSankey.links.formatValue(val);\r\n else\r\n return val + ' ' + configSankey.links.unit;\r\n }\r\n\r\n tipLinks.html(function(d) {\r\n var title, candidate;\r\n if (_dataSankey.links.indexOf(d.source.name) > -1) {\r\n candidate = d.source.name;\r\n title = d.target.name;\r\n } else {\r\n candidate = d.target.name;\r\n title = d.source.name;\r\n }\r\n var html = '
' +\r\n '

' + title + '

' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '' +\r\n '
' + candidate + '' + _formatValueTooltip(d.value) + '
' +\r\n '
';\r\n return html;\r\n });\r\n var topContentSVG = d3.select('.sk-svg').node().getBoundingClientRect().top;\r\n tipLinks.move = function(event) {\r\n tipLinks\r\n .style(\"top\", function() {\r\n if (d3.event.pageY - topContentSVG - linkTooltipOffset >= 0)\r\n return (d3.event.pageY - linkTooltipOffset) + \"px\";\r\n else\r\n return d3.event.pageY + 20 + \"px\";\r\n })\r\n .style(\"left\", function() {\r\n var left = (Math.max(d3.event.pageX - linkTooltipOffset, 10));\r\n left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20)\r\n return left + \"px\";\r\n })\r\n };\r\n\r\n tipNodes.html(function(d) {\r\n var nodeName = d.name;\r\n var linksFrom = d.targetLinks; //invert for reference\r\n var linksTo = d.sourceLinks;\r\n var html;\r\n\r\n html = '
' +\r\n '

' + nodeName + '

' +\r\n '';\r\n if (linksFrom.length > 0 & linksTo.length > 0) {\r\n html += ''\r\n }\r\n for (i = 0; i < linksFrom.length; ++i) {\r\n html += '' +\r\n '' +\r\n '' +\r\n '';\r\n }\r\n if (linksFrom.length > 0 & linksTo.length > 0) {\r\n html += ''\r\n }\r\n for (i = 0; i < linksTo.length; ++i) {\r\n html += '' +\r\n '' +\r\n '' +\r\n '';\r\n }\r\n html += '

' + configSankey.tooltip.labelSource + '

' + linksFrom[i].source.name + '' + _formatValueTooltip(linksFrom[i].value) + '

' + configSankey.tooltip.labelTarget + '

' + linksTo[i].target.name + '' + _formatValueTooltip(linksTo[i].value) + '
';\r\n return html;\r\n });\r\n tipNodes.move = function(event) {\r\n tipNodes.boxInfo = d3.select('.d3-tip-nodes').node().getBoundingClientRect();\r\n tipNodes\r\n .style(\"top\",\r\n function() {\r\n if ((d3.event.pageY - topContentSVG - tipNodes.boxInfo.height - 20) >= 0)\r\n return (d3.event.pageY - tipNodes.boxInfo.height - 20) + \"px\";\r\n else\r\n return d3.event.pageY + 20 + \"px\";\r\n }\r\n )\r\n .style(\"left\", function() {\r\n var left = (Math.max(d3.event.pageX - nodeTooltipOffset, 10));\r\n left = Math.min(left, window.innerWidth - d3.select('.d3-tip').node().getBoundingClientRect().width - 20)\r\n return left + \"px\";\r\n })\r\n };\r\n\r\n svg.call(tipLinks);\r\n svg.call(tipNodes);\r\n var _stopTooltips = function() {\r\n if (tipLinks) tipLinks.hide();\r\n if (tipNodes) tipNodes.hide();\r\n };\r\n\r\n //Load data\r\n sankey(_dataSankey);\r\n\r\n //update range font data\r\n _updateRangeFontData(_dataSankey.nodes);\r\n\r\n\r\n var link = svg.append(\"g\").selectAll(\".sk-link\")\r\n .data(_dataSankey.links, function(d) {\r\n return d.id;\r\n })\r\n .enter().append(\"path\")\r\n .attr(\"class\", \"sk-link\")\r\n .attr(\"d\", path)\r\n .style(\"stroke\", function(d) {\r\n return d.source.color;\r\n })\r\n .style(\"stroke-width\", function(d) {\r\n return Math.max(1, d.dy) + \"px\";\r\n })\r\n .sort(function(a, b) {\r\n return b.dy - a.dy;\r\n });\r\n if (configSankey.tooltip.infoDiv)\r\n link.on('mousemove', tipLinks.move).on('mouseover', tipLinks.show).on('mouseout', tipLinks.hide);\r\n else\r\n link.append(\"title\").text(function(d) {\r\n return d.source.name + \" -> \" + d.target.name + \"\\n\" + _formatValueTooltip(d.value);\r\n });\r\n\r\n // the function for moving the nodes\r\n function _dragmove(d) {\r\n _stopTooltips();\r\n d3.select(this).attr(\"transform\", \"translate(\" + d.x + \",\" + (d.y = Math.max(0, Math.min(dimensions.height - d.dy, d3.event.y))) + \")\");\r\n sankey.update(_dataSankey);\r\n link.attr(\"d\", path);\r\n }\r\n\r\n var node = svg.append(\"g\").selectAll(\".sk-node\")\r\n .data(_dataSankey.nodes, function(d) {\r\n return d.name;\r\n })\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"sk-node\")\r\n .attr(\"transform\", function(d) {\r\n return \"translate(\" + d.x + \",\" + d.y + \")\";\r\n })\r\n if (configSankey.tooltip.infoDiv)\r\n node.on('mousemove', tipNodes.move).on('mouseover', tipNodes.show).on('mouseout', tipNodes.hide);\r\n else\r\n node.append(\"title\").text(function(d) {\r\n return d.name + \"\\n\" + _formatValueTooltip(d.value);\r\n });\r\n //Drag nodes\t\r\n if (configSankey.nodes.canDragNodes)\r\n node.call(d3.drag().subject(function(d) {\r\n return d;\r\n }).on(\"start\", function() {\r\n d3.event.sourceEvent.stopPropagation();\r\n this.parentNode.appendChild(this);\r\n }).on(\"drag\", _dragmove));\r\n\r\n node.append(\"rect\")\r\n .attr(\"height\", function(d) {\r\n return d.dy;\r\n })\r\n .attr(\"width\", sankey.nodeWidth())\r\n .style(\"fill\", function(d) {\r\n return d.color;\r\n })\r\n .style(\"stroke\", function(d) {\r\n return d3.rgb(d.color).darker(1.8);\r\n });\r\n\r\n node.append(\"text\")\r\n .attr(\"x\", -6)\r\n .attr(\"y\", function(d) {\r\n return d.dy / 2;\r\n })\r\n .attr(\"dy\", \".35em\")\r\n .attr(\"text-anchor\", \"end\")\r\n .attr(\"transform\", null)\r\n .style(\"fill\", function(d) {\r\n return d3.rgb(d.color).darker(2.4);\r\n })\r\n .text(function(d) {\r\n return d.name;\r\n })\r\n .style(\"font-size\", function(d) {\r\n return _getFontSize(d) + \"px\";\r\n })\r\n .filter(function(d) {\r\n return d.x < dimensions.width / 2;\r\n })\r\n .attr(\"x\", 6 + sankey.nodeWidth())\r\n .attr(\"text-anchor\", \"start\");\r\n\r\n //https://bl.ocks.org/syntagmatic/77c7f7e8802e8824eed473dd065c450b\r\n var _updateLinksValues = function(dataUpdated) {\r\n _stopTooltips();\r\n sankey(dataUpdated);\r\n sankey.update(dataUpdated);\r\n\r\n //update range font data\r\n _updateRangeFontData(dataUpdated.nodes);\r\n\r\n svg.selectAll(\".sk-link\")\r\n .data(dataUpdated.links, function(d) {\r\n return d.id;\r\n })\r\n .sort(function(a, b) {\r\n return b.dy - a.dy;\r\n })\r\n .transition()\r\n .duration(1300)\r\n .attr(\"d\", path)\r\n .style(\"stroke-width\", function(d) {\r\n return Math.max(1, d.dy) + \"px\";\r\n });\r\n\r\n svg.selectAll(\".sk-node\")\r\n .data(dataUpdated.nodes, function(d) {\r\n return d.name;\r\n })\r\n .transition()\r\n .duration(1300)\r\n .attr(\"transform\", function(d) {\r\n return \"translate(\" + d.x + \",\" + d.y + \")\";\r\n });\r\n\r\n svg.selectAll(\".sk-node rect\")\r\n .transition()\r\n .duration(1300)\r\n .attr(\"height\", function(d) {\r\n return d.dy;\r\n });\r\n\r\n svg.selectAll(\".sk-node text\")\r\n .transition()\r\n .duration(1300)\r\n .attr(\"y\", function(d) {\r\n return d.dy / 2;\r\n })\r\n .style(\"font-size\", function(d) {\r\n return _getFontSize(d) + \"px\";\r\n });\r\n };\r\n\r\n\t//Update value of links, for call the function '_updateLinksValues' transition values (old to new)\r\n\t//This function only update values from links\r\n this.updateData = function(dataUpdated) {\r\n for (var i = 0; i < dataUpdated.links.length; i++) {\r\n var idLinkUpdate = dataUpdated.links[i].id || dataUpdated.links[i].source + \" -> \" + dataUpdated.links[i].target;\r\n var linkToUpdate = _dataSankey.links.filter(function(l) {\r\n return l.id == idLinkUpdate\r\n })[0];\r\n if (linkToUpdate) linkToUpdate.value = _safeValueToLink(dataUpdated.links[i].value);\r\n }\r\n _updateLinksValues(_dataSankey);\r\n };\r\n\r\n return this;\r\n};"]} \ No newline at end of file