@bino-bi/bn-template-engine 1.0.0-next.32 → 1.0.0-next.34

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 (112) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-66ed6259.entry.js +1 -0
  3. package/dist/bn-template-engine/p-789bfd06.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-BTbeDWM9.js → p-CAvWZ3a5.js} +1 -1
  5. package/dist/bn-template-engine/p-_SKPuKfK.js +1 -0
  6. package/dist/bn-template-engine/p-dc12ff1b.entry.js +1 -0
  7. package/dist/bn-template-engine/p-dec6837c.entry.js +1 -0
  8. package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +76 -28
  9. package/dist/cjs/bn-grid.cjs.entry.js +52 -15
  10. package/dist/cjs/bn-image.cjs.entry.js +1 -1
  11. package/dist/cjs/bn-text.cjs.entry.js +2 -2
  12. package/dist/cjs/{withStyled-Ds3e64Nz.js → withStyled-eHD8Yt2K.js} +6 -1
  13. package/dist/cjs/{withTranslation-Cjvvs3gL.js → withTranslation-yJ-j0lsu.js} +1 -1
  14. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -2
  15. package/dist/collection/components/bn-chart-structure/utils/model/DataPoint.js +5 -2
  16. package/dist/collection/components/bn-chart-time/bn-chart-time.js +2 -2
  17. package/dist/collection/components/bn-chart-time/utils/model/DataPoint.js +5 -2
  18. package/dist/collection/components/bn-grid/bn-grid.js +51 -14
  19. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -0
  20. package/dist/collection/components/bn-layout-card/bn-layout-card.js +2 -2
  21. package/dist/collection/components/bn-layout-page/bn-layout-page.js +2 -2
  22. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.js +1 -1
  23. package/dist/collection/components/bn-table/bn-table.js +2 -2
  24. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +23 -6
  25. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +15 -6
  26. package/dist/collection/components/bn-title/bn-title.js +2 -2
  27. package/dist/collection/utils/constants.js +5 -0
  28. package/dist/collection/utils/model/VarianceScenario.js +21 -2
  29. package/dist/collection/utils/xy/VarianceMeasure.js +1 -1
  30. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  31. package/dist/components/bn-chart-bubble.js +1 -1
  32. package/dist/components/bn-chart-bullet-renderer.js +1 -1
  33. package/dist/components/bn-chart-bullet.js +1 -1
  34. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  35. package/dist/components/bn-chart-scatter.js +1 -1
  36. package/dist/components/bn-chart-structure-renderer.js +1 -1
  37. package/dist/components/bn-chart-structure.js +1 -1
  38. package/dist/components/bn-chart-time-renderer.js +1 -1
  39. package/dist/components/bn-chart-time.js +1 -1
  40. package/dist/components/bn-grid.js +1 -1
  41. package/dist/components/bn-image.js +1 -1
  42. package/dist/components/bn-layout-card.js +1 -1
  43. package/dist/components/bn-layout-page.js +1 -1
  44. package/dist/components/bn-page.js +1 -1
  45. package/dist/components/bn-table-renderer.js +1 -1
  46. package/dist/components/bn-table.js +1 -1
  47. package/dist/components/bn-text.js +1 -1
  48. package/dist/components/bn-title-renderer.js +1 -1
  49. package/dist/components/bn-title.js +1 -1
  50. package/dist/components/bn-tree.js +1 -1
  51. package/dist/components/{p-0gehv1XG.js → p-4BanAktr.js} +1 -1
  52. package/dist/components/{p-BoUkFdpu.js → p-B3F_c9GB.js} +1 -1
  53. package/dist/components/{p-CtBM3KFY.js → p-B4pmO5QQ.js} +1 -1
  54. package/dist/components/{p-DyO09Jk6.js → p-B7UDMyar.js} +1 -1
  55. package/dist/components/{p-CxPSvrcF.js → p-BNWZoAip.js} +1 -1
  56. package/dist/components/p-BT2WH_CP.js +1 -0
  57. package/dist/components/{p-BPJsmv3o.js → p-BVnYDfb8.js} +1 -1
  58. package/dist/components/p-BWRE5w0i.js +1 -0
  59. package/dist/components/{p-DPLcGhVt.js → p-BXt0ers2.js} +1 -1
  60. package/dist/components/{p-BpCL2bfw.js → p-BldMZbAf.js} +1 -1
  61. package/dist/components/p-BtH2oezK.js +1 -0
  62. package/dist/components/{p-CMM8vtHW.js → p-C-oNdJj9.js} +1 -1
  63. package/dist/components/{p-D5-dYgK_.js → p-CJtE8Pyr.js} +1 -1
  64. package/dist/components/p-CLkpoHdg.js +1 -0
  65. package/dist/components/{p-z56_ZQ42.js → p-CPC9Vkmg.js} +1 -1
  66. package/dist/components/p-CYqHwYgQ.js +1 -0
  67. package/dist/components/{p-DYG9FH_u.js → p-CYv_8LrR.js} +1 -1
  68. package/dist/components/p-Ckl1aEvn.js +1 -0
  69. package/dist/components/p-D5LDmR4u.js +1 -0
  70. package/dist/components/{p-COqIkH1M.js → p-DHAoxu6M.js} +1 -1
  71. package/dist/components/{p-DdGnuNtc.js → p-DLLljAll.js} +1 -1
  72. package/dist/components/p-DdG2Ylar.js +1 -0
  73. package/dist/components/{p-LZ9lAY8T.js → p-Dn3DJxQQ.js} +1 -1
  74. package/dist/components/{p-BohXdw3-.js → p-GrpYAVHb.js} +1 -1
  75. package/dist/components/p-M6hn0BuZ.js +1 -0
  76. package/dist/components/{p-Dlb4ncGF.js → p-VIw66ez1.js} +1 -1
  77. package/dist/components/p-nHZ8466v.js +1 -0
  78. package/dist/esm/bn-annotation-layer_30.entry.js +76 -28
  79. package/dist/esm/bn-grid.entry.js +52 -15
  80. package/dist/esm/bn-image.entry.js +1 -1
  81. package/dist/esm/bn-text.entry.js +2 -2
  82. package/dist/esm/{withStyled-B-cbWCe2.js → withStyled-Cxua0iTP.js} +6 -1
  83. package/dist/esm/{withTranslation-_8q-7Y9C.js → withTranslation-BeAbw2--.js} +1 -1
  84. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +1 -0
  85. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +4 -1
  86. package/dist/types/components/bn-grid/bn-grid.d.ts +6 -2
  87. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +4 -3
  88. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +4 -3
  89. package/dist/types/components/bn-table/bn-table.d.ts +4 -1
  90. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  91. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +4 -0
  92. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +3 -3
  93. package/dist/types/components/bn-title/bn-title.d.ts +1 -1
  94. package/dist/types/components.d.ts +12 -12
  95. package/dist/types/utils/constants.d.ts +6 -1
  96. package/dist/types/utils/model/VarianceScenario.d.ts +13 -1
  97. package/package.json +1 -1
  98. package/dist/bn-template-engine/p-225cd474.entry.js +0 -1
  99. package/dist/bn-template-engine/p-58b10778.entry.js +0 -1
  100. package/dist/bn-template-engine/p-9f3cbc5f.entry.js +0 -1
  101. package/dist/bn-template-engine/p-BjR3nkhl.js +0 -1
  102. package/dist/bn-template-engine/p-ce39e111.entry.js +0 -1
  103. package/dist/components/p-B2jqpOF9.js +0 -1
  104. package/dist/components/p-BQMKgvEC.js +0 -1
  105. package/dist/components/p-BpsXOtoW.js +0 -1
  106. package/dist/components/p-CDoSPw-I.js +0 -1
  107. package/dist/components/p-CujsXn-l.js +0 -1
  108. package/dist/components/p-D4FY_yoG.js +0 -1
  109. package/dist/components/p-oJjMz8JF.js +0 -1
  110. package/dist/components/p-xpguaboj.js +0 -1
  111. package/dist/components/p-yH-XxIy9.js +0 -1
  112. package/dist/components/p-zf8cTH63.js +0 -1
