d3-state-visualizer
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -1,1 +0,1 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):"object"==typeof exports?exports["d3-state-visualizer"]=r():t["d3-state-visualizer"]=r()}(this,function(){return function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var n={};return r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o=n(37),i=e(o),u=n(38),c=e(u);r.default={forceGraph:i.default,tree:c.default},t.exports=r.default},function(t,r){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,r,n){var e=n(25),o=n(5),i=n(1),u="[object Array]",c=Object.prototype,a=c.toString,f=e(Array,"isArray"),l=f||function(t){return i(t)&&o(t.length)&&a.call(t)==u};t.exports=l},function(t,r){function n(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=n},function(t,r,n){function e(t){return o(t)?t:Object(t)}var o=n(3);t.exports=e},function(t,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&e>=t}var e=9007199254740991;t.exports=n},function(t,r,n){var e=n(25),o=n(9),i=n(3),u=n(63),c=e(Object,"keys"),a=c?function(t){var r=null==t?void 0:t.constructor;return"function"==typeof r&&r.prototype===t||"function"!=typeof t&&o(t)?u(t):i(t)?c(t):[]}:u;t.exports=a},function(t,r,n){function e(t,r,n){if("function"!=typeof t)return o;if(void 0===r)return t;switch(n){case 1:return function(n){return t.call(r,n)};case 3:return function(n,e,o){return t.call(r,n,e,o)};case 4:return function(n,e,o,i){return t.call(r,n,e,o,i)};case 5:return function(n,e,o,i,u){return t.call(r,n,e,o,i,u)}}return function(){return t.apply(r,arguments)}}var o=n(36);t.exports=e},function(t,r,n){function e(t){return i(t)&&o(t)&&c.call(t,"callee")&&!a.call(t,"callee")}var o=n(9),i=n(1),u=Object.prototype,c=u.hasOwnProperty,a=u.propertyIsEnumerable;t.exports=e},function(t,r,n){function e(t){return null!=t&&i(o(t))}var o=n(23),i=n(5);t.exports=e},function(t,r,n){function e(t,r,n,c,a,f){return t===r?!0:null==t||null==r||!i(t)&&!u(r)?t!==t&&r!==r:o(t,r,e,n,c,a,f)}var o=n(46),i=n(3),u=n(1);t.exports=e},function(t,r){function n(t,r){return t="number"==typeof t||e.test(t)?+t:-1,r=null==r?o:r,t>-1&&t%1==0&&r>t}var e=/^\d+$/,o=9007199254740991;t.exports=n},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(3),i="[object Function]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){var r;if(!u(t)||l.call(t)!=c||i(t)||!f.call(t,"constructor")&&(r=t.constructor,"function"==typeof r&&!(r instanceof r)))return!1;var n;return o(t,function(t,r){n=r}),void 0===n||f.call(t,n)}var o=n(45),i=n(8),u=n(1),c="[object Object]",a=Object.prototype,f=a.hasOwnProperty,l=a.toString;t.exports=e},function(t,r,n){function e(t){if(null==t)return[];a(t)||(t=Object(t));var r=t.length;r=r&&c(r)&&(i(t)||o(t))&&r||0;for(var n=t.constructor,e=-1,f="function"==typeof n&&n.prototype===t,s=Array(r),p=r>0;++e<r;)s[e]=e+"";for(var v in t)p&&u(v,r)||"constructor"==v&&(f||!l.call(t,v))||s.push(v);return s}var o=n(8),i=n(2),u=n(11),c=n(5),a=n(3),f=Object.prototype,l=f.hasOwnProperty;t.exports=e},function(t,r){function n(t,r){var n=-1,e=t.length;for(r||(r=Array(e));++n<e;)r[n]=t[n];return r}t.exports=n},function(t,r,n){function e(t,r,n,d,y,h,b){var g;if(n&&(g=y?n(t,d,y):n(t)),void 0!==g)return g;if(!p(t))return t;var j=s(t);if(j){if(g=a(t),!r)return o(t,g)}else{var A=R.call(t),O=A==x;if(A!=m&&A!=v&&(!O||y))return D[A]?f(t,A,r):y?t:{};if(g=l(O?{}:t),!r)return u(g,t)}h||(h=[]),b||(b=[]);for(var _=h.length;_--;)if(h[_]==t)return b[_];return h.push(t),b.push(g),(j?i:c)(t,function(o,i){g[i]=e(o,r,n,i,t,h,b)}),g}var o=n(15),i=n(41),u=n(43),c=n(19),a=n(59),f=n(60),l=n(61),s=n(2),p=n(3),v="[object Arguments]",d="[object Array]",y="[object Boolean]",h="[object Date]",b="[object Error]",x="[object Function]",g="[object Map]",j="[object Number]",m="[object Object]",A="[object RegExp]",O="[object Set]",_="[object String]",w="[object WeakMap]",M="[object ArrayBuffer]",S="[object Float32Array]",E="[object Float64Array]",P="[object Int8Array]",B="[object Int16Array]",C="[object Int32Array]",k="[object Uint8Array]",N="[object Uint8ClampedArray]",U="[object Uint16Array]",F="[object Uint32Array]",D={};D[v]=D[d]=D[M]=D[y]=D[h]=D[S]=D[E]=D[P]=D[B]=D[C]=D[j]=D[m]=D[A]=D[_]=D[k]=D[N]=D[U]=D[F]=!0,D[b]=D[x]=D[g]=D[O]=D[w]=!1;var I=Object.prototype,R=I.toString;t.exports=e},function(t,r){function n(t,r,n){n||(n={});for(var e=-1,o=r.length;++e<o;){var i=r[e];n[i]=t[i]}return n}t.exports=n},function(t,r,n){var e=n(54),o=e();t.exports=o},function(t,r,n){function e(t,r){return o(t,r,i)}var o=n(18),i=n(6);t.exports=e},function(t,r,n){function e(t,r,n){if(null!=t){void 0!==n&&n in o(t)&&(r=[n]);for(var e=0,i=r.length;null!=t&&i>e;)t=t[r[e++]];return e&&e==i?t:void 0}}var o=n(4);t.exports=e},function(t,r,n){function e(t,r,n){var e=r.length,u=e,c=!n;if(null==t)return!u;for(t=i(t);e--;){var a=r[e];if(c&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++e<u;){a=r[e];var f=a[0],l=t[f],s=a[1];if(c&&a[2]){if(void 0===l&&!(f in t))return!1}else{var p=n?n(l,s,f):void 0;if(!(void 0===p?o(s,l,n,!0):p))return!1}}return!0}var o=n(10),i=n(4);t.exports=e},function(t,r){function n(t){return function(r){return null==r?void 0:r[t]}}t.exports=n},function(t,r,n){var e=n(22),o=e("length");t.exports=o},function(t,r,n){function e(t){for(var r=i(t),n=r.length;n--;)r[n][2]=o(r[n][1]);return r}var o=n(27),i=n(84);t.exports=e},function(t,r,n){function e(t,r){var n=null==t?void 0:t[r];return o(n)?n:void 0}var o=n(31);t.exports=e},function(t,r,n){function e(t,r){var n=typeof t;if("string"==n&&c.test(t)||"number"==n)return!0;if(o(t))return!1;var e=!u.test(t);return e||null!=r&&t in i(r)}var o=n(2),i=n(4),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,c=/^\w*$/;t.exports=e},function(t,r,n){function e(t){return t===t&&!o(t)}var o=n(3);t.exports=e},function(t,r,n){function e(t){if(i(t))return t;var r=[];return o(t).replace(u,function(t,n,e,o){r.push(e?o.replace(c,"$1"):n||t)}),r}var o=n(51),i=n(2),u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,c=/\\(\\)?/g;t.exports=e},function(t,r,n){t.exports={clone:n(64),cloneDeep:n(65),eq:n(66),gt:n(67),gte:n(68),isArguments:n(8),isArray:n(2),isBoolean:n(69),isDate:n(70),isElement:n(71),isEmpty:n(72),isEqual:n(30),isError:n(73),isFinite:n(74),isFunction:n(12),isMatch:n(75),isNaN:n(76),isNative:n(31),isNull:n(77),isNumber:n(32),isObject:n(3),isPlainObject:n(13),isRegExp:n(78),isString:n(33),isTypedArray:n(34),isUndefined:n(79),lt:n(80),lte:n(81),toArray:n(82),toPlainObject:n(83)}},function(t,r,n){function e(t,r,n,e){n="function"==typeof n?i(n,e,3):void 0;var u=n?n(t,r):void 0;return void 0===u?o(t,r,n):!!u}var o=n(10),i=n(7);t.exports=e},function(t,r,n){function e(t){return null==t?!1:o(t)?l.test(a.call(t)):i(t)&&u.test(t)}var o=n(12),i=n(1),u=/^\[object .+?Constructor\]$/,c=Object.prototype,a=Function.prototype.toString,f=c.hasOwnProperty,l=RegExp("^"+a.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=e},function(t,r,n){function e(t){return"number"==typeof t||o(t)&&c.call(t)==i}var o=n(1),i="[object Number]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return"string"==typeof t||o(t)&&c.call(t)==i}var o=n(1),i="[object String]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return i(t)&&o(t.length)&&!!P[C.call(t)]}var o=n(5),i=n(1),u="[object Arguments]",c="[object Array]",a="[object Boolean]",f="[object Date]",l="[object Error]",s="[object Function]",p="[object Map]",v="[object Number]",d="[object Object]",y="[object RegExp]",h="[object Set]",b="[object String]",x="[object WeakMap]",g="[object ArrayBuffer]",j="[object Float32Array]",m="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",_="[object Int32Array]",w="[object Uint8Array]",M="[object Uint8ClampedArray]",S="[object Uint16Array]",E="[object Uint32Array]",P={};P[j]=P[m]=P[A]=P[O]=P[_]=P[w]=P[M]=P[S]=P[E]=!0,P[u]=P[c]=P[g]=P[a]=P[f]=P[l]=P[s]=P[p]=P[v]=P[d]=P[y]=P[h]=P[b]=P[x]=!1;var B=Object.prototype,C=B.toString;t.exports=e},function(t,r,n){var e=n(55),o=e();t.exports=o},function(t,r){function n(t){return t}t.exports=n},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var r=0,n=Array(t.length);r<t.length;r++)n[r]=t[r];return n}return Array.from(t)}Object.defineProperty(r,"__esModule",{value:!0});var i=n(2),u=e(i);r.default=function(){return function(t,r,n){var e=n.data,i=void 0===e?[]:e,c=n.id,a=void 0===c?"d3svg":c,f=n.style,l=void 0===f?"":f,s=n.size,p=void 0===s?1e3:s,v=n.aspectRatio,d=void 0===v?1:v,y=n.charge,h=void 0===y?-1:y,b=n.linkDistance,x=void 0===b?1:b,g=n.maxNodeSize,j=void 0===g?50:g,m={top:p/100,right:p/50,bottom:p/100,left:40},A=p-m.left-m.right,O=p*d-m.top-m.bottom,_=p,w=p*d,M=t.select(r),S=M.append("svg").attr({id:a,style:l,width:_,viewBox:"0 0 "+_+" "+w,preserveAspectRatio:"xMinYMin slice"}).append("g").attr({transform:"translate("+m.left+", "+m.top+")"}),E=S.selectAll("circle"),P=t.layout.force().size([A,O]).nodes(i).linkDistance(x).charge(h).on("tick",function(){E.attr({cx:function(t){return Math.round(t.x)},cy:function(t){return Math.round(t.y)}})}),B=P.nodes();return function(r){r&&(B=[].concat(o(B),o(r)),P.nodes(B)),E=E.data(B),E.enter().insert("circle").attr({r:function(t){var r=t[t.key];if(!u.default(r))return 10;var n=10+2*t[t.key].length;return n>j?j:n},fill:function(t){return u.default(t[t.key])?"blue":"red"}}).on({mouseover:function(){t.select(this).style("fill-opacity","0.5")},mouseout:function(){t.select(this).style("fill-opacity","1")}}).call(P.drag),E.exit().remove(),P.start()}}},t.exports=r.default},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var r=0,n=Array(t.length);r<t.length;r++)n[r]=t[r];return n}return Array.from(t)}Object.defineProperty(r,"__esModule",{value:!0});var i=(n(29),n(35)),u=(e(i),n(87)),c=e(u),a=n(39);r.default=function(){return function(t,r,n){var e=n.id,i=void 0===e?"d3svg":e,u=n.style,f=void 0===u?"":u,l=n.size,s=void 0===l?1e3:l,p=n.aspectRatio,v=void 0===p?1:p,d=n.isSorted,y=void 0===d?!1:d,h=n.widthBetweenBranchCoeff,b=void 0===h?1:h,x=n.heightBetweenNodesCoeff,g=void 0===x?1:x,j=n.transitionDuration,m=void 0===j?750:j,A={top:s/100,right:s/50,bottom:s/100,left:40},O=s-A.left-A.right,_=s*v-A.top-A.bottom,w=s,M=s*v,S=t.select(r),E=S.append("svg").attr({id:i,style:f,width:w,viewBox:"0 0 "+w+" "+M,preserveAspectRatio:"xMinYMin slice"}).append("g").attr({transform:"translate("+A.left+", "+A.top+")"}),P=t.layout.tree().size([O,_]),B=void 0;return y&&P.sort(function(t,r){return r.name.toLowerCase()<t.name.toLowerCase()?1:-1}),function(){function r(n){var e=t.svg.diagonal().projection(function(t){return[t.y,t.x]}),c=Math.max.apply(Math,o(a.getNodeGroupByDepthCount(B)));P=P.size([25*c*b,O]);var f=P.nodes(B),l=P.links(f);f.forEach(function(t){return t.y=t.depth*(7*u*g)});var s=E.selectAll("g.node").data(f,function(t){return t.id||(t.id=++i)}),p=s.enter().append("g").attr({"class":"node",transform:function(t){return"translate("+n.y0+","+n.x0+")"}}).on({click:function(n){t.event.defaultPrevented||r(a.toggleChildren(n))}});p.append("circle").attr({"class":"nodeCircle"}),p.append("text").attr({"class":"nodeText",dy:".35em"}).style({"fill-opacity":0}).text(function(t){return t.name}),s.select("text").attr({x:function(t){return t.children||t._children?-10:10},"text-anchor":function(t){return t.children||t._children?"end":"start"}}).text(function(t){return t.name}),s.select("circle.nodeCircle").attr({r:4.5}).style({fill:function(t){return t._children?"lightsteelblue":t.children?"#fff":"#ccc"}});var v=s.transition().duration(m).attr({transform:function(t){return"translate("+t.y+","+t.x+")"}});v.select("text").style("fill-opacity",1);var d=s.exit().transition().duration(m).attr({transform:function(t){return"translate("+n.y+","+n.x+")"}}).remove();d.select("circle").attr("r",0),d.select("text").style("fill-opacity",0);var y=E.selectAll("path.link").data(l,function(t){return t.target.id});y.enter().insert("path","g").attr({"class":"link",d:function(t){var r={x:n.x0,y:n.y0};return e({source:r,target:r})}}),y.transition().duration(m).attr({d:e}),y.exit().transition().duration(m).attr({d:function(t){var r={x:n.x,y:n.y};return e({source:r,target:r})}}).remove(),f.forEach(function(t){t.x0=t.x,t.y0=t.y})}var e=arguments.length<=0||void 0===arguments[0]?n.state:arguments[0];B=c.default(e,"state");var i=0,u=0;a.visit(B,function(t){return u=Math.max(t.name.length,u)},function(t){return t.children&&t.children.length>0?t.children:null}),B.x0=_/2,B.y0=0,r(B)}}},t.exports=r.default},function(t,r,n){"use strict";function e(t){t.children&&(t._children=t.children,t._children.forEach(e),t.children=null)}function o(t){t._children&&(t.children=t._children,t.children.forEach(o),t._children=null)}function i(t){return t.children?(t._children=t.children,t.children=null):t._children&&(t.children=t._children,t._children=null),t}function u(t,r,n){if(t){r(t);var e=n(t);if(e)for(var o=e.length,i=0;o>i;i++)u(e[i],r,n)}}function c(t){var r=[1],n=function e(t){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return t.children&&0!==t.children.length?(r.length<=n+1&&r.push(0),r[n+1]+=t.children.length,void t.children.forEach(function(t){e(t,n+1)})):0};return n(t),r}Object.defineProperty(r,"__esModule",{value:!0}),r.collapseChildren=e,r.expandChildren=o,r.toggleChildren=i,r.visit=u,r.getNodeGroupByDepthCount=c;n(29)},function(t,r){function n(t){var r=t?t.length:0;return r?t[r-1]:void 0}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=t.length;++n<e&&r(t[n],n,t)!==!1;);return t}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=t.length;++n<e;)if(r(t[n],n,t))return!0;return!1}t.exports=n},function(t,r,n){function e(t,r){return null==r?t:o(r,i(r),t)}var o=n(17),i=n(6);t.exports=e},function(t,r,n){function e(t,r,n){var e=typeof t;return"function"==e?void 0===r?t:u(t,r,n):null==t?c:"object"==e?o(t):void 0===r?a(t):i(t,r)}var o=n(47),i=n(48),u=n(7),c=n(36),a=n(86);t.exports=e},function(t,r,n){function e(t,r){return o(t,r,i)}var o=n(18),i=n(14);t.exports=e},function(t,r,n){function e(t,r,n,e,p,y,h){var b=c(t),x=c(r),g=l,j=l;b||(g=d.call(t),g==f?g=s:g!=s&&(b=a(t))),x||(j=d.call(r),j==f?j=s:j!=s&&(x=a(r)));var m=g==s,A=j==s,O=g==j;if(O&&!b&&!m)return i(t,r,g);if(!p){var _=m&&v.call(t,"__wrapped__"),w=A&&v.call(r,"__wrapped__");if(_||w)return n(_?t.value():t,w?r.value():r,e,p,y,h)}if(!O)return!1;y||(y=[]),h||(h=[]);for(var M=y.length;M--;)if(y[M]==t)return h[M]==r;y.push(t),h.push(r);var S=(b?o:u)(t,r,n,e,p,y,h);return y.pop(),h.pop(),S}var o=n(56),i=n(57),u=n(58),c=n(2),a=n(34),f="[object Arguments]",l="[object Array]",s="[object Object]",p=Object.prototype,v=p.hasOwnProperty,d=p.toString;t.exports=e},function(t,r,n){function e(t){var r=i(t);if(1==r.length&&r[0][2]){var n=r[0][0],e=r[0][1];return function(t){return null==t?!1:t[n]===e&&(void 0!==e||n in u(t))}}return function(t){return o(t,r)}}var o=n(21),i=n(24),u=n(4);t.exports=e},function(t,r,n){function e(t,r){var n=c(t),e=a(t)&&f(r),v=t+"";return t=p(t),function(c){if(null==c)return!1;var a=v;if(c=s(c),(n||!e)&&!(a in c)){if(c=1==t.length?c:o(c,u(t,0,-1)),null==c)return!1;a=l(t),c=s(c)}return c[a]===r?void 0!==r||a in c:i(r,c[a],void 0,!0)}}var o=n(20),i=n(10),u=n(50),c=n(2),a=n(26),f=n(27),l=n(40),s=n(4),p=n(28);t.exports=e},function(t,r,n){function e(t){var r=t+"";return t=i(t),function(n){return o(n,t,r)}}var o=n(20),i=n(28);t.exports=e},function(t,r){function n(t,r,n){var e=-1,o=t.length;r=null==r?0:+r||0,0>r&&(r=-r>o?0:o+r),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var i=Array(o);++e<o;)i[e]=t[e+r];return i}t.exports=n},function(t,r){function n(t){return null==t?"":t+""}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=r.length,o=Array(e);++n<e;)o[n]=t[r[n]];return o}t.exports=n},function(t,r){(function(r){function n(t){var r=new e(t.byteLength),n=new o(r);return n.set(new o(t)),r}var e=r.ArrayBuffer,o=r.Uint8Array;t.exports=n}).call(r,function(){return this}())},function(t,r,n){function e(t){return function(r,n,e){for(var i=o(r),u=e(r),c=u.length,a=t?c:-1;t?a--:++a<c;){var f=u[a];if(n(i[f],f,i)===!1)break}return r}}var o=n(4);t.exports=e},function(t,r,n){function e(t){return function(r,n,e){var u={};return n=o(n,e,3),i(r,function(r,e,o){var i=n(r,e,o);e=t?i:e,r=t?r:i,u[e]=r}),u}}var o=n(44),i=n(19);t.exports=e},function(t,r,n){function e(t,r,n,e,i,u,c){var a=-1,f=t.length,l=r.length;if(f!=l&&!(i&&l>f))return!1;for(;++a<f;){var s=t[a],p=r[a],v=e?e(i?p:s,i?s:p,a):void 0;if(void 0!==v){if(v)continue;return!1}if(i){if(!o(r,function(t){return s===t||n(s,t,e,i,u,c)}))return!1}else if(s!==p&&!n(s,p,e,i,u,c))return!1}return!0}var o=n(42);t.exports=e},function(t,r){function n(t,r,n){switch(n){case e:case o:return+t==+r;case i:return t.name==r.name&&t.message==r.message;case u:return t!=+t?r!=+r:t==+r;case c:case a:return t==r+""}return!1}var e="[object Boolean]",o="[object Date]",i="[object Error]",u="[object Number]",c="[object RegExp]",a="[object String]";t.exports=n},function(t,r,n){function e(t,r,n,e,i,c,a){var f=o(t),l=f.length,s=o(r),p=s.length;if(l!=p&&!i)return!1;for(var v=l;v--;){var d=f[v];if(!(i?d in r:u.call(r,d)))return!1}for(var y=i;++v<l;){d=f[v];var h=t[d],b=r[d],x=e?e(i?b:h,i?h:b,d):void 0;if(!(void 0===x?n(h,b,e,i,c,a):x))return!1;y||(y="constructor"==d)}if(!y){var g=t.constructor,j=r.constructor;if(g!=j&&"constructor"in t&&"constructor"in r&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j))return!1}return!0}var o=n(6),i=Object.prototype,u=i.hasOwnProperty;t.exports=e},function(t,r){function n(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&o.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var e=Object.prototype,o=e.hasOwnProperty;t.exports=n},function(t,r,n){function e(t,r,n){var e=t.constructor;switch(r){case l:return o(t);case i:case u:return new e(+t);case s:case p:case v:case d:case y:case h:case b:case x:case g:var m=t.buffer;return new e(n?o(m):m,t.byteOffset,t.length);case c:case f:return new e(t);case a:var A=new e(t.source,j.exec(t));A.lastIndex=t.lastIndex}return A}var o=n(53),i="[object Boolean]",u="[object Date]",c="[object Number]",a="[object RegExp]",f="[object String]",l="[object ArrayBuffer]",s="[object Float32Array]",p="[object Float64Array]",v="[object Int8Array]",d="[object Int16Array]",y="[object Int32Array]",h="[object Uint8Array]",b="[object Uint8ClampedArray]",x="[object Uint16Array]",g="[object Uint32Array]",j=/\w*$/;t.exports=e},function(t,r){function n(t){var r=t.constructor;return"function"==typeof r&&r instanceof r||(r=Object),new r}t.exports=n},function(t,r,n){function e(t,r,n){if(!u(n))return!1;var e=typeof r;if("number"==e?o(n)&&i(r,n.length):"string"==e&&r in n){var c=n[r];return t===t?t===c:c!==c}return!1}var o=n(9),i=n(11),u=n(3);t.exports=e},function(t,r,n){function e(t){for(var r=a(t),n=r.length,e=n&&t.length,f=!!e&&c(e)&&(i(t)||o(t)),s=-1,p=[];++s<n;){var v=r[s];(f&&u(v,e)||l.call(t,v))&&p.push(v)}return p}var o=n(8),i=n(2),u=n(11),c=n(5),a=n(14),f=Object.prototype,l=f.hasOwnProperty;t.exports=e},function(t,r,n){function e(t,r,n,e){return r&&"boolean"!=typeof r&&u(t,r,n)?r=!1:"function"==typeof r&&(e=n,n=r,r=!1),"function"==typeof n?o(t,r,i(n,e,3)):o(t,r)}var o=n(16),i=n(7),u=n(62);t.exports=e},function(t,r,n){function e(t,r,n){return"function"==typeof r?o(t,!0,i(r,n,3)):o(t,!0)}var o=n(16),i=n(7);t.exports=e},function(t,r,n){t.exports=n(30)},function(t,r){function n(t,r){return t>r}t.exports=n},function(t,r){function n(t,r){return t>=r}t.exports=n},function(t,r,n){function e(t){return t===!0||t===!1||o(t)&&c.call(t)==i}var o=n(1),i="[object Boolean]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(1),i="[object Date]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return!!t&&1===t.nodeType&&o(t)&&!i(t)}var o=n(1),i=n(13);t.exports=e},function(t,r,n){function e(t){return null==t?!0:u(t)&&(i(t)||f(t)||o(t)||a(t)&&c(t.splice))?!t.length:!l(t).length}var o=n(8),i=n(2),u=n(9),c=n(12),a=n(1),f=n(33),l=n(6);t.exports=e},function(t,r,n){function e(t){return o(t)&&"string"==typeof t.message&&c.call(t)==i}var o=n(1),i="[object Error]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r){(function(r){function n(t){return"number"==typeof t&&e(t)}var e=r.isFinite;t.exports=n}).call(r,function(){return this}())},function(t,r,n){function e(t,r,n,e){return n="function"==typeof n?i(n,e,3):void 0,o(t,u(r),n)}var o=n(21),i=n(7),u=n(24);t.exports=e},function(t,r,n){function e(t){return o(t)&&t!=+t}var o=n(32);t.exports=e},function(t,r){function n(t){return null===t}t.exports=n},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(3),i="[object RegExp]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r){function n(t){return void 0===t}t.exports=n},function(t,r){function n(t,r){return r>t}t.exports=n},function(t,r){function n(t,r){return r>=t}t.exports=n},function(t,r,n){function e(t){var r=t?i(t):0;return u(r)?r?o(t):[]:c(t)}var o=n(15),i=n(23),u=n(5),c=n(85);t.exports=e},function(t,r,n){function e(t){return o(t,i(t))}var o=n(17),i=n(14);t.exports=e},function(t,r,n){function e(t){t=i(t);for(var r=-1,n=o(t),e=n.length,u=Array(e);++r<e;){var c=n[r];u[r]=[c,t[c]]}return u}var o=n(6),i=n(4);t.exports=e},function(t,r,n){function e(t){return o(t,i(t))}var o=n(52),i=n(6);t.exports=e},function(t,r,n){function e(t){return u(t)?o(t):i(t)}var o=n(22),i=n(49),u=n(26);t.exports=e},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t,r,n){if(t){r(t);var e=n(t);if(e)for(var i=e.length,u=0;i>u;u++)o(e[u],r,n)}}function i(t,r){var n=null;return o(t,function(t){t.name===r&&(n=t)},function(t){return t.children}),n}function u(t,r,n){if(!s.default(t))return{};n=n||{name:r,children:[]};var e=i(n,r);return null===e?{}:(v.default(t,function(t,r){var o={name:r};f.default(t)||s.default(t)?(o.children=[],f.default(t)&&0!==t.length&&t.forEach(function(t,n){return o.children.push(c({name:r+"Child"+n},t))})):o=c({},o,{value:t}),e.children.push(o),u(t,r,n)}),n)}Object.defineProperty(r,"__esModule",{value:!0});var c=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t};r.default=u;var a=n(2),f=e(a),l=n(13),s=e(l),p=n(35),v=e(p);t.exports=r.default}])}); | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):"object"==typeof exports?exports["d3-state-visualizer"]=r():t["d3-state-visualizer"]=r()}(this,function(){return function(t){function r(e){if(n[e])return n[e].exports;var o=n[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var n={};return r.m=t,r.c=n,r.p="",r(0)}([function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(r,"__esModule",{value:!0});var o=n(37),i=e(o),u=n(38),c=e(u);r.default={forceGraph:i.default,tree:c.default},t.exports=r.default},function(t,r){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,r,n){var e=n(25),o=n(5),i=n(1),u="[object Array]",c=Object.prototype,a=c.toString,f=e(Array,"isArray"),l=f||function(t){return i(t)&&o(t.length)&&a.call(t)==u};t.exports=l},function(t,r){function n(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=n},function(t,r,n){function e(t){return o(t)?t:Object(t)}var o=n(3);t.exports=e},function(t,r){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&e>=t}var e=9007199254740991;t.exports=n},function(t,r,n){var e=n(25),o=n(9),i=n(3),u=n(63),c=e(Object,"keys"),a=c?function(t){var r=null==t?void 0:t.constructor;return"function"==typeof r&&r.prototype===t||"function"!=typeof t&&o(t)?u(t):i(t)?c(t):[]}:u;t.exports=a},function(t,r,n){function e(t,r,n){if("function"!=typeof t)return o;if(void 0===r)return t;switch(n){case 1:return function(n){return t.call(r,n)};case 3:return function(n,e,o){return t.call(r,n,e,o)};case 4:return function(n,e,o,i){return t.call(r,n,e,o,i)};case 5:return function(n,e,o,i,u){return t.call(r,n,e,o,i,u)}}return function(){return t.apply(r,arguments)}}var o=n(36);t.exports=e},function(t,r,n){function e(t){return i(t)&&o(t)&&c.call(t,"callee")&&!a.call(t,"callee")}var o=n(9),i=n(1),u=Object.prototype,c=u.hasOwnProperty,a=u.propertyIsEnumerable;t.exports=e},function(t,r,n){function e(t){return null!=t&&i(o(t))}var o=n(23),i=n(5);t.exports=e},function(t,r,n){function e(t,r,n,c,a,f){return t===r?!0:null==t||null==r||!i(t)&&!u(r)?t!==t&&r!==r:o(t,r,e,n,c,a,f)}var o=n(46),i=n(3),u=n(1);t.exports=e},function(t,r){function n(t,r){return t="number"==typeof t||e.test(t)?+t:-1,r=null==r?o:r,t>-1&&t%1==0&&r>t}var e=/^\d+$/,o=9007199254740991;t.exports=n},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(3),i="[object Function]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){var r;if(!u(t)||l.call(t)!=c||i(t)||!f.call(t,"constructor")&&(r=t.constructor,"function"==typeof r&&!(r instanceof r)))return!1;var n;return o(t,function(t,r){n=r}),void 0===n||f.call(t,n)}var o=n(45),i=n(8),u=n(1),c="[object Object]",a=Object.prototype,f=a.hasOwnProperty,l=a.toString;t.exports=e},function(t,r,n){function e(t){if(null==t)return[];a(t)||(t=Object(t));var r=t.length;r=r&&c(r)&&(i(t)||o(t))&&r||0;for(var n=t.constructor,e=-1,f="function"==typeof n&&n.prototype===t,s=Array(r),p=r>0;++e<r;)s[e]=e+"";for(var v in t)p&&u(v,r)||"constructor"==v&&(f||!l.call(t,v))||s.push(v);return s}var o=n(8),i=n(2),u=n(11),c=n(5),a=n(3),f=Object.prototype,l=f.hasOwnProperty;t.exports=e},function(t,r){function n(t,r){var n=-1,e=t.length;for(r||(r=Array(e));++n<e;)r[n]=t[n];return r}t.exports=n},function(t,r,n){function e(t,r,n,d,y,h,b){var g;if(n&&(g=y?n(t,d,y):n(t)),void 0!==g)return g;if(!p(t))return t;var j=s(t);if(j){if(g=a(t),!r)return o(t,g)}else{var A=R.call(t),O=A==x;if(A!=m&&A!=v&&(!O||y))return D[A]?f(t,A,r):y?t:{};if(g=l(O?{}:t),!r)return u(g,t)}h||(h=[]),b||(b=[]);for(var _=h.length;_--;)if(h[_]==t)return b[_];return h.push(t),b.push(g),(j?i:c)(t,function(o,i){g[i]=e(o,r,n,i,t,h,b)}),g}var o=n(15),i=n(41),u=n(43),c=n(19),a=n(59),f=n(60),l=n(61),s=n(2),p=n(3),v="[object Arguments]",d="[object Array]",y="[object Boolean]",h="[object Date]",b="[object Error]",x="[object Function]",g="[object Map]",j="[object Number]",m="[object Object]",A="[object RegExp]",O="[object Set]",_="[object String]",w="[object WeakMap]",E="[object ArrayBuffer]",M="[object Float32Array]",S="[object Float64Array]",C="[object Int8Array]",P="[object Int16Array]",B="[object Int32Array]",k="[object Uint8Array]",N="[object Uint8ClampedArray]",U="[object Uint16Array]",F="[object Uint32Array]",D={};D[v]=D[d]=D[E]=D[y]=D[h]=D[M]=D[S]=D[C]=D[P]=D[B]=D[j]=D[m]=D[A]=D[_]=D[k]=D[N]=D[U]=D[F]=!0,D[b]=D[x]=D[g]=D[O]=D[w]=!1;var I=Object.prototype,R=I.toString;t.exports=e},function(t,r){function n(t,r,n){n||(n={});for(var e=-1,o=r.length;++e<o;){var i=r[e];n[i]=t[i]}return n}t.exports=n},function(t,r,n){var e=n(54),o=e();t.exports=o},function(t,r,n){function e(t,r){return o(t,r,i)}var o=n(18),i=n(6);t.exports=e},function(t,r,n){function e(t,r,n){if(null!=t){void 0!==n&&n in o(t)&&(r=[n]);for(var e=0,i=r.length;null!=t&&i>e;)t=t[r[e++]];return e&&e==i?t:void 0}}var o=n(4);t.exports=e},function(t,r,n){function e(t,r,n){var e=r.length,u=e,c=!n;if(null==t)return!u;for(t=i(t);e--;){var a=r[e];if(c&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++e<u;){a=r[e];var f=a[0],l=t[f],s=a[1];if(c&&a[2]){if(void 0===l&&!(f in t))return!1}else{var p=n?n(l,s,f):void 0;if(!(void 0===p?o(s,l,n,!0):p))return!1}}return!0}var o=n(10),i=n(4);t.exports=e},function(t,r){function n(t){return function(r){return null==r?void 0:r[t]}}t.exports=n},function(t,r,n){var e=n(22),o=e("length");t.exports=o},function(t,r,n){function e(t){for(var r=i(t),n=r.length;n--;)r[n][2]=o(r[n][1]);return r}var o=n(27),i=n(84);t.exports=e},function(t,r,n){function e(t,r){var n=null==t?void 0:t[r];return o(n)?n:void 0}var o=n(31);t.exports=e},function(t,r,n){function e(t,r){var n=typeof t;if("string"==n&&c.test(t)||"number"==n)return!0;if(o(t))return!1;var e=!u.test(t);return e||null!=r&&t in i(r)}var o=n(2),i=n(4),u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,c=/^\w*$/;t.exports=e},function(t,r,n){function e(t){return t===t&&!o(t)}var o=n(3);t.exports=e},function(t,r,n){function e(t){if(i(t))return t;var r=[];return o(t).replace(u,function(t,n,e,o){r.push(e?o.replace(c,"$1"):n||t)}),r}var o=n(51),i=n(2),u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,c=/\\(\\)?/g;t.exports=e},function(t,r,n){t.exports={clone:n(64),cloneDeep:n(65),eq:n(66),gt:n(67),gte:n(68),isArguments:n(8),isArray:n(2),isBoolean:n(69),isDate:n(70),isElement:n(71),isEmpty:n(72),isEqual:n(30),isError:n(73),isFinite:n(74),isFunction:n(12),isMatch:n(75),isNaN:n(76),isNative:n(31),isNull:n(77),isNumber:n(32),isObject:n(3),isPlainObject:n(13),isRegExp:n(78),isString:n(33),isTypedArray:n(34),isUndefined:n(79),lt:n(80),lte:n(81),toArray:n(82),toPlainObject:n(83)}},function(t,r,n){function e(t,r,n,e){n="function"==typeof n?i(n,e,3):void 0;var u=n?n(t,r):void 0;return void 0===u?o(t,r,n):!!u}var o=n(10),i=n(7);t.exports=e},function(t,r,n){function e(t){return null==t?!1:o(t)?l.test(a.call(t)):i(t)&&u.test(t)}var o=n(12),i=n(1),u=/^\[object .+?Constructor\]$/,c=Object.prototype,a=Function.prototype.toString,f=c.hasOwnProperty,l=RegExp("^"+a.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=e},function(t,r,n){function e(t){return"number"==typeof t||o(t)&&c.call(t)==i}var o=n(1),i="[object Number]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return"string"==typeof t||o(t)&&c.call(t)==i}var o=n(1),i="[object String]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return i(t)&&o(t.length)&&!!C[B.call(t)]}var o=n(5),i=n(1),u="[object Arguments]",c="[object Array]",a="[object Boolean]",f="[object Date]",l="[object Error]",s="[object Function]",p="[object Map]",v="[object Number]",d="[object Object]",y="[object RegExp]",h="[object Set]",b="[object String]",x="[object WeakMap]",g="[object ArrayBuffer]",j="[object Float32Array]",m="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",_="[object Int32Array]",w="[object Uint8Array]",E="[object Uint8ClampedArray]",M="[object Uint16Array]",S="[object Uint32Array]",C={};C[j]=C[m]=C[A]=C[O]=C[_]=C[w]=C[E]=C[M]=C[S]=!0,C[u]=C[c]=C[g]=C[a]=C[f]=C[l]=C[s]=C[p]=C[v]=C[d]=C[y]=C[h]=C[b]=C[x]=!1;var P=Object.prototype,B=P.toString;t.exports=e},function(t,r,n){var e=n(55),o=e();t.exports=o},function(t,r){function n(t){return t}t.exports=n},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var r=0,n=Array(t.length);r<t.length;r++)n[r]=t[r];return n}return Array.from(t)}Object.defineProperty(r,"__esModule",{value:!0});var i=n(2),u=e(i);r.default=function(){return function(t,r,n){var e=n.data,i=void 0===e?[]:e,c=n.id,a=void 0===c?"d3svg":c,f=n.style,l=void 0===f?"":f,s=n.size,p=void 0===s?1e3:s,v=n.aspectRatio,d=void 0===v?1:v,y=n.charge,h=void 0===y?-1:y,b=n.linkDistance,x=void 0===b?1:b,g=n.maxNodeSize,j=void 0===g?50:g,m={top:p/100,right:p/50,bottom:p/100,left:40},A=p-m.left-m.right,O=p*d-m.top-m.bottom,_=p,w=p*d,E=t.select(r),M=E.append("svg").attr({id:a,style:l,width:_,viewBox:"0 0 "+_+" "+w,preserveAspectRatio:"xMinYMin slice"}).append("g").attr({transform:"translate("+m.left+", "+m.top+")"}),S=M.selectAll("circle"),C=t.layout.force().size([A,O]).nodes(i).linkDistance(x).charge(h).on("tick",function(){S.attr({cx:function(t){return Math.round(t.x)},cy:function(t){return Math.round(t.y)}})}),P=C.nodes();return function(r){r&&(P=[].concat(o(P),o(r)),C.nodes(P)),S=S.data(P),S.enter().insert("circle").attr({r:function(t){var r=t[t.key];if(!u.default(r))return 10;var n=10+2*t[t.key].length;return n>j?j:n},fill:function(t){return u.default(t[t.key])?"blue":"red"}}).on({mouseover:function(){t.select(this).style("fill-opacity","0.5")},mouseout:function(){t.select(this).style("fill-opacity","1")}}).call(C.drag),S.exit().remove(),C.start()}}},t.exports=r.default},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var r=0,n=Array(t.length);r<t.length;r++)n[r]=t[r];return n}return Array.from(t)}Object.defineProperty(r,"__esModule",{value:!0});var i=n(29),u=n(35),c=(e(u),n(87)),a=e(c),f=n(39);r.default=function(){return function(t,r,n){var e=n.id,u=void 0===e?"d3svg":e,c=n.style,l=void 0===c?"":c,s=n.size,p=void 0===s?1e3:s,v=n.aspectRatio,d=void 0===v?1:v,y=n.isSorted,h=void 0===y?!1:y,b=n.widthBetweenBranchCoeff,x=void 0===b?1:b,g=n.heightBetweenNodesCoeff,j=void 0===g?1:g,m=n.transitionDuration,A=void 0===m?750:m,O={top:p/100,right:p/50,bottom:p/100,left:40},_=p-O.left-O.right,w=p*d-O.top-O.bottom,E=p,M=p*d,S=t.select(r),C=S.append("svg").attr({id:u,style:l,width:E,viewBox:"0 0 "+E+" "+M,preserveAspectRatio:"xMinYMin slice"}).append("g").attr({transform:"translate("+O.left+", "+O.top+")"}),P=t.layout.tree().size([_,w]),B=void 0;return h&&P.sort(function(t,r){return r.name.toLowerCase()<t.name.toLowerCase()?1:-1}),function(){function r(n){var e=t.svg.diagonal().projection(function(t){return[t.y,t.x]}),i=Math.max.apply(Math,o(f.getNodeGroupByDepthCount(B)));P=P.size([25*i*x,_]);var a=P.nodes(B),l=P.links(a);a.forEach(function(t){return t.y=t.depth*(7*c*j)});var s=C.selectAll("g.node").data(a,function(t){return t.id||(t.id=++u)}),p=s.enter().append("g").attr({"class":"node",transform:function(t){return"translate("+n.y0+","+n.x0+")"}}).on({click:function(n){t.event.defaultPrevented||r(f.toggleChildren(n))}});p.append("circle").attr({"class":"nodeCircle"}),p.append("text").attr({"class":"nodeText",dy:".35em"}).style({"fill-opacity":0}).text(function(t){return t.name}),s.select("text").attr({x:function(t){return t.children||t._children?-10:10},"text-anchor":function(t){return t.children||t._children?"end":"start"}}).text(function(t){return t.name}),s.select("circle.nodeCircle").attr({r:4.5}).style({fill:function(t){return t._children?"lightsteelblue":t.children?"#fff":"#ccc"}});var v=s.transition().duration(A).attr({transform:function(t){return"translate("+t.y+","+t.x+")"}});v.select("text").style("fill-opacity",1);var d=s.exit().transition().duration(A).attr({transform:function(t){return"translate("+n.y+","+n.x+")"}}).remove();d.select("circle").attr("r",0),d.select("text").style("fill-opacity",0);var y=C.selectAll("path.link").data(l,function(t){return t.target.id});y.enter().insert("path","g").attr({"class":"link",d:function(t){var r={x:n.x0,y:n.y0};return e({source:r,target:r})}}),y.transition().duration(A).attr({d:e}),y.exit().transition().duration(A).attr({d:function(t){var r={x:n.x,y:n.y};return e({source:r,target:r})}}).remove(),a.forEach(function(t){t.x0=t.x,t.y0=t.y})}var e=arguments.length<=0||void 0===arguments[0]?n.state||n.tree:arguments[0];if(B=n.tree?e:a.default(e,"state"),i.isEmpty(B)||!B.name)throw new Error("Cannot render tree chart: empty data.");var u=0,c=0;f.visit(B,function(t){return c=Math.max(t.name.length,c)},function(t){return t.children&&t.children.length>0?t.children:null}),B.x0=w/2,B.y0=0,r(B)}}},t.exports=r.default},function(t,r,n){"use strict";function e(t){t.children&&(t._children=t.children,t._children.forEach(e),t.children=null)}function o(t){t._children&&(t.children=t._children,t.children.forEach(o),t._children=null)}function i(t){return t.children?(t._children=t.children,t.children=null):t._children&&(t.children=t._children,t._children=null),t}function u(t,r,n){if(t){r(t);var e=n(t);if(e)for(var o=e.length,i=0;o>i;i++)u(e[i],r,n)}}function c(t){var r=[1],n=function e(t){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return t.children&&0!==t.children.length?(r.length<=n+1&&r.push(0),r[n+1]+=t.children.length,void t.children.forEach(function(t){e(t,n+1)})):0};return n(t),r}Object.defineProperty(r,"__esModule",{value:!0}),r.collapseChildren=e,r.expandChildren=o,r.toggleChildren=i,r.visit=u,r.getNodeGroupByDepthCount=c;n(29)},function(t,r){function n(t){var r=t?t.length:0;return r?t[r-1]:void 0}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=t.length;++n<e&&r(t[n],n,t)!==!1;);return t}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=t.length;++n<e;)if(r(t[n],n,t))return!0;return!1}t.exports=n},function(t,r,n){function e(t,r){return null==r?t:o(r,i(r),t)}var o=n(17),i=n(6);t.exports=e},function(t,r,n){function e(t,r,n){var e=typeof t;return"function"==e?void 0===r?t:u(t,r,n):null==t?c:"object"==e?o(t):void 0===r?a(t):i(t,r)}var o=n(47),i=n(48),u=n(7),c=n(36),a=n(86);t.exports=e},function(t,r,n){function e(t,r){return o(t,r,i)}var o=n(18),i=n(14);t.exports=e},function(t,r,n){function e(t,r,n,e,p,y,h){var b=c(t),x=c(r),g=l,j=l;b||(g=d.call(t),g==f?g=s:g!=s&&(b=a(t))),x||(j=d.call(r),j==f?j=s:j!=s&&(x=a(r)));var m=g==s,A=j==s,O=g==j;if(O&&!b&&!m)return i(t,r,g);if(!p){var _=m&&v.call(t,"__wrapped__"),w=A&&v.call(r,"__wrapped__");if(_||w)return n(_?t.value():t,w?r.value():r,e,p,y,h)}if(!O)return!1;y||(y=[]),h||(h=[]);for(var E=y.length;E--;)if(y[E]==t)return h[E]==r;y.push(t),h.push(r);var M=(b?o:u)(t,r,n,e,p,y,h);return y.pop(),h.pop(),M}var o=n(56),i=n(57),u=n(58),c=n(2),a=n(34),f="[object Arguments]",l="[object Array]",s="[object Object]",p=Object.prototype,v=p.hasOwnProperty,d=p.toString;t.exports=e},function(t,r,n){function e(t){var r=i(t);if(1==r.length&&r[0][2]){var n=r[0][0],e=r[0][1];return function(t){return null==t?!1:t[n]===e&&(void 0!==e||n in u(t))}}return function(t){return o(t,r)}}var o=n(21),i=n(24),u=n(4);t.exports=e},function(t,r,n){function e(t,r){var n=c(t),e=a(t)&&f(r),v=t+"";return t=p(t),function(c){if(null==c)return!1;var a=v;if(c=s(c),(n||!e)&&!(a in c)){if(c=1==t.length?c:o(c,u(t,0,-1)),null==c)return!1;a=l(t),c=s(c)}return c[a]===r?void 0!==r||a in c:i(r,c[a],void 0,!0)}}var o=n(20),i=n(10),u=n(50),c=n(2),a=n(26),f=n(27),l=n(40),s=n(4),p=n(28);t.exports=e},function(t,r,n){function e(t){var r=t+"";return t=i(t),function(n){return o(n,t,r)}}var o=n(20),i=n(28);t.exports=e},function(t,r){function n(t,r,n){var e=-1,o=t.length;r=null==r?0:+r||0,0>r&&(r=-r>o?0:o+r),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var i=Array(o);++e<o;)i[e]=t[e+r];return i}t.exports=n},function(t,r){function n(t){return null==t?"":t+""}t.exports=n},function(t,r){function n(t,r){for(var n=-1,e=r.length,o=Array(e);++n<e;)o[n]=t[r[n]];return o}t.exports=n},function(t,r){(function(r){function n(t){var r=new e(t.byteLength),n=new o(r);return n.set(new o(t)),r}var e=r.ArrayBuffer,o=r.Uint8Array;t.exports=n}).call(r,function(){return this}())},function(t,r,n){function e(t){return function(r,n,e){for(var i=o(r),u=e(r),c=u.length,a=t?c:-1;t?a--:++a<c;){var f=u[a];if(n(i[f],f,i)===!1)break}return r}}var o=n(4);t.exports=e},function(t,r,n){function e(t){return function(r,n,e){var u={};return n=o(n,e,3),i(r,function(r,e,o){var i=n(r,e,o);e=t?i:e,r=t?r:i,u[e]=r}),u}}var o=n(44),i=n(19);t.exports=e},function(t,r,n){function e(t,r,n,e,i,u,c){var a=-1,f=t.length,l=r.length;if(f!=l&&!(i&&l>f))return!1;for(;++a<f;){var s=t[a],p=r[a],v=e?e(i?p:s,i?s:p,a):void 0;if(void 0!==v){if(v)continue;return!1}if(i){if(!o(r,function(t){return s===t||n(s,t,e,i,u,c)}))return!1}else if(s!==p&&!n(s,p,e,i,u,c))return!1}return!0}var o=n(42);t.exports=e},function(t,r){function n(t,r,n){switch(n){case e:case o:return+t==+r;case i:return t.name==r.name&&t.message==r.message;case u:return t!=+t?r!=+r:t==+r;case c:case a:return t==r+""}return!1}var e="[object Boolean]",o="[object Date]",i="[object Error]",u="[object Number]",c="[object RegExp]",a="[object String]";t.exports=n},function(t,r,n){function e(t,r,n,e,i,c,a){var f=o(t),l=f.length,s=o(r),p=s.length;if(l!=p&&!i)return!1;for(var v=l;v--;){var d=f[v];if(!(i?d in r:u.call(r,d)))return!1}for(var y=i;++v<l;){d=f[v];var h=t[d],b=r[d],x=e?e(i?b:h,i?h:b,d):void 0;if(!(void 0===x?n(h,b,e,i,c,a):x))return!1;y||(y="constructor"==d)}if(!y){var g=t.constructor,j=r.constructor;if(g!=j&&"constructor"in t&&"constructor"in r&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j))return!1}return!0}var o=n(6),i=Object.prototype,u=i.hasOwnProperty;t.exports=e},function(t,r){function n(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&o.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var e=Object.prototype,o=e.hasOwnProperty;t.exports=n},function(t,r,n){function e(t,r,n){var e=t.constructor;switch(r){case l:return o(t);case i:case u:return new e(+t);case s:case p:case v:case d:case y:case h:case b:case x:case g:var m=t.buffer;return new e(n?o(m):m,t.byteOffset,t.length);case c:case f:return new e(t);case a:var A=new e(t.source,j.exec(t));A.lastIndex=t.lastIndex}return A}var o=n(53),i="[object Boolean]",u="[object Date]",c="[object Number]",a="[object RegExp]",f="[object String]",l="[object ArrayBuffer]",s="[object Float32Array]",p="[object Float64Array]",v="[object Int8Array]",d="[object Int16Array]",y="[object Int32Array]",h="[object Uint8Array]",b="[object Uint8ClampedArray]",x="[object Uint16Array]",g="[object Uint32Array]",j=/\w*$/;t.exports=e},function(t,r){function n(t){var r=t.constructor;return"function"==typeof r&&r instanceof r||(r=Object),new r}t.exports=n},function(t,r,n){function e(t,r,n){if(!u(n))return!1;var e=typeof r;if("number"==e?o(n)&&i(r,n.length):"string"==e&&r in n){var c=n[r];return t===t?t===c:c!==c}return!1}var o=n(9),i=n(11),u=n(3);t.exports=e},function(t,r,n){function e(t){for(var r=a(t),n=r.length,e=n&&t.length,f=!!e&&c(e)&&(i(t)||o(t)),s=-1,p=[];++s<n;){var v=r[s];(f&&u(v,e)||l.call(t,v))&&p.push(v)}return p}var o=n(8),i=n(2),u=n(11),c=n(5),a=n(14),f=Object.prototype,l=f.hasOwnProperty;t.exports=e},function(t,r,n){function e(t,r,n,e){return r&&"boolean"!=typeof r&&u(t,r,n)?r=!1:"function"==typeof r&&(e=n,n=r,r=!1),"function"==typeof n?o(t,r,i(n,e,3)):o(t,r)}var o=n(16),i=n(7),u=n(62);t.exports=e},function(t,r,n){function e(t,r,n){return"function"==typeof r?o(t,!0,i(r,n,3)):o(t,!0)}var o=n(16),i=n(7);t.exports=e},function(t,r,n){t.exports=n(30)},function(t,r){function n(t,r){return t>r}t.exports=n},function(t,r){function n(t,r){return t>=r}t.exports=n},function(t,r,n){function e(t){return t===!0||t===!1||o(t)&&c.call(t)==i}var o=n(1),i="[object Boolean]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(1),i="[object Date]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r,n){function e(t){return!!t&&1===t.nodeType&&o(t)&&!i(t)}var o=n(1),i=n(13);t.exports=e},function(t,r,n){function e(t){return null==t?!0:u(t)&&(i(t)||f(t)||o(t)||a(t)&&c(t.splice))?!t.length:!l(t).length}var o=n(8),i=n(2),u=n(9),c=n(12),a=n(1),f=n(33),l=n(6);t.exports=e},function(t,r,n){function e(t){return o(t)&&"string"==typeof t.message&&c.call(t)==i}var o=n(1),i="[object Error]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r){(function(r){function n(t){return"number"==typeof t&&e(t)}var e=r.isFinite;t.exports=n}).call(r,function(){return this}())},function(t,r,n){function e(t,r,n,e){return n="function"==typeof n?i(n,e,3):void 0,o(t,u(r),n)}var o=n(21),i=n(7),u=n(24);t.exports=e},function(t,r,n){function e(t){return o(t)&&t!=+t}var o=n(32);t.exports=e},function(t,r){function n(t){return null===t}t.exports=n},function(t,r,n){function e(t){return o(t)&&c.call(t)==i}var o=n(3),i="[object RegExp]",u=Object.prototype,c=u.toString;t.exports=e},function(t,r){function n(t){return void 0===t}t.exports=n},function(t,r){function n(t,r){return r>t}t.exports=n},function(t,r){function n(t,r){return r>=t}t.exports=n},function(t,r,n){function e(t){var r=t?i(t):0;return u(r)?r?o(t):[]:c(t)}var o=n(15),i=n(23),u=n(5),c=n(85);t.exports=e},function(t,r,n){function e(t){return o(t,i(t))}var o=n(17),i=n(14);t.exports=e},function(t,r,n){function e(t){t=i(t);for(var r=-1,n=o(t),e=n.length,u=Array(e);++r<e;){var c=n[r];u[r]=[c,t[c]]}return u}var o=n(6),i=n(4);t.exports=e},function(t,r,n){function e(t){return o(t,i(t))}var o=n(52),i=n(6);t.exports=e},function(t,r,n){function e(t){return u(t)?o(t):i(t)}var o=n(22),i=n(49),u=n(26);t.exports=e},function(t,r,n){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}function o(t,r,n){if(t){r(t);var e=n(t);if(e)for(var i=e.length,u=0;i>u;u++)o(e[u],r,n)}}function i(t,r){var n=null;return o(t,function(t){t.name===r&&(n=t)},function(t){return t.children}),n}function u(t,r,n){if(!s.default(t))return{};n=n||{name:r,children:[]};var e=i(n,r);return null===e?{}:(v.default(t,function(t,r){var o={name:r};f.default(t)||s.default(t)?(o.children=[],f.default(t)&&0!==t.length&&t.forEach(function(t,n){return o.children.push(c({name:r+"Child"+n},t))})):o=c({},o,{value:t}),e.children.push(o),u(t,r,n)}),n)}Object.defineProperty(r,"__esModule",{value:!0});var c=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t};r.default=u;var a=n(2),f=e(a),l=n(13),s=e(l),p=n(35),v=e(p);t.exports=r.default}])}); |
@@ -74,5 +74,10 @@ 'use strict'; | ||
return function renderChart() { | ||
var nextState = arguments.length <= 0 || arguments[0] === undefined ? props.state : arguments[0]; | ||
var nextState = arguments.length <= 0 || arguments[0] === undefined ? props.state || props.tree : arguments[0]; | ||
data = (0, _map2tree2['default'])(nextState, 'state'); | ||
data = !props.tree ? (0, _map2tree2['default'])(nextState, 'state') : nextState; | ||
if ((0, _lodashLang.isEmpty)(data) || !data.name) { | ||
throw new Error('Cannot render tree chart: empty data.'); | ||
} | ||
var nodeIndex = 0; | ||
@@ -79,0 +84,0 @@ var maxLabelLength = 0; |
{ | ||
"name": "d3-state-visualizer", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Visualize your app state with a range of reusable charts", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
149136
3684