@bino-bi/bn-template-engine 1.0.0-next.45 → 1.0.0-next.46

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 (169) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-8b28c9bd.entry.js → p-16623e0f.entry.js} +1 -1
  3. package/dist/bn-template-engine/p-17970e07.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-48871742.entry.js → p-21930d0a.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-5a64f90f.entry.js → p-46c46067.entry.js} +1 -1
  6. package/dist/bn-template-engine/p-9caa7f46.entry.js +1 -0
  7. package/dist/bn-template-engine/p-B0MEAsAS.js +1 -0
  8. package/dist/bn-template-engine/{p-qpZjVnX5.js → p-BA-fydUt.js} +1 -1
  9. package/dist/bn-template-engine/p-BEGt_7Hr.js +1 -0
  10. package/dist/bn-template-engine/p-BRO1oW7m.js +1 -0
  11. package/dist/bn-template-engine/{p-DVE0-sOv.js → p-BnzIfgCq.js} +1 -1
  12. package/dist/bn-template-engine/{p-b0dfc113.entry.js → p-b0d528f2.entry.js} +1 -1
  13. package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +608 -83
  14. package/dist/cjs/bn-grid.cjs.entry.js +161 -34
  15. package/dist/cjs/bn-image.cjs.entry.js +2 -2
  16. package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
  17. package/dist/cjs/bn-ruleset.cjs.entry.js +2 -2
  18. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  19. package/dist/cjs/bn-text.cjs.entry.js +3 -3
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/cjs/{localFrame-U3Qs0psw.js → localFrame-C27GGom1.js} +1 -1
  22. package/dist/cjs/{withBodyObserver-S-FGHpAX.js → withBodyObserver-B78wzw3f.js} +1 -1
  23. package/dist/cjs/{withHasError-BkBrsCpI.js → withHasError-0hW3-4mr.js} +11 -5
  24. package/dist/cjs/{withStyled-BZb6snOx.js → withStyled-D0hrcfE_.js} +25 -1
  25. package/dist/cjs/{withTranslation-1qTs5Fi7.js → withTranslation-B4WipL_5.js} +2 -2
  26. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +33 -2
  27. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +112 -16
  28. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +1 -1
  29. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +3 -3
  30. package/dist/collection/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.js +113 -3
  31. package/dist/collection/components/bn-chart-time/bn-chart-time.js +261 -22
  32. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +221 -12
  33. package/dist/collection/components/bn-chart-time/utils/elements/Axis.js +9 -1
  34. package/dist/collection/components/bn-chart-time/utils/elements/Column.js +10 -4
  35. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +9 -3
  36. package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
  37. package/dist/collection/components/bn-chart-time/utils/model/DataPoint.js +9 -6
  38. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +15 -0
  39. package/dist/collection/components/bn-grid/bn-grid.js +118 -24
  40. package/dist/collection/components/bn-grid/utils/cellLayout.js +55 -9
  41. package/dist/collection/components/bn-layout-card/bn-layout-card.js +4 -2
  42. package/dist/collection/components/bn-layout-page/bn-layout-page.js +23 -1
  43. package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.css +10 -0
  44. package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.js +23 -1
  45. package/dist/collection/components/bn-title/bn-title.js +40 -2
  46. package/dist/collection/stores/componentStyles.js +9 -3
  47. package/dist/collection/stores/internationalization.js +2 -2
  48. package/dist/collection/utils/DateStringFactory.js +19 -0
  49. package/dist/collection/utils/model/DataFormatDigits.js +4 -2
  50. package/dist/collection/utils/model/VarianceScenario.js +13 -0
  51. package/dist/collection/utils/validate.js +4 -0
  52. package/dist/components/bn-annotation-layer.js +1 -1
  53. package/dist/components/bn-annotation-list.js +1 -1
  54. package/dist/components/bn-asset.js +1 -1
  55. package/dist/components/bn-body.js +1 -1
  56. package/dist/components/bn-card.js +1 -1
  57. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  58. package/dist/components/bn-chart-bubble.js +1 -1
  59. package/dist/components/bn-chart-bullet-renderer.js +1 -1
  60. package/dist/components/bn-chart-bullet.js +1 -1
  61. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  62. package/dist/components/bn-chart-scatter.js +1 -1
  63. package/dist/components/bn-chart-structure-renderer.js +1 -1
  64. package/dist/components/bn-chart-structure.js +1 -1
  65. package/dist/components/bn-chart-time-renderer.js +1 -1
  66. package/dist/components/bn-chart-time.js +1 -1
  67. package/dist/components/bn-component-style.js +1 -1
  68. package/dist/components/bn-context.js +1 -1
  69. package/dist/components/bn-dataset.js +1 -1
  70. package/dist/components/bn-datasource.js +1 -1
  71. package/dist/components/bn-footer.js +1 -1
  72. package/dist/components/bn-grid.js +1 -1
  73. package/dist/components/bn-image.js +1 -1
  74. package/dist/components/bn-internationalization.js +1 -1
  75. package/dist/components/bn-layout-card.js +1 -1
  76. package/dist/components/bn-layout-page.js +1 -1
  77. package/dist/components/bn-message.js +1 -1
  78. package/dist/components/bn-page.js +1 -1
  79. package/dist/components/bn-ruleset.js +1 -1
  80. package/dist/components/bn-scaling-group.js +1 -1
  81. package/dist/components/bn-table-renderer.js +1 -1
  82. package/dist/components/bn-table.js +1 -1
  83. package/dist/components/bn-text.js +1 -1
  84. package/dist/components/bn-title-renderer.js +1 -1
  85. package/dist/components/bn-title.js +1 -1
  86. package/dist/components/bn-tree.js +1 -1
  87. package/dist/components/p-9X5fVJqR.js +1 -0
  88. package/dist/components/p-B5GRtTLX.js +1 -0
  89. package/dist/components/{p-DJUffGeB.js → p-BKA15uoz.js} +1 -1
  90. package/dist/components/p-BKLq0Pbv.js +1 -0
  91. package/dist/components/p-BKTBdrEA.js +1 -0
  92. package/dist/components/p-Bd8cQiLx.js +1 -0
  93. package/dist/components/{p-CvEdUq8i.js → p-Be0Q3bvf.js} +1 -1
  94. package/dist/components/{p-xIWChKGS.js → p-Bj3RWsEx.js} +1 -1
  95. package/dist/components/{p-B4L069XF.js → p-BoBamuPt.js} +1 -1
  96. package/dist/components/{p-DaOm9YwQ.js → p-BrJZUp-K.js} +1 -1
  97. package/dist/components/{p-CyfGkLMh.js → p-BuWNCnvR.js} +1 -1
  98. package/dist/components/{p-M2k_I8lv.js → p-CFVoK5Rb.js} +1 -1
  99. package/dist/components/{p-fKJx8WtW.js → p-CgJB5mCu.js} +1 -1
  100. package/dist/components/p-Cxx0YNnl.js +1 -0
  101. package/dist/components/p-D9F5IBFT.js +1 -0
  102. package/dist/components/{p-BfUdaxZ9.js → p-DQFahsnV.js} +1 -1
  103. package/dist/components/p-DROj8gke.js +1 -0
  104. package/dist/components/p-D_Sbhd0L.js +1 -0
  105. package/dist/components/{p-Cel0a6ma.js → p-DbWh9W5D.js} +1 -1
  106. package/dist/components/{p-2eicD9rF.js → p-DkCeSWKR.js} +1 -1
  107. package/dist/components/{p-7ieJFBUk.js → p-DoOSXntC.js} +1 -1
  108. package/dist/components/p-Dxj_pf8s.js +1 -0
  109. package/dist/components/{p-DQl2K2Xl.js → p-DzYhS_9s.js} +1 -1
  110. package/dist/components/{p-B2bvM2Ig.js → p-EQNS13GN.js} +1 -1
  111. package/dist/components/{p-Y9bth2Y_.js → p-G56USTsQ.js} +1 -1
  112. package/dist/components/p-OgFFKehL.js +1 -0
  113. package/dist/components/{p-C2ycO60j.js → p-kvYRImZT.js} +1 -1
  114. package/dist/components/{p-Chuj-LpI.js → p-rEdNIgD8.js} +1 -1
  115. package/dist/components/{p-DwuXVo2h.js → p-uCpFBDF5.js} +1 -1
  116. package/dist/esm/bn-annotation-layer_30.entry.js +608 -83
  117. package/dist/esm/bn-grid.entry.js +161 -34
  118. package/dist/esm/bn-image.entry.js +2 -2
  119. package/dist/esm/bn-internationalization.entry.js +2 -2
  120. package/dist/esm/bn-ruleset.entry.js +2 -2
  121. package/dist/esm/bn-template-engine.js +1 -1
  122. package/dist/esm/bn-text.entry.js +3 -3
  123. package/dist/esm/loader.js +1 -1
  124. package/dist/esm/{localFrame-BNWPPaQa.js → localFrame-CEZ7-hBs.js} +1 -1
  125. package/dist/esm/{withBodyObserver-AHQAUV85.js → withBodyObserver-D9yIMxdr.js} +1 -1
  126. package/dist/esm/{withHasError-B6Lvj9Cq.js → withHasError-UGtkLrYT.js} +11 -5
  127. package/dist/esm/{withStyled-CzzXg64f.js → withStyled-BlMqEIfr.js} +25 -2
  128. package/dist/esm/{withTranslation-C1gL7wSU.js → withTranslation-Bc3bjHTb.js} +2 -2
  129. package/dist/schemas/theme.schema.json +18 -0
  130. package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +11 -0
  131. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +16 -0
  132. package/dist/types/components/bn-chart-structure/utils/elements/Needle.d.ts +2 -1
  133. package/dist/types/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.d.ts +8 -0
  134. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +46 -1
  135. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +37 -0
  136. package/dist/types/components/bn-chart-time/utils/elements/Axis.d.ts +2 -0
  137. package/dist/types/components/bn-chart-time/utils/elements/Needle.d.ts +2 -1
  138. package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
  139. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +6 -1
  140. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +6 -0
  141. package/dist/types/components/bn-grid/bn-grid.d.ts +23 -0
  142. package/dist/types/components/bn-grid/utils/cellLayout.d.ts +39 -3
  143. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -1
  144. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +9 -0
  145. package/dist/types/components/bn-title/bn-title-renderer/bn-title-renderer.d.ts +2 -0
  146. package/dist/types/components/bn-title/bn-title.d.ts +10 -0
  147. package/dist/types/components.d.ts +173 -6
  148. package/dist/types/stores/componentStyles.d.ts +8 -0
  149. package/dist/types/utils/DateStringFactory.d.ts +4 -0
  150. package/dist/types/utils/layoutState/types.d.ts +3 -0
  151. package/dist/types/utils/model/VarianceScenario.d.ts +2 -0
  152. package/dist/types/utils/validate.d.ts +2 -0
  153. package/package.json +1 -1
  154. package/dist/bn-template-engine/p-1b002bd5.entry.js +0 -1
  155. package/dist/bn-template-engine/p-750b2c82.entry.js +0 -1
  156. package/dist/bn-template-engine/p-D0tNATZq.js +0 -1
  157. package/dist/bn-template-engine/p-DF9sfwBN.js +0 -1
  158. package/dist/bn-template-engine/p-EcC0qLtU.js +0 -1
  159. package/dist/components/p-1B_s8oPY.js +0 -1
  160. package/dist/components/p-AwH1w8Mu.js +0 -1
  161. package/dist/components/p-BiSytXUy.js +0 -1
  162. package/dist/components/p-C3gYq-HU.js +0 -1
  163. package/dist/components/p-CEf5X8MZ.js +0 -1
  164. package/dist/components/p-CniN8ALm.js +0 -1
  165. package/dist/components/p-D40Am1Ap.js +0 -1
  166. package/dist/components/p-DDvWTgk1.js +0 -1
  167. package/dist/components/p-DjPWZfry.js +0 -1
  168. package/dist/components/p-DnDL1pPc.js +0 -1
  169. package/dist/components/p-sLbQ7yZ1.js +0 -1
