diff --git a/app/views/clicks/index.html.erb b/app/views/clicks/index.html.erb index da9bfc2..bd607b9 100644 --- a/app/views/clicks/index.html.erb +++ b/app/views/clicks/index.html.erb @@ -1,4 +1,6 @@ -

Listing clicks

+ + +

Clickstream

@@ -11,9 +13,8 @@ - + - <% end %> diff --git a/app/views/layouts/clicks.html.erb b/app/views/layouts/clicks.html.erb index ca1ca3c..7841d48 100644 --- a/app/views/layouts/clicks.html.erb +++ b/app/views/layouts/clicks.html.erb @@ -3,11 +3,71 @@ + + + Clicks: <%= controller.action_name %> <%= stylesheet_link_tag 'scaffold' %> - - + + + + + + +
+

<%= flash[:notice] %>

diff --git a/public/javascripts/excanvas.compiled.js b/public/javascripts/excanvas.compiled.js new file mode 100644 index 0000000..a34ca1d --- /dev/null +++ b/public/javascripts/excanvas.compiled.js @@ -0,0 +1,35 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_|| +b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d','","");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("g.x)g.x=e.x;if(h.y==null||e.yg.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_), +z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l')}else a.push('');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("')}a.push("");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(), +this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a, +0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager= +M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})(); diff --git a/public/javascripts/highcharts.js b/public/javascripts/highcharts.js new file mode 100644 index 0000000..36306c0 --- /dev/null +++ b/public/javascripts/highcharts.js @@ -0,0 +1,81 @@ +/* + Name: Highcharts + Version: 1.0.0 alpha + Author: Torstein Hønsi + Support: www.highcharts.com/support + License: www.highcharts.com/license +*/ +(function(){function V(a,b){a||(a={});for(var c in b)a[c]=b[c];return a}function ub(a){return Aa=W(Aa,a)}function Ja(a,b){var c=function(){};c.prototype=new a;V(c.prototype,b);return c}function Xa(a){for(var b=[],c=a.length-1;c>=0;c--)b.push(a[c]);return b}function vb(a,b){if(typeof a=="string")return a;else if(a.linearGradient){var c=b.createLinearGradient.apply(b,a.linearGradient);z(a.stops,function(d){c.addColorStop(d[0],d[1])});return c}}function Y(a,b,c,d,e){a=Ea.createElement(a);b&&V(a,b);e&& +ma(a,{padding:0,border:"none",margin:0});c&&ma(a,c);d&&d.appendChild(a);return a}function ma(a,b){if(Fa){if(b.opacity!==ba)b.filter="alpha(opacity="+b.opacity*100+")";if(b.cssFloat!==ba)b.styleFloat=b.cssFloat}V(a.style,b)}function wb(a,b,c,d){a=a;var e=isNaN(b=ra(b))?2:b;b=c===ba?".":c;d=d===ba?",":d;c=a<0?"-":"";var g=parseInt(a=ra(+a||0).toFixed(e))+"",j=(j=g.length)>3?j%3:0;return c+(j?g.substr(0,j)+d:"")+g.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+d)+(e?b+ra(a-g).toFixed(e).slice(2):"")}function nb(a, +b,c){function d(w){return w.toString().replace(/^([0-9])$/,"0$1")}b=new Date(b*oa);var e=b.getUTCHours(),g=b.getUTCDay(),j=b.getUTCDate(),f=b.getUTCMonth(),l=b.getUTCFullYear();lang=Aa.lang;var n=lang.weekdays,k=lang.months;b={a:n[g].substr(0,3),A:n[g],d:d(j),e:j,b:k[f].substr(0,3),B:k[f],m:d(f+1),y:l.toString().substr(2,2),Y:l,H:d(e),I:d(e%12),l:e%12,M:d(b.getUTCMinutes()),p:e<12?"AM":"PM",P:e<12?"am":"pm",S:d(b.getUTCSeconds())};for(var m in b)a=a.replace("%"+m,b[m]);return c?a.substr(0,1).toUpperCase()+ +a.substr(1):a}function ob(a){for(var b={x:a.offsetLeft,y:a.offsetTop};a.offsetParent;){a=a.offsetParent;b.x+=a.offsetLeft;b.y+=a.offsetTop;if(a!=Ea.body&&a!=Ea.documentElement){b.x-=a.scrollLeft;b.y-=a.scrollTop}}return b}function xb(a){function b(){var o={line:sa,spline:pb,area:yb,areaspline:zb,column:hb,bar:Ab,pie:Bb,scatter:Cb},r,p;z(a.series,function(E){r=o[E.type||t.defaultSeriesType];p=new r;p.init(s,E);Oa.push(p)})}function c(){var o,r,p,E,J,H=[];z(Oa,function(Q){var v=Q.options.stacking,D= +v=="percent";if(v)var A=H[Q.type]=H[Q.type]||[];if(D){E=0;J=99}if(Q.needsAxes){o=true;z(Q.data,function(B,C){if(r===ba)r=p=B[0];if(E===ba)E=J=B[1];if(B[0]>p)p=B[0];else if(B[0]J)J=C;else if(C"+p.text+""},V(p.style,{zIndex:8}),N)}function l(o,r,p){function E(q,y,K){var G= +1,ha=0;if(K){G*=-1;ha=Ga}if(ib){G*=-1;ha-=G*Ga}if(y)return(q-0)/Qa+Z;return G*(q-Z)*Qa+ha}function J(q,y,K){if(K){var G,ha,ua;G=ha=E(q)+ab;q=ua=S-E(q)-ab;if(p){q=da;ua=S-ja}else{G=O;ha=ca-va}X.drawLine(G,q,ha,ua,y,K)}}function H(q,y,K){var G=(y-q)*Qa;J(q+(y-q)/2,K,G)}function Q(q,y,K,G,ha,ua){var qa,R,wa,L=x.labels;if(y=="inside")ha=-ha;y=R=E(q+Ka)+ab;qa=wa=S-E(q+Ka)-ab;if(p){qa=S-ja;wa=qa+ha}else{y=O;R=y-ha}G&&X.drawLine(y,qa,R,wa,K,G);if(ua&&L.enabled)if((q=bb.call({value:Ba&&Ba[q]?Ba[q]:q}))|| +q===0)Ua.addText(q,y+L.x-(Ka&&p?Ka*Qa*(ib?-1:1):0),qa+L.y-(Ka&&!p?Ka*Qa*(ib?1:-1):0),L.style,L.rotation,L.align)}function v(q,y){var K;Va=y?1:ia.pow(10,xa(ia.log(q)/ia.LN10));K=q/Va;y||(y=[1,2,2.5,5,10]);for(var G=0;G=q)P.setUTCSeconds(L>=y?0:R*xa(P.getUTCSeconds()/R));if(L>=y)P.setUTCMinutes(L>=K?0:R*xa(P.getUTCMinutes()/R));if(L>=K)P.setUTCHours(L>=G?0:R*xa(P.getUTCHours()/R));if(L>=G)P.setUTCDate(L>=ua?1:R*xa(P.getUTCDate()/ +R));if(L>=ua){P.setUTCMonth(L>=qa?0:R*xa(P.getUTCMonth()/R));La=P.getUTCFullYear()}if(L>=qa){La-=La%R;P.setUTCFullYear(La)}L==ha&&P.setUTCDate(P.getUTCDate()-P.getUTCDay()+r.startOfWeek);ya=1;q=Z=P.getTime()/oa;La=P.getUTCFullYear();for(y=P.getUTCMonth();q=0? +Z%ea:ea+Z%ea;if(aa%ea)aa+=ea-aa%ea}for(var q=(Va<1?1/Va:1)*10,y=Z;y<=aa;y+=ea)Ca.push(I(y*q)/q);if(Ba){Z-=0.5;aa+=0.5}bb||(bb=function(){return this.value})}function B(){if(Z===null)Z=r.min===null?o.axes[fa+"Min"]:r.min;if(aa===null)aa=r.max===null?o.axes[fa+"Max"]:r.max;ea=Ba?1:r.tickInterval=="auto"?(aa-Z)*r.tickPixelInterval/Ga:r.tickInterval;if(r.type!="datetime")ea=v(ea);cb=r.minorTickInterval=="auto"&&ea?ea/5:r.minorTickInterval;r.type=="datetime"?D():A();Qa=Ga/(aa-Z)}function C(q,y){var K; +if(y-q>r.maxZoom){Z=q;aa=y}else{K=(r.maxZoom-y+q)/2;Z=q-K;aa=y+K}B()}function M(){Z=aa=ea=cb=Ca=null;B()}function ka(){Ua.clear();x.alternateGridColor&&z(Ca,function(K,G){if(G%2==0&&K0?B:B+fa)+F})}if(x){u=u.clientY- +C-Ma.y-da;ma(M,{height:ra(u)+F,top:(u>0?C:C+u)+F})}}else E(u)};H.onmouseout=v.onmouseout=function(u){u=u?u:Da.event;if((u=u.relatedTarget||u.toElement)&&u!=v&&u.tagName!="AREA"){Q.hide();if(o.hoverSeries){o.hoverSeries.setState();D=o.hoverSeries=null}}};H.onmousedown=v.onmousedown=function(u){u=u?u:Da.event;if(ka||x){u.preventDefault&&u.preventDefault();A=true;B=u.clientX-Ma.x-O;C=u.clientY-Ma.y-da;M||(M=Y(Ha,null,{position:la,border:"none",background:"#4572A7",opacity:0.25,width:ka?0:ta+F,height:x? +0:na+F}));Pa.div.appendChild(M)}};H.onmouseup=v.onmouseup=function(){var u;u=o.xAxis.translate;var fa=o.yAxis.translate;A=false;if(M&&M.offsetWidth>10&&M.offsetHeight>10){u={xMin:u(M.offsetLeft,true),xMax:u(M.offsetLeft+M.offsetWidth,true),yMin:fa(na-M.offsetTop-M.offsetHeight,true),yMax:fa(na-M.offsetTop,true)};M.parentNode.removeChild(M);M=null;o.toolbar.add("zoom","Reset zoom","Reset zoom level 1:1",function(){o.zoom(false);o.toolbar.remove("zoom")});o.zoom(u)}}}function E(u){var fa=o.hoverPoint, +Ga=o.hoverSeries;if(Ga){fa||(fa=Ga.tooltipPoints[Wa?u.clientY-Ma.y-da:u.clientX-Ma.x-O]);if(fa!=D){Q.refresh(fa,Ga);D=fa}}}function J(){var u="highchartsMap"+Eb++;v=Y("img",{useMap:"#"+u,src:"data:image/gif;base64,R0lGODlhAQABAJH/AP///0////"},{width:ta+F,height:na+F,left:O+F,top:da+F,opacity:0,border:"none",position:la,clip:"rect(1px,"+ta+"px,"+na+"px,1px)",zIndex:9},N);return Y("map",{name:u,id:u},null,N)}if(r.enabled){var H,Q=m(r),v,D,A,B,C,M,ka=/x/.test(o.options.chart.zoomType),x=/y/.test(o.options.chart.zoomType); +this.imagemap=H=J();this.tooltip=Q;this.zoomX=ka;this.zoomY=x;p();setInterval(function(){jb&&jb()},13)}}function m(o){function r(D,A){var B=D.tooltipPos,C=s.options,M=o.borderColor||D.color||A.color||"#606060";C=C.chart.inverted;var ka,x,u;ka=D.tooltipText;J=A;if(ka===false)E();else{H.innerHTML=ka;ka=B?B[0]:C?ta-D.y:D.x;B=B?B[1]:C?na-D.x:D.y;x=H.offsetWidth-Q;u=H.offsetHeight-Q;if(x>(v.w||0)+20||x<(v.w||0)-20||u>v.h||v.c!=M){v.clear();v.drawRect(Q/2,Q/2,x+20,u,M,Q,o.borderRadius,o.backgroundColor, +o.shadow);V(v,{w:x,h:u,c:M})}M=ka-v.w+O-35;if((C||M<5)&&ka+v.wS)C=S-v.h-5;p(I(M),I(C));A.drawPointState(D,"hover");za.style.visibility=db}}function p(D,A){var B=za.style.visibility==pa,C=B?D:(za.offsetLeft+D)/2;B=B?A:(za.offsetTop+A)/2;ma(za,{left:C+F,top:B+F});if(ra(D-C)>1||ra(A-B)>1)p(D,A);else jb=null}function E(){if(za)za.style.visibility=pa;J&&J.drawPointState()}var J,H,Q=o.borderWidth,v;za=Y(Ha,null,{position:la,visibility:pa,overflow:pa, +padding:"0 50px 5px 0",zIndex:6},N);v=new ga("tooltip-box",za,null,{width:ta+F,height:na+F});H=Y(Ha,{className:"highcharts-tooltip"},V(o.style,{position:qb,zIndex:2}),za);return{refresh:r,hide:E}}var w=function(o){if(!o.legend){var r,p=o.options.legend,E=p.layout,J=p.symbolWidth,H,Q=[];if(p.enabled){H=Y(Ha,{className:"highcharts-legend highcharts-legend-"+E,innerHTML:'
    '},V({position:la,zIndex:10},p.style),N);z(o.series,function(v){if(v.options.showInLegend){var D= +v.options.legendType=="point"?v.data:[v];z(D,function(A){A.simpleSymbol=/(bar|pie|area|column)/.test(v.type);var B=V(p.itemStyle,{paddingLeft:(A.simpleSymbol?16:J)+p.symbolPadding+F,cssFloat:E=="horizontal"?"left":"none"});A.legendItem=r=Y("li",{innerHTML:p.labelFormatter.call(A),className:A.visible?"":pa},B,H.firstChild);Ra(r,"mouseover",function(){A.visible&&ma(this,p.itemHoverStyle);A.setState("hover")});Ra(r,"mouseout",function(){A.visible&&ma(this,B);A.setState()});Ra(r,"click",function(){var C= +this.className;ma(this,C?B:p.itemHiddenStyle);A.setVisible(C)});Q.push(A)})}});if(p.borderWidth||p.backgroundColor)X.drawRect(H.offsetLeft,H.offsetTop,H.offsetWidth,H.offsetHeight,p.borderColor,p.borderWidth,p.borderRadius,p.backgroundColor,p.shadow);z(Q,function(v){var D=v.legendItem,A=H.offsetLeft+D.offsetLeft;D=H.offsetTop+D.offsetTop+D.offsetHeight/2;!v.simpleSymbol&&v.options&&v.options.lineWidth&&X.drawLine(A,D,A+J,D,v.color,v.options.lineWidth);if(v.simpleSymbol)X.drawRect(A,D-6,16,12,null, +0,2,v.color);else v.options&&v.options.marker&&v.options.marker.enabled&&v.drawMarker(X,A+J/2,D,v.options.marker)})}}};if(a.chart&&a.chart.inverted)Aa=W(Aa,Fb);a=W(Aa,a);var t=a.chart,U=t.margin;if(typeof U=="number")U=[U,U,U,U];var s=this,N=Ea.getElementById(t.renderTo),da=U[0],va=U[1],ja=U[2],O=U[3],X=new ga("chart-background",N),S,ca,Pa,na,ta,Ya,Za,Oa=[],Ma=ob(N),$a,Wa,jb,za;Ra(Da,"resize",function(){Ma=ob(N)});s.addLoading=function(o){s.resources[o]=false};s.clearLoading=function(o){s.resources[o]= +true;d()};s.options=a;s.series=Oa;s.resources={};s.inverted=Wa=a.chart.inverted;s.chartWidth=ca=N.offsetWidth;s.chartHeight=S=N.offsetHeight;s.plotWidth=ta=ca-O-va;s.plotHeight=na=S-da-ja;s.plotLeft=O;s.plotTop=da;s.stacks={column:[],area:[],areaspline:[]};s.plotLayer=Pa=new ga("plot",N,null,{position:la,width:ta+F,height:na+F,left:O+F,top:da+F,overflow:pa});this.tracker=new k(s,a.tooltip);if(t.plotBackgroundImage){s.addLoading("plotBack");$a=Y("img");$a.onload=function(){s.clearLoading("plotBack")}; +$a.src=t.plotBackgroundImage}b();d()}function rb(a){for(var b=[],c=[],d=0;d=0;b--)this.y2[b]=this.y2[b]*this.y2[b+1]+a[b]}var ba,Ea=document,Da=window, +ia=Math,I=ia.round,xa=ia.floor,ra=ia.abs,eb=ia.cos,fb=ia.sin,T=navigator.userAgent,Fa=/msie/i.test(T)&&!Da.opera,Gb=/AppleWebKit/.test(T),Eb=0,Sa=0,kb=0,sb={},tb=0,oa=1,Ha="div",la="absolute",qb="relative",pa="hidden",db="visible",F="px",z,Na,W,lb,Ra,gb;if(Da.jQuery){var Ta=jQuery;z=function(a,b){for(var c=0,d=a.length;c"+ +(this.point.name||this.series.name)+"
    X value: "+this.x+"
    Y value: "+this.y},backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,style:{color:"#333333",fontSize:"9pt",padding:"5px",font:T}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer",margin:"20px",font:T}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",style:{position:la,right:"50px",bottom:"5px",color:"#999",textDecoration:"none",font:T.replace("12px","10px")}}};Aa.yAxis= +W(Aa.xAxis,{gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,rotation:270,tickWidth:0,title:{enabled:true,margin:40,rotation:270,text:"Y-values"}});T=Aa.plotOptions;Ia=T.line;T.spline=W(Ia);T.scatter=W(Ia,{lineWidth:0,states:{hover:{lineWidth:0}}});T.area=W(Ia,{fillColor:"auto"});T.areaspline=W(T.area);T.column=W(Ia,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,pointPadding:0.1,states:{hover:{brightness:0.1,shadow:false}}}); +T.bar=W(T.column,{dataLabels:{align:"left",x:5,y:0}});T.pie=W(Ia,{center:["50%","50%"],legendType:"point",size:"90%",slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});var Fb={xAxis:{reversed:true,labels:{align:"right",x:-8,y:3},title:{rotation:270}},yAxis:{labels:{align:"center",x:0,y:14},title:{rotation:0}}},mb=function(a){function b(f){if(j=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(f))g=[parseInt(j[1]),parseInt(j[2]),parseInt(j[3]), +parseFloat(j[4])];else if(j=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f))g=[parseInt(j[1],16),parseInt(j[2],16),parseInt(j[3],16),1]}function c(){return g?"rgba("+g.join(",")+")":a}function d(f){if(typeof f=="number"&&f!=0)for(var l=0;l<3;l++){g[l]+=parseInt(f*255);if(g[l]<0)g[l]=0;if(g[l]>255)g[l]=255}return this}function e(f){g[3]=f;return this}var g,j;b(a);return{get:c,brighten:d,setOpacity:e}},ga=function(a,b,c,d){var e=this;c=V({className:"highcharts-"+a},c);d=V({width:b.offsetWidth+ +F,height:b.offsetHeight+F,position:la,top:0,left:0,margin:0,padding:0,border:"none"},d);a=Y(Ha,c,d,b);V(e,{div:a,width:a.offsetWidth,height:a.offsetHeight});e.svg=Fa?"":''};ga.prototype={getCtx:function(){if(!this.ctx){var a=Y("canvas",{id:"highcharts-canvas-"+tb++,width:this.width,height:this.height},{position:la},this.div); +if(Fa){G_vmlCanvasManager.initElement(a);a=Ea.getElementById(a.id)}this.ctx=a.getContext("2d")}return this.ctx},getSvg:function(){if(!this.svgObject){var a=this,b=a.div,c=a.width;a=a.height;if(Fa){if(!Ea.namespaces.g_vml_){Ea.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml");Ea.createStyleSheet().cssText="g_vml_\\:*{behavior:url(#default#VML)}"}this.svgObject=Y(Ha,null,{width:c+F,height:a+F,position:la},b)}else this.svgObject=Y("object",{width:c,height:a,type:"image/svg+xml"},{position:la, +left:0,top:0},b)}return this.svgObject},drawLine:function(a,b,c,d,e,g){var j=this.getCtx();if(a==c)a=c=I(a)+g%2/2;if(b==d)b=d=I(b)+g%2/2;j.lineWidth=g;j.lineCap="round";j.beginPath();j.moveTo(a,b);j.strokeStyle=e;j.lineTo(c,d);j.closePath();j.stroke()},drawPolyLine:function(a,b,c,d,e){var g=this.getCtx(),j=[];if(d&&c){z(a,function(f){j.push(f===ba?f:f+1)});for(d=1;d<=3;d++)this.drawPolyLine(j,"rgba(0, 0, 0, "+0.05*d+")",6-2*d)}g.beginPath();for(d=0;d'}else{f=true;j.svg+=''+a+""}j.hasObject=f}},strokeText:function(){if(this.hasObject){var a=this.getSvg(),b=this.svg;if(Fa)a.innerHTML=b;else{a.data="data:image/svg+xml,"+b+"";Gb&&this.div.appendChild(a)}}},clear:function(){var a=this,b=this.div,c=b.childNodes;a.ctx&&a.ctx.clearRect(0,0,a.width,a.height);if(a.svgObject){b.removeChild(a.svgObject);a.svgObject=null}for(var d=c.length-1;d>=0;d--){a=c[d];a.tagName=="SPAN"&&b.removeChild(a)}},hide:function(){this.div.style.visibility= +pa},show:function(){this.div.style.visibility=db}};var sa=function(){this.needsAxes=true;this.type="line"};sa.prototype={init:function(a,b){var c=this;c.chart=a;b=c.setOptions(b);V(c,{options:b,name:b.name,state:"",visible:b.visible||b.visible===ba});c.getColor();c.getSymbol();c.getData(b)},getData:function(a){var b=this,c=b.chart,d="series"+tb++;if(!a.data&&a.dataURL){c.addLoading(d);getAjax(a.dataURL,function(e){b.dataLoaded(e);c.clearLoading(d)})}else b.dataLoaded(a.data)},dataLoaded:function(a){var b= +this,c=b.chart,d=b.options,e=d.dataParser,g={},j,f;if(d.dataURL&&!e)e=function(k){return eval(k)};if(e)a=e.call(b,a);this.layerGroup=j=new ga("series-group",c.plotLayer.div,null,{zIndex:2});z(["","hover"],function(k){g[k]=new ga("state-"+k,j.div);k&&g[k].hide()});this.stateLayers=g;b.visible||b.setVisible(false);f=d.pointStart||0;a=Na(a,function(k){var m=k,w;if(typeof k=="number"||k===null)m=[f,k];else if(typeof k=="object"&&typeof k.length!="number"){m=[k.x===ba?f:k.x,k.y];for(w in k)m[w]=k[w]}else if(typeof k[0]== +"string"){k.name=k[0];k[0]=f;m=k}f+=d.pointInterval||1;return m});b.data=c.options.xAxis.reversed?Xa(a):a;var l=-1,n=[];z(a,function(k,m){if(k[1]===null){m>l+1&&n.push(a.slice(l+1,m));l=m}else m==a.length-1&&n.push(a.slice(l+1,m+1))});this.segments=n},setOptions:function(a){return W(this.chart.options.plotOptions[this.type],a)},getColor:function(){var a=this.chart.options.colors;this.color=this.options.color||a[Sa++]||"#0000ff";if(Sa>=a.length)Sa=0},getSymbol:function(){var a=this.chart.options.symbols, +b=this.options.marker.symbol||"auto";if(b=="auto")b=a[kb++];this.symbol=b;if(kb>=a.length)kb=0},translate:function(){var a=this.chart,b=this,c=b.options.stacking,d=a.stacks[b.type];z(this.data,function(e){var g=e[0],j=e[1],f;e.x=a.xAxis.translate(e[0]);if(c){f=d[g];g=f.cum=(f.cum||f.total)-j;j=g+j;if(c=="percent"){g=g*100/f.total;j=j*100/f.total;e.percentage=e[1]*100/f.total}e.yBottom=a.yAxis.translate(g,0,1)}if(j!==null)e.y=a.yAxis.translate(j,0,1);e.clientX=a.inverted?a.plotHeight-e.x+a.plotTop: +e.x+a.plotLeft});this.setTooltipPoints()},setTooltipPoints:function(){var a=this,b=a.chart,c=b.inverted,d=b.xAxis.categories,e=[],g=c?b.plotHeight:b.plotWidth,j,f,l=[];z(a.segments,function(n){e=e.concat(n)});if(b.options.xAxis.reversed)e=Xa(e);z(e,function(n,k){n.tooltipText=b.options.tooltip.formatter.call({series:a,point:n,x:d&&d[n[0]]!==ba?d[n[0]]:n[0],y:n[1],percentage:n.percentage});j=e[k-1]?e[k-1].high+1:0;for(f=n.high=e[k+1]?xa((n.x+(e[k+1]?e[k+1].x:g))/2):g;j<=f;)l[c?g-j++:j++]=n});a.tooltipPoints= +l},drawLine:function(a){var b=this,c=b.options,d=b.chart,e=b.stateLayers[a],g=c.lineColor||b.color,j=c.fillColor=="auto"?mb(b.color).setOpacity(c.fillOpacity||0.75).get():c.fillColor,f=d.inverted,l=(f?0:d.chartHeight)-d.yAxis.translate(0);if(a)c=W(c,c.states[a]);b.animate&&b.animate(true);z(b.segments,function(n){var k=[],m=[];z(n,function(t){k.push(f?d.plotWidth-t.y:t.x,f?d.plotHeight-t.x:t.y)});if(/area/.test(b.type)){for(var w=0;w=0;w--)m.push(n[w].x,n[w].yBottom);else m.push(f?l:n[n.length-1].x,f?n[0].x:l,f?l:n[0].x,f?n[n.length-1].x:l);e.drawPolyLine(m,null,null,c.shadow,j)}c.lineWidth&&e.drawPolyLine(k,g,c.lineWidth,c.shadow)});b.animate&&b.animate()},animate:function(a){var b=this,c=b.layerGroup.div;if(a)ma(c,{overflow:pa,width:0});else{gb(c,{width:b.chart.plotWidth+F},{duration:1E3});this.animate=null}},drawPoints:function(a){var b=this,c=b.stateLayers[a],d=b.options,e=d.marker,g=b.data,j=b.chart,f=j.inverted; +if(a){a=d.states[a].marker;if(a.lineWidth===ba)a.lineWidth=e.lineWidth+1;if(a.radius===ba)a.radius=e.radius+1;e=W(e,a)}e.enabled&&z(g,function(l){if(l.y!==ba)b.drawMarker(c,f?j.plotWidth-l.y:l.x,f?j.plotHeight-l.x:l.y,W(e,l.marker))})},drawMarker:function(a,b,c,d){if(d.lineColor=="auto")d.lineColor=this.color;if(d.fillColor=="auto")d.fillColor=this.color;if(d.symbol=="auto")d.symbol=this.symbol;a.drawSymbol(d.symbol,b,c,d.radius,d.lineWidth,d.lineColor,d.fillColor)},drawDataLabels:function(){if(this.options.dataLabels.enabled&& +!this.hasDrawnDataLabels){var a=this,b,c,d=a.data,e=a.options.dataLabels,g,j,f=a.chart,l=f.inverted,n=a.type=="pie";a.dataLabelsLayer=j=new ga("data-labels",a.layerGroup.div,null,{zIndex:1});e.style.color=e.color=="auto"?a.color:e.color;z(d,function(k){g=e.formatter.call({x:k[0],y:k[1],series:a,point:k});b=(l?f.plotWidth-k.y:k.x)+e.x;c=(l?f.plotHeight-k.x:k.y)+e.y;if(k.tooltipPos){b=k.tooltipPos[0]+e.x;c=k.tooltipPos[1]+e.y}if(n)j=new ga("data-labels",k.layer.div,null,{zIndex:3});if(g)j[n?"drawText": +"addText"](g,b,c,e.style,e.rotation,e.align)});n||j.strokeText();a.hasDrawnDataLabels=true}},drawPointState:function(a,b){var c=this.chart,d=c.inverted,e=c.singlePointLayer,g=this.options;if(!e)e=c.singlePointLayer=new ga("single-point",c.plotLayer.div,null,{zIndex:3});e.clear();if(b){var j=g.states[b].marker;b=g.marker.states[b];if(b.radius===ba)b.radius=j.radius+2;if(g=W(g.marker,a.marker,j,b))this.drawMarker(e,d?c.plotWidth-a.y:a.x,d?c.plotHeight-a.x:a.y,g)}},render:function(){this.drawDataLabels(); +for(var a in this.stateLayers){this.drawLine(a);this.drawPoints(a)}},clear:function(){var a=this.stateLayers;for(var b in a){a[b].clear();a[b].cleared=true}if(this.dataLabelsLayer){this.dataLabelsLayer.clear();this.hasDrawnDataLabels=false}},setState:function(a){a=a||"";if(this.state!=a){var b=this,c=b.stateLayers,d=c[a];c=c[b.state];(b.state=a)?d.show():c.hide()}},setVisible:function(a){this.visible=a?true:false;a?this.layerGroup.show():this.layerGroup.hide();if(this.legendItem)this.legendItem.className= +a?"":pa},getAreaCoords:function(){var a=this.chart,b=a.inverted,c=a.plotWidth,d=a.plotHeight,e=10,g=[];z(this.segments,function(j,f){if(a.options.xAxis.reversed)j=Xa(j);var l=[],n=[],k=[];z([n,k],function(m){for(var w=0,t=0,U,s,N=[j[0]],da=m==n?1:-1,va,ja,O,X,S,ca;j[t];){if(j[t].x>j[w].x+e||t==j.length-1){U=j[t];s=j.slice(w,t-1);z(s,function(Pa){if(da*Pa.y0){ja=N[t].x;va=N[t].y;w=ja-N[t-1].x;O=s=va- +N[t-1].y;X=-w;w=ia.sqrt(ia.pow(O,2)+ia.pow(X,2));S=da*e/w;w=I(N[t-1].x+S*O);s=I(N[t-1].y+S*X);ja=I(ja+S*O);O=I(va+S*X);if(m[m.length-1]&&m[m.length-1][0]>w)for(va=false;!va;){ca=m.pop();X=m[m.length-1];if(!X)break;S=(s-O)/(w-ja);ca=(X[1]-ca[1])/(X[0]-ca[0]);ca=(-ca*X[0]+X[1]+S*w-s)/(S-ca);S=S*(ca-w)+s;if(ca>X[0]){m.push([I(ca),I(S),1]);va=true}}else isNaN(w)||m.push([w,s]);m[m.length-1]&&m[m.length-1][0]=0;f--)l.push(b?c-k[f][1]:k[f][0],b?d-k[f][0]:k[f][1]);l.length||l.push(I(j[0].x),I(j[0].y));g.push([l.join(",")])});return g},createArea:function(){var a,b=this,c=b.chart,d=b.getAreaCoords(),e=c.tracker.imagemap,g=e.firstChild,j=[],f;z(d,function(l){f=/^[0-9]+,[0-9]+$/.test(l[0]);a=Y("area",{shape:f?"circle":"poly",chart:c,coords:l[0]+(f?",10":""),onmouseover:function(){if(b.visible){var n=c.hoverSeries;c.hoverPoint=l[1];n&&n!=b&&n.setState();e.insertBefore(this,e.childNodes[0]); +b.setState("hover");c.hoverSeries=b}}});g?e.insertBefore(a,g):e.appendChild(a);j.push(a)});b.areas=j}};var yb=Ja(sa,{type:"area"}),pb=Ja(sa,{type:"spline",drawLine:function(){this.segments=this.splinedata||this.getSplineData();sa.prototype.drawLine.apply(this,arguments)},getSplineData:function(){var a=this.chart,b=[],c;z(this.segments,function(d){if(a.options.xAxis.reversed)d=Xa(d);var e=[];z(d,function(g,j){var f=d[j+2]||d[j+1]||g;j=d[j-2]||d[j-1]||g;f.x>0&&j.x +1)c=I(ia.max(a.plotWidth,e[e.length-1].clientX-e[0].clientX)/3);b.push(c?(new rb(e)).get(c):[])});return this.splinedata=b}}),zb=Ja(pb,{type:"areaspline"}),hb=Ja(sa,{type:"column",init:function(){sa.prototype.init.apply(this,arguments);var a=this.chart;if(a.columnCount&&!this.options.stacking)a.columnCount++;else a.columnCount=1;this.columnNumber=a.columnCount},translate:function(){sa.prototype.translate.apply(this);var a=this.options,b=this.chart,c=this.data[1].x-this.data[0].x,d=c*a.groupPadding, +e=c-2*d;e=e/b.columnCount;a=e*a.pointPadding;var g=e-2*a,j=b.options.xAxis.reversed?b.columnCount-this.columnNumber:this.columnNumber-1,f=-(c/2)+d+j*e+a;b.xAxis.translate(0);z(this.data,function(l){l.x+=f;l.w=g;l.y0=b[b.inverted?"plotWidth":"plotHeight"]-b.yAxis.translate(0);l.h=(l.yBottom||l.y0)-l.y})},drawLine:function(){},getSymbol:function(){},drawPoints:function(a){var b=this,c=b.options,d=b.chart,e=d.inverted,g=b.data;a=b.state;var j=b.stateLayers[a];b.animate&&this.animate(true);z(g,function(f){h= +f.h;if(f.y!==ba)j.drawRect(e?f.y0-d.plotWidth:f.x,e?d.plotHeight-f.x-f.w:f.h>=0?f.y:f.y+f.h,e?f.h:f.w,e?f.w:ra(f.h),c.borderColor,c.borderWidth,c.borderRadius,b.color,c.shadow)});this.animate&&this.animate()},drawPointState:function(a,b){var c=this,d=c.chart,e=d.inverted,g=c.singlePointLayer;if(!g)g=c.singlePointLayer=new ga("single-point-layer",c.layerGroup.div);g.clear();if(b&&this.options.states[b]){b=W(this.options,this.options.states[b]);g.drawRect(e?a.y0-d.plotWidth:a.x,e?d.plotHeight-a.x-a.w: +a.y,e?a.h:a.w,e?a.w:a.h,b.borderColor,b.borderWidth,b.borderRadius,mb(b.color||this.color).brighten(b.brightness).get(),b.shadow)}},getAreaCoords:function(){var a=[],b=this.chart,c=b.inverted;z(this.data,function(d){var e=c?d.y0-b.plotWidth:d.x,g=c?b.plotHeight-d.x-d.w:d.y,j=g+(c?d.w:d.h),f=e+(c?d.h:d.w);a.push([Na([e,j,e,g,f,g,f,j],I).join(","),d])});return a},animate:function(a){var b=this,c=b.chart,d=c.inverted;b=b.layerGroup.div;if(a)b.style[d?"left":"top"]=(d?-c.plotWidth:c.plotHeight)+F;else{gb(b, +this.chart.inverted?{left:0}:{top:0});this.animate=null}}}),Ab=Ja(hb,{type:"bar",init:function(a){a.inverted=true;hb.prototype.init.apply(this,arguments)}}),Cb=Ja(sa,{type:"scatter",getAreaCoords:function(){var a=this.data,b=[];z(a,function(c){b.push([[I(c.x),I(c.y)].join(","),c])});return b}}),Bb=Ja(sa,{type:"pie",needsAxes:false,getColor:function(){},translate:function(){var a=0,b=this,c=-0.25,d=b.options,e=d.slicedOffset,g=d.center,j=b.chart,f=b.data,l=2*ia.PI,n=j.options.colors;g.push(d.size); +g=Na(g,function(k,m){return/%$/.test(k)?j["plot"+(m?"Height":"Width")]*parseInt(k)/100:k});z(f,function(k){a+=k[1]});z(f,function(k){k.start=c*l;c+=k[1]/a;k.end=c*l;k.center=[g[0],g[1]];k.size=g[2];var m=(k.end+k.start)/2;k.centerSliced=Na([eb(m)*e+g[0],fb(m)*e+g[1]],I);if(!k.color)k.color=n[Sa++];if(Sa>=n.length)Sa=0;if(k.visible===ba)k.visible=1;if(!k.layer)k.layer=new ga("pie",b.layerGroup.div);k.setState=function(w){b.drawPointState(k,w)};k.setVisible=function(w){var t=w?"show":"hide",U=k.legendItem; +k.visible=w;k.layer[t]();if(U)U.className=w?"":pa}});this.setTooltipPoints()},render:function(){this.pointsDrawn||this.drawPoints();this.drawDataLabels()},drawPoints:function(){var a=this;z(this.data,function(b){a.drawPoint(b,b.layer.getCtx(),b.color)});a.pointsDrawn=true},getSymbol:function(){},drawPointState:function(a,b){var c=this,d=c.options,e;if(a){e=a.stateLayer;if(!e)e=a.stateLayer=new ga("state-layer",a.layer.div);e.clear();if(b&&c.options.states[b]){b=W(d,d.states[b]);this.drawPoint(a,e.getCtx(), +b.color||a.color,b.brightness)}}c.hoverPoint&&c.hoverPoint.stateLayer.clear();c.hoverPoint=a},drawPoint:function(a,b,c,d){var e=a.sliced?a.centerSliced:a.center,g=e[0];e=e[1];var j=a.size;b.fillStyle=mb(c).brighten(d).get(b);b.beginPath();b.moveTo(g,e);b.arc(g,e,j/2,a.start,a.end,false);b.lineTo(g,e);b.closePath();b.fill()},getAreaCoords:function(){var a=[];z(this.data,function(b){for(var c=b.center[0],d=b.center[1],e=b.size/2,g=b.start,j=b.end,f=[],l=g;l;l+=0.25){if(l>=j)l=j;f=f.concat([c+eb(l)* +e,d+fb(l)*e]);if(l>=j)break}f=f.concat([c,d]);b.tooltipPos=[c+2*eb((g+j)/2)*e/3,d+2*fb((g+j)/2)*e/3];a.push([Na(f,I).join(","),b])});return a}});rb.prototype={get:function(a){a||(a=50);var b=this.n;b=(this.xdata[b-1]-this.xdata[0])/(a-1);var c=[],d=[];c[0]=this.xdata[0];d[0]=this.ydata[0];for(var e=[{x:c[0],y:d[0]}],g=1;g1;){var d=(b+c)/2;if(this.xdata[xa(d)]>a)b=d;else c= +d}b=xa(b);c=xa(c);d=this.xdata[b]-this.xdata[c];var e=(this.xdata[b]-a)/d;a=(a-this.xdata[c])/d;return e*this.ydata[c]+a*this.ydata[b]+((e*e*e-e)*this.y2[c]+(a*a*a-a)*this.y2[b])*d*d/6}};Highcharts={numberFormat:wb,dateFormat:nb,setOptions:ub,Chart:xb}})(); -- libgit2 0.21.2
    <%=h click.site_id %> <%=h click.visitor_id %><%=h click.additional_info %><%=h click.what_was_clicked %> <%= link_to 'Show', click %><%= link_to 'Edit', edit_click_path(click) %> <%= link_to 'Destroy', click, :confirm => 'Are you sure?', :method => :delete %>