@@ -1 +1 @@
1
- import{p as t,H as i,h as s,a as e,t as h}from"./p-D6YGOYV1.js";import{g as n,d as r}from"./p-BcOud3dQ.js";import{A as a,C as o}from"./p-BQMKgvEC.js";import{C as l,F as d,s as u,I as c}from"./p-xpguaboj.js";import{w as m}from"./p-DEHnizot.js";import{S as p,F as g,a as f,P as v}from"./p-D5-dYgK_.js";import{d as b,l as w,S as $}from"./p-COqIkH1M.js";import{S as y}from"./p-CtBM3KFY.js";import{e as M,r as S}from"./p-ClruFZD_.js";import{O as x}from"./p-CxPSvrcF.js";import{N as E}from"./p-BJmwHV0a.js";import{s as j}from"./p-Xb6Ilq8u.js";import{B as C}from"./p-t4xPltK2.js";class N{constructor(t,i,s,e,h,n){this.ruleSet=t,this.config=e,this.styles=h,this.availableWidth=n,this.rows=[],this.warnings=[],this.i18nMap=new Map,this.populateModel(i,s),this.normalized="target"===this.config.normalize&&this.rows.some((t=>null!==t.fraction)),null!==this.config.target&&this.rows.length>0&&!this.rows.some((t=>null!==t.target))&&this.warnings.push({code:"bullet-target-none",data:{}})}populateModel(t,i){var s,e,h;if(""===i)return;const n=this.config.level,r=this.config.order,a=this.config.actual.measure,o=null!==(e=null===(s=this.config.target)||void 0===s?void 0:s.measure)&&void 0!==e?e:null,l="transformOperator(operation)",d=[a,...null!==o?[o]:[]].map((t=>`CASE WHEN MIN(${l}) = MAX(${l}) THEN SUM(${t}) ELSE SUM(${t} * ${l}) END as ${t}, SUM(ABS(${t})) as ${t}_gross, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(", ");let u;try{u=t.exec(`SELECT ${this.createSelectString(n,r)}, ${d},\n MIN(transformOperator(operation)) as opMin, MAX(transformOperator(operation)) as opMax\n FROM ${i}\n GROUP BY ${this.createGroupByStr(n,r)}\n ORDER BY ${this.createOrderStr(n,r)}`)}catch(t){return void(this.queryError=M(t))}let c=null!=u?u:[];this.config.limit>0&&(c=c.slice(0,this.config.limit));let m=0,p=0,g=0,f=0;for(const t of c){const i="number"==typeof t.opMin?t.opMin:1,s="number"==typeof t.opMax?t.opMax:1;let e=-1===i&&-1===s?"-":"+";i!==s&&(e="+",m++);const n=this.readValue(t,a),r=null!==o?this.readValue(t,o):null;null!==n&&n<0&&f++;let l=null;"target"===this.config.normalize&&(null===r?null!==o&&p++:r<=0?g++:null!==n&&n>=0&&(l=n/r)),this.rows.push({category:String(null!==(h=t.category)&&void 0!==h?h:""),actual:n,target:r,operation:e,sentiment:this.sentiment(n,r,e),fraction:l})}m>0&&this.warnings.push({code:"bullet-mixed-operation",data:{count:String(m)}}),p>0&&this.warnings.push({code:"bullet-target-missing",data:{count:String(p)}}),g>0&&this.warnings.push({code:"bullet-target-invalid",data:{count:String(g)}}),f>0&&this.warnings.push({code:"bullet-actual-negative",data:{count:String(f)}})}readValue(t,i){if(0===t[`${i}_cnt`])return null;const s=t[i],e=t[`${i}_gross`];return"number"==typeof s&&"number"==typeof e&&Math.abs(s)<=1e-9*e?0:"number"==typeof s&&isFinite(s)?s:null}sentiment(t,i,s){return null===t||null===i||t===i?"neu":t>i!=("-"===s)?"pos":"neg"}createSelectString(t,i){return t===a.CATEGORY&&i.hierarchy.includes(x.CATEGORYINDEX)?`${x.CATEGORYINDEX}, ${a.CATEGORY} as category`:t===a.ROWGROUP&&i.hierarchy.includes(x.ROWGROUPINDEX)?`${x.ROWGROUPINDEX}, ${a.ROWGROUP} as category`:t===a.SUBCATEGORY&&i.hierarchy.includes(x.SUBCATEGORYINDEX)?`${x.SUBCATEGORYINDEX}, ${a.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===a.CATEGORY&&i.hierarchy.includes(x.CATEGORYINDEX)?`${x.CATEGORYINDEX}, ${a.CATEGORY}`:t===a.ROWGROUP&&i.hierarchy.includes(x.ROWGROUPINDEX)?`${x.ROWGROUPINDEX}, ${a.ROWGROUP}`:t===a.SUBCATEGORY&&i.hierarchy.includes(x.SUBCATEGORYINDEX)?`${x.SUBCATEGORYINDEX}, ${a.SUBCATEGORY}`:`${t.toString()}`}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=i.hierarchy.map((t=>`${t} ${i.direction}`)).toString()),s}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,e,h={}){var n,r,a;return t.text(i).font({size:null!==(n=h.size)&&void 0!==n?n:this.styles.fontStyles.size,weight:h.bold?"bold":"normal",anchor:null!==(r=h.anchor)&&void 0!==r?r:"start"}).fill(null!==(a=h.color)&&void 0!==a?a:this.styles.fontStyles.color).attr({x:s,y:e,"font-family":this.fontFamily()})}setI18n(t){this.i18nMap=t}hasNoData(){return 0===this.rows.length}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.styles.padding.top+this.titleHeight()+this.headerHeight()+this.rows.length*this.rowBlockHeight()+this.styles.padding.bottom}titleHeight(){return""!==this.config.chartTitle?1.6*this.em:0}headerHeight(){return this.rows.length>0?1.2*this.em:0}rowBlockHeight(){const t=this.em,i=this.styles.scaleFactors.rowHeight*t;return this.normalized?i:i+this.styles.scaleFactors.tickStripHeight*t}valueLabel(t){return null===t||"none"===this.config.labels.show?"":d.number(t,"decimal",this.config.labels.decimals,0,1,this.styles.locale)}targetFamily(){var t,i;const s=null!==(i=null===(t=this.config.target)||void 0===t?void 0:t.measure)&&void 0!==i?i:"pl1";return u(this.ruleSet.getScenarioColorIndex(s))}actualLabel(){var t;return null!==(t=this.config.actual.label)&&void 0!==t?t:d.translateScenarioLabel(this.config.actual.measure,this.i18nMap)}targetLabel(){return null===this.config.target?"":void 0!==this.config.target.label?this.config.target.label:this.normalized?this.i18nMap.get("target")||"Target":d.translateScenarioLabel(this.config.target.measure,this.i18nMap)}toString(){const t=new p;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s;const e=this.em,h=this.styles.scaleFactors,n=this.styles.padding,r=t.group();if(""!==this.config.chartTitle&&this.drawText(r,this.config.chartTitle,n.left,n.top+e,{bold:!0}),0===this.rows.length)return void t.group().addClass("annotations");const a=h.rowHeight*e,o=this.rowBlockHeight(),l=n.top+this.titleHeight()+this.headerHeight(),d=l+(this.rows.length-1)*o+a,u=Math.max(...this.rows.map((t=>this.textWidth(t.category,!0))),e),c=this.rows.map((t=>this.valueLabel(t.actual))),m="none"===this.config.labels.show?0:Math.max(...c.map((t=>this.textWidth(t))),0),p=n.left+u+h.labelToAxis*e,g=Math.max(10,this.availableWidth-p-n.right-m-(m>0?h.labelToBar*e:0)),f=null!==(i=this.config.actual.unit)&&void 0!==i?i:null===(s=this.config.target)||void 0===s?void 0:s.unit,v=this.i18nMap.get("axis.in")||"in",b=l-.35*e;void 0!==f&&""!==f&&this.drawText(r,`${v} ${f}`,n.left,b,{}),this.drawText(r,this.actualLabel(),p+.2*e,b,{}),this.normalized?this.drawNormalized(r,p,g,l,d,a,o,c):this.drawClassic(r,p,g,l,a,o,c),this.rows.forEach(((t,i)=>{this.drawText(r,t.category,p-h.labelToAxis*e,l+i*o+a/2+.35*e,{anchor:"end",bold:!0})})),r.line(p,l-.2*e,p,d+.2*e).stroke({color:this.styles.axisStyles.ac.stroke,width:j(h.axisLineWidth,this.em)}).attr(C,"axis"),t.group().addClass("annotations")}drawNormalized(t,i,s,e,h,n,r,a){const o=this.em,l=this.styles.scaleFactors,d=1.05*Math.max(1,...this.rows.map((t=>{var i;return null!==(i=t.fraction)&&void 0!==i?i:0}))),u=t=>i+t/d*s,c=u(1),m=this.styles.barStyles.getSVGStyle(this.targetFamily()),p=t.line(c,e-.3*o,c,h+.3*o).stroke({color:m.stroke,width:j(l.targetLineWidth,this.em)});void 0!==m.dasharray&&p.attr("stroke-dasharray",m.dasharray),this.drawText(t,this.targetLabel(),c,e-.35*o,{anchor:"middle",bold:!0}),this.rows.forEach(((s,h)=>{const d=e+h*r+n/2;if(null===s.fraction)return void this.drawValueText(t,a[h],i+l.labelToBar*o,d,s);const m=l.barHeight*o,p=u(s.fraction);if(t.rect(Math.max(0,p-i),m).move(i,d-m/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}).attr(b(this.rowKey(s),"element")).attr("data-bn-index",String(h)),this.config.showVariances&&"neu"!==s.sentiment){const i=l.varianceHeight*o,e=this.styles.varianceStyles.getSVGStyle(s.sentiment);t.rect(Math.abs(p-c),i).move(Math.min(p,c),d-i/2).fill(e.fill).stroke({color:e.stroke,width:e.width})}this.drawValueText(t,a[h],Math.max(p,c)+l.labelToBar*o,d,s)}))}drawClassic(t,i,s,e,h,n,r){const a=this.em,o=this.styles.scaleFactors,l=o.barHeight*a,u=this.config.ranges.length>0;this.rows.forEach(((c,m)=>{var p,g;const f=e+m*n,v=f+h/2,w=u&&null!==c.target?this.config.ranges.map((t=>t*c.target)):[],$=Math.max(null!==(p=c.actual)&&void 0!==p?p:0,null!==(g=c.target)&&void 0!==g?g:0,...w);if($<=0)return void this.drawValueText(t,r[m],i+o.labelToBar*a,v,c);const y=E.niceStep($,4),M=Math.ceil($/y-1e-9*y)*y,S=new E(0,M,i,i+s);let x=i;w.forEach(((i,s)=>{const e=.8*h;t.rect(Math.max(0,S.scale(i)-x),e).move(x,v-e/2).fill(this.styles.rangeColors[Math.min(s,this.styles.rangeColors.length-1)]).stroke("none"),x=S.scale(i)}));let C=i;if(null!==c.actual&&c.actual>0){const s=S.scale(c.actual);t.rect(s-i,l).move(i,v-l/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}).attr(b(this.rowKey(c),"element")).attr("data-bn-index",String(m)),C=s}if(null!==c.target&&c.target>0){const i=S.scale(c.target),s=o.targetTickHeight*a,h=this.styles.barStyles.getSVGStyle(this.targetFamily()),n=t.line(i,v-s/2,i,v+s/2).stroke({color:h.stroke,width:j(o.targetLineWidth,this.em)});void 0!==h.dasharray&&n.attr("stroke-dasharray",h.dasharray),0===m&&this.drawText(t,this.targetLabel(),i,e-.35*a,{anchor:"middle"}),C=Math.max(C,i)}C=Math.max(C,x),this.drawValueText(t,r[m],C+o.labelToBar*a,v,c);const N=S.ticks(4),O=E.tickDecimals(N),D=f+h;for(const i of N){const s=S.scale(i);t.line(s,D,s,D+o.axisTickLength*a).stroke({color:this.styles.axisStyles.ac.stroke,width:j(o.axisLineWidth,this.em)}),this.drawText(t,d.number(i,"decimal",O,O,1,this.styles.locale),s,D+o.tickStripHeight*a-.2*a,{anchor:"middle"})}}))}drawValueText(t,i,s,e,h){""!==i&&this.drawText(t,i,s,e+.35*this.em,{}).attr(b(this.rowKey(h),"label"))}rowKey(t){return Object.assign(Object.assign({},w(this.config.level,t.category)),{scenario:this.config.actual.measure})}}class O{constructor(){this.rowHeight=1.9,this.barHeight=.66,this.varianceHeight=.4,this.targetTickHeight=1.1,this.targetLineWidth=.15,this.axisLineWidth=.075,this.labelToBar=.3,this.labelToAxis=.3,this.axisTickLength=.35,this.tickStripHeight=1.2}}class D{adapt(t){const i=new O;return o.isNumber(t.rowHeight)&&(i.rowHeight=t.rowHeight),o.isNumber(t.barHeight)&&(i.barHeight=t.barHeight),o.isNumber(t.varianceHeight)&&(i.varianceHeight=t.varianceHeight),o.isNumber(t.targetTickHeight)&&(i.targetTickHeight=t.targetTickHeight),o.isNumber(t.targetLineWidth)&&(i.targetLineWidth=t.targetLineWidth),o.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),o.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),o.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),o.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),o.isNumber(t.tickStripHeight)&&(i.tickStripHeight=t.tickStripHeight),i}default(){return new O}}class F{constructor(t,i,s,e,h,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=e,this.varianceStyles=h,this.padding=n,this.rangeColors=["#D9D9D9","#EFEFEF"],this.locale="de"}}class z{constructor(t,i,s,e,h){this.scaleFactorsBulletChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=e,this.paddingAdapter=h}adapt(t){const i=this.default();return o.isExisting(t)&&(o.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsBulletChartAdapter.adapt(t.scaleFactors)),o.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),o.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),o.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),o.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),o.isExisting(t.padding)&&(i.padding=this.paddingAdapter.adapt(t.padding)),Array.isArray(t.rangeColors)&&t.rangeColors.length>0&&(i.rangeColors=t.rangeColors)),i}default(){return new F(this.scaleFactorsBulletChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingAdapter.default())}}const B=["bullet-target-missing","bullet-target-invalid","bullet-actual-negative","bullet-mixed-operation","bullet-target-none"],H=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.target=null,this.ranges=[],this.normalizeMode="target",this.showVariances=!0,this.level=a.CATEGORY,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",m(this)}getDb(){return this.stores||(this.stores=n(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=r(this.getDb(),this.tableName,this.filter);this.chart=new N(new c(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,actual:this.actual,target:this.target,ranges:this.ranges,normalize:this.normalizeMode,showVariances:this.showVariances,level:this.level,order:this.order,limit:this.limit,labels:this.labels},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),S(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of B){const s=`WARN_${t.replace(/-/g,"_")}`;if(i.has(t)){const e=void 0!==this.translator?this.translator(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:e})}else this.errors.remove(s)}}prepareStyle(){var t,i;const s=new z(new D,new g,new f(new $),new y(new $),new v).adapt(this.styles);return s.locale=(null===(i=null===(t=n(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return s(e,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(e,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(e,null,s("div",{innerHTML:this.svgMarkup}))}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}'}},[1,"bn-chart-bullet-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],actual:[16],target:[16],ranges:[16],normalizeMode:[1,"normalize-mode"],showVariances:[4,"show-variances"],level:[1],order:[16],limit:[2],labels:[16],filter:[1],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function W(){"undefined"!=typeof customElements&&["bn-chart-bullet-renderer"].forEach((t=>{"bn-chart-bullet-renderer"===t&&(customElements.get(h(t))||customElements.define(h(t),H))}))}export{H as B,W as d}
1
+ import{p as t,H as i,h as s,a as e,t as h}from"./p-D6YGOYV1.js";import{g as n,d as r}from"./p-BcOud3dQ.js";import{A as a,C as o}from"./p-D5LDmR4u.js";import{C as l,F as d,s as u,I as c}from"./p-M6hn0BuZ.js";import{w as m}from"./p-DEHnizot.js";import{S as p,F as g,a as f,P as v}from"./p-CJtE8Pyr.js";import{d as b,l as w,S as y}from"./p-DHAoxu6M.js";import{S as $}from"./p-B4pmO5QQ.js";import{e as M,r as S}from"./p-ClruFZD_.js";import{O as x}from"./p-BNWZoAip.js";import{N as E}from"./p-BJmwHV0a.js";import{s as j}from"./p-Xb6Ilq8u.js";import{B as N}from"./p-t4xPltK2.js";class D{constructor(t,i,s,e,h,n){this.ruleSet=t,this.config=e,this.styles=h,this.availableWidth=n,this.rows=[],this.warnings=[],this.i18nMap=new Map,this.populateModel(i,s),this.normalized="target"===this.config.normalize&&this.rows.some((t=>null!==t.fraction)),null!==this.config.target&&this.rows.length>0&&!this.rows.some((t=>null!==t.target))&&this.warnings.push({code:"bullet-target-none",data:{}})}populateModel(t,i){var s,e,h;if(""===i)return;const n=this.config.level,r=this.config.order,a=this.config.actual.measure,o=null!==(e=null===(s=this.config.target)||void 0===s?void 0:s.measure)&&void 0!==e?e:null,l="transformOperator(operation)",d=[a,...null!==o?[o]:[]].map((t=>`CASE WHEN MIN(${l}) = MAX(${l}) THEN SUM(${t}) ELSE SUM(${t} * ${l}) END as ${t}, SUM(ABS(${t})) as ${t}_gross, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(", ");let u;try{u=t.exec(`SELECT ${this.createSelectString(n,r)}, ${d},\n MIN(transformOperator(operation)) as opMin, MAX(transformOperator(operation)) as opMax\n FROM ${i}\n GROUP BY ${this.createGroupByStr(n,r)}\n ORDER BY ${this.createOrderStr(n,r)}`)}catch(t){return void(this.queryError=M(t))}let c=null!=u?u:[];this.config.limit>0&&(c=c.slice(0,this.config.limit));let m=0,p=0,g=0,f=0;for(const t of c){const i="number"==typeof t.opMin?t.opMin:1,s="number"==typeof t.opMax?t.opMax:1;let e=-1===i&&-1===s?"-":"+";i!==s&&(e="+",m++);const n=this.readValue(t,a),r=null!==o?this.readValue(t,o):null;null!==n&&n<0&&f++;let l=null;"target"===this.config.normalize&&(null===r?null!==o&&p++:r<=0?g++:null!==n&&n>=0&&(l=n/r)),this.rows.push({category:String(null!==(h=t.category)&&void 0!==h?h:""),actual:n,target:r,operation:e,sentiment:this.sentiment(n,r,e),fraction:l})}m>0&&this.warnings.push({code:"bullet-mixed-operation",data:{count:String(m)}}),p>0&&this.warnings.push({code:"bullet-target-missing",data:{count:String(p)}}),g>0&&this.warnings.push({code:"bullet-target-invalid",data:{count:String(g)}}),f>0&&this.warnings.push({code:"bullet-actual-negative",data:{count:String(f)}})}readValue(t,i){if(0===t[`${i}_cnt`])return null;const s=t[i],e=t[`${i}_gross`];return"number"==typeof s&&"number"==typeof e&&Math.abs(s)<=1e-9*e?0:"number"==typeof s&&isFinite(s)?s:null}sentiment(t,i,s){return null===t||null===i||t===i?"neu":t>i!=("-"===s)?"pos":"neg"}createSelectString(t,i){return t===a.CATEGORY&&i.hierarchy.includes(x.CATEGORYINDEX)?`${x.CATEGORYINDEX}, ${a.CATEGORY} as category`:t===a.ROWGROUP&&i.hierarchy.includes(x.ROWGROUPINDEX)?`${x.ROWGROUPINDEX}, ${a.ROWGROUP} as category`:t===a.SUBCATEGORY&&i.hierarchy.includes(x.SUBCATEGORYINDEX)?`${x.SUBCATEGORYINDEX}, ${a.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===a.CATEGORY&&i.hierarchy.includes(x.CATEGORYINDEX)?`${x.CATEGORYINDEX}, ${a.CATEGORY}`:t===a.ROWGROUP&&i.hierarchy.includes(x.ROWGROUPINDEX)?`${x.ROWGROUPINDEX}, ${a.ROWGROUP}`:t===a.SUBCATEGORY&&i.hierarchy.includes(x.SUBCATEGORYINDEX)?`${x.SUBCATEGORYINDEX}, ${a.SUBCATEGORY}`:`${t.toString()}`}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=i.hierarchy.map((t=>`${t} ${i.direction}`)).toString()),s}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,e,h={}){var n,r,a;return t.text(i).font({size:null!==(n=h.size)&&void 0!==n?n:this.styles.fontStyles.size,weight:h.bold?"bold":"normal",anchor:null!==(r=h.anchor)&&void 0!==r?r:"start"}).fill(null!==(a=h.color)&&void 0!==a?a:this.styles.fontStyles.color).attr({x:s,y:e,"font-family":this.fontFamily()})}setI18n(t){this.i18nMap=t}hasNoData(){return 0===this.rows.length}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.styles.padding.top+this.titleHeight()+this.headerHeight()+this.rows.length*this.rowBlockHeight()+this.styles.padding.bottom}titleHeight(){return""!==this.config.chartTitle?1.6*this.em:0}headerHeight(){return this.rows.length>0?1.2*this.em:0}rowBlockHeight(){const t=this.em,i=this.styles.scaleFactors.rowHeight*t;return this.normalized?i:i+this.styles.scaleFactors.tickStripHeight*t}valueLabel(t){return null===t||"none"===this.config.labels.show?"":d.number(t,"decimal",this.config.labels.decimals,0,1,this.styles.locale)}targetFamily(){var t,i;const s=null!==(i=null===(t=this.config.target)||void 0===t?void 0:t.measure)&&void 0!==i?i:"pl1";return u(this.ruleSet.getScenarioColorIndex(s))}actualLabel(){var t;return null!==(t=this.config.actual.label)&&void 0!==t?t:d.translateScenarioLabel(this.config.actual.measure,this.i18nMap)}targetLabel(){return null===this.config.target?"":void 0!==this.config.target.label?this.config.target.label:this.normalized?this.i18nMap.get("target")||"Target":d.translateScenarioLabel(this.config.target.measure,this.i18nMap)}toString(){const t=new p;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s;const e=this.em,h=this.styles.scaleFactors,n=this.styles.padding,r=t.group();if(""!==this.config.chartTitle&&this.drawText(r,this.config.chartTitle,n.left,n.top+e,{bold:!0}),0===this.rows.length)return void t.group().addClass("annotations");const a=h.rowHeight*e,o=this.rowBlockHeight(),l=n.top+this.titleHeight()+this.headerHeight(),d=l+(this.rows.length-1)*o+a,u=Math.max(...this.rows.map((t=>this.textWidth(t.category,!0))),e),c=this.rows.map((t=>this.valueLabel(t.actual))),m="none"===this.config.labels.show?0:Math.max(...c.map((t=>this.textWidth(t))),0),p=n.left+u+h.labelToAxis*e,g=Math.max(10,this.availableWidth-p-n.right-m-(m>0?h.labelToBar*e:0)),f=null!==(i=this.config.actual.unit)&&void 0!==i?i:null===(s=this.config.target)||void 0===s?void 0:s.unit,v=this.i18nMap.get("axis.in")||"in",b=l-.35*e;void 0!==f&&""!==f&&this.drawText(r,`${v} ${f}`,n.left,b,{}),this.drawText(r,this.actualLabel(),p+.2*e,b,{}),this.normalized?this.drawNormalized(r,p,g,l,d,a,o,c):this.drawClassic(r,p,g,l,a,o,c),this.rows.forEach(((t,i)=>{this.drawText(r,t.category,p-h.labelToAxis*e,l+i*o+a/2+.35*e,{anchor:"end",bold:!0})})),r.line(p,l-.2*e,p,d+.2*e).stroke({color:this.styles.axisStyles.ac.stroke,width:j(h.axisLineWidth,this.em)}).attr(N,"axis"),t.group().addClass("annotations")}drawNormalized(t,i,s,e,h,n,r,a){const o=this.em,l=this.styles.scaleFactors,d=1.05*Math.max(1,...this.rows.map((t=>{var i;return null!==(i=t.fraction)&&void 0!==i?i:0}))),u=t=>i+t/d*s,c=u(1),m=this.styles.barStyles.getSVGStyle(this.targetFamily()),p=t.line(c,e-.3*o,c,h+.3*o).stroke({color:m.stroke,width:j(l.targetLineWidth,this.em)});void 0!==m.dasharray&&p.attr("stroke-dasharray",m.dasharray),this.drawText(t,this.targetLabel(),c,e-.35*o,{anchor:"middle",bold:!0}),this.rows.forEach(((s,h)=>{const d=e+h*r+n/2;if(null===s.fraction)return void this.drawValueText(t,a[h],i+l.labelToBar*o,d,s);const m=l.barHeight*o,p=u(s.fraction);if(t.rect(Math.max(0,p-i),m).move(i,d-m/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}).attr(b(this.rowKey(s),"element")).attr("data-bn-index",String(h)),this.config.showVariances&&"neu"!==s.sentiment){const i=l.varianceHeight*o,e=this.styles.varianceStyles.getSVGStyle(s.sentiment);t.rect(Math.abs(p-c),i).move(Math.min(p,c),d-i/2).fill(e.fill).stroke({color:e.stroke,width:e.width})}this.drawValueText(t,a[h],Math.max(p,c)+l.labelToBar*o,d,s)}))}drawClassic(t,i,s,e,h,n,r){const a=this.em,o=this.styles.scaleFactors,l=o.barHeight*a,u=this.config.ranges.length>0;this.rows.forEach(((c,m)=>{var p,g;const f=e+m*n,v=f+h/2,w=u&&null!==c.target?this.config.ranges.map((t=>t*c.target)):[],y=Math.max(null!==(p=c.actual)&&void 0!==p?p:0,null!==(g=c.target)&&void 0!==g?g:0,...w);if(y<=0)return void this.drawValueText(t,r[m],i+o.labelToBar*a,v,c);const $=E.niceStep(y,4),M=Math.ceil(y/$-1e-9*$)*$,S=new E(0,M,i,i+s);let x=i;w.forEach(((i,s)=>{const e=.8*h;t.rect(Math.max(0,S.scale(i)-x),e).move(x,v-e/2).fill(this.styles.rangeColors[Math.min(s,this.styles.rangeColors.length-1)]).stroke("none"),x=S.scale(i)}));let N=i;if(null!==c.actual&&c.actual>0){const s=S.scale(c.actual);t.rect(s-i,l).move(i,v-l/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}).attr(b(this.rowKey(c),"element")).attr("data-bn-index",String(m)),N=s}if(null!==c.target&&c.target>0){const i=S.scale(c.target),s=o.targetTickHeight*a,h=this.styles.barStyles.getSVGStyle(this.targetFamily()),n=t.line(i,v-s/2,i,v+s/2).stroke({color:h.stroke,width:j(o.targetLineWidth,this.em)});void 0!==h.dasharray&&n.attr("stroke-dasharray",h.dasharray),0===m&&this.drawText(t,this.targetLabel(),i,e-.35*a,{anchor:"middle"}),N=Math.max(N,i)}N=Math.max(N,x),this.drawValueText(t,r[m],N+o.labelToBar*a,v,c);const D=S.ticks(4),O=E.tickDecimals(D),B=f+h;for(const i of D){const s=S.scale(i);t.line(s,B,s,B+o.axisTickLength*a).stroke({color:this.styles.axisStyles.ac.stroke,width:j(o.axisLineWidth,this.em)}),this.drawText(t,d.number(i,"decimal",O,O,1,this.styles.locale),s,B+o.tickStripHeight*a-.2*a,{anchor:"middle"})}}))}drawValueText(t,i,s,e,h){""!==i&&this.drawText(t,i,s,e+.35*this.em,{}).attr(b(this.rowKey(h),"label"))}rowKey(t){return Object.assign(Object.assign({},w(this.config.level,t.category)),{scenario:this.config.actual.measure})}}class O{constructor(){this.rowHeight=1.9,this.barHeight=.66,this.varianceHeight=.4,this.targetTickHeight=1.1,this.targetLineWidth=.15,this.axisLineWidth=.075,this.labelToBar=.3,this.labelToAxis=.3,this.axisTickLength=.35,this.tickStripHeight=1.2}}class B{adapt(t){const i=new O;return o.isNumber(t.rowHeight)&&(i.rowHeight=t.rowHeight),o.isNumber(t.barHeight)&&(i.barHeight=t.barHeight),o.isNumber(t.varianceHeight)&&(i.varianceHeight=t.varianceHeight),o.isNumber(t.targetTickHeight)&&(i.targetTickHeight=t.targetTickHeight),o.isNumber(t.targetLineWidth)&&(i.targetLineWidth=t.targetLineWidth),o.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),o.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),o.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),o.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),o.isNumber(t.tickStripHeight)&&(i.tickStripHeight=t.tickStripHeight),i}default(){return new O}}class C{constructor(t,i,s,e,h,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=e,this.varianceStyles=h,this.padding=n,this.rangeColors=["#D9D9D9","#EFEFEF"],this.locale="de"}}class z{constructor(t,i,s,e,h){this.scaleFactorsBulletChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=e,this.paddingAdapter=h}adapt(t){const i=this.default();return o.isExisting(t)&&(o.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsBulletChartAdapter.adapt(t.scaleFactors)),o.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),o.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),o.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),o.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),o.isExisting(t.padding)&&(i.padding=this.paddingAdapter.adapt(t.padding)),Array.isArray(t.rangeColors)&&t.rangeColors.length>0&&(i.rangeColors=t.rangeColors)),i}default(){return new C(this.scaleFactorsBulletChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingAdapter.default())}}const A=["bullet-target-missing","bullet-target-invalid","bullet-actual-negative","bullet-mixed-operation","bullet-target-none"],W=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.target=null,this.ranges=[],this.normalizeMode="target",this.showVariances=!0,this.level=a.CATEGORY,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",m(this)}getDb(){return this.stores||(this.stores=n(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=r(this.getDb(),this.tableName,this.filter);this.chart=new D(new c(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,actual:this.actual,target:this.target,ranges:this.ranges,normalize:this.normalizeMode,showVariances:this.showVariances,level:this.level,order:this.order,limit:this.limit,labels:this.labels},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),S(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of A){const s=`WARN_${t.replace(/-/g,"_")}`;if(i.has(t)){const e=void 0!==this.translator?this.translator(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:e})}else this.errors.remove(s)}}prepareStyle(){var t,i;const s=new z(new B,new g,new f(new y),new $(new y),new v).adapt(this.styles);return s.locale=(null===(i=null===(t=n(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return s(e,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(e,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(e,null,s("div",{innerHTML:this.svgMarkup}))}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}'}},[1,"bn-chart-bullet-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],actual:[16],target:[16],ranges:[16],normalizeMode:[1,"normalize-mode"],showVariances:[4,"show-variances"],level:[1],order:[16],limit:[2],labels:[16],filter:[1],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function F(){"undefined"!=typeof customElements&&["bn-chart-bullet-renderer"].forEach((t=>{"bn-chart-bullet-renderer"===t&&(customElements.get(h(t))||customElements.define(h(t),W))}))}export{W as B,F as d}
@@ -1 +1 @@
1
- import{g as n,c as o,R as t}from"./p-BcOud3dQ.js";import{f as e,g as i}from"./p-D6YGOYV1.js";import{r}from"./p-DEHnizot.js";import{i as s}from"./p-DYG9FH_u.js";const l="inherited-page",u="bn-layout-page";function a(n){return"inherited-closest"===n||n===l}function c(n,o){const t=[];let e=n.parentNode;for(;e;){const n=e.nodeName.toLowerCase();if(n===u){t.push(e);break}if("bn-layout-card"===n&&o!==l&&t.push(e),e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}return t}function d(n,o){var t;const e=n=>{const t=n.getAttribute(o),e=null==t?void 0:t.trim();return s(e)||a(e)?void 0:t};for(const i of n){if((null===(t=i.getAttribute(o))||void 0===t?void 0:t.trim())===l){const o=n.find((n=>n.nodeName.toLowerCase()===u)),t=o&&e(o);if(void 0!==t)return t;continue}const r=e(i);if(void 0!==r)return r}}const v=(n,o,t)=>{const s=new Map,u=new Map;let v=null;const f=()=>{var t;const r=i(n);s.clear(),u.clear(),v&&(v.disconnect(),v=null);const l=new Map;for(const e of o){const o=n[e.propName];if("string"!=typeof o||!a(o))continue;u.set(e.propName,o);const i=c(r,o),v=d(i,e.ancestorAttr);void 0!==v&&s.set(e.propName,v);for(const n of i)l.set(n,[...null!==(t=l.get(n))&&void 0!==t?t:[],e.ancestorAttr])}if(l.size>0){v=new MutationObserver((()=>{f(),e(n)}));for(const[n,o]of l)v.observe(n,{attributes:!0,attributeFilter:o})}},p=n.connectedCallback;n.connectedCallback=()=>{f(),r(p,n)};const m=n.disconnectedCallback;n.disconnectedCallback=()=>{v&&(v.disconnect(),v=null),s.clear(),u.clear(),r(m,n)};const b=n=>{var t;return null===(t=o.find((o=>o.propName===n)))||void 0===t?void 0:t.ancestorAttr.replace(/-(\w)/g,((n,o)=>o.toUpperCase()))};return(n,o,e)=>{const i=`WARN_inherited_${n}`,r=a(o);r&&u.get(n)!==o&&f();const c=r?s.get(n):void 0;return r&&void 0===c?(null==t||t.addOrReplace({id:i,type:"warning",message:`${n}: '${o}' could not be resolved, no surrounding ${o===l?"page":"card or page"} sets ${b(n)}`}),{value:e,inherited:!1,unresolved:!0}):(null==t||t.remove(i),{value:null!=c?c:o,inherited:void 0!==c,unresolved:!1})}},f=s=>{let l,u,a,c,d=null;const v=()=>{const n=i(s);if(d&&(d.disconnect(),d=null),a=s.i18nNamespace,u=a,null!=u)return;const o=function(n){let o=n.parentNode;for(;o;){if(o instanceof HTMLElement&&o.hasAttribute("i18n-namespace"))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(n);o&&(u=o.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{v(),e(s)})),d.observe(o,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=s.connectedCallback;s.connectedCallback=()=>{const o=i(s);c=n(o),v(),l=c.internationalization.on("set",(n=>{n!==u&&"_system"!==n||e(s)})),r(f,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),r(l),o(i(s)),r(p,s)},{t:(n,o)=>{var e,r,l,d,f;void 0!==c&&s.i18nNamespace!==a&&v(),n.startsWith(".")&&(n=i(s).localName+n),Object.prototype.hasOwnProperty.call(t,n)&&(n=t[n]);const p=c.internationalization.state,m=c.context.state.locale,b=null!==(l=null===(r=null===(e=p[u])||void 0===e?void 0:e[m])||void 0===r?void 0:r[n])&&void 0!==l?l:null===(f=null===(d=p._system)||void 0===d?void 0:d[m])||void 0===f?void 0:f[n];return null==b?n:b.replace(/{{([\s\S]+?)}}/g,((n,t)=>{var e;return null!==(e=null==o?void 0:o[t.trim()])&&void 0!==e?e:""}))}}};export{v as a,c as f,a as i,d as r,f as w}
1
+ import{g as n,c as o,R as t}from"./p-BcOud3dQ.js";import{f as e,g as i}from"./p-D6YGOYV1.js";import{r}from"./p-DEHnizot.js";import{i as s}from"./p-CYv_8LrR.js";const l="inherited-page",u="bn-layout-page";function a(n){return"inherited-closest"===n||n===l}function c(n,o){const t=[];let e=n.parentNode;for(;e;){const n=e.nodeName.toLowerCase();if(n===u){t.push(e);break}if("bn-layout-card"===n&&o!==l&&t.push(e),e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}return t}function d(n,o){var t;const e=n=>{const t=n.getAttribute(o),e=null==t?void 0:t.trim();return s(e)||a(e)?void 0:t};for(const i of n){if((null===(t=i.getAttribute(o))||void 0===t?void 0:t.trim())===l){const o=n.find((n=>n.nodeName.toLowerCase()===u)),t=o&&e(o);if(void 0!==t)return t;continue}const r=e(i);if(void 0!==r)return r}}const v=(n,o,t)=>{const s=new Map,u=new Map;let v=null;const f=()=>{var t;const r=i(n);s.clear(),u.clear(),v&&(v.disconnect(),v=null);const l=new Map;for(const e of o){const o=n[e.propName];if("string"!=typeof o||!a(o))continue;u.set(e.propName,o);const i=c(r,o),v=d(i,e.ancestorAttr);void 0!==v&&s.set(e.propName,v);for(const n of i)l.set(n,[...null!==(t=l.get(n))&&void 0!==t?t:[],e.ancestorAttr])}if(l.size>0){v=new MutationObserver((()=>{f(),e(n)}));for(const[n,o]of l)v.observe(n,{attributes:!0,attributeFilter:o})}},p=n.connectedCallback;n.connectedCallback=()=>{f(),r(p,n)};const m=n.disconnectedCallback;n.disconnectedCallback=()=>{v&&(v.disconnect(),v=null),s.clear(),u.clear(),r(m,n)};const b=n=>{var t;return null===(t=o.find((o=>o.propName===n)))||void 0===t?void 0:t.ancestorAttr.replace(/-(\w)/g,((n,o)=>o.toUpperCase()))};return(n,o,e)=>{const i=`WARN_inherited_${n}`,r=a(o);r&&u.get(n)!==o&&f();const c=r?s.get(n):void 0;return r&&void 0===c?(null==t||t.addOrReplace({id:i,type:"warning",message:`${n}: '${o}' could not be resolved, no surrounding ${o===l?"page":"card or page"} sets ${b(n)}`}),{value:e,inherited:!1,unresolved:!0}):(null==t||t.remove(i),{value:null!=c?c:o,inherited:void 0!==c,unresolved:!1})}},f=s=>{let l,u,a,c,d=null;const v=()=>{const n=i(s);if(d&&(d.disconnect(),d=null),a=s.i18nNamespace,u=a,null!=u)return;const o=function(n){let o=n.parentNode;for(;o;){if(o instanceof HTMLElement&&o.hasAttribute("i18n-namespace"))return o;if(o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}}(n);o&&(u=o.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{v(),e(s)})),d.observe(o,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=s.connectedCallback;s.connectedCallback=()=>{const o=i(s);c=n(o),v(),l=c.internationalization.on("set",(n=>{n!==u&&"_system"!==n||e(s)})),r(f,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),r(l),o(i(s)),r(p,s)},{t:(n,o)=>{var e,r,l,d,f;void 0!==c&&s.i18nNamespace!==a&&v(),n.startsWith(".")&&(n=i(s).localName+n),Object.prototype.hasOwnProperty.call(t,n)&&(n=t[n]);const p=c.internationalization.state,m=c.context.state.locale,b=null!==(l=null===(r=null===(e=p[u])||void 0===e?void 0:e[m])||void 0===r?void 0:r[n])&&void 0!==l?l:null===(f=null===(d=p._system)||void 0===d?void 0:d[m])||void 0===f?void 0:f[n];return null==b?n:b.replace(/{{([\s\S]+?)}}/g,((n,t)=>{var e;return null!==(e=null==o?void 0:o[t.trim()])&&void 0!==e?e:""}))}}};export{v as a,c as f,a as i,d as r,f as w}
@@ -1 +1 @@
1
- import{C as t}from"./p-BQMKgvEC.js";class s{constructor(t,s,i){this.pos=t,this.neg=s,this.neu=i,this.needleHeadColour="#000000"}getSVGStyle(t){return"pos"===t?this.pos:"neg"===t?this.neg:this.neu}}class i{constructor(t){this.svgStyleAdapter=t}adapt(i){const h=new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu());return t.isExisting(i.pos)&&(h.pos=this.svgStyleAdapter.adapt(i.pos)),t.isExisting(i.neg)&&(h.neg=this.svgStyleAdapter.adapt(i.neg)),t.isExisting(i.pp)&&(h.neu=this.svgStyleAdapter.adapt(i.neu)),t.isString(i.needleHeadColour)&&(h.needleHeadColour=i.needleHeadColour),h}default(){return new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu())}}export{i as S}
1
+ import{C as t}from"./p-D5LDmR4u.js";class s{constructor(t,s,i){this.pos=t,this.neg=s,this.neu=i,this.needleHeadColour="#000000"}getSVGStyle(t){return"pos"===t?this.pos:"neg"===t?this.neg:this.neu}}class i{constructor(t){this.svgStyleAdapter=t}adapt(i){const h=new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu());return t.isExisting(i.pos)&&(h.pos=this.svgStyleAdapter.adapt(i.pos)),t.isExisting(i.neg)&&(h.neg=this.svgStyleAdapter.adapt(i.neg)),t.isExisting(i.pp)&&(h.neu=this.svgStyleAdapter.adapt(i.neu)),t.isString(i.needleHeadColour)&&(h.needleHeadColour=i.needleHeadColour),h}default(){return new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu())}}export{i as S}
@@ -1 +1 @@
1
- import{C as t}from"./p-BQMKgvEC.js";import{X as s}from"./p-BcOud3dQ.js";import{L as i,H as n}from"./p-DPLcGhVt.js";import{F as o,C as e}from"./p-xpguaboj.js";import{N as r}from"./p-BJmwHV0a.js";import{s as h}from"./p-Xb6Ilq8u.js";import{B as l}from"./p-t4xPltK2.js";import{D as a}from"./p-DEHnizot.js";import{b as c}from"./p-BpsXOtoW.js";class u{constructor(t,i,n,o){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=n,this.padding=o,this.seriesColors=[...s],this.locale="de"}}class f{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new u(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class d{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=.075,this.gridLineWidth=.075}}class v{adapt(s){const i=new d;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new d}}function p(t,s,i){const n={[i.pointLevel]:t.name};return null!==i.seriesLevel&&""!==t.seriesKey&&(n[i.seriesLevel]=t.seriesKey),null!==i.facet&&""!==s&&(n["rowgroup"===i.facet.level?"rowGroup":"category"]=s),n}class m{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}function w(t,s,i,n=!1){return o.number(t,n?"percent":"decimal",s,s,1,i)}function x(t,s){return r.tickDecimals(s?t.map((t=>100*t)):t)}const y=["n","ne","e","se","s","sw","w","nw"],b=Math.SQRT1_2;class g{constructor(t,s,n=new i){this.frame=t,this.gapPx=s,this.manager=n}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of y){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*b+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,o){return{x:t,y:s,width:i,height:o,pointIndex:0,preferredHook:n.Center}}}class M{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:h(this.styles.scaleFactors.refLineWidth,this.em)};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)}).attr(l,"frame")}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const r of s.ticksX){const h=this.xScale.scale(r);t.text(w(r,s.xDecimals,this.styles.locale,s.xPercent)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:h,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const r of s.ticksY){const h=this.yScale.scale(r);t.text(w(r,s.yDecimals,this.styles.locale,s.yPercent)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:h+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class N{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=e(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of[...t.compareEntries,...t.entries])s.push({text:i.label,bold:!1,treatment:i.treatment,fill:i.fill});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){var e;const r=this.rows(s),h=this.swatchSize+.4*this.em;let l=i,a=n;for(const s of r){let i=l;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(l,a+(this.rowHeight-this.swatchSize)/2).fill(null!==(e=s.fill)&&void 0!==e?e:s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=h}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:a+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?l=i+this.textWidth(s.text,s.bold)+1.5*this.em:a+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class j{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const S=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class k{adapt(s){const i=new j;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=a.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of S){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new j}}const z={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function O(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function B(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function D(t,s){return"scenario"!==t.kind?null:s+c(t.slot)}function C(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,p=0,m=0,w=0,x=0;const y=new Map,b=new Map,g=new Map,M=null!==(i=s.compareFamily)&&void 0!==i?i:null,N=null!==M?D(s.measures.x,M):null,j=null!==M?D(s.measures.y,M):null,S=null!==M&&void 0!==s.measures.size?D(s.measures.size,M):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",M=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",k=`${u}\0${M}\0${t}`;if(f.has(k)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const D=O(i,s.measures.x),C=O(i,s.measures.y);if(null===D.value||null===C.value){(D.varianceNoData||C.varianceNoData)&&p++;continue}if(B(D.value,null===(e=s.domains)||void 0===e?void 0:e.x)||B(C.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const F={name:t,seriesKey:M,facetKey:u,x:D.value,y:C.value,row:i};if(void 0!==s.measures.size){const t=O(i,s.measures.size).value;if(null===t)continue;if(t<0){w++;continue}F.size=t}if(void 0!==s.measures.share){const t=O(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,F.share=Math.min(1,Math.max(0,t))):F.share=t)}if(null!==N&&null!==j){const t=i.slotValue(N),n=i.slotValue(j),o=null!==S?i.slotValue(S):null;null===t||null===n||null!==S&&null===o?F.compare=null:B(t,null===(h=s.domains)||void 0===h?void 0:h.x)||B(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,F.compare=null):(F.compare={x:t,y:n},null!==o&&(F.compare.size=o))}if(f.add(k),g.has(u)||g.set(u,[]),g.get(u).push(F),null!==s.facetLevel){const t=i[z[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[z[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(M))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(M,t)}}const k=[...g.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),C=k.map((t=>{let i=g.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),F=new Set;for(const t of C)for(const s of t.points)F.add(s.seriesKey);const H=[...F].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let I=null,L=0;for(const t of C)for(const s of t.points){L++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===I&&(I={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)I.xMin=Math.min(I.xMin,s),I.xMax=Math.max(I.xMax,s);for(const t of i)I.yMin=Math.min(I.yMin,t),I.yMax=Math.max(I.yMax,t);for(const t of n)I.sizeMax=Math.max(I.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),p>0&&u.push({code:"xy-variance-nodata",data:{count:String(p)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),w>0&&u.push({code:"bubble-size-negative",data:{count:String(w)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:C,series:H,extents:I,warnings:u,totalPoints:L}}export{m as F,g as P,v as S,k as X,N as a,M as b,p as c,f as d,w as f,C as r,x}
1
+ import{C as t}from"./p-D5LDmR4u.js";import{X as s}from"./p-BcOud3dQ.js";import{L as i,H as n}from"./p-BXt0ers2.js";import{F as o,C as e}from"./p-M6hn0BuZ.js";import{N as r}from"./p-BJmwHV0a.js";import{s as h}from"./p-Xb6Ilq8u.js";import{B as l}from"./p-t4xPltK2.js";import{D as a}from"./p-DEHnizot.js";import{b as c}from"./p-CLkpoHdg.js";class u{constructor(t,i,n,o){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=n,this.padding=o,this.seriesColors=[...s],this.locale="de"}}class f{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new u(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class d{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=.075,this.gridLineWidth=.075}}class v{adapt(s){const i=new d;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new d}}function p(t,s,i){const n={[i.pointLevel]:t.name};return null!==i.seriesLevel&&""!==t.seriesKey&&(n[i.seriesLevel]=t.seriesKey),null!==i.facet&&""!==s&&(n["rowgroup"===i.facet.level?"rowGroup":"category"]=s),n}class m{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}function w(t,s,i,n=!1){return o.number(t,n?"percent":"decimal",s,s,1,i)}function x(t,s){return r.tickDecimals(s?t.map((t=>100*t)):t)}const y=["n","ne","e","se","s","sw","w","nw"],b=Math.SQRT1_2;class g{constructor(t,s,n=new i){this.frame=t,this.gapPx=s,this.manager=n}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of y){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*b+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,o){return{x:t,y:s,width:i,height:o,pointIndex:0,preferredHook:n.Center}}}class M{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:h(this.styles.scaleFactors.refLineWidth,this.em)};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:h(this.styles.scaleFactors.gridLineWidth,this.em)}).attr(l,"frame")}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const r of s.ticksX){const h=this.xScale.scale(r);t.text(w(r,s.xDecimals,this.styles.locale,s.xPercent)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:h,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const r of s.ticksY){const h=this.yScale.scale(r);t.text(w(r,s.yDecimals,this.styles.locale,s.yPercent)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:h+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class N{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=e(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of[...t.compareEntries,...t.entries])s.push({text:i.label,bold:!1,treatment:i.treatment,fill:i.fill});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){var e;const r=this.rows(s),h=this.swatchSize+.4*this.em;let l=i,a=n;for(const s of r){let i=l;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(l,a+(this.rowHeight-this.swatchSize)/2).fill(null!==(e=s.fill)&&void 0!==e?e:s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=h}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:a+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?l=i+this.textWidth(s.text,s.bold)+1.5*this.em:a+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class j{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const S=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class k{adapt(s){const i=new j;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=a.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of S){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new j}}const z={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function B(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function D(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function O(t,s){return"scenario"!==t.kind?null:s+c(t.slot)}function H(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,p=0,m=0,w=0,x=0;const y=new Map,b=new Map,g=new Map,M=null!==(i=s.compareFamily)&&void 0!==i?i:null,N=null!==M?O(s.measures.x,M):null,j=null!==M?O(s.measures.y,M):null,S=null!==M&&void 0!==s.measures.size?O(s.measures.size,M):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",M=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",k=`${u}\0${M}\0${t}`;if(f.has(k)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const O=B(i,s.measures.x),H=B(i,s.measures.y);if(null===O.value||null===H.value){(O.varianceNoData||H.varianceNoData)&&p++;continue}if(D(O.value,null===(e=s.domains)||void 0===e?void 0:e.x)||D(H.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const C={name:t,seriesKey:M,facetKey:u,x:O.value,y:H.value,row:i};if(void 0!==s.measures.size){const t=B(i,s.measures.size).value;if(null===t)continue;if(t<0){w++;continue}C.size=t}if(void 0!==s.measures.share){const t=B(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,C.share=Math.min(1,Math.max(0,t))):C.share=t)}if(null!==N&&null!==j){const t=i.slotValue(N),n=i.slotValue(j),o=null!==S?i.slotValue(S):null;null===t||null===n||null!==S&&null===o?C.compare=null:D(t,null===(h=s.domains)||void 0===h?void 0:h.x)||D(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,C.compare=null):(C.compare={x:t,y:n},null!==o&&(C.compare.size=o))}if(f.add(k),g.has(u)||g.set(u,[]),g.get(u).push(C),null!==s.facetLevel){const t=i[z[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[z[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(M))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(M,t)}}const k=[...g.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),H=k.map((t=>{let i=g.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),C=new Set;for(const t of H)for(const s of t.points)C.add(s.seriesKey);const F=[...C].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let L=null,I=0;for(const t of H)for(const s of t.points){I++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===L&&(L={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)L.xMin=Math.min(L.xMin,s),L.xMax=Math.max(L.xMax,s);for(const t of i)L.yMin=Math.min(L.yMin,t),L.yMax=Math.max(L.yMax,t);for(const t of n)L.sizeMax=Math.max(L.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),p>0&&u.push({code:"xy-variance-nodata",data:{count:String(p)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),w>0&&u.push({code:"bubble-size-negative",data:{count:String(w)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),I>5e3&&u.push({code:"xy-point-budget",data:{count:String(I)}}),{facets:H,series:F,extents:L,warnings:u,totalPoints:I}}export{m as F,g as P,v as S,k as X,N as a,M as b,p as c,f as d,w as f,H as r,x}
@@ -1 +1 @@
1
- import{A as a}from"./p-CMM8vtHW.js";var c,t;!function(a){a.ASC="asc",a.DESC="desc"}(c||(c={})),function(a){a.ROWGROUP="rowGroup",a.ROWGROUPINDEX="rowGroupIndex",a.CATEGORY="category",a.CATEGORYINDEX="categoryIndex",a.SUBCATEGORY="subCategory",a.SUBCATEGORYINDEX="subCategoryIndex",a.AC1="ac1",a.AC2="ac2",a.AC3="ac3",a.AC4="ac4",a.PP1="pp1",a.PP2="pp2",a.PP3="pp3",a.PP4="pp4",a.FC1="fc1",a.FC2="fc2",a.FC3="fc3",a.FC4="fc4",a.PL1="pl1",a.PL2="pl2",a.PL3="pl3",a.PL4="pl4"}(t||(t={}));class r{constructor(a=["category"],t=c.ASC){this.hierarchy=a,this.direction=t}}class o{constructor(a){this.stringAdapter=a}adapt(o){var s;const p=a.adaptArray(o.hierarchy,this.stringAdapter),e=c[null===(s=o.direction)||void 0===s?void 0:s.toUpperCase()]||c.ASC;return new r(p.map((a=>t[a.toUpperCase()]||t.CATEGORY)),e)}default(){return new r(["category"],c.ASC)}}export{t as O,c as a,r as b,o as c}
1
+ import{A as a}from"./p-C-oNdJj9.js";var c,o;!function(a){a.ASC="asc",a.DESC="desc"}(c||(c={})),function(a){a.ROWGROUP="rowGroup",a.ROWGROUPINDEX="rowGroupIndex",a.CATEGORY="category",a.CATEGORYINDEX="categoryIndex",a.SUBCATEGORY="subCategory",a.SUBCATEGORYINDEX="subCategoryIndex",a.AC1="ac1",a.AC2="ac2",a.AC3="ac3",a.AC4="ac4",a.PP1="pp1",a.PP2="pp2",a.PP3="pp3",a.PP4="pp4",a.FC1="fc1",a.FC2="fc2",a.FC3="fc3",a.FC4="fc4",a.PL1="pl1",a.PL2="pl2",a.PL3="pl3",a.PL4="pl4"}(o||(o={}));class r{constructor(a=["category"],o=c.ASC){this.hierarchy=a,this.direction=o}}class t{constructor(a){this.stringAdapter=a}adapt(t){var s;const p=a.adaptArray(t.hierarchy,this.stringAdapter),e=c[null===(s=t.direction)||void 0===s?void 0:s.toUpperCase()]||c.ASC;return new r(p.map((a=>o[a.toUpperCase()]||o.CATEGORY)),e)}default(){return new r(["category"],c.ASC)}}export{o as O,c as a,r as b,t as c}
@@ -0,0 +1 @@
1
+ import{A as r}from"./p-C-oNdJj9.js";class a{adapt(a){return r.adaptDefaultString(a)}default(){return""}}export{a as S}
@@ -1 +1 @@
1
- import{p as t,H as e,h as i,a as s,t as a}from"./p-D6YGOYV1.js";import{i as o}from"./p-DYG9FH_u.js";import{w as n}from"./p-DEHnizot.js";import{w as r}from"./p-C6XrNN2m.js";import{w as f}from"./p-CGI6XIaK.js";import{V as l,a as d,p as h}from"./p-DM7fwmH4.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),n(this),this.errors=f(this),this.componentStyle=r(this)}validateFormat(t){const e="WARN_format";o(t)||l.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`format: invalid value '${t}' is not supported. Valid values: ${l.join(", ")}`})}validateOrientation(t){const e="WARN_orientation";o(t)||d.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`orientation: invalid value '${t}' is not supported. Valid values: ${d.join(", ")}`})}componentWillLoad(){this.validateFormat(this.format),this.validateOrientation(this.orientation)}render(){return i(s,{key:"b2d1a2638c7bee2b2e134d5fedbac63fe38e9830",format:this.format,orientation:this.orientation,style:this.prepareStyle()},i("slot",{key:"4769d18000916a16ee9da8fb0c19b5d8b12393c0"}))}prepareStyle(){const t={"font-family":this.componentStyle((t=>t.global.fontFamily)),"font-size":`${this.componentStyle((t=>t.global.fontSizePx))}px`,"--bn-font-family":this.componentStyle((t=>t.global.fontFamily))||"'Noto Sans', sans-serif","--bn-font-size":`${this.componentStyle((t=>t.global.fontSizePx))||13.3333}px`,"--bn-font-color":this.componentStyle((t=>t.global.fontColor))||"#000000","--bn-font-background":this.componentStyle((t=>t.global.fontBackgroundColor))||"#ffffff"};if(l.includes(this.format)){const{width:e,height:i}=h(this.format,this.orientation);t.width=e,t.height=i}return t}get element(){return this}static get watchers(){return{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}'}},[257,"bn-page",{selectedStyle:[513,"selected-style"],format:[1],orientation:[1]},void 0,{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}]);function p(){"undefined"!=typeof customElements&&["bn-page"].forEach((t=>{"bn-page"===t&&(customElements.get(a(t))||customElements.define(a(t),m))}))}export{m as P,p as d}
1
+ import{p as t,H as e,h as i,a as s,t as a}from"./p-D6YGOYV1.js";import{i as o}from"./p-CYv_8LrR.js";import{w as n}from"./p-DEHnizot.js";import{w as r}from"./p-C6XrNN2m.js";import{w as f}from"./p-CGI6XIaK.js";import{V as l,a as d,p as h}from"./p-DM7fwmH4.js";const m=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),n(this),this.errors=f(this),this.componentStyle=r(this)}validateFormat(t){const e="WARN_format";o(t)||l.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`format: invalid value '${t}' is not supported. Valid values: ${l.join(", ")}`})}validateOrientation(t){const e="WARN_orientation";o(t)||d.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`orientation: invalid value '${t}' is not supported. Valid values: ${d.join(", ")}`})}componentWillLoad(){this.validateFormat(this.format),this.validateOrientation(this.orientation)}render(){return i(s,{key:"b2d1a2638c7bee2b2e134d5fedbac63fe38e9830",format:this.format,orientation:this.orientation,style:this.prepareStyle()},i("slot",{key:"4769d18000916a16ee9da8fb0c19b5d8b12393c0"}))}prepareStyle(){const t={"font-family":this.componentStyle((t=>t.global.fontFamily)),"font-size":`${this.componentStyle((t=>t.global.fontSizePx))}px`,"--bn-font-family":this.componentStyle((t=>t.global.fontFamily))||"'Noto Sans', sans-serif","--bn-font-size":`${this.componentStyle((t=>t.global.fontSizePx))||13.3333}px`,"--bn-font-color":this.componentStyle((t=>t.global.fontColor))||"#000000","--bn-font-background":this.componentStyle((t=>t.global.fontBackgroundColor))||"#ffffff"};if(l.includes(this.format)){const{width:e,height:i}=h(this.format,this.orientation);t.width=e,t.height=i}return t}get element(){return this}static get watchers(){return{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}}static get style(){return':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}'}},[257,"bn-page",{selectedStyle:[513,"selected-style"],format:[1],orientation:[1]},void 0,{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}]);function p(){"undefined"!=typeof customElements&&["bn-page"].forEach((t=>{"bn-page"===t&&(customElements.get(a(t))||customElements.define(a(t),m))}))}export{m as P,p as d}
@@ -0,0 +1 @@
1
+ import{f as t,g as s}from"./p-D6YGOYV1.js";import{g as r,c as e}from"./p-BcOud3dQ.js";import{r as o}from"./p-DEHnizot.js";import{i as l,f as u,r as a}from"./p-B3F_c9GB.js";import{m as i}from"./p-B2NXsfMz.js";const n=n=>{let f,c,m,p,b,j=null;const B=()=>{const t=c.ruleSets.state;b=i([t._default||{},t[m]||{}]),p=i([t._system||{},b])},O=()=>{const r=s(n),e=r.getAttribute("ruleset");if(j&&(j.disconnect(),j=null),e&&l(e)){const s=u(r,e);if(m=a(s,"ruleset"),s.length>0){j=new MutationObserver((()=>{m=a(s,"ruleset"),B(),t(n)}));for(const t of s)j.observe(t,{attributes:!0,attributeFilter:["ruleset"]})}}else m=e},d=new MutationObserver((s=>{s.forEach((s=>{"ruleset"===s.attributeName&&(O(),B(),t(n))}))})),w=n.connectedCallback;n.connectedCallback=()=>{const e=s(n);c=r(e),p=c.ruleSets.state._system,d.observe(e,{attributes:!0,attributeFilter:["ruleset"]}),O(),B(),f=c.ruleSets.on("set",(r=>{r!==m&&"_default"!==r||(O(),B(),t(s(n)))})),o(w,n)};const F=n.disconnectedCallback;return n.disconnectedCallback=()=>{d.disconnect(),j&&(j.disconnect(),j=null),o(f),e(s(n)),o(F,n)},(t="all")=>"user"===t?b:p};export{n as w}
@@ -1 +1 @@
1
- import{S as t}from"./p-CeE4_3wQ.js";import{F as s}from"./p-xpguaboj.js";import"./p-BQMKgvEC.js";import{g as i}from"./p-4q8nRcWC.js";import{d as e}from"./p-COqIkH1M.js";var r;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(r||(r={}));class h{constructor(t,s,i,e,h,n,o,a){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.pointPart="label",this.x=s,this.y=i,this.value=h,this.group=t.group().id(this.createElementID(t.toString(),e)),this.styles=n,this.isVarianceLabel=!1,this.verticalHookLocation=o||r.Top,this.horizontalHookLocation=a||r.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}setPoint(t,s="label"){return this.pointKey=t,this.pointPart=s,this}updateGroup(t){return this.group=t,this}draw(i=!0,r={percent:2,decimal:1},h=new t){if(this.isEmpty())return this;const n=this.group;let o,a="";if(!1===Number.isNaN(Number(this.value))){let t="percent",i=r.percent,e=r.percent,n=1;!1===this.isRelativeLabel&&(i=r.decimal,e=r.decimal,n=h.value,t="decimal"),o=s.number(Number(this.value),t,i,e,n,this.styles.locale),this.isVarianceLabel&&Number(this.value)>=0&&(a="+")}else o=""+this.value;const l=this.drawLabel(n,a+o);return!1===i?(l.addClass("hide"),n.addClass("hide")):this.pointKey&&n.attr(e(this.pointKey,this.pointPart)),this}isEmpty(){return null==this.value||""===this.value}setPos(t,s){return this.x=t,this.y=s,this}forceStringTypeDraw(){const t=this.group;return this.drawLabel(t,""+this.value),this.pointKey&&t.attr(e(this.pointKey,this.pointPart)),this}drawLabel(t,s){const e=this.styles.fontStyles.background||"#ffffff";let h="start";const n=t.text(s);n.move(this.x,this.y);const o=n.bbox(),a=o.w,l=o.h;let c=0,u=0;const f=n.x();let p=n.y();return this.horizontalHookLocation===r.Left?(h="left",c=n.x()):this.horizontalHookLocation===r.Center?(h="middle",c=n.x()-(a+2)/2):this.horizontalHookLocation===r.Right&&(h="end",c=n.x()-a),this.verticalHookLocation===r.Center?(p=n.y()-1.2*l/2,u=p+.2*l):this.verticalHookLocation===r.Top?(p-=l/4,u=p+.2*l):this.verticalHookLocation===r.Bottom&&(p-=l,u=p+.2*l),n.move(f,p),n.font({anchor:h}),null!=this.segmentFillColor?n.fill(i(this.segmentFillColor)):t.rect(a+2,.8*l).stroke(e).fill(e).opacity(.9).move(c-1,u).insertBefore(n),n}createElementID(t,s){return t+"_"+s+"_"+this.ID_SCENARIOLABEL}}const n={ac:1,pp:2,fc:3,pl:4};var o;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(o||(o={}));class a{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((s=>this.intersects(t,s)))}getOptimalPlacement(t,s,i,e,r,h,o,a){const l=n[o]||99,c=h/2;for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.hasCollision(n.bounds))return n}for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.collidesWithHigherPriority(n.bounds,l))return n}return null}calculatePlacementForDirection(t,s,i,e,h,n,a,l){let c,u,f,p,m,b;switch(l){case o.Above:c=t,u=s-n-a,f=r.Bottom,p=r.Center,m=t-i/2,b=s-n-a-e;break;case o.Below:c=t,u=s+n+a,f=r.Top,p=r.Center,m=t-i/2,b=s+n+a-e/4;break;case o.Left:c=t-n-a,u=s,f=r.Center,p=r.Right,m=t-n-a-i,b=s-.6*e;break;case o.Right:c=t+n+a,u=s,f=r.Center,p=r.Left,m=t+n+a,b=s-.6*e}return{labelX:c,labelY:u,verticalHook:f,horizontalHook:p,bounds:{x:m,y:b,width:i,height:e,pointIndex:h,preferredHook:f}}}collidesWithHigherPriority(t,s){return this.labels.some((i=>!!i.scenarioType&&((n[i.scenarioType]||99)<s&&this.intersects(t,i))))}shouldHideScenarioLabel(t,s,i,e=20){const r=n[i]||99;return!(r<=1)&&this.scenarioLabels.some((i=>{if((n[i.scenarioType]||99)>=r)return!1;const h=Math.abs(s-i.y),o=Math.abs(t-i.x);return h<e&&o<e}))}registerScenarioLabel(t,s,i){this.scenarioLabels.push({x:t,y:s,scenarioType:i})}intersects(t,s){return!(t.x+t.width<s.x||s.x+s.width<t.x||t.y+t.height<s.y||s.y+s.height<t.y)}getLabelCount(){return this.labels.length}}export{r as H,a as L,n as S,h as a,o as b}
1
+ import{S as t}from"./p-CeE4_3wQ.js";import{F as s}from"./p-M6hn0BuZ.js";import"./p-D5LDmR4u.js";import{g as i}from"./p-4q8nRcWC.js";import{d as e}from"./p-DHAoxu6M.js";var r;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(r||(r={}));class h{constructor(t,s,i,e,h,n,o,a){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.pointPart="label",this.x=s,this.y=i,this.value=h,this.group=t.group().id(this.createElementID(t.toString(),e)),this.styles=n,this.isVarianceLabel=!1,this.verticalHookLocation=o||r.Top,this.horizontalHookLocation=a||r.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}setPoint(t,s="label"){return this.pointKey=t,this.pointPart=s,this}updateGroup(t){return this.group=t,this}draw(i=!0,r={percent:2,decimal:1},h=new t){if(this.isEmpty())return this;const n=this.group;let o,a="";if(!1===Number.isNaN(Number(this.value))){let t="percent",i=r.percent,e=r.percent,n=1;!1===this.isRelativeLabel&&(i=r.decimal,e=r.decimal,n=h.value,t="decimal"),o=s.number(Number(this.value),t,i,e,n,this.styles.locale),this.isVarianceLabel&&Number(this.value)>=0&&(a="+")}else o=""+this.value;const l=this.drawLabel(n,a+o);return!1===i?(l.addClass("hide"),n.addClass("hide")):this.pointKey&&n.attr(e(this.pointKey,this.pointPart)),this}isEmpty(){return null==this.value||""===this.value}setPos(t,s){return this.x=t,this.y=s,this}forceStringTypeDraw(){const t=this.group;return this.drawLabel(t,""+this.value),this.pointKey&&t.attr(e(this.pointKey,this.pointPart)),this}drawLabel(t,s){const e=this.styles.fontStyles.background||"#ffffff";let h="start";const n=t.text(s);n.move(this.x,this.y);const o=n.bbox(),a=o.w,l=o.h;let c=0,u=0;const f=n.x();let p=n.y();return this.horizontalHookLocation===r.Left?(h="left",c=n.x()):this.horizontalHookLocation===r.Center?(h="middle",c=n.x()-(a+2)/2):this.horizontalHookLocation===r.Right&&(h="end",c=n.x()-a),this.verticalHookLocation===r.Center?(p=n.y()-1.2*l/2,u=p+.2*l):this.verticalHookLocation===r.Top?(p-=l/4,u=p+.2*l):this.verticalHookLocation===r.Bottom&&(p-=l,u=p+.2*l),n.move(f,p),n.font({anchor:h}),null!=this.segmentFillColor?n.fill(i(this.segmentFillColor)):t.rect(a+2,.8*l).stroke(e).fill(e).opacity(.9).move(c-1,u).insertBefore(n),n}createElementID(t,s){return t+"_"+s+"_"+this.ID_SCENARIOLABEL}}const n={ac:1,pp:2,fc:3,pl:4};var o;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(o||(o={}));class a{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((s=>this.intersects(t,s)))}getOptimalPlacement(t,s,i,e,r,h,o,a){const l=n[o]||99,c=h/2;for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.hasCollision(n.bounds))return n}for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.collidesWithHigherPriority(n.bounds,l))return n}return null}calculatePlacementForDirection(t,s,i,e,h,n,a,l){let c,u,f,p,m,b;switch(l){case o.Above:c=t,u=s-n-a,f=r.Bottom,p=r.Center,m=t-i/2,b=s-n-a-e;break;case o.Below:c=t,u=s+n+a,f=r.Top,p=r.Center,m=t-i/2,b=s+n+a-e/4;break;case o.Left:c=t-n-a,u=s,f=r.Center,p=r.Right,m=t-n-a-i,b=s-.6*e;break;case o.Right:c=t+n+a,u=s,f=r.Center,p=r.Left,m=t+n+a,b=s-.6*e}return{labelX:c,labelY:u,verticalHook:f,horizontalHook:p,bounds:{x:m,y:b,width:i,height:e,pointIndex:h,preferredHook:f}}}collidesWithHigherPriority(t,s){return this.labels.some((i=>!!i.scenarioType&&((n[i.scenarioType]||99)<s&&this.intersects(t,i))))}shouldHideScenarioLabel(t,s,i,e=20){const r=n[i]||99;return!(r<=1)&&this.scenarioLabels.some((i=>{if((n[i.scenarioType]||99)>=r)return!1;const h=Math.abs(s-i.y),o=Math.abs(t-i.x);return h<e&&o<e}))}registerScenarioLabel(t,s,i){this.scenarioLabels.push({x:t,y:s,scenarioType:i})}intersects(t,s){return!(t.x+t.width<s.x||s.x+s.width<t.x||t.y+t.height<s.y||s.y+s.height<t.y)}getLabelCount(){return this.labels.length}}export{r as H,a as L,n as S,h as a,o as b}
@@ -1 +1 @@
1
- import{p as t,H as s,h as i,t as e}from"./p-D6YGOYV1.js";import{I as n,C as r}from"./p-BQMKgvEC.js";import{b as o,D as a,a as c}from"./p-xhiPDAZa.js";import{F as h,I as l}from"./p-xpguaboj.js";import{A as p}from"./p-CMM8vtHW.js";import{D as u,w as f}from"./p-DEHnizot.js";import{a as d,c as m}from"./p-CxPSvrcF.js";import{S as b}from"./p-oJjMz8JF.js";import{s as w}from"./p-CyUmrWfW.js";class _{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",o="";for(let a=0;a<e;a++){let c="";a>0&&(c=s.get("SEPARATOR_WS")),e>1&&a===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[a].name)||t[a].name),o=s.get(t[a].unit)||t[a].unit):(r=r+c+t[a].name,o=t[a].unit)}return[{name:r,unit:o}]}return t}createDimension(t,s,i,e,n,r="de"){let a="";if(void 0!==s){const t=new o;t.setLocale(r),a=t.getDateLinkString(s.start,s.end,s.link,s.format,n)}return a+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",h.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class v{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32,this.locale="de"}}class C{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new v;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=p.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=p.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),r.isString(t.locale)&&(s.locale=t.locale),s}default(){return new v}}var R;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(R||(R={}));class M{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new v,this.state=R.DIRTY,this.ruleSet=t||new l,this.dataSetFactory=new _,this.state=R.DIRTY,this.setI18n(new Map)}setRuleSet(t){this.ruleSet=t||new l}setI18n(t){this.state=R.DIRTY;const s=new Map([["SEPARATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["thereof","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return R.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit,this.config.locale),this.state=R.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=R.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class S{constructor(t="",s=""){this.name=t,this.unit=s}}class y{construnctor(){}adapt(t){const s=new S;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new S("","")}}class E{constructor(t=u.now(),s=u.now(),i=a.AUTO,e=c.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class g{construnctor(){}adapt(t){const s=new E;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new E}}const A=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:d.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.locale="de",this.title=new M(new l),f(this)}render(){return i("div",{key:"ecc33a660538732ceea3e4620afabfcb8ffbce95"},i("div",{key:"cb1c3b074817a4c0647419fdc0f2b94c113ebc09",innerHTML:w(this.title.unit)}),i("div",{key:"92b6ef66f67d33bd3bff6a760d1fc1bee605105d"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPARATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"74cc33e0e63592e5422b3c0e5c7a52715210c486"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new M(new l(this.ruleSetConfig)),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setRuleSet(new l(this.ruleSetConfig)),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new C(new y,new g,new m(new b),new b).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order,locale:this.locale})}static get style(){return':host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}p{margin:0}'}},[1,"bn-title-renderer",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],locale:[1],ruleSetConfig:[16]}]);function O(){"undefined"!=typeof customElements&&["bn-title-renderer"].forEach((t=>{"bn-title-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),A))}))}export{A as B,O as d}
1
+ import{p as t,H as s,h as i,t as e}from"./p-D6YGOYV1.js";import{I as n,C as r}from"./p-D5LDmR4u.js";import{b as o,D as a,a as c}from"./p-xhiPDAZa.js";import{F as h,I as l}from"./p-M6hn0BuZ.js";import{A as p}from"./p-C-oNdJj9.js";import{D as u,w as d}from"./p-DEHnizot.js";import{a as f,c as m}from"./p-BNWZoAip.js";import{S as b}from"./p-BT2WH_CP.js";import{s as w}from"./p-CyUmrWfW.js";class _{constructor(){}createMeasures(t,s,i){if(this.allMeasuresUseSameUnit(t)){const e=t.length;let r="",o="";for(let a=0;a<e;a++){let c="";a>0&&(c=s.get("SEPARATOR_WS")),e>1&&a===e-1&&(c=s.get("CONNECTOR_WS")),i===n.ALL?(r=(s.get(r)||r)+c+(s.get(t[a].name)||t[a].name),o=s.get(t[a].unit)||t[a].unit):(r=r+c+t[a].name,o=t[a].unit)}return[{name:r,unit:o}]}return t}createDimension(t,s,i,e,n,r="de"){let a="";if(void 0!==s){const t=new o;t.setLocale(r),a=t.getDateLinkString(s.start,s.end,s.link,s.format,n)}return a+t.map((t=>{let s="";return null!=i&&null!=i.hierarchy&&i.hierarchy.find((s=>s===t))&&(s=e.get("asc"===i.direction?"ORDER_asc":"ORDER_desc")),"".concat(" ",h.translateScenarioLabel(t,e),s)})).toString()}allMeasuresUseSameUnit(t){const s=new Map;return t.forEach((function(t){s.set(t.unit,!0)})),1===s.size}}class C{constructor(){this.businessunit="",this.measures=[],this.scenarios=[],this.i18nMode=n.ALL,this.intervalSpanLimit=32,this.locale="de"}}class R{constructor(t,s,i,e){this.measureEntryAdapter=t,this.timePeriodAdapter=s,this.orderAdapter=i,this.stringAdapter=e}adapt(t){const s=new C;return r.isString(t.businessunit)&&(s.businessunit=t.businessunit),r.isArray(t.measures)&&(s.measures=p.adaptArray(t.measures,this.measureEntryAdapter)),r.isArray(t.scenarios)&&(s.scenarios=p.adaptArray(t.scenarios,this.stringAdapter)),r.isExisting(t.timeperiod)&&(s.timeperiod=this.timePeriodAdapter.adapt(t.timeperiod)),r.isNumber(t.intervalSpanLimit)&&(s.intervalSpanLimit=t.intervalSpanLimit),r.isExisting(t.i18nMode)&&(s.i18nMode=t.i18nMode),r.isExisting(t.order)&&(s.order=this.orderAdapter.adapt(t.order)),r.isString(t.locale)&&(s.locale=t.locale),s}default(){return new C}}var v;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(v||(v={}));class y{constructor(t){this.i18n=new Map,this.unit="",this.measures=[],this.dimension="",this.config=new C,this.state=v.DIRTY,this.ruleSet=t||new l,this.dataSetFactory=new _,this.state=v.DIRTY,this.setI18n(new Map)}setRuleSet(t){this.ruleSet=t||new l}setI18n(t){this.state=v.DIRTY;const s=new Map([["SEPARATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["thereof","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"],["CONNECTOR_WS"," und "]]);this.i18n=new Map([...s,...t||new Map])}update(){return v.DIRTY===this.state&&(this.unit=this.config.businessunit,this.measures=this.dataSetFactory.createMeasures(this.config.measures,this.i18n,this.config.i18nMode),this.dimension=this.dataSetFactory.createDimension(this.config.scenarios,this.config.timeperiod,this.config.order,this.i18n,this.config.intervalSpanLimit,this.config.locale),this.state=v.UP_TO_DATE),this}setConfig(t){this.config=this.initConfig(t)}initConfig(t){this.state=v.DIRTY;const s=t,i=this;return t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))),s}}class S{constructor(t="",s=""){this.name=t,this.unit=s}}class A{construnctor(){}adapt(t){const s=new S;return r.isString(t.name)&&(s.name=t.name),r.isString(t.unit)&&(s.unit=t.unit),s}default(){return new S("","")}}class E{constructor(t=u.now(),s=u.now(),i=a.AUTO,e=c.AUTO){this.start=t,this.end=s,this.format=i,this.link=e}}class D{construnctor(){}adapt(t){const s=new E;return r.isDate(t.start)&&(s.start=t.start),r.isDate(t.end)&&(s.end=t.end),r.isExisting(t.format)&&(s.format=t.format),r.isExisting(t.link)&&(s.link=t.link),s}default(){return new E}}const M=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.businessUnit="",this.scenarios=[],this.measures=[],this.intervalSpanLimit=28,this.order={hierarchy:[],direction:f.ASC},this.i18n=new Map,this.i18nMode=n.ALL,this.locale="de",this.title=new y(new l),d(this)}render(){return i("div",{key:"ecc33a660538732ceea3e4620afabfcb8ffbce95"},i("div",{key:"cb1c3b074817a4c0647419fdc0f2b94c113ebc09",innerHTML:w(this.title.unit)}),i("div",{key:"92b6ef66f67d33bd3bff6a760d1fc1bee605105d"},this.title.measures.map(((t,s)=>i("span",null,this.isFirstElement(s)?this.title.i18n.get("SEPARATOR_WS"):"",i("span",{class:"measure"},t.name)," ",t.unit?this.title.i18n.get("in"):""," ",t.unit)))),i("div",{key:"74cc33e0e63592e5422b3c0e5c7a52715210c486"},this.title.dimension))}componentWillLoad(){const t=this.prepareConfig();this.title=new y(new l(this.ruleSetConfig)),this.title.setI18n(this.i18n),this.title.setConfig(t)}componentWillUpdate(){const t=this.prepareConfig();this.title.setI18n(this.i18n),this.title.setRuleSet(new l(this.ruleSetConfig)),this.title.setConfig(t)}componentWillRender(){this.title.update()}isFirstElement(t){return 0!==t}prepareConfig(){return new R(new A,new D,new m(new b),new b).adapt({businessunit:this.businessUnit,measures:this.measures,scenarios:this.scenarios,timeperiod:this.timeperiod,intervalSpanLimit:this.intervalSpanLimit,i18nMode:this.i18nMode,order:this.order,locale:this.locale})}static get style(){return':host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}p{margin:0}'}},[1,"bn-title-renderer",{businessUnit:[1537,"business-unit"],scenarios:[16],measures:[16],timeperiod:[16],intervalSpanLimit:[2,"interval-span-limit"],order:[16],i18n:[1040],i18nMode:[1,"i18n-mode"],locale:[1],ruleSetConfig:[16]}]);function O(){"undefined"!=typeof customElements&&["bn-title-renderer"].forEach((t=>{"bn-title-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),M))}))}export{M as B,O as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as i,h as s,a as n,t as e}from"./p-D6YGOYV1.js";import{r as h,m as o,g as r,d as a}from"./p-BcOud3dQ.js";import{C as l,I as d}from"./p-M6hn0BuZ.js";import{w as c}from"./p-DEHnizot.js";import{e as u,r as m}from"./p-ClruFZD_.js";import{S as v,F as f,a as p,P as w}from"./p-CJtE8Pyr.js";import{d as y,S as g}from"./p-DHAoxu6M.js";import{X as x,r as b,a as M,x as $,f as L,b as j,c as P,P as S,F as k,d as C,S as D}from"./p-B7UDMyar.js";import{N as W}from"./p-BJmwHV0a.js";import{a as E,r as T,i as z}from"./p-CLkpoHdg.js";import{s as N}from"./p-Xb6Ilq8u.js";class B{constructor(t,i){this.xScale=t,this.yScale=i}isPositiveDomain(){return this.xScale.domainMin>0&&this.yScale.domainMin>0}static autoK(t){const i=t.filter((t=>t>0)).sort(((t,i)=>t-i));if(0===i.length)return[];const s=t=>i[Math.min(i.length-1,Math.floor(t*i.length))];let n=B.ladderValues(s(.25),s(.75));if(n.length<2&&(n=B.ladderValues(i[0],i[i.length-1])),0===n.length)return[];if(1===n.length)return n;if(n.length<=4)return n;const e=[];for(let t=0;t<4;t++)e.push(n[Math.round(t*(n.length-1)/3)]);return[...new Set(e)]}static ladderValues(t,i){if(t<=0||i<t)return[];const s=[];for(let n=Math.floor(Math.log10(t))-1;n<=Math.ceil(Math.log10(i));n++)for(const e of[1,2,5]){const h=e*Math.pow(10,n);h>=t&&h<=i&&s.push(h)}return s}visibleRange(t){if(!this.isPositiveDomain()||t<=0)return null;const i=Math.max(this.xScale.domainMin,t/this.yScale.domainMax),s=Math.min(this.xScale.domainMax,t/this.yScale.domainMin);return i>=s?null:[i,s]}samples(t){const i=this.visibleRange(t);if(null===i)return null;const[s,n]=i,e=[];for(let i=0;i<64;i++){const h=s*Math.pow(n/s,i/63);e.push({x:this.xScale.scale(h),y:this.yScale.scale(t/h)})}return e}path(t){const i=this.samples(t);return null===i?null:i.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`)).join(" ")}exitPoint(t){const i=this.visibleRange(t);if(null===i)return null;const s=i[1],n=s>=this.xScale.domainMax-1e-9*Math.abs(this.xScale.domainMax);return{x:this.xScale.scale(s),y:this.yScale.scale(t/s),edge:n?"right":"bottom"}}regionPath(t){if(!this.isPositiveDomain()||t<=0)return null;const i=this.xScale.domainMin,s=this.xScale.domainMax,n=this.yScale.domainMin,e=this.yScale.domainMax,h=this.xScale.scale(i),o=this.xScale.scale(s),r=this.yScale.scale(e),a=this.yScale.scale(n);if(t>=s*e)return null;if(t<=i*n)return`M ${h} ${r} L ${o} ${r} L ${o} ${a} L ${h} ${a} Z`;const l=this.samples(t),[d,c]=this.visibleRange(t),u=d>i,m=c>=s-1e-9*Math.abs(s),v=l.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`));return m||v.push(`L ${o} ${a}`),v.push(`L ${o} ${r}`),u||v.push(`L ${h} ${r}`),v.push("Z"),v.join(" ")}}class H{constructor(t,i,s,n,e,h){var o,r;this.ruleSet=t,this.config=n,this.styles=e,this.availableWidth=h,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.config=Object.assign(Object.assign({},n),{x:E(n.x),y:E(n.y)});const a=new x;let l=[];try{""!==s&&(l=i.exec(`SELECT * FROM ${s}`))}catch(t){this.queryError=u(t)}const d=(null!=l?l:[]).map((t=>a.adapt(t)));this.data=b(d,{pointLevel:n.pointLevel,seriesLevel:n.seriesLevel,facetLevel:null!==n.facet?"rowgroup"===n.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=T(n.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(r=T(n.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"}},domains:{x:{min:this.config.x.min,max:this.config.x.max},y:{min:this.config.y.min,max:this.config.y.max}},limit:n.limit,limitBy:"order"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}get xPercent(){return z(this.config.x.measure)}get yPercent(){return z(this.config.y.measure)}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,n,e={}){var h,o,r;return t.text(i).font({size:null!==(h=e.size)&&void 0!==h?h:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(o=e.anchor)&&void 0!==o?o:"start"}).fill(null!==(r=e.color)&&void 0!==r?r:this.styles.fontStyles.color).attr({x:s,y:n,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getQueryError(){return this.queryError}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}axisTitle(t,i){var s;const n=null!==(s=t.label)&&void 0!==s?s:"";return""===n?"":void 0===t.unit||""===t.unit?n:`${n} ${i} ${t.unit}`}setI18n(t){this.i18nMap=t}legendModel(){const t=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:this.seriesTreatment(t.index)}}));return{sizeCaption:[],title:this.i18nMap.get("legend.title")||null,compareEntries:[],entries:t}}primaryColorIndex(){const t=T(this.config.x.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}seriesTreatment(t){const{color:i,overflowed:s}=h(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),o(this.primaryColorIndex(),i,"dot")}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}toString(){const t=new v;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s,n,e,h,o,r,a,l,d;this.warnings=this.data.warnings.slice();const c=this.em,u=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",v=t.group(),f=new M(this.styles),p=this.legendModel(),w=this.config.legend.show&&p.entries.length>0,y=w?f.measure(p,this.config.legend.position):{width:0,height:0},g=null!==this.config.iso,x=g?Math.max(3*c,...this.isoValueLabels().map((t=>this.textWidth(t)+c)),this.textWidth(null!==(i=this.config.iso.label)&&void 0!==i?i:"",!0)+c,this.textWidth(void 0!==this.config.iso.unit&&""!==this.config.iso.unit?`${m} ${this.config.iso.unit}`:"")+c):0,b="right"===this.config.legend.position?Math.max(w?y.width+c:0,x):x,j=""!==this.config.chartTitle?1.6*c:0,P=this.axisTitle(this.config.y,m),S=this.axisTitle(this.config.x,m),C=""!==P?1.4*c:.4*c,D=1.4*c+(""!==S?1.3*c:0);let E,T=3*c,z={x:0,y:0,width:0,height:0},N=[];const B=Math.max(1,this.data.facets.length),H=null===(s=this.config.facet)||void 0===s?void 0:s.columns,O=W.domain(null!==(e=null===(n=this.data.extents)||void 0===n?void 0:n.xMin)&&void 0!==e?e:0,null!==(o=null===(h=this.data.extents)||void 0===h?void 0:h.xMax)&&void 0!==o?o:1,{min:this.config.x.min,max:this.config.x.max}),V=W.domain(null!==(a=null===(r=this.data.extents)||void 0===r?void 0:r.yMin)&&void 0!==a?a:0,null!==(d=null===(l=this.data.extents)||void 0===l?void 0:l.yMax)&&void 0!==d?d:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-u.left-u.right-T-b);z={x:u.left+T,y:u.top+j+C,width:t,height:t/this.config.aspect},E=new k(B,H,z,this.styles.scaleFactors.panelGap*c);const i=E.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*c)))),n=new W(V[0],V[1],i,0);N=n.ticks(s);const e=$(N,this.yPercent);T=Math.max(...N.map((t=>this.textWidth(L(t,e,this.styles.locale,this.yPercent)))),c)+this.styles.scaleFactors.axisTickLength*c+.4*c}this.canvasHeight=z.y+z.height+D+("bottom"===this.config.legend.position&&w?y.height+c:0)+u.bottom,""!==this.config.chartTitle&&this.drawText(v,this.config.chartTitle,u.left,u.top+c,{bold:!0}),""!==P&&this.drawAxisTitleText(v,this.config.y,m,u.left,z.y-.6*c,"start");const A=this.buildPanels(E,O,V),F=A[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(A[0].rect.width/(7*c))))),I=$(F,this.xPercent),X=$(N,this.yPercent);let Y=!1;g&&(O[0]>0&&V[0]>0?Y=!0:this.addWarningOnce("xy-iso-domain",{})),0===this.data.facets.length?this.drawPanel(v,A[0],{key:"",points:[]},F,N,I,X,!0,!0,Y):this.data.facets.forEach(((t,i)=>{this.drawPanel(v,A[i],t,F,N,I,X,E.isOuterLeft(i),E.isOuterBottom(i),Y,this.data.facets.length>1?t.key:"")})),""!==S&&this.drawAxisTitleText(v,this.config.x,m,z.x+z.width,z.y+z.height+2.6*c,"end"),w&&("right"===this.config.legend.position?f.draw(v,p,z.x+z.width+c,z.y,"right"):f.draw(v,p,z.x,z.y+z.height+D,"bottom")),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,n,e,h){var o;const r=null!==(o=i.label)&&void 0!==o?o:"",a=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",l=.3*this.em;"start"===h?(this.drawText(t,r,n,e,{bold:!0}),""!==a&&this.drawText(t,a,n+this.textWidth(r,!0)+l,e,{})):""!==a?(this.drawText(t,a,n,e,{anchor:"end"}),this.drawText(t,r,n-this.textWidth(a)-l,e,{anchor:"end",bold:!0})):this.drawText(t,r,n,e,{anchor:"end",bold:!0})}buildPanels(t,i,s){const n=[];for(let e=0;e<t.count;e++){const h=t.panelRect(e),o=new W(i[0],i[1],h.x,h.x+h.width),r=new W(s[0],s[1],h.y+h.height,h.y);n.push({rect:h,xScale:o,yScale:r,frame:new j(o,r,h,this.styles)})}return n}drawPanel(t,i,s,n,e,h,o,r,a,l,d=""){var c,u;const m=t.group(),v=this.em;i.frame.drawBands(m,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(m,e,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*v?n:void 0),l&&null!==this.config.iso&&this.drawIso(m,i),i.frame.drawRefLines(m,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(m);const f=this.styles.scaleFactors.pointRadius*v,p=new S(i.rect,this.styles.scaleFactors.labelToMark*v),w=[];for(const t of s.points){const n=null!==(u=null===(c=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===c?void 0:c.index)&&void 0!==u?u:0,e=this.seriesTreatment(n),h=i.xScale.scale(t.x),o=i.yScale.scale(t.y);w.push({point:t,cx:h,cy:o,treatment:e});const r=m.circle(2*f).center(h,o).fill(e.fill).stroke({color:e.stroke,width:e.strokeWidth}).attr(y(P(t,s.key,this.config),"element"));void 0!==e.dasharray&&r.attr("stroke-dasharray",e.dasharray),p.registerMark(h,o,f)}this.drawPointLabels(m,p,w,f,s.key),i.frame.drawTickLabels(m,{ticksX:n,ticksY:e,xDecimals:h,yDecimals:o,xPercent:this.xPercent,yPercent:this.yPercent,showXLabels:a,showYLabels:r}),""!==d&&i.frame.drawPanelTitle(m,d)}drawPointLabels(t,i,s,n,e){const h=s.reduce(((t,i)=>t+i.cx),0)/Math.max(1,s.length),o=s.reduce(((t,i)=>t+i.cy),0)/Math.max(1,s.length),r=[...s].sort(((t,i)=>Math.hypot(i.cx-h,i.cy-o)-Math.hypot(t.cx-h,t.cy-o))),{selected:a,unknownNames:l}=i.selectCandidates(r,this.config.labels.points,this.config.labels.max,(t=>t.point.name));l.length>0&&this.addWarningOnce("xy-label-unknown",{names:l.join(", ")});const d=new Map,c=a.map((t=>{const i={name:t.point.name,cx:t.cx,cy:t.cy,r:n,width:this.textWidth(t.point.name),height:1.1*this.em};return d.set(i,t.point),i}));for(const s of i.place(c))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{}).attr(y(P(d.get(s.candidate),e,this.config),"label"))}drawIso(t,i){const s=this.config.iso,n=new B(i.xScale,i.yScale),e=this.i18nMap.get("axis.in")||"in",h=this.isoValues(),o=this.isoValueLabels();if(void 0!==s.highlight){const i=n.regionPath(s.highlight.from);null!==i&&t.path(i).fill(this.styles.axisStyles.pl.fill).stroke("none")}const r={color:this.styles.axisStyles.fc.stroke,width:N(this.styles.scaleFactors.gridLineWidth,this.em)};let a=null;for(const[i,s]of h.entries()){const e=n.path(s);if(null===e)continue;t.path(e).fill("none").stroke(r);const h=n.exitPoint(s);null!==h&&(this.drawText(t,o[i],h.x+.4*this.em,"right"===h.edge?h.y+.35*this.em:h.y-.5*this.em,{}),(null===a||h.y<a.y)&&(a=h))}if(null!==a&&void 0!==s.label&&""!==s.label){const i=void 0!==s.unit&&""!==s.unit?`${e} ${s.unit}`:"";this.drawText(t,s.label,a.x+.4*this.em,a.y-1.6*this.em,{bold:!0}),""!==i&&this.drawText(t,i,a.x+.4*this.em,a.y-.5*this.em,{})}}isoValues(){const t=this.config.iso;return"auto"!==t.values?t.values:B.autoK(this.data.facets.flatMap((t=>t.points.map((t=>t.x*t.y)))))}isoValueLabels(){const t=this.isoValues(),i=Math.max(0,...t.map((t=>W.stepDecimals(Math.abs(t)))));return t.map((t=>L(t,i,this.styles.locale)))}}const O=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-iso-domain","xy-label-unknown","xy-series-overflow","xy-point-budget"],V=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.iso=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",c(this)}getDb(){return this.stores||(this.stores=r(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=a(this.getDb(),this.tableName,this.filter);this.chart=new H(new d(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,iso:this.iso,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings()),m(this.errors,this.chart.getQueryError())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of O){const s=`WARN_${t.replace(/-/g,"_")}`;if(i.has(t)){const n=void 0!==this.translator?this.translator(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:n})}else this.errors.remove(s)}}prepareStyle(){var t,i;const s=new C(new D,new f,new p(new g),new w).adapt(this.styles);return s.locale=(null===(i=null===(t=r(this.element).context)||void 0===t?void 0:t.state)||void 0===i?void 0:i.locale)||"de",s}render(){var t;if(void 0===this.chart||void 0!==this.chart.getQueryError())return s(n,null);if(this.chart.hasNoData()){const i=null!==(t=this.i18n.get("no-data"))&&void 0!==t?t:"No Data";return s(n,{class:"no-data"},s("div",{class:"empty-state"},i))}return s(n,null,s("div",{innerHTML:this.svgMarkup}))}get element(){return this}static get style(){return':host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}'}},[1,"bn-chart-scatter-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],x:[16],y:[16],iso:[16],labels:[16],legend:[16],facet:[16],pointLevel:[1,"point-level"],seriesLevel:[1,"series-level"],aspect:[2],limit:[2],filter:[1],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function A(){"undefined"!=typeof customElements&&["bn-chart-scatter-renderer"].forEach((t=>{"bn-chart-scatter-renderer"===t&&(customElements.get(e(t))||customElements.define(e(t),V))}))}export{V as B,A as d}
@@ -1 +1 @@
1
- import{C as t}from"./p-BQMKgvEC.js";class a{static adaptDefaultString(a){return t.isString(a)?a.trim():""}static adaptArray(a,r){const s=[];return t.isArray(a)&&a.forEach((t=>{s.push(r.adapt(t))})),s}}export{a as A}
1
+ import{C as t}from"./p-D5LDmR4u.js";class a{static adaptDefaultString(a){return t.isString(a)?a.trim():""}static adaptArray(a,r){const s=[];return t.isArray(a)&&a.forEach((t=>{s.push(r.adapt(t))})),s}}export{a as A}