Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vis-graph3d

Package Overview
Dependencies
Maintainers
4
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vis-graph3d - npm Package Compare versions

Comparing version 5.9.4 to 5.9.5

6

esnext/esm/vis-graph3d.min.js

@@ -7,4 +7,4 @@ /**

*
* @version 5.9.4
* @date 2020-05-16T21:59:04.997Z
* @version 5.9.5
* @date 2020-05-20T22:38:31.992Z
*

@@ -27,3 +27,3 @@ * @copyright (c) 2011-2017 Almende B.V, http://almende.com

*/
import t from"component-emitter";import{addEventListener as e,preventDefault as i,removeEventListener as o,selectiveDeepExtend as n,isValidHex as a,hexToRGB as r,HSVToRGB as s,copyAndExtendArray as h,copyArray as l}from"vis-util/esnext";import{DataView as d,DataSet as c}from"vis-data/esnext";function u(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}u.subtract=function(t,e){var i=new u;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,i},u.add=function(t,e){var i=new u;return i.x=t.x+e.x,i.y=t.y+e.y,i.z=t.z+e.z,i},u.avg=function(t,e){return new u((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},u.scalarProduct=function(t,e){return new u(t.x*e,t.y*e,t.z*e)},u.dotProduct=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},u.crossProduct=function(t,e){var i=new u;return i.x=t.y*e.z-t.z*e.y,i.y=t.z*e.x-t.x*e.z,i.z=t.x*e.y-t.y*e.x,i},u.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},u.prototype.normalize=function(){return u.scalarProduct(this,1/this.length())};var p=u;var f=function(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0};function m(t,e){if(void 0===t)throw new Error("No container element defined");if(this.container=t,this.visible=!e||null==e.visible||e.visible,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}function v(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}m.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},m.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},m.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date-t,o=Math.max(this.playInterval-i,0),n=this;this.playTimeout=setTimeout((function(){n.playNext()}),o)},m.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},m.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},m.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},m.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},m.prototype.setPlayInterval=function(t){this.playInterval=t},m.prototype.getPlayInterval=function(){return this.playInterval},m.prototype.setPlayLoop=function(t){this.playLoop=t},m.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},m.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},m.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},m.prototype.setIndex=function(t){if(!(t<this.values.length))throw new Error("Index out of range");this.index=t,this.redraw(),this.onChange()},m.prototype.getIndex=function(){return this.index},m.prototype.get=function(){return this.values[this.index]},m.prototype._onMouseDown=function(t){if(t.which?1===t.which:1===t.button){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var o=this;this.onmousemove=function(t){o._onMouseMove(t)},this.onmouseup=function(t){o._onMouseUp(t)},e(document,"mousemove",this.onmousemove),e(document,"mouseup",this.onmouseup),i(t)}},m.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,o=Math.round(i/e*(this.values.length-1));return o<0&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},m.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return t/(this.values.length-1)*e+3},m.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,o=this.startSlideX+e,n=this.leftToIndex(o);this.setIndex(n),i()},m.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",o(document,"mousemove",this.onmousemove),o(document,"mouseup",this.onmouseup),i()},v.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},v.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t||0,this._end=e||0,this.setStep(i,o)},v.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),!0===this.prettyStep?this._step=v.calculatePrettyStep(t):this._step=t)},v.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),a=i;return Math.abs(o-t)<=Math.abs(a-t)&&(a=o),Math.abs(n-t)<=Math.abs(a-t)&&(a=n),a<=0&&(a=1),a},v.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},v.prototype.getStep=function(){return this._step},v.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()<this._start&&this.next()},v.prototype.next=function(){this._current+=this._step},v.prototype.end=function(){return this._current>this._end};var y=v;function g(){this.armLocation=new p,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraOffset=new p,this.offsetMultiplier=.6,this.cameraLocation=new p,this.cameraRotation=new p(.5*Math.PI,0,0),this.calculateCameraOrientation()}g.prototype.setOffset=function(t,e){var i=Math.abs,o=Math.sign,n=this.offsetMultiplier,a=this.armLength*n;i(t)>a&&(t=o(t)*a),i(e)>a&&(e=o(e)*a),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},g.prototype.getOffset=function(){return this.cameraOffset},g.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},g.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},g.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},g.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},g.prototype.getArmLength=function(){return this.armLength},g.prototype.getCameraLocation=function(){return this.cameraLocation},g.prototype.getCameraRotation=function(){return this.cameraRotation},g.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=this.cameraRotation.z,i=this.cameraOffset.x,o=this.cameraOffset.y,n=Math.sin,a=Math.cos;this.cameraLocation.x=this.cameraLocation.x+i*a(e)+o*-n(e)*a(t),this.cameraLocation.y=this.cameraLocation.y+i*n(e)+o*a(e)*a(t),this.cameraLocation.z=this.cameraLocation.z+o*n(t)};var x={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},w={dot:x.DOT,"dot-line":x.DOTLINE,"dot-color":x.DOTCOLOR,"dot-size":x.DOTSIZE,line:x.LINE,grid:x.GRID,surface:x.SURFACE,bar:x.BAR,"bar-color":x.BARCOLOR,"bar-size":x.BARSIZE},b=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showXAxis","showYAxis","showZAxis","showGrayBottom","showGrid","showPerspective","showShadow","showSurfaceGrid","keepAspectRatio","rotateAxisLabels","verticalRatio","dotSizeRatio","dotSizeMinFraction","dotSizeMaxFraction","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","axisFontSize","axisFontType","gridColor","xCenter","yCenter","zoomable","tooltipDelay","ctrlToZoom"],_=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],C=void 0;function S(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function L(t,e){return void 0===t||""===t?e:t+(void 0===(i=e)||""===i||"string"!=typeof i?i:i.charAt(0).toUpperCase()+i.slice(1));var i}function T(t,e,i,o){for(var n,a=0;a<i.length;++a)e[L(o,n=i[a])]=t[n]}function M(t,e,i,o){for(var n,a=0;a<i.length;++a)void 0!==t[n=i[a]]&&(e[L(o,n)]=t[n])}function R(t,e){if(void 0!==t.backgroundColor&&function(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!=typeof t)throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}(t.backgroundColor,e),function(t,e){if(void 0===t)return;void 0===e.dataColor&&(e.dataColor={});"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth))}(t.dataColor,e),function(t,e){if(void 0===t)return;var i;if("string"==typeof t){if(-1===(i=function(t){var e=w[t];if(void 0===e)return-1;return e}(t)))throw new Error("Style '"+t+"' is invalid")}else{if(!function(t){var e=!1;for(var i in x)if(x[i]===t){e=!0;break}return e}(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}(t.style,e),void 0!==t.surfaceColors){if(console.warn("`options.surfaceColors` is deprecated and may be removed in a future version. Please use `options.colormap` instead. Note that the `colormap` option uses the inverse array ordering (running from vMin to vMax)."),void 0!==t.colormap)throw new Error("The `colormap` and `surfaceColors` options are mutually exclusive.");"surface"!==e.style?console.warn("Ignoring `surfaceColors` in graph style `"+e.style+"` for backward compatibility (only effective in `surface` plots)."):function(t,e){if(void 0===t||!0===t)return;if(!1===t)return void(e.surfaceColors=void 0);void 0===e.surfaceColors&&(e.surfaceColors={});let i;if(Array.isArray(t))i=z(t);else{if("object"!=typeof t)throw new Error("Unsupported type of surfaceColors");i=P(t.hue)}i.reverse(),e.colormap=i}(t.surfaceColors,e)}else!function(t,e){if(void 0===t)return;let i;if(Array.isArray(t))i=z(t);else if("object"==typeof t)i=P(t.hue);else{if("function"!=typeof t)throw new Error("Unsupported type of colormap");i=t}e.colormap=i}(t.colormap,e);!function(t,e){if(void 0===t){if(void 0===C.showLegend){var i=e.style===x.DOTCOLOR||e.style===x.DOTSIZE;e.showLegend=i}}else e.showLegend=t}(t.showLegend,e),A(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),null!=t.onclick&&(e.onclick_callback=t.onclick,console.warn("`options.onclick` is deprecated and may be removed in a future version. Please use `Graph3d.on('click', handler)` instead.")),void 0!==t.tooltipStyle&&n(["tooltipStyle"],e,t)}function z(t){if(t.length<2)throw new Error("Colormap array length must be 2 or above.");return t.map((function(t){if(!a(t))throw new Error("Invalid hex color code supplied to colormap.");return r(t)}))}function P(t){if(void 0===t)throw new Error("Unsupported type of colormap");if(!(t.saturation>=0&&t.saturation<=100))throw new Error("Saturation is out of bounds. Expected range is 0-100.");if(!(t.brightness>=0&&t.brightness<=100))throw new Error("Brightness is out of bounds. Expected range is 0-100.");if(!(t.colorStops>=2))throw new Error("colorStops is out of bounds. Expected 2 or above.");const e=(t.end-t.start)/(t.colorStops-1);let i=[];for(let o=0;o<t.colorStops;++o){let n=(t.start+e*o)%360/360;i.push(s(n<0?n+1:n,t.saturation/100,t.brightness/100))}return i}function A(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new g),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}let D,E=!1,k="background: #FFeeee; color: #dd0000";class B{constructor(){}static validate(t,e,i){E=!1,D=e;let o=e;return void 0!==i&&(o=e[i]),B.parse(t,o,[]),E}static parse(t,e,i){for(let o in t)t.hasOwnProperty(o)&&B.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void B.getSuggestion(t,i,o);let n=t,a=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",a="object"===B.getType(e[t]));let r=i[n];a&&void 0!==r.__type__&&(r=r.__type__),B.checkFields(t,e,i,n,r,o)}static checkFields(t,e,i,o,n,a){let r=function(e){console.log("%c"+e+B.printLocation(a,t),k)},s=B.getType(e[t]),l=n[s];void 0!==l?"array"===B.getType(l)&&-1===l.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+B.print(l)+' not "'+e[t]+'". '),E=!0):"object"===s&&"__any__"!==o&&(a=h(a,t),B.parse(e[t],i[o],a)):void 0===n.any&&(r('Invalid type received for "'+t+'". Expected: '+B.print(Object.keys(n))+". Received ["+s+'] "'+e[t]+'"'),E=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let o,n=B.findInOptions(t,e,i,!1),a=B.findInOptions(t,D,[],!0);o=void 0!==n.indexMatch?" in "+B.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n':a.distance<=4&&n.distance>a.distance?" in "+B.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+B.printLocation(a.path,a.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+B.printLocation(n.path,t):". Did you mean one of these: "+B.print(Object.keys(e))+B.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+o,k),E=!0}static findInOptions(t,e,i,o=!1){let n=1e9,a="",r=[],s=t.toLowerCase(),d=void 0;for(let c in e){let u;if(void 0!==e[c].__type__&&!0===o){let o=B.findInOptions(t,e[c],h(i,c));n>o.distance&&(a=o.closestMatch,r=o.path,n=o.distance,d=o.indexMatch)}else-1!==c.toLowerCase().indexOf(s)&&(d=c),u=B.levenshteinDistance(t,c),n>u&&(a=c,r=l(i),n=u)}return{closestMatch:a,path:r,distance:n,indexMatch:d}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,o,n=[];for(i=0;i<=e.length;i++)n[i]=[i];for(o=0;o<=t.length;o++)n[0][o]=o;for(i=1;i<=e.length;i++)for(o=1;o<=t.length;o++)e.charAt(i-1)==t.charAt(o-1)?n[i][o]=n[i-1][o-1]:n[i][o]=Math.min(n[i-1][o-1]+1,Math.min(n[i][o-1]+1,n[i-1][o]+1));return n[e.length][t.length]}}let O="string",I="boolean",W="number",Y="object",G={fill:{string:O},stroke:{string:O},strokeWidth:{number:W},__type__:{string:O,object:Y,undefined:"undefined"}},F={animationAutoStart:{boolean:I,undefined:"undefined"},animationInterval:{number:W},animationPreload:{boolean:I},axisColor:{string:O},axisFontSize:{number:W},axisFontType:{string:O},backgroundColor:G,xBarWidth:{number:W,undefined:"undefined"},yBarWidth:{number:W,undefined:"undefined"},cameraPosition:{distance:{number:W},horizontal:{number:W},vertical:{number:W},__type__:{object:Y}},zoomable:{boolean:I},ctrlToZoom:{boolean:I},xCenter:{string:O},yCenter:{string:O},colormap:{hue:{start:{number:W},end:{number:W},saturation:{number:W},brightness:{number:W},colorStops:{number:W},__type__:{object:Y}},__type__:{array:"array",object:Y,function:"function",undefined:"undefined"}},dataColor:G,dotSizeMinFraction:{number:W},dotSizeMaxFraction:{number:W},dotSizeRatio:{number:W},filterLabel:{string:O},gridColor:{string:O},onclick:{function:"function"},keepAspectRatio:{boolean:I},xLabel:{string:O},yLabel:{string:O},zLabel:{string:O},legendLabel:{string:O},xMin:{number:W,undefined:"undefined"},yMin:{number:W,undefined:"undefined"},zMin:{number:W,undefined:"undefined"},xMax:{number:W,undefined:"undefined"},yMax:{number:W,undefined:"undefined"},zMax:{number:W,undefined:"undefined"},showAnimationControls:{boolean:I,undefined:"undefined"},showGrayBottom:{boolean:I},showGrid:{boolean:I},showLegend:{boolean:I,undefined:"undefined"},showPerspective:{boolean:I},showShadow:{boolean:I},showSurfaceGrid:{boolean:I},showXAxis:{boolean:I},showYAxis:{boolean:I},showZAxis:{boolean:I},rotateAxisLabels:{boolean:I},surfaceColors:{hue:{start:{number:W},end:{number:W},saturation:{number:W},brightness:{number:W},colorStops:{number:W},__type__:{object:Y}},__type__:{boolean:I,array:"array",object:Y,undefined:"undefined"}},xStep:{number:W,undefined:"undefined"},yStep:{number:W,undefined:"undefined"},zStep:{number:W,undefined:"undefined"},style:{number:W,string:["bar","bar-color","bar-size","dot","dot-line","dot-color","dot-size","line","grid","surface"]},tooltip:{boolean:I,function:"function"},tooltipDelay:{number:W},tooltipStyle:{content:{color:{string:O},background:{string:O},border:{string:O},borderRadius:{string:O},boxShadow:{string:O},padding:{string:O},__type__:{object:Y}},line:{borderLeft:{string:O},height:{string:O},width:{string:O},pointerEvents:{string:O},__type__:{object:Y}},dot:{border:{string:O},borderRadius:{string:O},height:{string:O},width:{string:O},pointerEvents:{string:O},__type__:{object:Y}},__type__:{object:Y}},xValueLabel:{function:"function"},yValueLabel:{function:"function"},zValueLabel:{function:"function"},valueMax:{number:W,undefined:"undefined"},valueMin:{number:W,undefined:"undefined"},verticalRatio:{number:W},height:{string:O},width:{string:O},__type__:{object:Y}};function N(){this.min=void 0,this.max=void 0}N.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.max<t)&&(this.max=t))},N.prototype.combine=function(t){this.add(t.min),this.add(t.max)},N.prototype.expand=function(t){if(void 0!==t){var e=this.min-t,i=this.max+t;if(e>i)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},N.prototype.range=function(){return this.max-this.min},N.prototype.center=function(){return(this.min+this.max)/2};var X=N;function V(t,e,i){this.dataGroup=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=t.getDistinctValues(this.column),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}function Z(){this.dataTable=null}V.prototype.isLoaded=function(){return this.loaded},V.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},V.prototype.getLabel=function(){return this.graph.filterLabel},V.prototype.getColumn=function(){return this.column},V.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},V.prototype.getValues=function(){return this.values},V.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},V.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new d(this.dataGroup.getDataSet(),{filter:function(t){return t[i.column]==i.value}}).get();e=this.dataGroup._getDataPoints(o),this.dataPoints[t]=e}return e},V.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},V.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},V.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var o=this;setTimeout((function(){o.loadInBackground(t+1)}),10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},Z.prototype.initializeData=function(t,e,i){if(void 0!==e){var o;if(Array.isArray(e)&&(e=new c(e)),!(e instanceof c||e instanceof d))throw new Error("Array, DataSet, or DataView expected");if(0!=(o=e.get()).length){this.style=i,this.dataSet&&this.dataSet.off("*",this._onChange),this.dataSet=e,this.dataTable=o;var n=this;this._onChange=function(){t.setData(n.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z";var a=t.hasBars(i);if(a&&(void 0!==t.defaultXBarWidth?this.xBarWidth=t.defaultXBarWidth:this.xBarWidth=this.getSmallestDifference(o,this.colX)||1,void 0!==t.defaultYBarWidth?this.yBarWidth=t.defaultYBarWidth:this.yBarWidth=this.getSmallestDifference(o,this.colY)||1),this._initializeRange(o,this.colX,t,a),this._initializeRange(o,this.colY,t,a),this._initializeRange(o,this.colZ,t,!1),o[0].hasOwnProperty("style")){this.colValue="style";var r=this.getColumnRange(o,this.colValue);this._setRangeDefaults(r,t.defaultValueMin,t.defaultValueMax),this.valueRange=r}else this.colValue="z",this.valueRange=this.zRange;return this.getDataTable()[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new V(this,"filter",t),this.dataFilter.setOnLoadCallback((function(){t.redraw()}))),this.dataFilter?this.dataFilter._getDataPoints():this._getDataPoints(this.getDataTable())}}},Z.prototype._collectRangeSettings=function(t,e){if(-1==["x","y","z"].indexOf(t))throw new Error("Column '"+t+"' invalid");var i=t.toUpperCase();return{barWidth:this[t+"BarWidth"],min:e["default"+i+"Min"],max:e["default"+i+"Max"],step:e["default"+i+"Step"],range_label:t+"Range",step_label:t+"Step"}},Z.prototype._initializeRange=function(t,e,i,o){var n=this._collectRangeSettings(e,i),a=this.getColumnRange(t,e);o&&"z"!=e&&a.expand(n.barWidth/2),this._setRangeDefaults(a,n.min,n.max),this[n.range_label]=a,this[n.step_label]=void 0!==n.step?n.step:a.range()/5},Z.prototype.getDistinctValues=function(t,e){void 0===e&&(e=this.dataTable);for(var i=[],o=0;o<e.length;o++){var n=e[o][t]||0;-1===i.indexOf(n)&&i.push(n)}return i.sort((function(t,e){return t-e}))},Z.prototype.getSmallestDifference=function(t,e){for(var i=this.getDistinctValues(t,e),o=null,n=1;n<i.length;n++){var a=i[n]-i[n-1];(null==o||o>a)&&(o=a)}return o},Z.prototype.getColumnRange=function(t,e){for(var i=new X,o=0;o<t.length;o++){var n=t[o][e];i.adjust(n)}return i},Z.prototype.getNumberOfRows=function(){return this.dataTable.length},Z.prototype._setRangeDefaults=function(t,e,i){void 0!==e&&(t.min=e),void 0!==i&&(t.max=i),t.max<=t.min&&(t.max=t.min+1)},Z.prototype.getDataTable=function(){return this.dataTable},Z.prototype.getDataSet=function(){return this.dataSet},Z.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new p;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new p(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},Z.prototype.initDataAsMatrix=function(t){var e,i,o,n,a=this.getDistinctValues(this.colX,t),r=this.getDistinctValues(this.colY,t),s=this.getDataPoints(t),h=[];for(o=0;o<s.length;o++){n=s[o];var l=a.indexOf(n.point.x),d=r.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0);return s},Z.prototype.getInfo=function(){var t=this.dataFilter;if(t)return t.getLabel()+": "+t.getSelectedValue()},Z.prototype.reload=function(){this.dataTable&&this.setData(this.dataTable)},Z.prototype._getDataPoints=function(t){var e=[];if(this.style===x.GRID||this.style===x.SURFACE)e=this.initDataAsMatrix(t);else if(e=this.getDataPoints(t),this.style===x.LINE)for(var i=0;i<e.length;i++)i>0&&(e[i-1].pointNext=e[i]);return e},U.STYLE=x;function U(t,e,i){if(!(this instanceof U))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.dataGroup=new Z,this.dataPoints=null,this.create(),function(t,e){if(void 0===t||S(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");C=t,T(t,e,b),T(t,e,_,"default"),R(t,e),e.margin=10,e.showTooltip=!1,e.onclick_callback=null,e.eye=new p(0,0,-1)}(U.DEFAULTS,this),this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.setOptions(i),this.setData(e)}function j(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function H(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}U.DEFAULTS={width:"400px",height:"400px",filterLabel:"time",legendLabel:"value",xLabel:"x",yLabel:"y",zLabel:"z",xValueLabel:function(t){return t},yValueLabel:function(t){return t},zValueLabel:function(t){return t},showXAxis:!0,showYAxis:!0,showZAxis:!0,showGrayBottom:!1,showGrid:!0,showPerspective:!0,showShadow:!1,showSurfaceGrid:!0,keepAspectRatio:!0,rotateAxisLabels:!0,verticalRatio:.5,dotSizeRatio:.02,dotSizeMinFraction:.5,dotSizeMaxFraction:2.5,showAnimationControls:void 0,animationInterval:1e3,animationPreload:!1,animationAutoStart:void 0,axisFontSize:14,axisFontType:"arial",axisColor:"#4D4D4D",gridColor:"#D3D3D3",xCenter:"55%",yCenter:"50%",style:U.STYLE.DOT,tooltip:!1,tooltipDelay:300,tooltipStyle:{content:{padding:"10px",border:"1px solid #4d4d4d",color:"#1a1a1a",background:"rgba(255,255,255,0.7)",borderRadius:"2px",boxShadow:"5px 5px 10px rgba(128,128,128,0.5)"},line:{height:"40px",width:"0",borderLeft:"1px solid #4d4d4d",pointerEvents:"none"},dot:{height:"0",width:"0",border:"5px solid #4d4d4d",borderRadius:"5px",pointerEvents:"none"}},dataColor:{fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},surfaceColors:void 0,colormap:void 0,cameraPosition:{horizontal:1,vertical:.5,distance:1.7},zoomable:!0,ctrlToZoom:!1,showLegend:void 0,backgroundColor:void 0,xBarWidth:void 0,yBarWidth:void 0,valueMin:void 0,valueMax:void 0,xMin:void 0,xMax:void 0,xStep:void 0,yMin:void 0,yMax:void 0,yStep:void 0,zMin:void 0,zMax:void 0,zStep:void 0},t(U.prototype),U.prototype._setScale=function(){this.scale=new p(1/this.xRange.range(),1/this.yRange.range(),1/this.zRange.range()),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,void 0!==this.valueRange&&(this.scale.value=1/this.valueRange.range());var t=this.xRange.center()*this.scale.x,e=this.yRange.center()*this.scale.y,i=this.zRange.center()*this.scale.z;this.camera.setArmLocation(t,e,i)},U.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},U.prototype._convertPointToTranslation=function(t){var e=this.camera.getCameraLocation(),i=this.camera.getCameraRotation(),o=t.x*this.scale.x,n=t.y*this.scale.y,a=t.z*this.scale.z,r=e.x,s=e.y,h=e.z,l=Math.sin(i.x),d=Math.cos(i.x),c=Math.sin(i.y),u=Math.cos(i.y),f=Math.sin(i.z),m=Math.cos(i.z);return new p(u*(f*(n-s)+m*(o-r))-c*(a-h),l*(u*(a-h)+c*(f*(n-s)+m*(o-r)))+d*(m*(n-s)-f*(o-r)),d*(u*(a-h)+c*(f*(n-s)+m*(o-r)))-l*(m*(n-s)-f*(o-r)))},U.prototype._convertTranslationToScreen=function(t){var e,i,o=this.eye.x,n=this.eye.y,a=this.eye.z,r=t.x,s=t.y,h=t.z;return this.showPerspective?(e=a/h*(r-o),i=a/h*(s-n)):(e=r*(-a/this.camera.getArmLength()),i=s*(-a/this.camera.getArmLength())),new f(this.currentXCenter+e*this.frame.canvas.clientWidth,this.currentYCenter-i*this.frame.canvas.clientWidth)},U.prototype._calcTranslations=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.trans=this._convertPointToTranslation(i.point),i.screen=this._convertTranslationToScreen(i.trans);var o=this._convertPointToTranslation(i.bottom);i.dist=this.showPerspective?o.length():-o.z}t.sort((function(t,e){return e.dist-t.dist}))},U.prototype._initializeRanges=function(){var t=this.dataGroup;this.xRange=t.xRange,this.yRange=t.yRange,this.zRange=t.zRange,this.valueRange=t.valueRange,this.xStep=t.xStep,this.yStep=t.yStep,this.zStep=t.zStep,this.xBarWidth=t.xBarWidth,this.yBarWidth=t.yBarWidth,this.colX=t.colX,this.colY=t.colY,this.colZ=t.colZ,this.colValue=t.colValue,this._setScale()},U.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new p;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new p(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},U.prototype._getDataPoints=function(t){var e,i,o,n,a=[];if(this.style===U.STYLE.GRID||this.style===U.STYLE.SURFACE){var r=this.dataGroup.getDistinctValues(this.colX,t),s=this.dataGroup.getDistinctValues(this.colY,t);a=this.getDataPoints(t);var h=[];for(o=0;o<a.length;o++){n=a[o];var l=r.indexOf(n.point.x),d=s.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0)}else if(a=this.getDataPoints(t),this.style===U.STYLE.LINE)for(o=0;o<a.length;o++)o>0&&(a[o-1].pointNext=a[o]);return a},U.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var i=this;e(this.frame.canvas,"mousedown",(function(t){i._onMouseDown(t)})),e(this.frame.canvas,"touchstart",(function(t){i._onTouchStart(t)})),e(this.frame.canvas,"mousewheel",(function(t){i._onWheel(t)})),e(this.frame.canvas,"mousemove",(function(t){i._onTooltip(t)})),e(this.frame.canvas,"click",(function(t){i._onClick(t)})),this.containerElement.appendChild(this.frame)},U.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},U.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},U.prototype.animationStart=function(){if(this.animationAutoStart&&this.dataGroup.dataFilter){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()}},U.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},U.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},U.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},U.prototype._readData=function(t){this.dataPoints=this.dataGroup.initializeData(this,t,this.style),this._initializeRanges(),this._redrawFilter()},U.prototype.setData=function(t){null!=t&&(this._readData(t),this.redraw(),this.animationStart())},U.prototype.setOptions=function(t){if(void 0===t)return;!0===B.validate(t,F)&&console.log("%cErrors have been found in the supplied options object.",k),this.animationStop(),function(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===C||S(C))throw new Error("DEFAULTS not set for module Settings");M(t,e,b),M(t,e,_,"default"),R(t,e)}}(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.setAxisLabelMethod(),this.setData(this.dataGroup.getDataTable()),this.animationStart()},U.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case U.STYLE.BAR:t=this._redrawBarGraphPoint;break;case U.STYLE.BARCOLOR:t=this._redrawBarColorGraphPoint;break;case U.STYLE.BARSIZE:t=this._redrawBarSizeGraphPoint;break;case U.STYLE.DOT:t=this._redrawDotGraphPoint;break;case U.STYLE.DOTLINE:t=this._redrawDotLineGraphPoint;break;case U.STYLE.DOTCOLOR:t=this._redrawDotColorGraphPoint;break;case U.STYLE.DOTSIZE:t=this._redrawDotSizeGraphPoint;break;case U.STYLE.SURFACE:t=this._redrawSurfaceGraphPoint;break;case U.STYLE.GRID:t=this._redrawGridGraphPoint;break;case U.STYLE.LINE:t=this._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},U.prototype.setAxisLabelMethod=function(){this.rotateAxisLabels?(this._drawAxisLabelX=this.drawAxisLabelXRotate,this._drawAxisLabelY=this.drawAxisLabelYRotate,this._drawAxisLabelZ=this.drawAxisLabelZRotate):(this._drawAxisLabelX=this.drawAxisLabelX,this._drawAxisLabelY=this.drawAxisLabelY,this._drawAxisLabelZ=this.drawAxisLabelZ)},U.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},U.prototype._getContext=function(){var t=this.frame.canvas.getContext("2d");return t.lineJoin="round",t.lineCap="round",t},U.prototype._redrawClear=function(){var t=this.frame.canvas;t.getContext("2d").clearRect(0,0,t.width,t.height)},U.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},U.prototype._getLegendWidth=function(){var t;this.style===U.STYLE.DOTSIZE?t=this._dotSize()*this.dotSizeMaxFraction:t=this.style===U.STYLE.BARSIZE?this.xBarWidth:20;return t},U.prototype._redrawLegend=function(){if(!0===this.showLegend&&this.style!==U.STYLE.LINE&&this.style!==U.STYLE.BARSIZE){var t=this.style===U.STYLE.BARSIZE||this.style===U.STYLE.DOTSIZE,e=this.style===U.STYLE.DOTSIZE||this.style===U.STYLE.DOTCOLOR||this.style===U.STYLE.SURFACE||this.style===U.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),o=this.margin,n=this._getLegendWidth(),a=this.frame.clientWidth-this.margin,r=a-n,s=o+i,h=this._getContext();if(h.lineWidth=1,h.font="14px arial",!1===t){var l,d=i;for(l=0;l<d;l++){const t=1-(l-0)/(d-0),e=this._colormap(t,1);h.strokeStyle=e,h.beginPath(),h.moveTo(r,o+l),h.lineTo(a,o+l),h.stroke()}h.strokeStyle=this.axisColor,h.strokeRect(r,o,n,i)}else{var c;this.style===U.STYLE.DOTSIZE?c=n*(this.dotSizeMinFraction/this.dotSizeMaxFraction):(this.style,U.STYLE.BARSIZE),h.strokeStyle=this.axisColor,h.fillStyle=this.dataColor.fill,h.beginPath(),h.moveTo(r,o),h.lineTo(a,o),h.lineTo(r+c,s),h.lineTo(r,s),h.closePath(),h.fill(),h.stroke()}var u,p,m=e?this.valueRange.min:this.zRange.min,v=e?this.valueRange.max:this.zRange.max,g=new y(m,v,(v-m)/5,!0);for(g.start(!0);!g.end();)l=s-(g.getCurrent()-m)/(v-m)*i,u=new f(r-5,l),p=new f(r,l),this._line(h,u,p),h.textAlign="right",h.textBaseline="middle",h.fillStyle=this.axisColor,h.fillText(g.getCurrent(),r-10,l),g.next();h.textAlign="right",h.textBaseline="top";var x=this.legendLabel;h.fillText(x,a,s+this.margin)}},U.prototype._redrawFilter=function(){var t=this.dataGroup.dataFilter,e=this.frame.filter;if(e.innerHTML="",t){var i=new m(e,{visible:this.showAnimationControls});e.slider=i,e.style.padding="10px",i.setValues(t.values),i.setPlayInterval(this.animationInterval);var o=this;i.setOnChangeCallback((function(){var t=o.dataGroup.dataFilter,e=i.getIndex();t.selectValue(e),o.dataPoints=t._getDataPoints(),o.redraw()}))}else e.slider=void 0},U.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},U.prototype._redrawInfo=function(){var t=this.dataGroup.getInfo();if(void 0!==t){var e=this._getContext();e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,o=this.margin;e.fillText(t,i,o)}},U.prototype._line=function(t,e,i,o){void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()},U.prototype.drawAxisLabelX=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},U.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},U.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},U.prototype.drawAxisLabelXRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},U.prototype.drawAxisLabelYRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},U.prototype.drawAxisLabelZRotate=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},U.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),a=this._convert3Dto2D(i);this._line(t,n,a,o)},U.prototype._redrawAxis=function(){var t,e,i,o,n,a,r,s,h,l,d=this._getContext();d.font=this.axisFontSize/this.camera.getArmLength()+"px "+this.axisFontType;var c,u,m,v=.025/this.scale.x,g=.025/this.scale.y,x=5/this.camera.getArmLength(),w=this.camera.getArmRotation().horizontal,b=new f(Math.cos(w),Math.sin(w)),_=this.xRange,C=this.yRange,S=this.zRange;for(d.lineWidth=1,o=void 0===this.defaultXStep,(i=new y(_.min,_.max,this.xStep,o)).start(!0);!i.end();){var L=i.getCurrent();if(this.showGrid?(t=new p(L,C.min,S.min),e=new p(L,C.max,S.min),this._line3d(d,t,e,this.gridColor)):this.showXAxis&&(t=new p(L,C.min,S.min),e=new p(L,C.min+v,S.min),this._line3d(d,t,e,this.axisColor),t=new p(L,C.max,S.min),e=new p(L,C.max-v,S.min),this._line3d(d,t,e,this.axisColor)),this.showXAxis){r=b.x>0?C.min:C.max,c=new p(L,r,S.min);let t=" "+this.xValueLabel(L)+" ";this._drawAxisLabelX.call(this,d,c,t,w,x)}i.next()}for(d.lineWidth=1,o=void 0===this.defaultYStep,(i=new y(C.min,C.max,this.yStep,o)).start(!0);!i.end();){var T=i.getCurrent();if(this.showGrid?(t=new p(_.min,T,S.min),e=new p(_.max,T,S.min),this._line3d(d,t,e,this.gridColor)):this.showYAxis&&(t=new p(_.min,T,S.min),e=new p(_.min+g,T,S.min),this._line3d(d,t,e,this.axisColor),t=new p(_.max,T,S.min),e=new p(_.max-g,T,S.min),this._line3d(d,t,e,this.axisColor)),this.showYAxis){a=b.y>0?_.min:_.max,c=new p(a,T,S.min);let t=" "+this.yValueLabel(T)+" ";this._drawAxisLabelY.call(this,d,c,t,w,x)}i.next()}if(this.showZAxis){for(d.lineWidth=1,o=void 0===this.defaultZStep,(i=new y(S.min,S.max,this.zStep,o)).start(!0),a=b.x>0?_.min:_.max,r=b.y<0?C.min:C.max;!i.end();){var M=i.getCurrent(),R=new p(a,r,M),z=this._convert3Dto2D(R);e=new f(z.x-x,z.y),this._line(d,z,e,this.axisColor);let t=this.zValueLabel(M)+" ";this._drawAxisLabelZ.call(this,d,R,t,5),i.next()}d.lineWidth=1,t=new p(a,r,S.min),e=new p(a,r,S.max),this._line3d(d,t,e,this.axisColor)}this.showXAxis&&(d.lineWidth=1,u=new p(_.min,C.min,S.min),m=new p(_.max,C.min,S.min),this._line3d(d,u,m,this.axisColor),u=new p(_.min,C.max,S.min),m=new p(_.max,C.max,S.min),this._line3d(d,u,m,this.axisColor));this.showYAxis&&(d.lineWidth=1,t=new p(_.min,C.min,S.min),e=new p(_.min,C.max,S.min),this._line3d(d,t,e,this.axisColor),t=new p(_.max,C.min,S.min),e=new p(_.max,C.max,S.min),this._line3d(d,t,e,this.axisColor));var P=this.xLabel;P.length>0&&this.showXAxis&&(l=.1/this.scale.y,a=(_.max+3*_.min)/4,r=b.x>0?C.min-l:C.max+l,n=new p(a,r,S.min),this.drawAxisLabelX(d,n,P,w));var A=this.yLabel;A.length>0&&this.showYAxis&&(h=.1/this.scale.x,a=b.y>0?_.min-h:_.max+h,r=(C.max+3*C.min)/4,n=new p(a,r,S.min),this.drawAxisLabelY(d,n,A,w));var D=this.zLabel;D.length>0&&this.showZAxis&&(30,a=b.x>0?_.min:_.max,r=b.y<0?C.min:C.max,s=(S.max+3*S.min)/4,n=new p(a,r,s),this.drawAxisLabelZ(d,n,D,30))},U.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-this.eye.z/this.camera.getArmLength()*this.dataColor.strokeWidth:this.dataColor.strokeWidth},U.prototype._redrawBar=function(t,e,i,o,n,a){var r,s=this,h=e.point,l=this.zRange.min,d=[{point:new p(h.x-i,h.y-o,h.z)},{point:new p(h.x+i,h.y-o,h.z)},{point:new p(h.x+i,h.y+o,h.z)},{point:new p(h.x-i,h.y+o,h.z)}],c=[{point:new p(h.x-i,h.y-o,l)},{point:new p(h.x+i,h.y-o,l)},{point:new p(h.x+i,h.y+o,l)},{point:new p(h.x-i,h.y+o,l)}];d.forEach((function(t){t.screen=s._convert3Dto2D(t.point)})),c.forEach((function(t){t.screen=s._convert3Dto2D(t.point)}));var u=[{corners:d,center:p.avg(c[0].point,c[2].point)},{corners:[d[0],d[1],c[1],c[0]],center:p.avg(c[1].point,c[0].point)},{corners:[d[1],d[2],c[2],c[1]],center:p.avg(c[2].point,c[1].point)},{corners:[d[2],d[3],c[3],c[2]],center:p.avg(c[3].point,c[2].point)},{corners:[d[3],d[0],c[0],c[3]],center:p.avg(c[0].point,c[3].point)}];e.surfaces=u;for(let t=0;t<u.length;t++){r=u[t];var f=this._convertPointToTranslation(r.center);r.dist=this.showPerspective?f.length():-f.z}u.sort((function(t,e){var i=e.dist-t.dist;return i||(t.corners===d?1:e.corners===d?-1:0)})),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=a,t.fillStyle=n;for(let e=2;e<u.length;e++)r=u[e],this._polygon(t,r.corners)},U.prototype._polygon=function(t,e,i,o){if(!(e.length<2)){void 0!==i&&(t.fillStyle=i),void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var n=1;n<e.length;++n){var a=e[n];t.lineTo(a.screen.x,a.screen.y)}t.closePath(),t.fill(),t.stroke()}},U.prototype._drawCircle=function(t,e,i,o,n){var a=this._calcRadius(e,n);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=i,t.beginPath(),t.arc(e.screen.x,e.screen.y,a,0,2*Math.PI,!0),t.fill(),t.stroke()},U.prototype._getColorsRegular=function(t){const e=(t.point.value-this.valueRange.min)*this.scale.value;return{fill:this._colormap(e,1),border:this._colormap(e,.8)}},U.prototype._getColorsColor=function(t){var e,i,o;if(t&&t.point&&t.point.data&&t.point.data.style&&(o=t.point.data.style),o&&"object"==typeof o&&o.fill&&o.stroke)return{fill:o.fill,border:o.stroke};if("string"==typeof t.point.value)e=t.point.value,i=t.point.value;else{const o=(t.point.value-this.valueRange.min)*this.scale.value;e=this._colormap(o,1),i=this._colormap(o,.8)}return{fill:e,border:i}},U.prototype._getColorsSize=function(){return{fill:this.dataColor.fill,border:this.dataColor.stroke}},U.prototype._colormap=function(t,e=1){let i,o,n,a;const r=this.colormap;if(Array.isArray(r)){const e=r.length-1,a=Math.max(Math.floor(t*e),0),s=Math.min(a+1,e),h=t*e-a,l=r[a],d=r[s];i=l.r+h*(d.r-l.r),o=l.g+h*(d.g-l.g),n=l.b+h*(d.b-l.b)}else if("function"==typeof r)({r:i,g:o,b:n,a:a}=r(t));else{const e=240*(1-t);({r:i,g:o,b:n}=s(e/360,1,1))}return"number"!=typeof a||Number.isNaN(a)?`RGB(${Math.round(i*e)}, ${Math.round(o*e)}, ${Math.round(n*e)})`:`RGBA(${Math.round(i*e)}, ${Math.round(o*e)}, ${Math.round(n*e)}, ${a})`},U.prototype._calcRadius=function(t,e){var i;return void 0===e&&(e=this._dotSize()),(i=this.showPerspective?e/-t.trans.z:e*(-this.eye.z/this.camera.getArmLength()))<0&&(i=0),i},U.prototype._redrawBarGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsRegular(e);this._redrawBar(t,e,i,o,n.fill,n.border)},U.prototype._redrawBarColorGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsColor(e);this._redrawBar(t,e,i,o,n.fill,n.border)},U.prototype._redrawBarSizeGraphPoint=function(t,e){var i=(e.point.value-this.valueRange.min)/this.valueRange.range(),o=this.xBarWidth/2*(.8*i+.2),n=this.yBarWidth/2*(.8*i+.2),a=this._getColorsSize();this._redrawBar(t,e,o,n,a.fill,a.border)},U.prototype._redrawDotGraphPoint=function(t,e){var i=this._getColorsRegular(e);this._drawCircle(t,e,i.fill,i.border)},U.prototype._redrawDotLineGraphPoint=function(t,e){var i=this._convert3Dto2D(e.bottom);t.lineWidth=1,this._line(t,i,e.screen,this.gridColor),this._redrawDotGraphPoint(t,e)},U.prototype._redrawDotColorGraphPoint=function(t,e){var i=this._getColorsColor(e);this._drawCircle(t,e,i.fill,i.border)},U.prototype._redrawDotSizeGraphPoint=function(t,e){var i=this._dotSize(),o=(e.point.value-this.valueRange.min)/this.valueRange.range(),n=i*this.dotSizeMinFraction,a=n+(i*this.dotSizeMaxFraction-n)*o,r=this._getColorsSize();this._drawCircle(t,e,r.fill,r.border,a)},U.prototype._redrawSurfaceGraphPoint=function(t,e){var i=e.pointRight,o=e.pointTop,n=e.pointCross;if(void 0!==e&&void 0!==i&&void 0!==o&&void 0!==n){var a,r,s,h=!0;if(this.showGrayBottom||this.showShadow){var l=p.subtract(n.trans,e.trans),d=p.subtract(o.trans,i.trans),c=p.crossProduct(l,d);if(this.showPerspective){let t=p.avg(p.avg(e.trans,n.trans),p.avg(i.trans,o.trans));s=-p.dotProduct(c.normalize(),t.normalize())}else s=c.z/c.length();h=s>0}if(h||!this.showGrayBottom){const t=((e.point.value+i.point.value+o.point.value+n.point.value)/4-this.valueRange.min)*this.scale.value,r=this.showShadow?(1+s)/2:1;a=this._colormap(t,r)}else a="gray";r=this.showSurfaceGrid?this.axisColor:a,t.lineWidth=this._getStrokeWidth(e);var u=[e,i,n,o];this._polygon(t,u,a,r)}},U.prototype._drawGridLine=function(t,e,i){if(void 0===e||void 0===i)return;const o=((e.point.value+i.point.value)/2-this.valueRange.min)*this.scale.value;t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._colormap(o,1),this._line(t,e.screen,i.screen)},U.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},U.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},U.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t<this.dataPoints.length;t++){var i=this.dataPoints[t];this._pointDrawingMethod.call(this,e,i)}},U.prototype._storeMousePosition=function(t){this.startMouseX=j(t),this.startMouseY=H(t),this._startCameraOffset=this.camera.getOffset()},U.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this._storeMousePosition(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var o=this;this.onmousemove=function(t){o._onMouseMove(t)},this.onmouseup=function(t){o._onMouseUp(t)},e(document,"mousemove",o.onmousemove),e(document,"mouseup",o.onmouseup),i(t)}},U.prototype._onMouseMove=function(t){this.moving=!0,t=t||window.event;var e=parseFloat(j(t))-this.startMouseX,o=parseFloat(H(t))-this.startMouseY;if(t&&!0===t.ctrlKey){var n=.5*this.frame.clientWidth,a=.5*this.frame.clientHeight,r=(this._startCameraOffset.x||0)-e/n*this.camera.armLength*.8,s=(this._startCameraOffset.y||0)+o/a*this.camera.armLength*.8;this.camera.setOffset(r,s),this._storeMousePosition(t)}else{var h=this.startArmRotation.horizontal+e/200,l=this.startArmRotation.vertical+o/200,d=Math.sin(4/360*2*Math.PI);Math.abs(Math.sin(h))<d&&(h=Math.round(h/Math.PI)*Math.PI-.001),Math.abs(Math.cos(h))<d&&(h=(Math.round(h/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(l))<d&&(l=Math.round(l/Math.PI)*Math.PI),Math.abs(Math.cos(l))<d&&(l=(Math.round(l/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(h,l)}this.redraw();var c=this.getCameraPosition();this.emit("cameraPositionChange",c),i(t)},U.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,o(document,"mousemove",this.onmousemove),o(document,"mouseup",this.onmouseup),i(t)},U.prototype._onClick=function(t){if(this.onclick_callback||this.hasListeners("click")){if(this.moving)this.moving=!1;else{var e=this.frame.getBoundingClientRect(),o=j(t)-e.left,n=H(t)-e.top,a=this._dataPointFromXY(o,n);a&&(this.onclick_callback&&this.onclick_callback(a.point.data),this.emit("click",a.point.data))}i(t)}},U.prototype._onTooltip=function(t){var e=this.tooltipDelay,i=this.frame.getBoundingClientRect(),o=j(t)-i.left,n=H(t)-i.top;if(this.showTooltip)if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)this._hideTooltip();else if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(o,n);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var r=this;this.tooltipTimeout=setTimeout((function(){r.tooltipTimeout=null;var t=r._dataPointFromXY(o,n);t&&r._showTooltip(t)}),e)}},U.prototype._onTouchStart=function(t){this.touchDown=!0;var i=this;this.ontouchmove=function(t){i._onTouchMove(t)},this.ontouchend=function(t){i._onTouchEnd(t)},e(document,"touchmove",i.ontouchmove),e(document,"touchend",i.ontouchend),this._onMouseDown(t)},U.prototype._onTouchMove=function(t){this._onMouseMove(t)},U.prototype._onTouchEnd=function(t){this.touchDown=!1,o(document,"touchmove",this.ontouchmove),o(document,"touchend",this.ontouchend),this._onMouseUp(t)},U.prototype._onWheel=function(t){if(t||(t=window.event),this.zoomable&&(!this.ctrlToZoom||t.ctrlKey)){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var o=this.camera.getArmLength()*(1-e/10);this.camera.setArmLength(o),this.redraw(),this._hideTooltip()}var n=this.getCameraPosition();this.emit("cameraPositionChange",n),i(t)}},U.prototype._insideTriangle=function(t,e){var i=e[0],o=e[1],n=e[2];function a(t){return t>0?1:t<0?-1:0}var r=a((o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x)),s=a((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),h=a((i.x-n.x)*(t.y-n.y)-(i.y-n.y)*(t.x-n.x));return!(0!=r&&0!=s&&r!=s||0!=s&&0!=h&&s!=h||0!=r&&0!=h&&r!=h)},U.prototype._dataPointFromXY=function(t,e){var i,o=null,n=null,a=null,r=new f(t,e);if(this.style===U.STYLE.BAR||this.style===U.STYLE.BARCOLOR||this.style===U.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){var s=(o=this.dataPoints[i]).surfaces;if(s)for(var h=s.length-1;h>=0;h--){var l=s[h].corners,d=[l[0].screen,l[1].screen,l[2].screen],c=[l[2].screen,l[3].screen,l[0].screen];if(this._insideTriangle(r,d)||this._insideTriangle(r,c))return o}}else for(i=0;i<this.dataPoints.length;i++){var u=(o=this.dataPoints[i]).screen;if(u){var p=Math.abs(t-u.x),m=Math.abs(e-u.y),v=Math.sqrt(p*p+m*m);(null===a||v<a)&&v<100&&(a=v,n=o)}}return n},U.prototype.hasBars=function(t){return t==U.STYLE.BAR||t==U.STYLE.BARCOLOR||t==U.STYLE.BARSIZE},U.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),Object.assign(e.style,{},this.tooltipStyle.content),e.style.position="absolute",i=document.createElement("div"),Object.assign(i.style,{},this.tooltipStyle.line),i.style.position="absolute",o=document.createElement("div"),Object.assign(o.style,{},this.tooltipStyle.dot),o.style.position="absolute",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,a=e.offsetHeight,r=i.offsetHeight,s=o.offsetWidth,h=o.offsetHeight,l=t.screen.x-n/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=l+"px",e.style.top=t.screen.y-r-a+"px",o.style.left=t.screen.x-s/2+"px",o.style.top=t.screen.y-h/2+"px"},U.prototype._hideTooltip=function(){if(this.tooltip)for(var t in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}},U.prototype.setCameraPosition=function(t){A(t,this),this.redraw()},U.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()};export{U as Graph3d,g as Graph3dCamera,V as Graph3dFilter,f as Graph3dPoint2d,p as Graph3dPoint3d,m as Graph3dSlider,y as Graph3dStepNumber};
import t from"component-emitter";import{addEventListener as e,preventDefault as i,removeEventListener as o,selectiveDeepExtend as n,isValidHex as a,hexToRGB as r,HSVToRGB as s,copyAndExtendArray as h,copyArray as l}from"vis-util/esnext/esm/vis-util.js";import{DataView as d,DataSet as c}from"vis-data/esnext/esm/vis-data.js";function u(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}u.subtract=function(t,e){var i=new u;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,i},u.add=function(t,e){var i=new u;return i.x=t.x+e.x,i.y=t.y+e.y,i.z=t.z+e.z,i},u.avg=function(t,e){return new u((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},u.scalarProduct=function(t,e){return new u(t.x*e,t.y*e,t.z*e)},u.dotProduct=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},u.crossProduct=function(t,e){var i=new u;return i.x=t.y*e.z-t.z*e.y,i.y=t.z*e.x-t.x*e.z,i.z=t.x*e.y-t.y*e.x,i},u.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},u.prototype.normalize=function(){return u.scalarProduct(this,1/this.length())};var p=u;var f=function(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0};function m(t,e){if(void 0===t)throw new Error("No container element defined");if(this.container=t,this.visible=!e||null==e.visible||e.visible,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}function v(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}m.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},m.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},m.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date-t,o=Math.max(this.playInterval-i,0),n=this;this.playTimeout=setTimeout((function(){n.playNext()}),o)},m.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},m.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},m.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},m.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},m.prototype.setPlayInterval=function(t){this.playInterval=t},m.prototype.getPlayInterval=function(){return this.playInterval},m.prototype.setPlayLoop=function(t){this.playLoop=t},m.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},m.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},m.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},m.prototype.setIndex=function(t){if(!(t<this.values.length))throw new Error("Index out of range");this.index=t,this.redraw(),this.onChange()},m.prototype.getIndex=function(){return this.index},m.prototype.get=function(){return this.values[this.index]},m.prototype._onMouseDown=function(t){if(t.which?1===t.which:1===t.button){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var o=this;this.onmousemove=function(t){o._onMouseMove(t)},this.onmouseup=function(t){o._onMouseUp(t)},e(document,"mousemove",this.onmousemove),e(document,"mouseup",this.onmouseup),i(t)}},m.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,o=Math.round(i/e*(this.values.length-1));return o<0&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},m.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return t/(this.values.length-1)*e+3},m.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,o=this.startSlideX+e,n=this.leftToIndex(o);this.setIndex(n),i()},m.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",o(document,"mousemove",this.onmousemove),o(document,"mouseup",this.onmouseup),i()},v.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},v.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t||0,this._end=e||0,this.setStep(i,o)},v.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),!0===this.prettyStep?this._step=v.calculatePrettyStep(t):this._step=t)},v.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),a=i;return Math.abs(o-t)<=Math.abs(a-t)&&(a=o),Math.abs(n-t)<=Math.abs(a-t)&&(a=n),a<=0&&(a=1),a},v.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},v.prototype.getStep=function(){return this._step},v.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()<this._start&&this.next()},v.prototype.next=function(){this._current+=this._step},v.prototype.end=function(){return this._current>this._end};var y=v;function g(){this.armLocation=new p,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraOffset=new p,this.offsetMultiplier=.6,this.cameraLocation=new p,this.cameraRotation=new p(.5*Math.PI,0,0),this.calculateCameraOrientation()}g.prototype.setOffset=function(t,e){var i=Math.abs,o=Math.sign,n=this.offsetMultiplier,a=this.armLength*n;i(t)>a&&(t=o(t)*a),i(e)>a&&(e=o(e)*a),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},g.prototype.getOffset=function(){return this.cameraOffset},g.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},g.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},g.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},g.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},g.prototype.getArmLength=function(){return this.armLength},g.prototype.getCameraLocation=function(){return this.cameraLocation},g.prototype.getCameraRotation=function(){return this.cameraRotation},g.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=this.cameraRotation.z,i=this.cameraOffset.x,o=this.cameraOffset.y,n=Math.sin,a=Math.cos;this.cameraLocation.x=this.cameraLocation.x+i*a(e)+o*-n(e)*a(t),this.cameraLocation.y=this.cameraLocation.y+i*n(e)+o*a(e)*a(t),this.cameraLocation.z=this.cameraLocation.z+o*n(t)};var x={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},w={dot:x.DOT,"dot-line":x.DOTLINE,"dot-color":x.DOTCOLOR,"dot-size":x.DOTSIZE,line:x.LINE,grid:x.GRID,surface:x.SURFACE,bar:x.BAR,"bar-color":x.BARCOLOR,"bar-size":x.BARSIZE},b=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showXAxis","showYAxis","showZAxis","showGrayBottom","showGrid","showPerspective","showShadow","showSurfaceGrid","keepAspectRatio","rotateAxisLabels","verticalRatio","dotSizeRatio","dotSizeMinFraction","dotSizeMaxFraction","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","axisFontSize","axisFontType","gridColor","xCenter","yCenter","zoomable","tooltipDelay","ctrlToZoom"],_=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],C=void 0;function S(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function L(t,e){return void 0===t||""===t?e:t+(void 0===(i=e)||""===i||"string"!=typeof i?i:i.charAt(0).toUpperCase()+i.slice(1));var i}function T(t,e,i,o){for(var n,a=0;a<i.length;++a)e[L(o,n=i[a])]=t[n]}function M(t,e,i,o){for(var n,a=0;a<i.length;++a)void 0!==t[n=i[a]]&&(e[L(o,n)]=t[n])}function R(t,e){if(void 0!==t.backgroundColor&&function(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!=typeof t)throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}(t.backgroundColor,e),function(t,e){if(void 0===t)return;void 0===e.dataColor&&(e.dataColor={});"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth))}(t.dataColor,e),function(t,e){if(void 0===t)return;var i;if("string"==typeof t){if(-1===(i=function(t){var e=w[t];if(void 0===e)return-1;return e}(t)))throw new Error("Style '"+t+"' is invalid")}else{if(!function(t){var e=!1;for(var i in x)if(x[i]===t){e=!0;break}return e}(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}(t.style,e),void 0!==t.surfaceColors){if(console.warn("`options.surfaceColors` is deprecated and may be removed in a future version. Please use `options.colormap` instead. Note that the `colormap` option uses the inverse array ordering (running from vMin to vMax)."),void 0!==t.colormap)throw new Error("The `colormap` and `surfaceColors` options are mutually exclusive.");"surface"!==e.style?console.warn("Ignoring `surfaceColors` in graph style `"+e.style+"` for backward compatibility (only effective in `surface` plots)."):function(t,e){if(void 0===t||!0===t)return;if(!1===t)return void(e.surfaceColors=void 0);void 0===e.surfaceColors&&(e.surfaceColors={});let i;if(Array.isArray(t))i=z(t);else{if("object"!=typeof t)throw new Error("Unsupported type of surfaceColors");i=P(t.hue)}i.reverse(),e.colormap=i}(t.surfaceColors,e)}else!function(t,e){if(void 0===t)return;let i;if(Array.isArray(t))i=z(t);else if("object"==typeof t)i=P(t.hue);else{if("function"!=typeof t)throw new Error("Unsupported type of colormap");i=t}e.colormap=i}(t.colormap,e);!function(t,e){if(void 0===t){if(void 0===C.showLegend){var i=e.style===x.DOTCOLOR||e.style===x.DOTSIZE;e.showLegend=i}}else e.showLegend=t}(t.showLegend,e),A(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),null!=t.onclick&&(e.onclick_callback=t.onclick,console.warn("`options.onclick` is deprecated and may be removed in a future version. Please use `Graph3d.on('click', handler)` instead.")),void 0!==t.tooltipStyle&&n(["tooltipStyle"],e,t)}function z(t){if(t.length<2)throw new Error("Colormap array length must be 2 or above.");return t.map((function(t){if(!a(t))throw new Error("Invalid hex color code supplied to colormap.");return r(t)}))}function P(t){if(void 0===t)throw new Error("Unsupported type of colormap");if(!(t.saturation>=0&&t.saturation<=100))throw new Error("Saturation is out of bounds. Expected range is 0-100.");if(!(t.brightness>=0&&t.brightness<=100))throw new Error("Brightness is out of bounds. Expected range is 0-100.");if(!(t.colorStops>=2))throw new Error("colorStops is out of bounds. Expected 2 or above.");const e=(t.end-t.start)/(t.colorStops-1);let i=[];for(let o=0;o<t.colorStops;++o){let n=(t.start+e*o)%360/360;i.push(s(n<0?n+1:n,t.saturation/100,t.brightness/100))}return i}function A(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new g),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}let D,E=!1,k="background: #FFeeee; color: #dd0000";class B{constructor(){}static validate(t,e,i){E=!1,D=e;let o=e;return void 0!==i&&(o=e[i]),B.parse(t,o,[]),E}static parse(t,e,i){for(let o in t)t.hasOwnProperty(o)&&B.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void B.getSuggestion(t,i,o);let n=t,a=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",a="object"===B.getType(e[t]));let r=i[n];a&&void 0!==r.__type__&&(r=r.__type__),B.checkFields(t,e,i,n,r,o)}static checkFields(t,e,i,o,n,a){let r=function(e){console.log("%c"+e+B.printLocation(a,t),k)},s=B.getType(e[t]),l=n[s];void 0!==l?"array"===B.getType(l)&&-1===l.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+B.print(l)+' not "'+e[t]+'". '),E=!0):"object"===s&&"__any__"!==o&&(a=h(a,t),B.parse(e[t],i[o],a)):void 0===n.any&&(r('Invalid type received for "'+t+'". Expected: '+B.print(Object.keys(n))+". Received ["+s+'] "'+e[t]+'"'),E=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let o,n=B.findInOptions(t,e,i,!1),a=B.findInOptions(t,D,[],!0);o=void 0!==n.indexMatch?" in "+B.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n':a.distance<=4&&n.distance>a.distance?" in "+B.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+B.printLocation(a.path,a.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+B.printLocation(n.path,t):". Did you mean one of these: "+B.print(Object.keys(e))+B.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+o,k),E=!0}static findInOptions(t,e,i,o=!1){let n=1e9,a="",r=[],s=t.toLowerCase(),d=void 0;for(let c in e){let u;if(void 0!==e[c].__type__&&!0===o){let o=B.findInOptions(t,e[c],h(i,c));n>o.distance&&(a=o.closestMatch,r=o.path,n=o.distance,d=o.indexMatch)}else-1!==c.toLowerCase().indexOf(s)&&(d=c),u=B.levenshteinDistance(t,c),n>u&&(a=c,r=l(i),n=u)}return{closestMatch:a,path:r,distance:n,indexMatch:d}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,o,n=[];for(i=0;i<=e.length;i++)n[i]=[i];for(o=0;o<=t.length;o++)n[0][o]=o;for(i=1;i<=e.length;i++)for(o=1;o<=t.length;o++)e.charAt(i-1)==t.charAt(o-1)?n[i][o]=n[i-1][o-1]:n[i][o]=Math.min(n[i-1][o-1]+1,Math.min(n[i][o-1]+1,n[i-1][o]+1));return n[e.length][t.length]}}let O="string",I="boolean",W="number",Y="object",G={fill:{string:O},stroke:{string:O},strokeWidth:{number:W},__type__:{string:O,object:Y,undefined:"undefined"}},F={animationAutoStart:{boolean:I,undefined:"undefined"},animationInterval:{number:W},animationPreload:{boolean:I},axisColor:{string:O},axisFontSize:{number:W},axisFontType:{string:O},backgroundColor:G,xBarWidth:{number:W,undefined:"undefined"},yBarWidth:{number:W,undefined:"undefined"},cameraPosition:{distance:{number:W},horizontal:{number:W},vertical:{number:W},__type__:{object:Y}},zoomable:{boolean:I},ctrlToZoom:{boolean:I},xCenter:{string:O},yCenter:{string:O},colormap:{hue:{start:{number:W},end:{number:W},saturation:{number:W},brightness:{number:W},colorStops:{number:W},__type__:{object:Y}},__type__:{array:"array",object:Y,function:"function",undefined:"undefined"}},dataColor:G,dotSizeMinFraction:{number:W},dotSizeMaxFraction:{number:W},dotSizeRatio:{number:W},filterLabel:{string:O},gridColor:{string:O},onclick:{function:"function"},keepAspectRatio:{boolean:I},xLabel:{string:O},yLabel:{string:O},zLabel:{string:O},legendLabel:{string:O},xMin:{number:W,undefined:"undefined"},yMin:{number:W,undefined:"undefined"},zMin:{number:W,undefined:"undefined"},xMax:{number:W,undefined:"undefined"},yMax:{number:W,undefined:"undefined"},zMax:{number:W,undefined:"undefined"},showAnimationControls:{boolean:I,undefined:"undefined"},showGrayBottom:{boolean:I},showGrid:{boolean:I},showLegend:{boolean:I,undefined:"undefined"},showPerspective:{boolean:I},showShadow:{boolean:I},showSurfaceGrid:{boolean:I},showXAxis:{boolean:I},showYAxis:{boolean:I},showZAxis:{boolean:I},rotateAxisLabels:{boolean:I},surfaceColors:{hue:{start:{number:W},end:{number:W},saturation:{number:W},brightness:{number:W},colorStops:{number:W},__type__:{object:Y}},__type__:{boolean:I,array:"array",object:Y,undefined:"undefined"}},xStep:{number:W,undefined:"undefined"},yStep:{number:W,undefined:"undefined"},zStep:{number:W,undefined:"undefined"},style:{number:W,string:["bar","bar-color","bar-size","dot","dot-line","dot-color","dot-size","line","grid","surface"]},tooltip:{boolean:I,function:"function"},tooltipDelay:{number:W},tooltipStyle:{content:{color:{string:O},background:{string:O},border:{string:O},borderRadius:{string:O},boxShadow:{string:O},padding:{string:O},__type__:{object:Y}},line:{borderLeft:{string:O},height:{string:O},width:{string:O},pointerEvents:{string:O},__type__:{object:Y}},dot:{border:{string:O},borderRadius:{string:O},height:{string:O},width:{string:O},pointerEvents:{string:O},__type__:{object:Y}},__type__:{object:Y}},xValueLabel:{function:"function"},yValueLabel:{function:"function"},zValueLabel:{function:"function"},valueMax:{number:W,undefined:"undefined"},valueMin:{number:W,undefined:"undefined"},verticalRatio:{number:W},height:{string:O},width:{string:O},__type__:{object:Y}};function N(){this.min=void 0,this.max=void 0}N.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.max<t)&&(this.max=t))},N.prototype.combine=function(t){this.add(t.min),this.add(t.max)},N.prototype.expand=function(t){if(void 0!==t){var e=this.min-t,i=this.max+t;if(e>i)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},N.prototype.range=function(){return this.max-this.min},N.prototype.center=function(){return(this.min+this.max)/2};var X=N;function V(t,e,i){this.dataGroup=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=t.getDistinctValues(this.column),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}function Z(){this.dataTable=null}V.prototype.isLoaded=function(){return this.loaded},V.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},V.prototype.getLabel=function(){return this.graph.filterLabel},V.prototype.getColumn=function(){return this.column},V.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},V.prototype.getValues=function(){return this.values},V.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},V.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var o=new d(this.dataGroup.getDataSet(),{filter:function(t){return t[i.column]==i.value}}).get();e=this.dataGroup._getDataPoints(o),this.dataPoints[t]=e}return e},V.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},V.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},V.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var o=this;setTimeout((function(){o.loadInBackground(t+1)}),10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},Z.prototype.initializeData=function(t,e,i){if(void 0!==e){var o;if(Array.isArray(e)&&(e=new c(e)),!(e instanceof c||e instanceof d))throw new Error("Array, DataSet, or DataView expected");if(0!=(o=e.get()).length){this.style=i,this.dataSet&&this.dataSet.off("*",this._onChange),this.dataSet=e,this.dataTable=o;var n=this;this._onChange=function(){t.setData(n.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z";var a=t.hasBars(i);if(a&&(void 0!==t.defaultXBarWidth?this.xBarWidth=t.defaultXBarWidth:this.xBarWidth=this.getSmallestDifference(o,this.colX)||1,void 0!==t.defaultYBarWidth?this.yBarWidth=t.defaultYBarWidth:this.yBarWidth=this.getSmallestDifference(o,this.colY)||1),this._initializeRange(o,this.colX,t,a),this._initializeRange(o,this.colY,t,a),this._initializeRange(o,this.colZ,t,!1),o[0].hasOwnProperty("style")){this.colValue="style";var r=this.getColumnRange(o,this.colValue);this._setRangeDefaults(r,t.defaultValueMin,t.defaultValueMax),this.valueRange=r}else this.colValue="z",this.valueRange=this.zRange;return this.getDataTable()[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new V(this,"filter",t),this.dataFilter.setOnLoadCallback((function(){t.redraw()}))),this.dataFilter?this.dataFilter._getDataPoints():this._getDataPoints(this.getDataTable())}}},Z.prototype._collectRangeSettings=function(t,e){if(-1==["x","y","z"].indexOf(t))throw new Error("Column '"+t+"' invalid");var i=t.toUpperCase();return{barWidth:this[t+"BarWidth"],min:e["default"+i+"Min"],max:e["default"+i+"Max"],step:e["default"+i+"Step"],range_label:t+"Range",step_label:t+"Step"}},Z.prototype._initializeRange=function(t,e,i,o){var n=this._collectRangeSettings(e,i),a=this.getColumnRange(t,e);o&&"z"!=e&&a.expand(n.barWidth/2),this._setRangeDefaults(a,n.min,n.max),this[n.range_label]=a,this[n.step_label]=void 0!==n.step?n.step:a.range()/5},Z.prototype.getDistinctValues=function(t,e){void 0===e&&(e=this.dataTable);for(var i=[],o=0;o<e.length;o++){var n=e[o][t]||0;-1===i.indexOf(n)&&i.push(n)}return i.sort((function(t,e){return t-e}))},Z.prototype.getSmallestDifference=function(t,e){for(var i=this.getDistinctValues(t,e),o=null,n=1;n<i.length;n++){var a=i[n]-i[n-1];(null==o||o>a)&&(o=a)}return o},Z.prototype.getColumnRange=function(t,e){for(var i=new X,o=0;o<t.length;o++){var n=t[o][e];i.adjust(n)}return i},Z.prototype.getNumberOfRows=function(){return this.dataTable.length},Z.prototype._setRangeDefaults=function(t,e,i){void 0!==e&&(t.min=e),void 0!==i&&(t.max=i),t.max<=t.min&&(t.max=t.min+1)},Z.prototype.getDataTable=function(){return this.dataTable},Z.prototype.getDataSet=function(){return this.dataSet},Z.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new p;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new p(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},Z.prototype.initDataAsMatrix=function(t){var e,i,o,n,a=this.getDistinctValues(this.colX,t),r=this.getDistinctValues(this.colY,t),s=this.getDataPoints(t),h=[];for(o=0;o<s.length;o++){n=s[o];var l=a.indexOf(n.point.x),d=r.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0);return s},Z.prototype.getInfo=function(){var t=this.dataFilter;if(t)return t.getLabel()+": "+t.getSelectedValue()},Z.prototype.reload=function(){this.dataTable&&this.setData(this.dataTable)},Z.prototype._getDataPoints=function(t){var e=[];if(this.style===x.GRID||this.style===x.SURFACE)e=this.initDataAsMatrix(t);else if(e=this.getDataPoints(t),this.style===x.LINE)for(var i=0;i<e.length;i++)i>0&&(e[i-1].pointNext=e[i]);return e},U.STYLE=x;function U(t,e,i){if(!(this instanceof U))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.dataGroup=new Z,this.dataPoints=null,this.create(),function(t,e){if(void 0===t||S(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");C=t,T(t,e,b),T(t,e,_,"default"),R(t,e),e.margin=10,e.showTooltip=!1,e.onclick_callback=null,e.eye=new p(0,0,-1)}(U.DEFAULTS,this),this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.setOptions(i),this.setData(e)}function j(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function H(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}U.DEFAULTS={width:"400px",height:"400px",filterLabel:"time",legendLabel:"value",xLabel:"x",yLabel:"y",zLabel:"z",xValueLabel:function(t){return t},yValueLabel:function(t){return t},zValueLabel:function(t){return t},showXAxis:!0,showYAxis:!0,showZAxis:!0,showGrayBottom:!1,showGrid:!0,showPerspective:!0,showShadow:!1,showSurfaceGrid:!0,keepAspectRatio:!0,rotateAxisLabels:!0,verticalRatio:.5,dotSizeRatio:.02,dotSizeMinFraction:.5,dotSizeMaxFraction:2.5,showAnimationControls:void 0,animationInterval:1e3,animationPreload:!1,animationAutoStart:void 0,axisFontSize:14,axisFontType:"arial",axisColor:"#4D4D4D",gridColor:"#D3D3D3",xCenter:"55%",yCenter:"50%",style:U.STYLE.DOT,tooltip:!1,tooltipDelay:300,tooltipStyle:{content:{padding:"10px",border:"1px solid #4d4d4d",color:"#1a1a1a",background:"rgba(255,255,255,0.7)",borderRadius:"2px",boxShadow:"5px 5px 10px rgba(128,128,128,0.5)"},line:{height:"40px",width:"0",borderLeft:"1px solid #4d4d4d",pointerEvents:"none"},dot:{height:"0",width:"0",border:"5px solid #4d4d4d",borderRadius:"5px",pointerEvents:"none"}},dataColor:{fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},surfaceColors:void 0,colormap:void 0,cameraPosition:{horizontal:1,vertical:.5,distance:1.7},zoomable:!0,ctrlToZoom:!1,showLegend:void 0,backgroundColor:void 0,xBarWidth:void 0,yBarWidth:void 0,valueMin:void 0,valueMax:void 0,xMin:void 0,xMax:void 0,xStep:void 0,yMin:void 0,yMax:void 0,yStep:void 0,zMin:void 0,zMax:void 0,zStep:void 0},t(U.prototype),U.prototype._setScale=function(){this.scale=new p(1/this.xRange.range(),1/this.yRange.range(),1/this.zRange.range()),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,void 0!==this.valueRange&&(this.scale.value=1/this.valueRange.range());var t=this.xRange.center()*this.scale.x,e=this.yRange.center()*this.scale.y,i=this.zRange.center()*this.scale.z;this.camera.setArmLocation(t,e,i)},U.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},U.prototype._convertPointToTranslation=function(t){var e=this.camera.getCameraLocation(),i=this.camera.getCameraRotation(),o=t.x*this.scale.x,n=t.y*this.scale.y,a=t.z*this.scale.z,r=e.x,s=e.y,h=e.z,l=Math.sin(i.x),d=Math.cos(i.x),c=Math.sin(i.y),u=Math.cos(i.y),f=Math.sin(i.z),m=Math.cos(i.z);return new p(u*(f*(n-s)+m*(o-r))-c*(a-h),l*(u*(a-h)+c*(f*(n-s)+m*(o-r)))+d*(m*(n-s)-f*(o-r)),d*(u*(a-h)+c*(f*(n-s)+m*(o-r)))-l*(m*(n-s)-f*(o-r)))},U.prototype._convertTranslationToScreen=function(t){var e,i,o=this.eye.x,n=this.eye.y,a=this.eye.z,r=t.x,s=t.y,h=t.z;return this.showPerspective?(e=a/h*(r-o),i=a/h*(s-n)):(e=r*(-a/this.camera.getArmLength()),i=s*(-a/this.camera.getArmLength())),new f(this.currentXCenter+e*this.frame.canvas.clientWidth,this.currentYCenter-i*this.frame.canvas.clientWidth)},U.prototype._calcTranslations=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.trans=this._convertPointToTranslation(i.point),i.screen=this._convertTranslationToScreen(i.trans);var o=this._convertPointToTranslation(i.bottom);i.dist=this.showPerspective?o.length():-o.z}t.sort((function(t,e){return e.dist-t.dist}))},U.prototype._initializeRanges=function(){var t=this.dataGroup;this.xRange=t.xRange,this.yRange=t.yRange,this.zRange=t.zRange,this.valueRange=t.valueRange,this.xStep=t.xStep,this.yStep=t.yStep,this.zStep=t.zStep,this.xBarWidth=t.xBarWidth,this.yBarWidth=t.yBarWidth,this.colX=t.colX,this.colY=t.colY,this.colZ=t.colZ,this.colValue=t.colValue,this._setScale()},U.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new p;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new p(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},U.prototype._getDataPoints=function(t){var e,i,o,n,a=[];if(this.style===U.STYLE.GRID||this.style===U.STYLE.SURFACE){var r=this.dataGroup.getDistinctValues(this.colX,t),s=this.dataGroup.getDistinctValues(this.colY,t);a=this.getDataPoints(t);var h=[];for(o=0;o<a.length;o++){n=a[o];var l=r.indexOf(n.point.x),d=s.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0)}else if(a=this.getDataPoints(t),this.style===U.STYLE.LINE)for(o=0;o<a.length;o++)o>0&&(a[o-1].pointNext=a[o]);return a},U.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var i=this;e(this.frame.canvas,"mousedown",(function(t){i._onMouseDown(t)})),e(this.frame.canvas,"touchstart",(function(t){i._onTouchStart(t)})),e(this.frame.canvas,"mousewheel",(function(t){i._onWheel(t)})),e(this.frame.canvas,"mousemove",(function(t){i._onTooltip(t)})),e(this.frame.canvas,"click",(function(t){i._onClick(t)})),this.containerElement.appendChild(this.frame)},U.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},U.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},U.prototype.animationStart=function(){if(this.animationAutoStart&&this.dataGroup.dataFilter){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()}},U.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},U.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},U.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},U.prototype._readData=function(t){this.dataPoints=this.dataGroup.initializeData(this,t,this.style),this._initializeRanges(),this._redrawFilter()},U.prototype.setData=function(t){null!=t&&(this._readData(t),this.redraw(),this.animationStart())},U.prototype.setOptions=function(t){if(void 0===t)return;!0===B.validate(t,F)&&console.log("%cErrors have been found in the supplied options object.",k),this.animationStop(),function(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===C||S(C))throw new Error("DEFAULTS not set for module Settings");M(t,e,b),M(t,e,_,"default"),R(t,e)}}(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.setAxisLabelMethod(),this.setData(this.dataGroup.getDataTable()),this.animationStart()},U.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case U.STYLE.BAR:t=this._redrawBarGraphPoint;break;case U.STYLE.BARCOLOR:t=this._redrawBarColorGraphPoint;break;case U.STYLE.BARSIZE:t=this._redrawBarSizeGraphPoint;break;case U.STYLE.DOT:t=this._redrawDotGraphPoint;break;case U.STYLE.DOTLINE:t=this._redrawDotLineGraphPoint;break;case U.STYLE.DOTCOLOR:t=this._redrawDotColorGraphPoint;break;case U.STYLE.DOTSIZE:t=this._redrawDotSizeGraphPoint;break;case U.STYLE.SURFACE:t=this._redrawSurfaceGraphPoint;break;case U.STYLE.GRID:t=this._redrawGridGraphPoint;break;case U.STYLE.LINE:t=this._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},U.prototype.setAxisLabelMethod=function(){this.rotateAxisLabels?(this._drawAxisLabelX=this.drawAxisLabelXRotate,this._drawAxisLabelY=this.drawAxisLabelYRotate,this._drawAxisLabelZ=this.drawAxisLabelZRotate):(this._drawAxisLabelX=this.drawAxisLabelX,this._drawAxisLabelY=this.drawAxisLabelY,this._drawAxisLabelZ=this.drawAxisLabelZ)},U.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},U.prototype._getContext=function(){var t=this.frame.canvas.getContext("2d");return t.lineJoin="round",t.lineCap="round",t},U.prototype._redrawClear=function(){var t=this.frame.canvas;t.getContext("2d").clearRect(0,0,t.width,t.height)},U.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},U.prototype._getLegendWidth=function(){var t;this.style===U.STYLE.DOTSIZE?t=this._dotSize()*this.dotSizeMaxFraction:t=this.style===U.STYLE.BARSIZE?this.xBarWidth:20;return t},U.prototype._redrawLegend=function(){if(!0===this.showLegend&&this.style!==U.STYLE.LINE&&this.style!==U.STYLE.BARSIZE){var t=this.style===U.STYLE.BARSIZE||this.style===U.STYLE.DOTSIZE,e=this.style===U.STYLE.DOTSIZE||this.style===U.STYLE.DOTCOLOR||this.style===U.STYLE.SURFACE||this.style===U.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),o=this.margin,n=this._getLegendWidth(),a=this.frame.clientWidth-this.margin,r=a-n,s=o+i,h=this._getContext();if(h.lineWidth=1,h.font="14px arial",!1===t){var l,d=i;for(l=0;l<d;l++){const t=1-(l-0)/(d-0),e=this._colormap(t,1);h.strokeStyle=e,h.beginPath(),h.moveTo(r,o+l),h.lineTo(a,o+l),h.stroke()}h.strokeStyle=this.axisColor,h.strokeRect(r,o,n,i)}else{var c;this.style===U.STYLE.DOTSIZE?c=n*(this.dotSizeMinFraction/this.dotSizeMaxFraction):(this.style,U.STYLE.BARSIZE),h.strokeStyle=this.axisColor,h.fillStyle=this.dataColor.fill,h.beginPath(),h.moveTo(r,o),h.lineTo(a,o),h.lineTo(r+c,s),h.lineTo(r,s),h.closePath(),h.fill(),h.stroke()}var u,p,m=e?this.valueRange.min:this.zRange.min,v=e?this.valueRange.max:this.zRange.max,g=new y(m,v,(v-m)/5,!0);for(g.start(!0);!g.end();)l=s-(g.getCurrent()-m)/(v-m)*i,u=new f(r-5,l),p=new f(r,l),this._line(h,u,p),h.textAlign="right",h.textBaseline="middle",h.fillStyle=this.axisColor,h.fillText(g.getCurrent(),r-10,l),g.next();h.textAlign="right",h.textBaseline="top";var x=this.legendLabel;h.fillText(x,a,s+this.margin)}},U.prototype._redrawFilter=function(){var t=this.dataGroup.dataFilter,e=this.frame.filter;if(e.innerHTML="",t){var i=new m(e,{visible:this.showAnimationControls});e.slider=i,e.style.padding="10px",i.setValues(t.values),i.setPlayInterval(this.animationInterval);var o=this;i.setOnChangeCallback((function(){var t=o.dataGroup.dataFilter,e=i.getIndex();t.selectValue(e),o.dataPoints=t._getDataPoints(),o.redraw()}))}else e.slider=void 0},U.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},U.prototype._redrawInfo=function(){var t=this.dataGroup.getInfo();if(void 0!==t){var e=this._getContext();e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,o=this.margin;e.fillText(t,i,o)}},U.prototype._line=function(t,e,i,o){void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()},U.prototype.drawAxisLabelX=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},U.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},U.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},U.prototype.drawAxisLabelXRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},U.prototype.drawAxisLabelYRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},U.prototype.drawAxisLabelZRotate=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},U.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),a=this._convert3Dto2D(i);this._line(t,n,a,o)},U.prototype._redrawAxis=function(){var t,e,i,o,n,a,r,s,h,l,d=this._getContext();d.font=this.axisFontSize/this.camera.getArmLength()+"px "+this.axisFontType;var c,u,m,v=.025/this.scale.x,g=.025/this.scale.y,x=5/this.camera.getArmLength(),w=this.camera.getArmRotation().horizontal,b=new f(Math.cos(w),Math.sin(w)),_=this.xRange,C=this.yRange,S=this.zRange;for(d.lineWidth=1,o=void 0===this.defaultXStep,(i=new y(_.min,_.max,this.xStep,o)).start(!0);!i.end();){var L=i.getCurrent();if(this.showGrid?(t=new p(L,C.min,S.min),e=new p(L,C.max,S.min),this._line3d(d,t,e,this.gridColor)):this.showXAxis&&(t=new p(L,C.min,S.min),e=new p(L,C.min+v,S.min),this._line3d(d,t,e,this.axisColor),t=new p(L,C.max,S.min),e=new p(L,C.max-v,S.min),this._line3d(d,t,e,this.axisColor)),this.showXAxis){r=b.x>0?C.min:C.max,c=new p(L,r,S.min);let t=" "+this.xValueLabel(L)+" ";this._drawAxisLabelX.call(this,d,c,t,w,x)}i.next()}for(d.lineWidth=1,o=void 0===this.defaultYStep,(i=new y(C.min,C.max,this.yStep,o)).start(!0);!i.end();){var T=i.getCurrent();if(this.showGrid?(t=new p(_.min,T,S.min),e=new p(_.max,T,S.min),this._line3d(d,t,e,this.gridColor)):this.showYAxis&&(t=new p(_.min,T,S.min),e=new p(_.min+g,T,S.min),this._line3d(d,t,e,this.axisColor),t=new p(_.max,T,S.min),e=new p(_.max-g,T,S.min),this._line3d(d,t,e,this.axisColor)),this.showYAxis){a=b.y>0?_.min:_.max,c=new p(a,T,S.min);let t=" "+this.yValueLabel(T)+" ";this._drawAxisLabelY.call(this,d,c,t,w,x)}i.next()}if(this.showZAxis){for(d.lineWidth=1,o=void 0===this.defaultZStep,(i=new y(S.min,S.max,this.zStep,o)).start(!0),a=b.x>0?_.min:_.max,r=b.y<0?C.min:C.max;!i.end();){var M=i.getCurrent(),R=new p(a,r,M),z=this._convert3Dto2D(R);e=new f(z.x-x,z.y),this._line(d,z,e,this.axisColor);let t=this.zValueLabel(M)+" ";this._drawAxisLabelZ.call(this,d,R,t,5),i.next()}d.lineWidth=1,t=new p(a,r,S.min),e=new p(a,r,S.max),this._line3d(d,t,e,this.axisColor)}this.showXAxis&&(d.lineWidth=1,u=new p(_.min,C.min,S.min),m=new p(_.max,C.min,S.min),this._line3d(d,u,m,this.axisColor),u=new p(_.min,C.max,S.min),m=new p(_.max,C.max,S.min),this._line3d(d,u,m,this.axisColor));this.showYAxis&&(d.lineWidth=1,t=new p(_.min,C.min,S.min),e=new p(_.min,C.max,S.min),this._line3d(d,t,e,this.axisColor),t=new p(_.max,C.min,S.min),e=new p(_.max,C.max,S.min),this._line3d(d,t,e,this.axisColor));var P=this.xLabel;P.length>0&&this.showXAxis&&(l=.1/this.scale.y,a=(_.max+3*_.min)/4,r=b.x>0?C.min-l:C.max+l,n=new p(a,r,S.min),this.drawAxisLabelX(d,n,P,w));var A=this.yLabel;A.length>0&&this.showYAxis&&(h=.1/this.scale.x,a=b.y>0?_.min-h:_.max+h,r=(C.max+3*C.min)/4,n=new p(a,r,S.min),this.drawAxisLabelY(d,n,A,w));var D=this.zLabel;D.length>0&&this.showZAxis&&(30,a=b.x>0?_.min:_.max,r=b.y<0?C.min:C.max,s=(S.max+3*S.min)/4,n=new p(a,r,s),this.drawAxisLabelZ(d,n,D,30))},U.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-this.eye.z/this.camera.getArmLength()*this.dataColor.strokeWidth:this.dataColor.strokeWidth},U.prototype._redrawBar=function(t,e,i,o,n,a){var r,s=this,h=e.point,l=this.zRange.min,d=[{point:new p(h.x-i,h.y-o,h.z)},{point:new p(h.x+i,h.y-o,h.z)},{point:new p(h.x+i,h.y+o,h.z)},{point:new p(h.x-i,h.y+o,h.z)}],c=[{point:new p(h.x-i,h.y-o,l)},{point:new p(h.x+i,h.y-o,l)},{point:new p(h.x+i,h.y+o,l)},{point:new p(h.x-i,h.y+o,l)}];d.forEach((function(t){t.screen=s._convert3Dto2D(t.point)})),c.forEach((function(t){t.screen=s._convert3Dto2D(t.point)}));var u=[{corners:d,center:p.avg(c[0].point,c[2].point)},{corners:[d[0],d[1],c[1],c[0]],center:p.avg(c[1].point,c[0].point)},{corners:[d[1],d[2],c[2],c[1]],center:p.avg(c[2].point,c[1].point)},{corners:[d[2],d[3],c[3],c[2]],center:p.avg(c[3].point,c[2].point)},{corners:[d[3],d[0],c[0],c[3]],center:p.avg(c[0].point,c[3].point)}];e.surfaces=u;for(let t=0;t<u.length;t++){r=u[t];var f=this._convertPointToTranslation(r.center);r.dist=this.showPerspective?f.length():-f.z}u.sort((function(t,e){var i=e.dist-t.dist;return i||(t.corners===d?1:e.corners===d?-1:0)})),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=a,t.fillStyle=n;for(let e=2;e<u.length;e++)r=u[e],this._polygon(t,r.corners)},U.prototype._polygon=function(t,e,i,o){if(!(e.length<2)){void 0!==i&&(t.fillStyle=i),void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var n=1;n<e.length;++n){var a=e[n];t.lineTo(a.screen.x,a.screen.y)}t.closePath(),t.fill(),t.stroke()}},U.prototype._drawCircle=function(t,e,i,o,n){var a=this._calcRadius(e,n);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=i,t.beginPath(),t.arc(e.screen.x,e.screen.y,a,0,2*Math.PI,!0),t.fill(),t.stroke()},U.prototype._getColorsRegular=function(t){const e=(t.point.value-this.valueRange.min)*this.scale.value;return{fill:this._colormap(e,1),border:this._colormap(e,.8)}},U.prototype._getColorsColor=function(t){var e,i,o;if(t&&t.point&&t.point.data&&t.point.data.style&&(o=t.point.data.style),o&&"object"==typeof o&&o.fill&&o.stroke)return{fill:o.fill,border:o.stroke};if("string"==typeof t.point.value)e=t.point.value,i=t.point.value;else{const o=(t.point.value-this.valueRange.min)*this.scale.value;e=this._colormap(o,1),i=this._colormap(o,.8)}return{fill:e,border:i}},U.prototype._getColorsSize=function(){return{fill:this.dataColor.fill,border:this.dataColor.stroke}},U.prototype._colormap=function(t,e=1){let i,o,n,a;const r=this.colormap;if(Array.isArray(r)){const e=r.length-1,a=Math.max(Math.floor(t*e),0),s=Math.min(a+1,e),h=t*e-a,l=r[a],d=r[s];i=l.r+h*(d.r-l.r),o=l.g+h*(d.g-l.g),n=l.b+h*(d.b-l.b)}else if("function"==typeof r)({r:i,g:o,b:n,a:a}=r(t));else{const e=240*(1-t);({r:i,g:o,b:n}=s(e/360,1,1))}return"number"!=typeof a||Number.isNaN(a)?`RGB(${Math.round(i*e)}, ${Math.round(o*e)}, ${Math.round(n*e)})`:`RGBA(${Math.round(i*e)}, ${Math.round(o*e)}, ${Math.round(n*e)}, ${a})`},U.prototype._calcRadius=function(t,e){var i;return void 0===e&&(e=this._dotSize()),(i=this.showPerspective?e/-t.trans.z:e*(-this.eye.z/this.camera.getArmLength()))<0&&(i=0),i},U.prototype._redrawBarGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsRegular(e);this._redrawBar(t,e,i,o,n.fill,n.border)},U.prototype._redrawBarColorGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsColor(e);this._redrawBar(t,e,i,o,n.fill,n.border)},U.prototype._redrawBarSizeGraphPoint=function(t,e){var i=(e.point.value-this.valueRange.min)/this.valueRange.range(),o=this.xBarWidth/2*(.8*i+.2),n=this.yBarWidth/2*(.8*i+.2),a=this._getColorsSize();this._redrawBar(t,e,o,n,a.fill,a.border)},U.prototype._redrawDotGraphPoint=function(t,e){var i=this._getColorsRegular(e);this._drawCircle(t,e,i.fill,i.border)},U.prototype._redrawDotLineGraphPoint=function(t,e){var i=this._convert3Dto2D(e.bottom);t.lineWidth=1,this._line(t,i,e.screen,this.gridColor),this._redrawDotGraphPoint(t,e)},U.prototype._redrawDotColorGraphPoint=function(t,e){var i=this._getColorsColor(e);this._drawCircle(t,e,i.fill,i.border)},U.prototype._redrawDotSizeGraphPoint=function(t,e){var i=this._dotSize(),o=(e.point.value-this.valueRange.min)/this.valueRange.range(),n=i*this.dotSizeMinFraction,a=n+(i*this.dotSizeMaxFraction-n)*o,r=this._getColorsSize();this._drawCircle(t,e,r.fill,r.border,a)},U.prototype._redrawSurfaceGraphPoint=function(t,e){var i=e.pointRight,o=e.pointTop,n=e.pointCross;if(void 0!==e&&void 0!==i&&void 0!==o&&void 0!==n){var a,r,s,h=!0;if(this.showGrayBottom||this.showShadow){var l=p.subtract(n.trans,e.trans),d=p.subtract(o.trans,i.trans),c=p.crossProduct(l,d);if(this.showPerspective){let t=p.avg(p.avg(e.trans,n.trans),p.avg(i.trans,o.trans));s=-p.dotProduct(c.normalize(),t.normalize())}else s=c.z/c.length();h=s>0}if(h||!this.showGrayBottom){const t=((e.point.value+i.point.value+o.point.value+n.point.value)/4-this.valueRange.min)*this.scale.value,r=this.showShadow?(1+s)/2:1;a=this._colormap(t,r)}else a="gray";r=this.showSurfaceGrid?this.axisColor:a,t.lineWidth=this._getStrokeWidth(e);var u=[e,i,n,o];this._polygon(t,u,a,r)}},U.prototype._drawGridLine=function(t,e,i){if(void 0===e||void 0===i)return;const o=((e.point.value+i.point.value)/2-this.valueRange.min)*this.scale.value;t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._colormap(o,1),this._line(t,e.screen,i.screen)},U.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},U.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},U.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t<this.dataPoints.length;t++){var i=this.dataPoints[t];this._pointDrawingMethod.call(this,e,i)}},U.prototype._storeMousePosition=function(t){this.startMouseX=j(t),this.startMouseY=H(t),this._startCameraOffset=this.camera.getOffset()},U.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this._storeMousePosition(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var o=this;this.onmousemove=function(t){o._onMouseMove(t)},this.onmouseup=function(t){o._onMouseUp(t)},e(document,"mousemove",o.onmousemove),e(document,"mouseup",o.onmouseup),i(t)}},U.prototype._onMouseMove=function(t){this.moving=!0,t=t||window.event;var e=parseFloat(j(t))-this.startMouseX,o=parseFloat(H(t))-this.startMouseY;if(t&&!0===t.ctrlKey){var n=.5*this.frame.clientWidth,a=.5*this.frame.clientHeight,r=(this._startCameraOffset.x||0)-e/n*this.camera.armLength*.8,s=(this._startCameraOffset.y||0)+o/a*this.camera.armLength*.8;this.camera.setOffset(r,s),this._storeMousePosition(t)}else{var h=this.startArmRotation.horizontal+e/200,l=this.startArmRotation.vertical+o/200,d=Math.sin(4/360*2*Math.PI);Math.abs(Math.sin(h))<d&&(h=Math.round(h/Math.PI)*Math.PI-.001),Math.abs(Math.cos(h))<d&&(h=(Math.round(h/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(l))<d&&(l=Math.round(l/Math.PI)*Math.PI),Math.abs(Math.cos(l))<d&&(l=(Math.round(l/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(h,l)}this.redraw();var c=this.getCameraPosition();this.emit("cameraPositionChange",c),i(t)},U.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,o(document,"mousemove",this.onmousemove),o(document,"mouseup",this.onmouseup),i(t)},U.prototype._onClick=function(t){if(this.onclick_callback||this.hasListeners("click")){if(this.moving)this.moving=!1;else{var e=this.frame.getBoundingClientRect(),o=j(t)-e.left,n=H(t)-e.top,a=this._dataPointFromXY(o,n);a&&(this.onclick_callback&&this.onclick_callback(a.point.data),this.emit("click",a.point.data))}i(t)}},U.prototype._onTooltip=function(t){var e=this.tooltipDelay,i=this.frame.getBoundingClientRect(),o=j(t)-i.left,n=H(t)-i.top;if(this.showTooltip)if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)this._hideTooltip();else if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(o,n);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var r=this;this.tooltipTimeout=setTimeout((function(){r.tooltipTimeout=null;var t=r._dataPointFromXY(o,n);t&&r._showTooltip(t)}),e)}},U.prototype._onTouchStart=function(t){this.touchDown=!0;var i=this;this.ontouchmove=function(t){i._onTouchMove(t)},this.ontouchend=function(t){i._onTouchEnd(t)},e(document,"touchmove",i.ontouchmove),e(document,"touchend",i.ontouchend),this._onMouseDown(t)},U.prototype._onTouchMove=function(t){this._onMouseMove(t)},U.prototype._onTouchEnd=function(t){this.touchDown=!1,o(document,"touchmove",this.ontouchmove),o(document,"touchend",this.ontouchend),this._onMouseUp(t)},U.prototype._onWheel=function(t){if(t||(t=window.event),this.zoomable&&(!this.ctrlToZoom||t.ctrlKey)){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var o=this.camera.getArmLength()*(1-e/10);this.camera.setArmLength(o),this.redraw(),this._hideTooltip()}var n=this.getCameraPosition();this.emit("cameraPositionChange",n),i(t)}},U.prototype._insideTriangle=function(t,e){var i=e[0],o=e[1],n=e[2];function a(t){return t>0?1:t<0?-1:0}var r=a((o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x)),s=a((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),h=a((i.x-n.x)*(t.y-n.y)-(i.y-n.y)*(t.x-n.x));return!(0!=r&&0!=s&&r!=s||0!=s&&0!=h&&s!=h||0!=r&&0!=h&&r!=h)},U.prototype._dataPointFromXY=function(t,e){var i,o=null,n=null,a=null,r=new f(t,e);if(this.style===U.STYLE.BAR||this.style===U.STYLE.BARCOLOR||this.style===U.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){var s=(o=this.dataPoints[i]).surfaces;if(s)for(var h=s.length-1;h>=0;h--){var l=s[h].corners,d=[l[0].screen,l[1].screen,l[2].screen],c=[l[2].screen,l[3].screen,l[0].screen];if(this._insideTriangle(r,d)||this._insideTriangle(r,c))return o}}else for(i=0;i<this.dataPoints.length;i++){var u=(o=this.dataPoints[i]).screen;if(u){var p=Math.abs(t-u.x),m=Math.abs(e-u.y),v=Math.sqrt(p*p+m*m);(null===a||v<a)&&v<100&&(a=v,n=o)}}return n},U.prototype.hasBars=function(t){return t==U.STYLE.BAR||t==U.STYLE.BARCOLOR||t==U.STYLE.BARSIZE},U.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),Object.assign(e.style,{},this.tooltipStyle.content),e.style.position="absolute",i=document.createElement("div"),Object.assign(i.style,{},this.tooltipStyle.line),i.style.position="absolute",o=document.createElement("div"),Object.assign(o.style,{},this.tooltipStyle.dot),o.style.position="absolute",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,a=e.offsetHeight,r=i.offsetHeight,s=o.offsetWidth,h=o.offsetHeight,l=t.screen.x-n/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=l+"px",e.style.top=t.screen.y-r-a+"px",o.style.left=t.screen.x-s/2+"px",o.style.top=t.screen.y-h/2+"px"},U.prototype._hideTooltip=function(){if(this.tooltip)for(var t in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}},U.prototype.setCameraPosition=function(t){A(t,this),this.redraw()},U.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()};export{U as Graph3d,g as Graph3dCamera,V as Graph3dFilter,f as Graph3dPoint2d,p as Graph3dPoint3d,m as Graph3dSlider,y as Graph3dStepNumber};
//# sourceMappingURL=vis-graph3d.min.js.map

@@ -7,4 +7,4 @@ /**

*
* @version 5.9.4
* @date 2020-05-16T21:59:04.997Z
* @version 5.9.5
* @date 2020-05-20T22:38:31.992Z
*

@@ -27,3 +27,3 @@ * @copyright (c) 2011-2017 Almende B.V, http://almende.com

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("component-emitter"),require("vis-util/esnext"),require("vis-data/esnext")):"function"==typeof define&&define.amd?define(["exports","component-emitter","vis-util/esnext","vis-data/esnext"],e):e((t=t||self).vis=t.vis||{},t.Emitter,t.vis,t.vis)}(this,(function(t,e,i,o){function n(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n.subtract=function(t,e){var i=new n;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,i},n.add=function(t,e){var i=new n;return i.x=t.x+e.x,i.y=t.y+e.y,i.z=t.z+e.z,i},n.avg=function(t,e){return new n((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},n.scalarProduct=function(t,e){return new n(t.x*e,t.y*e,t.z*e)},n.dotProduct=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},n.crossProduct=function(t,e){var i=new n;return i.x=t.y*e.z-t.z*e.y,i.y=t.z*e.x-t.x*e.z,i.z=t.x*e.y-t.y*e.x,i},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.prototype.normalize=function(){return n.scalarProduct(this,1/this.length())};var a=n;var r=function(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0};function s(t,e){if(void 0===t)throw new Error("No container element defined");if(this.container=t,this.visible=!e||null==e.visible||e.visible,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}function h(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}s.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},s.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},s.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date-t,o=Math.max(this.playInterval-i,0),n=this;this.playTimeout=setTimeout((function(){n.playNext()}),o)},s.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},s.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},s.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},s.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},s.prototype.setPlayInterval=function(t){this.playInterval=t},s.prototype.getPlayInterval=function(){return this.playInterval},s.prototype.setPlayLoop=function(t){this.playLoop=t},s.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},s.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},s.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},s.prototype.setIndex=function(t){if(!(t<this.values.length))throw new Error("Index out of range");this.index=t,this.redraw(),this.onChange()},s.prototype.getIndex=function(){return this.index},s.prototype.get=function(){return this.values[this.index]},s.prototype._onMouseDown=function(t){if(t.which?1===t.which:1===t.button){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},i.addEventListener(document,"mousemove",this.onmousemove),i.addEventListener(document,"mouseup",this.onmouseup),i.preventDefault(t)}},s.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,o=Math.round(i/e*(this.values.length-1));return o<0&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},s.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return t/(this.values.length-1)*e+3},s.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,o=this.startSlideX+e,n=this.leftToIndex(o);this.setIndex(n),i.preventDefault()},s.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",i.removeEventListener(document,"mousemove",this.onmousemove),i.removeEventListener(document,"mouseup",this.onmouseup),i.preventDefault()},h.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},h.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t||0,this._end=e||0,this.setStep(i,o)},h.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),!0===this.prettyStep?this._step=h.calculatePrettyStep(t):this._step=t)},h.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),a=i;return Math.abs(o-t)<=Math.abs(a-t)&&(a=o),Math.abs(n-t)<=Math.abs(a-t)&&(a=n),a<=0&&(a=1),a},h.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},h.prototype.getStep=function(){return this._step},h.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()<this._start&&this.next()},h.prototype.next=function(){this._current+=this._step},h.prototype.end=function(){return this._current>this._end};var l=h;function d(){this.armLocation=new a,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraOffset=new a,this.offsetMultiplier=.6,this.cameraLocation=new a,this.cameraRotation=new a(.5*Math.PI,0,0),this.calculateCameraOrientation()}d.prototype.setOffset=function(t,e){var i=Math.abs,o=Math.sign,n=this.offsetMultiplier,a=this.armLength*n;i(t)>a&&(t=o(t)*a),i(e)>a&&(e=o(e)*a),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},d.prototype.getOffset=function(){return this.cameraOffset},d.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},d.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},d.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},d.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},d.prototype.getArmLength=function(){return this.armLength},d.prototype.getCameraLocation=function(){return this.cameraLocation},d.prototype.getCameraRotation=function(){return this.cameraRotation},d.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=this.cameraRotation.z,i=this.cameraOffset.x,o=this.cameraOffset.y,n=Math.sin,a=Math.cos;this.cameraLocation.x=this.cameraLocation.x+i*a(e)+o*-n(e)*a(t),this.cameraLocation.y=this.cameraLocation.y+i*n(e)+o*a(e)*a(t),this.cameraLocation.z=this.cameraLocation.z+o*n(t)};var c={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},u={dot:c.DOT,"dot-line":c.DOTLINE,"dot-color":c.DOTCOLOR,"dot-size":c.DOTSIZE,line:c.LINE,grid:c.GRID,surface:c.SURFACE,bar:c.BAR,"bar-color":c.BARCOLOR,"bar-size":c.BARSIZE},p=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showXAxis","showYAxis","showZAxis","showGrayBottom","showGrid","showPerspective","showShadow","showSurfaceGrid","keepAspectRatio","rotateAxisLabels","verticalRatio","dotSizeRatio","dotSizeMinFraction","dotSizeMaxFraction","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","axisFontSize","axisFontType","gridColor","xCenter","yCenter","zoomable","tooltipDelay","ctrlToZoom"],f=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],m=void 0;function v(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function y(t,e){return void 0===t||""===t?e:t+(void 0===(i=e)||""===i||"string"!=typeof i?i:i.charAt(0).toUpperCase()+i.slice(1));var i}function g(t,e,i,o){for(var n,a=0;a<i.length;++a)e[y(o,n=i[a])]=t[n]}function x(t,e,i,o){for(var n,a=0;a<i.length;++a)void 0!==t[n=i[a]]&&(e[y(o,n)]=t[n])}function w(t,e){if(void 0!==t.backgroundColor&&function(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!=typeof t)throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}(t.backgroundColor,e),function(t,e){if(void 0===t)return;void 0===e.dataColor&&(e.dataColor={});"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth))}(t.dataColor,e),function(t,e){if(void 0===t)return;var i;if("string"==typeof t){if(-1===(i=function(t){var e=u[t];if(void 0===e)return-1;return e}(t)))throw new Error("Style '"+t+"' is invalid")}else{if(!function(t){var e=!1;for(var i in c)if(c[i]===t){e=!0;break}return e}(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}(t.style,e),void 0!==t.surfaceColors){if(console.warn("`options.surfaceColors` is deprecated and may be removed in a future version. Please use `options.colormap` instead. Note that the `colormap` option uses the inverse array ordering (running from vMin to vMax)."),void 0!==t.colormap)throw new Error("The `colormap` and `surfaceColors` options are mutually exclusive.");"surface"!==e.style?console.warn("Ignoring `surfaceColors` in graph style `"+e.style+"` for backward compatibility (only effective in `surface` plots)."):function(t,e){if(void 0===t||!0===t)return;if(!1===t)return void(e.surfaceColors=void 0);void 0===e.surfaceColors&&(e.surfaceColors={});let i;if(Array.isArray(t))i=b(t);else{if("object"!=typeof t)throw new Error("Unsupported type of surfaceColors");i=_(t.hue)}i.reverse(),e.colormap=i}(t.surfaceColors,e)}else!function(t,e){if(void 0===t)return;let i;if(Array.isArray(t))i=b(t);else if("object"==typeof t)i=_(t.hue);else{if("function"!=typeof t)throw new Error("Unsupported type of colormap");i=t}e.colormap=i}(t.colormap,e);!function(t,e){if(void 0===t){if(void 0===m.showLegend){var i=e.style===c.DOTCOLOR||e.style===c.DOTSIZE;e.showLegend=i}}else e.showLegend=t}(t.showLegend,e),L(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),null!=t.onclick&&(e.onclick_callback=t.onclick,console.warn("`options.onclick` is deprecated and may be removed in a future version. Please use `Graph3d.on('click', handler)` instead.")),void 0!==t.tooltipStyle&&i.selectiveDeepExtend(["tooltipStyle"],e,t)}function b(t){if(t.length<2)throw new Error("Colormap array length must be 2 or above.");return t.map((function(t){if(!i.isValidHex(t))throw new Error("Invalid hex color code supplied to colormap.");return i.hexToRGB(t)}))}function _(t){if(void 0===t)throw new Error("Unsupported type of colormap");if(!(t.saturation>=0&&t.saturation<=100))throw new Error("Saturation is out of bounds. Expected range is 0-100.");if(!(t.brightness>=0&&t.brightness<=100))throw new Error("Brightness is out of bounds. Expected range is 0-100.");if(!(t.colorStops>=2))throw new Error("colorStops is out of bounds. Expected 2 or above.");const e=(t.end-t.start)/(t.colorStops-1);let o=[];for(let n=0;n<t.colorStops;++n){let a=(t.start+e*n)%360/360;o.push(i.HSVToRGB(a<0?a+1:a,t.saturation/100,t.brightness/100))}return o}function L(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new d),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}let S,C=!1,T="background: #FFeeee; color: #dd0000";class M{constructor(){}static validate(t,e,i){C=!1,S=e;let o=e;return void 0!==i&&(o=e[i]),M.parse(t,o,[]),C}static parse(t,e,i){for(let o in t)t.hasOwnProperty(o)&&M.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void M.getSuggestion(t,i,o);let n=t,a=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",a="object"===M.getType(e[t]));let r=i[n];a&&void 0!==r.__type__&&(r=r.__type__),M.checkFields(t,e,i,n,r,o)}static checkFields(t,e,o,n,a,r){let s=function(e){console.log("%c"+e+M.printLocation(r,t),T)},h=M.getType(e[t]),l=a[h];void 0!==l?"array"===M.getType(l)&&-1===l.indexOf(e[t])?(s('Invalid option detected in "'+t+'". Allowed values are:'+M.print(l)+' not "'+e[t]+'". '),C=!0):"object"===h&&"__any__"!==n&&(r=i.copyAndExtendArray(r,t),M.parse(e[t],o[n],r)):void 0===a.any&&(s('Invalid type received for "'+t+'". Expected: '+M.print(Object.keys(a))+". Received ["+h+'] "'+e[t]+'"'),C=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let o,n=M.findInOptions(t,e,i,!1),a=M.findInOptions(t,S,[],!0);o=void 0!==n.indexMatch?" in "+M.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n':a.distance<=4&&n.distance>a.distance?" in "+M.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+M.printLocation(a.path,a.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+M.printLocation(n.path,t):". Did you mean one of these: "+M.print(Object.keys(e))+M.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+o,T),C=!0}static findInOptions(t,e,o,n=!1){let a=1e9,r="",s=[],h=t.toLowerCase(),l=void 0;for(let d in e){let c;if(void 0!==e[d].__type__&&!0===n){let n=M.findInOptions(t,e[d],i.copyAndExtendArray(o,d));a>n.distance&&(r=n.closestMatch,s=n.path,a=n.distance,l=n.indexMatch)}else-1!==d.toLowerCase().indexOf(h)&&(l=d),c=M.levenshteinDistance(t,d),a>c&&(r=d,s=i.copyArray(o),a=c)}return{closestMatch:r,path:s,distance:a,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,o,n=[];for(i=0;i<=e.length;i++)n[i]=[i];for(o=0;o<=t.length;o++)n[0][o]=o;for(i=1;i<=e.length;i++)for(o=1;o<=t.length;o++)e.charAt(i-1)==t.charAt(o-1)?n[i][o]=n[i-1][o-1]:n[i][o]=Math.min(n[i-1][o-1]+1,Math.min(n[i][o-1]+1,n[i-1][o]+1));return n[e.length][t.length]}}let R="string",D="boolean",A="number",P="object",z={fill:{string:R},stroke:{string:R},strokeWidth:{number:A},__type__:{string:R,object:P,undefined:"undefined"}},E={animationAutoStart:{boolean:D,undefined:"undefined"},animationInterval:{number:A},animationPreload:{boolean:D},axisColor:{string:R},axisFontSize:{number:A},axisFontType:{string:R},backgroundColor:z,xBarWidth:{number:A,undefined:"undefined"},yBarWidth:{number:A,undefined:"undefined"},cameraPosition:{distance:{number:A},horizontal:{number:A},vertical:{number:A},__type__:{object:P}},zoomable:{boolean:D},ctrlToZoom:{boolean:D},xCenter:{string:R},yCenter:{string:R},colormap:{hue:{start:{number:A},end:{number:A},saturation:{number:A},brightness:{number:A},colorStops:{number:A},__type__:{object:P}},__type__:{array:"array",object:P,function:"function",undefined:"undefined"}},dataColor:z,dotSizeMinFraction:{number:A},dotSizeMaxFraction:{number:A},dotSizeRatio:{number:A},filterLabel:{string:R},gridColor:{string:R},onclick:{function:"function"},keepAspectRatio:{boolean:D},xLabel:{string:R},yLabel:{string:R},zLabel:{string:R},legendLabel:{string:R},xMin:{number:A,undefined:"undefined"},yMin:{number:A,undefined:"undefined"},zMin:{number:A,undefined:"undefined"},xMax:{number:A,undefined:"undefined"},yMax:{number:A,undefined:"undefined"},zMax:{number:A,undefined:"undefined"},showAnimationControls:{boolean:D,undefined:"undefined"},showGrayBottom:{boolean:D},showGrid:{boolean:D},showLegend:{boolean:D,undefined:"undefined"},showPerspective:{boolean:D},showShadow:{boolean:D},showSurfaceGrid:{boolean:D},showXAxis:{boolean:D},showYAxis:{boolean:D},showZAxis:{boolean:D},rotateAxisLabels:{boolean:D},surfaceColors:{hue:{start:{number:A},end:{number:A},saturation:{number:A},brightness:{number:A},colorStops:{number:A},__type__:{object:P}},__type__:{boolean:D,array:"array",object:P,undefined:"undefined"}},xStep:{number:A,undefined:"undefined"},yStep:{number:A,undefined:"undefined"},zStep:{number:A,undefined:"undefined"},style:{number:A,string:["bar","bar-color","bar-size","dot","dot-line","dot-color","dot-size","line","grid","surface"]},tooltip:{boolean:D,function:"function"},tooltipDelay:{number:A},tooltipStyle:{content:{color:{string:R},background:{string:R},border:{string:R},borderRadius:{string:R},boxShadow:{string:R},padding:{string:R},__type__:{object:P}},line:{borderLeft:{string:R},height:{string:R},width:{string:R},pointerEvents:{string:R},__type__:{object:P}},dot:{border:{string:R},borderRadius:{string:R},height:{string:R},width:{string:R},pointerEvents:{string:R},__type__:{object:P}},__type__:{object:P}},xValueLabel:{function:"function"},yValueLabel:{function:"function"},zValueLabel:{function:"function"},valueMax:{number:A,undefined:"undefined"},valueMin:{number:A,undefined:"undefined"},verticalRatio:{number:A},height:{string:R},width:{string:R},__type__:{object:P}};function k(){this.min=void 0,this.max=void 0}k.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.max<t)&&(this.max=t))},k.prototype.combine=function(t){this.add(t.min),this.add(t.max)},k.prototype.expand=function(t){if(void 0!==t){var e=this.min-t,i=this.max+t;if(e>i)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},k.prototype.range=function(){return this.max-this.min},k.prototype.center=function(){return(this.min+this.max)/2};var B=k;function O(t,e,i){this.dataGroup=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=t.getDistinctValues(this.column),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}function I(){this.dataTable=null}O.prototype.isLoaded=function(){return this.loaded},O.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},O.prototype.getLabel=function(){return this.graph.filterLabel},O.prototype.getColumn=function(){return this.column},O.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},O.prototype.getValues=function(){return this.values},O.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},O.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var n=new o.DataView(this.dataGroup.getDataSet(),{filter:function(t){return t[i.column]==i.value}}).get();e=this.dataGroup._getDataPoints(n),this.dataPoints[t]=e}return e},O.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},O.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},O.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var o=this;setTimeout((function(){o.loadInBackground(t+1)}),10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},I.prototype.initializeData=function(t,e,i){if(void 0!==e){var n;if(Array.isArray(e)&&(e=new o.DataSet(e)),!(e instanceof o.DataSet||e instanceof o.DataView))throw new Error("Array, DataSet, or DataView expected");if(0!=(n=e.get()).length){this.style=i,this.dataSet&&this.dataSet.off("*",this._onChange),this.dataSet=e,this.dataTable=n;var a=this;this._onChange=function(){t.setData(a.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z";var r=t.hasBars(i);if(r&&(void 0!==t.defaultXBarWidth?this.xBarWidth=t.defaultXBarWidth:this.xBarWidth=this.getSmallestDifference(n,this.colX)||1,void 0!==t.defaultYBarWidth?this.yBarWidth=t.defaultYBarWidth:this.yBarWidth=this.getSmallestDifference(n,this.colY)||1),this._initializeRange(n,this.colX,t,r),this._initializeRange(n,this.colY,t,r),this._initializeRange(n,this.colZ,t,!1),n[0].hasOwnProperty("style")){this.colValue="style";var s=this.getColumnRange(n,this.colValue);this._setRangeDefaults(s,t.defaultValueMin,t.defaultValueMax),this.valueRange=s}else this.colValue="z",this.valueRange=this.zRange;return this.getDataTable()[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new O(this,"filter",t),this.dataFilter.setOnLoadCallback((function(){t.redraw()}))),this.dataFilter?this.dataFilter._getDataPoints():this._getDataPoints(this.getDataTable())}}},I.prototype._collectRangeSettings=function(t,e){if(-1==["x","y","z"].indexOf(t))throw new Error("Column '"+t+"' invalid");var i=t.toUpperCase();return{barWidth:this[t+"BarWidth"],min:e["default"+i+"Min"],max:e["default"+i+"Max"],step:e["default"+i+"Step"],range_label:t+"Range",step_label:t+"Step"}},I.prototype._initializeRange=function(t,e,i,o){var n=this._collectRangeSettings(e,i),a=this.getColumnRange(t,e);o&&"z"!=e&&a.expand(n.barWidth/2),this._setRangeDefaults(a,n.min,n.max),this[n.range_label]=a,this[n.step_label]=void 0!==n.step?n.step:a.range()/5},I.prototype.getDistinctValues=function(t,e){void 0===e&&(e=this.dataTable);for(var i=[],o=0;o<e.length;o++){var n=e[o][t]||0;-1===i.indexOf(n)&&i.push(n)}return i.sort((function(t,e){return t-e}))},I.prototype.getSmallestDifference=function(t,e){for(var i=this.getDistinctValues(t,e),o=null,n=1;n<i.length;n++){var a=i[n]-i[n-1];(null==o||o>a)&&(o=a)}return o},I.prototype.getColumnRange=function(t,e){for(var i=new B,o=0;o<t.length;o++){var n=t[o][e];i.adjust(n)}return i},I.prototype.getNumberOfRows=function(){return this.dataTable.length},I.prototype._setRangeDefaults=function(t,e,i){void 0!==e&&(t.min=e),void 0!==i&&(t.max=i),t.max<=t.min&&(t.max=t.min+1)},I.prototype.getDataTable=function(){return this.dataTable},I.prototype.getDataSet=function(){return this.dataSet},I.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new a;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new a(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},I.prototype.initDataAsMatrix=function(t){var e,i,o,n,a=this.getDistinctValues(this.colX,t),r=this.getDistinctValues(this.colY,t),s=this.getDataPoints(t),h=[];for(o=0;o<s.length;o++){n=s[o];var l=a.indexOf(n.point.x),d=r.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0);return s},I.prototype.getInfo=function(){var t=this.dataFilter;if(t)return t.getLabel()+": "+t.getSelectedValue()},I.prototype.reload=function(){this.dataTable&&this.setData(this.dataTable)},I.prototype._getDataPoints=function(t){var e=[];if(this.style===c.GRID||this.style===c.SURFACE)e=this.initDataAsMatrix(t);else if(e=this.getDataPoints(t),this.style===c.LINE)for(var i=0;i<e.length;i++)i>0&&(e[i-1].pointNext=e[i]);return e},W.STYLE=c;function W(t,e,i){if(!(this instanceof W))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.dataGroup=new I,this.dataPoints=null,this.create(),function(t,e){if(void 0===t||v(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");m=t,g(t,e,p),g(t,e,f,"default"),w(t,e),e.margin=10,e.showTooltip=!1,e.onclick_callback=null,e.eye=new a(0,0,-1)}(W.DEFAULTS,this),this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.setOptions(i),this.setData(e)}function G(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function Y(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}W.DEFAULTS={width:"400px",height:"400px",filterLabel:"time",legendLabel:"value",xLabel:"x",yLabel:"y",zLabel:"z",xValueLabel:function(t){return t},yValueLabel:function(t){return t},zValueLabel:function(t){return t},showXAxis:!0,showYAxis:!0,showZAxis:!0,showGrayBottom:!1,showGrid:!0,showPerspective:!0,showShadow:!1,showSurfaceGrid:!0,keepAspectRatio:!0,rotateAxisLabels:!0,verticalRatio:.5,dotSizeRatio:.02,dotSizeMinFraction:.5,dotSizeMaxFraction:2.5,showAnimationControls:void 0,animationInterval:1e3,animationPreload:!1,animationAutoStart:void 0,axisFontSize:14,axisFontType:"arial",axisColor:"#4D4D4D",gridColor:"#D3D3D3",xCenter:"55%",yCenter:"50%",style:W.STYLE.DOT,tooltip:!1,tooltipDelay:300,tooltipStyle:{content:{padding:"10px",border:"1px solid #4d4d4d",color:"#1a1a1a",background:"rgba(255,255,255,0.7)",borderRadius:"2px",boxShadow:"5px 5px 10px rgba(128,128,128,0.5)"},line:{height:"40px",width:"0",borderLeft:"1px solid #4d4d4d",pointerEvents:"none"},dot:{height:"0",width:"0",border:"5px solid #4d4d4d",borderRadius:"5px",pointerEvents:"none"}},dataColor:{fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},surfaceColors:void 0,colormap:void 0,cameraPosition:{horizontal:1,vertical:.5,distance:1.7},zoomable:!0,ctrlToZoom:!1,showLegend:void 0,backgroundColor:void 0,xBarWidth:void 0,yBarWidth:void 0,valueMin:void 0,valueMax:void 0,xMin:void 0,xMax:void 0,xStep:void 0,yMin:void 0,yMax:void 0,yStep:void 0,zMin:void 0,zMax:void 0,zStep:void 0},e(W.prototype),W.prototype._setScale=function(){this.scale=new a(1/this.xRange.range(),1/this.yRange.range(),1/this.zRange.range()),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,void 0!==this.valueRange&&(this.scale.value=1/this.valueRange.range());var t=this.xRange.center()*this.scale.x,e=this.yRange.center()*this.scale.y,i=this.zRange.center()*this.scale.z;this.camera.setArmLocation(t,e,i)},W.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},W.prototype._convertPointToTranslation=function(t){var e=this.camera.getCameraLocation(),i=this.camera.getCameraRotation(),o=t.x*this.scale.x,n=t.y*this.scale.y,r=t.z*this.scale.z,s=e.x,h=e.y,l=e.z,d=Math.sin(i.x),c=Math.cos(i.x),u=Math.sin(i.y),p=Math.cos(i.y),f=Math.sin(i.z),m=Math.cos(i.z);return new a(p*(f*(n-h)+m*(o-s))-u*(r-l),d*(p*(r-l)+u*(f*(n-h)+m*(o-s)))+c*(m*(n-h)-f*(o-s)),c*(p*(r-l)+u*(f*(n-h)+m*(o-s)))-d*(m*(n-h)-f*(o-s)))},W.prototype._convertTranslationToScreen=function(t){var e,i,o=this.eye.x,n=this.eye.y,a=this.eye.z,s=t.x,h=t.y,l=t.z;return this.showPerspective?(e=a/l*(s-o),i=a/l*(h-n)):(e=s*(-a/this.camera.getArmLength()),i=h*(-a/this.camera.getArmLength())),new r(this.currentXCenter+e*this.frame.canvas.clientWidth,this.currentYCenter-i*this.frame.canvas.clientWidth)},W.prototype._calcTranslations=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.trans=this._convertPointToTranslation(i.point),i.screen=this._convertTranslationToScreen(i.trans);var o=this._convertPointToTranslation(i.bottom);i.dist=this.showPerspective?o.length():-o.z}t.sort((function(t,e){return e.dist-t.dist}))},W.prototype._initializeRanges=function(){var t=this.dataGroup;this.xRange=t.xRange,this.yRange=t.yRange,this.zRange=t.zRange,this.valueRange=t.valueRange,this.xStep=t.xStep,this.yStep=t.yStep,this.zStep=t.zStep,this.xBarWidth=t.xBarWidth,this.yBarWidth=t.yBarWidth,this.colX=t.colX,this.colY=t.colY,this.colZ=t.colZ,this.colValue=t.colValue,this._setScale()},W.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new a;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new a(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},W.prototype._getDataPoints=function(t){var e,i,o,n,a=[];if(this.style===W.STYLE.GRID||this.style===W.STYLE.SURFACE){var r=this.dataGroup.getDistinctValues(this.colX,t),s=this.dataGroup.getDistinctValues(this.colY,t);a=this.getDataPoints(t);var h=[];for(o=0;o<a.length;o++){n=a[o];var l=r.indexOf(n.point.x),d=s.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0)}else if(a=this.getDataPoints(t),this.style===W.STYLE.LINE)for(o=0;o<a.length;o++)o>0&&(a[o-1].pointNext=a[o]);return a},W.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this;i.addEventListener(this.frame.canvas,"mousedown",(function(t){e._onMouseDown(t)})),i.addEventListener(this.frame.canvas,"touchstart",(function(t){e._onTouchStart(t)})),i.addEventListener(this.frame.canvas,"mousewheel",(function(t){e._onWheel(t)})),i.addEventListener(this.frame.canvas,"mousemove",(function(t){e._onTooltip(t)})),i.addEventListener(this.frame.canvas,"click",(function(t){e._onClick(t)})),this.containerElement.appendChild(this.frame)},W.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},W.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},W.prototype.animationStart=function(){if(this.animationAutoStart&&this.dataGroup.dataFilter){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()}},W.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},W.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},W.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},W.prototype._readData=function(t){this.dataPoints=this.dataGroup.initializeData(this,t,this.style),this._initializeRanges(),this._redrawFilter()},W.prototype.setData=function(t){null!=t&&(this._readData(t),this.redraw(),this.animationStart())},W.prototype.setOptions=function(t){if(void 0===t)return;!0===M.validate(t,E)&&console.log("%cErrors have been found in the supplied options object.",T),this.animationStop(),function(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===m||v(m))throw new Error("DEFAULTS not set for module Settings");x(t,e,p),x(t,e,f,"default"),w(t,e)}}(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.setAxisLabelMethod(),this.setData(this.dataGroup.getDataTable()),this.animationStart()},W.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case W.STYLE.BAR:t=this._redrawBarGraphPoint;break;case W.STYLE.BARCOLOR:t=this._redrawBarColorGraphPoint;break;case W.STYLE.BARSIZE:t=this._redrawBarSizeGraphPoint;break;case W.STYLE.DOT:t=this._redrawDotGraphPoint;break;case W.STYLE.DOTLINE:t=this._redrawDotLineGraphPoint;break;case W.STYLE.DOTCOLOR:t=this._redrawDotColorGraphPoint;break;case W.STYLE.DOTSIZE:t=this._redrawDotSizeGraphPoint;break;case W.STYLE.SURFACE:t=this._redrawSurfaceGraphPoint;break;case W.STYLE.GRID:t=this._redrawGridGraphPoint;break;case W.STYLE.LINE:t=this._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},W.prototype.setAxisLabelMethod=function(){this.rotateAxisLabels?(this._drawAxisLabelX=this.drawAxisLabelXRotate,this._drawAxisLabelY=this.drawAxisLabelYRotate,this._drawAxisLabelZ=this.drawAxisLabelZRotate):(this._drawAxisLabelX=this.drawAxisLabelX,this._drawAxisLabelY=this.drawAxisLabelY,this._drawAxisLabelZ=this.drawAxisLabelZ)},W.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},W.prototype._getContext=function(){var t=this.frame.canvas.getContext("2d");return t.lineJoin="round",t.lineCap="round",t},W.prototype._redrawClear=function(){var t=this.frame.canvas;t.getContext("2d").clearRect(0,0,t.width,t.height)},W.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},W.prototype._getLegendWidth=function(){var t;this.style===W.STYLE.DOTSIZE?t=this._dotSize()*this.dotSizeMaxFraction:t=this.style===W.STYLE.BARSIZE?this.xBarWidth:20;return t},W.prototype._redrawLegend=function(){if(!0===this.showLegend&&this.style!==W.STYLE.LINE&&this.style!==W.STYLE.BARSIZE){var t=this.style===W.STYLE.BARSIZE||this.style===W.STYLE.DOTSIZE,e=this.style===W.STYLE.DOTSIZE||this.style===W.STYLE.DOTCOLOR||this.style===W.STYLE.SURFACE||this.style===W.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),o=this.margin,n=this._getLegendWidth(),a=this.frame.clientWidth-this.margin,s=a-n,h=o+i,d=this._getContext();if(d.lineWidth=1,d.font="14px arial",!1===t){var c,u=i;for(c=0;c<u;c++){const t=1-(c-0)/(u-0),e=this._colormap(t,1);d.strokeStyle=e,d.beginPath(),d.moveTo(s,o+c),d.lineTo(a,o+c),d.stroke()}d.strokeStyle=this.axisColor,d.strokeRect(s,o,n,i)}else{var p;this.style===W.STYLE.DOTSIZE?p=n*(this.dotSizeMinFraction/this.dotSizeMaxFraction):(this.style,W.STYLE.BARSIZE),d.strokeStyle=this.axisColor,d.fillStyle=this.dataColor.fill,d.beginPath(),d.moveTo(s,o),d.lineTo(a,o),d.lineTo(s+p,h),d.lineTo(s,h),d.closePath(),d.fill(),d.stroke()}var f,m,v=e?this.valueRange.min:this.zRange.min,y=e?this.valueRange.max:this.zRange.max,g=new l(v,y,(y-v)/5,!0);for(g.start(!0);!g.end();)c=h-(g.getCurrent()-v)/(y-v)*i,f=new r(s-5,c),m=new r(s,c),this._line(d,f,m),d.textAlign="right",d.textBaseline="middle",d.fillStyle=this.axisColor,d.fillText(g.getCurrent(),s-10,c),g.next();d.textAlign="right",d.textBaseline="top";var x=this.legendLabel;d.fillText(x,a,h+this.margin)}},W.prototype._redrawFilter=function(){var t=this.dataGroup.dataFilter,e=this.frame.filter;if(e.innerHTML="",t){var i=new s(e,{visible:this.showAnimationControls});e.slider=i,e.style.padding="10px",i.setValues(t.values),i.setPlayInterval(this.animationInterval);var o=this;i.setOnChangeCallback((function(){var t=o.dataGroup.dataFilter,e=i.getIndex();t.selectValue(e),o.dataPoints=t._getDataPoints(),o.redraw()}))}else e.slider=void 0},W.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},W.prototype._redrawInfo=function(){var t=this.dataGroup.getInfo();if(void 0!==t){var e=this._getContext();e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,o=this.margin;e.fillText(t,i,o)}},W.prototype._line=function(t,e,i,o){void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()},W.prototype.drawAxisLabelX=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},W.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},W.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},W.prototype.drawAxisLabelXRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},W.prototype.drawAxisLabelYRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},W.prototype.drawAxisLabelZRotate=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},W.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),a=this._convert3Dto2D(i);this._line(t,n,a,o)},W.prototype._redrawAxis=function(){var t,e,i,o,n,s,h,d,c,u,p=this._getContext();p.font=this.axisFontSize/this.camera.getArmLength()+"px "+this.axisFontType;var f,m,v,y=.025/this.scale.x,g=.025/this.scale.y,x=5/this.camera.getArmLength(),w=this.camera.getArmRotation().horizontal,b=new r(Math.cos(w),Math.sin(w)),_=this.xRange,L=this.yRange,S=this.zRange;for(p.lineWidth=1,o=void 0===this.defaultXStep,(i=new l(_.min,_.max,this.xStep,o)).start(!0);!i.end();){var C=i.getCurrent();if(this.showGrid?(t=new a(C,L.min,S.min),e=new a(C,L.max,S.min),this._line3d(p,t,e,this.gridColor)):this.showXAxis&&(t=new a(C,L.min,S.min),e=new a(C,L.min+y,S.min),this._line3d(p,t,e,this.axisColor),t=new a(C,L.max,S.min),e=new a(C,L.max-y,S.min),this._line3d(p,t,e,this.axisColor)),this.showXAxis){h=b.x>0?L.min:L.max,f=new a(C,h,S.min);let t=" "+this.xValueLabel(C)+" ";this._drawAxisLabelX.call(this,p,f,t,w,x)}i.next()}for(p.lineWidth=1,o=void 0===this.defaultYStep,(i=new l(L.min,L.max,this.yStep,o)).start(!0);!i.end();){var T=i.getCurrent();if(this.showGrid?(t=new a(_.min,T,S.min),e=new a(_.max,T,S.min),this._line3d(p,t,e,this.gridColor)):this.showYAxis&&(t=new a(_.min,T,S.min),e=new a(_.min+g,T,S.min),this._line3d(p,t,e,this.axisColor),t=new a(_.max,T,S.min),e=new a(_.max-g,T,S.min),this._line3d(p,t,e,this.axisColor)),this.showYAxis){s=b.y>0?_.min:_.max,f=new a(s,T,S.min);let t=" "+this.yValueLabel(T)+" ";this._drawAxisLabelY.call(this,p,f,t,w,x)}i.next()}if(this.showZAxis){for(p.lineWidth=1,o=void 0===this.defaultZStep,(i=new l(S.min,S.max,this.zStep,o)).start(!0),s=b.x>0?_.min:_.max,h=b.y<0?L.min:L.max;!i.end();){var M=i.getCurrent(),R=new a(s,h,M),D=this._convert3Dto2D(R);e=new r(D.x-x,D.y),this._line(p,D,e,this.axisColor);let t=this.zValueLabel(M)+" ";this._drawAxisLabelZ.call(this,p,R,t,5),i.next()}p.lineWidth=1,t=new a(s,h,S.min),e=new a(s,h,S.max),this._line3d(p,t,e,this.axisColor)}this.showXAxis&&(p.lineWidth=1,m=new a(_.min,L.min,S.min),v=new a(_.max,L.min,S.min),this._line3d(p,m,v,this.axisColor),m=new a(_.min,L.max,S.min),v=new a(_.max,L.max,S.min),this._line3d(p,m,v,this.axisColor));this.showYAxis&&(p.lineWidth=1,t=new a(_.min,L.min,S.min),e=new a(_.min,L.max,S.min),this._line3d(p,t,e,this.axisColor),t=new a(_.max,L.min,S.min),e=new a(_.max,L.max,S.min),this._line3d(p,t,e,this.axisColor));var A=this.xLabel;A.length>0&&this.showXAxis&&(u=.1/this.scale.y,s=(_.max+3*_.min)/4,h=b.x>0?L.min-u:L.max+u,n=new a(s,h,S.min),this.drawAxisLabelX(p,n,A,w));var P=this.yLabel;P.length>0&&this.showYAxis&&(c=.1/this.scale.x,s=b.y>0?_.min-c:_.max+c,h=(L.max+3*L.min)/4,n=new a(s,h,S.min),this.drawAxisLabelY(p,n,P,w));var z=this.zLabel;z.length>0&&this.showZAxis&&(30,s=b.x>0?_.min:_.max,h=b.y<0?L.min:L.max,d=(S.max+3*S.min)/4,n=new a(s,h,d),this.drawAxisLabelZ(p,n,z,30))},W.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-this.eye.z/this.camera.getArmLength()*this.dataColor.strokeWidth:this.dataColor.strokeWidth},W.prototype._redrawBar=function(t,e,i,o,n,r){var s,h=this,l=e.point,d=this.zRange.min,c=[{point:new a(l.x-i,l.y-o,l.z)},{point:new a(l.x+i,l.y-o,l.z)},{point:new a(l.x+i,l.y+o,l.z)},{point:new a(l.x-i,l.y+o,l.z)}],u=[{point:new a(l.x-i,l.y-o,d)},{point:new a(l.x+i,l.y-o,d)},{point:new a(l.x+i,l.y+o,d)},{point:new a(l.x-i,l.y+o,d)}];c.forEach((function(t){t.screen=h._convert3Dto2D(t.point)})),u.forEach((function(t){t.screen=h._convert3Dto2D(t.point)}));var p=[{corners:c,center:a.avg(u[0].point,u[2].point)},{corners:[c[0],c[1],u[1],u[0]],center:a.avg(u[1].point,u[0].point)},{corners:[c[1],c[2],u[2],u[1]],center:a.avg(u[2].point,u[1].point)},{corners:[c[2],c[3],u[3],u[2]],center:a.avg(u[3].point,u[2].point)},{corners:[c[3],c[0],u[0],u[3]],center:a.avg(u[0].point,u[3].point)}];e.surfaces=p;for(let t=0;t<p.length;t++){s=p[t];var f=this._convertPointToTranslation(s.center);s.dist=this.showPerspective?f.length():-f.z}p.sort((function(t,e){var i=e.dist-t.dist;return i||(t.corners===c?1:e.corners===c?-1:0)})),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=r,t.fillStyle=n;for(let e=2;e<p.length;e++)s=p[e],this._polygon(t,s.corners)},W.prototype._polygon=function(t,e,i,o){if(!(e.length<2)){void 0!==i&&(t.fillStyle=i),void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var n=1;n<e.length;++n){var a=e[n];t.lineTo(a.screen.x,a.screen.y)}t.closePath(),t.fill(),t.stroke()}},W.prototype._drawCircle=function(t,e,i,o,n){var a=this._calcRadius(e,n);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=i,t.beginPath(),t.arc(e.screen.x,e.screen.y,a,0,2*Math.PI,!0),t.fill(),t.stroke()},W.prototype._getColorsRegular=function(t){const e=(t.point.value-this.valueRange.min)*this.scale.value;return{fill:this._colormap(e,1),border:this._colormap(e,.8)}},W.prototype._getColorsColor=function(t){var e,i,o;if(t&&t.point&&t.point.data&&t.point.data.style&&(o=t.point.data.style),o&&"object"==typeof o&&o.fill&&o.stroke)return{fill:o.fill,border:o.stroke};if("string"==typeof t.point.value)e=t.point.value,i=t.point.value;else{const o=(t.point.value-this.valueRange.min)*this.scale.value;e=this._colormap(o,1),i=this._colormap(o,.8)}return{fill:e,border:i}},W.prototype._getColorsSize=function(){return{fill:this.dataColor.fill,border:this.dataColor.stroke}},W.prototype._colormap=function(t,e=1){let o,n,a,r;const s=this.colormap;if(Array.isArray(s)){const e=s.length-1,i=Math.max(Math.floor(t*e),0),r=Math.min(i+1,e),h=t*e-i,l=s[i],d=s[r];o=l.r+h*(d.r-l.r),n=l.g+h*(d.g-l.g),a=l.b+h*(d.b-l.b)}else if("function"==typeof s)({r:o,g:n,b:a,a:r}=s(t));else{const e=240*(1-t);({r:o,g:n,b:a}=i.HSVToRGB(e/360,1,1))}return"number"!=typeof r||Number.isNaN(r)?`RGB(${Math.round(o*e)}, ${Math.round(n*e)}, ${Math.round(a*e)})`:`RGBA(${Math.round(o*e)}, ${Math.round(n*e)}, ${Math.round(a*e)}, ${r})`},W.prototype._calcRadius=function(t,e){var i;return void 0===e&&(e=this._dotSize()),(i=this.showPerspective?e/-t.trans.z:e*(-this.eye.z/this.camera.getArmLength()))<0&&(i=0),i},W.prototype._redrawBarGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsRegular(e);this._redrawBar(t,e,i,o,n.fill,n.border)},W.prototype._redrawBarColorGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsColor(e);this._redrawBar(t,e,i,o,n.fill,n.border)},W.prototype._redrawBarSizeGraphPoint=function(t,e){var i=(e.point.value-this.valueRange.min)/this.valueRange.range(),o=this.xBarWidth/2*(.8*i+.2),n=this.yBarWidth/2*(.8*i+.2),a=this._getColorsSize();this._redrawBar(t,e,o,n,a.fill,a.border)},W.prototype._redrawDotGraphPoint=function(t,e){var i=this._getColorsRegular(e);this._drawCircle(t,e,i.fill,i.border)},W.prototype._redrawDotLineGraphPoint=function(t,e){var i=this._convert3Dto2D(e.bottom);t.lineWidth=1,this._line(t,i,e.screen,this.gridColor),this._redrawDotGraphPoint(t,e)},W.prototype._redrawDotColorGraphPoint=function(t,e){var i=this._getColorsColor(e);this._drawCircle(t,e,i.fill,i.border)},W.prototype._redrawDotSizeGraphPoint=function(t,e){var i=this._dotSize(),o=(e.point.value-this.valueRange.min)/this.valueRange.range(),n=i*this.dotSizeMinFraction,a=n+(i*this.dotSizeMaxFraction-n)*o,r=this._getColorsSize();this._drawCircle(t,e,r.fill,r.border,a)},W.prototype._redrawSurfaceGraphPoint=function(t,e){var i=e.pointRight,o=e.pointTop,n=e.pointCross;if(void 0!==e&&void 0!==i&&void 0!==o&&void 0!==n){var r,s,h,l=!0;if(this.showGrayBottom||this.showShadow){var d=a.subtract(n.trans,e.trans),c=a.subtract(o.trans,i.trans),u=a.crossProduct(d,c);if(this.showPerspective){let t=a.avg(a.avg(e.trans,n.trans),a.avg(i.trans,o.trans));h=-a.dotProduct(u.normalize(),t.normalize())}else h=u.z/u.length();l=h>0}if(l||!this.showGrayBottom){const t=((e.point.value+i.point.value+o.point.value+n.point.value)/4-this.valueRange.min)*this.scale.value,a=this.showShadow?(1+h)/2:1;r=this._colormap(t,a)}else r="gray";s=this.showSurfaceGrid?this.axisColor:r,t.lineWidth=this._getStrokeWidth(e);var p=[e,i,n,o];this._polygon(t,p,r,s)}},W.prototype._drawGridLine=function(t,e,i){if(void 0===e||void 0===i)return;const o=((e.point.value+i.point.value)/2-this.valueRange.min)*this.scale.value;t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._colormap(o,1),this._line(t,e.screen,i.screen)},W.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},W.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},W.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t<this.dataPoints.length;t++){var i=this.dataPoints[t];this._pointDrawingMethod.call(this,e,i)}},W.prototype._storeMousePosition=function(t){this.startMouseX=G(t),this.startMouseY=Y(t),this._startCameraOffset=this.camera.getOffset()},W.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this._storeMousePosition(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},i.addEventListener(document,"mousemove",e.onmousemove),i.addEventListener(document,"mouseup",e.onmouseup),i.preventDefault(t)}},W.prototype._onMouseMove=function(t){this.moving=!0,t=t||window.event;var e=parseFloat(G(t))-this.startMouseX,o=parseFloat(Y(t))-this.startMouseY;if(t&&!0===t.ctrlKey){var n=.5*this.frame.clientWidth,a=.5*this.frame.clientHeight,r=(this._startCameraOffset.x||0)-e/n*this.camera.armLength*.8,s=(this._startCameraOffset.y||0)+o/a*this.camera.armLength*.8;this.camera.setOffset(r,s),this._storeMousePosition(t)}else{var h=this.startArmRotation.horizontal+e/200,l=this.startArmRotation.vertical+o/200,d=Math.sin(4/360*2*Math.PI);Math.abs(Math.sin(h))<d&&(h=Math.round(h/Math.PI)*Math.PI-.001),Math.abs(Math.cos(h))<d&&(h=(Math.round(h/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(l))<d&&(l=Math.round(l/Math.PI)*Math.PI),Math.abs(Math.cos(l))<d&&(l=(Math.round(l/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(h,l)}this.redraw();var c=this.getCameraPosition();this.emit("cameraPositionChange",c),i.preventDefault(t)},W.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,i.removeEventListener(document,"mousemove",this.onmousemove),i.removeEventListener(document,"mouseup",this.onmouseup),i.preventDefault(t)},W.prototype._onClick=function(t){if(this.onclick_callback||this.hasListeners("click")){if(this.moving)this.moving=!1;else{var e=this.frame.getBoundingClientRect(),o=G(t)-e.left,n=Y(t)-e.top,a=this._dataPointFromXY(o,n);a&&(this.onclick_callback&&this.onclick_callback(a.point.data),this.emit("click",a.point.data))}i.preventDefault(t)}},W.prototype._onTooltip=function(t){var e=this.tooltipDelay,i=this.frame.getBoundingClientRect(),o=G(t)-i.left,n=Y(t)-i.top;if(this.showTooltip)if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)this._hideTooltip();else if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(o,n);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var r=this;this.tooltipTimeout=setTimeout((function(){r.tooltipTimeout=null;var t=r._dataPointFromXY(o,n);t&&r._showTooltip(t)}),e)}},W.prototype._onTouchStart=function(t){this.touchDown=!0;var e=this;this.ontouchmove=function(t){e._onTouchMove(t)},this.ontouchend=function(t){e._onTouchEnd(t)},i.addEventListener(document,"touchmove",e.ontouchmove),i.addEventListener(document,"touchend",e.ontouchend),this._onMouseDown(t)},W.prototype._onTouchMove=function(t){this._onMouseMove(t)},W.prototype._onTouchEnd=function(t){this.touchDown=!1,i.removeEventListener(document,"touchmove",this.ontouchmove),i.removeEventListener(document,"touchend",this.ontouchend),this._onMouseUp(t)},W.prototype._onWheel=function(t){if(t||(t=window.event),this.zoomable&&(!this.ctrlToZoom||t.ctrlKey)){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var o=this.camera.getArmLength()*(1-e/10);this.camera.setArmLength(o),this.redraw(),this._hideTooltip()}var n=this.getCameraPosition();this.emit("cameraPositionChange",n),i.preventDefault(t)}},W.prototype._insideTriangle=function(t,e){var i=e[0],o=e[1],n=e[2];function a(t){return t>0?1:t<0?-1:0}var r=a((o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x)),s=a((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),h=a((i.x-n.x)*(t.y-n.y)-(i.y-n.y)*(t.x-n.x));return!(0!=r&&0!=s&&r!=s||0!=s&&0!=h&&s!=h||0!=r&&0!=h&&r!=h)},W.prototype._dataPointFromXY=function(t,e){var i,o=null,n=null,a=null,s=new r(t,e);if(this.style===W.STYLE.BAR||this.style===W.STYLE.BARCOLOR||this.style===W.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){var h=(o=this.dataPoints[i]).surfaces;if(h)for(var l=h.length-1;l>=0;l--){var d=h[l].corners,c=[d[0].screen,d[1].screen,d[2].screen],u=[d[2].screen,d[3].screen,d[0].screen];if(this._insideTriangle(s,c)||this._insideTriangle(s,u))return o}}else for(i=0;i<this.dataPoints.length;i++){var p=(o=this.dataPoints[i]).screen;if(p){var f=Math.abs(t-p.x),m=Math.abs(e-p.y),v=Math.sqrt(f*f+m*m);(null===a||v<a)&&v<100&&(a=v,n=o)}}return n},W.prototype.hasBars=function(t){return t==W.STYLE.BAR||t==W.STYLE.BARCOLOR||t==W.STYLE.BARSIZE},W.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),Object.assign(e.style,{},this.tooltipStyle.content),e.style.position="absolute",i=document.createElement("div"),Object.assign(i.style,{},this.tooltipStyle.line),i.style.position="absolute",o=document.createElement("div"),Object.assign(o.style,{},this.tooltipStyle.dot),o.style.position="absolute",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,a=e.offsetHeight,r=i.offsetHeight,s=o.offsetWidth,h=o.offsetHeight,l=t.screen.x-n/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=l+"px",e.style.top=t.screen.y-r-a+"px",o.style.left=t.screen.x-s/2+"px",o.style.top=t.screen.y-h/2+"px"},W.prototype._hideTooltip=function(){if(this.tooltip)for(var t in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}},W.prototype.setCameraPosition=function(t){L(t,this),this.redraw()},W.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()},t.Graph3d=W,t.Graph3dCamera=d,t.Graph3dFilter=O,t.Graph3dPoint2d=r,t.Graph3dPoint3d=a,t.Graph3dSlider=s,t.Graph3dStepNumber=l,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("component-emitter"),require("vis-util/esnext/umd/vis-util.js"),require("vis-data/esnext/umd/vis-data.js")):"function"==typeof define&&define.amd?define(["exports","component-emitter","vis-util/esnext/umd/vis-util.js","vis-data/esnext/umd/vis-data.js"],e):e((t=t||self).vis=t.vis||{},t.Emitter,t.vis,t.vis)}(this,(function(t,e,i,o){function n(t,e,i){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==i?i:0}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n.subtract=function(t,e){var i=new n;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,i},n.add=function(t,e){var i=new n;return i.x=t.x+e.x,i.y=t.y+e.y,i.z=t.z+e.z,i},n.avg=function(t,e){return new n((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},n.scalarProduct=function(t,e){return new n(t.x*e,t.y*e,t.z*e)},n.dotProduct=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},n.crossProduct=function(t,e){var i=new n;return i.x=t.y*e.z-t.z*e.y,i.y=t.z*e.x-t.x*e.z,i.z=t.x*e.y-t.y*e.x,i},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.prototype.normalize=function(){return n.scalarProduct(this,1/this.length())};var a=n;var r=function(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0};function s(t,e){if(void 0===t)throw new Error("No container element defined");if(this.container=t,this.visible=!e||null==e.visible||e.visible,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}function h(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}s.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},s.prototype.next=function(){var t=this.getIndex();t<this.values.length-1&&(t++,this.setIndex(t))},s.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<this.values.length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var i=new Date-t,o=Math.max(this.playInterval-i,0),n=this;this.playTimeout=setTimeout((function(){n.playNext()}),o)},s.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},s.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},s.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},s.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},s.prototype.setPlayInterval=function(t){this.playInterval=t},s.prototype.getPlayInterval=function(){return this.playInterval},s.prototype.setPlayLoop=function(t){this.playLoop=t},s.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},s.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},s.prototype.setValues=function(t){this.values=t,this.values.length>0?this.setIndex(0):this.index=void 0},s.prototype.setIndex=function(t){if(!(t<this.values.length))throw new Error("Index out of range");this.index=t,this.redraw(),this.onChange()},s.prototype.getIndex=function(){return this.index},s.prototype.get=function(){return this.values[this.index]},s.prototype._onMouseDown=function(t){if(t.which?1===t.which:1===t.button){this.startClientX=t.clientX,this.startSlideX=parseFloat(this.frame.slide.style.left),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},i.addEventListener(document,"mousemove",this.onmousemove),i.addEventListener(document,"mouseup",this.onmouseup),i.preventDefault(t)}},s.prototype.leftToIndex=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t-3,o=Math.round(i/e*(this.values.length-1));return o<0&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},s.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return t/(this.values.length-1)*e+3},s.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,o=this.startSlideX+e,n=this.leftToIndex(o);this.setIndex(n),i.preventDefault()},s.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",i.removeEventListener(document,"mousemove",this.onmousemove),i.removeEventListener(document,"mouseup",this.onmouseup),i.preventDefault()},h.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},h.prototype.setRange=function(t,e,i,o){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(i))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t||0,this._end=e||0,this.setStep(i,o)},h.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),!0===this.prettyStep?this._step=h.calculatePrettyStep(t):this._step=t)},h.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),n=5*Math.pow(10,Math.round(e(t/5))),a=i;return Math.abs(o-t)<=Math.abs(a-t)&&(a=o),Math.abs(n-t)<=Math.abs(a-t)&&(a=n),a<=0&&(a=1),a},h.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},h.prototype.getStep=function(){return this._step},h.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()<this._start&&this.next()},h.prototype.next=function(){this._current+=this._step},h.prototype.end=function(){return this._current>this._end};var l=h;function d(){this.armLocation=new a,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraOffset=new a,this.offsetMultiplier=.6,this.cameraLocation=new a,this.cameraRotation=new a(.5*Math.PI,0,0),this.calculateCameraOrientation()}d.prototype.setOffset=function(t,e){var i=Math.abs,o=Math.sign,n=this.offsetMultiplier,a=this.armLength*n;i(t)>a&&(t=o(t)*a),i(e)>a&&(e=o(e)*a),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},d.prototype.getOffset=function(){return this.cameraOffset},d.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},d.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},d.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},d.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},d.prototype.getArmLength=function(){return this.armLength},d.prototype.getCameraLocation=function(){return this.cameraLocation},d.prototype.getCameraRotation=function(){return this.cameraRotation},d.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=this.cameraRotation.z,i=this.cameraOffset.x,o=this.cameraOffset.y,n=Math.sin,a=Math.cos;this.cameraLocation.x=this.cameraLocation.x+i*a(e)+o*-n(e)*a(t),this.cameraLocation.y=this.cameraLocation.y+i*n(e)+o*a(e)*a(t),this.cameraLocation.z=this.cameraLocation.z+o*n(t)};var c={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},u={dot:c.DOT,"dot-line":c.DOTLINE,"dot-color":c.DOTCOLOR,"dot-size":c.DOTSIZE,line:c.LINE,grid:c.GRID,surface:c.SURFACE,bar:c.BAR,"bar-color":c.BARCOLOR,"bar-size":c.BARSIZE},p=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showXAxis","showYAxis","showZAxis","showGrayBottom","showGrid","showPerspective","showShadow","showSurfaceGrid","keepAspectRatio","rotateAxisLabels","verticalRatio","dotSizeRatio","dotSizeMinFraction","dotSizeMaxFraction","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","axisFontSize","axisFontType","gridColor","xCenter","yCenter","zoomable","tooltipDelay","ctrlToZoom"],f=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],m=void 0;function v(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function y(t,e){return void 0===t||""===t?e:t+(void 0===(i=e)||""===i||"string"!=typeof i?i:i.charAt(0).toUpperCase()+i.slice(1));var i}function g(t,e,i,o){for(var n,a=0;a<i.length;++a)e[y(o,n=i[a])]=t[n]}function x(t,e,i,o){for(var n,a=0;a<i.length;++a)void 0!==t[n=i[a]]&&(e[y(o,n)]=t[n])}function w(t,e){if(void 0!==t.backgroundColor&&function(t,e){var i="white",o="gray",n=1;if("string"==typeof t)i=t,o="none",n=0;else{if("object"!=typeof t)throw new Error("Unsupported type of backgroundColor");void 0!==t.fill&&(i=t.fill),void 0!==t.stroke&&(o=t.stroke),void 0!==t.strokeWidth&&(n=t.strokeWidth)}e.frame.style.backgroundColor=i,e.frame.style.borderColor=o,e.frame.style.borderWidth=n+"px",e.frame.style.borderStyle="solid"}(t.backgroundColor,e),function(t,e){if(void 0===t)return;void 0===e.dataColor&&(e.dataColor={});"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(t.fill&&(e.dataColor.fill=t.fill),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth))}(t.dataColor,e),function(t,e){if(void 0===t)return;var i;if("string"==typeof t){if(-1===(i=function(t){var e=u[t];if(void 0===e)return-1;return e}(t)))throw new Error("Style '"+t+"' is invalid")}else{if(!function(t){var e=!1;for(var i in c)if(c[i]===t){e=!0;break}return e}(t))throw new Error("Style '"+t+"' is invalid");i=t}e.style=i}(t.style,e),void 0!==t.surfaceColors){if(console.warn("`options.surfaceColors` is deprecated and may be removed in a future version. Please use `options.colormap` instead. Note that the `colormap` option uses the inverse array ordering (running from vMin to vMax)."),void 0!==t.colormap)throw new Error("The `colormap` and `surfaceColors` options are mutually exclusive.");"surface"!==e.style?console.warn("Ignoring `surfaceColors` in graph style `"+e.style+"` for backward compatibility (only effective in `surface` plots)."):function(t,e){if(void 0===t||!0===t)return;if(!1===t)return void(e.surfaceColors=void 0);void 0===e.surfaceColors&&(e.surfaceColors={});let i;if(Array.isArray(t))i=b(t);else{if("object"!=typeof t)throw new Error("Unsupported type of surfaceColors");i=_(t.hue)}i.reverse(),e.colormap=i}(t.surfaceColors,e)}else!function(t,e){if(void 0===t)return;let i;if(Array.isArray(t))i=b(t);else if("object"==typeof t)i=_(t.hue);else{if("function"!=typeof t)throw new Error("Unsupported type of colormap");i=t}e.colormap=i}(t.colormap,e);!function(t,e){if(void 0===t){if(void 0===m.showLegend){var i=e.style===c.DOTCOLOR||e.style===c.DOTSIZE;e.showLegend=i}}else e.showLegend=t}(t.showLegend,e),L(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),null!=t.onclick&&(e.onclick_callback=t.onclick,console.warn("`options.onclick` is deprecated and may be removed in a future version. Please use `Graph3d.on('click', handler)` instead.")),void 0!==t.tooltipStyle&&i.selectiveDeepExtend(["tooltipStyle"],e,t)}function b(t){if(t.length<2)throw new Error("Colormap array length must be 2 or above.");return t.map((function(t){if(!i.isValidHex(t))throw new Error("Invalid hex color code supplied to colormap.");return i.hexToRGB(t)}))}function _(t){if(void 0===t)throw new Error("Unsupported type of colormap");if(!(t.saturation>=0&&t.saturation<=100))throw new Error("Saturation is out of bounds. Expected range is 0-100.");if(!(t.brightness>=0&&t.brightness<=100))throw new Error("Brightness is out of bounds. Expected range is 0-100.");if(!(t.colorStops>=2))throw new Error("colorStops is out of bounds. Expected 2 or above.");const e=(t.end-t.start)/(t.colorStops-1);let o=[];for(let n=0;n<t.colorStops;++n){let a=(t.start+e*n)%360/360;o.push(i.HSVToRGB(a<0?a+1:a,t.saturation/100,t.brightness/100))}return o}function L(t,e){var i=t;void 0!==i&&(void 0===e.camera&&(e.camera=new d),e.camera.setArmRotation(i.horizontal,i.vertical),e.camera.setArmLength(i.distance))}let S,C=!1,T="background: #FFeeee; color: #dd0000";class M{constructor(){}static validate(t,e,i){C=!1,S=e;let o=e;return void 0!==i&&(o=e[i]),M.parse(t,o,[]),C}static parse(t,e,i){for(let o in t)t.hasOwnProperty(o)&&M.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void M.getSuggestion(t,i,o);let n=t,a=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",a="object"===M.getType(e[t]));let r=i[n];a&&void 0!==r.__type__&&(r=r.__type__),M.checkFields(t,e,i,n,r,o)}static checkFields(t,e,o,n,a,r){let s=function(e){console.log("%c"+e+M.printLocation(r,t),T)},h=M.getType(e[t]),l=a[h];void 0!==l?"array"===M.getType(l)&&-1===l.indexOf(e[t])?(s('Invalid option detected in "'+t+'". Allowed values are:'+M.print(l)+' not "'+e[t]+'". '),C=!0):"object"===h&&"__any__"!==n&&(r=i.copyAndExtendArray(r,t),M.parse(e[t],o[n],r)):void 0===a.any&&(s('Invalid type received for "'+t+'". Expected: '+M.print(Object.keys(a))+". Received ["+h+'] "'+e[t]+'"'),C=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let o,n=M.findInOptions(t,e,i,!1),a=M.findInOptions(t,S,[],!0);o=void 0!==n.indexMatch?" in "+M.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n':a.distance<=4&&n.distance>a.distance?" in "+M.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+M.printLocation(a.path,a.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+M.printLocation(n.path,t):". Did you mean one of these: "+M.print(Object.keys(e))+M.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+o,T),C=!0}static findInOptions(t,e,o,n=!1){let a=1e9,r="",s=[],h=t.toLowerCase(),l=void 0;for(let d in e){let c;if(void 0!==e[d].__type__&&!0===n){let n=M.findInOptions(t,e[d],i.copyAndExtendArray(o,d));a>n.distance&&(r=n.closestMatch,s=n.path,a=n.distance,l=n.indexMatch)}else-1!==d.toLowerCase().indexOf(h)&&(l=d),c=M.levenshteinDistance(t,d),a>c&&(r=d,s=i.copyArray(o),a=c)}return{closestMatch:r,path:s,distance:a,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,o,n=[];for(i=0;i<=e.length;i++)n[i]=[i];for(o=0;o<=t.length;o++)n[0][o]=o;for(i=1;i<=e.length;i++)for(o=1;o<=t.length;o++)e.charAt(i-1)==t.charAt(o-1)?n[i][o]=n[i-1][o-1]:n[i][o]=Math.min(n[i-1][o-1]+1,Math.min(n[i][o-1]+1,n[i-1][o]+1));return n[e.length][t.length]}}let R="string",D="boolean",A="number",P="object",z={fill:{string:R},stroke:{string:R},strokeWidth:{number:A},__type__:{string:R,object:P,undefined:"undefined"}},E={animationAutoStart:{boolean:D,undefined:"undefined"},animationInterval:{number:A},animationPreload:{boolean:D},axisColor:{string:R},axisFontSize:{number:A},axisFontType:{string:R},backgroundColor:z,xBarWidth:{number:A,undefined:"undefined"},yBarWidth:{number:A,undefined:"undefined"},cameraPosition:{distance:{number:A},horizontal:{number:A},vertical:{number:A},__type__:{object:P}},zoomable:{boolean:D},ctrlToZoom:{boolean:D},xCenter:{string:R},yCenter:{string:R},colormap:{hue:{start:{number:A},end:{number:A},saturation:{number:A},brightness:{number:A},colorStops:{number:A},__type__:{object:P}},__type__:{array:"array",object:P,function:"function",undefined:"undefined"}},dataColor:z,dotSizeMinFraction:{number:A},dotSizeMaxFraction:{number:A},dotSizeRatio:{number:A},filterLabel:{string:R},gridColor:{string:R},onclick:{function:"function"},keepAspectRatio:{boolean:D},xLabel:{string:R},yLabel:{string:R},zLabel:{string:R},legendLabel:{string:R},xMin:{number:A,undefined:"undefined"},yMin:{number:A,undefined:"undefined"},zMin:{number:A,undefined:"undefined"},xMax:{number:A,undefined:"undefined"},yMax:{number:A,undefined:"undefined"},zMax:{number:A,undefined:"undefined"},showAnimationControls:{boolean:D,undefined:"undefined"},showGrayBottom:{boolean:D},showGrid:{boolean:D},showLegend:{boolean:D,undefined:"undefined"},showPerspective:{boolean:D},showShadow:{boolean:D},showSurfaceGrid:{boolean:D},showXAxis:{boolean:D},showYAxis:{boolean:D},showZAxis:{boolean:D},rotateAxisLabels:{boolean:D},surfaceColors:{hue:{start:{number:A},end:{number:A},saturation:{number:A},brightness:{number:A},colorStops:{number:A},__type__:{object:P}},__type__:{boolean:D,array:"array",object:P,undefined:"undefined"}},xStep:{number:A,undefined:"undefined"},yStep:{number:A,undefined:"undefined"},zStep:{number:A,undefined:"undefined"},style:{number:A,string:["bar","bar-color","bar-size","dot","dot-line","dot-color","dot-size","line","grid","surface"]},tooltip:{boolean:D,function:"function"},tooltipDelay:{number:A},tooltipStyle:{content:{color:{string:R},background:{string:R},border:{string:R},borderRadius:{string:R},boxShadow:{string:R},padding:{string:R},__type__:{object:P}},line:{borderLeft:{string:R},height:{string:R},width:{string:R},pointerEvents:{string:R},__type__:{object:P}},dot:{border:{string:R},borderRadius:{string:R},height:{string:R},width:{string:R},pointerEvents:{string:R},__type__:{object:P}},__type__:{object:P}},xValueLabel:{function:"function"},yValueLabel:{function:"function"},zValueLabel:{function:"function"},valueMax:{number:A,undefined:"undefined"},valueMin:{number:A,undefined:"undefined"},verticalRatio:{number:A},height:{string:R},width:{string:R},__type__:{object:P}};function k(){this.min=void 0,this.max=void 0}k.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.max<t)&&(this.max=t))},k.prototype.combine=function(t){this.add(t.min),this.add(t.max)},k.prototype.expand=function(t){if(void 0!==t){var e=this.min-t,i=this.max+t;if(e>i)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=i}},k.prototype.range=function(){return this.max-this.min},k.prototype.center=function(){return(this.min+this.max)/2};var B=k;function O(t,e,i){this.dataGroup=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=t.getDistinctValues(this.column),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}function I(){this.dataTable=null}O.prototype.isLoaded=function(){return this.loaded},O.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},O.prototype.getLabel=function(){return this.graph.filterLabel},O.prototype.getColumn=function(){return this.column},O.prototype.getSelectedValue=function(){if(void 0!==this.index)return this.values[this.index]},O.prototype.getValues=function(){return this.values},O.prototype.getValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");return this.values[t]},O.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var i={};i.column=this.column,i.value=this.values[t];var n=new o.DataView(this.dataGroup.getDataSet(),{filter:function(t){return t[i.column]==i.value}}).get();e=this.dataGroup._getDataPoints(n),this.dataPoints[t]=e}return e},O.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},O.prototype.selectValue=function(t){if(t>=this.values.length)throw new Error("Index out of range");this.index=t,this.value=this.values[t]},O.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<this.values.length){void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var i=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+i+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var o=this;setTimeout((function(){o.loadInBackground(t+1)}),10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()},I.prototype.initializeData=function(t,e,i){if(void 0!==e){var n;if(Array.isArray(e)&&(e=new o.DataSet(e)),!(e instanceof o.DataSet||e instanceof o.DataView))throw new Error("Array, DataSet, or DataView expected");if(0!=(n=e.get()).length){this.style=i,this.dataSet&&this.dataSet.off("*",this._onChange),this.dataSet=e,this.dataTable=n;var a=this;this._onChange=function(){t.setData(a.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z";var r=t.hasBars(i);if(r&&(void 0!==t.defaultXBarWidth?this.xBarWidth=t.defaultXBarWidth:this.xBarWidth=this.getSmallestDifference(n,this.colX)||1,void 0!==t.defaultYBarWidth?this.yBarWidth=t.defaultYBarWidth:this.yBarWidth=this.getSmallestDifference(n,this.colY)||1),this._initializeRange(n,this.colX,t,r),this._initializeRange(n,this.colY,t,r),this._initializeRange(n,this.colZ,t,!1),n[0].hasOwnProperty("style")){this.colValue="style";var s=this.getColumnRange(n,this.colValue);this._setRangeDefaults(s,t.defaultValueMin,t.defaultValueMax),this.valueRange=s}else this.colValue="z",this.valueRange=this.zRange;return this.getDataTable()[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new O(this,"filter",t),this.dataFilter.setOnLoadCallback((function(){t.redraw()}))),this.dataFilter?this.dataFilter._getDataPoints():this._getDataPoints(this.getDataTable())}}},I.prototype._collectRangeSettings=function(t,e){if(-1==["x","y","z"].indexOf(t))throw new Error("Column '"+t+"' invalid");var i=t.toUpperCase();return{barWidth:this[t+"BarWidth"],min:e["default"+i+"Min"],max:e["default"+i+"Max"],step:e["default"+i+"Step"],range_label:t+"Range",step_label:t+"Step"}},I.prototype._initializeRange=function(t,e,i,o){var n=this._collectRangeSettings(e,i),a=this.getColumnRange(t,e);o&&"z"!=e&&a.expand(n.barWidth/2),this._setRangeDefaults(a,n.min,n.max),this[n.range_label]=a,this[n.step_label]=void 0!==n.step?n.step:a.range()/5},I.prototype.getDistinctValues=function(t,e){void 0===e&&(e=this.dataTable);for(var i=[],o=0;o<e.length;o++){var n=e[o][t]||0;-1===i.indexOf(n)&&i.push(n)}return i.sort((function(t,e){return t-e}))},I.prototype.getSmallestDifference=function(t,e){for(var i=this.getDistinctValues(t,e),o=null,n=1;n<i.length;n++){var a=i[n]-i[n-1];(null==o||o>a)&&(o=a)}return o},I.prototype.getColumnRange=function(t,e){for(var i=new B,o=0;o<t.length;o++){var n=t[o][e];i.adjust(n)}return i},I.prototype.getNumberOfRows=function(){return this.dataTable.length},I.prototype._setRangeDefaults=function(t,e,i){void 0!==e&&(t.min=e),void 0!==i&&(t.max=i),t.max<=t.min&&(t.max=t.min+1)},I.prototype.getDataTable=function(){return this.dataTable},I.prototype.getDataSet=function(){return this.dataSet},I.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new a;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new a(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},I.prototype.initDataAsMatrix=function(t){var e,i,o,n,a=this.getDistinctValues(this.colX,t),r=this.getDistinctValues(this.colY,t),s=this.getDataPoints(t),h=[];for(o=0;o<s.length;o++){n=s[o];var l=a.indexOf(n.point.x),d=r.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0);return s},I.prototype.getInfo=function(){var t=this.dataFilter;if(t)return t.getLabel()+": "+t.getSelectedValue()},I.prototype.reload=function(){this.dataTable&&this.setData(this.dataTable)},I.prototype._getDataPoints=function(t){var e=[];if(this.style===c.GRID||this.style===c.SURFACE)e=this.initDataAsMatrix(t);else if(e=this.getDataPoints(t),this.style===c.LINE)for(var i=0;i<e.length;i++)i>0&&(e[i-1].pointNext=e[i]);return e},W.STYLE=c;function W(t,e,i){if(!(this instanceof W))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.dataGroup=new I,this.dataPoints=null,this.create(),function(t,e){if(void 0===t||v(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");m=t,g(t,e,p),g(t,e,f,"default"),w(t,e),e.margin=10,e.showTooltip=!1,e.onclick_callback=null,e.eye=new a(0,0,-1)}(W.DEFAULTS,this),this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.setOptions(i),this.setData(e)}function G(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function Y(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}W.DEFAULTS={width:"400px",height:"400px",filterLabel:"time",legendLabel:"value",xLabel:"x",yLabel:"y",zLabel:"z",xValueLabel:function(t){return t},yValueLabel:function(t){return t},zValueLabel:function(t){return t},showXAxis:!0,showYAxis:!0,showZAxis:!0,showGrayBottom:!1,showGrid:!0,showPerspective:!0,showShadow:!1,showSurfaceGrid:!0,keepAspectRatio:!0,rotateAxisLabels:!0,verticalRatio:.5,dotSizeRatio:.02,dotSizeMinFraction:.5,dotSizeMaxFraction:2.5,showAnimationControls:void 0,animationInterval:1e3,animationPreload:!1,animationAutoStart:void 0,axisFontSize:14,axisFontType:"arial",axisColor:"#4D4D4D",gridColor:"#D3D3D3",xCenter:"55%",yCenter:"50%",style:W.STYLE.DOT,tooltip:!1,tooltipDelay:300,tooltipStyle:{content:{padding:"10px",border:"1px solid #4d4d4d",color:"#1a1a1a",background:"rgba(255,255,255,0.7)",borderRadius:"2px",boxShadow:"5px 5px 10px rgba(128,128,128,0.5)"},line:{height:"40px",width:"0",borderLeft:"1px solid #4d4d4d",pointerEvents:"none"},dot:{height:"0",width:"0",border:"5px solid #4d4d4d",borderRadius:"5px",pointerEvents:"none"}},dataColor:{fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},surfaceColors:void 0,colormap:void 0,cameraPosition:{horizontal:1,vertical:.5,distance:1.7},zoomable:!0,ctrlToZoom:!1,showLegend:void 0,backgroundColor:void 0,xBarWidth:void 0,yBarWidth:void 0,valueMin:void 0,valueMax:void 0,xMin:void 0,xMax:void 0,xStep:void 0,yMin:void 0,yMax:void 0,yStep:void 0,zMin:void 0,zMax:void 0,zStep:void 0},e(W.prototype),W.prototype._setScale=function(){this.scale=new a(1/this.xRange.range(),1/this.yRange.range(),1/this.zRange.range()),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,void 0!==this.valueRange&&(this.scale.value=1/this.valueRange.range());var t=this.xRange.center()*this.scale.x,e=this.yRange.center()*this.scale.y,i=this.zRange.center()*this.scale.z;this.camera.setArmLocation(t,e,i)},W.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},W.prototype._convertPointToTranslation=function(t){var e=this.camera.getCameraLocation(),i=this.camera.getCameraRotation(),o=t.x*this.scale.x,n=t.y*this.scale.y,r=t.z*this.scale.z,s=e.x,h=e.y,l=e.z,d=Math.sin(i.x),c=Math.cos(i.x),u=Math.sin(i.y),p=Math.cos(i.y),f=Math.sin(i.z),m=Math.cos(i.z);return new a(p*(f*(n-h)+m*(o-s))-u*(r-l),d*(p*(r-l)+u*(f*(n-h)+m*(o-s)))+c*(m*(n-h)-f*(o-s)),c*(p*(r-l)+u*(f*(n-h)+m*(o-s)))-d*(m*(n-h)-f*(o-s)))},W.prototype._convertTranslationToScreen=function(t){var e,i,o=this.eye.x,n=this.eye.y,a=this.eye.z,s=t.x,h=t.y,l=t.z;return this.showPerspective?(e=a/l*(s-o),i=a/l*(h-n)):(e=s*(-a/this.camera.getArmLength()),i=h*(-a/this.camera.getArmLength())),new r(this.currentXCenter+e*this.frame.canvas.clientWidth,this.currentYCenter-i*this.frame.canvas.clientWidth)},W.prototype._calcTranslations=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.trans=this._convertPointToTranslation(i.point),i.screen=this._convertTranslationToScreen(i.trans);var o=this._convertPointToTranslation(i.bottom);i.dist=this.showPerspective?o.length():-o.z}t.sort((function(t,e){return e.dist-t.dist}))},W.prototype._initializeRanges=function(){var t=this.dataGroup;this.xRange=t.xRange,this.yRange=t.yRange,this.zRange=t.zRange,this.valueRange=t.valueRange,this.xStep=t.xStep,this.yStep=t.yStep,this.zStep=t.zStep,this.xBarWidth=t.xBarWidth,this.yBarWidth=t.yBarWidth,this.colX=t.colX,this.colY=t.colY,this.colZ=t.colZ,this.colValue=t.colValue,this._setScale()},W.prototype.getDataPoints=function(t){for(var e=[],i=0;i<t.length;i++){var o=new a;o.x=t[i][this.colX]||0,o.y=t[i][this.colY]||0,o.z=t[i][this.colZ]||0,o.data=t[i],o.value=t[i][this.colValue]||0;var n={};n.point=o,n.bottom=new a(o.x,o.y,this.zRange.min),n.trans=void 0,n.screen=void 0,e.push(n)}return e},W.prototype._getDataPoints=function(t){var e,i,o,n,a=[];if(this.style===W.STYLE.GRID||this.style===W.STYLE.SURFACE){var r=this.dataGroup.getDistinctValues(this.colX,t),s=this.dataGroup.getDistinctValues(this.colY,t);a=this.getDataPoints(t);var h=[];for(o=0;o<a.length;o++){n=a[o];var l=r.indexOf(n.point.x),d=s.indexOf(n.point.y);void 0===h[l]&&(h[l]=[]),h[l][d]=n}for(e=0;e<h.length;e++)for(i=0;i<h[e].length;i++)h[e][i]&&(h[e][i].pointRight=e<h.length-1?h[e+1][i]:void 0,h[e][i].pointTop=i<h[e].length-1?h[e][i+1]:void 0,h[e][i].pointCross=e<h.length-1&&i<h[e].length-1?h[e+1][i+1]:void 0)}else if(a=this.getDataPoints(t),this.style===W.STYLE.LINE)for(o=0;o<a.length;o++)o>0&&(a[o-1].pointNext=a[o]);return a},W.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),this.frame.filter.style.position="absolute",this.frame.filter.style.bottom="0px",this.frame.filter.style.left="0px",this.frame.filter.style.width="100%",this.frame.appendChild(this.frame.filter);var e=this;i.addEventListener(this.frame.canvas,"mousedown",(function(t){e._onMouseDown(t)})),i.addEventListener(this.frame.canvas,"touchstart",(function(t){e._onTouchStart(t)})),i.addEventListener(this.frame.canvas,"mousewheel",(function(t){e._onWheel(t)})),i.addEventListener(this.frame.canvas,"mousemove",(function(t){e._onTooltip(t)})),i.addEventListener(this.frame.canvas,"click",(function(t){e._onClick(t)})),this.containerElement.appendChild(this.frame)},W.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},W.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,this.frame.filter.style.width=this.frame.canvas.clientWidth-20+"px"},W.prototype.animationStart=function(){if(this.animationAutoStart&&this.dataGroup.dataFilter){if(!this.frame.filter||!this.frame.filter.slider)throw new Error("No animation available");this.frame.filter.slider.play()}},W.prototype.animationStop=function(){this.frame.filter&&this.frame.filter.slider&&this.frame.filter.slider.stop()},W.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=parseFloat(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=parseFloat(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=parseFloat(this.yCenter)/100*(this.frame.canvas.clientHeight-this.frame.filter.clientHeight):this.currentYCenter=parseFloat(this.yCenter)},W.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},W.prototype._readData=function(t){this.dataPoints=this.dataGroup.initializeData(this,t,this.style),this._initializeRanges(),this._redrawFilter()},W.prototype.setData=function(t){null!=t&&(this._readData(t),this.redraw(),this.animationStart())},W.prototype.setOptions=function(t){if(void 0===t)return;!0===M.validate(t,E)&&console.log("%cErrors have been found in the supplied options object.",T),this.animationStop(),function(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===m||v(m))throw new Error("DEFAULTS not set for module Settings");x(t,e,p),x(t,e,f,"default"),w(t,e)}}(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.setAxisLabelMethod(),this.setData(this.dataGroup.getDataTable()),this.animationStart()},W.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case W.STYLE.BAR:t=this._redrawBarGraphPoint;break;case W.STYLE.BARCOLOR:t=this._redrawBarColorGraphPoint;break;case W.STYLE.BARSIZE:t=this._redrawBarSizeGraphPoint;break;case W.STYLE.DOT:t=this._redrawDotGraphPoint;break;case W.STYLE.DOTLINE:t=this._redrawDotLineGraphPoint;break;case W.STYLE.DOTCOLOR:t=this._redrawDotColorGraphPoint;break;case W.STYLE.DOTSIZE:t=this._redrawDotSizeGraphPoint;break;case W.STYLE.SURFACE:t=this._redrawSurfaceGraphPoint;break;case W.STYLE.GRID:t=this._redrawGridGraphPoint;break;case W.STYLE.LINE:t=this._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},W.prototype.setAxisLabelMethod=function(){this.rotateAxisLabels?(this._drawAxisLabelX=this.drawAxisLabelXRotate,this._drawAxisLabelY=this.drawAxisLabelYRotate,this._drawAxisLabelZ=this.drawAxisLabelZRotate):(this._drawAxisLabelX=this.drawAxisLabelX,this._drawAxisLabelY=this.drawAxisLabelY,this._drawAxisLabelZ=this.drawAxisLabelZ)},W.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},W.prototype._getContext=function(){var t=this.frame.canvas.getContext("2d");return t.lineJoin="round",t.lineCap="round",t},W.prototype._redrawClear=function(){var t=this.frame.canvas;t.getContext("2d").clearRect(0,0,t.width,t.height)},W.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},W.prototype._getLegendWidth=function(){var t;this.style===W.STYLE.DOTSIZE?t=this._dotSize()*this.dotSizeMaxFraction:t=this.style===W.STYLE.BARSIZE?this.xBarWidth:20;return t},W.prototype._redrawLegend=function(){if(!0===this.showLegend&&this.style!==W.STYLE.LINE&&this.style!==W.STYLE.BARSIZE){var t=this.style===W.STYLE.BARSIZE||this.style===W.STYLE.DOTSIZE,e=this.style===W.STYLE.DOTSIZE||this.style===W.STYLE.DOTCOLOR||this.style===W.STYLE.SURFACE||this.style===W.STYLE.BARCOLOR,i=Math.max(.25*this.frame.clientHeight,100),o=this.margin,n=this._getLegendWidth(),a=this.frame.clientWidth-this.margin,s=a-n,h=o+i,d=this._getContext();if(d.lineWidth=1,d.font="14px arial",!1===t){var c,u=i;for(c=0;c<u;c++){const t=1-(c-0)/(u-0),e=this._colormap(t,1);d.strokeStyle=e,d.beginPath(),d.moveTo(s,o+c),d.lineTo(a,o+c),d.stroke()}d.strokeStyle=this.axisColor,d.strokeRect(s,o,n,i)}else{var p;this.style===W.STYLE.DOTSIZE?p=n*(this.dotSizeMinFraction/this.dotSizeMaxFraction):(this.style,W.STYLE.BARSIZE),d.strokeStyle=this.axisColor,d.fillStyle=this.dataColor.fill,d.beginPath(),d.moveTo(s,o),d.lineTo(a,o),d.lineTo(s+p,h),d.lineTo(s,h),d.closePath(),d.fill(),d.stroke()}var f,m,v=e?this.valueRange.min:this.zRange.min,y=e?this.valueRange.max:this.zRange.max,g=new l(v,y,(y-v)/5,!0);for(g.start(!0);!g.end();)c=h-(g.getCurrent()-v)/(y-v)*i,f=new r(s-5,c),m=new r(s,c),this._line(d,f,m),d.textAlign="right",d.textBaseline="middle",d.fillStyle=this.axisColor,d.fillText(g.getCurrent(),s-10,c),g.next();d.textAlign="right",d.textBaseline="top";var x=this.legendLabel;d.fillText(x,a,h+this.margin)}},W.prototype._redrawFilter=function(){var t=this.dataGroup.dataFilter,e=this.frame.filter;if(e.innerHTML="",t){var i=new s(e,{visible:this.showAnimationControls});e.slider=i,e.style.padding="10px",i.setValues(t.values),i.setPlayInterval(this.animationInterval);var o=this;i.setOnChangeCallback((function(){var t=o.dataGroup.dataFilter,e=i.getIndex();t.selectValue(e),o.dataPoints=t._getDataPoints(),o.redraw()}))}else e.slider=void 0},W.prototype._redrawSlider=function(){void 0!==this.frame.filter.slider&&this.frame.filter.slider.redraw()},W.prototype._redrawInfo=function(){var t=this.dataGroup.getInfo();if(void 0!==t){var e=this._getContext();e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var i=this.margin,o=this.margin;e.fillText(t,i,o)}},W.prototype._line=function(t,e,i,o){void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()},W.prototype.drawAxisLabelX=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},W.prototype.drawAxisLabelY=function(t,e,i,o,n){void 0===n&&(n=0);var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.textAlign="center",t.textBaseline="top",a.y+=n):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)},W.prototype.drawAxisLabelZ=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},W.prototype.drawAxisLabelXRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)>0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)<0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},W.prototype.drawAxisLabelYRotate=function(t,e,i,o,n){var a=this._convert3Dto2D(e);Math.cos(2*o)<0?(t.save(),t.translate(a.x,a.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,0,0),t.restore()):Math.sin(2*o)>0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,a.x,a.y))},W.prototype.drawAxisLabelZRotate=function(t,e,i,o){void 0===o&&(o=0);var n=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(i,n.x-o,n.y)},W.prototype._line3d=function(t,e,i,o){var n=this._convert3Dto2D(e),a=this._convert3Dto2D(i);this._line(t,n,a,o)},W.prototype._redrawAxis=function(){var t,e,i,o,n,s,h,d,c,u,p=this._getContext();p.font=this.axisFontSize/this.camera.getArmLength()+"px "+this.axisFontType;var f,m,v,y=.025/this.scale.x,g=.025/this.scale.y,x=5/this.camera.getArmLength(),w=this.camera.getArmRotation().horizontal,b=new r(Math.cos(w),Math.sin(w)),_=this.xRange,L=this.yRange,S=this.zRange;for(p.lineWidth=1,o=void 0===this.defaultXStep,(i=new l(_.min,_.max,this.xStep,o)).start(!0);!i.end();){var C=i.getCurrent();if(this.showGrid?(t=new a(C,L.min,S.min),e=new a(C,L.max,S.min),this._line3d(p,t,e,this.gridColor)):this.showXAxis&&(t=new a(C,L.min,S.min),e=new a(C,L.min+y,S.min),this._line3d(p,t,e,this.axisColor),t=new a(C,L.max,S.min),e=new a(C,L.max-y,S.min),this._line3d(p,t,e,this.axisColor)),this.showXAxis){h=b.x>0?L.min:L.max,f=new a(C,h,S.min);let t=" "+this.xValueLabel(C)+" ";this._drawAxisLabelX.call(this,p,f,t,w,x)}i.next()}for(p.lineWidth=1,o=void 0===this.defaultYStep,(i=new l(L.min,L.max,this.yStep,o)).start(!0);!i.end();){var T=i.getCurrent();if(this.showGrid?(t=new a(_.min,T,S.min),e=new a(_.max,T,S.min),this._line3d(p,t,e,this.gridColor)):this.showYAxis&&(t=new a(_.min,T,S.min),e=new a(_.min+g,T,S.min),this._line3d(p,t,e,this.axisColor),t=new a(_.max,T,S.min),e=new a(_.max-g,T,S.min),this._line3d(p,t,e,this.axisColor)),this.showYAxis){s=b.y>0?_.min:_.max,f=new a(s,T,S.min);let t=" "+this.yValueLabel(T)+" ";this._drawAxisLabelY.call(this,p,f,t,w,x)}i.next()}if(this.showZAxis){for(p.lineWidth=1,o=void 0===this.defaultZStep,(i=new l(S.min,S.max,this.zStep,o)).start(!0),s=b.x>0?_.min:_.max,h=b.y<0?L.min:L.max;!i.end();){var M=i.getCurrent(),R=new a(s,h,M),D=this._convert3Dto2D(R);e=new r(D.x-x,D.y),this._line(p,D,e,this.axisColor);let t=this.zValueLabel(M)+" ";this._drawAxisLabelZ.call(this,p,R,t,5),i.next()}p.lineWidth=1,t=new a(s,h,S.min),e=new a(s,h,S.max),this._line3d(p,t,e,this.axisColor)}this.showXAxis&&(p.lineWidth=1,m=new a(_.min,L.min,S.min),v=new a(_.max,L.min,S.min),this._line3d(p,m,v,this.axisColor),m=new a(_.min,L.max,S.min),v=new a(_.max,L.max,S.min),this._line3d(p,m,v,this.axisColor));this.showYAxis&&(p.lineWidth=1,t=new a(_.min,L.min,S.min),e=new a(_.min,L.max,S.min),this._line3d(p,t,e,this.axisColor),t=new a(_.max,L.min,S.min),e=new a(_.max,L.max,S.min),this._line3d(p,t,e,this.axisColor));var A=this.xLabel;A.length>0&&this.showXAxis&&(u=.1/this.scale.y,s=(_.max+3*_.min)/4,h=b.x>0?L.min-u:L.max+u,n=new a(s,h,S.min),this.drawAxisLabelX(p,n,A,w));var P=this.yLabel;P.length>0&&this.showYAxis&&(c=.1/this.scale.x,s=b.y>0?_.min-c:_.max+c,h=(L.max+3*L.min)/4,n=new a(s,h,S.min),this.drawAxisLabelY(p,n,P,w));var z=this.zLabel;z.length>0&&this.showZAxis&&(30,s=b.x>0?_.min:_.max,h=b.y<0?L.min:L.max,d=(S.max+3*S.min)/4,n=new a(s,h,d),this.drawAxisLabelZ(p,n,z,30))},W.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-this.eye.z/this.camera.getArmLength()*this.dataColor.strokeWidth:this.dataColor.strokeWidth},W.prototype._redrawBar=function(t,e,i,o,n,r){var s,h=this,l=e.point,d=this.zRange.min,c=[{point:new a(l.x-i,l.y-o,l.z)},{point:new a(l.x+i,l.y-o,l.z)},{point:new a(l.x+i,l.y+o,l.z)},{point:new a(l.x-i,l.y+o,l.z)}],u=[{point:new a(l.x-i,l.y-o,d)},{point:new a(l.x+i,l.y-o,d)},{point:new a(l.x+i,l.y+o,d)},{point:new a(l.x-i,l.y+o,d)}];c.forEach((function(t){t.screen=h._convert3Dto2D(t.point)})),u.forEach((function(t){t.screen=h._convert3Dto2D(t.point)}));var p=[{corners:c,center:a.avg(u[0].point,u[2].point)},{corners:[c[0],c[1],u[1],u[0]],center:a.avg(u[1].point,u[0].point)},{corners:[c[1],c[2],u[2],u[1]],center:a.avg(u[2].point,u[1].point)},{corners:[c[2],c[3],u[3],u[2]],center:a.avg(u[3].point,u[2].point)},{corners:[c[3],c[0],u[0],u[3]],center:a.avg(u[0].point,u[3].point)}];e.surfaces=p;for(let t=0;t<p.length;t++){s=p[t];var f=this._convertPointToTranslation(s.center);s.dist=this.showPerspective?f.length():-f.z}p.sort((function(t,e){var i=e.dist-t.dist;return i||(t.corners===c?1:e.corners===c?-1:0)})),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=r,t.fillStyle=n;for(let e=2;e<p.length;e++)s=p[e],this._polygon(t,s.corners)},W.prototype._polygon=function(t,e,i,o){if(!(e.length<2)){void 0!==i&&(t.fillStyle=i),void 0!==o&&(t.strokeStyle=o),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var n=1;n<e.length;++n){var a=e[n];t.lineTo(a.screen.x,a.screen.y)}t.closePath(),t.fill(),t.stroke()}},W.prototype._drawCircle=function(t,e,i,o,n){var a=this._calcRadius(e,n);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=i,t.beginPath(),t.arc(e.screen.x,e.screen.y,a,0,2*Math.PI,!0),t.fill(),t.stroke()},W.prototype._getColorsRegular=function(t){const e=(t.point.value-this.valueRange.min)*this.scale.value;return{fill:this._colormap(e,1),border:this._colormap(e,.8)}},W.prototype._getColorsColor=function(t){var e,i,o;if(t&&t.point&&t.point.data&&t.point.data.style&&(o=t.point.data.style),o&&"object"==typeof o&&o.fill&&o.stroke)return{fill:o.fill,border:o.stroke};if("string"==typeof t.point.value)e=t.point.value,i=t.point.value;else{const o=(t.point.value-this.valueRange.min)*this.scale.value;e=this._colormap(o,1),i=this._colormap(o,.8)}return{fill:e,border:i}},W.prototype._getColorsSize=function(){return{fill:this.dataColor.fill,border:this.dataColor.stroke}},W.prototype._colormap=function(t,e=1){let o,n,a,r;const s=this.colormap;if(Array.isArray(s)){const e=s.length-1,i=Math.max(Math.floor(t*e),0),r=Math.min(i+1,e),h=t*e-i,l=s[i],d=s[r];o=l.r+h*(d.r-l.r),n=l.g+h*(d.g-l.g),a=l.b+h*(d.b-l.b)}else if("function"==typeof s)({r:o,g:n,b:a,a:r}=s(t));else{const e=240*(1-t);({r:o,g:n,b:a}=i.HSVToRGB(e/360,1,1))}return"number"!=typeof r||Number.isNaN(r)?`RGB(${Math.round(o*e)}, ${Math.round(n*e)}, ${Math.round(a*e)})`:`RGBA(${Math.round(o*e)}, ${Math.round(n*e)}, ${Math.round(a*e)}, ${r})`},W.prototype._calcRadius=function(t,e){var i;return void 0===e&&(e=this._dotSize()),(i=this.showPerspective?e/-t.trans.z:e*(-this.eye.z/this.camera.getArmLength()))<0&&(i=0),i},W.prototype._redrawBarGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsRegular(e);this._redrawBar(t,e,i,o,n.fill,n.border)},W.prototype._redrawBarColorGraphPoint=function(t,e){var i=this.xBarWidth/2,o=this.yBarWidth/2,n=this._getColorsColor(e);this._redrawBar(t,e,i,o,n.fill,n.border)},W.prototype._redrawBarSizeGraphPoint=function(t,e){var i=(e.point.value-this.valueRange.min)/this.valueRange.range(),o=this.xBarWidth/2*(.8*i+.2),n=this.yBarWidth/2*(.8*i+.2),a=this._getColorsSize();this._redrawBar(t,e,o,n,a.fill,a.border)},W.prototype._redrawDotGraphPoint=function(t,e){var i=this._getColorsRegular(e);this._drawCircle(t,e,i.fill,i.border)},W.prototype._redrawDotLineGraphPoint=function(t,e){var i=this._convert3Dto2D(e.bottom);t.lineWidth=1,this._line(t,i,e.screen,this.gridColor),this._redrawDotGraphPoint(t,e)},W.prototype._redrawDotColorGraphPoint=function(t,e){var i=this._getColorsColor(e);this._drawCircle(t,e,i.fill,i.border)},W.prototype._redrawDotSizeGraphPoint=function(t,e){var i=this._dotSize(),o=(e.point.value-this.valueRange.min)/this.valueRange.range(),n=i*this.dotSizeMinFraction,a=n+(i*this.dotSizeMaxFraction-n)*o,r=this._getColorsSize();this._drawCircle(t,e,r.fill,r.border,a)},W.prototype._redrawSurfaceGraphPoint=function(t,e){var i=e.pointRight,o=e.pointTop,n=e.pointCross;if(void 0!==e&&void 0!==i&&void 0!==o&&void 0!==n){var r,s,h,l=!0;if(this.showGrayBottom||this.showShadow){var d=a.subtract(n.trans,e.trans),c=a.subtract(o.trans,i.trans),u=a.crossProduct(d,c);if(this.showPerspective){let t=a.avg(a.avg(e.trans,n.trans),a.avg(i.trans,o.trans));h=-a.dotProduct(u.normalize(),t.normalize())}else h=u.z/u.length();l=h>0}if(l||!this.showGrayBottom){const t=((e.point.value+i.point.value+o.point.value+n.point.value)/4-this.valueRange.min)*this.scale.value,a=this.showShadow?(1+h)/2:1;r=this._colormap(t,a)}else r="gray";s=this.showSurfaceGrid?this.axisColor:r,t.lineWidth=this._getStrokeWidth(e);var p=[e,i,n,o];this._polygon(t,p,r,s)}},W.prototype._drawGridLine=function(t,e,i){if(void 0===e||void 0===i)return;const o=((e.point.value+i.point.value)/2-this.valueRange.min)*this.scale.value;t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._colormap(o,1),this._line(t,e.screen,i.screen)},W.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},W.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},W.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t<this.dataPoints.length;t++){var i=this.dataPoints[t];this._pointDrawingMethod.call(this,e,i)}},W.prototype._storeMousePosition=function(t){this.startMouseX=G(t),this.startMouseY=Y(t),this._startCameraOffset=this.camera.getOffset()},W.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this._storeMousePosition(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},i.addEventListener(document,"mousemove",e.onmousemove),i.addEventListener(document,"mouseup",e.onmouseup),i.preventDefault(t)}},W.prototype._onMouseMove=function(t){this.moving=!0,t=t||window.event;var e=parseFloat(G(t))-this.startMouseX,o=parseFloat(Y(t))-this.startMouseY;if(t&&!0===t.ctrlKey){var n=.5*this.frame.clientWidth,a=.5*this.frame.clientHeight,r=(this._startCameraOffset.x||0)-e/n*this.camera.armLength*.8,s=(this._startCameraOffset.y||0)+o/a*this.camera.armLength*.8;this.camera.setOffset(r,s),this._storeMousePosition(t)}else{var h=this.startArmRotation.horizontal+e/200,l=this.startArmRotation.vertical+o/200,d=Math.sin(4/360*2*Math.PI);Math.abs(Math.sin(h))<d&&(h=Math.round(h/Math.PI)*Math.PI-.001),Math.abs(Math.cos(h))<d&&(h=(Math.round(h/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(l))<d&&(l=Math.round(l/Math.PI)*Math.PI),Math.abs(Math.cos(l))<d&&(l=(Math.round(l/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(h,l)}this.redraw();var c=this.getCameraPosition();this.emit("cameraPositionChange",c),i.preventDefault(t)},W.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,i.removeEventListener(document,"mousemove",this.onmousemove),i.removeEventListener(document,"mouseup",this.onmouseup),i.preventDefault(t)},W.prototype._onClick=function(t){if(this.onclick_callback||this.hasListeners("click")){if(this.moving)this.moving=!1;else{var e=this.frame.getBoundingClientRect(),o=G(t)-e.left,n=Y(t)-e.top,a=this._dataPointFromXY(o,n);a&&(this.onclick_callback&&this.onclick_callback(a.point.data),this.emit("click",a.point.data))}i.preventDefault(t)}},W.prototype._onTooltip=function(t){var e=this.tooltipDelay,i=this.frame.getBoundingClientRect(),o=G(t)-i.left,n=Y(t)-i.top;if(this.showTooltip)if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)this._hideTooltip();else if(this.tooltip&&this.tooltip.dataPoint){var a=this._dataPointFromXY(o,n);a!==this.tooltip.dataPoint&&(a?this._showTooltip(a):this._hideTooltip())}else{var r=this;this.tooltipTimeout=setTimeout((function(){r.tooltipTimeout=null;var t=r._dataPointFromXY(o,n);t&&r._showTooltip(t)}),e)}},W.prototype._onTouchStart=function(t){this.touchDown=!0;var e=this;this.ontouchmove=function(t){e._onTouchMove(t)},this.ontouchend=function(t){e._onTouchEnd(t)},i.addEventListener(document,"touchmove",e.ontouchmove),i.addEventListener(document,"touchend",e.ontouchend),this._onMouseDown(t)},W.prototype._onTouchMove=function(t){this._onMouseMove(t)},W.prototype._onTouchEnd=function(t){this.touchDown=!1,i.removeEventListener(document,"touchmove",this.ontouchmove),i.removeEventListener(document,"touchend",this.ontouchend),this._onMouseUp(t)},W.prototype._onWheel=function(t){if(t||(t=window.event),this.zoomable&&(!this.ctrlToZoom||t.ctrlKey)){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var o=this.camera.getArmLength()*(1-e/10);this.camera.setArmLength(o),this.redraw(),this._hideTooltip()}var n=this.getCameraPosition();this.emit("cameraPositionChange",n),i.preventDefault(t)}},W.prototype._insideTriangle=function(t,e){var i=e[0],o=e[1],n=e[2];function a(t){return t>0?1:t<0?-1:0}var r=a((o.x-i.x)*(t.y-i.y)-(o.y-i.y)*(t.x-i.x)),s=a((n.x-o.x)*(t.y-o.y)-(n.y-o.y)*(t.x-o.x)),h=a((i.x-n.x)*(t.y-n.y)-(i.y-n.y)*(t.x-n.x));return!(0!=r&&0!=s&&r!=s||0!=s&&0!=h&&s!=h||0!=r&&0!=h&&r!=h)},W.prototype._dataPointFromXY=function(t,e){var i,o=null,n=null,a=null,s=new r(t,e);if(this.style===W.STYLE.BAR||this.style===W.STYLE.BARCOLOR||this.style===W.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){var h=(o=this.dataPoints[i]).surfaces;if(h)for(var l=h.length-1;l>=0;l--){var d=h[l].corners,c=[d[0].screen,d[1].screen,d[2].screen],u=[d[2].screen,d[3].screen,d[0].screen];if(this._insideTriangle(s,c)||this._insideTriangle(s,u))return o}}else for(i=0;i<this.dataPoints.length;i++){var p=(o=this.dataPoints[i]).screen;if(p){var f=Math.abs(t-p.x),m=Math.abs(e-p.y),v=Math.sqrt(f*f+m*m);(null===a||v<a)&&v<100&&(a=v,n=o)}}return n},W.prototype.hasBars=function(t){return t==W.STYLE.BAR||t==W.STYLE.BARCOLOR||t==W.STYLE.BARSIZE},W.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),Object.assign(e.style,{},this.tooltipStyle.content),e.style.position="absolute",i=document.createElement("div"),Object.assign(i.style,{},this.tooltipStyle.line),i.style.position="absolute",o=document.createElement("div"),Object.assign(o.style,{},this.tooltipStyle.dot),o.style.position="absolute",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var n=e.offsetWidth,a=e.offsetHeight,r=i.offsetHeight,s=o.offsetWidth,h=o.offsetHeight,l=t.screen.x-n/2;l=Math.min(Math.max(l,10),this.frame.clientWidth-10-n),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=l+"px",e.style.top=t.screen.y-r-a+"px",o.style.left=t.screen.x-s/2+"px",o.style.top=t.screen.y-h/2+"px"},W.prototype._hideTooltip=function(){if(this.tooltip)for(var t in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}},W.prototype.setCameraPosition=function(t){L(t,this),this.redraw()},W.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()},t.Graph3d=W,t.Graph3dCamera=d,t.Graph3dFilter=O,t.Graph3dPoint2d=r,t.Graph3dPoint3d=a,t.Graph3dSlider=s,t.Graph3dStepNumber=l,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=vis-graph3d.min.js.map
{
"name": "vis-graph3d",
"version": "5.9.4",
"version": "5.9.5",
"description": "Create interactive, animated 3d graphs. Surfaces, lines, dots and block styling out of the box.",

@@ -67,3 +67,4 @@ "browser": "peer/umd/vis-graph3d.min.js",

"propagating-hammerjs": "^1.4.0",
"vis-data": "^6.2.0",
"uuid": "^7.0.0 || ^8.0.0",
"vis-data": "^6.5.0",
"vis-util": "^3.0.0 || ^4.0.0"

@@ -79,6 +80,6 @@ },

"@babel/runtime-corejs3": "7.9.6",
"@rollup/plugin-commonjs": "11.1.0",
"@rollup/plugin-commonjs": "12.0.0",
"@rollup/plugin-json": "4.0.3",
"@rollup/plugin-node-resolve": "7.1.3",
"@rollup/plugin-strip": "1.3.2",
"@rollup/plugin-node-resolve": "8.0.0",
"@rollup/plugin-strip": "1.3.3",
"babel-plugin-css-modules-transform": "1.6.2",

@@ -89,3 +90,3 @@ "babel-plugin-istanbul": "6.0.0",

"eslint": "7.0.0",
"git-authors-cli": "1.0.25",
"git-authors-cli": "1.0.26",
"hammerjs": "2.0.8",

@@ -96,12 +97,12 @@ "husky": "4.2.5",

"keycharm": "0.3.1",
"lint-staged": "10.2.2",
"lint-staged": "10.2.4",
"mocha": "7.1.2",
"moment": "2.25.3",
"moment": "2.26.0",
"nyc": "15.0.1",
"opencollective": "1.0.3",
"postcss-assets": "5.0.0",
"prettier": "2.0.2",
"prettier": "2.0.5",
"propagating-hammerjs": "1.4.7",
"rimraf": "3.0.2",
"rollup": "2.10.2",
"rollup": "2.10.5",
"rollup-plugin-analyzer": "3.2.3",

@@ -118,5 +119,6 @@ "rollup-plugin-babel": "4.4.0",

"test-console": "1.1.0",
"vis-data": "6.5.0",
"vis-dev-utils": "2.2.10",
"vis-util": "4.0.0"
"uuid": "8.1.0",
"vis-data": "6.5.1",
"vis-dev-utils": "2.2.13",
"vis-util": "4.0.2"
},

@@ -123,0 +125,0 @@ "collective": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc