$(window).on("load",(function(){var t=d3.select("#sunburst-sequence"),e=t.node().getBoundingClientRect().width,n=Math.min(e,400)/2,r={w:75,h:30,s:3,t:10},a={home:"#99B898",product:"#FECEA8",search:"#FF847C",account:"#E84A5F",other:"#6C5B7B",end:"#355C7D"},i=0,l=t.append("svg:svg").attr("width",e).attr("height",400).append("svg:g").attr("id","container").attr("transform","translate("+e/2+",200)"),s=d3.layout.partition().size([2*Math.PI,n*n]).value((function(t){return t.size})),d=d3.svg.arc().startAngle((function(t){return t.x})).endAngle((function(t){return t.x+t.dx})).innerRadius((function(t){return Math.sqrt(t.y)})).outerRadius((function(t){return Math.sqrt(t.y+t.dy)}));function o(e){var n=(100*e.value/i).toPrecision(3),s=n+"%";n<.1&&(s="< 0.1%"),d3.select("#percentage").text(s),d3.select("#explanation").style("visibility","");var d=function(t){var e=[],n=t;for(;n.parent;)e.unshift(n),n=n.parent;return e}(e);!function(t,e){var n=d3.select("#trail").selectAll("g").data(t,(function(t){return t.name+t.depth})),i=n.enter().append("svg:g");i.append("svg:polygon").attr("points",u).style("fill",(function(t){return a[t.name]})),i.append("svg:text").attr("x",(r.w+r.t)/2).attr("y",r.h/2).attr("dy","0.35em").attr("text-anchor","middle").text((function(t){return t.name})),n.attr("transform",(function(t,e){return"translate("+e*(r.w+r.s)+", 0)"})),n.exit().remove(),d3.select("#trail").select("#endlabel").attr("x",(t.length+.5)*(r.w+r.s)).attr("y",r.h/2).attr("dy","0.35em").attr("text-anchor","middle").text(e),d3.select("#trail").style("visibility","")}(d,s),t.selectAll("path").style("opacity",.3),l.selectAll("path").filter((function(t){return d.indexOf(t)>=0})).style("opacity",1)}function c(e){d3.select("#trail").style("visibility","hidden"),t.selectAll("path").on("mouseover",null),t.selectAll("path").transition().duration(1e3).style("opacity",1).each("end",(function(){d3.select(this).on("mouseover",o)})),d3.select("#explanation").style("visibility","hidden")}function u(t,e){var n=[];return n.push("0,0"),n.push(r.w+",0"),n.push(r.w+r.t+","+r.h/2),n.push(r.w+","+r.h),n.push("0,"+r.h),e>0&&n.push(r.t+","+r.h/2),n.join(" ")}function h(){var t=d3.select("#legend");"hidden"==t.style("visibility")?t.style("visibility",""):t.style("visibility","hidden")}d3.text("../../../app-assets/data/d3/circle/visit-sequences.csv",(function(t){!function(t){d3.select("#sequence").append("svg:svg").attr("width",e).attr("height",50).attr("id","trail").append("svg:text").attr("id","endlabel").style("fill","#000"),r={w:75,h:30,s:3,r:3},u=d3.select("#legend").append("svg:svg").attr("width",r.w).attr("height",d3.keys(a).length*(r.h+r.s)).selectAll("g").data(d3.entries(a)).enter().append("svg:g").attr("transform",(function(t,e){return"translate(0,"+e*(r.h+r.s)+")"})),u.append("svg:rect").attr("rx",r.r).attr("ry",r.r).attr("width",r.w).attr("height",r.h).style("fill",(function(t){return t.value})),u.append("svg:text").attr("x",r.w/2).attr("y",r.h/2).attr("dy","0.35em").attr("text-anchor","middle").text((function(t){return t.key})),d3.select("#togglelegend").on("click",h),l.append("svg:circle").attr("r",n).style("opacity",0);var r,u;var p=s.nodes(t).filter((function(t){return t.dx>.005})),v=l.data([t]).selectAll("path").data(p).enter().append("svg:path").attr("display",(function(t){return t.depth?null:"none"})).attr("d",d).attr("fill-rule","evenodd").style("fill",(function(t){return a[t.name]})).style("opacity",1).on("mouseover",o);d3.select("#container").on("mouseleave",c),i=v.node().__data__.value}(function(t){for(var e={name:"root",children:[]},n=0;n