@plotly/d3-sankey
Advanced tools
Comparing version 0.7.2 to 0.7.3
@@ -1,2 +0,2 @@ | ||
// https://github.com/d3/d3-sankey Version 0.7.2. Copyright 2019 Mike Bostock. | ||
// https://github.com/plotly/d3-sankey Version 0.7.3. Copyright 2020 Mike Bostock. | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-collection'), require('d3-shape')) : |
@@ -1,2 +0,2 @@ | ||
// https://github.com/d3/d3-sankey Version 0.7.2. Copyright 2019 Mike Bostock. | ||
// https://github.com/plotly/d3-sankey Version 0.7.3. Copyright 2020 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,g,k,t){"use strict";function e(n){return n.target.depth}function p(n,t){return n.sourceLinks.length?n.depth:t-1}function v(n){return function(){return n}}function L(n,t){return E(n.source,t.source)||n.index-t.index}function x(n,t){return E(n.target,t.target)||n.index-t.index}function E(n,t){return n.y0-t.y0}function m(n){return n.value}function w(n){return(n.y0+n.y1)/2}function M(n){return w(n.source)*n.value}function b(n){return w(n.target)*n.value}function j(n){return n.index}function q(n){return n.nodes}function z(n){return n.links}function O(n,t){var e=n.get(t);if(!e)throw new Error("missing: "+t);return e}function r(n){return[n.source.x1,n.y0]}function o(n){return[n.target.x0,n.y1]}n.sankey=function(){var u=0,c=0,i=1,f=1,s=24,a=8,t=j,h=p,e=q,r=z,d=32,l=2/3;function o(){var n={nodes:e.apply(null,arguments),links:r.apply(null,arguments)};return function(n){n.nodes.forEach(function(n,t){n.index=t,n.sourceLinks=[],n.targetLinks=[]});var o=k.map(n.nodes,t);n.links.forEach(function(n,t){n.index=t;var e=n.source,r=n.target;"object"!=typeof e&&(e=n.source=O(o,e)),"object"!=typeof r&&(r=n.target=O(o,r)),e.sourceLinks.push(n),r.targetLinks.push(n)})}(n),n.nodes.forEach(function(n){n.value=Math.max(g.sum(n.sourceLinks,m),g.sum(n.targetLinks,m))}),function(n){var t,e,r;for(t=n.nodes,e=[],r=0;t.length;++r,t=e,e=[])t.forEach(function(n){n.depth=r,n.sourceLinks.forEach(function(n){e.indexOf(n.target)<0&&e.push(n.target)})});for(t=n.nodes,e=[],r=0;t.length;++r,t=e,e=[])t.forEach(function(n){n.height=r,n.targetLinks.forEach(function(n){e.indexOf(n.source)<0&&e.push(n.source)})});var o=(i-u-s)/(r-1);n.nodes.forEach(function(n){n.x1=(n.x0=u+Math.max(0,Math.min(r-1,Math.floor(h.call(null,n,r))))*o)+s})}(n),function(r){var o=k.nest().key(function(n){return n.x0}).sortKeys(g.ascending).entries(r.nodes).map(function(n){return n.values});(function(){var n=g.max(o,function(n){return n.length}),t=l*(f-c)/(n-1);t<a&&(a=t);var e=g.min(o,function(n){return(f-c-(n.length-1)*a)/g.sum(n,m)});o.forEach(function(n){n.forEach(function(n,t){n.y1=(n.y0=t)+n.value*e})}),r.links.forEach(function(n){n.width=n.value*e})})(),i();for(var n=1,t=d;0<t;--t)u(n*=.99),i(),e(n),i();function e(e){o.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var t=(g.sum(n.targetLinks,M)/g.sum(n.targetLinks,m)-w(n))*e;n.y0+=t,n.y1+=t}})})}function u(e){o.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var t=(g.sum(n.sourceLinks,b)/g.sum(n.sourceLinks,m)-w(n))*e;n.y0+=t,n.y1+=t}})})}function i(){o.forEach(function(n){var t,e,r,o=c,u=n.length;for(n.sort(E),r=0;r<u;++r)t=n[r],0<(e=o-t.y0)&&(t.y0+=e,t.y1+=e),o=t.y1+a;if(0<(e=o-a-f))for(o=t.y0-=e,t.y1-=e,r=u-2;0<=r;--r)t=n[r],0<(e=t.y1+a-o)&&(t.y0-=e,t.y1-=e),o=t.y0})}}(n),y(n),n}function y(n){n.nodes.forEach(function(n){n.sourceLinks.sort(x),n.targetLinks.sort(L)}),n.nodes.forEach(function(n){var t=n.y0,e=t;n.sourceLinks.forEach(function(n){n.y0=t+n.width/2,t+=n.width}),n.targetLinks.forEach(function(n){n.y1=e+n.width/2,e+=n.width})})}return o.update=function(n){return y(n),n},o.nodeId=function(n){return arguments.length?(t="function"==typeof n?n:v(n),o):t},o.nodeAlign=function(n){return arguments.length?(h="function"==typeof n?n:v(n),o):h},o.nodeWidth=function(n){return arguments.length?(s=+n,o):s},o.nodePadding=function(n){return arguments.length?(a=+n,o):a},o.nodes=function(n){return arguments.length?(e="function"==typeof n?n:v(n),o):e},o.links=function(n){return arguments.length?(r="function"==typeof n?n:v(n),o):r},o.size=function(n){return arguments.length?(u=c=0,i=+n[0],f=+n[1],o):[i-u,f-c]},o.extent=function(n){return arguments.length?(u=+n[0][0],i=+n[1][0],c=+n[0][1],f=+n[1][1],o):[[u,c],[i,f]]},o.iterations=function(n){return arguments.length?(d=+n,o):d},o},n.sankeyCenter=function(n){return n.targetLinks.length?n.depth:n.sourceLinks.length?g.min(n.sourceLinks,e)-1:0},n.sankeyLeft=function(n){return n.depth},n.sankeyRight=function(n,t){return t-1-n.height},n.sankeyJustify=p,n.sankeyLinkHorizontal=function(){return t.linkHorizontal().source(r).target(o)},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "@plotly/d3-sankey", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "Visualize flow between nodes in a directed acyclic network.", | ||
@@ -18,6 +18,6 @@ "keywords": [ | ||
"jsnext:main": "index", | ||
"homepage": "https://github.com/d3/d3-sankey", | ||
"homepage": "https://github.com/plotly/d3-sankey", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/d3/d3-sankey.git" | ||
"url": "https://github.com/plotly/d3-sankey.git" | ||
}, | ||
@@ -24,0 +24,0 @@ "scripts": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
822122