@perses-dev/histogram-chart-plugin 0.12.0 → 0.13.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/__mf/js/{main.ffd61509.js → HistogramChart.df5fff46.js} +4 -4
  2. package/__mf/js/async/121.27e8d4f8.js +2 -0
  3. package/__mf/js/async/362.fcbf1223.js +1 -0
  4. package/__mf/js/async/392.5ba26727.js +2 -0
  5. package/__mf/js/async/470.2ea03b19.js +2 -0
  6. package/__mf/js/async/887.bbc6e84a.js +144 -0
  7. package/__mf/js/async/888.85a51e69.js +1 -0
  8. package/__mf/js/async/941.8421dbe6.js +2 -0
  9. package/__mf/js/async/{953.5b6a6f54.js → 953.bbe56839.js} +2 -2
  10. package/__mf/js/async/963.0a826f58.js +1 -0
  11. package/__mf/js/async/__federation_expose_HistogramChart.a9992cd4.js +1 -0
  12. package/__mf/js/main.4a790b64.js +7 -0
  13. package/lib/HistogramChart.d.ts +3 -3
  14. package/lib/HistogramChart.d.ts.map +1 -1
  15. package/lib/HistogramChart.js +2 -2
  16. package/lib/HistogramChart.js.map +1 -1
  17. package/lib/bootstrap.js +2 -2
  18. package/lib/components/HistogramChart.d.ts +4 -4
  19. package/lib/components/HistogramChart.d.ts.map +1 -1
  20. package/lib/components/HistogramChart.js +7 -7
  21. package/lib/components/HistogramChart.js.map +1 -1
  22. package/lib/components/HistogramChartOptionsEditorSettings.d.ts +2 -2
  23. package/lib/components/HistogramChartOptionsEditorSettings.d.ts.map +1 -1
  24. package/lib/components/HistogramChartOptionsEditorSettings.js +5 -5
  25. package/lib/components/HistogramChartOptionsEditorSettings.js.map +1 -1
  26. package/lib/components/HistogramChartPanel.d.ts +4 -4
  27. package/lib/components/HistogramChartPanel.d.ts.map +1 -1
  28. package/lib/components/HistogramChartPanel.js +6 -6
  29. package/lib/components/HistogramChartPanel.js.map +1 -1
  30. package/lib/components/index.js +3 -3
  31. package/lib/components/index.js.map +1 -1
  32. package/lib/getPluginModule.d.ts +1 -1
  33. package/lib/getPluginModule.d.ts.map +1 -1
  34. package/lib/getPluginModule.js +3 -1
  35. package/lib/getPluginModule.js.map +1 -1
  36. package/lib/histogram-chart-model.d.ts +3 -3
  37. package/lib/histogram-chart-model.d.ts.map +1 -1
  38. package/lib/histogram-chart-model.js.map +1 -1
  39. package/lib/index-federation.js +1 -1
  40. package/lib/index.js +4 -4
  41. package/lib/index.js.map +1 -1
  42. package/lib/setup-tests.d.ts +1 -1
  43. package/lib/setup-tests.d.ts.map +1 -1
  44. package/lib/setup-tests.js +2 -2
  45. package/lib/setup-tests.js.map +1 -1
  46. package/lib/utils/index.js +1 -1
  47. package/lib/utils/index.js.map +1 -1
  48. package/lib/utils/thresholds.d.ts +1 -1
  49. package/lib/utils/thresholds.d.ts.map +1 -1
  50. package/lib/utils/thresholds.js.map +1 -1
  51. package/mf-manifest.json +18 -18
  52. package/mf-stats.json +18 -18
  53. package/package.json +10 -10
  54. package/__mf/js/HistogramChart.e667cd2b.js +0 -7
  55. package/__mf/js/async/121.4fbaef7c.js +0 -2
  56. package/__mf/js/async/392.76c75fd4.js +0 -2
  57. package/__mf/js/async/470.46eda164.js +0 -2
  58. package/__mf/js/async/535.32b814f1.js +0 -1
  59. package/__mf/js/async/888.0f662c7e.js +0 -1
  60. package/__mf/js/async/892.f82ac287.js +0 -144
  61. package/__mf/js/async/941.4dc35097.js +0 -2
  62. package/__mf/js/async/963.85edfb9c.js +0 -1
  63. package/__mf/js/async/__federation_expose_HistogramChart.c1589bb7.js +0 -1
  64. package/lib/cjs/HistogramChart.js +0 -40
  65. package/lib/cjs/bootstrap.js +0 -26
  66. package/lib/cjs/components/HistogramChart.js +0 -207
  67. package/lib/cjs/components/HistogramChartOptionsEditorSettings.js +0 -138
  68. package/lib/cjs/components/HistogramChartPanel.js +0 -104
  69. package/lib/cjs/components/index.js +0 -32
  70. package/lib/cjs/env.d.js +0 -14
  71. package/lib/cjs/getPluginModule.js +0 -39
  72. package/lib/cjs/histogram-chart-model.js +0 -84
  73. package/lib/cjs/index-federation.js +0 -55
  74. package/lib/cjs/index.js +0 -47
  75. package/lib/cjs/setup-tests.js +0 -19
  76. package/lib/cjs/utils/index.js +0 -30
  77. package/lib/cjs/utils/thresholds.js +0 -34
  78. /package/__mf/css/async/{892.85c2cbf6.css → 887.85c2cbf6.css} +0 -0
  79. /package/__mf/js/async/{121.4fbaef7c.js.LICENSE.txt → 121.27e8d4f8.js.LICENSE.txt} +0 -0
  80. /package/__mf/js/async/{392.76c75fd4.js.LICENSE.txt → 392.5ba26727.js.LICENSE.txt} +0 -0
  81. /package/__mf/js/async/{470.46eda164.js.LICENSE.txt → 470.2ea03b19.js.LICENSE.txt} +0 -0
  82. /package/__mf/js/async/{892.f82ac287.js.LICENSE.txt → 887.bbc6e84a.js.LICENSE.txt} +0 -0
  83. /package/__mf/js/async/{941.4dc35097.js.LICENSE.txt → 941.8421dbe6.js.LICENSE.txt} +0 -0
  84. /package/__mf/js/async/{953.5b6a6f54.js.LICENSE.txt → 953.bbe56839.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 941.4dc35097.js.LICENSE.txt */
2
- "use strict";(self.chunk_HistogramChart=self.chunk_HistogramChart||[]).push([["941"],{7470(e,r,t){var o=t(20231);r.createRoot=o.createRoot,r.hydrateRoot=o.hydrateRoot},2192(e,r,t){var o=t(70451),a=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,_=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function c(e,r,t){var o,n={},c=null,l=null;for(o in void 0!==t&&(c=""+t),void 0!==r.key&&(c=""+r.key),void 0!==r.ref&&(l=r.ref),r)s.call(r,o)&&!f.hasOwnProperty(o)&&(n[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===n[o]&&(n[o]=r[o]);return{$$typeof:a,type:e,key:c,ref:l,props:n,_owner:_.current}}r.Fragment=n,r.jsx=c,r.jsxs=c},62540(e,r,t){e.exports=t(2192)},86604(e,r,t){t.r(r);var o=t(62540),a=t(70451),n=t.n(a);t(7470).createRoot(document.getElementById("root")).render((0,o.jsx)(n().StrictMode,{}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_HistogramChart=self.chunk_HistogramChart||[]).push([["963"],{38662(e,t,r){r.r(t),r.d(t,{Immer:()=>X,applyPatches:()=>et,castDraft:()=>ea,castImmutable:()=>ei,createDraft:()=>er,current:()=>q,enableMapSet:()=>G,enablePatches:()=>B,finishDraft:()=>en,freeze:()=>z,immerable:()=>i,isDraft:()=>u,isDraftable:()=>l,nothing:()=>a,original:()=>h,produce:()=>T,produceWithPatches:()=>V,setAutoFreeze:()=>Y,setUseStrictIteration:()=>ee,setUseStrictShallowCopy:()=>Z});var n,a=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),s=Symbol.for("immer-state");function o(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var c=Object.getPrototypeOf;function u(e){return!!e&&!!e[s]}function l(e){return!!e&&(_(e)||Array.isArray(e)||!!e[i]||!!e.constructor?.[i]||m(e)||S(e))}var f=Object.prototype.constructor.toString(),p=new WeakMap;function _(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if("function"!=typeof r)return!1;let n=p.get(r);return void 0===n&&(n=Function.toString.call(r),p.set(r,n)),n===f}function h(e){return u(e)||o(15,e),e[s].base_}function d(e,t,r=!0){0===y(e)?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function y(e){let t=e[s];return t?t.type_:Array.isArray(e)?1:m(e)?2:3*!!S(e)}function b(e,t){return 2===y(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function v(e,t){return 2===y(e)?e.get(t):e[t]}function g(e,t,r){let n=y(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function m(e){return e instanceof Map}function S(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function P(e,t){if(m(e))return new Map(e);if(S(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=_(e);if(!0!==t&&("class_only"!==t||r)){let t=c(e);return null!==t&&r?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[s];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){let a=r[n],i=t[a];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(c(e),t)}}function z(e,t=!1){return j(e)||u(e)||!l(e)||(y(e)>1&&Object.defineProperties(e,{set:O,add:O,clear:O,delete:O}),Object.freeze(e),t&&Object.values(e).forEach(e=>z(e,!0))),e}var O={value:function(){o(2)}};function j(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var M={};function A(e){let t=M[e];return t||o(0,e),t}function k(e,t){t&&(A("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function D(e){F(e),e.drafts_.forEach(E),e.drafts_=null}function F(e){e===n&&(n=e.parent_)}function I(e){return n={drafts_:[],parent_:n,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function E(e){let t=e[s];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function x(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[s].modified_&&(D(t),o(4)),l(e)&&(e=C(t,e),t.parent_||N(t,e)),t.patches_&&A("Patches").generateReplacementPatches_(r[s].base_,e,t.patches_,t.inversePatches_)):e=C(t,r,[]),D(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==a?e:void 0}function C(e,t,r){if(j(t))return t;let n=e.immer_.shouldUseStrictIteration(),a=t[s];if(!a)return d(t,(n,i)=>U(e,a,t,n,i,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return N(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let t=a.copy_,i=t,s=!1;3===a.type_&&(i=new Set(t),t.clear(),s=!0),d(i,(n,i)=>U(e,a,t,n,i,r,s),n),N(e,t,!1),r&&e.patches_&&A("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function U(e,t,r,n,a,i,s){if(null==a||"object"!=typeof a&&!s)return;let o=j(a);if(!o||s){if(u(a)){let s=C(e,a,i&&t&&3!==t.type_&&!b(t.assigned_,n)?i.concat(n):void 0);if(g(r,n,s),!u(s))return;e.canAutoFreeze_=!1}else s&&r.add(a);if(l(a)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&o)return;C(e,a),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&(m(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&N(e,a)}}}function N(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&z(t,r)}var R={get(e,t){if(t===s)return e;let r=w(e);if(!b(r,t)){var n;let a;return n=e,(a=H(r,t))?"value"in a?a.value:a.get?.call(n.draft_):void 0}let a=r[t];return e.finalized_||!l(a)?a:a===K(e.base_,t)?(J(e),e.copy_[t]=$(a,e)):a},has:(e,t)=>t in w(e),ownKeys:e=>Reflect.ownKeys(w(e)),set(e,t,r){let n=H(w(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=K(w(e),t),a=n?.[s];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||b(e.base_,t)))return!0;J(e),L(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==K(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,J(e),L(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=w(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){o(11)},getPrototypeOf:e=>c(e.base_),setPrototypeOf(){o(12)}},W={};function K(e,t){let r=e[s];return(r?w(r):e)[t]}function H(e,t){if(!(t in e))return;let r=c(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=c(r)}}function L(e){!e.modified_&&(e.modified_=!0,e.parent_&&L(e.parent_))}function J(e){e.copy_||(e.copy_=P(e.base_,e.scope_.immer_.useStrictShallowCopy_))}d(R,(e,t)=>{W[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),W.deleteProperty=function(e,t){return W.set.call(this,e,t,void 0)},W.set=function(e,t,r){return R.set.call(this,e[0],t,r,e[0])};var X=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,r)=>{let n;if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...a){return n.produce(e,e=>t.call(this,e,...a))}}if("function"!=typeof t&&o(6),void 0!==r&&"function"!=typeof r&&o(7),l(e)){let a=I(this),i=$(e,void 0),s=!0;try{n=t(i),s=!1}finally{s?D(a):F(a)}return k(a,r),x(n,a)}if(e&&"object"==typeof e)o(1,e);else{if(void 0===(n=t(e))&&(n=e),n===a&&(n=void 0),this.autoFreeze_&&z(n,!0),r){let t=[],a=[];A("Patches").generateReplacementPatches_(e,n,t,a),r(t,a)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return"function"==typeof e?(t,...r)=>this.produceWithPatches(t,t=>e(t,...r)):[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){l(e)||o(8),u(e)&&(e=q(e));let t=I(this),r=$(e,void 0);return r[s].isManual_=!0,F(t),r}finishDraft(e,t){let r=e&&e[s];r&&r.isManual_||o(9);let{scope_:n}=r;return k(n,t),x(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=A("Patches").applyPatches_;return u(e)?n(e,t):this.produce(e,e=>n(e,t))}};function $(e,t){let r=m(e)?A("MapSet").proxyMap_(e,t):S(e)?A("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),a={type_:+!!r,scope_:t?t.scope_:n,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=a,s=R;r&&(i=[a],s=W);let{revoke:o,proxy:c}=Proxy.revocable(i,s);return a.draft_=c,a.revoke_=o,c}(e,t);return(t?t.scope_:n).drafts_.push(r),r}function q(e){return u(e)||o(10,e),function e(t){let r;if(!l(t)||j(t))return t;let n=t[s],a=!0;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=P(t,n.scope_.immer_.useStrictShallowCopy_),a=n.scope_.immer_.shouldUseStrictIteration()}else r=P(t,!0);return d(r,(t,n)=>{g(r,t,e(n))},a),n&&(n.finalized_=!1),r}(e)}function B(){let e="replace",t="remove";function r(e){if(!l(e))return e;if(Array.isArray(e))return e.map(r);if(m(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,r(t)]));if(S(e))return new Set(Array.from(e).map(r));let t=Object.create(c(e));for(let n in e)t[n]=r(e[n]);return b(e,i)&&(t[i]=e[i]),t}function n(e){return u(e)?r(e):e}M.Patches||(M.Patches={applyPatches_:function(n,a){return a.forEach(a=>{let{path:i,op:s}=a,c=n;for(let e=0;e<i.length-1;e++){let t=y(c),r=i[e];"string"!=typeof r&&"number"!=typeof r&&(r=""+r),(0===t||1===t)&&("__proto__"===r||"constructor"===r)&&o(19),"function"==typeof c&&"prototype"===r&&o(19),"object"!=typeof(c=v(c,r))&&o(18,i.join("/"))}let u=y(c),l=r(a.value),f=i[i.length-1];switch(s){case e:switch(u){case 2:return c.set(f,l);case 3:o(16);default:return c[f]=l}case"add":switch(u){case 1:return"-"===f?c.push(l):c.splice(f,0,l);case 2:return c.set(f,l);case 3:return c.add(l);default:return c[f]=l}case t:switch(u){case 1:return c.splice(f,1);case 2:return c.delete(f);case 3:return c.delete(a.value);default:return delete c[f]}default:o(17,s)}}),n},generatePatches_:function(r,a,i,s){switch(r.type_){case 0:case 2:return function(r,a,i,s){let{base_:o,copy_:c}=r;d(r.assigned_,(r,u)=>{let l=v(o,r),f=v(c,r),p=u?b(o,r)?e:"add":t;if(l===f&&p===e)return;let _=a.concat(r);i.push(p===t?{op:p,path:_}:{op:p,path:_,value:f}),s.push("add"===p?{op:t,path:_}:p===t?{op:"add",path:_,value:n(l)}:{op:e,path:_,value:n(l)})})}(r,a,i,s);case 1:return function(r,a,i,s){let{base_:o,assigned_:c}=r,u=r.copy_;u.length<o.length&&([o,u]=[u,o],[i,s]=[s,i]);for(let t=0;t<o.length;t++)if(c[t]&&u[t]!==o[t]){let r=a.concat([t]);i.push({op:e,path:r,value:n(u[t])}),s.push({op:e,path:r,value:n(o[t])})}for(let e=o.length;e<u.length;e++){let t=a.concat([e]);i.push({op:"add",path:t,value:n(u[e])})}for(let e=u.length-1;o.length<=e;--e){let r=a.concat([e]);s.push({op:t,path:r})}}(r,a,i,s);case 3:return function(e,r,n,a){let{base_:i,copy_:s}=e,o=0;i.forEach(e=>{if(!s.has(e)){let i=r.concat([o]);n.push({op:t,path:i,value:e}),a.unshift({op:"add",path:i,value:e})}o++}),o=0,s.forEach(e=>{if(!i.has(e)){let i=r.concat([o]);n.push({op:"add",path:i,value:e}),a.unshift({op:t,path:i,value:e})}o++})}(r,a,i,s)}},generateReplacementPatches_:function(t,r,n,i){n.push({op:e,path:[],value:r===a?void 0:r}),i.push({op:e,path:[],value:t})}})}function G(){class e extends Map{constructor(e,t){super(),this[s]={type_:2,parent_:t,scope_:t?t.scope_:n,modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return w(this[s]).size}has(e){return w(this[s]).has(e)}set(e,r){let n=this[s];return i(n),w(n).has(e)&&w(n).get(e)===r||(t(n),L(n),n.assigned_.set(e,!0),n.copy_.set(e,r),n.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;let r=this[s];return i(r),t(r),L(r),r.base_.has(e)?r.assigned_.set(e,!1):r.assigned_.delete(e),r.copy_.delete(e),!0}clear(){let e=this[s];i(e),w(e).size&&(t(e),L(e),e.assigned_=new Map,d(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){w(this[s]).forEach((r,n,a)=>{e.call(t,this.get(n),n,this)})}get(e){let r=this[s];i(r);let n=w(r).get(e);if(r.finalized_||!l(n)||n!==r.base_.get(e))return n;let a=$(n,r);return t(r),r.copy_.set(e,a),a}keys(){return w(this[s]).keys()}values(){let e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{let t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}}entries(){let e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{let t=e.next();if(t.done)return t;let r=this.get(t.value);return{done:!1,value:[t.value,r]}}}}[Symbol.iterator](){return this.entries()}}function t(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}class r extends Set{constructor(e,t){super(),this[s]={type_:3,parent_:t,scope_:t?t.scope_:n,modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return w(this[s]).size}has(e){let t=this[s];return(i(t),t.copy_)?!!(t.copy_.has(e)||t.drafts_.has(e)&&t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){let t=this[s];return i(t),this.has(e)||(a(t),L(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;let t=this[s];return i(t),a(t),L(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))}clear(){let e=this[s];i(e),w(e).size&&(a(e),L(e),e.copy_.clear())}values(){let e=this[s];return i(e),a(e),e.copy_.values()}entries(){let e=this[s];return i(e),a(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){let r=this.values(),n=r.next();for(;!n.done;)e.call(t,n.value,n.value,this),n=r.next()}}function a(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(l(t)){let r=$(t,e);e.drafts_.set(t,r),e.copy_.add(r)}else e.copy_.add(t)}))}function i(e){e.revoked_&&o(3,JSON.stringify(w(e)))}M.MapSet||(M.MapSet={proxyMap_:function(t,r){return new e(t,r)},proxySet_:function(e,t){return new r(e,t)}})}var Q=new X,T=Q.produce,V=Q.produceWithPatches.bind(Q),Y=Q.setAutoFreeze.bind(Q),Z=Q.setUseStrictShallowCopy.bind(Q),ee=Q.setUseStrictIteration.bind(Q),et=Q.applyPatches.bind(Q),er=Q.createDraft.bind(Q),en=Q.finishDraft.bind(Q);function ea(e){return e}function ei(e){return e}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_HistogramChart=self.chunk_HistogramChart||[]).push([["759"],{64278(e,t,o){o.r(t),o.d(t,{HistogramChart:()=>C});var l=o(62540),n=o(93648),r=o(57072),i=o(43945),a=o(25632),s=o.n(a);let u={unit:"decimal"},d={defaultColor:"#56b4e9"},h={none:{label:"None",log:void 0},2:{label:"2",log:2},10:{label:"10",log:10}},c=Object.entries(h).map(e=>{let[t,o]=e;return{id:t,...o}});var m=o(315),p=o(88091),g=o(74628),v=o(70451),f=o(74653),x=o(96331);function b(e){let{width:t,height:o,data:n,format:i,min:a,max:s,thresholds:u,logBase:d}=e,h=(0,r.useChartsTheme)(),c=(0,v.useMemo)(()=>n.buckets.map(e=>{let[t,o,l,n]=e,r=parseFloat(o),i=parseFloat(l),a=parseFloat(n);if(void 0!==d&&r<=0){if(i<=0)return null;r=.001*i}return{value:[r,i,a,t],itemStyle:{color:function(e,t,o,l){if(null==t?void 0:t.steps){let n=t.steps.map((n,r)=>e>=n.value?n.color??o.thresholds.palette[r]??t.defaultColor??l:null).filter(e=>null!==e);return n[n.length-1]??t.defaultColor??l}return(null==t?void 0:t.defaultColor)??l}(parseFloat(o),u,h,h.echartsTheme[0])}}}).filter(e=>null!==e),[h,n.buckets,d,u]),m=(0,v.useMemo)(()=>{if(void 0===d){if(a)return a;if(c&&c[0]){var e;return Math.min(0,Math.floor((null==(e=c[0])?void 0:e.value[0])??0))}}},[d,a,c]),p=(0,v.useMemo)(()=>{if(s)return s;if(c&&c[c.length-1]){var e;return Math.ceil((null==(e=c[c.length-1])?void 0:e.value[1])??1)}},[s,c]),g=(0,v.useMemo)(()=>{if(!c)return h.noDataOption;let e={scale:!1,min:m,max:p};return void 0!==d&&(e.type="log",e.logBase=d),{title:{show:!1},tooltip:{},xAxis:e,yAxis:(0,r.getFormattedAxis)({},i),series:[{type:"custom",renderItem:function(e,t){var o;let l=t.value(0),n=t.value(1),r=t.value(2),i=t.coord([l,r]),a=t.coord([n,0]),s=null==i?void 0:i[0],u=null==i?void 0:i[1],d=null==a?void 0:a[0],h=null==a?void 0:a[1];if(void 0===s||void 0===u||void 0===d||void 0===h)return null;let c=d-s,m=h-u,p=null==(o=t.style)?void 0:o.call(t);return Number.isFinite(s)&&Number.isFinite(u)&&Number.isFinite(c)&&Number.isFinite(m)?{type:"rect",shape:{x:s,y:u,width:c,height:m},style:p}:null},label:{show:!1},dimensions:["from","to"],encode:{x:[0,1],y:2,tooltip:[0,1],itemName:2},data:c}]}},[h.noDataOption,i,d,p,m,c]);return(0,l.jsx)(r.EChart,{style:{width:t,height:o},sx:{padding:`${h.container.padding.default}px`},option:g,theme:h.echartsTheme})}(0,f.Y)([x.a]);let C={PanelComponent:function(e){let{spec:t,contentDimensions:o,queryResults:n}=e,{min:i,max:a}=t,h=(0,r.useChartsTheme)(),c=s()({},u,t.format),f=s()({},d,t.thresholds),x=(0,v.useMemo)(()=>{let e=[];for(let t of n)for(let o of t.data.series){if(!o.histograms||0===o.histograms.length)continue;let[,t]=o.histograms[0];t&&t.buckets&&e.push({buckets:t.buckets})}return e},[n]);if(0===x.length)return(0,l.jsx)(m.A,{justifyContent:"center",height:"100%",children:(0,l.jsx)(p.A,{variant:"body2",textAlign:"center",children:"No data available (only native histograms are supported for now)"})});if(void 0===o)return null;let C=o.width/x.length-h.container.padding.default;return C<90&&x.length>1&&(C=90),(0,l.jsx)(m.A,{direction:"row",justifyContent:"center",alignItems:"center",sx:{overflowX:x.length>1?"scroll":"auto"},children:x.map((e,n)=>(0,l.jsx)(g.A,{children:(0,l.jsx)(b,{width:C,height:o.height,data:e,format:c,min:i,max:a,thresholds:f,logBase:t.logBase})},`histogram-series-${n}`))})},supportedQueryTypes:["TimeSeriesQuery"],queryOptions:{mode:"instant"},panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:o}=e,a=s()({},u,o.format),m=s()({},d,o.thresholds),p=o.logBase?h[o.logBase]:h.none,g="Enter value";"percent"===a.unit?g="0":"percent-decimal"===a.unit&&(g="0");let v="Enter value";return"percent"===a.unit?v="100":"percent-decimal"===a.unit&&(v="1"),(0,l.jsxs)(r.OptionsEditorGrid,{children:[(0,l.jsx)(r.OptionsEditorColumn,{children:(0,l.jsxs)(r.OptionsEditorGroup,{title:"Misc",children:[(0,l.jsx)(r.FormatControls,{value:a,onChange:e=>{t((0,i.produce)(o,t=>{t.format=e}))}}),(0,l.jsx)(r.OptionsEditorControl,{label:"Min",control:(0,l.jsx)(n.A,{type:"number",value:o.min??"",onChange:e=>{let l=e.target.value?Number(e.target.value):void 0;t((0,i.produce)(o,e=>{e.min=l}))},placeholder:g,sx:{width:"100%"}})}),(0,l.jsx)(r.OptionsEditorControl,{label:"Max",control:(0,l.jsx)(n.A,{type:"number",value:o.max??"",onChange:e=>{let l=e.target.value?Number(e.target.value):void 0;t((0,i.produce)(o,e=>{e.max=l}))},placeholder:v,sx:{width:"100%"}})}),(0,l.jsx)(r.OptionsEditorControl,{label:"Log Base",control:(0,l.jsx)(r.SettingsAutocomplete,{value:{...p,id:(null==p?void 0:p.label)??"None"},options:c,onChange:(e,l)=>{t((0,i.produce)(o,e=>{e.logBase=l.log}))},disableClearable:!0})})]})}),(0,l.jsx)(r.OptionsEditorColumn,{children:(0,l.jsx)(r.ThresholdsEditor,{thresholds:m,onChange:e=>{t((0,i.produce)(o,t=>{t.thresholds=e}))}})})]})}}],createInitialOptions:function(){return{format:u}}}}}]);
@@ -1,40 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "HistogramChart", {
18
- enumerable: true,
19
- get: function() {
20
- return HistogramChart;
21
- }
22
- });
23
- const _components = require("./components");
24
- const _histogramchartmodel = require("./histogram-chart-model");
25
- const HistogramChart = {
26
- PanelComponent: _components.HistogramChartPanel,
27
- supportedQueryTypes: [
28
- 'TimeSeriesQuery'
29
- ],
30
- queryOptions: {
31
- mode: 'instant'
32
- },
33
- panelOptionsEditorComponents: [
34
- {
35
- label: 'Settings',
36
- content: _components.HistogramChartOptionsEditorSettings
37
- }
38
- ],
39
- createInitialOptions: _histogramchartmodel.createInitialHistogramChartOptions
40
- };
@@ -1,26 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- const _jsxruntime = require("react/jsx-runtime");
18
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
19
- const _client = /*#__PURE__*/ _interop_require_default(require("react-dom/client"));
20
- function _interop_require_default(obj) {
21
- return obj && obj.__esModule ? obj : {
22
- default: obj
23
- };
24
- }
25
- const root = _client.default.createRoot(document.getElementById('root'));
26
- root.render(/*#__PURE__*/ (0, _jsxruntime.jsx)(_react.default.StrictMode, {}));
@@ -1,207 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "HistogramChart", {
18
- enumerable: true,
19
- get: function() {
20
- return HistogramChart;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _react = require("react");
25
- const _components = require("@perses-dev/components");
26
- const _core = require("echarts/core");
27
- const _charts = require("echarts/charts");
28
- const _utils = require("../utils");
29
- (0, _core.use)([
30
- _charts.CustomChart
31
- ]);
32
- function HistogramChart({ width, height, data, format, min, max, thresholds, logBase }) {
33
- const chartsTheme = (0, _components.useChartsTheme)();
34
- const transformedData = (0, _react.useMemo)(()=>{
35
- return data.buckets.map(([bucket, lowerBound, upperBound, count])=>{
36
- let lower = parseFloat(lowerBound);
37
- const upper = parseFloat(upperBound);
38
- const countValue = parseFloat(count);
39
- // For logarithmic scales, we need to handle non-positive lower bounds
40
- // since log(0) and log(negative) are undefined
41
- if (logBase !== undefined && lower <= 0) {
42
- // Skip buckets that would be entirely non-positive on a log scale
43
- if (upper <= 0) {
44
- return null;
45
- }
46
- // For buckets that span from 0 (or negative) to positive,
47
- // use a small fraction of the upper bound as the lower bound
48
- // This ensures the bucket is still visible on the log scale
49
- lower = upper * 0.001; // Use 0.1% of upper bound as minimum
50
- }
51
- return {
52
- value: [
53
- lower,
54
- upper,
55
- countValue,
56
- bucket
57
- ],
58
- itemStyle: {
59
- color: (0, _utils.getColorFromThresholds)(parseFloat(lowerBound), thresholds, chartsTheme, chartsTheme.echartsTheme[0])
60
- }
61
- };
62
- }).filter((item)=>item !== null);
63
- }, [
64
- chartsTheme,
65
- data.buckets,
66
- logBase,
67
- thresholds
68
- ]);
69
- const minXAxis = (0, _react.useMemo)(()=>{
70
- if (logBase !== undefined) {
71
- // For logarithmic scales, let ECharts auto-calculate the range based on data
72
- // to avoid issues with non-positive values
73
- return undefined;
74
- }
75
- if (min) {
76
- return min;
77
- }
78
- if (transformedData && transformedData[0]) {
79
- return Math.min(0, Math.floor(transformedData[0]?.value[0] ?? 0));
80
- }
81
- return undefined;
82
- }, [
83
- logBase,
84
- min,
85
- transformedData
86
- ]);
87
- const maxXAxis = (0, _react.useMemo)(()=>{
88
- if (max) {
89
- return max;
90
- }
91
- if (transformedData && transformedData[transformedData.length - 1]) {
92
- return Math.ceil(transformedData[transformedData.length - 1]?.value[1] ?? 1);
93
- }
94
- return undefined;
95
- }, [
96
- max,
97
- transformedData
98
- ]);
99
- const option = (0, _react.useMemo)(()=>{
100
- if (!transformedData) return chartsTheme.noDataOption;
101
- // Build xAxis configuration based on whether logarithmic scale is requested
102
- const xAxisConfig = {
103
- scale: false,
104
- min: minXAxis,
105
- max: maxXAxis
106
- };
107
- // Apply logarithmic scale settings if requested
108
- if (logBase !== undefined) {
109
- xAxisConfig.type = 'log';
110
- xAxisConfig.logBase = logBase;
111
- }
112
- return {
113
- title: {
114
- show: false
115
- },
116
- tooltip: {},
117
- xAxis: xAxisConfig,
118
- yAxis: (0, _components.getFormattedAxis)({}, format),
119
- series: [
120
- {
121
- type: 'custom',
122
- renderItem: function(params, api) {
123
- const lowerBound = api.value(0);
124
- const upperBound = api.value(1);
125
- const yValue = api.value(2);
126
- // Get the pixel coordinates for the start and end points of the bar
127
- const startCoord = api.coord([
128
- lowerBound,
129
- yValue
130
- ]);
131
- const endCoord = api.coord([
132
- upperBound,
133
- 0
134
- ]);
135
- // Extract coordinates with safety checks
136
- const startX = startCoord?.[0];
137
- const startY = startCoord?.[1];
138
- const endX = endCoord?.[0];
139
- const endY = endCoord?.[1];
140
- // Check if coordinates are valid before proceeding
141
- if (startX === undefined || startY === undefined || endX === undefined || endY === undefined) {
142
- return null;
143
- }
144
- // For logarithmic scales, api.size() doesn't work correctly because
145
- // the visual width isn't linear. Instead, we calculate the width
146
- // directly from the pixel coordinates.
147
- const barWidth = endX - startX;
148
- const barHeight = endY - startY;
149
- const style = api.style?.();
150
- // Skip rendering if coordinates are invalid (can happen with log scale edge cases)
151
- if (!Number.isFinite(startX) || !Number.isFinite(startY) || !Number.isFinite(barWidth) || !Number.isFinite(barHeight)) {
152
- return null;
153
- }
154
- return {
155
- type: 'rect',
156
- shape: {
157
- x: startX,
158
- y: startY,
159
- width: barWidth,
160
- height: barHeight
161
- },
162
- style: style
163
- };
164
- },
165
- label: {
166
- show: false
167
- },
168
- dimensions: [
169
- 'from',
170
- 'to'
171
- ],
172
- encode: {
173
- x: [
174
- 0,
175
- 1
176
- ],
177
- y: 2,
178
- tooltip: [
179
- 0,
180
- 1
181
- ],
182
- itemName: 2
183
- },
184
- data: transformedData
185
- }
186
- ]
187
- };
188
- }, [
189
- chartsTheme.noDataOption,
190
- format,
191
- logBase,
192
- maxXAxis,
193
- minXAxis,
194
- transformedData
195
- ]);
196
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.EChart, {
197
- style: {
198
- width: width,
199
- height: height
200
- },
201
- sx: {
202
- padding: `${chartsTheme.container.padding.default}px`
203
- },
204
- option: option,
205
- theme: chartsTheme.echartsTheme
206
- });
207
- }
@@ -1,138 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "HistogramChartOptionsEditorSettings", {
18
- enumerable: true,
19
- get: function() {
20
- return HistogramChartOptionsEditorSettings;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _components = require("@perses-dev/components");
26
- const _immer = require("immer");
27
- const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
28
- const _histogramchartmodel = require("../histogram-chart-model");
29
- function _interop_require_default(obj) {
30
- return obj && obj.__esModule ? obj : {
31
- default: obj
32
- };
33
- }
34
- function HistogramChartOptionsEditorSettings(props) {
35
- const { onChange, value } = props;
36
- const handleUnitChange = (newFormat)=>{
37
- onChange((0, _immer.produce)(value, (draft)=>{
38
- draft.format = newFormat;
39
- }));
40
- };
41
- const handleThresholdsChange = (thresholds)=>{
42
- onChange((0, _immer.produce)(value, (draft)=>{
43
- draft.thresholds = thresholds;
44
- }));
45
- };
46
- // ensures decimalPlaces defaults to correct value
47
- const format = (0, _merge.default)({}, _histogramchartmodel.DEFAULT_FORMAT, value.format);
48
- const thresholds = (0, _merge.default)({}, _histogramchartmodel.DEFAULT_THRESHOLDS, value.thresholds);
49
- // Get the current log base configuration
50
- const logBase = value.logBase ? _histogramchartmodel.LOG_BASE_CONFIG[value.logBase] : _histogramchartmodel.LOG_BASE_CONFIG['none'];
51
- // max only needs to be set explicitly for units other than percent and percent-decimal
52
- let minPlaceholder = 'Enter value';
53
- if (format.unit === 'percent') {
54
- minPlaceholder = _histogramchartmodel.DEFAULT_MIN_PERCENT.toString();
55
- } else if (format.unit === 'percent-decimal') {
56
- minPlaceholder = _histogramchartmodel.DEFAULT_MIN_PERCENT_DECIMAL.toString();
57
- }
58
- // max only needs to be set explicitly for units other than percent and percent-decimal
59
- let maxPlaceholder = 'Enter value';
60
- if (format.unit === 'percent') {
61
- maxPlaceholder = _histogramchartmodel.DEFAULT_MAX_PERCENT.toString();
62
- } else if (format.unit === 'percent-decimal') {
63
- maxPlaceholder = _histogramchartmodel.DEFAULT_MAX_PERCENT_DECIMAL.toString();
64
- }
65
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGrid, {
66
- children: [
67
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
68
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGroup, {
69
- title: "Misc",
70
- children: [
71
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.FormatControls, {
72
- value: format,
73
- onChange: handleUnitChange
74
- }),
75
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
76
- label: "Min",
77
- control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
78
- type: "number",
79
- value: value.min ?? '',
80
- onChange: (e)=>{
81
- // ensure empty value resets to undef to allow chart to calculate max
82
- const newValue = e.target.value ? Number(e.target.value) : undefined;
83
- onChange((0, _immer.produce)(value, (draft)=>{
84
- draft.min = newValue;
85
- }));
86
- },
87
- placeholder: minPlaceholder,
88
- sx: {
89
- width: '100%'
90
- }
91
- })
92
- }),
93
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
94
- label: "Max",
95
- control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
96
- type: "number",
97
- value: value.max ?? '',
98
- onChange: (e)=>{
99
- // ensure empty value resets to undef to allow chart to calculate max
100
- const newValue = e.target.value ? Number(e.target.value) : undefined;
101
- onChange((0, _immer.produce)(value, (draft)=>{
102
- draft.max = newValue;
103
- }));
104
- },
105
- placeholder: maxPlaceholder,
106
- sx: {
107
- width: '100%'
108
- }
109
- })
110
- }),
111
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
112
- label: "Log Base",
113
- control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.SettingsAutocomplete, {
114
- value: {
115
- ...logBase,
116
- id: logBase?.label ?? 'None'
117
- },
118
- options: _histogramchartmodel.LOG_BASE_OPTIONS,
119
- onChange: (__, newValue)=>{
120
- onChange((0, _immer.produce)(value, (draft)=>{
121
- draft.logBase = newValue.log;
122
- }));
123
- },
124
- disableClearable: true
125
- })
126
- })
127
- ]
128
- })
129
- }),
130
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
131
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ThresholdsEditor, {
132
- thresholds: thresholds,
133
- onChange: handleThresholdsChange
134
- })
135
- })
136
- ]
137
- });
138
- }
@@ -1,104 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "HistogramChartPanel", {
18
- enumerable: true,
19
- get: function() {
20
- return HistogramChartPanel;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
26
- const _react = require("react");
27
- const _components = require("@perses-dev/components");
28
- const _histogramchartmodel = require("../histogram-chart-model");
29
- const _HistogramChart = require("./HistogramChart");
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
35
- const HISTOGRAM_MIN_WIDTH = 90;
36
- function HistogramChartPanel(props) {
37
- const { spec: pluginSpec, contentDimensions, queryResults } = props;
38
- const { min, max } = pluginSpec;
39
- const chartsTheme = (0, _components.useChartsTheme)();
40
- // ensures all default format properties set if undef
41
- const format = (0, _merge.default)({}, _histogramchartmodel.DEFAULT_FORMAT, pluginSpec.format);
42
- const thresholds = (0, _merge.default)({}, _histogramchartmodel.DEFAULT_THRESHOLDS, pluginSpec.thresholds);
43
- const histogramData = (0, _react.useMemo)(()=>{
44
- const histograms = [];
45
- for (const result of queryResults){
46
- for (const timeSeries of result.data.series){
47
- if (!timeSeries.histograms || timeSeries.histograms.length === 0) {
48
- continue;
49
- }
50
- const [, histoBuckets] = timeSeries.histograms[0];
51
- if (histoBuckets && histoBuckets.buckets) {
52
- histograms.push({
53
- buckets: histoBuckets.buckets
54
- });
55
- }
56
- }
57
- }
58
- return histograms;
59
- }, [
60
- queryResults
61
- ]);
62
- // no data message handled inside chart component
63
- if (histogramData.length === 0) {
64
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
65
- justifyContent: "center",
66
- height: "100%",
67
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
68
- variant: "body2",
69
- textAlign: "center",
70
- children: "No data available (only native histograms are supported for now)"
71
- })
72
- });
73
- }
74
- if (contentDimensions === undefined) return null;
75
- // accounts for showing a separate chart for each time series
76
- let chartWidth = contentDimensions.width / histogramData.length - chartsTheme.container.padding.default;
77
- if (chartWidth < HISTOGRAM_MIN_WIDTH && histogramData.length > 1) {
78
- // enables horizontal scroll when charts overflow outside of panel
79
- chartWidth = HISTOGRAM_MIN_WIDTH;
80
- }
81
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
82
- direction: "row",
83
- justifyContent: "center",
84
- alignItems: "center",
85
- sx: {
86
- // so scrollbar only shows when necessary
87
- overflowX: histogramData.length > 1 ? 'scroll' : 'auto'
88
- },
89
- children: histogramData.map((series, seriesIndex)=>{
90
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
91
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HistogramChart.HistogramChart, {
92
- width: chartWidth,
93
- height: contentDimensions.height,
94
- data: series,
95
- format: format,
96
- min: min,
97
- max: max,
98
- thresholds: thresholds,
99
- logBase: pluginSpec.logBase
100
- })
101
- }, `histogram-series-${seriesIndex}`);
102
- })
103
- });
104
- }
@@ -1,32 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./HistogramChartOptionsEditorSettings"), exports);
18
- _export_star(require("./HistogramChartPanel"), exports);
19
- _export_star(require("./HistogramChart"), exports);
20
- function _export_star(from, to) {
21
- Object.keys(from).forEach(function(k) {
22
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
23
- Object.defineProperty(to, k, {
24
- enumerable: true,
25
- get: function() {
26
- return from[k];
27
- }
28
- });
29
- }
30
- });
31
- return from;
32
- }
package/lib/cjs/env.d.js DELETED
@@ -1,14 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- /// <reference types="@rsbuild/core/types" />
14
- "use strict";
@@ -1,39 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the \"License\");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an \"AS IS\" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "getPluginModule", {
18
- enumerable: true,
19
- get: function() {
20
- return getPluginModule;
21
- }
22
- });
23
- const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
24
- function _interop_require_default(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
- function getPluginModule() {
30
- const { name, version, perses } = _packagejson.default;
31
- return {
32
- kind: 'PluginModule',
33
- metadata: {
34
- name,
35
- version
36
- },
37
- spec: perses
38
- };
39
- }