@@ -1 +0,0 @@
1
- import{f as r,g as s}from"./p-D6YGOYV1.js";import{g as o,c as t}from"./p-DDvWTgk1.js";import{r as a}from"./p-Dq9dG0Kr.js";import{m as e}from"./p-B2NXsfMz.js";const p=p=>{let m,f,c,i;const n=()=>{const r=f.componentStyles.state;i=e([r._system||{},r._default||{},r[c]||{}],{arrayMergeType:"overwrite"})},g=p.connectedCallback;p.connectedCallback=()=>{const t=s(p);f=o(t),i=f.componentStyles.state._system,c=p.selectedStyle,n(),m=f.componentStyles.on("set",(o=>{o!==c&&"_default"!==o||(c=p.selectedStyle,n(),r(s(p)))})),a(g,p)};const j=p.disconnectedCallback;return p.disconnectedCallback=()=>{a(m),t(s(p)),a(j,p)},r=>(void 0!==f&&p.selectedStyle!==c&&(c=p.selectedStyle,n()),r(i))};export{p as w}
@@ -1 +0,0 @@
1
- import{p as t,H as i,h as s,a as e,t as h}from"./p-D6YGOYV1.js";import{r as n,m as o,s as r,g as a,d as l}from"./p-DDvWTgk1.js";import{C as d,I as c}from"./p-CniN8ALm.js";import{w as u}from"./p-Dq9dG0Kr.js";import{e as v,r as m}from"./p-ClruFZD_.js";import{S as f,F as b,a as p,P as w}from"./p-eWxolPDU.js";import{d as g,S as y}from"./p-BzjGUtYh.js";import{X as x,r as M,a as $,x as z,f as j,b as L,P as S,c as P,F as W,d as D,S as k}from"./p-BfUdaxZ9.js";import{g as C}from"./p-4q8nRcWC.js";import{N}from"./p-BJmwHV0a.js";import{a as E,r as F,i as T}from"./p-BXXjh6We.js";class A{constructor(t,i,s,e,h){this.mode=t,this.vMax=i,this.rMaxPx=s,this.rMinPx=e,this.areaPerUnitPx2=h}static local(t,i,s){return new A("local",t,i,s,0)}static grouped(t){return new A("grouped",0,0,0,t)}radius(t){return"grouped"===this.mode?t<=0?0:Math.sqrt(this.areaPerUnitPx2*t/Math.PI):this.vMax<=0||t<=0?this.rMinPx:Math.max(this.rMinPx,this.rMaxPx*Math.sqrt(t/this.vMax))}}class B{constructor(t,i,s,e,h,n){var o,r,a,l;this.ruleSet=t,this.config=e,this.styles=h,this.availableWidth=n,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.hatchPatterns=new Set,this.scaleOverflowCount=0,this.svgRoot=null,this.config=Object.assign(Object.assign({},e),{x:E(e.x),y:E(e.y)});const d=new x;let c=[];try{""!==s&&(c=i.exec(`SELECT * FROM ${s}`))}catch(t){this.queryError=v(t)}const u=(null!=c?c:[]).map((t=>d.adapt(t)));this.data=M(u,{pointLevel:e.pointLevel,seriesLevel:e.seriesLevel,facetLevel:null!==e.facet?"rowgroup"===e.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=F(e.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(r=F(e.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"},size:null!==(a=F(e.size.measure))&&void 0!==a?a:{kind:"scenario",slot:"ac3"},share:null!==e.share&&null!==(l=F(e.share.measure))&&void 0!==l?l:void 0},compareFamily:e.compareFamily,domains:{x:{min:this.config.x.min,max:this.config.x.max},y:{min:this.config.y.min,max:this.config.y.max}},limit:e.limit,limitBy:"size"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}get xPercent(){return T(this.config.x.measure)}get yPercent(){return T(this.config.y.measure)}get sizePercent(){return T(this.config.size.measure)}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=d(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,o;return t.text(i).font({size:this.styles.fontStyles.size,weight:h.bold?"bold":"normal",anchor:null!==(n=h.anchor)&&void 0!==n?n:"start"}).fill(null!==(o=h.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:e,"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}setI18n(t){this.i18nMap=t}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}primaryColorIndex(){const t=F(this.config.size.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}compareColorIndex(){return this.ruleSet.getScenarioColorIndex(`${this.config.compareFamily}1`)}seriesHue(t){const{color:i,overflowed:s}=n(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),i}familyDisplayName(t){return this.ruleSet.getScenario(`${t}1`).group}legendModel(){var t,i;const s=[],e=null!==(i=null!==(t=this.config.size.label)&&void 0!==t?t:this.i18nMap.get("legend.size"))&&void 0!==i?i:"";""!==e&&(s.push(e),void 0!==this.config.size.unit&&""!==this.config.size.unit&&s.push(`${this.i18nMap.get("axis.in")||"in"} ${this.config.size.unit}`));const h=[];if(null!==this.config.compareFamily){const t=F(this.config.size.measure),i=null!==t&&"scenario"===t.kind?t.slot.replace(/\d+$/,""):"ac";h.push(this.legendEntry(this.familyDisplayName(this.config.compareFamily),this.compareColorIndex(),0)),h.push(this.legendEntry(this.familyDisplayName(i),this.primaryColorIndex(),0))}const n=this.data.series.map((t=>{var i;return this.legendEntry(""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,this.primaryColorIndex(),t.index)}));return{sizeCaption:s,title:this.i18nMap.get("legend.title")||null,compareEntries:h,entries:n}}legendEntry(t,i,s){const e=this.seriesHue(s),h=o(i,e,"bubble");return{label:t,treatment:h,fill:this.treatmentFill(h,s,e)}}toString(){const t=new f;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}axisTitle(t,i){var s;const e=null!==(s=t.label)&&void 0!==s?s:"";return""===e?"":void 0===t.unit||""===t.unit?e:`${e} ${i} ${t.unit}`}draw(t){var i,s,e,h,n,o,r,a,l,d,c;this.warnings=this.data.warnings.slice(),this.hatchPatterns.clear(),this.scaleOverflowCount=0,this.svgRoot=t;const u=this.em,v=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",f=t.group(),b=new $(this.styles),p=this.legendModel(),w=this.config.legend.show&&(p.entries.length>0||p.sizeCaption.length>0),g=w?b.measure(p,this.config.legend.position):{width:0,height:0},y="right"===this.config.legend.position&&w?g.width+u:0,x=""!==this.config.chartTitle?1.6*u:0,M=this.axisTitle(this.config.y,m),L=this.axisTitle(this.config.x,m),S=""!==M?1.4*u:.4*u,P=1.4*u+(""!==L?1.3*u:0);let D,k=3*u,C={x:0,y:0,width:0,height:0},E=[];const F=Math.max(1,this.data.facets.length),T=null===(i=this.config.facet)||void 0===i?void 0:i.columns,B=N.domain(null!==(e=null===(s=this.data.extents)||void 0===s?void 0:s.xMin)&&void 0!==e?e:0,null!==(n=null===(h=this.data.extents)||void 0===h?void 0:h.xMax)&&void 0!==n?n:1,{min:this.config.x.min,max:this.config.x.max}),U=N.domain(null!==(r=null===(o=this.data.extents)||void 0===o?void 0:o.yMin)&&void 0!==r?r:0,null!==(l=null===(a=this.data.extents)||void 0===a?void 0:a.yMax)&&void 0!==l?l: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-v.left-v.right-k-y);C={x:v.left+k,y:v.top+x+S,width:t,height:t/this.config.aspect},D=new W(F,T,C,this.styles.scaleFactors.panelGap*u);const i=D.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),e=new N(U[0],U[1],i,0);E=e.ticks(s);const h=z(E,this.yPercent);k=Math.max(...E.map((t=>this.textWidth(j(t,h,this.styles.locale,this.yPercent)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=C.y+C.height+P+("bottom"===this.config.legend.position&&w?g.height+u:0)+v.bottom,""!==this.config.chartTitle&&this.drawText(f,this.config.chartTitle,v.left,v.top+u,{bold:!0}),""!==M&&this.drawAxisTitleText(f,this.config.y,m,v.left,C.y-.6*u,"start");const H=this.buildPanels(D,B,U),I=H[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(H[0].rect.width/(7*u))))),O=z(I,this.xPercent),X=z(E,this.yPercent),Y=this.config.sizeAreaPerUnit>0?A.grouped(this.config.sizeAreaPerUnit):A.local(null!==(c=null===(d=this.data.extents)||void 0===d?void 0:d.sizeMax)&&void 0!==c?c:0,this.styles.scaleFactors.bubbleMaxRadius*u,this.styles.scaleFactors.bubbleMinRadius*u);0===this.data.facets.length?this.drawPanel(f,H[0],{key:"",points:[]},Y,I,E,O,X,!0,!0):this.data.facets.forEach(((t,i)=>{this.drawPanel(f,H[i],t,Y,I,E,O,X,D.isOuterLeft(i),D.isOuterBottom(i),this.data.facets.length>1?t.key:"")})),""!==L&&this.drawAxisTitleText(f,this.config.x,m,C.x+C.width,C.y+C.height+2.6*u,"end"),w&&("right"===this.config.legend.position?b.draw(f,p,C.x+C.width+u,C.y,"right"):b.draw(f,p,C.x,C.y+C.height+P,"bottom")),this.scaleOverflowCount>0&&this.addWarningOnce("bubble-scale-overflow",{count:String(this.scaleOverflowCount)}),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,e,h,n){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"===n?(this.drawText(t,r,e,h,{bold:!0}),""!==a&&this.drawText(t,a,e+this.textWidth(r,!0)+l,h,{})):""!==a?(this.drawText(t,a,e,h,{anchor:"end"}),this.drawText(t,r,e-this.textWidth(a)-l,h,{anchor:"end",bold:!0})):this.drawText(t,r,e,h,{anchor:"end",bold:!0})}buildPanels(t,i,s){const e=[];for(let h=0;h<t.count;h++){const n=t.panelRect(h),o=new N(i[0],i[1],n.x,n.x+n.width),r=new N(s[0],s[1],n.y+n.height,n.y);e.push({rect:n,xScale:o,yScale:r,frame:new L(o,r,n,this.styles)})}return e}treatmentFill(t,i,s){return!0!==t.hatch?t.fill:(this.ensureHatchPattern(i,s),`url(#xy-fc-${i})`)}ensureHatchPattern(t,i){this.hatchPatterns.has(t)||null===this.svgRoot||(this.hatchPatterns.add(t),this.svgRoot.defs().pattern(10,10,(t=>{t.rect(10,10).fill("#ffffff"),t.line(0,10,10,0).stroke({color:i,width:2}),t.line(-2.5,2.5,2.5,-2.5).stroke({color:i,width:2}),t.line(7.5,12.5,12.5,7.5).stroke({color:i,width:2})})).id(`xy-fc-${t}`))}drawPanel(t,i,s,e,h,n,a,l,d,c,u=""){var v,m,f,b,p,w;const y=t.group(),x=this.em;i.frame.drawBands(y,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(y,n,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*x?h:void 0),i.frame.drawRefLines(y,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(y);const M=y.group().id("compare"),$=y.group().id("primary"),z=new S(i.rect,this.styles.scaleFactors.labelToMark*x),j=[...s.points].sort(((t,i)=>{var s,e;return(null!==(s=i.size)&&void 0!==s?s:0)-(null!==(e=t.size)&&void 0!==e?e:0)})),L=[];for(const t of j){const h=null!==(m=null===(v=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===v?void 0:v.index)&&void 0!==m?m:0,n=this.seriesHue(h),a=o(this.primaryColorIndex(),n,"bubble"),l=i.xScale.scale(t.x),d=i.yScale.scale(t.y),c=e.radius(null!==(f=t.size)&&void 0!==f?f:0);if(this.config.sizeAreaPerUnit>0&&this.bubbleExceedsPanel(i.rect,l,d,c)&&this.scaleOverflowCount++,null!=t.compare){const s=o(this.compareColorIndex(),n,"bubble"),r=i.xScale.scale(t.compare.x),a=i.yScale.scale(t.compare.y),l=e.radius(null!==(b=t.compare.size)&&void 0!==b?b:0);this.drawBubble(M,r,a,l,s,h,n),z.registerMark(r,a,l),this.config.labels.values&&void 0!==t.compare.size&&l>=1.2*x&&this.drawValueLabel(M,r,a,l,t.compare.size,s.fill)}const u=P(t,s.key,this.config);null===(p=this.drawBubble($,l,d,c,a,h,n))||void 0===p||p.attr(g(u,"element")),z.registerMark(l,d,c),void 0!==t.share&&c>0&&(null===(w=this.drawShareSlice($,l,d,c,t.share,r(n)))||void 0===w||w.attr(g(u))),this.config.labels.values&&void 0!==t.size&&this.drawValueLabel($,l,d,c,t.size,!0===a.hatch?"#ffffff":a.fill),L.push({point:t,cx:l,cy:d,r:c,seriesIndex:h,hue:n,treatment:a})}this.drawNameLabels(y,z,L,s.key),i.frame.drawTickLabels(y,{ticksX:h,ticksY:n,xDecimals:a,yDecimals:l,xPercent:this.xPercent,yPercent:this.yPercent,showXLabels:c,showYLabels:d}),""!==u&&i.frame.drawPanelTitle(y,u)}bubbleExceedsPanel(t,i,s,e){return i-e<t.x||i+e>t.x+t.width||s-e<t.y||s+e>t.y+t.height}drawBubble(t,i,s,e,h,n,o){if(!(e<=0))return t.circle(2*e).center(i,s).fill(this.treatmentFill(h,n,o)).stroke({color:h.stroke,width:h.strokeWidth})}drawShareSlice(t,i,s,e,h,n){if(h<=0)return;if(h>=1)return t.circle(2*e).center(i,s).fill(n);const o=2*h*Math.PI,r=i+e*Math.sin(o),a=s-e*Math.cos(o),l=o>Math.PI?1:0;return t.path(`M ${i} ${s} L ${i} ${s-e} A ${e} ${e} 0 ${l} 1 ${r} ${a} Z`).fill(n).stroke("none")}drawValueLabel(t,i,s,e,h,n){const o=j(h,this.valueDecimals(),this.styles.locale,this.sizePercent);this.textWidth(o)+.4*this.em>2*e||this.drawText(t,o,i,s+.35*this.em,{anchor:"middle",color:C(n)})}drawNameLabels(t,i,s,e){const h=[...s].sort(((t,i)=>{var s,e;return(null!==(s=i.point.size)&&void 0!==s?s:0)-(null!==(e=t.point.size)&&void 0!==e?e:0)})),{selected:n,unknownNames:o}=i.selectCandidates(h,this.config.labels.points,this.config.labels.max,(t=>t.point.name));o.length>0&&this.addWarningOnce("xy-label-unknown",{names:o.join(", ")});const r=new Map,a=n.map((t=>{const i={name:t.point.name,cx:t.cx,cy:t.cy,r:t.r,width:this.textWidth(t.point.name),height:1.1*this.em};return r.set(i,t.point),i}));for(const s of i.place(a))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{}).attr(g(P(r.get(s.candidate),e,this.config),"label"))}valueDecimals(){var t,i,s;let e=0;for(const h of this.data.facets)for(const n of h.points)e=Math.max(e,Math.abs(null!==(t=n.size)&&void 0!==t?t:0),Math.abs(null!==(s=null===(i=n.compare)||void 0===i?void 0:i.size)&&void 0!==s?s:0));return e>0&&Number.isFinite(e)?(this.sizePercent&&(e*=100),N.stepDecimals(Math.pow(10,Math.floor(Math.log10(e))-2))):1}}const U=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-label-unknown","xy-series-overflow","xy-point-budget","bubble-size-negative","bubble-share-range","bubble-scale-overflow"],H=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.tableName="",this.dataVersion=0,this.chartTitle="",this.share=null,this.compareFamily=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.sizeAreaPerUnit=0,this.i18n=new Map,this.containerWidth=0,this.svgMarkup="",u(this)}getDb(){return this.stores||(this.stores=a(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=l(this.getDb(),this.tableName,this.filter);this.chart=new B(new c(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,size:this.size,share:this.share,compareFamily:this.compareFamily,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit,sizeAreaPerUnit:this.sizeAreaPerUnit},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 U){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 D(new k,new b,new p(new y),new w).adapt(this.styles);return s.locale=(null===(i=null===(t=a(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-bubble-renderer",{tableName:[1,"table-name"],dataVersion:[2,"data-version"],chartTitle:[1,"chart-title"],x:[16],y:[16],size:[16],share:[16],compareFamily:[1,"compare-family"],labels:[16],legend:[16],facet:[16],pointLevel:[1,"point-level"],seriesLevel:[1,"series-level"],aspect:[2],limit:[2],filter:[1],sizeAreaPerUnit:[2,"size-area-per-unit"],styles:[16],i18n:[16],containerWidth:[2,"container-width"],ruleSetConfig:[16],errors:[16],translator:[16]}]);function I(){"undefined"!=typeof customElements&&["bn-chart-bubble-renderer"].forEach((t=>{"bn-chart-bubble-renderer"===t&&(customElements.get(h(t))||customElements.define(h(t),H))}))}export{H as B,I as d}
@@ -1 +0,0 @@
1
- import{D as t}from"./p-Dq9dG0Kr.js";var e,s;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(e||(e={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(s||(s={}));class r{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW kkkk",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),r.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),r.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,s){switch(s){case e.DAY:return this.getFormatedDayDate(t);case e.MONTH:return this.getFormatedMonthDate(t);case e.QUARTER:return this.getFormatedQuarterDate(t);case e.WEEK:return this.getFormatedWeekDate(t);case e.HOUR:return this.getFormatedHourDate(t);case e.MINUTE:return this.getFormatedMinuteDate(t);case e.SECOND:return this.getFormatedSecondDate(t);case e.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,s)}}calculateDistanceType(s,r,i=32){if(null==r)return e.DAY;const a="number"==typeof s?t.fromMillis(s):s,n="number"==typeof r?t.fromMillis(r):r;return 0===n.diff(a).as("milliseconds")?e.DAY:n.diff(a).as("milliseconds")<i?e.MILLISECOND:n.diff(a).as("seconds")<i?e.SECOND:n.diff(a).as("minutes")<i?e.MINUTE:n.diff(a).as("hours")<i?e.HOUR:n.diff(a).as("days")<i?e.DAY:n.diff(a).as("weeks")<i?e.WEEK:n.diff(a).as("months")<i?e.MONTH:n.diff(a).as("quarters")<i?e.QUARTER:e.YEAR}datesBetween(t,e,s){const r=this.convertDateDistanceToMomentunitOfTime(s),i=t.startOf(r),a=e.endOf(r),n=[];let h=i;do{n.push(h),h=h.plus(this.createDiratonLike(r,1))}while(h<=a);return n}countBetween(t,e,s){const r=this.convertDateDistanceToMomentunitOfTime(s);return Math.floor(e.startOf(r).diff(t.startOf(r),r).as(r))+1}getDateLinkString(r,i,a,n,h){if(null==r&&null==i)return"";if(null==r&&a!==s.END&&a!==s.YTD)return"";if(null==i&&(s.INTERVAL===a||s.CUM===a||s.END===a||s.YTD===a))return"";const u=r||t.now(),c=i;n===e.AUTO&&(n=this.calculateDistanceType(u,c,h));let o=this.getDateString(u,n),l="",y=s.NONE;return null!=c&&(l=this.getDateString(c,n),y=s.INTERVAL,o===l&&a===s.INTERVAL&&(a=s.NONE),o===l&&a===s.AVG&&(y=s.NONE),s.END!==a&&s.YTD!==a||(o=l),a!==s.INTERVAL&&a!==s.CUM&&a!==s.AVG||(n===e.QUARTER?u.quarter===c.quarter&&u.year===c.year?l=l.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.MONTH?u.month===c.month&&u.year===c.year?l=l.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.WEEK&&(u.weekNumber===c.weekNumber&&u.weekYear===c.weekYear?l=l.replace(" "+c.weekYear,""):u.weekYear===c.weekYear&&(o=o.replace(" "+u.weekYear,""))))),this.dateLinkFormat[a].replace("[LINK]",this.dateLinkFormat[y]).replace("[DATE]",o).replace("[DATE2]",l)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" kk"),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let s;switch(t){case e.YEAR:s="year";break;case e.MONTH:s="month";break;case e.QUARTER:s="quarter";break;case e.WEEK:s="week";break;case e.DAY:s="day";break;case e.HOUR:s="hour";break;case e.MINUTE:s="minute";break;case e.SECOND:s="second";break;case e.MILLISECOND:s="millisecond";break;default:s="day"}return s}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}r.LOCALE_DATE_FORMAT={en:{week:"'W'WW kkkk",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},r.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};export{e as D,s as a,r as b}