@kyndryl-design-system/shidoka-charts 2.3.0 → 2.4.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.
- package/common/config/chartTypes/boxplot.js +2 -0
- package/common/config/chartTypes/boxplot.js.map +1 -0
- package/common/config/chartTypes/matrix.js +1 -1
- package/common/config/chartTypes/matrix.js.map +1 -1
- package/common/config/chartTypes/violin.js +2 -0
- package/common/config/chartTypes/violin.js.map +1 -0
- package/common/config/globalOptions.js +1 -1
- package/common/config/globalOptions.js.map +1 -1
- package/common/config/globalOptionsNonRadial.js +1 -1
- package/common/config/globalOptionsNonRadial.js.map +1 -1
- package/common/config/globalOptionsRadial.js +1 -1
- package/common/config/globalOptionsRadial.js.map +1 -1
- package/common/helpers/boxplotViolinTableRenderer.d.ts +4 -0
- package/common/helpers/boxplotViolinTableRenderer.d.ts.map +1 -0
- package/common/helpers/boxplotViolinTableRenderer.js +52 -0
- package/common/helpers/boxplotViolinTableRenderer.js.map +1 -0
- package/components/chart/chart.d.ts.map +1 -1
- package/components/chart/chart.js +11 -11
- package/components/chart/chart.js.map +1 -1
- package/external/@sgratzl/boxplots/build/index.js +2 -0
- package/external/@sgratzl/boxplots/build/index.js.map +1 -0
- package/external/@sgratzl/chartjs-chart-boxplot/build/index.js +2 -0
- package/external/@sgratzl/chartjs-chart-boxplot/build/index.js.map +1 -0
- package/external/chart.js/dist/chart.js +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getComputedColorPalette as o}from"../colorPalettes.js";const r="boxplot",t=o=>{const r="y"===o.options.indexAxis;return{...{scales:{x:{grid:{display:r}},y:{grid:{display:!r}}},plugins:{legend:{display:!0,position:"bottom"},tooltip:{enabled:!0,callbacks:{title:o=>{const t=r?o[0].chart.options.scales.y.title?.text:o[0].chart.options.scales.x.title?.text;return t?t+": "+o[0].label:o[0].label}}}}},...o.options||{}}},e=(r,t)=>{const{colorPalette:e="categorical",backgroundAlpha:l="80",borderWidth:a=1,outlierStyle:i="circle",outlierRadius:d=3,outlierBorderWidth:n=1,itemStyle:s="circle",itemRadius:c=0,itemBorderWidth:u=0,lowerBackgroundAlpha:h="80",upperBackgroundAlpha:p="80",datasetOptionsOverride:m={}}=r.options,g=o(e),B=Math.floor(t/(g.length-1)),y=g[t>g.length-1?t-(g.length-1)*B:t];return{backgroundColor:y+l,borderColor:y,borderWidth:a,outlierStyle:i,outlierRadius:d,outlierBorderWidth:n,outlierBackgroundColor:y+l,outlierBorderColor:y,medianColor:y,meanStyle:"circle",meanRadius:3,meanBorderWidth:a,meanBackgroundColor:y+l,meanBorderColor:y,itemStyle:s,itemRadius:c,itemBorderWidth:u,lowerBackgroundColor:y+h,upperBackgroundColor:y+p,...m}},l=(o,r,t,e=0)=>{const l=Array.from({length:o},(()=>Math.floor(Math.random()*(t-r)+r))).sort(((o,r)=>o-r));if(e>0)for(let o=0;o<e;o++)Math.random()>.5?l.push(t+Math.floor(Math.random()*t*.5)):l.unshift(Math.max(0,r-Math.floor(Math.random()*r*.5)));return l};export{e as datasetOptions,l as generateRandomData,t as options,r as type};
|
|
2
|
+
//# sourceMappingURL=boxplot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplot.js","sources":["../../../../src/common/config/chartTypes/boxplot.js"],"sourcesContent":["import { getComputedColorPalette } from '../colorPalettes';\n\nexport const type = 'boxplot';\n\nexport const options = (ctx) => {\n const horizontal = ctx.options.indexAxis === 'y';\n\n const defaultOptions = {\n scales: {\n x: {\n grid: { display: horizontal },\n },\n y: {\n grid: { display: !horizontal },\n },\n },\n plugins: {\n legend: {\n display: true,\n position: 'bottom',\n },\n tooltip: {\n enabled: true,\n callbacks: {\n title: (items) => {\n const axisLabel = horizontal\n ? items[0].chart.options.scales.y.title?.text\n : items[0].chart.options.scales.x.title?.text;\n return axisLabel\n ? axisLabel + ': ' + items[0].label\n : items[0].label;\n },\n },\n },\n },\n };\n\n return {\n ...defaultOptions,\n ...(ctx.options || {}),\n };\n};\n\nexport const datasetOptions = (ctx, index) => {\n const {\n colorPalette = 'categorical',\n backgroundAlpha = '80',\n borderWidth = 1,\n outlierStyle = 'circle',\n outlierRadius = 3,\n outlierBorderWidth = 1,\n itemStyle = 'circle',\n itemRadius = 0,\n itemBorderWidth = 0,\n lowerBackgroundAlpha = '80',\n upperBackgroundAlpha = '80',\n datasetOptionsOverride = {},\n } = ctx.options;\n\n const palette = getComputedColorPalette(colorPalette);\n const cycles = Math.floor(index / (palette.length - 1));\n const idx =\n index > palette.length - 1 ? index - (palette.length - 1) * cycles : index;\n const color = palette[idx];\n\n return {\n backgroundColor: color + backgroundAlpha,\n borderColor: color,\n borderWidth,\n outlierStyle,\n outlierRadius,\n outlierBorderWidth,\n outlierBackgroundColor: color + backgroundAlpha,\n outlierBorderColor: color,\n medianColor: color,\n meanStyle: 'circle',\n meanRadius: 3,\n meanBorderWidth: borderWidth,\n meanBackgroundColor: color + backgroundAlpha,\n meanBorderColor: color,\n itemStyle,\n itemRadius,\n itemBorderWidth,\n lowerBackgroundColor: color + lowerBackgroundAlpha,\n upperBackgroundColor: color + upperBackgroundAlpha,\n ...datasetOptionsOverride,\n };\n};\n\nexport const generateRandomData = (count, min, max, outliers = 0) => {\n const values = Array.from({ length: count }, () =>\n Math.floor(Math.random() * (max - min) + min)\n ).sort((a, b) => a - b);\n\n if (outliers > 0) {\n for (let i = 0; i < outliers; i++) {\n if (Math.random() > 0.5) {\n values.push(max + Math.floor(Math.random() * max * 0.5));\n } else {\n values.unshift(\n Math.max(0, min - Math.floor(Math.random() * min * 0.5))\n );\n }\n }\n }\n\n return values;\n};\n"],"names":["type","options","ctx","horizontal","indexAxis","scales","x","grid","display","y","plugins","legend","position","tooltip","enabled","callbacks","title","items","axisLabel","chart","text","label","datasetOptions","index","colorPalette","backgroundAlpha","borderWidth","outlierStyle","outlierRadius","outlierBorderWidth","itemStyle","itemRadius","itemBorderWidth","lowerBackgroundAlpha","upperBackgroundAlpha","datasetOptionsOverride","palette","getComputedColorPalette","cycles","Math","floor","length","color","backgroundColor","borderColor","outlierBackgroundColor","outlierBorderColor","medianColor","meanStyle","meanRadius","meanBorderWidth","meanBackgroundColor","meanBorderColor","lowerBackgroundColor","upperBackgroundColor","generateRandomData","count","min","max","outliers","values","Array","from","random","sort","a","b","i","push","unshift"],"mappings":"8DAEY,MAACA,EAAO,UAEPC,EAAWC,IACtB,MAAMC,EAAuC,MAA1BD,EAAID,QAAQG,UAgC/B,MAAO,IA9BgB,CACrBC,OAAQ,CACNC,EAAG,CACDC,KAAM,CAAEC,QAASL,IAEnBM,EAAG,CACDF,KAAM,CAAEC,SAAUL,KAGtBO,QAAS,CACPC,OAAQ,CACNH,SAAS,EACTI,SAAU,UAEZC,QAAS,CACPC,SAAS,EACTC,UAAW,CACTC,MAAQC,IACN,MAAMC,EAAYf,EACdc,EAAM,GAAGE,MAAMlB,QAAQI,OAAOI,EAAEO,OAAOI,KACvCH,EAAM,GAAGE,MAAMlB,QAAQI,OAAOC,EAAEU,OAAOI,KAC3C,OAAOF,EACHA,EAAY,KAAOD,EAAM,GAAGI,MAC5BJ,EAAM,GAAGI,KAAK,SAStBnB,EAAID,SAAW,GACpB,EAGUqB,EAAiB,CAACpB,EAAKqB,KAClC,MAAMC,aACJA,EAAe,cAAaC,gBAC5BA,EAAkB,KAAIC,YACtBA,EAAc,EAACC,aACfA,EAAe,SAAQC,cACvBA,EAAgB,EAACC,mBACjBA,EAAqB,EAACC,UACtBA,EAAY,SAAQC,WACpBA,EAAa,EAACC,gBACdA,EAAkB,EAACC,qBACnBA,EAAuB,KAAIC,qBAC3BA,EAAuB,KAAIC,uBAC3BA,EAAyB,CAAE,GACzBjC,EAAID,QAEFmC,EAAUC,EAAwBb,GAClCc,EAASC,KAAKC,MAAMjB,GAASa,EAAQK,OAAS,IAG9CC,EAAQN,EADZb,EAAQa,EAAQK,OAAS,EAAIlB,GAASa,EAAQK,OAAS,GAAKH,EAASf,GAGvE,MAAO,CACLoB,gBAAiBD,EAAQjB,EACzBmB,YAAaF,EACbhB,cACAC,eACAC,gBACAC,qBACAgB,uBAAwBH,EAAQjB,EAChCqB,mBAAoBJ,EACpBK,YAAaL,EACbM,UAAW,SACXC,WAAY,EACZC,gBAAiBxB,EACjByB,oBAAqBT,EAAQjB,EAC7B2B,gBAAiBV,EACjBZ,YACAC,aACAC,kBACAqB,qBAAsBX,EAAQT,EAC9BqB,qBAAsBZ,EAAQR,KAC3BC,EACJ,EAGUoB,EAAqB,CAACC,EAAOC,EAAKC,EAAKC,EAAW,KAC7D,MAAMC,EAASC,MAAMC,KAAK,CAAErB,OAAQe,IAAS,IAC3CjB,KAAKC,MAAMD,KAAKwB,UAAYL,EAAMD,GAAOA,KACzCO,MAAK,CAACC,EAAGC,IAAMD,EAAIC,IAErB,GAAIP,EAAW,EACb,IAAK,IAAIQ,EAAI,EAAGA,EAAIR,EAAUQ,IACxB5B,KAAKwB,SAAW,GAClBH,EAAOQ,KAAKV,EAAMnB,KAAKC,MAAMD,KAAKwB,SAAWL,EAAM,KAEnDE,EAAOS,QACL9B,KAAKmB,IAAI,EAAGD,EAAMlB,KAAKC,MAAMD,KAAKwB,SAAWN,EAAM,MAM3D,OAAOG,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getComputedColorPalette as t}from"../colorPalettes.js";const e="matrix",i=(t,e={})=>{const{xAxis:i,yAxis:l,xKey:o="x",yKey:a="y",valueKey:n="value"}=e;if(!(i&&l&&Array.isArray(i)&&Array.isArray(l)))throw new Error("xAxis and yAxis must be provided as arrays");const r=[],s=new Map;t.forEach((t=>{const e=`${t[o]}-${t[a]}`;s.set(e,t[n])}));for(let t=1;t<=l.length;t++)for(let e=1;e<=i.length;e++){const o=l[t-1],a=`${i[e-1]}-${o}`,n=s.has(a)?s.get(a):void 0;r.push({x:e,y:t,value:n})}return r};let l=!1;function o(t){l=!!t}function a(){return!!l||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullscreenElement||document.msFullscreenElement)}function n(t,e){if(!t||"string"!=typeof t||!t.startsWith("#"))return`rgba(204, 204, 204, ${isNaN(e)?.7:e})`;const i=isNaN(e)?.7:e,{r:l,g:o,b:a}=function(t){if(!t||"string"!=typeof t||!t.startsWith("#")||t.length<7)return{r:0,g:0,b:0};const e=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return{r:isNaN(e)?0:e,g:isNaN(i)?0:i,b:isNaN(l)?0:l}}(t);return`rgba(${l}, ${o}, ${a}, ${i})`}function r(t,e,i=50,l=15,o=1,a){if(!e||!Array.isArray(e)||0===e.length)return`rgba(204, 204, 204, ${o})`;if((a||"").toLowerCase().includes("divergent")){const i=-100,l=100,a=Math.floor(e.length/2);if(t<=0){const l=(t-i)/(0-i),r=Math.round(l*a);return n(e[Math.min(r,a)],o)}{const i=t/l,r=a+Math.round(i*(e.length-a-1));return n(e[Math.min(r,e.length-1)],o)}}{const i=0,l=(t-i)/(100-i),a=Math.round(l*(e.length-1));return n(e[Math.min(a,e.length-1)],o)}}const s={id:"gradientLegend",afterDraw(t,e,i){if(!i||!i.display)return;const l=i.colors||t.options.plugins?.gradientLegend?.colors||t.options.colorScale?.colors||t.data?.datasets?.[0]?._colorPalette;if(!l||!l.length)return;const o=t.ctx,a=t.chartArea,r=(i.paletteKey||"").toLowerCase().includes("divergent"),s=t.options.colorScale||{},c=s.min??(r?-100:0),d=s.neutral??(r?0:50),g=s.max??100,h={position:i.position||"bottom",width:i.width||Math.min(400,.8*a.width),height:i.height||20,margin:i.margin||10,borderRadius:i.borderRadius||4,gradientBorderRadius:1,title:i.title||"",titleFontSize:i.titleFontSize||12,labelFontSize:i.labelFontSize||12,labelMargin:i.labelMargin||5,opacity:"number"==typeof i.opacity?i.opacity:.7,...i};let u,p;"bottom"===h.position?(u=a.left+(a.width-h.width)/2,p=a.bottom+h.margin):"top"===h.position?(u=a.left+(a.width-h.width)/2,p=a.top-h.margin-h.height):"bottom-left"===h.position?(u=a.left-70,p=a.bottom+70):(u=a.left+(a.width-h.width)/2,p=a.bottom+h.margin);const f=o.createLinearGradient(u,p,u+h.width,p),b=l.findIndex((t=>t.toLowerCase().includes("neutral")));if(b>0){const t=l.slice(0,b),e=l[b],i=l.slice(b+1);t.forEach(((e,i)=>{const l=t.length>1?i/(t.length-1)*.5:0;f.addColorStop(l,n(e,h.opacity))})),f.addColorStop(.5,n(e,h.opacity)),i.forEach(((t,e)=>{const l=.5+(i.length>1?e/(i.length-1)*.5:0);f.addColorStop(l,n(t,h.opacity))}))}else l.forEach(((t,e)=>{f.addColorStop(e/(l.length-1),n(t,h.opacity))}));function m(t,e,i,l,a){o.beginPath(),o.moveTo(t+a,e),o.lineTo(t+i-a,e),o.arcTo(t+i,e,t+i,e+a,a),o.lineTo(t+i,e+l-a),o.arcTo(t+i,e+l,t+i-a,e+l,a),o.lineTo(t+a,e+l),o.arcTo(t,e+l,t,e+l-a,a),o.lineTo(t,e+a),o.arcTo(t,e,t+a,e,a),o.closePath()}h.title&&(o.font=`500 ${h.titleFontSize}px ${t.options.font?.family||"Arial"}`,o.textAlign="left",o.textBaseline="bottom",o.fillStyle=t.options.color||"#666",o.fillText(h.title,u,p-h.labelMargin)),o.fillStyle="#fff",m(u,p,h.width,h.height,h.borderRadius),o.fill(),o.fillStyle=f,m(u,p,h.width,h.height,h.gradientBorderRadius),o.fill(),o.font=`${h.labelFontSize}px ${t.options.font?.family||"Arial"}`,o.fillStyle=t.options.color||"#666";const y=t=>t.toString();o.textAlign="left",o.textBaseline="top",o.fillText(y(c),u,p+h.height+h.labelMargin),l.length>=3&&void 0!==d&&(o.textAlign="center",o.fillText(y(d),u+h.width/2,p+h.height+h.labelMargin)),o.textAlign="right",o.fillText(y(g),u+h.width,p+h.height+h.labelMargin)}},c=e=>{const i=e?.datasets?.[0],l=(i?.data??[]).map((t=>"number"==typeof t.value?t.value:void 0)).filter((t=>void 0!==t)),o=e.options?.colorPalette||"sequential02",n=t(o),r=l.length?Math.min(...l):0,s=l.length?Math.max(...l):0,c=o.toLowerCase().includes("divergent")?0:50,d=e.options?.plugins?.gradientLegend?.display;return{responsive:!1,maintainAspectRatio:!0,aspectRatio:2,layout:{padding:d?{bottom:
|
|
1
|
+
import{getComputedColorPalette as t}from"../colorPalettes.js";const e="matrix",i=(t,e={})=>{const{xAxis:i,yAxis:l,xKey:o="x",yKey:a="y",valueKey:n="value"}=e;if(!(i&&l&&Array.isArray(i)&&Array.isArray(l)))throw new Error("xAxis and yAxis must be provided as arrays");const r=[],s=new Map;t.forEach((t=>{const e=`${t[o]}-${t[a]}`;s.set(e,t[n])}));for(let t=1;t<=l.length;t++)for(let e=1;e<=i.length;e++){const o=l[t-1],a=`${i[e-1]}-${o}`,n=s.has(a)?s.get(a):void 0;r.push({x:e,y:t,value:n})}return r};let l=!1;function o(t){l=!!t}function a(){return!!l||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullscreenElement||document.msFullscreenElement)}function n(t,e){if(!t||"string"!=typeof t||!t.startsWith("#"))return`rgba(204, 204, 204, ${isNaN(e)?.7:e})`;const i=isNaN(e)?.7:e,{r:l,g:o,b:a}=function(t){if(!t||"string"!=typeof t||!t.startsWith("#")||t.length<7)return{r:0,g:0,b:0};const e=parseInt(t.slice(1,3),16),i=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return{r:isNaN(e)?0:e,g:isNaN(i)?0:i,b:isNaN(l)?0:l}}(t);return`rgba(${l}, ${o}, ${a}, ${i})`}function r(t,e,i=50,l=15,o=1,a){if(!e||!Array.isArray(e)||0===e.length)return`rgba(204, 204, 204, ${o})`;if((a||"").toLowerCase().includes("divergent")){const i=-100,l=100,a=Math.floor(e.length/2);if(t<=0){const l=(t-i)/(0-i),r=Math.round(l*a);return n(e[Math.min(r,a)],o)}{const i=t/l,r=a+Math.round(i*(e.length-a-1));return n(e[Math.min(r,e.length-1)],o)}}{const i=0,l=(t-i)/(100-i),a=Math.round(l*(e.length-1));return n(e[Math.min(a,e.length-1)],o)}}const s={id:"gradientLegend",afterDraw(t,e,i){if(!i||!i.display)return;const l=i.colors||t.options.plugins?.gradientLegend?.colors||t.options.colorScale?.colors||t.data?.datasets?.[0]?._colorPalette;if(!l||!l.length)return;const o=t.ctx,a=t.chartArea,r=(i.paletteKey||"").toLowerCase().includes("divergent"),s=t.options.colorScale||{},c=s.min??(r?-100:0),d=s.neutral??(r?0:50),g=s.max??100,h={position:i.position||"bottom",width:i.width||Math.min(400,.8*a.width),height:i.height||20,margin:i.margin||10,borderRadius:i.borderRadius||4,gradientBorderRadius:1,title:i.title||"",titleFontSize:i.titleFontSize||12,labelFontSize:i.labelFontSize||12,labelMargin:i.labelMargin||5,opacity:"number"==typeof i.opacity?i.opacity:.7,...i};let u,p;"bottom"===h.position?(u=a.left+(a.width-h.width)/2,p=a.bottom+h.margin):"top"===h.position?(u=a.left+(a.width-h.width)/2,p=a.top-h.margin-h.height):"bottom-left"===h.position?(u=a.left-70,p=a.bottom+70):(u=a.left+(a.width-h.width)/2,p=a.bottom+h.margin);const f=o.createLinearGradient(u,p,u+h.width,p),b=l.findIndex((t=>t.toLowerCase().includes("neutral")));if(b>0){const t=l.slice(0,b),e=l[b],i=l.slice(b+1);t.forEach(((e,i)=>{const l=t.length>1?i/(t.length-1)*.5:0;f.addColorStop(l,n(e,h.opacity))})),f.addColorStop(.5,n(e,h.opacity)),i.forEach(((t,e)=>{const l=.5+(i.length>1?e/(i.length-1)*.5:0);f.addColorStop(l,n(t,h.opacity))}))}else l.forEach(((t,e)=>{f.addColorStop(e/(l.length-1),n(t,h.opacity))}));function m(t,e,i,l,a){o.beginPath(),o.moveTo(t+a,e),o.lineTo(t+i-a,e),o.arcTo(t+i,e,t+i,e+a,a),o.lineTo(t+i,e+l-a),o.arcTo(t+i,e+l,t+i-a,e+l,a),o.lineTo(t+a,e+l),o.arcTo(t,e+l,t,e+l-a,a),o.lineTo(t,e+a),o.arcTo(t,e,t+a,e,a),o.closePath()}h.title&&(o.font=`500 ${h.titleFontSize}px ${t.options.font?.family||"Arial"}`,o.textAlign="left",o.textBaseline="bottom",o.fillStyle=t.options.color||"#666",o.fillText(h.title,u,p-h.labelMargin)),o.fillStyle="#fff",m(u,p,h.width,h.height,h.borderRadius),o.fill(),o.fillStyle=f,m(u,p,h.width,h.height,h.gradientBorderRadius),o.fill(),o.font=`${h.labelFontSize}px ${t.options.font?.family||"Arial"}`,o.fillStyle=t.options.color||"#666";const y=t=>t.toString();o.textAlign="left",o.textBaseline="top",o.fillText(y(c),u,p+h.height+h.labelMargin),l.length>=3&&void 0!==d&&(o.textAlign="center",o.fillText(y(d),u+h.width/2,p+h.height+h.labelMargin)),o.textAlign="right",o.fillText(y(g),u+h.width,p+h.height+h.labelMargin)}},c=e=>{const i=e?.datasets?.[0],l=(i?.data??[]).map((t=>"number"==typeof t.value?t.value:void 0)).filter((t=>void 0!==t)),o=e.options?.colorPalette||"sequential02",n=t(o),r=l.length?Math.min(...l):0,s=l.length?Math.max(...l):0,c=o.toLowerCase().includes("divergent")?0:50,d=e.options?.plugins?.gradientLegend?.display;return{responsive:!1,maintainAspectRatio:!0,aspectRatio:2,layout:{padding:d?{bottom:35}:{bottom:0}},plugins:{tooltip:{callbacks:{title:()=>"",label(t){const i=t.dataset.data[t.dataIndex];return[`${e.labels.y?.[i.y-1]||e.labels[i.y-1]} - ${e.labels.x?.[i.x-1]||e.labels[i.x-1]}`,`Value: ${i.value??"N/A"}`]}}},legend:{display:!1},gradientLegend:{display:d,position:"bottom-left",title:e.options?.plugins?.gradientLegend?.title||"",margin:0,height:15,width:280,opacity:.8,colors:n,paletteKey:o,legendLabels:[r,c,s]}},colorPalette:n,colorScale:{min:r,neutral:c,max:s,colors:n},scales:{x:{grid:{display:!1},min:1,max:e.labels.x?.length??e.labels?.length??3,offset:!0,ticks:{autoSkip:!1,maxTicksLimit:15,callback:t=>e.labels.x?.[t-1]??e.labels?.[t-1]??"",padding:function(){return a()?30:20}},afterFit(t){d&&(t.height-=10)}},y:{grid:{display:!1},min:1,max:e.labels.y?.length??e.labels?.length??3,ticks:{autoSkip:!1,maxTicksLimit:15,callback:t=>e.labels.y?.[t-1]??e.labels?.[t-1]??"",padding:function(){return a()?15:8}}}}}},d=e=>{const i=e.options?.colorPalette||"categorical",l=t(i),o=e.labels.x?.length??e.labels?.length??3,n=e.labels.y?.length??e.labels?.length??3;return{borderWidth:0,borderColor:"transparent",width({chart:t}){const e=(t.chartArea?.width??0)/o-2;return e>0?e:1},height({chart:t}){const e=t.chartArea?.height??0,i=e/n-0;return a()?e/11.75:Math.min(i,60)},backgroundColor:({raw:t})=>void 0!==t?.value?r(t.value,l,50,15,.8,i):"rgba(204, 204, 204, 0.8)",hoverBackgroundColor:({raw:t})=>void 0!==t?.value?r(t.value,l,50,15,1,i):"#999"}};var g={options:c,datasetOptions:d,plugins:[s]};export{i as createMatrixData,d as datasetOptions,g as default,c as options,o as setMatrixFullscreen,e as type};
|
|
2
2
|
//# sourceMappingURL=matrix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix.js","sources":["../../../../src/common/config/chartTypes/matrix.js"],"sourcesContent":["import { getComputedColorPalette } from '../colorPalettes';\n\nexport const type = 'matrix';\n\nexport const createMatrixData = (data, options = {}) => {\n const { xAxis, yAxis, xKey = 'x', yKey = 'y', valueKey = 'value' } = options;\n\n if (!xAxis || !yAxis || !Array.isArray(xAxis) || !Array.isArray(yAxis)) {\n throw new Error('xAxis and yAxis must be provided as arrays');\n }\n\n const matrixData = [];\n const dataMap = new Map();\n\n data.forEach((item) => {\n const xValue = item[xKey];\n const yValue = item[yKey];\n const key = `${xValue}-${yValue}`;\n dataMap.set(key, item[valueKey]);\n });\n\n for (let y = 1; y <= yAxis.length; y++) {\n for (let x = 1; x <= xAxis.length; x++) {\n const yValue = yAxis[y - 1];\n const xValue = xAxis[x - 1];\n const key = `${xValue}-${yValue}`;\n const value = dataMap.has(key) ? dataMap.get(key) : undefined;\n matrixData.push({ x, y, value });\n }\n }\n\n return matrixData;\n};\n\nconst defaultOpacity = 0.8;\n\nlet isMatrixFullscreen = false;\n\nexport function setMatrixFullscreen(state) {\n isMatrixFullscreen = !!state;\n}\n\nfunction isFullScreen() {\n if (isMatrixFullscreen) {\n return true;\n }\n\n return !!(\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullscreenElement ||\n document.msFullscreenElement\n );\n}\n\nfunction parseColor(hex) {\n if (\n !hex ||\n typeof hex !== 'string' ||\n !hex.startsWith('#') ||\n hex.length < 7\n ) {\n return { r: 0, g: 0, b: 0 };\n }\n\n const r = parseInt(hex.slice(1, 3), 16);\n const g = parseInt(hex.slice(3, 5), 16);\n const b = parseInt(hex.slice(5, 7), 16);\n return { r: isNaN(r) ? 0 : r, g: isNaN(g) ? 0 : g, b: isNaN(b) ? 0 : b };\n}\n\nfunction getColorWithOpacity(color, opacity) {\n if (!color || typeof color !== 'string' || !color.startsWith('#')) {\n return `rgba(204, 204, 204, ${!isNaN(opacity) ? opacity : 0.7})`;\n }\n\n const finalOpacity = !isNaN(opacity) ? opacity : 0.7;\n const { r, g, b } = parseColor(color);\n return `rgba(${r}, ${g}, ${b}, ${finalOpacity})`;\n}\n\nfunction getPresetSymmetricColor(\n value,\n colors,\n neutral = 50,\n band = 15,\n opacity = 1,\n paletteKey\n) {\n if (!colors || !Array.isArray(colors) || colors.length === 0) {\n return `rgba(204, 204, 204, ${opacity})`;\n }\n\n const key = paletteKey || '';\n if (key.toLowerCase().includes('divergent')) {\n const minVal = -100;\n const maxVal = 100;\n const neutralIndex = Math.floor(colors.length / 2);\n if (value <= 0) {\n const ratio = (value - minVal) / (0 - minVal);\n const idx = Math.round(ratio * neutralIndex);\n return getColorWithOpacity(colors[Math.min(idx, neutralIndex)], opacity);\n } else {\n const ratio = value / maxVal;\n const idx =\n neutralIndex + Math.round(ratio * (colors.length - neutralIndex - 1));\n return getColorWithOpacity(\n colors[Math.min(idx, colors.length - 1)],\n opacity\n );\n }\n } else {\n const minVal = 0;\n const maxVal = 100;\n const ratio = (value - minVal) / (maxVal - minVal);\n const idx = Math.round(ratio * (colors.length - 1));\n return getColorWithOpacity(\n colors[Math.min(idx, colors.length - 1)],\n opacity\n );\n }\n}\n\nconst gradientLegendPlugin = {\n id: 'gradientLegend',\n afterDraw(chart, args, options) {\n if (!options || !options.display) return;\n const Colors =\n options.colors ||\n chart.options.plugins?.gradientLegend?.colors ||\n chart.options.colorScale?.colors ||\n chart.data?.datasets?.[0]?._colorPalette;\n if (!Colors || !Colors.length) return;\n\n const ctx = chart.ctx;\n const chartArea = chart.chartArea;\n const paletteKey = options.paletteKey || '';\n const isDivergentPalette = paletteKey.toLowerCase().includes('divergent');\n const computedScale = chart.options.colorScale || {};\n const minVal = computedScale.min ?? (isDivergentPalette ? -100 : 0);\n const neutralVal = computedScale.neutral ?? (isDivergentPalette ? 0 : 50);\n const maxVal = computedScale.max ?? (isDivergentPalette ? 100 : 100);\n\n const legendOptions = {\n position: options.position || 'bottom',\n width: options.width || Math.min(400, chartArea.width * 0.8),\n height: options.height || 20,\n margin: options.margin || 10,\n borderRadius: options.borderRadius || 4,\n gradientBorderRadius: 1,\n title: options.title || '',\n titleFontSize: options.titleFontSize || 12,\n labelFontSize: options.labelFontSize || 12,\n labelMargin: options.labelMargin || 5,\n opacity: typeof options.opacity === 'number' ? options.opacity : 0.7,\n ...options,\n };\n\n let x, y;\n if (legendOptions.position === 'bottom') {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.bottom + legendOptions.margin;\n } else if (legendOptions.position === 'top') {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.top - legendOptions.margin - legendOptions.height;\n } else if (legendOptions.position === 'bottom-left') {\n x = chartArea.left - 70;\n y = chartArea.bottom + 70;\n } else {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.bottom + legendOptions.margin;\n }\n\n const gradient = ctx.createLinearGradient(x, y, x + legendOptions.width, y);\n const neutralIndex = Colors.findIndex((c) =>\n c.toLowerCase().includes('neutral')\n );\n if (neutralIndex > 0) {\n const negativeColors = Colors.slice(0, neutralIndex);\n const neutralColor = Colors[neutralIndex];\n const positiveColors = Colors.slice(neutralIndex + 1);\n negativeColors.forEach((color, i) => {\n const t =\n negativeColors.length > 1\n ? (i / (negativeColors.length - 1)) * 0.5\n : 0;\n gradient.addColorStop(\n t,\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n gradient.addColorStop(\n 0.5,\n getColorWithOpacity(neutralColor, legendOptions.opacity)\n );\n positiveColors.forEach((color, i) => {\n const t =\n 0.5 +\n (positiveColors.length > 1\n ? (i / (positiveColors.length - 1)) * 0.5\n : 0);\n gradient.addColorStop(\n t,\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n } else {\n Colors.forEach((color, i) => {\n gradient.addColorStop(\n i / (Colors.length - 1),\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n }\n\n if (legendOptions.title) {\n ctx.font = `500 ${legendOptions.titleFontSize}px ${\n chart.options.font?.family || 'Arial'\n }`;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'bottom';\n ctx.fillStyle = chart.options.color || '#666';\n ctx.fillText(legendOptions.title, x, y - legendOptions.labelMargin);\n }\n\n function drawRoundedRect(xx, yy, w, h, radius) {\n ctx.beginPath();\n ctx.moveTo(xx + radius, yy);\n ctx.lineTo(xx + w - radius, yy);\n ctx.arcTo(xx + w, yy, xx + w, yy + radius, radius);\n ctx.lineTo(xx + w, yy + h - radius);\n ctx.arcTo(xx + w, yy + h, xx + w - radius, yy + h, radius);\n ctx.lineTo(xx + radius, yy + h);\n ctx.arcTo(xx, yy + h, xx, yy + h - radius, radius);\n ctx.lineTo(xx, yy + radius);\n ctx.arcTo(xx, yy, xx + radius, yy, radius);\n ctx.closePath();\n }\n\n ctx.fillStyle = '#fff';\n drawRoundedRect(\n x,\n y,\n legendOptions.width,\n legendOptions.height,\n legendOptions.borderRadius\n );\n ctx.fill();\n\n ctx.fillStyle = gradient;\n drawRoundedRect(\n x,\n y,\n legendOptions.width,\n legendOptions.height,\n legendOptions.gradientBorderRadius\n );\n ctx.fill();\n\n ctx.font = `${legendOptions.labelFontSize}px ${\n chart.options.font?.family || 'Arial'\n }`;\n ctx.fillStyle = chart.options.color || '#666';\n const formatValue = (val) => val.toString();\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'top';\n ctx.fillText(\n formatValue(minVal),\n x,\n y + legendOptions.height + legendOptions.labelMargin\n );\n\n if (Colors.length >= 3 && neutralVal !== undefined) {\n ctx.textAlign = 'center';\n ctx.fillText(\n formatValue(neutralVal),\n x + legendOptions.width / 2,\n y + legendOptions.height + legendOptions.labelMargin\n );\n }\n\n ctx.textAlign = 'right';\n ctx.fillText(\n formatValue(maxVal),\n x + legendOptions.width,\n y + legendOptions.height + legendOptions.labelMargin\n );\n },\n};\n\nexport const options = (ctx) => {\n const ds = ctx?.datasets?.[0];\n const data = ds?.data ?? [];\n const allValues = data\n .map((d) => (typeof d.value === 'number' ? d.value : undefined))\n .filter((v) => v !== undefined);\n\n const paletteKey = ctx.options?.colorPalette || 'sequential02';\n const Colors = getComputedColorPalette(paletteKey);\n const minValue = allValues.length ? Math.min(...allValues) : 0;\n const maxValue = allValues.length ? Math.max(...allValues) : 0;\n const isDivergent = paletteKey.toLowerCase().includes('divergent');\n const computedNeutral = isDivergent ? 0 : 50;\n const legendEnabled = ctx.options?.plugins?.gradientLegend?.display;\n const legendPadding = legendEnabled ? { bottom: 30 } : { bottom: 0 };\n\n return {\n responsive: false,\n maintainAspectRatio: true,\n aspectRatio: 2,\n layout: { padding: legendPadding },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(context) {\n const v = context.dataset.data[context.dataIndex];\n const rowLabel = ctx.labels.y?.[v.y - 1] || ctx.labels[v.y - 1];\n const colLabel = ctx.labels.x?.[v.x - 1] || ctx.labels[v.x - 1];\n return [`${rowLabel} - ${colLabel}`, `Value: ${v.value ?? 'N/A'}`];\n },\n },\n },\n legend: { display: false },\n gradientLegend: {\n display: legendEnabled,\n position: 'bottom-left',\n title: ctx.options?.plugins?.gradientLegend?.title || '',\n margin: 0,\n height: 15,\n width: 280,\n opacity: defaultOpacity,\n colors: Colors,\n paletteKey,\n legendLabels: [minValue, computedNeutral, maxValue],\n },\n },\n colorPalette: Colors,\n colorScale: {\n min: minValue,\n neutral: computedNeutral,\n max: maxValue,\n colors: Colors,\n },\n scales: {\n x: {\n grid: { display: false },\n min: 1,\n max: ctx.labels.x?.length ?? ctx.labels?.length ?? 3,\n offset: true,\n ticks: {\n autoSkip: false,\n maxTicksLimit: 15,\n callback: (value) =>\n ctx.labels.x?.[value - 1] ?? ctx.labels?.[value - 1] ?? '',\n padding: function () {\n return isFullScreen() ? 30 : 20;\n },\n },\n afterFit(scale) {\n if (legendEnabled) {\n scale.height -= 10;\n }\n },\n },\n y: {\n grid: { display: false },\n min: 1,\n max: ctx.labels.y?.length ?? ctx.labels?.length ?? 3,\n ticks: {\n autoSkip: false,\n maxTicksLimit: 15,\n callback: (value) =>\n ctx.labels.y?.[value - 1] ?? ctx.labels?.[value - 1] ?? '',\n padding: function () {\n return isFullScreen() ? 15 : 8;\n },\n },\n },\n },\n };\n};\n\nexport const datasetOptions = (ctx) => {\n const paletteKey = ctx.options?.colorPalette || 'categorical';\n const Colors = getComputedColorPalette(paletteKey);\n const numCols = ctx.labels.x?.length ?? ctx.labels?.length ?? 3;\n const numRows = ctx.labels.y?.length ?? ctx.labels?.length ?? 3;\n\n return {\n borderWidth: 0,\n borderColor: 'transparent',\n width({ chart }) {\n const gap = 2;\n const totalWidth = chart.chartArea?.width ?? 0;\n const cellWidth = totalWidth / numCols - gap;\n return cellWidth > 0 ? cellWidth : 1;\n },\n height({ chart }) {\n const gap = 0;\n const totalHeight = chart.chartArea?.height ?? 0;\n const cellHeight = totalHeight / numRows - gap;\n return isFullScreen() ? totalHeight / 11.75 : Math.min(cellHeight, 60);\n },\n backgroundColor({ raw }) {\n if (raw?.value !== undefined) {\n return getPresetSymmetricColor(\n raw.value,\n Colors,\n 50,\n 15,\n defaultOpacity,\n paletteKey\n );\n }\n return 'rgba(204, 204, 204, 0.8)';\n },\n hoverBackgroundColor({ raw }) {\n if (raw?.value !== undefined) {\n return getPresetSymmetricColor(\n raw.value,\n Colors,\n 50,\n 15,\n 1,\n paletteKey\n );\n }\n return '#999';\n },\n };\n};\n\nexport default {\n options,\n datasetOptions,\n plugins: [gradientLegendPlugin],\n};\n"],"names":["type","createMatrixData","data","options","xAxis","yAxis","xKey","yKey","valueKey","Array","isArray","Error","matrixData","dataMap","Map","forEach","item","key","set","y","length","x","yValue","value","has","get","undefined","push","isMatrixFullscreen","setMatrixFullscreen","state","isFullScreen","document","fullscreenElement","webkitFullscreenElement","mozFullscreenElement","msFullscreenElement","getColorWithOpacity","color","opacity","startsWith","isNaN","finalOpacity","r","g","b","hex","parseInt","slice","parseColor","getPresetSymmetricColor","colors","neutral","band","paletteKey","toLowerCase","includes","minVal","maxVal","neutralIndex","Math","floor","ratio","idx","round","min","gradientLegendPlugin","id","afterDraw","chart","args","display","Colors","plugins","gradientLegend","colorScale","datasets","_colorPalette","ctx","chartArea","isDivergentPalette","computedScale","neutralVal","max","legendOptions","position","width","height","margin","borderRadius","gradientBorderRadius","title","titleFontSize","labelFontSize","labelMargin","left","bottom","top","gradient","createLinearGradient","findIndex","c","negativeColors","neutralColor","positiveColors","i","t","addColorStop","drawRoundedRect","xx","yy","w","h","radius","beginPath","moveTo","lineTo","arcTo","closePath","font","family","textAlign","textBaseline","fillStyle","fillText","fill","formatValue","val","toString","ds","allValues","map","d","filter","v","colorPalette","getComputedColorPalette","minValue","maxValue","computedNeutral","legendEnabled","responsive","maintainAspectRatio","aspectRatio","layout","padding","tooltip","callbacks","label","context","dataset","dataIndex","labels","legend","legendLabels","scales","grid","offset","ticks","autoSkip","maxTicksLimit","callback","afterFit","scale","datasetOptions","numCols","numRows","borderWidth","borderColor","cellWidth","totalHeight","cellHeight","backgroundColor","raw","hoverBackgroundColor","matrix"],"mappings":"8DAEY,MAACA,EAAO,SAEPC,EAAmB,CAACC,EAAMC,EAAU,MAC/C,MAAMC,MAAEA,EAAKC,MAAEA,EAAKC,KAAEA,EAAO,IAAGC,KAAEA,EAAO,IAAGC,SAAEA,EAAW,SAAYL,EAErE,KAAKC,GAAUC,GAAUI,MAAMC,QAAQN,IAAWK,MAAMC,QAAQL,IAC9D,MAAM,IAAIM,MAAM,8CAGlB,MAAMC,EAAa,GACbC,EAAU,IAAIC,IAEpBZ,EAAKa,SAASC,IACZ,MAEMC,EAAM,GAFGD,EAAKV,MACLU,EAAKT,KAEpBM,EAAQK,IAAID,EAAKD,EAAKR,GAAU,IAGlC,IAAK,IAAIW,EAAI,EAAGA,GAAKd,EAAMe,OAAQD,IACjC,IAAK,IAAIE,EAAI,EAAGA,GAAKjB,EAAMgB,OAAQC,IAAK,CACtC,MAAMC,EAASjB,EAAMc,EAAI,GAEnBF,EAAM,GADGb,EAAMiB,EAAI,MACAC,IACnBC,EAAQV,EAAQW,IAAIP,GAAOJ,EAAQY,IAAIR,QAAOS,EACpDd,EAAWe,KAAK,CAAEN,IAAGF,IAAGI,SACzB,CAGH,OAAOX,CAAU,EAKnB,IAAIgB,GAAqB,EAElB,SAASC,EAAoBC,GAClCF,IAAuBE,CACzB,CAEA,SAASC,IACP,QAAIH,MAKFI,SAASC,mBACTD,SAASE,yBACTF,SAASG,sBACTH,SAASI,oBAEb,CAkBA,SAASC,EAAoBC,EAAOC,GAClC,IAAKD,GAA0B,iBAAVA,IAAuBA,EAAME,WAAW,KAC3D,MAAO,uBAAwBC,MAAMF,GAAqB,GAAVA,KAGlD,MAAMG,EAAgBD,MAAMF,GAAqB,GAAVA,GACjCI,EAAEA,EAACC,EAAEA,EAACC,EAAEA,GAtBhB,SAAoBC,GAClB,IACGA,GACc,iBAARA,IACNA,EAAIN,WAAW,MAChBM,EAAI1B,OA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AAMU,WAAWO,OAAS,GACd+E,EAFnB,EAGZ,OAAOI,EAAY,EAAIA,EAAY,CACpC,EACD,MAAAlF,EAAOlB,MAAEA,IACP,MACMqG,EAAcrG,EAAMU,WAAWQ,QAAU,EACzCoF,EAAaD,EAAcJ,EAFrB,EAGZ,OAAOvI,IAAiB2I,EAAc,MAAQ9G,KAAKK,IAAI0G,EAAY,GACpE,EACDC,gBAAe,EAACC,IAAEA,UACGnJ,IAAfmJ,GAAKtJ,MACA2B,EACL2H,EAAItJ,MACJiD,EACA,GACA,GA3Xa,GA6XblB,GAGG,2BAETwH,qBAAoB,EAACD,IAAEA,UACFnJ,IAAfmJ,GAAKtJ,MACA2B,EACL2H,EAAItJ,MACJiD,EACA,GACA,GACA,EACAlB,GAGG,OAEV,EAGH,IAAeyH,EAAA,CACb5K,UACAiK,iBACA3F,QAAS,CAACP"}
|
|
1
|
+
{"version":3,"file":"matrix.js","sources":["../../../../src/common/config/chartTypes/matrix.js"],"sourcesContent":["import { getComputedColorPalette } from '../colorPalettes';\n\nexport const type = 'matrix';\n\nexport const createMatrixData = (data, options = {}) => {\n const { xAxis, yAxis, xKey = 'x', yKey = 'y', valueKey = 'value' } = options;\n\n if (!xAxis || !yAxis || !Array.isArray(xAxis) || !Array.isArray(yAxis)) {\n throw new Error('xAxis and yAxis must be provided as arrays');\n }\n\n const matrixData = [];\n const dataMap = new Map();\n\n data.forEach((item) => {\n const xValue = item[xKey];\n const yValue = item[yKey];\n const key = `${xValue}-${yValue}`;\n dataMap.set(key, item[valueKey]);\n });\n\n for (let y = 1; y <= yAxis.length; y++) {\n for (let x = 1; x <= xAxis.length; x++) {\n const yValue = yAxis[y - 1];\n const xValue = xAxis[x - 1];\n const key = `${xValue}-${yValue}`;\n const value = dataMap.has(key) ? dataMap.get(key) : undefined;\n matrixData.push({ x, y, value });\n }\n }\n\n return matrixData;\n};\n\nconst defaultOpacity = 0.8;\n\nlet isMatrixFullscreen = false;\n\nexport function setMatrixFullscreen(state) {\n isMatrixFullscreen = !!state;\n}\n\nfunction isFullScreen() {\n if (isMatrixFullscreen) {\n return true;\n }\n\n return !!(\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullscreenElement ||\n document.msFullscreenElement\n );\n}\n\nfunction parseColor(hex) {\n if (\n !hex ||\n typeof hex !== 'string' ||\n !hex.startsWith('#') ||\n hex.length < 7\n ) {\n return { r: 0, g: 0, b: 0 };\n }\n\n const r = parseInt(hex.slice(1, 3), 16);\n const g = parseInt(hex.slice(3, 5), 16);\n const b = parseInt(hex.slice(5, 7), 16);\n return { r: isNaN(r) ? 0 : r, g: isNaN(g) ? 0 : g, b: isNaN(b) ? 0 : b };\n}\n\nfunction getColorWithOpacity(color, opacity) {\n if (!color || typeof color !== 'string' || !color.startsWith('#')) {\n return `rgba(204, 204, 204, ${!isNaN(opacity) ? opacity : 0.7})`;\n }\n\n const finalOpacity = !isNaN(opacity) ? opacity : 0.7;\n const { r, g, b } = parseColor(color);\n return `rgba(${r}, ${g}, ${b}, ${finalOpacity})`;\n}\n\nfunction getPresetSymmetricColor(\n value,\n colors,\n neutral = 50,\n band = 15,\n opacity = 1,\n paletteKey\n) {\n if (!colors || !Array.isArray(colors) || colors.length === 0) {\n return `rgba(204, 204, 204, ${opacity})`;\n }\n\n const key = paletteKey || '';\n if (key.toLowerCase().includes('divergent')) {\n const minVal = -100;\n const maxVal = 100;\n const neutralIndex = Math.floor(colors.length / 2);\n if (value <= 0) {\n const ratio = (value - minVal) / (0 - minVal);\n const idx = Math.round(ratio * neutralIndex);\n return getColorWithOpacity(colors[Math.min(idx, neutralIndex)], opacity);\n } else {\n const ratio = value / maxVal;\n const idx =\n neutralIndex + Math.round(ratio * (colors.length - neutralIndex - 1));\n return getColorWithOpacity(\n colors[Math.min(idx, colors.length - 1)],\n opacity\n );\n }\n } else {\n const minVal = 0;\n const maxVal = 100;\n const ratio = (value - minVal) / (maxVal - minVal);\n const idx = Math.round(ratio * (colors.length - 1));\n return getColorWithOpacity(\n colors[Math.min(idx, colors.length - 1)],\n opacity\n );\n }\n}\n\nconst gradientLegendPlugin = {\n id: 'gradientLegend',\n afterDraw(chart, args, options) {\n if (!options || !options.display) return;\n const Colors =\n options.colors ||\n chart.options.plugins?.gradientLegend?.colors ||\n chart.options.colorScale?.colors ||\n chart.data?.datasets?.[0]?._colorPalette;\n if (!Colors || !Colors.length) return;\n\n const ctx = chart.ctx;\n const chartArea = chart.chartArea;\n const paletteKey = options.paletteKey || '';\n const isDivergentPalette = paletteKey.toLowerCase().includes('divergent');\n const computedScale = chart.options.colorScale || {};\n const minVal = computedScale.min ?? (isDivergentPalette ? -100 : 0);\n const neutralVal = computedScale.neutral ?? (isDivergentPalette ? 0 : 50);\n const maxVal = computedScale.max ?? (isDivergentPalette ? 100 : 100);\n\n const legendOptions = {\n position: options.position || 'bottom',\n width: options.width || Math.min(400, chartArea.width * 0.8),\n height: options.height || 20,\n margin: options.margin || 10,\n borderRadius: options.borderRadius || 4,\n gradientBorderRadius: 1,\n title: options.title || '',\n titleFontSize: options.titleFontSize || 12,\n labelFontSize: options.labelFontSize || 12,\n labelMargin: options.labelMargin || 5,\n opacity: typeof options.opacity === 'number' ? options.opacity : 0.7,\n ...options,\n };\n\n let x, y;\n if (legendOptions.position === 'bottom') {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.bottom + legendOptions.margin;\n } else if (legendOptions.position === 'top') {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.top - legendOptions.margin - legendOptions.height;\n } else if (legendOptions.position === 'bottom-left') {\n x = chartArea.left - 70;\n y = chartArea.bottom + 70;\n } else {\n x = chartArea.left + (chartArea.width - legendOptions.width) / 2;\n y = chartArea.bottom + legendOptions.margin;\n }\n\n const gradient = ctx.createLinearGradient(x, y, x + legendOptions.width, y);\n const neutralIndex = Colors.findIndex((c) =>\n c.toLowerCase().includes('neutral')\n );\n if (neutralIndex > 0) {\n const negativeColors = Colors.slice(0, neutralIndex);\n const neutralColor = Colors[neutralIndex];\n const positiveColors = Colors.slice(neutralIndex + 1);\n negativeColors.forEach((color, i) => {\n const t =\n negativeColors.length > 1\n ? (i / (negativeColors.length - 1)) * 0.5\n : 0;\n gradient.addColorStop(\n t,\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n gradient.addColorStop(\n 0.5,\n getColorWithOpacity(neutralColor, legendOptions.opacity)\n );\n positiveColors.forEach((color, i) => {\n const t =\n 0.5 +\n (positiveColors.length > 1\n ? (i / (positiveColors.length - 1)) * 0.5\n : 0);\n gradient.addColorStop(\n t,\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n } else {\n Colors.forEach((color, i) => {\n gradient.addColorStop(\n i / (Colors.length - 1),\n getColorWithOpacity(color, legendOptions.opacity)\n );\n });\n }\n\n if (legendOptions.title) {\n ctx.font = `500 ${legendOptions.titleFontSize}px ${\n chart.options.font?.family || 'Arial'\n }`;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'bottom';\n ctx.fillStyle = chart.options.color || '#666';\n ctx.fillText(legendOptions.title, x, y - legendOptions.labelMargin);\n }\n\n function drawRoundedRect(xx, yy, w, h, radius) {\n ctx.beginPath();\n ctx.moveTo(xx + radius, yy);\n ctx.lineTo(xx + w - radius, yy);\n ctx.arcTo(xx + w, yy, xx + w, yy + radius, radius);\n ctx.lineTo(xx + w, yy + h - radius);\n ctx.arcTo(xx + w, yy + h, xx + w - radius, yy + h, radius);\n ctx.lineTo(xx + radius, yy + h);\n ctx.arcTo(xx, yy + h, xx, yy + h - radius, radius);\n ctx.lineTo(xx, yy + radius);\n ctx.arcTo(xx, yy, xx + radius, yy, radius);\n ctx.closePath();\n }\n\n ctx.fillStyle = '#fff';\n drawRoundedRect(\n x,\n y,\n legendOptions.width,\n legendOptions.height,\n legendOptions.borderRadius\n );\n ctx.fill();\n\n ctx.fillStyle = gradient;\n drawRoundedRect(\n x,\n y,\n legendOptions.width,\n legendOptions.height,\n legendOptions.gradientBorderRadius\n );\n ctx.fill();\n\n ctx.font = `${legendOptions.labelFontSize}px ${\n chart.options.font?.family || 'Arial'\n }`;\n ctx.fillStyle = chart.options.color || '#666';\n const formatValue = (val) => val.toString();\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'top';\n ctx.fillText(\n formatValue(minVal),\n x,\n y + legendOptions.height + legendOptions.labelMargin\n );\n\n if (Colors.length >= 3 && neutralVal !== undefined) {\n ctx.textAlign = 'center';\n ctx.fillText(\n formatValue(neutralVal),\n x + legendOptions.width / 2,\n y + legendOptions.height + legendOptions.labelMargin\n );\n }\n\n ctx.textAlign = 'right';\n ctx.fillText(\n formatValue(maxVal),\n x + legendOptions.width,\n y + legendOptions.height + legendOptions.labelMargin\n );\n },\n};\n\nexport const options = (ctx) => {\n const ds = ctx?.datasets?.[0];\n const data = ds?.data ?? [];\n const allValues = data\n .map((d) => (typeof d.value === 'number' ? d.value : undefined))\n .filter((v) => v !== undefined);\n\n const paletteKey = ctx.options?.colorPalette || 'sequential02';\n const Colors = getComputedColorPalette(paletteKey);\n const minValue = allValues.length ? Math.min(...allValues) : 0;\n const maxValue = allValues.length ? Math.max(...allValues) : 0;\n const isDivergent = paletteKey.toLowerCase().includes('divergent');\n const computedNeutral = isDivergent ? 0 : 50;\n const legendEnabled = ctx.options?.plugins?.gradientLegend?.display;\n const legendPadding = legendEnabled ? { bottom: 35 } : { bottom: 0 };\n\n return {\n responsive: false,\n maintainAspectRatio: true,\n aspectRatio: 2,\n layout: { padding: legendPadding },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(context) {\n const v = context.dataset.data[context.dataIndex];\n const rowLabel = ctx.labels.y?.[v.y - 1] || ctx.labels[v.y - 1];\n const colLabel = ctx.labels.x?.[v.x - 1] || ctx.labels[v.x - 1];\n return [`${rowLabel} - ${colLabel}`, `Value: ${v.value ?? 'N/A'}`];\n },\n },\n },\n legend: { display: false },\n gradientLegend: {\n display: legendEnabled,\n position: 'bottom-left',\n title: ctx.options?.plugins?.gradientLegend?.title || '',\n margin: 0,\n height: 15,\n width: 280,\n opacity: defaultOpacity,\n colors: Colors,\n paletteKey,\n legendLabels: [minValue, computedNeutral, maxValue],\n },\n },\n colorPalette: Colors,\n colorScale: {\n min: minValue,\n neutral: computedNeutral,\n max: maxValue,\n colors: Colors,\n },\n scales: {\n x: {\n grid: { display: false },\n min: 1,\n max: ctx.labels.x?.length ?? ctx.labels?.length ?? 3,\n offset: true,\n ticks: {\n autoSkip: false,\n maxTicksLimit: 15,\n callback: (value) =>\n ctx.labels.x?.[value - 1] ?? ctx.labels?.[value - 1] ?? '',\n padding: function () {\n return isFullScreen() ? 30 : 20;\n },\n },\n afterFit(scale) {\n if (legendEnabled) {\n scale.height -= 10;\n }\n },\n },\n y: {\n grid: { display: false },\n min: 1,\n max: ctx.labels.y?.length ?? ctx.labels?.length ?? 3,\n ticks: {\n autoSkip: false,\n maxTicksLimit: 15,\n callback: (value) =>\n ctx.labels.y?.[value - 1] ?? ctx.labels?.[value - 1] ?? '',\n padding: function () {\n return isFullScreen() ? 15 : 8;\n },\n },\n },\n },\n };\n};\n\nexport const datasetOptions = (ctx) => {\n const paletteKey = ctx.options?.colorPalette || 'categorical';\n const Colors = getComputedColorPalette(paletteKey);\n const numCols = ctx.labels.x?.length ?? ctx.labels?.length ?? 3;\n const numRows = ctx.labels.y?.length ?? ctx.labels?.length ?? 3;\n\n return {\n borderWidth: 0,\n borderColor: 'transparent',\n width({ chart }) {\n const gap = 2;\n const totalWidth = chart.chartArea?.width ?? 0;\n const cellWidth = totalWidth / numCols - gap;\n return cellWidth > 0 ? cellWidth : 1;\n },\n height({ chart }) {\n const gap = 0;\n const totalHeight = chart.chartArea?.height ?? 0;\n const cellHeight = totalHeight / numRows - gap;\n return isFullScreen() ? totalHeight / 11.75 : Math.min(cellHeight, 60);\n },\n backgroundColor({ raw }) {\n if (raw?.value !== undefined) {\n return getPresetSymmetricColor(\n raw.value,\n Colors,\n 50,\n 15,\n defaultOpacity,\n paletteKey\n );\n }\n return 'rgba(204, 204, 204, 0.8)';\n },\n hoverBackgroundColor({ raw }) {\n if (raw?.value !== undefined) {\n return getPresetSymmetricColor(\n raw.value,\n Colors,\n 50,\n 15,\n 1,\n paletteKey\n );\n }\n return '#999';\n },\n };\n};\n\nexport default {\n options,\n datasetOptions,\n plugins: [gradientLegendPlugin],\n};\n"],"names":["type","createMatrixData","data","options","xAxis","yAxis","xKey","yKey","valueKey","Array","isArray","Error","matrixData","dataMap","Map","forEach","item","key","set","y","length","x","yValue","value","has","get","undefined","push","isMatrixFullscreen","setMatrixFullscreen","state","isFullScreen","document","fullscreenElement","webkitFullscreenElement","mozFullscreenElement","msFullscreenElement","getColorWithOpacity","color","opacity","startsWith","isNaN","finalOpacity","r","g","b","hex","parseInt","slice","parseColor","getPresetSymmetricColor","colors","neutral","band","paletteKey","toLowerCase","includes","minVal","maxVal","neutralIndex","Math","floor","ratio","idx","round","min","gradientLegendPlugin","id","afterDraw","chart","args","display","Colors","plugins","gradientLegend","colorScale","datasets","_colorPalette","ctx","chartArea","isDivergentPalette","computedScale","neutralVal","max","legendOptions","position","width","height","margin","borderRadius","gradientBorderRadius","title","titleFontSize","labelFontSize","labelMargin","left","bottom","top","gradient","createLinearGradient","findIndex","c","negativeColors","neutralColor","positiveColors","i","t","addColorStop","drawRoundedRect","xx","yy","w","h","radius","beginPath","moveTo","lineTo","arcTo","closePath","font","family","textAlign","textBaseline","fillStyle","fillText","fill","formatValue","val","toString","ds","allValues","map","d","filter","v","colorPalette","getComputedColorPalette","minValue","maxValue","computedNeutral","legendEnabled","responsive","maintainAspectRatio","aspectRatio","layout","padding","tooltip","callbacks","label","context","dataset","dataIndex","labels","legend","legendLabels","scales","grid","offset","ticks","autoSkip","maxTicksLimit","callback","afterFit","scale","datasetOptions","numCols","numRows","borderWidth","borderColor","cellWidth","totalHeight","cellHeight","backgroundColor","raw","hoverBackgroundColor","matrix"],"mappings":"8DAEY,MAACA,EAAO,SAEPC,EAAmB,CAACC,EAA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G,EAAMU,WAAWQ,QAAU,EACzCoF,EAAaD,EAAcJ,EAFrB,EAGZ,OAAOvI,IAAiB2I,EAAc,MAAQ9G,KAAKK,IAAI0G,EAAY,GACpE,EACDC,gBAAe,EAACC,IAAEA,UACGnJ,IAAfmJ,GAAKtJ,MACA2B,EACL2H,EAAItJ,MACJiD,EACA,GACA,GA3Xa,GA6XblB,GAGG,2BAETwH,qBAAoB,EAACD,IAAEA,UACFnJ,IAAfmJ,GAAKtJ,MACA2B,EACL2H,EAAItJ,MACJiD,EACA,GACA,GACA,EACAlB,GAGG,OAEV,EAGH,IAAeyH,EAAA,CACb5K,UACAiK,iBACA3F,QAAS,CAACP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{getComputedColorPalette as o}from"../colorPalettes.js";const t="violin",r=o=>{const t="y"===o.options.indexAxis;return{...{scales:{x:{grid:{display:t}},y:{grid:{display:!t}}},plugins:{legend:{display:!0,position:"bottom"},tooltip:{enabled:!0,callbacks:{title:o=>{const r=t?o[0].chart.options.scales.y.title?.text:o[0].chart.options.scales.x.title?.text;return r?r+": "+o[0].label:o[0].label}}}}},...o.options||{}}},e=(t,r)=>{const{colorPalette:e="categorical",backgroundAlpha:l="95",borderWidth:i=1,outlierStyle:a="circle",outlierRadius:n=3,outlierBorderWidth:d=1,meanStyle:s="circle",meanRadius:h=3,meanBorderWidth:c=1,pointCount:u=100,violinWidth:m=.8,datasetOptionsOverride:p={}}=t.options,g=o(e),y=Math.floor(r/(g.length-1)),b=g[r>g.length-1?r-(g.length-1)*y:r];return{backgroundColor:b+l,borderColor:b,borderWidth:i,outlierStyle:a,outlierRadius:n,outlierBorderWidth:d,outlierBackgroundColor:b+l,outlierBorderColor:b,medianColor:b,meanStyle:s,meanRadius:h,meanBorderWidth:c,meanBackgroundColor:b+l,meanBorderColor:b,points:u,width:m,...p}},l=(o,t,r,e=0)=>{const l=Array.from({length:o},(()=>Math.floor(Math.random()*(r-t)+t))).sort(((o,t)=>o-t));if(e>0)for(let o=0;o<e;o++)Math.random()>.5?l.push(r+Math.floor(Math.random()*r*.5)):l.unshift(Math.max(0,t-Math.floor(Math.random()*t*.5)));return l};export{e as datasetOptions,l as generateRandomData,r as options,t as type};
|
|
2
|
+
//# sourceMappingURL=violin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"violin.js","sources":["../../../../src/common/config/chartTypes/violin.js"],"sourcesContent":["import { getComputedColorPalette } from '../colorPalettes';\n\nexport const type = 'violin';\n\nexport const options = (ctx) => {\n const horizontal = ctx.options.indexAxis === 'y';\n\n const defaultOptions = {\n scales: {\n x: {\n grid: { display: horizontal },\n },\n y: {\n grid: { display: !horizontal },\n },\n },\n plugins: {\n legend: {\n display: true,\n position: 'bottom',\n },\n tooltip: {\n enabled: true,\n callbacks: {\n title: (items) => {\n const axisLabel = horizontal\n ? items[0].chart.options.scales.y.title?.text\n : items[0].chart.options.scales.x.title?.text;\n return axisLabel\n ? axisLabel + ': ' + items[0].label\n : items[0].label;\n },\n },\n },\n },\n };\n return {\n ...defaultOptions,\n ...(ctx.options || {}),\n };\n};\n\nexport const datasetOptions = (ctx, index) => {\n const {\n colorPalette = 'categorical',\n backgroundAlpha = '95',\n borderWidth = 1,\n outlierStyle = 'circle',\n outlierRadius = 3,\n outlierBorderWidth = 1,\n meanStyle = 'circle',\n meanRadius = 3,\n meanBorderWidth = 1,\n pointCount = 100,\n violinWidth = 0.8,\n datasetOptionsOverride = {},\n } = ctx.options;\n\n const palette = getComputedColorPalette(colorPalette);\n const cycles = Math.floor(index / (palette.length - 1));\n const idx =\n index > palette.length - 1 ? index - (palette.length - 1) * cycles : index;\n const color = palette[idx];\n\n return {\n backgroundColor: color + backgroundAlpha,\n borderColor: color,\n borderWidth,\n outlierStyle,\n outlierRadius,\n outlierBorderWidth,\n outlierBackgroundColor: color + backgroundAlpha,\n outlierBorderColor: color,\n medianColor: color,\n meanStyle,\n meanRadius,\n meanBorderWidth,\n meanBackgroundColor: color + backgroundAlpha,\n meanBorderColor: color,\n points: pointCount,\n width: violinWidth,\n ...datasetOptionsOverride,\n };\n};\n\nexport const generateRandomData = (count, min, max, outliers = 0) => {\n const values = Array.from({ length: count }, () =>\n Math.floor(Math.random() * (max - min) + min)\n ).sort((a, b) => a - b);\n\n if (outliers > 0) {\n for (let i = 0; i < outliers; i++) {\n if (Math.random() > 0.5) {\n values.push(max + Math.floor(Math.random() * max * 0.5));\n } else {\n values.unshift(\n Math.max(0, min - Math.floor(Math.random() * min * 0.5))\n );\n }\n }\n }\n\n return values;\n};\n"],"names":["type","options","ctx","horizontal","indexAxis","scales","x","grid","display","y","plugins","legend","position","tooltip","enabled","callbacks","title","items","axisLabel","chart","text","label","datasetOptions","index","colorPalette","backgroundAlpha","borderWidth","outlierStyle","outlierRadius","outlierBorderWidth","meanStyle","meanRadius","meanBorderWidth","pointCount","violinWidth","datasetOptionsOverride","palette","getComputedColorPalette","cycles","Math","floor","length","color","backgroundColor","borderColor","outlierBackgroundColor","outlierBorderColor","medianColor","meanBackgroundColor","meanBorderColor","points","width","generateRandomData","count","min","max","outliers","values","Array","from","random","sort","a","b","i","push","unshift"],"mappings":"8DAEY,MAACA,EAAO,SAEPC,EAAWC,IACtB,MAAMC,EAAuC,MAA1BD,EAAID,QAAQG,UA+B/B,MAAO,IA7BgB,CACrBC,OAAQ,CACNC,EAAG,CACDC,KAAM,CAAEC,QAASL,IAEnBM,EAAG,CACDF,KAAM,CAAEC,SAAUL,KAGtBO,QAAS,CACPC,OAAQ,CACNH,SAAS,EACTI,SAAU,UAEZC,QAAS,CACPC,SAAS,EACTC,UAAW,CACTC,MAAQC,IACN,MAAMC,EAAYf,EACdc,EAAM,GAAGE,MAAMlB,QAAQI,OAAOI,EAAEO,OAAOI,KACvCH,EAAM,GAAGE,MAAMlB,QAAQI,OAAOC,EAAEU,OAAOI,KAC3C,OAAOF,EACHA,EAAY,KAAOD,EAAM,GAAGI,MAC5BJ,EAAM,GAAGI,KAAK,SAQtBnB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
-
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const t=t=>{const e=o("--kd-color-text-level-
|
|
1
|
+
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const t=t=>{const e=o("--kd-color-text-level-primary"),r=o("--kd-color-text-level-secondary"),a=o("--kd-color-background-ui-default-dark"),i=o("--kd-color-text-variant-inversed");return{resizeDelay:50,maintainAspectRatio:!(null!==t.height||null!==t.width),plugins:{canvasBackground:{color:"transparent"},legend:{display:!1,position:"bottom",labels:{color:e,boxWidth:16,boxHeight:16,borderRadius:2,useBorderRadius:!0,padding:8}},tooltip:{bodyColor:i,footerColor:i,titleColor:i,backgroundColor:a,multiKeyBackground:"transparent",titleFont:{weight:"400"},footerFont:{weight:"400"},titleMarginBottom:8,bodySpacing:4,footerMarginTop:10,cornerRadius:2,boxWidth:16,boxHeight:16,boxPadding:4},datalabels:{display:!1,color:r},chartjs2music:{internal:{},cc:t.ccDiv}}}};export{t as default};
|
|
2
2
|
//# sourceMappingURL=globalOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalOptions.js","sources":["../../../src/common/config/globalOptions.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const SecondaryTextColor = getTokenThemeVal(\n '--kd-color-text-level-secondary'\n );\n const TooltipBgColor = getTokenThemeVal(\n '--kd-color-background-ui-default-dark'\n );\n const TooltipTextColor = getTokenThemeVal('--kd-color-text-variant-inversed');\n const ExplicitSize = ctx.height !== null || ctx.width !== null;\n\n return {\n resizeDelay: 50, //debounce the resize\n maintainAspectRatio: !ExplicitSize,\n plugins: {\n canvasBackground: {\n color: 'transparent',\n },\n legend: {\n display: false,\n position: 'bottom',\n labels: {\n boxWidth: 16,\n boxHeight: 16,\n borderRadius: 2,\n useBorderRadius: true,\n padding: 8,\n },\n },\n tooltip: {\n bodyColor: TooltipTextColor,\n footerColor: TooltipTextColor,\n titleColor: TooltipTextColor,\n backgroundColor: TooltipBgColor,\n multiKeyBackground: 'transparent',\n titleFont: {\n weight: '400',\n },\n footerFont: {\n weight: '400',\n },\n titleMarginBottom: 8,\n bodySpacing: 4,\n footerMarginTop: 10,\n cornerRadius: 2,\n boxWidth: 16,\n boxHeight: 16,\n boxPadding: 4,\n },\n datalabels: {\n display: false,\n color: SecondaryTextColor,\n },\n chartjs2music: {\n internal: {},\n cc: ctx.ccDiv,\n },\n },\n };\n};\n\nexport default defaultConfig;\n\n/**\n * The function `handleLegendHover` updates the background and border colors of a chart legend item\n * when it is hovered over.\n * @param e - The `e` parameter is an event object that represents the event that triggered the\n * function. It can be used to access information about the event, such as the target element or the\n * event type.\n * @param item - The `item` parameter represents the legend item that was hovered over. It contains\n * information about the dataset index and the index of the hovered item within that dataset.\n * @param legend - The `legend` parameter is the legend object of a chart. It contains information\n * about the chart's legend, such as the labels and colors of the legend items.\n */\
|
|
1
|
+
{"version":3,"file":"globalOptions.js","sources":["../../../src/common/config/globalOptions.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const PrimaryTextColor = getTokenThemeVal('--kd-color-text-level-primary');\n const SecondaryTextColor = getTokenThemeVal(\n '--kd-color-text-level-secondary'\n );\n const TooltipBgColor = getTokenThemeVal(\n '--kd-color-background-ui-default-dark'\n );\n const TooltipTextColor = getTokenThemeVal('--kd-color-text-variant-inversed');\n const ExplicitSize = ctx.height !== null || ctx.width !== null;\n\n return {\n resizeDelay: 50, //debounce the resize\n maintainAspectRatio: !ExplicitSize,\n plugins: {\n canvasBackground: {\n color: 'transparent',\n },\n legend: {\n display: false,\n position: 'bottom',\n labels: {\n color: PrimaryTextColor,\n boxWidth: 16,\n boxHeight: 16,\n borderRadius: 2,\n useBorderRadius: true,\n padding: 8,\n },\n },\n tooltip: {\n bodyColor: TooltipTextColor,\n footerColor: TooltipTextColor,\n titleColor: TooltipTextColor,\n backgroundColor: TooltipBgColor,\n multiKeyBackground: 'transparent',\n titleFont: {\n weight: '400',\n },\n footerFont: {\n weight: '400',\n },\n titleMarginBottom: 8,\n bodySpacing: 4,\n footerMarginTop: 10,\n cornerRadius: 2,\n boxWidth: 16,\n boxHeight: 16,\n boxPadding: 4,\n },\n datalabels: {\n display: false,\n color: SecondaryTextColor,\n },\n chartjs2music: {\n internal: {},\n cc: ctx.ccDiv,\n },\n },\n };\n};\n\nexport default defaultConfig;\n\n/**\n * The function `handleLegendHover` updates the background and border colors of a chart legend item\n * when it is hovered over.\n * @param e - The `e` parameter is an event object that represents the event that triggered the\n * function. It can be used to access information about the event, such as the target element or the\n * event type.\n * @param item - The `item` parameter represents the legend item that was hovered over. It contains\n * information about the dataset index and the index of the hovered item within that dataset.\n * @param legend - The `legend` parameter is the legend object of a chart. It contains information\n * about the chart's legend, such as the labels and colors of the legend items.\n */\nexport const handleLegendHover = (e, item, legend) => {\n const DatasetIndex = item.datasetIndex || 0;\n const Datasets = legend.chart.data.datasets;\n const Dataset = Datasets[DatasetIndex];\n const AlphaHexLength = 9; // includes #\n const Alpha = '4D'; // 30% opacity\n\n if (Array.isArray(Dataset.backgroundColor)) {\n Dataset.backgroundColor.forEach((color, index, colors) => {\n colors[index] =\n index === item.index || color.length === AlphaHexLength\n ? color\n : color + Alpha;\n });\n } else {\n Datasets.forEach((dataset, index) => {\n const backgroundColor = dataset.backgroundColor;\n const borderColor = dataset.borderColor;\n\n if (backgroundColor) {\n dataset.backgroundColor =\n index === DatasetIndex || backgroundColor.length === AlphaHexLength\n ? backgroundColor\n : backgroundColor + Alpha;\n }\n\n if (borderColor) {\n dataset.borderColor =\n index === DatasetIndex || borderColor.length === AlphaHexLength\n ? borderColor\n : borderColor + Alpha;\n }\n });\n }\n\n legend.chart.update();\n};\n\n/**\n * The function `handleLegendLeave` updates the background and border colors of a chart legend when the\n * mouse leaves the legend item.\n * @param e - The event object that triggered the legend leave event.\n * @param item - The `item` parameter represents the legend item that was interacted with. It contains\n * information about the dataset index and other properties related to the legend item.\n * @param legend - The `legend` parameter is the legend object of a chart. It contains information\n * about the chart's legend, such as the labels and colors of the legend items.\n */\nexport const handleLegendLeave = (e, item, legend) => {\n const DatasetIndex = item.datasetIndex || 0;\n const Datasets = legend.chart.data.datasets;\n const Dataset = Datasets[DatasetIndex];\n const AlphaHexLength = 9;\n\n if (Array.isArray(Dataset.backgroundColor)) {\n Dataset.backgroundColor.forEach((color, index, colors) => {\n colors[index] =\n color.length === AlphaHexLength ? color.slice(0, -2) : color;\n });\n } else {\n Datasets.forEach((dataset) => {\n const backgroundColor = dataset.backgroundColor;\n const borderColor = dataset.borderColor;\n\n if (backgroundColor) {\n dataset.backgroundColor =\n backgroundColor.length === AlphaHexLength\n ? backgroundColor.slice(0, -2)\n : backgroundColor;\n }\n\n if (borderColor) {\n dataset.borderColor =\n borderColor.length === AlphaHexLength\n ? borderColor.slice(0, -2)\n : borderColor;\n }\n });\n }\n\n legend.chart.update();\n};\n"],"names":["defaultConfig","ctx","PrimaryTextColor","getTokenThemeVal","SecondaryTextColor","TooltipBgColor","TooltipTextColor","resizeDelay","maintainAspectRatio","height","width","plugins","canvasBackground","color","legend","display","position","labels","boxWidth","boxHeight","borderRadius","useBorderRadius","padding","tooltip","bodyColor","footerColor","titleColor","backgroundColor","multiKeyBackground","titleFont","weight","footerFont","titleMarginBottom","bodySpacing","footerMarginTop","cornerRadius","boxPadding","datalabels","chartjs2music","internal","cc","ccDiv"],"mappings":"wHAEK,MAACA,EAAiBC,IACrB,MAAMC,EAAmBC,EAAiB,iCACpCC,EAAqBD,EACzB,mCAEIE,EAAiBF,EACrB,yCAEIG,EAAmBH,EAAiB,oCAG1C,MAAO,CACLI,YAAa,GACbC,sBAJkC,OAAfP,EAAIQ,QAAiC,OAAdR,EAAIS,OAK9CC,QAAS,CACPC,iBAAkB,CAChBC,MAAO,eAETC,OAAQ,CACNC,SAAS,EACTC,SAAU,SACVC,OAAQ,CACNJ,MAAOX,EACPgB,SAAU,GACVC,UAAW,GACXC,aAAc,EACdC,iBAAiB,EACjBC,QAAS,IAGbC,QAAS,CACPC,UAAWlB,EACXmB,YAAanB,EACboB,WAAYpB,EACZqB,gBAAiBtB,EACjBuB,mBAAoB,cACpBC,UAAW,CACTC,OAAQ,OAEVC,WAAY,CACVD,OAAQ,OAEVE,kBAAmB,EACnBC,YAAa,EACbC,gBAAiB,GACjBC,aAAc,EACdjB,SAAU,GACVC,UAAW,GACXiB,WAAY,GAEdC,WAAY,CACVtB,SAAS,EACTF,MAAOT,GAETkC,cAAe,CACbC,SAAU,CAAE,EACZC,GAAIvC,EAAIwC,QAGb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const t=t=>{const r=o("--kd-color-border-variants-light"),a=t.options.scales&&Object.keys(t.options.scales).length>2,
|
|
1
|
+
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const t=t=>{const r=o("--kd-color-border-variants-light"),a=o("--kd-color-text-level-primary"),s=t.options.scales&&Object.keys(t.options.scales).length>2,e={grid:{drawTicks:!1,color:r},ticks:{padding:8,color:a},border:{display:!1},title:{color:a,display:!0}},d={scales:{x:{title:{display:!0,text:"X Axis ",padding:8},...e},y:{title:{display:!0,text:"Y Axis ",padding:{bottom:8,top:0}},...e}},plugins:{tooltip:{callbacks:{labelColor:function(o){const t=Array.isArray(o.dataset.backgroundColor),r="function"==typeof o.dataset.backgroundColor?o.dataset.borderColor+"80":o.dataset.backgroundColor;return{borderColor:o.dataset.borderColor,backgroundColor:t?r[o.dataIndex]:r,borderRadius:2}}}}}};if(s){const o=Object.keys(t.options.scales).find((o=>"x"!==o&&"y"!==o));d.scales[o]={title:{display:!0,padding:{bottom:8,top:0}},position:"right",grid:{drawOnChartArea:!1,drawTicks:!1,color:r},border:{display:!1}}}return d};export{t as default};
|
|
2
2
|
//# sourceMappingURL=globalOptionsNonRadial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalOptionsNonRadial.js","sources":["../../../src/common/config/globalOptionsNonRadial.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const GridLinesColor = getTokenThemeVal('--kd-color-border-variants-light');\n\n const MultiAxis =\n ctx.options.scales && Object.keys(ctx.options.scales).length > 2;\n\n const CommonAxisOptions = {\n grid: {\n drawTicks: false,\n color: GridLinesColor,\n },\n ticks: {\n padding: 8,\n },\n border: {\n display: false,\n },\n };\n\n const options = {\n scales: {\n x: {\n title: {\n display: true,\n text: 'X Axis ',\n padding: 8,\n },\n ...CommonAxisOptions,\n },\n y: {\n title: {\n display: true,\n text: 'Y Axis ',\n padding: { bottom: 8, top: 0 },\n },\n ...CommonAxisOptions,\n },\n },\n plugins: {\n tooltip: {\n callbacks: {\n labelColor: function (context) {\n const PerDatapointColors = Array.isArray(\n context.dataset.backgroundColor\n );\n const IsFunction =\n typeof context.dataset.backgroundColor == 'function';\n const BgColor = IsFunction\n ? context.dataset.borderColor + '80'\n : context.dataset.backgroundColor;\n\n return {\n borderColor: context.dataset.borderColor,\n backgroundColor: PerDatapointColors\n ? BgColor[context.dataIndex]\n : BgColor,\n borderRadius: 2,\n };\n },\n },\n },\n },\n };\n\n if (MultiAxis) {\n const ThirdAxisId = Object.keys(ctx.options.scales).find(\n (scaleId) => scaleId !== 'x' && scaleId !== 'y'\n );\n\n options.scales[ThirdAxisId] = {\n title: {\n display: true,\n padding: { bottom: 8, top: 0 },\n },\n position: 'right',\n grid: {\n drawOnChartArea: false,\n drawTicks: false,\n color: GridLinesColor,\n },\n border: {\n display: false,\n },\n };\n }\n\n return options;\n};\n\nexport default defaultConfig;\n"],"names":["defaultConfig","ctx","GridLinesColor","getTokenThemeVal","MultiAxis","options","scales","Object","keys","length","CommonAxisOptions","grid","drawTicks","color","ticks","padding","border","display","
|
|
1
|
+
{"version":3,"file":"globalOptionsNonRadial.js","sources":["../../../src/common/config/globalOptionsNonRadial.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const GridLinesColor = getTokenThemeVal('--kd-color-border-variants-light');\n const AxisTextColor = getTokenThemeVal('--kd-color-text-level-primary');\n\n const MultiAxis =\n ctx.options.scales && Object.keys(ctx.options.scales).length > 2;\n\n const CommonAxisOptions = {\n grid: {\n drawTicks: false,\n color: GridLinesColor,\n },\n ticks: {\n padding: 8,\n color: AxisTextColor,\n },\n border: {\n display: false,\n },\n title: {\n color: AxisTextColor,\n display: true,\n },\n };\n\n const options = {\n scales: {\n x: {\n title: {\n display: true,\n text: 'X Axis ',\n padding: 8,\n },\n ...CommonAxisOptions,\n },\n y: {\n title: {\n display: true,\n text: 'Y Axis ',\n padding: { bottom: 8, top: 0 },\n },\n ...CommonAxisOptions,\n },\n },\n plugins: {\n tooltip: {\n callbacks: {\n labelColor: function (context) {\n const PerDatapointColors = Array.isArray(\n context.dataset.backgroundColor\n );\n const IsFunction =\n typeof context.dataset.backgroundColor == 'function';\n const BgColor = IsFunction\n ? context.dataset.borderColor + '80'\n : context.dataset.backgroundColor;\n\n return {\n borderColor: context.dataset.borderColor,\n backgroundColor: PerDatapointColors\n ? BgColor[context.dataIndex]\n : BgColor,\n borderRadius: 2,\n };\n },\n },\n },\n },\n };\n\n if (MultiAxis) {\n const ThirdAxisId = Object.keys(ctx.options.scales).find(\n (scaleId) => scaleId !== 'x' && scaleId !== 'y'\n );\n\n options.scales[ThirdAxisId] = {\n title: {\n display: true,\n padding: { bottom: 8, top: 0 },\n },\n position: 'right',\n grid: {\n drawOnChartArea: false,\n drawTicks: false,\n color: GridLinesColor,\n },\n border: {\n display: false,\n },\n };\n }\n\n return options;\n};\n\nexport default defaultConfig;\n"],"names":["defaultConfig","ctx","GridLinesColor","getTokenThemeVal","AxisTextColor","MultiAxis","options","scales","Object","keys","length","CommonAxisOptions","grid","drawTicks","color","ticks","padding","border","display","title","x","text","y","bottom","top","plugins","tooltip","callbacks","labelColor","context","PerDatapointColors","Array","isArray","dataset","backgroundColor","BgColor","borderColor","dataIndex","borderRadius","ThirdAxisId","find","scaleId","position","drawOnChartArea"],"mappings":"wHAEK,MAACA,EAAiBC,IACrB,MAAMC,EAAiBC,EAAiB,oCAClCC,EAAgBD,EAAiB,iCAEjCE,EACJJ,EAAIK,QAAQC,QAAUC,OAAOC,KAAKR,EAAIK,QAAQC,QAAQG,OAAS,EAE3DC,EAAoB,CACxBC,KAAM,CACJC,WAAW,EACXC,MAAOZ,GAETa,MAAO,CACLC,QAAS,EACTF,MAAOV,GAETa,OAAQ,CACNC,SAAS,GAEXC,MAAO,CACLL,MAAOV,EACPc,SAAS,IAIPZ,EAAU,CACdC,OAAQ,CACNa,EAAG,CACDD,MAAO,CACLD,SAAS,EACTG,KAAM,UACNL,QAAS,MAERL,GAELW,EAAG,CACDH,MAAO,CACLD,SAAS,EACTG,KAAM,UACNL,QAAS,CAAEO,OAAQ,EAAGC,IAAK,OAE1Bb,IAGPc,QAAS,CACPC,QAAS,CACPC,UAAW,CACTC,WAAY,SAAUC,GACpB,MAAMC,EAAqBC,MAAMC,QAC/BH,EAAQI,QAAQC,iBAIZC,EADsC,mBAAnCN,EAAQI,QAAQC,gBAErBL,EAAQI,QAAQG,YAAc,KAC9BP,EAAQI,QAAQC,gBAEpB,MAAO,CACLE,YAAaP,EAAQI,QAAQG,YAC7BF,gBAAiBJ,EACbK,EAAQN,EAAQQ,WAChBF,EACJG,aAAc,EAEjB,MAMT,GAAIjC,EAAW,CACb,MAAMkC,EAAc/B,OAAOC,KAAKR,EAAIK,QAAQC,QAAQiC,MACjDC,GAAwB,MAAZA,GAA+B,MAAZA,IAGlCnC,EAAQC,OAAOgC,GAAe,CAC5BpB,MAAO,CACLD,SAAS,EACTF,QAAS,CAAEO,OAAQ,EAAGC,IAAK,IAE7BkB,SAAU,QACV9B,KAAM,CACJ+B,iBAAiB,EACjB9B,WAAW,EACXC,MAAOZ,GAETe,OAAQ,CACNC,SAAS,GAGd,CAED,OAAOZ,CAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const r=r=>
|
|
1
|
+
import{getTokenThemeVal as o}from'./../../external/@kyndryl-design-system/shidoka-foundation/common/helpers/color.js';const r=r=>{const l=o("--kd-color-background-page-default"),e=o("--kd-color-text-level-primary"),a={x:{title:{text:"X Axis",color:e},grid:{display:!1},ticks:{display:!1,color:e},border:{display:!1}},y:{title:{text:"Y Axis",color:e},grid:{display:!1},ticks:{display:!1,color:e},border:{display:!1}}},t=r.type||r.chart?.config.type;return"radar"!==t&&"polarArea"!==t||(a.r={grid:{display:!0},angleLines:{display:!0},ticks:{color:e},pointLabels:{color:e}}),{elements:{arc:{borderColor:l}},scales:a,plugins:{tooltip:{callbacks:{labelColor(o){const r=o.dataset.backgroundColor,l=Array.isArray(r);return{borderColor:o.dataset.borderColor,backgroundColor:l?r[o.dataIndex]:r,borderRadius:2}}}}}}};export{r as default};
|
|
2
2
|
//# sourceMappingURL=globalOptionsRadial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalOptionsRadial.js","sources":["../../../src/common/config/globalOptionsRadial.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const ArcColor = getTokenThemeVal('--kd-color-background-page-default');\n\n
|
|
1
|
+
{"version":3,"file":"globalOptionsRadial.js","sources":["../../../src/common/config/globalOptionsRadial.js"],"sourcesContent":["import { getTokenThemeVal } from '@kyndryl-design-system/shidoka-foundation/common/helpers/color';\n\nconst defaultConfig = (ctx) => {\n const ArcColor = getTokenThemeVal('--kd-color-background-page-default');\n const AxisTextColor = getTokenThemeVal('--kd-color-text-level-primary');\n\n const scales = {\n x: {\n title: { text: 'X Axis', color: AxisTextColor },\n grid: { display: false },\n ticks: { display: false, color: AxisTextColor },\n border: { display: false },\n },\n y: {\n title: { text: 'Y Axis', color: AxisTextColor },\n grid: { display: false },\n ticks: { display: false, color: AxisTextColor },\n border: { display: false },\n },\n };\n\n const chartType = ctx.type || ctx.chart?.config.type;\n if (chartType === 'radar' || chartType === 'polarArea') {\n scales.r = {\n grid: { display: true },\n angleLines: { display: true },\n ticks: { color: AxisTextColor },\n pointLabels: { color: AxisTextColor },\n };\n }\n\n return {\n elements: {\n arc: { borderColor: ArcColor },\n },\n scales,\n plugins: {\n tooltip: {\n callbacks: {\n labelColor(context) {\n const bg = context.dataset.backgroundColor;\n const perPoint = Array.isArray(bg);\n return {\n borderColor: context.dataset.borderColor,\n backgroundColor: perPoint ? bg[context.dataIndex] : bg,\n borderRadius: 2,\n };\n },\n },\n },\n },\n };\n};\n\nexport default defaultConfig;\n"],"names":["defaultConfig","ctx","ArcColor","getTokenThemeVal","AxisTextColor","scales","x","title","text","color","grid","display","ticks","border","y","chartType","type","chart","config","r","angleLines","pointLabels","elements","arc","borderColor","plugins","tooltip","callbacks","labelColor","context","bg","dataset","backgroundColor","perPoint","Array","isArray","dataIndex","borderRadius"],"mappings":"wHAEK,MAACA,EAAiBC,IACrB,MAAMC,EAAWC,EAAiB,sCAC5BC,EAAgBD,EAAiB,iCAEjCE,EAAS,CACbC,EAAG,CACDC,MAAO,CAAEC,KAAM,SAAUC,MAAOL,GAChCM,KAAM,CAAEC,SAAS,GACjBC,MAAO,CAAED,SAAS,EAAOF,MAAOL,GAChCS,OAAQ,CAAEF,SAAS,IAErBG,EAAG,CACDP,MAAO,CAAEC,KAAM,SAAUC,MAAOL,GAChCM,KAAM,CAAEC,SAAS,GACjBC,MAAO,CAAED,SAAS,EAAOF,MAAOL,GAChCS,OAAQ,CAAEF,SAAS,KAIjBI,EAAYd,EAAIe,MAAQf,EAAIgB,OAAOC,OAAOF,KAUhD,MATkB,UAAdD,GAAuC,cAAdA,IAC3BV,EAAOc,EAAI,CACTT,KAAM,CAAEC,SAAS,GACjBS,WAAY,CAAET,SAAS,GACvBC,MAAO,CAAEH,MAAOL,GAChBiB,YAAa,CAAEZ,MAAOL,KAInB,CACLkB,SAAU,CACRC,IAAK,CAAEC,YAAatB,IAEtBG,SACAoB,QAAS,CACPC,QAAS,CACPC,UAAW,CACT,UAAAC,CAAWC,GACT,MAAMC,EAAKD,EAAQE,QAAQC,gBACrBC,EAAWC,MAAMC,QAAQL,GAC/B,MAAO,CACLN,YAAaK,EAAQE,QAAQP,YAC7BQ,gBAAiBC,EAAWH,EAAGD,EAAQO,WAAaN,EACpDO,aAAc,EAEjB,KAIR"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function renderBoxplotViolinTableHeader(): import("lit-html").TemplateResult<1>;
|
|
2
|
+
export declare function renderBoxplotViolinTableRow(label: string, values: number[]): import("lit-html").TemplateResult<1>;
|
|
3
|
+
export declare function renderBoxplotViolinTable(labels: string[], datasets: any[], axisLabel: string): import("lit-html").TemplateResult<1>;
|
|
4
|
+
//# sourceMappingURL=boxplotViolinTableRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplotViolinTableRenderer.d.ts","sourceRoot":"","sources":["../../../src/common/helpers/boxplotViolinTableRenderer.ts"],"names":[],"mappings":"AAEA,wBAAgB,8BAA8B,yCAa7C;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,wCAiE1E;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,GAAG,EAAE,EACf,SAAS,EAAE,MAAM,wCAyGlB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import'./../../external/@lit/reactive-element/reactive-element.js';import{html as t}from'./../../external/lit-html/lit-html.js';import'./../../external/lit-element/lit-element.js';function e(e,l,d){return l&&l.length&&e&&e.length?t`
|
|
2
|
+
<thead>
|
|
3
|
+
<tr>
|
|
4
|
+
<th>${d}</th>
|
|
5
|
+
${l.map((e=>t`
|
|
6
|
+
<th>${e.label||"Dataset"} (Min)</th>
|
|
7
|
+
<th>${e.label||"Dataset"} (Q1)</th>
|
|
8
|
+
<th>${e.label||"Dataset"} (Median)</th>
|
|
9
|
+
<th>${e.label||"Dataset"} (Q3)</th>
|
|
10
|
+
<th>${e.label||"Dataset"} (Max)</th>
|
|
11
|
+
<th>${e.label||"Dataset"} (IQR)</th>
|
|
12
|
+
<th>${e.label||"Dataset"} (Outlier(s))</th>
|
|
13
|
+
`))}
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
${e.map(((e,d)=>t`
|
|
18
|
+
<tr>
|
|
19
|
+
<td>${e}</td>
|
|
20
|
+
${l.map((e=>{const l=e.data[d];if(!l||!l.length)return t`
|
|
21
|
+
<td>-</td>
|
|
22
|
+
<td>-</td>
|
|
23
|
+
<td>-</td>
|
|
24
|
+
<td>-</td>
|
|
25
|
+
<td>-</td>
|
|
26
|
+
<td>-</td>
|
|
27
|
+
<td>-</td>
|
|
28
|
+
`;const a=[...l].sort(((t,e)=>t-e)),h=a.length,o=a[0],n=a[h-1],r=h%2==0?(a[h/2-1]+a[h/2])/2:a[Math.floor(h/2)],i=a.slice(0,Math.floor(h/2)),s=h%2==0?a.slice(h/2):a.slice(Math.floor(h/2)+1),$=i.length%2==0?(i[i.length/2-1]+i[i.length/2])/2:i[Math.floor(i.length/2)],m=s.length%2==0?(s[s.length/2-1]+s[s.length/2])/2:s[Math.floor(s.length/2)],b=m-$,g=$-1.5*b,f=m+1.5*b,c=a.filter((t=>t<g||t>f));return t`
|
|
29
|
+
<td>${o}</td>
|
|
30
|
+
<td>${$}</td>
|
|
31
|
+
<td>${r}</td>
|
|
32
|
+
<td>${m}</td>
|
|
33
|
+
<td>${n}</td>
|
|
34
|
+
<td>${b.toFixed(2)}</td>
|
|
35
|
+
<td>${c.length?c.join(", "):"–"}</td>
|
|
36
|
+
`}))}
|
|
37
|
+
</tr>
|
|
38
|
+
`))}
|
|
39
|
+
</tbody>
|
|
40
|
+
`:t`
|
|
41
|
+
<thead>
|
|
42
|
+
<tr>
|
|
43
|
+
<th>No data available</th>
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
<tr>
|
|
48
|
+
<td>No data available for display</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</tbody>
|
|
51
|
+
`}export{e as renderBoxplotViolinTable};
|
|
52
|
+
//# sourceMappingURL=boxplotViolinTableRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplotViolinTableRenderer.js","sources":["../../../src/common/helpers/boxplotViolinTableRenderer.ts"],"sourcesContent":["import { html } from 'lit';\n\nexport function renderBoxplotViolinTableHeader() {\n return html`\n <tr>\n <th>Group</th>\n <th>Minimum</th>\n <th>Q1</th>\n <th>Median</th>\n <th>Q3</th>\n <th>Maximum</th>\n <th>IQR</th>\n <th>Outlier(s)</th>\n </tr>\n `;\n}\n\nexport function renderBoxplotViolinTableRow(label: string, values: number[]) {\n if (!values || !values.length) {\n return html`\n <tr>\n <td>${label}</td>\n <td>–</td>\n <td>–</td>\n <td>–</td>\n <td>–</td>\n <td>–</td>\n <td>–</td>\n <td>–</td>\n </tr>\n `;\n }\n\n const sortedValues = [...values].sort((a, b) => a - b);\n const len = sortedValues.length;\n\n const min = sortedValues[0];\n const max = sortedValues[len - 1];\n const median =\n len % 2 === 0\n ? (sortedValues[len / 2 - 1] + sortedValues[len / 2]) / 2\n : sortedValues[Math.floor(len / 2)];\n\n const lowerHalf = sortedValues.slice(0, Math.floor(len / 2));\n const upperHalf =\n len % 2 === 0\n ? sortedValues.slice(len / 2)\n : sortedValues.slice(Math.floor(len / 2) + 1);\n\n const q1 =\n lowerHalf.length % 2 === 0\n ? (lowerHalf[lowerHalf.length / 2 - 1] +\n lowerHalf[lowerHalf.length / 2]) /\n 2\n : lowerHalf[Math.floor(lowerHalf.length / 2)];\n\n const q3 =\n upperHalf.length % 2 === 0\n ? (upperHalf[upperHalf.length / 2 - 1] +\n upperHalf[upperHalf.length / 2]) /\n 2\n : upperHalf[Math.floor(upperHalf.length / 2)];\n\n const iqr = q3 - q1;\n const lowerBound = q1 - 1.5 * iqr;\n const upperBound = q3 + 1.5 * iqr;\n const outliers = sortedValues.filter(\n (value) => value < lowerBound || value > upperBound\n );\n\n return html`\n <tr>\n <td>${label}</td>\n <td>${min}</td>\n <td>${q1}</td>\n <td>${median}</td>\n <td>${q3}</td>\n <td>${max}</td>\n <td>${iqr.toFixed(2)}</td>\n <td>${outliers.length ? outliers.join(', ') : '–'}</td>\n </tr>\n `;\n}\n\nexport function renderBoxplotViolinTable(\n labels: string[],\n datasets: any[],\n axisLabel: string\n) {\n if (!datasets || !datasets.length || !labels || !labels.length) {\n return html`\n <thead>\n <tr>\n <th>No data available</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>No data available for display</td>\n </tr>\n </tbody>\n `;\n }\n\n return html`\n <thead>\n <tr>\n <th>${axisLabel}</th>\n ${datasets.map(\n (dataset) => html`\n <th>${dataset.label || 'Dataset'} (Min)</th>\n <th>${dataset.label || 'Dataset'} (Q1)</th>\n <th>${dataset.label || 'Dataset'} (Median)</th>\n <th>${dataset.label || 'Dataset'} (Q3)</th>\n <th>${dataset.label || 'Dataset'} (Max)</th>\n <th>${dataset.label || 'Dataset'} (IQR)</th>\n <th>${dataset.label || 'Dataset'} (Outlier(s))</th>\n `\n )}\n </tr>\n </thead>\n <tbody>\n ${labels.map(\n (label, i) => html`\n <tr>\n <td>${label}</td>\n ${datasets.map((dataset) => {\n const values = dataset.data[i];\n if (!values || !values.length) {\n return html`\n <td>-</td>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n `;\n }\n\n const sortedValues = [...values].sort((a, b) => a - b);\n const len = sortedValues.length;\n\n const min = sortedValues[0];\n const max = sortedValues[len - 1];\n const median =\n len % 2 === 0\n ? (sortedValues[len / 2 - 1] + sortedValues[len / 2]) / 2\n : sortedValues[Math.floor(len / 2)];\n\n const lowerHalf = sortedValues.slice(0, Math.floor(len / 2));\n const upperHalf =\n len % 2 === 0\n ? sortedValues.slice(len / 2)\n : sortedValues.slice(Math.floor(len / 2) + 1);\n\n const q1 =\n lowerHalf.length % 2 === 0\n ? (lowerHalf[lowerHalf.length / 2 - 1] +\n lowerHalf[lowerHalf.length / 2]) /\n 2\n : lowerHalf[Math.floor(lowerHalf.length / 2)];\n\n const q3 =\n upperHalf.length % 2 === 0\n ? (upperHalf[upperHalf.length / 2 - 1] +\n upperHalf[upperHalf.length / 2]) /\n 2\n : upperHalf[Math.floor(upperHalf.length / 2)];\n\n const iqr = q3 - q1;\n const lowerBound = q1 - 1.5 * iqr;\n const upperBound = q3 + 1.5 * iqr;\n const outliers = sortedValues.filter(\n (value) => value < lowerBound || value > upperBound\n );\n\n return html`\n <td>${min}</td>\n <td>${q1}</td>\n <td>${median}</td>\n <td>${q3}</td>\n <td>${max}</td>\n <td>${iqr.toFixed(2)}</td>\n <td>${outliers.length ? outliers.join(', ') : '–'}</td>\n `;\n })}\n </tr>\n `\n )}\n </tbody>\n `;\n}\n"],"names":["renderBoxplotViolinTable","labels","datasets","axisLabel","length","html","map","dataset","label","i","values","data","sortedValues","sort","a","b","len","min","max","median","Math","floor","lowerHalf","slice","upperHalf","q1","q3","iqr","lowerBound","upperBound","outliers","filter","value","toFixed","join"],"mappings":"mMAoFgBA,EACdC,EACAC,EACAC,GAEA,OAAKD,GAAaA,EAASE,QAAWH,GAAWA,EAAOG,OAejDC,CAAI;;;cAGCF;UACJD,EAASI,KACRC,GAAYF,CAAI;kBACTE,EAAQC,OAAS;kBACjBD,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,EAAS1B,OAAS0B,EAASI,KAAK,MAAQ;eAC/C;;;;IA/FJ7B,CAAI;;;;;;;;;;;KAsGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/chart/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/chart/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,0BAA0B,CAAC;AA2DlC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,E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