/**

* @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;c,“.”===d)t.splice(c,1),c-=1;else if(“..”===d){if(1===c&&(“..”===t||“..”===t))break;c>0&&(t.splice(c-1,2),c-=2)}t=t.join(“/”)}else 0===t.indexOf(“./”)&&(t=t.substring(2));if((f||g)&&h){for(n=t.split(“/”),c=n.length;c>0;c-=1){if(r=n.slice(0,c).join(“/”),f)for(p=f.length;p>0;p-=1)if(a=h,a&&(a=a)){i=a,s=c;break}if(i)break;!l&&g&&g&&(l=g,u=c)}!i&&l&&(i=l,s=u),i&&(n.splice(0,s,i),t=n.join(“/”))}return t}function o(t,e){return function(){return f.apply(r,b.call(arguments,0).concat())}}function s(t){return function(e){return i(e,t)}}function l(t){return function(e){x=e}}function u(t){if(a(m,t)){var e=m;delete m,y=!0,d.apply(r,e)}if(!a(x,t)&&!a(y,t))throw new Error(“No ”+t);return x}function c(t){var e,n=t?t.indexOf(“!”):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),}function p(t){return function(){return _&&_.config&&_.config||{}}}var d,f,h,g,x={},m={},_={},y={},v=Object.prototype.hasOwnProperty,b=[].slice,k=/.js$/;h=function(t,e){var n,r=c(t),a=r;return t=r,a&&(a=i(a,e),n=u(a)),a?t=n&&n.normalize?n.normalize(t,s(e)):i(t,e):(t=i(t,e),r=c(t),a=r,t=r,a&&(n=u(a))),{f:a?a+“!”+t:t,n:t,pr:a,p:n}},g={require:function(t){return o(t)},exports:function(t){var e=x;return“undefined”!=typeof e?e:x={}},module:function(t){return{id:t,uri:“”,exports:x,config:p(t)}}},d=function(t,e,n,i){var s,c,p,d,f,_,v=[],b=typeof n;if(i=i||t,“undefined”===b||“function”===b){for(e=!e.length&&n.length?:e,f=0;f,i),c=d.f,“require”===c)v=g.require(t);else if(“exports”===c)v=g.exports(t),_=!0;else if(“module”===c)s=v=g.module(t);else if(a(x,c)||a(m,c)||a(y,c))v=u©;else{if(!d.p)throw new Error(t+“ missing ”+c);d.p.load(d.n,o(i,!0),l©,{}),v=x}p=n?n.apply(x,v):void 0,t&&(s&&s.exports!==r&&s.exports!==x?x=s.exports:p===r&&_||(x=p))}else t&&(x=n)},t=e=f=function(t,e,n,a,i){if(“string”==typeof t)return g?g(e):u(h(t,e).f);if(!t.splice){if(_=t,_.deps&&f(.deps,.callback),!e)return;e.splice?(t=e,e=n,n=null):t=r}return e=e||function(){},“function”==typeof n&&(n=a,a=i),a?d(r,t,e,n):setTimeout(function(){d(r,t,e,n)},4),f},f.config=function(t){return f(t)},t._defined=x,n=function(t,e,n){e.splice||(n=e,e=[]),a(x,t)||a(m,t)||(m=[t,e,n])},n.amd={jQuery:!0}}(),n(“contrib/almond/almond”,function(){}),n(“tools”,[],function(){var t={STL:Nyaplot.STL,:Nyaplot.,uuid:Nyaplot.uuid,Manager:Nyaplot.Manager};return t}),n(“components/scale”,,function(t){function e(t,e){var n=Math.abs(e.x-e.x),r=Math.abs(e.y-e.y);return this.scales={},this.center={x:n/2,y:r/2},this.max_r=Math.min(n,r)/2,this}var n=t._;return e.prototype.init=function(t,e,n,r){this.inner_radius=t,this.outer_radius=e,this.inner_num=n,this.outer_num=r,this.inner_thickness=t/(n+1),this.outer_thickness=(this.max_r-e)/r},e.prototype.addGroup=function(t,e,n,r){var a=d3.scale.ordinal().domain(e).rangePoints(,1);this.scales=a,this.width=(r-n)/(e.length+1)},e.prototype.groups=function(){return n.keys(this.scales)},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(t){return t>=0?this.outer_thickness:this.inner_thickness},e.prototype.getCenter=function(){return this.center},e.prototype.getRange=function(t){var e,n;return t>0?(e=this.outer_radius+this.outer_thickness*(t-1),n=e+this.outer_thickness):(n=this.inner_radius,e=n-this.inner_thickness),},e.prototype.get=function(t,e,n){var r,a;return r=t>0?this.outer_radius+this.outer_thickness*t:this.inner_radius-this.inner_thickness*t*-1,a=this.scales(n),{x:r*Math.sin(a),y:-r*Math.cos(a),r:r,theta:a}},e}),n(“components/axis”,,function(t){function e(e,n,r){var a=t._,i=t.Manager,o={width:0,height:0,margin:{top:0,bottom:0,left:0,right:0},x_label:“X”,y_label:“Y”,zoom:!0,zoom_range:,rotate_x_label:0,rotate_y_label:0,pane_uuid:null,z_index:0,extra:{}},s={df_id:null,inner_radius:150,outer_radius:170,group_by:null,fill_by:null,axis:null,chord:!1,matrix:null,padding:.05,inner_num:0,outer_num:1,color:,text_color:“#fff”,text_size:“1em”};arguments.length>2&&(a.extend(o,r),a.extend(s,r.extra),o.extra=s);var l=i.getData(o.extra.df_id),u=l.column(o.extra.group_by),c={},p=o.extra.chord?o.extra.matrix:[],d=function(){if(o.extra.fill_by){var t=l.scale(o.extra.fill_by,o.extra.color),e=a.zip.apply(null,a.map(l.column(o.extra.fill_by),function(e,n){return}));return d3.scale.ordinal().domain(e).range(e)}return d3.scale.ordinal().range(o.extra.color)}();a.each(u,function(t,e){var n=l.nested_column(e,o.extra.axis);if(c=n,null==o.extra.matrix){p=[];for(var r=0;r[r]=r==e?n.length:0}});var f=d3.layout.chord().padding(o.extra.padding).matrix(p),h=e.append(“g”).attr(“transform”,“translate(”o.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”)});