-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsota.min.js
1 lines (1 loc) · 39.7 KB
/
sota.min.js
1
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("d3")):"function"==typeof define&&define.amd?define(["d3"],e):(t=t||self).sota=e(t.d3)}(this,(function(t){"use strict";var e={separatorStrokeWidth:1,barHeight:32,barMargin:16,labelLeft:6,labelBelow:8,groupLabelMargin:32,legendMargin:24,xAxisTop:24,overflowOffset:24,lineColor:"#777777",labelColor:"#777777",mainHeight:300,tickSize:4,labelAngle:30,groupedBarChart:{barHeight:24,barMargin:8},margin:{top:20,bottom:20,left:0,right:0},swatch:{between:12,belowBetween:8,right:24,width:32,height:24,below:16}};function a(e){const a=e.node().offsetWidth/2,n=t.event.pageX;return n-a<0?a:n+a>window.innerWidth?window.innerWidth-a:n}function n(e){return t.format(".1f")(e)+"%"}function l(l,s,r,o,i){l.on("mouseover",(function(l,c){t.select(this).attr("opacity",e.hoverOpacity),s.style("opacity",1).html(()=>{let t=`<span class="sota-text-label"></span><span class="sota-heavy-label">${o[c]}</span><br/>Percentage: ${n(r[c])}`;return i&&(t+="<br/>Number of responses: "+i[c]),t+="</span>",t}).style("left",a(s)+"px").style("top",t.event.pageY+"px")})).on("mousemove",e=>{s.style("left",a(s)+"px").style("top",t.event.pageY+"px")}).on("mouseout",(function(e){t.select(this).attr("opacity",1),s.style("opacity",0)}))}function s(e,a,n=null){return n=null==n?t.sum(e,t=>+t.value):n,[a?e.map(t=>+t.value):e.map(t=>+t.value/n*100),!a&&e.map(t=>+t.value),e.map(t=>t.label)]}function r(t){const e=new Event("sotaChartRendered");t.closest(".container").dispatchEvent(e)}let o={barChart:function({selector:a,dataFile:o,inputIsPercentage:i=!1,showXAxis:c=!0,showSeparators:h=!0,displayPercentage:d=!0,totalResp:g=null,maxVal:p=null,minVal:m=null,margin:f=e.margin}){const x=e.tickSize,u=e.separatorStrokeWidth,b=e.labelLeft,y=e.barHeight,w=e.barMargin,v=e.overflowOffset,B=e.xAxisTop,C=t.select(a),k=C.append("svg"),A=t.select("body").append("div").attr("class","tooltip"),$=C.node().offsetWidth,M=$-f.left-f.right,j=k.append("g").attr("class","sota-barChart-mainChart").attr("transform",`translate(${f.left+v} ${f.right})`).attr("width",M);t.csv(o+".csv").then(e=>{const o=y+w;let S=e.length*o;const[L,G,P]=s(e,i,g),N=d||i?L:G;if(null==m)m=i||d?0:t.min(N);else if(!0===m)m=t.min(N);else if(isNaN(m)||""===m)throw"invalid minVal for graph on "+a;if(null==p)p=i||d?100:t.max(N);else if(!0===p)p=t.max(N);else if(isNaN(p)||""===p)throw"invalid maxVal for graph on "+a;const W=t.scaleLinear().domain([m,p]).range([0,M]);let T;function O(t){return t*o}if(c&&(T=j.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-num-axis").call(t.axisBottom(W).tickSize(-x)).attr("transform","translate(0 "+(S+B)+")")),j.selectAll(".sota-barChart-bar").data(N).join("rect").attr("class","sota-barChart-bar sota-gen-bar").attr("width",t=>W(t)).attr("height",y).attr("x",0).attr("y",(t,e)=>O(e)),j.selectAll(".sota-barChart-hiddenBar").data(N).join("rect").attr("class","sota-barChart-hiddenBar").attr("width",M).attr("height",y).attr("x",0).attr("y",(t,e)=>O(e)).attr("fill","transparent").call(l,A,L,P,G),j.selectAll(".sota-barChart-label").data(e).join("text").attr("class","sota-barChart-label sota-text-label sota-heavy-label").html(t=>t.label).attr("alignment-baseline","central").attr("dominant-baseline","central").attr("x",b).attr("y",(t,e)=>O(e)+y/2),h&&j.selectAll(".sota-barChart-separator").data(N).join("line").attr("class","sota-barChart-separator").attr("x1",0).attr("x2",M).attr("y1",(t,e)=>O(e)+y+6).attr("y2",(t,e)=>O(e)+y+6).attr("stroke-width",u).attr("stroke","#dddddd"),j.selectAll(".sota-barChart-value").data(N).join("text").attr("class","sota-barChart-value sota-num-label").html((t,e)=>i||d?n(t):t).attr("alignment-baseline","central").attr("dominant-baseline","central").attr("text-anchor","end").attr("x",M).attr("y",(t,e)=>O(e)+y/2),c){let e=[];T.selectAll("text").each((function(){e.push(this.getBBox().y+this.getBBox().height)})),S+=+t.max(e)}const I=S+f.top+f.bottom;k.style("width",$+2*v+"px").attr("height",I).style("margin-left",-v+"px"),r(C.node())})},pieChart:function({selector:a,dataFile:o,inputIsPercentage:i=!1,sorted:c=!0,pieRad:h=150,pieThick:d=80,margin:g=e.margin}){const p=e.lineColor,m=e.separatorStrokeWidth,f=e.separatorStrokeWidth,x=e.swatch.between,u=e.swatch.right,b=e.swatch.width,y=e.swatch.height,w=e.swatch.belowBetween,v=e.swatch.below,B=e.legendMargin,C=e.overflowOffset,k=t.select(a),A=k.append("svg"),$=t.select("body").append("div").attr("class","tooltip"),M=k.node().offsetWidth,j=M-g.left-g.right,S=A.append("g").attr("class","sota-barChart-mainChart").attr("transform",`translate(${g.left+C} ${g.top})`).attr("width",j);j<2*h&&(h=j/2),d>h&&(d=50),t.csv(o+".csv").then(e=>{const[a,o,L]=s(e,i),G=(c?t.pie():t.pie().sort(null))(a);let P=0,N=[];const W=t.scaleOrdinal().domain(L).range(t.map(L,(t,e)=>"module-fill-"+(L.length>3?e+1:2*e+1)).keys()),T=S.append("g").lower().attr("class","sota-gen-legend").attr("transform",`translate(0 ${g.top})`);if(T.selectAll("nothing").data(e).enter().append("text").attr("class","sota-gen-legend-text").text(t=>t.label).attr("x",(function(){N.push(this.getBBox().width)})).remove(),t.sum(N,t=>t)+L.length*(b+x)+(L.length-1)*u>j){let e=j-t.max(N)-b-x;T.selectAll(".sota-gen-legend-swatch").data(L).join("rect").attr("class",t=>"sota-gen-legend-swatch "+W(t)).attr("x",e).attr("y",(t,e)=>(y+w)*e).attr("width",b).attr("height",y),T.selectAll(".sota-gen-legend-text").data(L).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",e+b+x).attr("y",(t,e)=>(y+w)*e+y/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),P=L.length*y+(L.length-1)*w+v+B}else{let e=j-(t.sum(N,t=>t)+L.length*(b+x)+(L.length-1)*u);T.selectAll(".sota-gen-legend-swatch").data(L).join("rect").attr("class",t=>"sota-gen-legend-swatch "+W(t)).attr("x",(a,n)=>e+n*(b+x+u)+t.sum(N.slice(0,n),t=>t)).attr("y",0).attr("width",b).attr("height",y),T.selectAll(".sota-gen-legend-text").data(L).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",(a,n)=>e+n*(b+x+u)+b+x+t.sum(N.slice(0,n),t=>t)).attr("y",y/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),P=y+v+B}const O=S.append("g").attr("transform","translate("+j/2+","+(h+P)+")"),I=t.arc().innerRadius(.8*h-.8*d).outerRadius(.8*h),V=t.arc().innerRadius(.9*h).outerRadius(.9*h);O.selectAll(".sota-pieChart-slice").data(G).join("path").attr("class",(t,e)=>"sota-pieChart-slice "+W(e)).attr("d",I).attr("stroke","#fff").style("stroke-width",f).call(l,$,a,L,o);let z=!1;O.selectAll(".sota-pieChart-polyline").data(G).join("polyline").attr("class","sota-pieChart-polyline").attr("stroke",p).style("fill","none").attr("stroke-width",m).attr("points",(t,e)=>{let a=I.centroid(t),n=V.centroid(t),l=V.centroid(t);const s=V.centroid(t),r=e>0&&V.centroid(G[e-1]),o=(t.endAngle+t.startAngle)/2<Math.PI;return e>0&&Math.sign(s[0])==Math.sign(r[0])&&Math.abs(r[1]-s[1])<20?(l[0]=.95*h*((z?o:!o)?1:-1),z=!0):(l[0]=.95*h*((z?!o:o)?1:-1),z=!1),[a,n,l]}),z=!1,O.selectAll(".sota-pieChart-label").data(G).join("text").attr("class","sota-pieChart-label sota-num-label").text((t,e)=>n(a[e])).attr("alignment-baseline","central").attr("dominant-baseline","central").attr("transform",(t,e)=>{const a=V.centroid(t),n=e>0&&V.centroid(G[e-1]),l=(t.endAngle+t.startAngle)/2<Math.PI;return e>0&&Math.sign(a[0])==Math.sign(n[0])&&Math.abs(n[1]-a[1])<20?(a[0]=.99*h*((z?l:!l)?1:-1),z=!0):(a[0]=.99*h*((z?!l:l)?1:-1),z=!1),e==G.length-1&&(z=!1),"translate("+a+")"}).style("text-anchor",(t,e)=>{const a=V.centroid(t),n=e>0&&V.centroid(G[e-1]),l=(t.endAngle+t.startAngle)/2<Math.PI;if(e>0&&Math.sign(a[0])==Math.sign(n[0])&&Math.abs(n[1]-a[1])<20){const t=(z?l:!l)?"start":"end";return z=!0,t}{const t=(z?!l:l)?"start":"end";return z=!1,t}});const Y=2*h+P+g.top+g.bottom;A.style("width",M+2*C+"px").attr("height",Y).style("margin-left",-C+"px"),r(k.node())})},lineGraph:function({selector:a,dataFile:l,inputIsPercentage:s=!1,minVal:o=null,maxVal:i=null,height:c=300,customTooltipAppend:h="",prop5:d="value5",prop6:g="value6",margin:p={top:20,bottom:20,left:24,right:0}}){const m=e.separatorStrokeWidth,f=e.overflowOffset,x=t.select(a),u=x.append("svg"),b=t.select("body").append("div").attr("class","tooltip"),y=x.node().offsetWidth,w=y-p.left-p.right;console.log(y,w);const v=u.append("g").attr("class","sota-lineGraph-mainChart").attr("transform",`translate(${p.left+f} ${p.right})`).attr("width",w);t.csv(l+".csv").then(e=>{const l=e.map(t=>t.label),h=e.map(t=>+t.value);if(null==o)o=s?0:t.min(e,t=>t.value);else if(1==o)o=t.min(e,t=>t.value);else if(isNaN(o)||""==o)throw"invalid minVal for graph on "+a;if(null==i)i=s?100:t.max(e,t=>t.value);else if(1==i)i=t.max(e,t=>t.value);else if(isNaN(i)||""==i)throw"invalid maxVal for graph on "+a;const d=t.scaleBand().domain(l.map(t=>t)).range([0,w]),g=t.scaleLinear().domain([o,i]).range([c-p.bottom,p.top]);v.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-text-axis").call(t.axisBottom(d).ticks(e.length).tickSize(-8)).style("transform","translateY("+(c-p.bottom)+"px)"),v.append("g").attr("class","sota-gen-axis sota-gen-YAxis sota-num-axis").call(t.axisLeft(g).tickSize(-8)),v.selectAll(".sota-lineGraph-path").data([h]).join("path").attr("class","sota-lineGraph-path").attr("d",t.line().x((t,e)=>d(l[e])+d.bandwidth()/2).y(t=>g(t))).attr("fill","none").attr("stroke","#bbb").style("stroke-width",3),v.selectAll(".sota-lineGraph-circle").data(h).join("circle").attr("class","sota-lineGraph-circle").attr("cx",(t,e)=>d(l[e])+d.bandwidth()/2).attr("cy",t=>g(t)).attr("r",4).attr("stroke","white").style("stroke-width",m).on("mouseover",(function(e,a){t.select(this).attr("opacity",.8),b.style("opacity",1).html(`<span class="sota-tooltip-label">${l[a]}</span><br/>Value: `+(s?n(e):e)+"</span>").style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")})).on("mousemove",e=>{b.style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")}).on("mouseout",(function(e){t.select(this).attr("opacity",1),b.style("opacity",0)})),v.selectAll(".sota-lineGraph-label").data(h).join("text").attr("class","sota-lineGraph-label sota-num-label").text((t,e)=>{if(s)return t+"%"}).attr("x",(t,e)=>d(l[e])+d.bandwidth()/2).attr("y",t=>g(t)-16).style("text-anchor","middle"),u.style("width",y+2*f+"px").attr("height",c).style("margin-left",-f+"px"),r(x.node())})},stackedBarChart:function({selector:a,dataFile:l,inputIsPercentage:s=!1,showXAxis:o=!0,labelStyle:i="onBar",groupLabelStyle:c="none",showLegend:h=!0,prop5:d="value5",prop6:g="value6",margin:p=e.margin}){const m=e.separatorStrokeWidth,f=e.barHeight,x=e.barMargin,u=e.overflowOffset,b=e.groupLabelMargin,y=e.labelLeft,w=e.labelBelow,v=e.lineColor,B=e.swatch.between,C=e.swatch.right,k=e.swatch.width,A=e.swatch.height,$=e.swatch.belowBetween,M=e.swatch.below,j=e.xAxisTop;var S=t.select(a),L=S.append("svg"),G=t.select("body").append("div").attr("class","tooltip"),P=document.querySelector(a).offsetWidth,N=P-p.left-p.right;const W=L.append("g").attr("class","sota-stackedBarChart-mainChart").attr("transform",`translate(${p.left+u} ${p.right})`).attr("width",N);t.csv(l+".csv").then(e=>{var a=f+x,l=e.length*a,d=0;"onBar"==c&&(a+=e.length*b,l+=e.length*b,d=b);const g=e.columns.slice(1),T=t.map(e,t=>t.group).keys();var O=[];s?e.forEach(t=>{let e=0,a=[];for(let n of g){let l=+t[n];a.push([l,e]),e+=l}O.push(a)}):e.forEach(e=>{let a=0,n=t.sum(g,t=>+e[t]),l=[];for(let t of g){let s=+e[t]/n*100;l.push([s,a,+e[t]]),a+=s}O.push(l)});const I=t.scaleBand().domain(T).range([0,l]).padding([.2]),V=t.scaleLinear().domain([0,100]).range([0,N]),z=t.scaleOrdinal().domain(g).range(t.map(g,(t,e)=>"module-fill-"+(g.length>3?e+1:2*e+1)).keys());o&&(W.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-num-axis").call(t.axisBottom(V).ticks(e.length).tickSize(-8)).attr("transform","translate(0 "+(l+j)+")"),l+=20+j);var Y=0;if(h){let e=[];const a=L.append("g").lower().attr("class","sota-gen-legend").attr("transform",`translate(0 ${p.top})`);if(a.selectAll("nothing").data(g).enter().append("text").attr("class","sota-gen-legend-text").text(t=>t).attr("x",(function(){e.push(this.getBBox().width)})).remove(),t.sum(e,t=>t)+g.length*(k+B)+(g.length-1)*C>N){let n=P+u-t.max(e)-k-B;a.selectAll(".sota-gen-legend-swatch").data(g).join("rect").attr("class",t=>"sota-gen-legend-swatch "+z(t)).attr("x",n).attr("y",(t,e)=>(A+$)*e).attr("width",k).attr("height",A),a.selectAll(".sota-gen-legend-text").data(g).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",n+k+B).attr("y",(t,e)=>(A+$)*e+A/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),Y=g.length*A+(g.length-1)*$+M}else{let n=P+u-(t.sum(e,t=>t)+g.length*(k+B)+(g.length-1)*C);a.selectAll(".sota-gen-legend-swatch").data(g).join("rect").attr("class",t=>"sota-gen-legend-swatch "+z(t)).attr("x",(a,l)=>n+l*(k+B+C)+t.sum(e.slice(0,l),t=>t)).attr("y",0).attr("width",k).attr("height",A),a.selectAll(".sota-gen-legend-text").data(g).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",(a,l)=>n+l*(k+B+C)+k+B+t.sum(e.slice(0,l),t=>t)).attr("y",A/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),Y=A+M}}const E=W.selectAll(".sota-stackedBarChart-group").data(O).join("g").attr("class","sota-stackedBarChart-group").attr("transform",(t,e)=>"translate(0 "+(I(T[e])+d-x)+")");E.selectAll(".sota-stackedBarChart-bar").data(t=>t).join("rect").attr("class",(t,e)=>"sota-stackedBarChart-bar "+z(e)).attr("x",t=>V(t[1])).attr("y",0).attr("width",t=>V(t[0])).attr("height",f).on("mouseover",(function(e,a){t.select(this).attr("opacity",.8),G.style("opacity",1).html(()=>{let t=`<span class="sota-text-label"><span class="sota-heavy-label">${g[a]}</span><br/>Percentage: ${n(e[0])}`;return s||(t+="<br/>Number of responses: "+e[2]),t+="</span>",t}).style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")})).on("mousemove",()=>{G.style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")}).on("mouseout",(function(e){t.select(this).attr("opacity",1),G.style("opacity",0)})),E.selectAll(".sota-stackedBarChart-separator").data(t=>t).join("rect").attr("class","sota-stackedBarChart-separator").attr("fill","white").attr("x",t=>V(t[1])+V(t[0])).attr("y",0).attr("width",t=>t[0]>0?m:0).attr("height",f),"onBar"==c&&W.selectAll(".sota-stackedBarChart-groupLabel-onBar").data(T).join("text").attr("class","sota-stackedBarChart-groupLabel-onBar sota-text-label sota-heavy-label").text(t=>t).attr("alignment-baseline","bottom").attr("x",0).attr("y",t=>I(t));var F=0;if("onBar"==i)E.selectAll(".sota-stackedBarChart-label-onBar").data(t=>t).join("text").attr("class","sota-stackedBarChart-label-onBar sota-num-label").text(e=>t.format(".1f")(e[0])+"%").attr("alignment-baseline","central").attr("dominant-baseline","central").attr("text-anchor","end").attr("x",t=>V(t[1])+V(t[0])-y).attr("y",f/2).style("display",(function(t,e){return this.getBBox().x<(e>0?V(t[1]):p.left)?"none":""}));else if("aboveBar"==i){var X=[];E.selectAll(".sota-stackedBarChart-label-aboveBar-text").data(t=>t).join("text").attr("class","sota-stackedBarChart-label-aboveBar-text sota-num-label").text((e,a)=>`${g[a]}: ${t.format(".1f")(e[0])}%`).attr("x",t=>V(t[1])+V(t[0])/2).attr("y",(function(t){return X.push([this.getBBox().x,this.getBBox().width]),-2*w})).attr("alignment-baseline","bottom");let e=[];!function t(a){if(a==X.length-1)return e[a]=-2,-2;if(X[a][0]+X[a][1]+y>X[a+1][0]){X[a+1][0]=X[a][0]+X[a][1]+y;let n=t(a+1)-1;return e[a]=n,n}return t(a+1),e[a]=-2,-2}(0),E.selectAll(".sota-stackedBarChart-label-aboveBar-line").data(t=>t).join("polyline").attr("class","sota-stackedBarChart-label-aboveBar-line").attr("points",(t,a)=>{let n=V(t[1])+V(t[0])/2,l=f/2,s=n,r=(e[a]+1)*w;return`${n},${l} ${s},${r} ${X[a][0]+X[a][1]},${r}`}).attr("stroke-width",m).attr("stroke",v).attr("fill","none"),E.selectAll(".sota-stackedBarChart-label-aboveBar-text").data(t=>t).join("text").attr("x",(t,e)=>X[e][0]).attr("y",(t,a)=>e[a]*w),F=-1*t.min(e)*w+20}const H=l+p.top+p.bottom+Y+F;L.style("width",P+2*u+"px").attr("height",H).style("margin-left",-u+"px"),W.attr("transform",`translate(${u} ${p.top+Y+F})`).attr("width",N),r(S.node())})},customBarChart:function({selector:a,dataFile:o,shapeFile:i,shapeWidth:c=300,inputIsPercentage:h=!1,margin:d=e.margin}){var g=t.select(a),p=g.append("svg"),m=t.select("body").append("div").attr("class","tooltip");const f=p.append("g").attr("class","sota-mainChart");var x=document.querySelector(a).offsetWidth;const u=e.separatorStrokeWidth,b=e.labelLeft,y=e.labelBelow,w=e.lineColor;t.xml("shapes/"+i+".svg").then(e=>{let i=document.importNode(e.documentElement,!0),v=t.select(i).select("path").node(),B=0,C=0;p.append(()=>v).attr("class",(function(){return B=this.getBBox().width,C=this.getBBox().height,""})).remove();let k=c/B,A=C*k;p.append("defs").append("clipPath").attr("id","shapeDef"+a.substring(1)).append(()=>v).attr("transform",`scale(${k})`),t.csv(o+".csv").then(e=>{const[r,o,i]=s(e,h);let g=0,v=[];for(let t of e)v.push(g),g+=+t.value;const B=t.scaleLinear().domain([0,t.sum(e,t=>+t.value)]).range([0,c]),C=t.scaleOrdinal().domain(t.map(e,t=>t.label)).range(t.map(e,(t,e)=>"module-fill-"+(e+1)).keys());f.selectAll(".sota-customBarChart-bar").data(e).join("rect").attr("class",t=>"sota-customBarChart-bar "+C(t.label)).attr("x",(t,e)=>B(v[e])).attr("y",0).attr("width",t=>B(t.value)).attr("height",A).attr("clip-path","url(#shapeDef"+a.substring(1)+")").call(l,m,r,i,o),f.selectAll(".sota-customBarChart-separator").data(e).join("rect").attr("class","sota-customBarChart-separator").attr("x",(t,e)=>0==e?-u:B(v[e])).attr("y",0).attr("width",u).attr("height",A).attr("fill","white").attr("clip-path","url(#shapeDef"+a.substring(1)+")");var k=[];f.selectAll(".sota-customBarChart-label-aboveBar-text").data(e).join("text").attr("class","sota-customBarChart-label-aboveBar-text").html((t,e)=>`<tspan class="sota-text-label sota-heavy-label">${t.label}:</tspan><tspan class="sota-num-label"> ${n(r[e])}</tspan>`).attr("x",(t,e)=>B(v[e])+B(t.value)/2+b).attr("y",(function(t){return k.push([this.getBBox().x,this.getBBox().width]),A+3*y})).attr("alignment-baseline","top");let $=[];!function t(e){if(e==k.length-1)return $[e]=3,3;if(k[e][0]+k[e][1]+2*b>k[e+1][0]){k[e+1][0]=k[e][0]+k[e][1]+2*b;let a=t(e+1)+1;return $[e]=a,a}return t(e+1),$[e]=3,3}(0),f.selectAll(".sota-customBarChart-label-aboveBar-line").data(e).join("polyline").attr("class","sota-customBarChart-label-aboveBar-line").attr("points",(t,e)=>{let a=B(v[e])+B(t.value)/2,n=A-y,l=a,s=A+($[e]+1)*y;return`${a},${n} ${l},${s} ${k[e][0]+k[e][1]},${s}`}).attr("stroke-width",u).attr("stroke",w).attr("fill","none"),f.selectAll(".sota-customBarChart-label-aboveBar-text").data(e).join("text").attr("x",(t,e)=>k[e][0]).attr("y",(t,e)=>A+$[e]*y);let M=t.max($)*y+20,j=A+d.top+d.bottom+M;p.attr("height",j),f.attr("transform",`translate(${d.left} ${d.top})`).attr("width",x-d.left-d.right)}),r(g.node())})},columnChart:function({selector:a,dataFile:n,inputIsPercentage:o=!1,displayPercentage:i=!0,totalResp:c=null,maxVal:h=null,minVal:d=null,mainHeight:g=e.mainHeight,showLegend:p=!1,margin:m={top:20,bottom:20,left:24,right:0}}){const f=e.overflowOffset,x=e.tickSize,u=e.labelAngle,b=e.swatch.between,y=e.swatch.right,w=e.swatch.width,v=e.swatch.height,B=e.swatch.belowBetween,C=e.swatch.below,k=t.select(a),A=k.append("svg"),$=t.select("body").append("div").attr("class","tooltip"),M=A.append("g").attr("class","sota-mainChart"),j=document.querySelector(a).offsetWidth,S=j-m.left-m.right;t.csv(n+".csv").then(e=>{const[n,L,G]=s(e,o,c),P=i||o?n:L;if(null===d)d=o||i?0:t.min(P);else if(!0===d)d=t.min(P);else if(isNaN(d)||""===d)throw"invalid minVal for graph on "+a;if(null===h)h=o||i?100:t.max(P);else if(!0===h)h=t.max(P);else if(isNaN(h)||""===h)throw"invalid maxVal for graph on "+a;const N=t.scaleBand().domain(G).range([0,S]).padding([.3]),W=t.scaleLinear().domain([d,h]).range([g,0]),T=t.scaleOrdinal().domain(G).range(t.map(G,(t,e)=>"module-fill-"+(e+1)).keys());let O,I=0,V=!1;if(p){let a=[];const n=A.append("g").lower().attr("class","sota-gen-legend").attr("transform",`translate(0 ${m.top})`);if(n.selectAll("nothing").data(e).enter().append("text").attr("class","sota-gen-legend-text").text(t=>t.label).attr("x",(function(){a.push(this.getBBox().width)})).remove(),t.sum(a,t=>t)+a.length*b+(a.length-1)*y>S){let e=j-t.max(a)-w-b;n.selectAll(".sota-gen-legend-swatch").data(G).join("rect").attr("class",t=>"sota-gen-legend-swatch "+T(t)).attr("x",e).attr("y",(t,e)=>(v+B)*e).attr("width",w).attr("height",v),n.selectAll(".sota-gen-legend-text").data(G).join("text").attr("class","sota-gen-legend-text sota-text-label").text(t=>t).attr("x",e+w+b).attr("y",(t,e)=>(v+B)*e+v/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),I=G.length*v+(G.length-1)*B+C}else{let e=j-(t.sum(a,t=>t)+G.length*(w+b)+(G.length-1)*y);n.selectAll(".sota-gen-legend-swatch").data(G).join("rect").attr("class",t=>"sota-gen-legend-swatch "+T(t)).attr("x",(n,l)=>e+l*(w+b+y)+t.sum(a.slice(0,l),t=>t)).attr("y",0).attr("width",w).attr("height",v),n.selectAll(".sota-gen-legend-text").data(G).join("text").attr("class","sota-gen-legend-text sota-text-label").text(t=>t).attr("x",(n,l)=>e+l*(w+b+y)+w+b+t.sum(a.slice(0,l),t=>t)).attr("y",v/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),I=v+C}}else{O=M.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-text-axis").call(t.axisBottom(N).tickSize(0)).attr("transform",`translate(0 ${g})`);const e=O.selectAll("text"),a=e.nodes();for(let t in a){if(t==a.length-1)continue;let e=a[+t].getBBox(),n=a[+t+1].getBBox();if(e.x+e.width>n.x){V=!0;break}}V&&e.attr("text-anchor","end").style("transform",`translateY(4px) rotate(-${u}deg)`).node().classList.add("angled-label")}M.append("g").attr("class","sota-gen-axis sota-gen-yAxis sota-num-axis").call(t.axisLeft(W).tickSize(-x));if(M.selectAll(".sota-columnChart-bar").data(P).join("rect").attr("class",(t,e)=>{let a="sota-columnChart-bar sota-gen-bar";return a+=p?" "+T(G[e]):"",a}).attr("x",(t,e)=>N(G[e])).attr("y",t=>W(t)).attr("width",N.bandwidth()).attr("height",t=>g-W(t)).call(l,$,n,G,L),p)g+=I;else if(V){let e=[];const a=O.select("text").node().getBBox(),n=a.y,l=a.height;O.selectAll("text").each((function(){e.push(this.getBBox().width)}));const s=t.max(e)*Math.sin(u*Math.PI/180),r=l*Math.cos(u*Math.PI/180);g+=n+s+r}else{let e=[];O.selectAll("text").each((function(){e.push(this.getBBox().y+this.getBBox().height)})),g+=+t.max(e)}let z=g+m.top+m.bottom;A.style("width",j+2*f+"px").attr("height",z).style("margin-left",-f+"px"),M.attr("transform",`translate(${m.left+f} ${m.top+I})`).attr("width",S),r(k.node())})},groupedBarChart:function({selector:a,dataFile:l,totalResp:s=null,inputIsPercentage:o=!1,displayPercentage:i=!0,minVal:c=0,maxVal:h=null,margin:d=e.margin}){const g=e.groupedBarChart.barHeight,p=e.groupedBarChart.barMargin,m=e.overflowOffset,f=e.groupLabelMargin,x=(e.swatch.between,e.swatch.right,e.swatch.width,e.swatch.height,e.swatch.belowBetween,e.swatch.below,e.xAxisTop),u=t.select(a),b=u.append("svg"),y=t.select("body").append("div").attr("class","tooltip"),w=b.append("g").attr("class","sota-mainChart"),v=document.querySelector(a).offsetWidth,B=v-d.left-d.right;t.csv(l+".csv").then(e=>{window.wow=e;const l=e.columns.splice(1),C=t.map(e,t=>t.group).keys(),k=t.map(e,e=>{let a=[];for(let t of l)a.push(+e[t]);return t.max(a)}).keys(),A=t.max(k,t=>+t);if(null==h)h=o||i?100:A;else if(isNaN(h)||""===h)throw"invalid maxVal for graph on "+a;const $=g+p,M=$*l.length;let j=(M+f)*e.length;const S=t.scaleLinear().domain([c,h]).range([0,B]),L=t.scaleOrdinal().domain(t.map(e,t=>t.group)).range(t.map(e,(t,e)=>(M+f)*e).keys()),G=t.scaleOrdinal().domain(l).range(t.map(l,(t,e)=>$*e).keys());w.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-groupedBarChart-xAxis sota-num-axis").call(t.axisBottom(S).tickSize(-(j+x))).attr("transform","translate(0 "+(j+x)+")");j+=20+x;const P=w.selectAll(".sota-groupedBarChart-group").data(e).join("g").attr("class","sota-groupedBarChart-group").attr("transform",(t,e)=>`translate(0 ${L(t.group)})`),N=t.scaleOrdinal().domain(l).range(t.map(l,(t,e)=>"module-fill-"+(e+1)).keys());P.selectAll(".sota-gen-bar").data(t=>{let e=[];for(let a of l)e.push(+t[a]);return e}).join("rect").attr("class",(t,e)=>"sota-gen-bar "+N(l[e])).attr("y",(t,e)=>+G(l[e])+ +f).attr("x",0).attr("width",(t,e)=>S(o?t:t/s[l[e]]*100)).attr("height",g).on("mouseover",(function(e,a){t.select(this).attr("opacity",.8),y.style("opacity",1).html(()=>{let t=`<span class="sota-text-label"><span class="sota-heavy-label">${l[a]}</span><br/>Percentage: ${n(o?e:e/s[l[a]]*100)}`;return o||(t+="<br/>Number of responses: "+e),t+="</span>",t}).style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")})).on("mousemove",()=>{y.style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")}).on("mouseout",(function(e){t.select(this).attr("opacity",1),y.style("opacity",0)})),w.selectAll(".sota-gen-groupLabel").data(C).join("text").attr("class","sota-gen-groupLabel sota-text-label sota-heavy-label").text(t=>t).attr("alignment-baseline","bottom").attr("x",0).attr("y",t=>+L(t)+ +f).attr("transform","translate(0 -8)");let W=j+d.top+d.bottom;b.style("width",v+2*m+"px").attr("height",W).style("margin-left",-m+"px"),w.attr("transform",`translate(${d.left+m} ${d.top})`).attr("width",B),r(u.node())})},stackedColumnChart:function({selector:a,dataFile:l,inputIsPercentage:s=!1,displayPercentage:o=!0,maxVal:i=null,minVal:c=null,mainHeight:h=e.mainHeight,margin:d={top:20,bottom:20,left:24,right:0}}){const g=e.tickSize,p=e.separatorStrokeWidth,m=e.overflowOffset,f=e.labelAngle,x=e.swatch.between,u=e.swatch.right,b=e.swatch.width,y=e.swatch.height,w=e.swatch.belowBetween,v=e.swatch.below,B=t.select(a),C=B.append("svg"),k=t.select("body").append("div").attr("class","tooltip"),A=C.append("g").attr("class","sota-stackedColumnChart-mainChart"),$=document.querySelector(a).offsetWidth,M=$-d.left-d.right;t.csv(l+".csv").then(e=>{const l=e.columns.slice(1),j=t.map(e,t=>t.group).keys();var S=[];s?e.forEach(t=>{let e=0,a=[];for(let n of l){let l=+t[n];a.push([l,e]),e+=l}S.push(a)}):e.forEach(e=>{let a=0,n=t.sum(l,t=>+e[t]),s=[];for(let t of l){let l=+e[t]/n*100;s.push([l,a,+e[t]]),a+=l}S.push(s)});const L=o||s?S:e.map(t=>+t.value);if(null===c)c=s||o?0:t.min(L);else if(!0===c)c=t.min(L);else if(isNaN(c)||""===c)throw"invalid minVal for graph on "+a;if(null===i)i=s||o?100:t.max(L);else if(!0===i)i=t.max(L);else if(isNaN(i)||""===i)throw"invalid maxVal for graph on "+a;const G=t.scaleBand().domain(j).range([0,M]).padding([.3]),P=t.scaleLinear().domain([c,i]).range([h,0]),N=t.scaleOrdinal().domain(l).range(t.map(l,(t,e)=>"module-fill-"+(l.length>3?e+1:2*e+1)).keys()),W=(A.append("g").attr("class","sota-gen-axis sota-gen-yAxis sota-num-axis").call(t.axisLeft(P).tickSize(-g)),A.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-text-axis").call(t.axisBottom(G).tickSize(0)).attr("transform",`translate(0 ${h})`));let T=!1;const O=W.selectAll("text"),I=O.nodes();for(let t in I){if(t==I.length-1)continue;let e=I[+t].getBBox(),a=I[+t+1].getBBox();if(e.x+e.width>a.x){T=!0;break}}T&&O.attr("text-anchor","end").style("transform",`translateY(4px) rotate(-${f}deg)`).node().classList.add("angled-label");let V=0,z=[];const Y=C.append("g").lower().attr("class","sota-gen-legend").attr("transform",`translate(0 ${d.top})`);if(Y.selectAll("nothing").data(l).enter().append("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",(function(){z.push(this.getBBox().width)})).remove(),t.sum(z,t=>t)+z.length*(b+x)+(z.length-1)*u>M){let e=$+m-t.max(z)-b-x;Y.selectAll(".sota-gen-legend-swatch").data(l).join("rect").attr("class",t=>"sota-gen-legend-swatch "+N(t)).attr("x",e).attr("y",(t,e)=>(y+w)*e).attr("width",b).attr("height",y),Y.selectAll(".sota-gen-legend-text").data(l).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",e+b+x).attr("y",(t,e)=>(y+w)*e+y/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),V=l.length*y+(l.length-1)*w+v}else{let e=$+m-(t.sum(z,t=>t)+l.length*(b+x)+(l.length-1)*u);Y.selectAll(".sota-gen-legend-swatch").data(l).join("rect").attr("class",t=>"sota-gen-legend-swatch "+N(t)).attr("x",(a,n)=>e+n*(b+x+u)+t.sum(z.slice(0,n),t=>t)).attr("y",0).attr("width",b).attr("height",y),Y.selectAll(".sota-gen-legend-text").data(l).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",(a,n)=>e+n*(b+x+u)+b+x+t.sum(z.slice(0,n),t=>t)).attr("y",y/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),V=y+v}const E=A.selectAll(".sota-stackedColumnChart-group").data(S).join("g").attr("class","sota-stackedColumnChart-group").attr("transform",(t,e)=>"translate("+G(j[e])+" 0)");if(E.selectAll(".sota-stackedColumnChart-bar").data(t=>t).join("rect").attr("class",(t,e)=>"sota-stackedColumnChart-bar "+N(e)).attr("x",0).attr("y",t=>P(t[0]+t[1])).attr("width",G.bandwidth()).attr("height",t=>h-P(t[0])).on("mouseover",(function(e,a){t.select(this).attr("opacity",.8),k.style("opacity",1).html(()=>{let t=`<span class="sota-text-label"><span class="sota-heavy-label">${l[a]}</span><br/>Percentage: ${n(e[0])}`;return s||(t+="<br/>Number of responses: "+e[2]),t+="</span>",t}).style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")})).on("mousemove",()=>{k.style("left",t.event.pageX+"px").style("top",t.event.pageY+"px")}).on("mouseout",(function(e){t.select(this).attr("opacity",1),k.style("opacity",0)})),E.selectAll(".sota-stackedColumnChart-separator").data(t=>t).join("rect").attr("class","sota-stackedColumnChart-separator").attr("fill","white").attr("x",0).attr("y",(t,e)=>P(t[0])+P(t[1])-h).attr("height",t=>t[0]>0?p:0).attr("width",G.bandwidth()),h+=V,T){let e=[];const a=W.select("text").node().getBBox(),n=a.y,l=a.height;W.selectAll("text").each((function(){e.push(this.getBBox().width)}));const s=t.max(e)*Math.sin(f*Math.PI/180),r=l*Math.cos(f*Math.PI/180);h+=n+s+r}else{let e=[];W.selectAll("text").each((function(){e.push(this.getBBox().y+this.getBBox().height)})),h+=+t.max(e)}let F=h+d.top+d.bottom+V;C.style("width",$+2*m+"px").attr("height",F).style("margin-left",-m+"px"),A.attr("transform",`translate(${d.left+m} ${d.top+V})`).attr("width",M),r(B.node())})},customColumnChart:function({selector:a,dataFile:n,shapeFile:o,shapeHeight:i=300,inputIsPercentage:c=!1,margin:h=e.margin}){const d=t.select(a),g=d.append("svg"),p=t.select("body").append("div").attr("class","tooltip"),m=g.append("g").attr("class","sota-mainChart"),f=document.querySelector(a).offsetWidth,x=e.separatorStrokeWidth;t.xml("shapes/"+o+".svg").then(e=>{let o=document.importNode(e.documentElement,!0),u=t.select(o).select("path").node(),b=0,y=0;g.append(()=>u).attr("class",(function(){return b=this.getBBox().width,y=this.getBBox().height,""})).remove();let w=i/y,v=b*w;g.append("defs").append("clipPath").attr("id","shapeDef"+a.substring(1)).append(()=>u).attr("transform",`scale(${w})`),t.csv(n+".csv").then(e=>{const[n,r,o]=s(e,c);let d=0,u=[];for(let t of e)u.push(d),d+=+t.value;const b=t.scaleLinear().domain([0,t.sum(e,t=>+t.value)]).range([0,i]),y=t.scaleOrdinal().domain(o).range(t.map(o,(t,e)=>"module-fill-"+(e+1)).keys());m.selectAll(".sota-customColumnChart-bar").data(e).join("rect").attr("class",t=>"sota-customColumnChart-bar "+y(t.label)).attr("x",0).attr("y",(t,e)=>b(u[e])).attr("width",v).attr("height",t=>b(t.value)).attr("clip-path","url(#shapeDef"+a.substring(1)+")").call(l,p,n,o,r),m.selectAll(".sota-customColumnChart-separator").data(e).join("rect").attr("class","sota-customColumnChart-separator").attr("x",0).attr("y",(t,e)=>0==e?-x:b(u[e])).attr("width",v).attr("height",x).attr("fill","white").attr("clip-path","url(#shapeDef"+a.substring(1)+")");const w=i+h.top+h.bottom;g.attr("height",w),m.attr("transform",`translate(${h.left} ${h.top})`).attr("width",f-h.left-h.right)}),r(d.node())})},multiLineGraph:function({selector:a,dataFile:n,height:l=300,showLegend:s=!0,inputIsPercentage:o=!1,margin:i={top:20,bottom:20,left:24,right:0}}){const c=e.overflowOffset,h=e.swatch.between,d=e.swatch.right,g=e.swatch.width,p=e.swatch.height,m=e.swatch.belowBetween,f=e.swatch.below,x=t.select(a),u=x.append("svg"),b=(t.select("body").append("div").attr("class","tooltip"),document.querySelector(a).offsetWidth),y=b-i.left-i.right,w=l-i.top-i.bottom,v=u.append("g").attr("class","sota-stackedBarChart-mainChart").attr("transform",`translate(${i.left+c} ${i.right})`).attr("width",y);t.csv(n+".csv").then(e=>{const a=e.columns.slice(1),n=t.map(e,t=>t.group).keys(),B=t.scaleBand().domain(a).range([0,y]),C=t.scaleLinear().domain([0,50]).range([w,0]);var k=[];o?e.forEach(t=>{let e=[];for(let n of a)e.push(+t[n]);k.push(e)}):e.forEach(e=>{let n=t.sum(a,t=>+e[t]),l=[];for(let t of a){let a=+e[t]/n*100;l.push([a,+e[t]])}k.push(l)});const A=t.scaleOrdinal().domain(n).range(t.map(n,(t,e)=>"module-fill-"+(n.length>3?e+1:2*e+1)).keys()),$=t.scaleOrdinal().domain(n).range(t.map(n,(t,e)=>"module-stroke-"+(n.length>3?e+1:2*e+1)).keys());let M=0;if(s){let e=[];const a=u.append("g").lower().attr("class","sota-gen-legend").attr("transform",`translate(0 ${i.top})`);if(a.selectAll("nothing").data(n).enter().append("text").attr("class","sota-gen-legend-text").text(t=>t).attr("x",(function(){e.push(this.getBBox().width)})).remove(),t.sum(e,t=>t)+n.length*(g+h)+(n.length-1)*d>y){let l=b+c-t.max(e)-g-h;a.selectAll(".sota-gen-legend-swatch").data(n).join("rect").attr("class",t=>"sota-gen-legend-swatch "+A(t)).attr("x",l).attr("y",(t,e)=>(p+m)*e).attr("width",g).attr("height",p),a.selectAll(".sota-gen-legend-text").data(n).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",l+g+h).attr("y",(t,e)=>(p+m)*e+p/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),M=n.length*p+(n.length-1)*m+f}else{let l=b+c-(t.sum(e,t=>t)+n.length*(g+h)+(n.length-1)*d);a.selectAll(".sota-gen-legend-swatch").data(n).join("rect").attr("class",t=>"sota-gen-legend-swatch "+A(t)).attr("x",(a,n)=>l+n*(g+h+d)+t.sum(e.slice(0,n),t=>t)).attr("y",0).attr("width",g).attr("height",p),a.selectAll(".sota-gen-legend-text").data(n).join("text").attr("class","sota-gen-legend-text sota-text-label sota-heavy-label").text(t=>t).attr("x",(a,n)=>l+n*(g+h+d)+g+h+t.sum(e.slice(0,n),t=>t)).attr("y",p/2).attr("alignment-baseline","central").attr("dominant-baseline","central"),M=p+f}}v.append("g").attr("class","sota-gen-axis sota-gen-xAxis sota-text-axis").call(t.axisBottom(B).ticks(e.length).tickSize(-8)).style("transform","translateY("+w+"px)"),v.append("g").attr("class","sota-gen-axis sota-gen-YAxis sota-num-axis").call(t.axisLeft(C).tickSize(-8)),v.selectAll(".sota-multiLineGraph-group").data(k).join("g").attr("class",(t,e)=>"sota-multiLineGraph-group "+$(n[e])).selectAll(".sota-multiLineGraph-path").data(t=>[t]).join("path").attr("class","sota-multiLineGraph-path").attr("d",t.line().x((t,e)=>B(a[e])+B.bandwidth()/2).y(t=>C(t[0]))).attr("fill","none").style("stroke-width",3),l=w+M,u.style("width",b+2*c+"px").attr("height",l+M+"px").style("margin-left",-c+"px"),v.attr("transform",`translate(${i.left} ${i.top+M})`).attr("width",y),r(x.node())})},setColors:function(t){let e="";for(const a in t){e+=`#${a}{\n background-color: ${t[a][0]};\n color: ${t[a][0]};\n }\n #${a} .sota-gen-bar{\n fill: ${t[a][3]};\n }\n `;for(const n in t[a])e+=`\n #${a} .module-fill-${+n+1}{\n fill: ${t[a][n]};\n }\n #${a} .module-stroke-${+n+1}{\n stroke: ${t[a][n]};\n }\n `}document.head.appendChild(document.createElement("style")).textContent=e},setStyles:function(t,a=e){const n=a.separatorStrokeWidth,l=a.lineColor;let s=`\n@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-Roman.otf");\n\tfont-weight: normal;\n\tfont-style: normal\n}\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-Italic.otf");\n\tfont-weight: normal;\n\tfont-style: italic\n}\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-Bold.otf");\n\tfont-weight: bold;\n\tfont-style: normal\n}\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-BoldItalic.otf");\n\tfont-weight: bold;\n\tfont-style: italic\n}\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-Semibold.otf");\n\tfont-weight: 600;\n\tfont-style: normal\n}\n\n@font-face {\n\tfont-family: 'Mercury Text G1';\n\tsrc: url("${t}/Mercury/MercuryTextG1-SemiboldItalic.otf");\n\tfont-weight: 600;\n\tfont-style: italic\n}\n\nbody{\n margin: 0;\n}\n\nsection {\n\tpadding: 48px 0;\n\twidth: 100%\n}\n\nsection > p{\n color: #fff;\n font-family: "Mercury Text G1";\n line-height: 1.5;\n max-width: 800px;\n margin: 64px auto;\n padding: 0 24px;\n}\n\nh1 {\n\tfont-size: 56px;\n\tfont-family: 'Montserrat', sans-serif;\n\ttext-transform: uppercase;\n\tfont-weight: 700;\n\ttext-align: center;\n\tcolor: #fff\n}\n\n.container {\n position: relative;\n\tmax-width: 1500px;\n\tbox-sizing: border-box;\n\tfont-family: "Montserrat", Arial, sans-serif;\n\twidth: 100%;\n\tpadding: 48px 24px;\n\tmargin: 0 auto;\n\tbackground-color: #fff;\n\tgrid-template-columns: minmax(0, 1fr)\n}\n\n.container:before{\n pointer-events: none;\n content: "";\n position: absolute;\n left: 0;\n top: 32px;\n display: none;\n height: calc(100% - 64px);\n}\n\n.container:after{\n content: "";\n clear: both;\n display: table; \n}\n\n.module {\n\tposition: absolute;\n\tfloat: left;\n\twidth: calc(100% - 48px);\n\tborder-bottom: 1px solid rgba(0,0,0,0.2);\n\tpadding-bottom: 32px;\n\tmargin-bottom: 32px;\n}\n\n@media (min-width: 800px) {\n .container:before{\n width: 50%;\n display: block;\n border-right: 1px solid rgba(0,0,0,0.1);\n }\n \n .module {\n width: calc(50% - 48px);\n }\n}\n\n@media (min-width: 1200px) { \n .module {\n width: calc(33% - 48px);\n }\n\n .container:before{\n width: 33.3%;\n left: 33.3%;\n border-left: 1px solid rgba(0,0,0,0.1);\n }\n}\n\n.module>svg {\n\twidth: 100%\n}\n\n.module h3 {\n\tfont-family: 'Montserrat', sans-serif;\n\tfont-weight: 700;\n\ttext-transform: uppercase;\n\tline-height: 1.1;\n}\n\n.module p{\n line-height: 1.4;\n}\n\n.module .subtitle {\n\tfont-family: "Mercury Text G1", serif;\n\topacity: 0.4;\n\tline-height: 1.1;\n}\n\ntext{\n fill: red;\n}\n\n.sota-heavy-label{\n font-weight: 700;\n}\n\n.sota-num-label, .sota-num-axis .tick text{\n font-family: "Montserrat", sans-serif;\n font-size: 14px;\n fill: ${e.labelColor};\n}\n\n.sota-text-label, .sota-text-axis .tick text{\n font-family: "Mercury Text G1", serif;\n fill: black;\n}\n\n.sota-num-label.sota-stackedBarChart-label-onBar{\n fill: rgba(255,255,255,0.6);\n}\n\n.tooltip {\n\tbackground-color: #222;\n\tcolor: #fff;\n\tpadding: 12px;\n\tposition: absolute;\n\tpointer-events: none;\n\topacity: 0;\n\ttransform: translate(-50%, -100%);\n\twhite-space: nowrap\n}\n\n.sota-gen-axis{\n opacity: 0.4;\n}\n\n.sota-gen-axis.sota-gen-xAxis .tick text {\n\ttransform: translateY(4px);\n}\n\n.sota-gen-axis.sota-gen-yAxis .tick text {\n\ttransform: translateX(-8px);\n\ttext-anchor: end\n}\n\n.sota-gen-xAxis:not(.sota-text-axis) g.tick:first-of-type text:not(.angled-label){\n text-anchor: start;\n}\n\n.sota-gen-xAxis:not(.sota-text-axis) g.tick:last-of-type text:not(.angled-label){\n text-anchor: end;\n}\n\n.sota-gen-axis .tick line,\n.sota-gen-axis path.domain {\n\tstroke-width: ${n}px;\n\tstroke: ${l};\n}\n\n.sota-groupedBarChart-xAxis .tick line {\n\topacity: 0.2\n}\n\n.sota-big {\n\tfont-weight: 700;\n\tfont-size: 96px;\n\tline-height: 1.0;\n\tmargin-top: -8px;\n\tfont-family: "Mercury Text G1", serif\n}\n `;document.head.appendChild(document.createElement("style")).textContent=s,console.log("styles set")}};return o.sotaConfig=e,o.setParam=function(t,e){this.sotaConfig[t]=e},o.getParam=function(t){return this.sotaConfig[t]},o}));