text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(){function t(){var t=Math.min(e.width,e.height)/3,i=0,l=a.append("svg").attr("width",e.width).attr("height",e.height),c=d3.arc().innerRadius(t-d).outerRadius(t),u=d3.pie().value(function(t){return t.employees}).padAngle(.01).sort(null),o=l.append("g").attr("class","group").attr("transform","translate("+e.width/2+","+e.height/2+")").selectAll(".arc").data(u(r)).enter().append("g").attr("class","arc").attr("id",function(){return"arc-"+i++});return l.select(".group").append("text").attr("transform","translate(0,10)").classed("total-text",!0).attr("text-anchor","middle").text(function(t){return d3.sum(r,function(t){return t.employees})}),o.append("path").attr("d",c).style("fill",function(t){return n(t.data.department)}),l}var e={width:200,height:200,margin:20},n=null,r=[],a=null,d=10;return t.renderLegends=function(t,e,r){function a(t,e){var r=d3.select(e)._groups[0][0].clientWidth,a=d3.select(e)._groups[0][0].clientHeight,d=Math.min(r,a)/4,i=7,l=document.createElement("div"),c=d3.select(l).attr("width",r).attr("height",a).append("svg").attr("width",r).attr("height",a-i);return c.append("g").append("circle").classed("legend-circle",!0).datum(t).attr("cx",10).attr("cy",10).attr("r",d).style("fill",function(t){return n(t.department)}).attr("legend-id",function(t){return o++}).on("click",function(){var t=d3.select("#arc-"+d3.select(this).attr("legend-id"));t.style("opacity",.2),setTimeout(function(){t.style("opacity",1)},1e3)}),l}var d=[];d.push(""),d=d.concat(d3.keys(e[0]));var i=t.append("table").classed("legends",!0),l=i.append("thead"),c=i.append("tbody");l.append("tr").selectAll("th").data(d).enter().append("th").text(function(t){return r[t]});var u=c.selectAll("tr").data(e).enter().append("tr");u.selectAll("td").data(function(t){return d.map(function(e){return{column:e,value:t[e]}})}).enter().append("td").html(function(t){return t.value});var o=0;u.each(function(t,e){d3.select(this).select("td").classed("sl-circle-cell",!0).append(function(t){return a(t,this)})})},t.targetEl=function(e){return arguments.length?(a=e,t):a},t.colorScale=function(e){return arguments.length?(n=d3.scaleOrdinal(e),t):n},t.data=function(e){return arguments.length?(r=e,t):r},t.height=function(n){return arguments.length?(e.height=n,t):e.height},t.width=function(n){return arguments.length?(e.width=n,t):e.width},t}t.donutChart=e,Object.defineProperty(t,"__esModule",{value:!0})});