/**
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */
!function(t,e){var n=e();“undefined”!=typeof define&&define.amd&&define(n),t.Bionya=n}(this,function(){var t,e,n;return function®{function a(t,e){return v.call(t,e)}function i(t,e){var n,r,a,i,o,s,l,u,c,p,d,f=e&&e.split(“/”),h=_.map,g=h&&h||{};if(t&&“.”===t.charAt(0))if(e){for(f=f.slice(0,f.length-1),t=t.split(“/”),o=t.length-1,_.nodeIdCompat&&k.test(t)&&(t=t.replace(k,“”)),t=f.concat(t),c=0;co.width/2
“,”o.height/2
“)”),g=“clip”+o.pane_uuid;h.append(“clipPath”).attr(“id”,g).append(“rect”).attr({x:-o.width/2,y:-o.height/2,width:o.width,height:o.height}),h.attr(“clip-path”,“url(#”g
“)”).style(“z-index”,o.z_index);var x=o.pane_uuid+“group”;h.append(“g”).selectAll(“g”).data(f.groups).enter().append(“g”).attr(“class”,“group_arcs”).append(“path”).style(“fill”,function(t){return d(t.index)}).style(“stroke”,function(t){return d(t.index)}).attr(“d”,d3.svg.arc().innerRadius(o.extra.inner_radius).outerRadius(o.extra.outer_radius)).attr(“id”,function(t,e){return x+e}),h.selectAll(“.group_arcs”).append(“text”).attr(“x”,6).attr(“dy”,15).append(“textPath”).attr(“xhref”,function(t,e){return“#”+x+e}).text(function(t,e){return u}).attr(“fill”,o.extra.text_color).attr(“font-size”,o.extra.text_size),o.extra.chord&&h.append(“g”).selectAll(“path”).data(f.chords).enter().append(“path”).attr(“d”,d3.svg.chord().radius(o.extra.inner_radius)).style(“fill”,“#fff”),n.init(o.extra.inner_radius,o.extra.outer_radius,o.extra.inner_num,o.extra.outer_num),h.selectAll(“.group_arcs”).each(function(t,e){n.addGroup(u,c[u],t.startAngle,t.endAngle)});a.flatten(a.map(c,function(t,e){return a.map(t,function(t){return n.get(0,e,t)})}));o.zoom&&e.call(d3.behavior.zoom().scaleExtent(o.zoom_range).on(“zoom”,function(){var t=d3.event.translate,n=d3.event.scale;e.select(“.context_child”).attr(“transform”,“translate(”t
“) scale(”n
“)”),t+=(n-1)*o.width/2,t+=(n-1)*o.height/2,h.select(“g”).attr(“transform”,“translate(”t
“) scale(”n
“)”)}))}return e}),n(“diagrams/arc”,,function(t){function e(t,e,a,i){var o={range:,width:.5,color:,fill_by:null,x:null,y:null,layer:1,axis:!0};return arguments.length>3&&n.extend(o,i),this.height_scale=function(){var t=e.getHeight(o.layer);return d3.scale.linear().domain(o.range).range()}(),this.inner_radius=e.getRange(o.layer),this.model=function(){var n=e.getCenter();return t.append(“g”).attr(“transform”,“translate(”n.x
“,”n.y
“)”)}(),this.scales=e,this.df=r.getData(a),this.color_scale=d3.scale.ordinal().range(o.color),this.uuid=o.uuid,this.options=o,this}var n=t._,r=t.Manager;return e.prototype.update=function(){var t=this.scales.groups(),e=this;this.options.axis&&!function(){var t=e.height_scale.ticks(5);t.reverse().pop();var n=e.model.append(“g”).selectAll(“g”).data(t).enter().append(“g”);n.append(“circle”).attr(“fill”,“none”).attr(“stroke”,“#000”).attr(“r”,function(t){return e.inner_radius+e.height_scale(t)}),n.append(“text”).attr(“y”,function(t){return-1*(e.inner_radius+e.height_scale(t)+4)}).text(function(t){return t})}(),n.each(t,function(t,r){var a=e.df.nested_column(r,e.options.x),i=e.df.nested_column(r,e.options.y),o=function(){var t=e.options.color;if(e.options.fill_by){var r=e.options.fill_by,a=e.df.scale(r,t),i=n.zip.apply(null,n.map(e.df.column®,function(t,e){return}));return d3.scale.ordinal().domain(i).range(i)}return d3.scale.ordinal().range(t)}(),s=e.processData(t,a,i,o);e.updateModels(s)})},e.prototype.processData=function(t,e,r,a){var i=this;return n.map(e,function(e,n){var o=i.scales.get(i.options.layer,t,e);return o.height=i.height_scale(r),o.fill=a(n),o})},e.prototype.updateModels=function(t){var e=this.height_scale(0),n=this.inner_radius,r=this.scales.getWidth()*this.options.width;this.model.append(“g”).selectAll(“path”).data(t).enter().append(“path”).attr(“d”,d3.svg.arc().startAngle(function(t){return t.theta-r/2}).endAngle(function(t){return t.theta+r/2}).innerRadius(n+e).outerRadius(function(t){return n+t.height})).attr(“stroke”,function(t){return t.fill}).attr(“fill”,function(t){return t.fill})},e.prototype.getLegend=function(){},e.prototype.checkSelectedData=function(){},e}),n(“diagrams/connector”,,function(t){function e(t,e,a,i){var o={color:“#737373”,fill_by:null,from:null,to:null,shape:“circle”,stroke_width:2,size:100,shape_fill:“#fff”,shape_stroke:“#3182bd”,shape_stroke_width:2,arc_height:30,layer:0};arguments.length>3&&n.extend(o,i),this.model=function(){var n=e.getCenter();return t.append(“g”).attr(“transform”,“translate(”n.x
“,”n.y
“)”)}(),this.scales=e,this.df=r.getData(a),this.uuid=o.uuid,this.options=o}var n=t._,r=t.Manager;return e.prototype.update=function(){var t=this.df.column(this.options.from),e=this.df.column(this.options.to),n=this.processData(t,e);this.updateModels(n)},e.prototype.processData=function(t,e){var r=this.scales,a=this.options.layer,i=this.options.arc_height;return n.map(n.zip(t,e),function(t){var e=n.map(t,function(t){var e=t.split(/(.+).(.+)/),n=e,i=e,o=r.get(a,n,i);return{x:o.x,y:o.y}}),o=function(){var t=n.map(,function(t){return(e[t]+e[t])/2}),r=Math.sqrt(t*t+t*t),a=n.map(t,function(t){return t/r});return{x:a*(r-i),y:a*(r-i)}}();return[e,o,e]})},e.prototype.updateModels=function(t){var e=(this.scales,this.layer,this.options),r=this.model.selectAll(“g”).data(t).enter().append(“g”);r.append(“path”).attr(“d”,d3.svg.line().tension(.2).x(function(t){return t.x}).y(function(t){return t.y}).interpolate(“cardinal”)).attr(“fill”,“none”).attr(“stroke”,e.color).attr(“stroke-width”,e.stroke_width),r.append(“g”).selectAll(“path”).data(n.filter(n.flatten(t),function(t,e){return e%3!=1})).enter().append(“path”).attr(“d”,d3.svg.symbol().type(e.shape).size(e.size)).attr(“fill”,e.shape_fill).attr(“stroke”,e.shape_stroke).attr(“stroke-width”,e.shape_stroke_width).attr(“transform”,function(t){return“translate(”t.x
“,”t.y
“)”})},e.prototype.getLegend=function(){},e.prototype.checkSelectedData=function(){},e}),n(“diagrams/labels”,,function(t){function e(t,e,a,i){var o={color:“#000”,fill_by:null,x:null,text:null,stroke_width:4,text_size:“1em”,layer:1};arguments.length>3&&n.extend(o,i),this.model=function(){var n=e.getCenter();return t.append(“g”).attr(“transform”,“translate(”n.x
“,”n.y
“)”)}(),this.scales=e,this.df=r.getData(a),this.uuid=o.uuid,this.options=o}var n=t._,r=t.Manager;return e.prototype.update=function(){var t=this.scales.groups(),e=this;n.each(t,function(t,n){var r=e.df.nested_column(n,e.options.x),a=e.df.nested_column(n,e.options.text),i=e.processData(t,r,a);e.updateModels(i)})},e.prototype.processData=function(t,e,r){var a=this.scales,i=this.options.layer;return n.filter(n.map(n.zip(e,r),function(e){return{theta:a.get(i,t,e).theta,text:e}}),function(t){return null!=t.text&&t.text.length>0})},e.prototype.updateModels=function(t){var e=this.scales,n=this.options.layer,r=this.options,a=e.getRange(n),i=this.model.append(“g”).selectAll(“g”).data(t).enter().append(“g”).attr(“transform”,function(t){return“rotate(”+180*((t.theta-Math.PI/2)/Math.PI)+“)”});i.append(“text”).text(function(t){return t.text}).attr(“text-anchor”,“start”).attr(“dominant-baseline”,“middle”).attr(“fill”,r.color).attr(“x”,a+10).attr(“y”,0).attr(“font-size”,r.text_size),i.append(“line”).attr(“x1”,a).attr(“x2”,a+5).attr(“y1”,0).attr(“y2”,0).attr(“stroke”,“#000”)},e.prototype.getLegend=function(){},e.prototype.checkSelectedData=function(){},e}),n(“main”,,function(t){var e={};return e.Nya={scale:t(“components/scale”),axis:t(“components/axis”),diagrams:{arc:t(“diagrams/arc”),connector:t(“diagrams/connector”),labels:t(“diagrams/labels”)}},e}),e(“main”)});