-
Notifications
You must be signed in to change notification settings - Fork 5
/
DashboardPanelChart.js
1 lines (1 loc) · 10.7 KB
/
DashboardPanelChart.js
1
!function(){function t(t){return t&&t.__esModule?t.default:t}var r,e,o,a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n={},l={},i={},u={};u=Array.isArray;var s={};function c(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}var d={},f={},h={},b={},p={};p="object"==typeof a&&a&&a.Object===Object&&a;var g="object"==typeof self&&self&&self.Object===Object&&self;h=(b=p||g||Function("return this")()).Symbol;var v={},y=Object.prototype,_=y.hasOwnProperty,C=y.toString,m=h?h.toStringTag:void 0;v=function(t){var r=_.call(t,m),e=t[m];try{t[m]=void 0;var o=!0}catch(t){}var a=C.call(t);return o&&(r?t[m]=e:delete t[m]),a};var w={},j=Object.prototype.toString;w=function(t){return j.call(t)};var O=h?h.toStringTag:void 0;f=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?v(t):w(t)};var k={};k=function(t){return null!=t&&"object"==typeof t},d=function(t){return(void 0===t?"undefined":c(t))=="symbol"||k(t)&&"[object Symbol]"==f(t)};var S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/;s=function(t,r){if(u(t))return!1;var e=void 0===t?"undefined":c(t);return!!("number"==e||"symbol"==e||"boolean"==e||null==t||d(t))||z.test(t)||!S.test(t)||null!=r&&t in Object(r)};var P={},x={},F={},W={},B={},T={},A={},E={},R={},H={},L={};L=function(t){var r=void 0===t?"undefined":c(t);return null!=t&&("object"==r||"function"==r)},H=function(t){if(!L(t))return!1;var r=f(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r};var M={},U={};U=b["__core-js_shared__"];var q=(o=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";M=function(t){return!!q&&q in t};var D={},G=Function.prototype.toString;D=function(t){if(null!=t){try{return G.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var I=/^\[object .+?Constructor\]$/,N=Object.prototype,Z=Function.prototype.toString,J=N.hasOwnProperty,K=RegExp("^"+Z.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");R=function(t){return!(!L(t)||M(t))&&(H(t)?K:I).test(D(t))};var Q={};Q=function(t,r){return null==t?void 0:t[r]},A=(E=function(t,r){var e=Q(t,r);return R(e)?e:void 0})(Object,"create"),T=function(){this.__data__=A?A(null):{},this.size=0};var V={};V=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r};var X={},Y=Object.prototype.hasOwnProperty;X=function(t){var r=this.__data__;if(A){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return Y.call(r,t)?r[t]:void 0};var tt={},tr=Object.prototype.hasOwnProperty;tt=function(t){var r=this.__data__;return A?void 0!==r[t]:tr.call(r,t)};var te={};function to(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}te=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=A&&void 0===r?"__lodash_hash_undefined__":r,this},to.prototype.clear=T,to.prototype.delete=V,to.prototype.get=X,to.prototype.has=tt,to.prototype.set=te,B=to;var ta={},tn={};tn=function(){this.__data__=[],this.size=0};var tl={},ti={},tu={};tu=function(t,r){return t===r||t!=t&&r!=r},ti=function(t,r){for(var e=t.length;e--;)if(tu(t[e][0],r))return e;return -1};var ts=Array.prototype.splice;tl=function(t){var r=this.__data__,e=ti(r,t);return!(e<0)&&(e==r.length-1?r.pop():ts.call(r,e,1),--this.size,!0)};var tc={};tc=function(t){var r=this.__data__,e=ti(r,t);return e<0?void 0:r[e][1]};var td={};td=function(t){return ti(this.__data__,t)>-1};var tf={};function th(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}tf=function(t,r){var e=this.__data__,o=ti(e,t);return o<0?(++this.size,e.push([t,r])):e[o][1]=r,this},th.prototype.clear=tn,th.prototype.delete=tl,th.prototype.get=tc,th.prototype.has=td,th.prototype.set=tf,ta=th;var tb={};tb=E(b,"Map"),W=function(){this.size=0,this.__data__={hash:new B,map:new(tb||ta),string:new B}};var tp={},tg={},tv={};tv=function(t){var r=void 0===t?"undefined":c(t);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t},tg=function(t,r){var e=t.__data__;return tv(r)?e["string"==typeof r?"string":"hash"]:e.map},tp=function(t){var r=tg(this,t).delete(t);return this.size-=r?1:0,r};var ty={};ty=function(t){return tg(this,t).get(t)};var t_={};t_=function(t){return tg(this,t).has(t)};var tC={};function tm(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var o=t[r];this.set(o[0],o[1])}}function tw(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw TypeError("Expected a function");var e=function(){var o=arguments,a=r?r.apply(this,o):o[0],n=e.cache;if(n.has(a))return n.get(a);var l=t.apply(this,o);return e.cache=n.set(a,l)||n,l};return e.cache=new(tw.Cache||F),e}tC=function(t,r){var e=tg(this,t),o=e.size;return e.set(t,r),this.size+=e.size==o?0:1,this},tm.prototype.clear=W,tm.prototype.delete=tp,tm.prototype.get=ty,tm.prototype.has=t_,tm.prototype.set=tC,F=tm,tw.Cache=F;var tj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tO=/\\(\\)?/g;e=(r=(x=tw)(function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(tj,function(t,e,o,a){r.push(o?a.replace(tO,"$1"):e||t)}),r},function(t){return 500===e.size&&e.clear(),t})).cache,P=r;var tk={},t$={},tS={};tS=function(t,r){for(var e=-1,o=null==t?0:t.length,a=Array(o);++e<o;)a[e]=r(t[e],e,t);return a};var tz=1/0,tP=h?h.prototype:void 0,tx=tP?tP.toString:void 0;t$=function t(r){if("string"==typeof r)return r;if(u(r))return tS(r,t)+"";if(d(r))return tx?tx.call(r):"";var e=r+"";return"0"==e&&1/r==-tz?"-0":e},tk=function(t){return null==t?"":t$(t)},i=function(t,r){return u(t)?t:s(t,r)?[t]:P(tk(t))};var tF={},tW=1/0;tF=function(t){if("string"==typeof t||d(t))return t;var r=t+"";return"0"==r&&1/t==-tW?"-0":r},l=function(t,r){r=i(r,t);for(var e=0,o=r.length;null!=t&&e<o;)t=t[tF(r[e++])];return e&&e==o?t:void 0},n=function(t,r,e){var o=null==t?void 0:l(t,r);return void 0===o?e:o};var tB={},tT={},tA={},tE={},tR={};tR=function(){try{var t=E(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),tE=function(t,r,e){"__proto__"==r&&tR?tR(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var tH=Object.prototype.hasOwnProperty;tA=function(t,r,e){var o=t[r];tH.call(t,r)&&tu(o,e)&&(void 0!==e||r in t)||tE(t,r,e)};var tL={},tM=/^(?:0|[1-9]\d*)$/;function tU(r){var e=r.type;if(!t(n)(r,"options.legend.labels.boxWidth")){var o=Chart.defaults.global.legend.labels.boxWidth,a=Chart.defaults.global.legend.labels.boxWidthByChartType[e]||o;t(tB)(r,"options.legend.labels.boxWidth",a)}}tL=function(t,r){var e=void 0===t?"undefined":c(t);return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&tM.test(t))&&t>-1&&t%1==0&&t<r},tT=function(t,r,e,o){if(!L(t))return t;r=i(r,t);for(var a=-1,n=r.length,l=n-1,u=t;null!=u&&++a<n;){var s=tF(r[a]),c=e;if("__proto__"===s||"constructor"===s||"prototype"===s)break;if(a!=l){var d=u[s];void 0===(c=o?o(d,s,u):void 0)&&(c=L(d)?d:tL(r[a+1])?[]:{})}tA(u,s,c),u=u[s]}return t},tB=function(t,r,e){return null==t?t:tT(t,r,e)};var tq={dashboard:["rgb(23, 185, 120)","rgb(103, 114, 229)","rgb(219, 120, 221)","rgb(244, 190, 86)","rgb(35, 164, 240)"],airtable:["rgb(8, 157, 88)","rgb(168, 71, 189)","rgb(62, 134, 246)","rgb(217, 70, 55)","rgb(240, 181, 0)"],processwire:["rgb(37, 128, 230)","rgb(233, 53, 97)","rgb(69, 183, 151)","rgb(28, 40, 53)"],reminders:["rgb(92, 91, 231)","rgb(253, 71, 59)","rgb(252, 160, 11)","rgb(41, 209, 92)","rgb(211, 128, 246)"],workflow:["rgb(99, 142, 196)","rgb(68, 158, 135)","rgb(186, 101, 192)","rgb(222, 83, 87)","rgb(209, 151, 40)"]},tD=tq.processwire,tG=function(t){tD=tq[t]||tD},tI=function(t,r){return t[r%t.length]};function tN(t){var r=t.data("chart-instance");if(r)return r;var e=t.data("chart"),o=t.data("theme");tG(t.data("default-theme")),tU(e),e.theme=o;var a=new Chart(t,e);return t.data("chart-instance",a),t.attr("data-setup",!0),a}Chart.defaults.global.animation.duration=0,Chart.defaults.global.aspectRatio=2.5,Chart.defaults.global.layout.padding=5,Chart.defaults.scale.gridLines.drawBorder=!1,Chart.defaults.scale.color="rgba(0, 0, 0, 0.07)",Chart.defaults.scale.zeroLineColor="rgba(0, 0, 0, 0.07)",Chart.defaults.scale.drawBorder=!1,Chart.defaults.scale.ticks.beginAtZero=!0,Chart.defaults.global.legend.position="bottom",Chart.defaults.global.legend.labels.fontColor="rgb(110, 110, 110)",Chart.defaults.global.legend.labels.usePointStyle=!0,Chart.defaults.global.legend.labels.boxWidth=4,Chart.defaults.global.legend.labels.boxWidthByChartType={doughnut:4,pie:8},Chart.defaults.global.tooltips.titleFontColor="rgb(53, 75, 96)",Chart.defaults.global.tooltips.backgroundColor="rgb(240, 243, 247)",Chart.defaults.global.tooltips.bodyFontColor="rgba(53, 75, 96, 0.6)",Chart.defaults.global.tooltips.displayColors=!1,Chart.defaults.global.tooltips.titleFontSize=14,Chart.defaults.global.tooltips.bodyFontSize=14,Chart.defaults.global.tooltips.cornerRadius=4,Chart.defaults.global.tooltips.xPadding=10,Chart.defaults.global.tooltips.yPadding=10,Chart.defaults.global.elements.line.backgroundColor="transparent",Chart.defaults.global.elements.line.clip=20,Chart.defaults.global.elements.line.borderWidth=2,Chart.defaults.doughnut.cutoutPercentage=75,Chart.defaults.global.elements.arc.borderWidth=4,Chart.defaults.global.elements.arc.borderColor="white",Chart.defaults.global.elements.arc.hoverBorderColor="white",Chart.defaults.global.elements.point.backgroundColor="white",Chart.defaults.global.elements.point.radius=3,Chart.defaults.global.elements.point.hoverRadius=4,Chart.defaults.global.elements.point.borderWidth=2,Chart.defaults.global.elements.point.hoverBorderWidth=2,Chart.pluginService.register({beforeUpdate:function(t){var r=tq[t.config.theme]||tD;switch(t.config.type){case"bar":t.data.datasets.forEach(function(t,e){t.borderColor||(t.borderColor=tI(r,e),t.backgroundColor||(t.backgroundColor=t.borderColor))});break;case"line":t.data.datasets.forEach(function(t,e){t.borderColor||(t.borderColor=tI(r,e),t.backgroundColor||(t.pointHoverBackgroundColor=t.borderColor),t.pointHoverBackgroundColor||(t.pointHoverBackgroundColor=t.borderColor))});break;case"pies":case"doughnut":t.data.datasets.forEach(function(t){if(!t.backgroundColor){var e=t.data.map(function(t,e){return tI(r,e)});t.backgroundColor=e}t.borderColor||(t.borderColor="white")})}}}),$(document).on("dashboard:panel(chart)",function(t,r){!function(t){t.find("canvas").each(function(t,r){tN($(r))})}(r.$element)}),$(document).on("dashboard:reload(chart)",function(t,r){var e,o,a=r.$element,n=r.$new;t.preventDefault(),e=a.find("canvas"),o=n.find("canvas"),e.each(function(t,r){var e,a,n,l;e=$(r),a=o.eq(t),n=e.data("chart-instance")||tN(e),tU(l=a.data("chart")),n.config.data=l.data,n.options=l.options,n.update()})})}();