-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc906820a.js
1 lines (1 loc) · 2.03 KB
/
c906820a.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{sVx7:function(x,D,t){"use strict";t.r(D),t.d(D,"default",function(){return I});var o=t("nKUr"),B=t.n(o),P=t("c1Ei"),i=t.n(P),O=t("5Tp6"),b=t("XKWP"),U=t("N7Kx"),y=t("kFHX"),C=t("4jIl"),W=t("q1tI"),A=t.n(W),r=t("VphZ"),I=function(K){Object(y.a)(a,K);var j=Object(C.a)(a);function a(){var s;Object(b.a)(this,a);for(var d=arguments.length,c=new Array(d),u=0;u<d;u++)c[u]=arguments[u];return s=j.call.apply(j,[this].concat(c)),s.svgWidth=1e3,s.svgHeight=500,s.drawSvg=Object(O.a)(i.a.mark(function _(){var m,M,f,h,g,v,E,p;return i.a.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return m=r.select(".hierarchy-test"),m.selectAll("svg").remove(),M=m.append("svg").attr("width",s.svgWidth).attr("height",s.svgHeight).style("border","1px solid black"),l.next=5,r.json("./hierarchy/tree-map.json");case 5:f=l.sent,h=r.hierarchy(f).sum(function(e){var n=e.value;return n}).sort(function(e,n){return n.value-e.value}),g=r.partition().size([s.svgWidth,s.svgHeight]),g(h),v=h.descendants(),E=M.selectAll("g").data(v),p=E.enter().append("g").attr("transform",function(e){var n=e.x0,T=e.y0;return"translate(".concat(n,",").concat(T,")")}),p.append("rect").style("fill",function(e,n){return r.interpolatePiYG(n/v.length)}).style("stroke","black").attr("opacity",.5).transition().duration(500).ease(r.easeCircleIn).attr("x",0).attr("y",0).attr("width",function(e){return e.x1-e.x0}).attr("height",function(e){return e.y1-e.y0}),p.append("text").attr("dx",10).attr("dy",20).text(function(e){return e.data.name}),E.exit().remove();case 15:case"end":return l.stop()}},_)})),s}return Object(U.a)(a,[{key:"componentDidMount",value:function(){var s=Object(O.a)(i.a.mark(function c(){return i.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,this.drawSvg();case 2:case"end":return _.stop()}},c,this)}));function d(){return s.apply(this,arguments)}return d}()},{key:"render",value:function(){return Object(o.jsx)(o.Fragment,{children:Object(o.jsx)("div",{className:"hierarchy-test"})})}}]),a}(A.a.Component)}}]);