framework/extensions/statistics/js/dist/admin.js

2 lines
50 KiB
JavaScript
Raw Normal View History

module.exports=function(t){var e={};function s(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)s.d(i,a,function(e){return t[e]}.bind(null,a));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=8)}([function(t,e){t.exports=flarum.core.compat["utils/abbreviateNumber"]},function(t,e){t.exports=flarum.core.compat.app},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["components/DashboardPage"]},function(t,e){t.exports=flarum.core.compat["components/DashboardWidget"]},function(t,e){t.exports=flarum.core.compat["components/SelectDropdown"]},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["helpers/icon"]},function(t,e,s){"use strict";s.r(e);var i=s(1),a=s.n(i),n=s(2),r=s(3),o=s.n(r);var l=s(4),h=s.n(l),d=s(5),c=s.n(d),p=s(6),u=s.n(p),f=s(7),g=s.n(f),y=s(0),b=s.n(y);function x(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function v(t){let e=t.getBoundingClientRect();return{top:e.top+(document.documentElement.scrollTop||document.body.scrollTop),left:e.left+(document.documentElement.scrollLeft||document.body.scrollLeft)}}x.create=((t,e)=>{var s=document.createElement(t);for(var i in e){var a=e[i];if("inside"===i)x(a).appendChild(s);else if("around"===i){var n=x(a);n.parentNode.insertBefore(s,n),s.appendChild(n)}else"styles"===i?"object"==typeof a&&Object.keys(a).map(t=>{s.style[t]=a[t]}):i in s?s[i]=a:s.setAttribute(i,a)}return s});const w={margins:{top:10,bottom:10,left:20,right:20},paddings:{top:20,bottom:40,left:30,right:10},baseHeight:240,titleHeight:20,legendHeight:30,titleFontSize:12};function A(t){return t.titleHeight+t.margins.top+t.paddings.top}function P(t){return t.margins.left+t.paddings.left}function k(t){return t.margins.top+t.margins.bottom+t.paddings.top+t.paddings.bottom+t.titleHeight+t.legendHeight}function C(t){return t.margins.left+t.margins.right+t.paddings.left+t.paddings.right}const D=700,L=400,T=["line","bar"],M=100,N=.5,O=.01,E=4,S=20,$=2,z=5,W=10,H=7,F=5,I=["light-blue","blue","violet","red","orange","yellow","green","light-green","purple","magenta","light-grey","dark-grey"],R={bar:I,line:I,pie:I,percentage:I,heatmap:["#ebedf0","#c6e48b","#7bc96f","#239a3b","#196127"]},j=Math.PI/180,Y=360;class _{constructor({parent:t=null,colors:e=[]}){this.parent=t,this.colors=e,this.titleName="",this.titleValue="",this.listValues=[],this.titleValueFirst=0,this.x=0,this.y=0,this.top=0,this.left=0,this.setup()}setup(){this.makeTooltip()}refresh(){this.fill(),this.calcPosition()}makeTooltip(){this.container=x.create("div",{inside:this.parent,className:"graph-svg-tip comparison",innerHTML:'<span class="title"></span>\n\t\t\t\t<ul class="data-point-list"></ul>\n\t\t\t\t<div class="svg-pointer"></div>'}),this.hideTip(),this.title=this.container.querySelector(".title"),this.dataPointList=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",()=>{this.hideTip()})}fill(){let t;this.index&&this.container.setAttribute("data-point-index",this.index),t=this.titleValueFirst?`<strong>${this.titleValue}</strong>${this.titleName}`:`${this.titleName}<strong>${this.titleValue}</strong>`,this.title.innerHTML=t,this.dataPointList.innerHTML="",this.listValues.map((t,e)=>{const s=this.colors[e]||"black";let i=0===t.formatted||t.formatted?t.formatted:t.value
//# sourceMappingURL=admin.js.map