!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.line_heatmap=e():t.line_heatmap=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(3),i=r.n(n);function a(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e={container:document.getElementById(this.ID)};e=Object.assign(e,t),this.heatmap=i.a.create(e),console.log(this.heatmap)}},{key:"setTrackData",value:function(t){var e=this;this.heatmap.setData({max:0,min:0,data:[]}),t.forEach(function(t){e.heatmap.addData(t)})}}])&&a(e.prototype,r),n&&a(e,n),t}()},function(t,e,r){"use strict";(function(t){var n=r(0),i=(r(2),'
\n
\n
\n
\n
\n
\n
\n'),a={};function o(t){return t.split("\n").filter(function(t){return t.split(",").length>3}).map(function(t){var e=JSON.parse("["+t+"]");return{x:e[0],y:e[1],value:1}})}e.a={init:function(e,r){var s=document.getElementById(e);s.innerHTML=i;var l=o(r),u=new n.a("line-heatmap-canvas");u.create(),u.setTrackData(l);var c=document.getElementById("line-heatmap-slider");t.create(c,{start:[1,l.length],connect:!0,margin:1,range:{min:1,max:l.length}}),a.container=s,a.heatmap=u,a.data=l,a.slider=c,c.noUiSlider.on("update",function(t,e){var r=this.get();console.log(r);var n=a.data.slice(+r[0]-1,+r[1]+1);console.log(n),a.heatmap.setTrackData(n)})},updateLogString:function(t){var e=o(t);a.data=e,a.slider.noUiSlider.updateOptions({range:{min:1,max:e.length}}),a.heatmap.setTrackData(e)}}}).call(this,r(2))},function(t,e,r){var n,i,a;/*! nouislider - 12.1.0 - 10/25/2018 */i=[],void 0===(a="function"==typeof(n=function(){"use strict";var t="12.1.0";function e(t){return null!=t}function r(t){t.preventDefault()}function n(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function i(t,e,r){r>0&&(l(t,e),setTimeout(function(){u(t,e)},r))}function a(t){return Math.max(Math.min(t,100),0)}function o(t){return Array.isArray(t)?t:[t]}function s(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function l(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function u(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function c(t){var e=void 0!==window.pageXOffset,r="CSS1Compat"===(t.compatMode||""),n=e?window.pageXOffset:r?t.documentElement.scrollLeft:t.body.scrollLeft,i=e?window.pageYOffset:r?t.documentElement.scrollTop:t.body.scrollTop;return{x:n,y:i}}function h(t,e){return 100/(e-t)}function d(t,e){return 100*e/(t[1]-t[0])}function f(t,e){for(var r=1;t>=e[r];)r+=1;return r}function p(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=f(r,t),i=t[n-1],a=t[n],o=e[n-1],s=e[n];return o+function(t,e){return d(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}([i,a],r)/h(o,s)}function m(t,e,r,n){if(100===n)return n;var i=f(n,t),a=t[i-1],o=t[i];return r?n-a>(o-a)/2?o:a:e[i-1]?t[i-1]+function(t,e){return Math.round(t/e)*e}(n-t[i-1],e[i-1]):n}function g(e,r,i){var a;if("number"==typeof r&&(r=[r]),!Array.isArray(r))throw new Error("noUiSlider ("+t+"): 'range' contains invalid value.");if(!n(a="min"===e?0:"max"===e?100:parseFloat(e))||!n(r[0]))throw new Error("noUiSlider ("+t+"): 'range' value isn't numeric.");i.xPct.push(a),i.xVal.push(r[0]),a?i.xSteps.push(!isNaN(r[1])&&r[1]):isNaN(r[1])||(i.xSteps[0]=r[1]),i.xHighestCompleteStep.push(0)}function v(t,e,r){if(!e)return!0;r.xSteps[t]=d([r.xVal[t],r.xVal[t+1]],e)/h(r.xPct[t],r.xPct[t+1]);var n=(r.xVal[t+1]-r.xVal[t])/r.xNumSteps[t],i=Math.ceil(Number(n.toFixed(3))-1),a=r.xVal[t]+r.xNumSteps[t]*i;r.xHighestCompleteStep[t]=a}function x(t,e,r){var n;this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i=[];for(n in t)t.hasOwnProperty(n)&&i.push([t[n],n]);for(i.length&&"object"==typeof i[0][0]?i.sort(function(t,e){return t[0][0]-e[0][0]}):i.sort(function(t,e){return t[0]-e[0]}),n=0;n=100)return t.slice(-1)[0];var n=f(r,e),i=t[n-1],a=t[n],o=e[n-1],s=e[n];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([i,a],(r-o)*h(o,s))}(this.xVal,this.xPct,t)},x.prototype.getStep=function(t){return t=m(this.xPct,this.xSteps,this.snap,t)},x.prototype.getNearbySteps=function(t){var e=f(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},x.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(s);return Math.max.apply(null,t)},x.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var b={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function y(e){if(function(t){return"object"==typeof t&&"function"==typeof t.to&&"function"==typeof t.from}(e))return!0;throw new Error("noUiSlider ("+t+"): 'format' requires 'to' and 'from' methods.")}function _(e,r){if(!n(r))throw new Error("noUiSlider ("+t+"): 'step' is not numeric.");e.singleStep=r}function w(e,r){if("object"!=typeof r||Array.isArray(r))throw new Error("noUiSlider ("+t+"): 'range' is not an object.");if(void 0===r.min||void 0===r.max)throw new Error("noUiSlider ("+t+"): Missing 'min' or 'max' in 'range'.");if(r.min===r.max)throw new Error("noUiSlider ("+t+"): 'range' 'min' and 'max' cannot be equal.");e.spectrum=new x(r,e.snap,e.singleStep)}function S(e,r){if(r=o(r),!Array.isArray(r)||!r.length)throw new Error("noUiSlider ("+t+"): 'start' option is incorrect.");e.handles=r.length,e.start=r}function C(e,r){if(e.snap=r,"boolean"!=typeof r)throw new Error("noUiSlider ("+t+"): 'snap' option must be a boolean.")}function E(e,r){if(e.animate=r,"boolean"!=typeof r)throw new Error("noUiSlider ("+t+"): 'animate' option must be a boolean.")}function D(e,r){if(e.animationDuration=r,"number"!=typeof r)throw new Error("noUiSlider ("+t+"): 'animationDuration' option must be a number.")}function N(e,r){var n,i=[!1];if("lower"===r?r=[!0,!1]:"upper"===r&&(r=[!1,!0]),!0===r||!1===r){for(n=1;n=100)throw new Error("noUiSlider ("+t+"): 'padding' option must not exceed 100% of the range.")}}function P(e,r){switch(r){case"ltr":e.dir=0;break;case"rtl":e.dir=1;break;default:throw new Error("noUiSlider ("+t+"): 'direction' option was not recognized.")}}function A(e,r){if("string"!=typeof r)throw new Error("noUiSlider ("+t+"): 'behaviour' must be a string containing options.");var n=r.indexOf("tap")>=0,i=r.indexOf("drag")>=0,a=r.indexOf("fixed")>=0,o=r.indexOf("snap")>=0,s=r.indexOf("hover")>=0,l=r.indexOf("unconstrained")>=0;if(a){if(2!==e.handles)throw new Error("noUiSlider ("+t+"): 'fixed' behaviour must be used with 2 handles");M(e,e.start[1]-e.start[0])}if(l&&(e.margin||e.limit))throw new Error("noUiSlider ("+t+"): 'unconstrained' behaviour cannot be used with margin or limit");e.events={tap:n||o,drag:i,fixed:a,snap:o,hover:s,unconstrained:l}}function V(e,r){if(!1!==r)if(!0===r){e.tooltips=[];for(var n=0;nA&&((s=L(i,!1)).className=c(o,n.cssClasses.value),s.setAttribute("data-value",a),s.style[n.style]=t+"%",s.innerHTML=r.to(a))}}(a,t[a][0],t[a][1])}),i}function I(){var t;m&&((t=m).parentElement.removeChild(t),m=null)}function G(e){I();var r=e.mode,n=e.density||1,i=e.filter||!1,a=e.values||!1,o=e.stepped||!1,s=function(e,r,n){if("range"===e||"steps"===e)return D.xVal;if("count"===e){if(r<2)throw new Error("noUiSlider ("+t+"): 'values' (>= 2) required for mode 'count'.");var i=r-1,a=100/i;for(r=[];i--;)r[i]=i*a;r.push(100),e="positions"}return"positions"===e?r.map(function(t){return D.fromStepping(n?D.getStep(t):t)}):"values"===e?n?r.map(function(t){return D.fromStepping(D.getStep(D.toStepping(t)))}):r:void 0}(r,a,o),l=function(t,e,r){var n,i={},a=D.xVal[0],o=D.xVal[D.xVal.length-1],s=!1,l=!1,u=0;return(n=r.slice().sort(function(t,e){return t-e}),r=n.filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==a&&(r.unshift(a),s=!0),r[r.length-1]!==o&&(r.push(o),l=!0),r.forEach(function(n,a){var o,c,h,d,f,p,m,g,v,x,b=n,y=r[a+1],_="steps"===e;if(_&&(o=D.xNumSteps[a]),o||(o=y-b),!1!==b&&void 0!==y)for(o=Math.max(o,1e-7),c=b;c<=y;c=(c+o).toFixed(7)/1){for(g=(f=(d=D.toStepping(c))-u)/t,x=f/(v=Math.round(g)),h=1;h<=v;h+=1)i[(p=u+h*x).toFixed(5)]=[D.fromStepping(p),0];m=r.indexOf(c)>-1?V:_?F:A,!a&&s&&(m=0),c===y&&l||(i[d.toFixed(5)]=[c,m]),u=d}}),i}(n,r,s),u=e.format||{to:Math.round};return m=w.appendChild(H(l,i,u))}function X(){var t=h.getBoundingClientRect(),e="offset"+["Width","Height"][n.ort];return 0===n.ort?t.width||h[e]:t.height||h[e]}function Y(t,e,r,i){var a=function(a){return!!(a=function(t,e,r){var n,i,a=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),a){var l=function(t){return t.target===r||r.contains(t.target)};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;n=u[0].pageX,i=u[0].pageY}else{var h=Array.prototype.find.call(t.changedTouches,l);if(!h)return!1;n=h.pageX,i=h.pageY}}return e=e||c(M),(o||s)&&(n=t.clientX+e.x,i=t.clientY+e.y),t.pageOffset=e,t.points=[n,i],t.cursor=o||s,t}(a,i.pageOffset,i.target||e))&&!(w.hasAttribute("disabled")&&!i.doNotReject)&&(o=w,s=n.cssClasses.tap,!((o.classList?o.classList.contains(s):new RegExp("\\b"+s+"\\b").test(o.className))&&!i.doNotReject)&&!(t===b.start&&void 0!==a.buttons&&a.buttons>1)&&(!i.hover||!a.buttons)&&(_||a.preventDefault(),a.calcPoint=a.points[n.ort],void r(a,i)));var o,s},o=[];return t.split(" ").forEach(function(t){e.addEventListener(t,a,!!_&&{passive:!0}),o.push([t,a])}),o}function q(t){var e,r,i,o,s,l,u=t-(e=h,r=n.ort,i=e.getBoundingClientRect(),o=e.ownerDocument,s=o.documentElement,l=c(o),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),r?i.top+l.y-s.clientTop:i.left+l.x-s.clientLeft),d=100*u/X();return d=a(d),n.dir?100-d:d}function J(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&$(t,e)}function W(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return $(t,e);var r=(n.dir?-1:1)*(t.calcPoint-e.startCalcPoint),i=100*r/e.baseSize;at(r>0,i,e.locations,e.handleNumbers)}function $(t,e){e.handle&&(u(e.handle,n.cssClasses.active),E-=1),e.listeners.forEach(function(t){U.removeEventListener(t[0],t[1])}),0===E&&(u(w,n.cssClasses.drag),st(),t.cursor&&(k.style.cursor="",k.removeEventListener("selectstart",r))),e.handleNumbers.forEach(function(t){et("change",t),et("set",t),et("end",t)})}function K(t,e){var i;if(1===e.handleNumbers.length){var a=d[e.handleNumbers[0]];if(a.hasAttribute("disabled"))return!1;i=a.children[0],E+=1,l(i,n.cssClasses.active)}t.stopPropagation();var o=[],s=Y(b.move,U,W,{target:t.target,handle:i,listeners:o,startCalcPoint:t.calcPoint,baseSize:X(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:S.slice()}),u=Y(b.end,U,$,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers}),c=Y("mouseout",U,J,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers});o.push.apply(o,s.concat(u,c)),t.cursor&&(k.style.cursor=getComputedStyle(t.target).cursor,d.length>1&&l(w,n.cssClasses.drag),k.addEventListener("selectstart",r,!1)),e.handleNumbers.forEach(function(t){et("start",t)})}function Q(t){t.stopPropagation();var e=q(t.calcPoint),r=function(t){var e=100,r=!1;return d.forEach(function(n,i){if(!n.hasAttribute("disabled")){var a=Math.abs(S[i]-t);(a1&&!n.events.unconstrained&&(i&&e>0&&(r=Math.max(r,t[e-1]+n.margin)),o&&e1&&n.limit&&(i&&e>0&&(r=Math.min(r,t[e-1]+n.limit)),o&&e1?n.forEach(function(t,r){var n=nt(i,t,i[t]+e,a[r],o[r],!1);!1===n?e=0:(e=n-i[t],i[t]=n)}):a=o=[!0];var s=!1;n.forEach(function(t,n){s=lt(t,r[t]+e,a[n],o[n])||s}),s&&n.forEach(function(t){et("update",t),et("slide",t)})}function ot(t,e){return n.dir?100-t-e:t}function st(){C.forEach(function(t){var e=S[t]>50?-1:1,r=3+(d.length+e*t);d[t].style.zIndex=r})}function lt(t,e,r,i){return!1!==(e=nt(S,t,e,r,i,!1))&&(function(t,e){S[t]=e,N[t]=D.fromStepping(e);var r="translate("+it(rt(ot(e,0)-j),"0")+")";d[t].style[n.transformRule]=r,ut(t),ut(t+1)}(t,e),!0)}function ut(t){if(f[t]){var e=0,r=100;0!==t&&(e=S[t-1]),t!==f.length-1&&(r=S[t]);var i=r-e,a="translate("+it(rt(ot(e,i)),"0")+")",o="scale("+it(i/100,"1")+")";f[t].style[n.transformRule]=a+" "+o}}function ct(t,e){var r=o(t),a=void 0===S[0];e=void 0===e||!!e,n.animate&&!a&&i(w,n.cssClasses.tap,n.animationDuration),C.forEach(function(t){lt(t,function(t,e){return null===t||!1===t||void 0===t?S[e]:("number"==typeof t&&(t=String(t)),t=n.format.from(t),!1===(t=D.toStepping(t))||isNaN(t)?S[e]:t)}(r[t],t),!0,!1)}),C.forEach(function(t){lt(t,S[t],!0,!0)}),st(),C.forEach(function(t){et("update",t),null!==r[t]&&e&&et("set",t)})}function ht(){var t=N.map(n.format.to);return 1===t.length?t[0]:t}return l(x=w,n.cssClasses.target),0===n.dir?l(x,n.cssClasses.ltr):l(x,n.cssClasses.rtl),0===n.ort?l(x,n.cssClasses.horizontal):l(x,n.cssClasses.vertical),h=L(x,n.cssClasses.base),function(t,e){var r=L(e,n.cssClasses.connects);d=[],(f=[]).push(z(r,t[0]));for(var i=0;ir.stepAfter.startValue&&(i=r.stepAfter.startValue-n),a=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===t?i=null:0===t&&(a=null);var o=D.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(o))),null!==a&&!1!==a&&(a=Number(a.toFixed(o))),[a,i]})},on:tt,off:function(t){var e=t&&t.split(".")[0],r=e&&t.substring(e.length);Object.keys(O).forEach(function(t){var n=t.split(".")[0],i=t.substring(n.length);e&&e!==n||r&&r!==i||delete O[t]})},get:ht,set:ct,setHandle:function(e,r,n){var i=[];if(!((e=Number(e))>=0&&es?(e?this.setDataMax(h):this._max=h,!1):h0)for(var t=arguments[0],e=t.length;e--;)this.addData.call(this,t[e]);else{var r=this._organiseData(arguments[0],!0);r&&(0===this._data.length&&(this._min=this._max=r.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[r]}))}return this},setData:function(t){var e=t.data,r=e.length;this._data=[],this._radi=[];for(var n=0;n0&&(this._drawAlpha(t),this._colorize())},renderAll:function(t){this._clear(),t.data.length>0&&(this._drawAlpha(function(t){for(var e=[],r=t.min,n=t.max,i=t.radi,a=(t=t.data,Object.keys(t)),o=a.length;o--;)for(var s=a[o],l=Object.keys(t[s]),u=l.length;u--;){var c=l[u],h=t[s][c],d=i[s][c];e.push({x:s,y:c,value:h,radius:d})}return{min:r,max:n,data:e}}(t)),this._colorize())},_updateGradient:function(e){this._palette=t(e)},updateConfig:function(t){t.gradient&&this._updateGradient(t),this._setStyles(t)},setDimensions:function(t,e){this._width=t,this._height=e,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=e},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(t){this._blur=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=t.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=t.height||this._height,this._opacity=255*(t.opacity||0),this._maxOpacity=255*(t.maxOpacity||t.defaultMaxOpacity),this._minOpacity=255*(t.minOpacity||t.defaultMinOpacity),this._useGradientOpacity=!!t.useGradientOpacity},_drawAlpha:function(t){for(var r=this._min=t.min,n=this._max=t.max,i=(t=t.data||[]).length,a=1-this._blur;i--;){var o,s=t[i],l=s.x,u=s.y,c=s.radius,h=Math.min(s.value,n),d=l-c,f=u-c,p=this.shadowCtx;this._templates[c]?o=this._templates[c]:this._templates[c]=o=e(c,a);var m=(h-r)/(n-r);p.globalAlpha=m<.01?.01:m,p.drawImage(o,d,f),dthis._renderBoundaries[2]&&(this._renderBoundaries[2]=d+2*c),f+2*c>this._renderBoundaries[3]&&(this._renderBoundaries[3]=f+2*c)}},_colorize:function(){var t=this._renderBoundaries[0],e=this._renderBoundaries[1],r=this._renderBoundaries[2]-t,n=this._renderBoundaries[3]-e,i=this._width,a=this._height,o=this._opacity,s=this._maxOpacity,l=this._minOpacity,u=this._useGradientOpacity;t<0&&(t=0),e<0&&(e=0),t+r>i&&(r=i-t),e+n>a&&(n=a-e);for(var c=this.shadowCtx.getImageData(t,e,r,n),h=c.data,d=h.length,f=this._palette,p=3;p0?o:g>0},getDataURL:function(){return this.canvas.toDataURL()}},r}(),i=(t=!1,"canvas2d"===e.defaultRenderer&&(t=n),t),a={merge:function(){for(var t={},e=arguments.length,r=0;r