Repository navigation
Expand file tree
/
Copy pathDashboardPanelChart.js
More file actions
1 lines (1 loc) · 10.7 KB
/
Copy pathDashboardPanelChart.js
File metadata and controls
1 lines (1 loc) · 10.7 KB
1
!function(){function t(t){return t&&t.__esModule?t.default:t}var r,e="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},o={},a={},n={},l={};l=Array.isArray;var i={};function u(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}var s={},c={},d={},f={},h={};h=(void 0===e?"undefined":u(e))=="object"&&e&&e.Object===Object&&e;var b=("u"<typeof self?"undefined":u(self))=="object"&&self&&self.Object===Object&&self;d=(f=h||b||Function("return this")()).Symbol;var p={},g=Object.prototype,v=g.hasOwnProperty,y=g.toString,_=d?d.toStringTag:void 0;p=function(t){var r=v.call(t,_),e=t[_];try{t[_]=void 0;var o=!0}catch(t){}var a=y.call(t);return o&&(r?t[_]=e:delete t[_]),a};var C={},m=Object.prototype.toString;C=function(t){return m.call(t)};var w=d?d.toStringTag:void 0;c=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":w&&w in Object(t)?p(t):C(t)};var j={};j=function(t){return null!=t&&(void 0===t?"undefined":u(t))=="object"},s=function(t){return(void 0===t?"undefined":u(t))=="symbol"||j(t)&&"[object Symbol]"==c(t)};var O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;i=function(t,r){if(l(t))return!1;var e=void 0===t?"undefined":u(t);return!!("number"==e||"symbol"==e||"boolean"==e||null==t||s(t))||k.test(t)||!O.test(t)||null!=r&&t in Object(r)};var S={},z={},P={},x={},F={},W={},B={},T={},A={},E={},R={};R=function(t){var r=void 0===t?"undefined":u(t);return null!=t&&("object"==r||"function"==r)},E=function(t){if(!R(t))return!1;var r=c(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r};var H={},L={};L=f["__core-js_shared__"];var M=(r=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";H=function(t){return!!M&&M in t};var U={},q=Function.prototype.toString;U=function(t){if(null!=t){try{return q.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var D=/^\[object .+?Constructor\]$/,G=Object.prototype,I=Function.prototype.toString,N=G.hasOwnProperty,Z=RegExp("^"+I.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");A=function(t){return!(!R(t)||H(t))&&(E(t)?Z:D).test(U(t))};var J={};J=function(t,r){return null==t?void 0:t[r]},B=(T=function(t,r){var e=J(t,r);return A(e)?e:void 0})(Object,"create"),W=function(){this.__data__=B?B(null):{},this.size=0};var K={};K=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=!!r,r};var Q={},V=Object.prototype.hasOwnProperty;Q=function(t){var r=this.__data__;if(B){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return V.call(r,t)?r[t]:void 0};var X={},Y=Object.prototype.hasOwnProperty;X=function(t){var r=this.__data__;return B?void 0!==r[t]:Y.call(r,t)};var tt={};function tr(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])}}tt=function(t,r){var e=this.__data__;return this.size+=+!this.has(t),e[t]=B&&void 0===r?"__lodash_hash_undefined__":r,this},tr.prototype.clear=W,tr.prototype.delete=K,tr.prototype.get=Q,tr.prototype.has=X,tr.prototype.set=tt,F=tr;var te={},to={};to=function(){this.__data__=[],this.size=0};var ta={},tn={},tl={};tl=function(t,r){return t===r||t!=t&&r!=r},tn=function(t,r){for(var e=t.length;e--;)if(tl(t[e][0],r))return e;return -1};var ti=Array.prototype.splice;ta=function(t){var r=this.__data__,e=tn(r,t);return!(e<0)&&(e==r.length-1?r.pop():ti.call(r,e,1),--this.size,!0)};var tu={};tu=function(t){var r=this.__data__,e=tn(r,t);return e<0?void 0:r[e][1]};var ts={};ts=function(t){return tn(this.__data__,t)>-1};var tc={};function td(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])}}tc=function(t,r){var e=this.__data__,o=tn(e,t);return o<0?(++this.size,e.push([t,r])):e[o][1]=r,this},td.prototype.clear=to,td.prototype.delete=ta,td.prototype.get=tu,td.prototype.has=ts,td.prototype.set=tc,te=td;var tf={};tf=T(f,"Map"),x=function(){this.size=0,this.__data__={hash:new F,map:new(tf||te),string:new F}};var th={},tb={},tp={};tp=function(t){var r=void 0===t?"undefined":u(t);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t},tb=function(t,r){var e=t.__data__;return tp(r)?e["string"==typeof r?"string":"hash"]:e.map},th=function(t){var r=tb(this,t).delete(t);return this.size-=!!r,r};var tg={};tg=function(t){return tb(this,t).get(t)};var tv={};tv=function(t){return tb(this,t).has(t)};var ty={};function t_(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 tC(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(tC.Cache||P),e}ty=function(t,r){var e=tb(this,t),o=e.size;return e.set(t,r),this.size+=+(e.size!=o),this},t_.prototype.clear=x,t_.prototype.delete=th,t_.prototype.get=tg,t_.prototype.has=tv,t_.prototype.set=ty,tC.Cache=P=t_,z=tC;var tm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tw=/\\(\\)?/g;S=function(t){var r=z(t,function(t){return 500===e.size&&e.clear(),t}),e=r.cache;return r}(function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(tm,function(t,e,o,a){r.push(o?a.replace(tw,"$1"):e||t)}),r});var tj={},tO={},tk={};tk=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 t$=1/0,tS=d?d.prototype:void 0,tz=tS?tS.toString:void 0;tO=function t(r){if("string"==typeof r)return r;if(l(r))return tk(r,t)+"";if(s(r))return tz?tz.call(r):"";var e=r+"";return"0"==e&&1/r==-t$?"-0":e},tj=function(t){return null==t?"":tO(t)},n=function(t,r){return l(t)?t:i(t,r)?[t]:S(tj(t))};var tP={},tx=1/0;tP=function(t){if("string"==typeof t||s(t))return t;var r=t+"";return"0"==r&&1/t==-tx?"-0":r},a=function(t,r){r=n(r,t);for(var e=0,o=r.length;null!=t&&e<o;)t=t[tP(r[e++])];return e&&e==o?t:void 0},o=function(t,r,e){var o=null==t?void 0:a(t,r);return void 0===o?e:o};var tF={},tW={},tB={},tT={},tA={};tA=function(){try{var t=T(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),tT=function(t,r,e){"__proto__"==r&&tA?tA(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var tE=Object.prototype.hasOwnProperty;tB=function(t,r,e){var o=t[r];tE.call(t,r)&&tl(o,e)&&(void 0!==e||r in t)||tT(t,r,e)};var tR={},tH=/^(?:0|[1-9]\d*)$/;function tL(r){var e=r.type;if(!t(o)(r,"options.legend.labels.boxWidth")){var a=Chart.defaults.global.legend.labels.boxWidth,n=Chart.defaults.global.legend.labels.boxWidthByChartType[e]||a;t(tF)(r,"options.legend.labels.boxWidth",n)}}tR=function(t,r){var e=void 0===t?"undefined":u(t);return!!(r=null==r?0x1fffffffffffff:r)&&("number"==e||"symbol"!=e&&tH.test(t))&&t>-1&&t%1==0&&t<r},tW=function(t,r,e,o){if(!R(t))return t;r=n(r,t);for(var a=-1,l=r.length,i=l-1,u=t;null!=u&&++a<l;){var s=tP(r[a]),c=e;if("__proto__"===s||"constructor"===s||"prototype"===s)break;if(a!=i){var d=u[s];void 0===(c=o?o(d,s,u):void 0)&&(c=R(d)?d:tR(r[a+1])?[]:{})}tB(u,s,c),u=u[s]}return t},tF=function(t,r,e){return null==t?t:tW(t,r,e)};var tM={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)"]},tU=tM.processwire,tq=function(t){tU=tM[t]||tU},tD=function(t,r){return t[r%t.length]};function tG(t){var r=t.data("chart-instance");if(r)return r;var e=t.data("chart"),o=t.data("theme");tq(t.data("default-theme")),tL(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=tM[t.config.theme]||tU;switch(t.config.type){case"bar":t.data.datasets.forEach(function(t,e){!t.borderColor&&(t.borderColor=tD(r,e),t.backgroundColor||(t.backgroundColor=t.borderColor))});break;case"line":t.data.datasets.forEach(function(t,e){!t.borderColor&&(t.borderColor=tD(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 tD(r,e)});t.backgroundColor=e}t.borderColor||(t.borderColor="white")})}}}),$(document).on("dashboard:panel(chart)",function(t,r){r.$element.find("canvas").each(function(t,r){tG($(r))})}),$(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")||tG(e),tL(l=a.data("chart")),n.config.data=l.data,n.options=l.options,n.update()})})}();