@perses-dev/histogram-chart-plugin 0.11.0-beta.0 → 0.11.0

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 (66) hide show
  1. package/__mf/js/{HistogramChart.6093b28c.js → HistogramChart.f6bd8f08.js} +3 -3
  2. package/__mf/js/async/12.97ac25db.js +2 -0
  3. package/__mf/js/async/161.565de0af.js +144 -0
  4. package/__mf/js/async/392.712ee0cf.js +2 -0
  5. package/__mf/js/async/__federation_expose_HistogramChart.721e2e2a.js +1 -0
  6. package/__mf/js/{main.e8b69fff.js → main.26934b75.js} +3 -3
  7. package/lib/HistogramChart.js +1 -1
  8. package/lib/HistogramChart.js.map +1 -1
  9. package/lib/bootstrap.js +1 -1
  10. package/lib/bootstrap.js.map +1 -1
  11. package/lib/cjs/HistogramChart.js +1 -1
  12. package/lib/cjs/bootstrap.js +1 -1
  13. package/lib/cjs/components/HistogramChart.js +71 -20
  14. package/lib/cjs/components/HistogramChartOptionsEditorSettings.js +19 -1
  15. package/lib/cjs/components/HistogramChartPanel.js +3 -2
  16. package/lib/cjs/components/index.js +1 -1
  17. package/lib/cjs/env.d.js +1 -1
  18. package/lib/cjs/getPluginModule.js +12 -0
  19. package/lib/cjs/histogram-chart-model.js +25 -1
  20. package/lib/cjs/index-federation.js +1 -1
  21. package/lib/cjs/index.js +1 -1
  22. package/lib/cjs/setup-tests.js +1 -1
  23. package/lib/cjs/utils/index.js +1 -1
  24. package/lib/cjs/utils/thresholds.js +12 -0
  25. package/lib/components/HistogramChart.d.ts +3 -1
  26. package/lib/components/HistogramChart.d.ts.map +1 -1
  27. package/lib/components/HistogramChart.js +71 -20
  28. package/lib/components/HistogramChart.js.map +1 -1
  29. package/lib/components/HistogramChartOptionsEditorSettings.d.ts.map +1 -1
  30. package/lib/components/HistogramChartOptionsEditorSettings.js +21 -3
  31. package/lib/components/HistogramChartOptionsEditorSettings.js.map +1 -1
  32. package/lib/components/HistogramChartPanel.d.ts.map +1 -1
  33. package/lib/components/HistogramChartPanel.js +3 -2
  34. package/lib/components/HistogramChartPanel.js.map +1 -1
  35. package/lib/components/index.js +1 -1
  36. package/lib/components/index.js.map +1 -1
  37. package/lib/env.d.js +1 -1
  38. package/lib/env.d.js.map +1 -1
  39. package/lib/getPluginModule.d.ts.map +1 -1
  40. package/lib/getPluginModule.js +12 -0
  41. package/lib/getPluginModule.js.map +1 -1
  42. package/lib/histogram-chart-model.d.ts +11 -0
  43. package/lib/histogram-chart-model.d.ts.map +1 -1
  44. package/lib/histogram-chart-model.js +20 -1
  45. package/lib/histogram-chart-model.js.map +1 -1
  46. package/lib/index-federation.js +1 -1
  47. package/lib/index-federation.js.map +1 -1
  48. package/lib/index.js +1 -1
  49. package/lib/index.js.map +1 -1
  50. package/lib/setup-tests.js +1 -1
  51. package/lib/setup-tests.js.map +1 -1
  52. package/lib/utils/index.js +1 -1
  53. package/lib/utils/index.js.map +1 -1
  54. package/lib/utils/thresholds.d.ts.map +1 -1
  55. package/lib/utils/thresholds.js +12 -0
  56. package/lib/utils/thresholds.js.map +1 -1
  57. package/mf-manifest.json +12 -12
  58. package/mf-stats.json +12 -12
  59. package/package.json +4 -4
  60. package/__mf/js/async/12.41482399.js +0 -2
  61. package/__mf/js/async/392.3fc5b732.js +0 -2
  62. package/__mf/js/async/735.ab58bf74.js +0 -144
  63. package/__mf/js/async/__federation_expose_HistogramChart.da17bbfc.js +0 -1
  64. /package/__mf/js/async/{12.41482399.js.LICENSE.txt → 12.97ac25db.js.LICENSE.txt} +0 -0
  65. /package/__mf/js/async/{735.ab58bf74.js.LICENSE.txt → 161.565de0af.js.LICENSE.txt} +0 -0
  66. /package/__mf/js/async/{392.3fc5b732.js.LICENSE.txt → 392.712ee0cf.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_HistogramChart=self.chunk_HistogramChart||[]).push([["759"],{4278:function(e,t,r){r.r(t),r.d(t,{HistogramChart:()=>x});var o=r(2540),n=r(3648),l=r(8612),i=r(3945),a=r(5632),s=r.n(a);let u={unit:"decimal"},h={defaultColor:"#56b4e9"};var d=r(315),c=r(8091),m=r(4628),p=r(451),f=r(4653),g=r(6331);function v(e){let{width:t,height:r,data:n,format:i,min:a,max:s,thresholds:u}=e,h=(0,l.useChartsTheme)(),d=(0,p.useMemo)(()=>n.buckets.map(e=>{let[t,r,o,n]=e;return{value:[parseFloat(r),parseFloat(o),parseFloat(n),t],itemStyle:{color:function(e,t,r,o){if(null==t?void 0:t.steps){let n=t.steps.map((n,l)=>e>=n.value?n.color??r.thresholds.palette[l]??t.defaultColor??o:null).filter(e=>null!==e);return n[n.length-1]??t.defaultColor??o}return(null==t?void 0:t.defaultColor)??o}(parseFloat(r),u,h,h.echartsTheme[0])}}}),[h,n.buckets,u]),c=(0,p.useMemo)(()=>{if(a)return a;if(d&&d[0]){var e;return Math.min(0,Math.floor((null==(e=d[0])?void 0:e.value[0])??0))}},[a,d]),m=(0,p.useMemo)(()=>{if(s)return s;if(d&&d[d.length-1]){var e;return Math.ceil((null==(e=d[d.length-1])?void 0:e.value[1])??1)}},[s,d]),f=(0,p.useMemo)(()=>d?{title:{show:!1},tooltip:{},xAxis:{scale:!1,min:c,max:m},yAxis:(0,l.getFormattedAxis)({},i),series:[{type:"custom",renderItem:function(e,t){var r,o;let n=t.value(2),l=t.coord([t.value(0),n]),i=null==(r=t.size)?void 0:r.call(t,[t.value(1)-t.value(0),n]),a=null==(o=t.style)?void 0:o.call(t);return{type:"rect",shape:{x:l[0],y:l[1],width:i[0],height:i[1]},style:a}},label:{show:!1},dimensions:["from","to"],encode:{x:[0,1],y:2,tooltip:[0,1],itemName:2},data:d}]}:h.noDataOption,[h.noDataOption,i,m,c,d]);return(0,o.jsx)(l.EChart,{style:{width:t,height:r},sx:{padding:`${h.container.padding.default}px`},option:f,theme:h.echartsTheme})}(0,f.Y)([g.a]);let x={PanelComponent:function(e){let{spec:t,contentDimensions:r,queryResults:n}=e,{min:i,max:a}=t,f=(0,l.useChartsTheme)(),g=s()({},u,t.format),x=s()({},h,t.thresholds),C=(0,p.useMemo)(()=>{let e=[];for(let t of n)for(let r of t.data.series){if(!r.histograms||0===r.histograms.length)continue;let[,t]=r.histograms[0];t&&t.buckets&&e.push({buckets:t.buckets})}return e},[n]);if(0===C.length)return(0,o.jsx)(d.A,{justifyContent:"center",height:"100%",children:(0,o.jsx)(c.A,{variant:"body2",textAlign:"center",children:"No data available (only native histograms are supported for now)"})});if(void 0===r)return null;let y=r.width/C.length-f.container.padding.default;return y<90&&C.length>1&&(y=90),(0,o.jsx)(d.A,{direction:"row",justifyContent:"center",alignItems:"center",sx:{overflowX:C.length>1?"scroll":"auto"},children:C.map((e,t)=>(0,o.jsx)(m.A,{children:(0,o.jsx)(v,{width:y,height:r.height,data:e,format:g,min:i,max:a,thresholds:x})},`histogram-series-${t}`))})},supportedQueryTypes:["TimeSeriesQuery"],queryOptions:{mode:"instant"},panelOptionsEditorComponents:[{label:"Settings",content:function(e){let{onChange:t,value:r}=e,a=s()({},u,r.format),d=s()({},h,r.thresholds),c="Enter value";"percent"===a.unit?c="0":"percent-decimal"===a.unit&&(c="0");let m="Enter value";return"percent"===a.unit?m="100":"percent-decimal"===a.unit&&(m="1"),(0,o.jsxs)(l.OptionsEditorGrid,{children:[(0,o.jsx)(l.OptionsEditorColumn,{children:(0,o.jsxs)(l.OptionsEditorGroup,{title:"Misc",children:[(0,o.jsx)(l.FormatControls,{value:a,onChange:e=>{t((0,i.produce)(r,t=>{t.format=e}))}}),(0,o.jsx)(l.OptionsEditorControl,{label:"Min",control:(0,o.jsx)(n.A,{type:"number",value:r.min??"",onChange:e=>{let o=e.target.value?Number(e.target.value):void 0;t((0,i.produce)(r,e=>{e.min=o}))},placeholder:c,sx:{width:"100%"}})}),(0,o.jsx)(l.OptionsEditorControl,{label:"Max",control:(0,o.jsx)(n.A,{type:"number",value:r.max??"",onChange:e=>{let o=e.target.value?Number(e.target.value):void 0;t((0,i.produce)(r,e=>{e.max=o}))},placeholder:m,sx:{width:"100%"}})})]})}),(0,o.jsx)(l.OptionsEditorColumn,{children:(0,o.jsx)(l.ThresholdsEditor,{thresholds:d,onChange:e=>{t((0,i.produce)(r,t=>{t.thresholds=e}))}})})]})}}],createInitialOptions:function(){return{format:u}}}}}]);