@bino-bi/bn-template-engine 1.0.0-alpha.16 → 1.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-0107f0cc.entry.js +1 -0
- package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
- package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
- package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
- package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
- package/dist/bn-template-engine/p-5651417d.entry.js +1 -0
- package/dist/bn-template-engine/p-5bfdc1e5.entry.js +1 -0
- package/dist/bn-template-engine/p-6b75762d.entry.js +1 -0
- package/dist/bn-template-engine/{p-ff659485.entry.js → p-7bdc0e28.entry.js} +1 -1
- package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
- package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
- package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
- package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
- package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
- package/dist/bn-template-engine/p-CBqUr7I8.js +1 -0
- package/dist/bn-template-engine/{p-BPDZcex5.js → p-CPzF3Q2m.js} +1 -1
- package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
- package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
- package/dist/bn-template-engine/p-a130cb43.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-dc745c32.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/p-f3d1fa06.entry.js +1 -0
- package/dist/bn-template-engine/p-fcb43f2c.entry.js +1 -0
- package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
- package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
- package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-DobBozQC.js +87 -0
- package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
- package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
- package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +1614 -9670
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
- package/dist/cjs/bn-grid.cjs.entry.js +5 -3
- package/dist/cjs/bn-image.cjs.entry.js +5 -3
- package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
- package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +8 -79
- package/dist/cjs/bn-tree.cjs.entry.js +4 -2
- package/dist/cjs/{context-protocol-Cn5PL928.js → context-protocol-BDrMkhc4.js} +272 -1
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
- package/dist/cjs/layoutObserver-p0wXIWFg.js +350 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/{scaling-DM2UILdF.js → scaling-BmqxcNOf.js} +1 -1
- package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
- package/dist/cjs/{withStyled-Dx3uRw9g.js → withStyled-CRiC9fzc.js} +44 -383
- package/dist/collection/collection-manifest.json +7 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +23 -2
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +29 -4
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +3 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +27 -4
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +29 -4
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +16 -4
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +1 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
- package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +1 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +26 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +33 -4
- package/dist/collection/components/bn-message/bn-message.css +6 -2
- package/dist/collection/components/bn-message/bn-message.js +3 -2
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
- package/dist/collection/components/bn-table/bn-table.js +146 -14
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +64 -8
- package/dist/collection/components/bn-table/utils/Table.js +43 -5
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
- package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
- package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +87 -15
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +284 -3
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
- package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
- package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +10 -0
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +2 -75
- package/dist/collection/components/bn-title/bn-title.js +27 -3
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -3
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/stores/componentStyles.js +67 -0
- package/dist/collection/stores/createScopedStores.js +6 -1
- package/dist/collection/stores/internationalization.js +68 -0
- package/dist/collection/stores/ruleSets.js +46 -0
- package/dist/collection/utils/constants.js +5 -0
- package/dist/collection/utils/ibcsRuleSet.js +14 -26
- package/dist/collection/utils/sanitizeHtml.js +81 -0
- package/dist/collection/utils/validate.js +24 -0
- package/dist/collection/utils/withComponentStyle.js +3 -5
- package/dist/collection/utils/withInheritedProps.js +1 -1
- package/dist/collection/utils/withRuleSet.js +105 -0
- package/dist/collection/utils/withScalingGroup.js +3 -0
- package/dist/collection/utils/xy/FacetGrid.js +36 -0
- package/dist/collection/utils/xy/IsoCurves.js +156 -0
- package/dist/collection/utils/xy/NumericScale.js +103 -0
- package/dist/collection/utils/xy/PointLabeler.js +96 -0
- package/dist/collection/utils/xy/RadiusScale.js +42 -0
- package/dist/collection/utils/xy/SeriesPalette.js +80 -0
- package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
- package/dist/collection/utils/xy/XYFrame.js +120 -0
- package/dist/collection/utils/xy/XYLegend.js +107 -0
- package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
- package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
- package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
- package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
- package/dist/components/AxisConfig.js +1 -0
- package/dist/components/CompareUtil.js +1 -0
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/LabelCollisionManager.js +1 -0
- package/dist/components/NumericScale.js +1 -0
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/SiPrefix.js +1 -0
- package/dist/components/StringAdapter.js +1 -0
- package/dist/components/VarianceMeasure.js +1 -0
- package/dist/components/XYChartDataRow.js +1 -0
- package/dist/components/bn-chart-bubble.d.ts +11 -0
- package/dist/components/bn-chart-bubble.js +1 -0
- package/dist/components/bn-chart-bullet.d.ts +11 -0
- package/dist/components/bn-chart-bullet.js +1 -0
- package/dist/components/bn-chart-scatter.d.ts +11 -0
- package/dist/components/bn-chart-scatter.js +1 -0
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer2.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-ruleset.d.ts +11 -0
- package/dist/components/bn-ruleset.js +1 -0
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/formatter.js +1 -0
- package/dist/components/ibcs-chart-bubble.d.ts +11 -0
- package/dist/components/ibcs-chart-bubble.js +1 -0
- package/dist/components/ibcs-chart-bubble2.js +1 -0
- package/dist/components/ibcs-chart-bullet.d.ts +11 -0
- package/dist/components/ibcs-chart-bullet.js +1 -0
- package/dist/components/ibcs-chart-bullet2.js +1 -0
- package/dist/components/ibcs-chart-scatter.d.ts +11 -0
- package/dist/components/ibcs-chart-scatter.js +1 -0
- package/dist/components/ibcs-chart-scatter2.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/layoutObserver.js +1 -1
- package/dist/components/luxon.js +1 -1
- package/dist/components/main.js +1 -0
- package/dist/components/merge.js +1 -0
- package/dist/components/sanitizeHtml.js +1 -0
- package/dist/components/stackColors.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withComponentStyle.js +1 -1
- package/dist/components/withDataset.js +1 -0
- package/dist/components/withRuleSet.js +1 -0
- package/dist/components/withScalingGroup.js +1 -0
- package/dist/components/withStyled.js +1 -1
- package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
- package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BPeWfygb.js +83 -0
- package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
- package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
- package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +1127 -9183
- package/dist/esm/bn-chart-bubble.entry.js +760 -0
- package/dist/esm/bn-chart-bullet.entry.js +783 -0
- package/dist/esm/bn-chart-scatter.entry.js +656 -0
- package/dist/esm/bn-grid.entry.js +5 -3
- package/dist/esm/bn-image.entry.js +5 -3
- package/dist/esm/bn-internationalization.entry.js +2 -2
- package/dist/esm/bn-ruleset.entry.js +39 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +7 -78
- package/dist/esm/bn-tree.entry.js +4 -2
- package/dist/esm/{context-protocol-BB-4Onmw.js → context-protocol-1Yj1uKvh.js} +268 -2
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
- package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
- package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
- package/dist/esm/layoutObserver-DCbmpGrz.js +345 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/{scaling-h4KcBet3.js → scaling-B_k50v9z.js} +2 -2
- package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
- package/dist/esm/{withStyled-BBvU2f-A.js → withStyled-Br2DGTPs.js} +30 -367
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
- package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
- package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
- package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +7 -0
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +2 -0
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +1 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +10 -1
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +2 -0
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +1 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +10 -0
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +14 -0
- package/dist/types/components/bn-message/bn-message.d.ts +5 -2
- package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
- package/dist/types/components/bn-table/bn-table.d.ts +38 -5
- package/dist/types/components/bn-table/ibcs-table.d.ts +8 -1
- package/dist/types/components/bn-table/utils/Table.d.ts +8 -0
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
- package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
- package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
- package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +13 -7
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +17 -0
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
- package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
- package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +4 -0
- package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
- package/dist/types/components/bn-title/bn-title.d.ts +11 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components.d.ts +1383 -82
- package/dist/types/context/context-protocol.d.ts +2 -0
- package/dist/types/stores/componentStyles.d.ts +41 -0
- package/dist/types/stores/createScopedStores.d.ts +2 -0
- package/dist/types/stores/ruleSets.d.ts +40 -0
- package/dist/types/utils/constants.d.ts +5 -0
- package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
- package/dist/types/utils/model/ChartStyles.d.ts +2 -1
- package/dist/types/utils/sanitizeHtml.d.ts +6 -0
- package/dist/types/utils/validate.d.ts +12 -0
- package/dist/types/utils/withInheritedProps.d.ts +11 -0
- package/dist/types/utils/withRuleSet.d.ts +24 -0
- package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
- package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
- package/dist/types/utils/xy/NumericScale.d.ts +41 -0
- package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
- package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
- package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
- package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
- package/dist/types/utils/xy/XYFrame.d.ts +44 -0
- package/dist/types/utils/xy/XYLegend.d.ts +43 -0
- package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
- package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
- package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
- package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
- package/package.json +1 -1
- package/readme.md +7 -3
- package/dist/bn-template-engine/p-19f49fbc.entry.js +0 -1
- package/dist/bn-template-engine/p-3465fcdc.entry.js +0 -1
- package/dist/bn-template-engine/p-67746414.entry.js +0 -1
- package/dist/bn-template-engine/p-6b469808.entry.js +0 -1
- package/dist/bn-template-engine/p-86ca2d5e.entry.js +0 -1
- package/dist/bn-template-engine/p-Tx6omDWp.js +0 -1
- package/dist/bn-template-engine/p-d724ab88.entry.js +0 -1
- package/dist/bn-template-engine/p-efd3b67a.entry.js +0 -1
- package/dist/bn-template-engine/p-z9bPNFYF.js +0 -1
- package/dist/components/ibcsRuleSet.js +0 -1
- package/dist/components/scaling.js +0 -1
- package/dist/components/withInheritedProps.js +0 -1
|
@@ -52,7 +52,7 @@ export class TableRow {
|
|
|
52
52
|
getCells() {
|
|
53
53
|
return this.elements;
|
|
54
54
|
}
|
|
55
|
-
createElement(value, scenario, columnType, cellType, prefix, cellStyle, isSecondaryElement, categoryWidth, measureScale, isBarChart = false, columnStats) {
|
|
55
|
+
createElement(value, scenario, columnType, cellType, prefix, cellStyle, isSecondaryElement, categoryWidth, measureScale, isBarChart = false, columnStats, colSpan = 1, waterfall) {
|
|
56
56
|
let cssStyle = cellStyle;
|
|
57
57
|
if (scenario === "category" && categoryWidth != null) {
|
|
58
58
|
cssStyle = `category-${categoryWidth.toString()}`;
|
|
@@ -82,9 +82,10 @@ export class TableRow {
|
|
|
82
82
|
if (columnType) {
|
|
83
83
|
cssStyle = `${cssStyle} ${columnType}`;
|
|
84
84
|
}
|
|
85
|
-
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle,
|
|
85
|
+
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, colSpan, measureScale);
|
|
86
86
|
cell.isBarChart = isBarChart;
|
|
87
87
|
cell.columnStats = columnStats;
|
|
88
|
+
cell.waterfall = waterfall;
|
|
88
89
|
this.elements.push(cell);
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { AXIS_COLOR, DEFAULT_STYLES, formatValue, getBarFill, getBarStroke, getBarStyle, getScenarioType, PatternDefs, } from "./CellBarChart";
|
|
3
|
+
/**
|
|
4
|
+
* Renders one row of an IBCS waterfall for a scenario bar column.
|
|
5
|
+
*
|
|
6
|
+
* All rows of a column share the same coordinate system: the geometry's
|
|
7
|
+
* min/max extents (value units, always including zero) are mapped onto the
|
|
8
|
+
* bar area, so bars always fit and the zero axis sits at the same x position
|
|
9
|
+
* in every row. Fixed unit scaling is deliberately not applied — a clipped
|
|
10
|
+
* bar would break the start position of every subsequent bar.
|
|
11
|
+
*
|
|
12
|
+
* Layout: [left label area][bar area][right label area]
|
|
13
|
+
* The value label sits at the bar's free end (right of rightward bars,
|
|
14
|
+
* left of leftward bars). thereof/partof rows additionally get dashed
|
|
15
|
+
* guides marking their parent bar's extent.
|
|
16
|
+
*/
|
|
17
|
+
export const WaterfallBar = (props) => {
|
|
18
|
+
const { value, scenario, height, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, waterfall, } = props;
|
|
19
|
+
const s = styles.scaleFactor;
|
|
20
|
+
const fs = styles.fontSize;
|
|
21
|
+
const range = waterfall.max - waterfall.min;
|
|
22
|
+
if (value === null || value === undefined || isNaN(value) || range <= 0) {
|
|
23
|
+
return (h("span", { class: "bar-chart-empty", style: { color: styles.fontColor, fontStyle: "italic" } }, "-"));
|
|
24
|
+
}
|
|
25
|
+
const labelAreaWidth = 38 * s;
|
|
26
|
+
const barAreaWidth = maxBarWidthEm * fs;
|
|
27
|
+
const totalWidth = labelAreaWidth + barAreaWidth + labelAreaWidth;
|
|
28
|
+
const pxPerUnit = barAreaWidth / range;
|
|
29
|
+
const xOf = (coordinate) => labelAreaWidth + (coordinate - waterfall.min) * pxPerUnit;
|
|
30
|
+
const padding = 2 * s;
|
|
31
|
+
const barHeight = height - padding * 2;
|
|
32
|
+
const barY = padding;
|
|
33
|
+
const axisX = xOf(0);
|
|
34
|
+
const startX = xOf(waterfall.start);
|
|
35
|
+
const endX = xOf(waterfall.end);
|
|
36
|
+
const barX = Math.min(startX, endX);
|
|
37
|
+
const barWidth = Math.abs(endX - startX);
|
|
38
|
+
const barStyle = getBarStyle(scenario, value, false, styles);
|
|
39
|
+
const fillValue = getBarFill(barStyle, getScenarioType(scenario));
|
|
40
|
+
const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
|
|
41
|
+
// Scenario values carry no variance sentiment — labels are unsigned per IBCS
|
|
42
|
+
const displayValue = formatValue(value, waterfall.kind === "partof", measureScale).replace(/^\+/, "");
|
|
43
|
+
const pointsLeft = endX < startX;
|
|
44
|
+
const labelX = pointsLeft ? barX - 4 * s : barX + barWidth + 4 * s;
|
|
45
|
+
const labelAnchor = pointsLeft ? "end" : "start";
|
|
46
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart waterfall-bar", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), waterfall.parentStart !== undefined && waterfall.parentEnd !== undefined && (h("line", { x1: xOf(waterfall.parentStart), y1: 0, x2: xOf(waterfall.parentStart), y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s, "stroke-dasharray": `${2 * s},${2 * s}` })), waterfall.parentStart !== undefined && waterfall.parentEnd !== undefined && (h("line", { x1: xOf(waterfall.parentEnd), y1: 0, x2: xOf(waterfall.parentEnd), y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s, "stroke-dasharray": `${2 * s},${2 * s}` })), barWidth > 0 && (h("rect", { x: barX, y: barY, width: barWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": fs, "font-family": styles.fontFamily }, displayValue)));
|
|
47
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TableRow } from "../elements";
|
|
2
2
|
import { TableRowType, TableType } from "../model";
|
|
3
|
-
import { DataQuery } from "../helper";
|
|
3
|
+
import { computeWaterfall, DataQuery, hasGroupingStructure, INTERVAL_NONE } from "../helper";
|
|
4
4
|
import { Formatter } from "../../../../utils";
|
|
5
|
-
import { I18nMode, DataFormat } from "../../../../utils/constants";
|
|
5
|
+
import { I18nMode, DataFormat, Scenarios } from "../../../../utils/constants";
|
|
6
6
|
import { QueryColumnNames, VarianceScenario } from "../../../../utils/model";
|
|
7
7
|
/**
|
|
8
8
|
* Transforms raw query results into structured TableRow collections for header and body.
|
|
@@ -32,8 +32,12 @@ export class TableDataSetFactory {
|
|
|
32
32
|
const header = [];
|
|
33
33
|
this.attributesByAlias = new Map(attributes.map((attribute) => [attribute.alias, attribute]));
|
|
34
34
|
this.normalizedHeader = this.normalizeHeader(type, scenarios, attributes);
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const hasIntervalColumns = this.normalizedHeader.some((column) => column.bucket !== undefined);
|
|
36
|
+
if (hasIntervalColumns) {
|
|
37
|
+
header.push(this.createIntervalBandRow());
|
|
38
|
+
}
|
|
39
|
+
const headerRow = new TableRow(hasIntervalColumns ? 1 : 0, 0, TableRowType.HEADER);
|
|
40
|
+
const separatorRow = new TableRow(hasIntervalColumns ? 2 : 1, 0, TableRowType.SEPERATORLINE);
|
|
37
41
|
for (const scenario of this.normalizedHeader) {
|
|
38
42
|
const attribute = this.attributesByAlias.get(scenario.name);
|
|
39
43
|
headerRow.createElement(attribute
|
|
@@ -45,6 +49,32 @@ export class TableDataSetFactory {
|
|
|
45
49
|
header.push(separatorRow);
|
|
46
50
|
return header;
|
|
47
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates the spanning interval band row (e.g. `2023 | 2024 | 2025`) rendered
|
|
54
|
+
* above the scenario label row. Leading non-interval columns (category,
|
|
55
|
+
* operation, attributes) receive borderless filler cells; each run of
|
|
56
|
+
* consecutive columns of the same bucket is spanned by one label cell.
|
|
57
|
+
*/
|
|
58
|
+
createIntervalBandRow() {
|
|
59
|
+
const bandRow = new TableRow(0, 0, TableRowType.HEADER);
|
|
60
|
+
let index = 0;
|
|
61
|
+
while (index < this.normalizedHeader.length) {
|
|
62
|
+
const column = this.normalizedHeader[index];
|
|
63
|
+
if (column.bucket === undefined) {
|
|
64
|
+
bandRow.createElement(null, column.type, "filler", null, null, null, null, null, null);
|
|
65
|
+
index += 1;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
let runLength = 1;
|
|
69
|
+
while (index + runLength < this.normalizedHeader.length &&
|
|
70
|
+
this.normalizedHeader[index + runLength].bucket === column.bucket) {
|
|
71
|
+
runLength += 1;
|
|
72
|
+
}
|
|
73
|
+
bandRow.createElement(column.bucketLabel, column.type, "intervalGroup", null, null, null, null, null, null, false, undefined, runLength);
|
|
74
|
+
index += runLength;
|
|
75
|
+
}
|
|
76
|
+
return bandRow;
|
|
77
|
+
}
|
|
48
78
|
setHeaderPrefix(scenario, i18n, measureScale, measureUnit, showMeasureScale) {
|
|
49
79
|
let prefix = "";
|
|
50
80
|
if (scenario.name === "category" && showMeasureScale) {
|
|
@@ -104,23 +134,33 @@ export class TableDataSetFactory {
|
|
|
104
134
|
* the columns correctyl (IBCS style)
|
|
105
135
|
*/
|
|
106
136
|
createBodyRows(config, i18n, db, fromExpr) {
|
|
137
|
+
var _a;
|
|
107
138
|
const bodyRows = [];
|
|
108
139
|
let iGroupIndex = -1; // index used in detailRow JSON to count the current group
|
|
109
140
|
const queryData = new DataQuery(config, i18n).execute(db, fromExpr); // collection of all query results
|
|
110
141
|
// Calculate column statistics for bar columns
|
|
111
|
-
const columnStatsMap = this.calculateColumnStatistics(queryData, config.barColumns);
|
|
142
|
+
const columnStatsMap = this.calculateColumnStatistics(queryData, config.barColumns, config.interval !== INTERVAL_NONE);
|
|
143
|
+
// Scenario bar columns render as a waterfall when grouping structure is present;
|
|
144
|
+
// interval/columnthereof composite columns are excluded and render as today
|
|
145
|
+
const waterfallColumns = ((_a = config.barColumns) !== null && _a !== void 0 ? _a : []).filter((column) => column.toUpperCase().trim() in Scenarios);
|
|
146
|
+
const waterfallResult = waterfallColumns.length > 0 &&
|
|
147
|
+
config.interval === INTERVAL_NONE &&
|
|
148
|
+
config.categoryThereOf.size === 0 &&
|
|
149
|
+
hasGroupingStructure(queryData)
|
|
150
|
+
? computeWaterfall(queryData, waterfallColumns, config.type)
|
|
151
|
+
: undefined;
|
|
112
152
|
for (const groupData of queryData) {
|
|
113
153
|
// groupData is a collection of dataRows, each group base on a query and represents a 'row' group
|
|
114
154
|
iGroupIndex += 1;
|
|
115
155
|
const iRowIndex = -1;
|
|
116
|
-
bodyRows.push(...this.createRow(config.i18n, i18n, config.scenariosUnitType, groupData, iGroupIndex, iRowIndex, config.categoryWidth, config.measureScale, config.barColumns, columnStatsMap));
|
|
156
|
+
bodyRows.push(...this.createRow(config.i18n, i18n, config.scenariosUnitType, groupData, iGroupIndex, iRowIndex, config.categoryWidth, config.measureScale, config.barColumns, columnStatsMap, waterfallResult));
|
|
117
157
|
}
|
|
118
158
|
return bodyRows;
|
|
119
159
|
}
|
|
120
160
|
/**
|
|
121
161
|
* Calculate min/max statistics for bar chart columns across all query data.
|
|
122
162
|
*/
|
|
123
|
-
calculateColumnStatistics(queryData, barColumns) {
|
|
163
|
+
calculateColumnStatistics(queryData, barColumns, intervalActive = false) {
|
|
124
164
|
const statsMap = new Map();
|
|
125
165
|
if (!barColumns || barColumns.length === 0) {
|
|
126
166
|
return statsMap;
|
|
@@ -135,12 +175,19 @@ export class TableDataSetFactory {
|
|
|
135
175
|
for (const groupData of queryData) {
|
|
136
176
|
for (const row of groupData) {
|
|
137
177
|
for (const column of barColumns) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
178
|
+
// with an active interval the rendered values live under the
|
|
179
|
+
// `column##bucket` keys; the plain column would hold the (larger)
|
|
180
|
+
// un-bucketed aggregate and skew the bar scaling
|
|
181
|
+
const values = intervalActive
|
|
182
|
+
? this.extractIntervalColumnValues(row, column)
|
|
183
|
+
: [this.extractColumnValue(row, column)];
|
|
184
|
+
for (const value of values) {
|
|
185
|
+
if (value !== null && !isNaN(value)) {
|
|
186
|
+
const stats = statsMap.get(column);
|
|
187
|
+
stats.min = Math.min(stats.min, value);
|
|
188
|
+
stats.max = Math.max(stats.max, value);
|
|
189
|
+
valuesMap.get(column).push(Math.abs(value));
|
|
190
|
+
}
|
|
144
191
|
}
|
|
145
192
|
}
|
|
146
193
|
}
|
|
@@ -162,6 +209,20 @@ export class TableDataSetFactory {
|
|
|
162
209
|
}
|
|
163
210
|
return statsMap;
|
|
164
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Extract all per-bucket values of an interval column (`column##<bucketKey>`).
|
|
214
|
+
*/
|
|
215
|
+
extractIntervalColumnValues(row, column) {
|
|
216
|
+
const prefix = column + "##";
|
|
217
|
+
const values = [];
|
|
218
|
+
for (const key of Object.keys(row)) {
|
|
219
|
+
if (key.startsWith(prefix)) {
|
|
220
|
+
const val = Number(row[key]);
|
|
221
|
+
values.push(isNaN(val) ? null : val);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return values;
|
|
225
|
+
}
|
|
165
226
|
/**
|
|
166
227
|
* Extract a numeric value from a row for a given column name.
|
|
167
228
|
* Handles the various naming conventions used in the table data.
|
|
@@ -199,7 +260,7 @@ export class TableDataSetFactory {
|
|
|
199
260
|
* @param barColumns
|
|
200
261
|
* @param columnStatsMap
|
|
201
262
|
*/
|
|
202
|
-
createRow(i18nMode, i18n, scenariosUnitType, groupData, iGroupIndex, iRowIndex, categoryWidth, measureScale, barColumns, columnStatsMap) {
|
|
263
|
+
createRow(i18nMode, i18n, scenariosUnitType, groupData, iGroupIndex, iRowIndex, categoryWidth, measureScale, barColumns, columnStatsMap, waterfallResult) {
|
|
203
264
|
var _a;
|
|
204
265
|
const result = [];
|
|
205
266
|
for (const rawDataRow of groupData) {
|
|
@@ -214,13 +275,24 @@ export class TableDataSetFactory {
|
|
|
214
275
|
const value = this.getRawDataRowElement(rawDataRow, scenario);
|
|
215
276
|
const isBarChart = (_a = barColumns === null || barColumns === void 0 ? void 0 : barColumns.includes(scenario.type)) !== null && _a !== void 0 ? _a : false;
|
|
216
277
|
const columnStats = isBarChart ? columnStatsMap === null || columnStatsMap === void 0 ? void 0 : columnStatsMap.get(scenario.type) : undefined;
|
|
217
|
-
|
|
278
|
+
// waterfall geometry only exists for plain scenario columns (no ## composites)
|
|
279
|
+
const waterfall = isBarChart &&
|
|
280
|
+
scenario.bucket === undefined &&
|
|
281
|
+
scenario.name === scenario.group &&
|
|
282
|
+
scenario.name === scenario.type
|
|
283
|
+
? waterfallResult === null || waterfallResult === void 0 ? void 0 : waterfallResult.get(rawDataRow, scenario.type)
|
|
284
|
+
: undefined;
|
|
285
|
+
detailsRow.createElement(this.translateSumCellLabel(i18nMode, i18n, value, groupName, subCategory, type, scenario.type), scenario.type, this.createColumnType(scenario), this.setCellType(scenario.type, scenariosUnitType), this.translateCellPrefix(i18n, type, scenario.type), this.translateScenarioCSS(scenario.type, value), isSecondElement, categoryWidth, measureScale === null || measureScale === void 0 ? void 0 : measureScale.value, isBarChart, columnStats, 1, waterfall);
|
|
218
286
|
}
|
|
219
287
|
result.push(detailsRow);
|
|
220
288
|
}
|
|
221
289
|
return result;
|
|
222
290
|
}
|
|
223
291
|
getRawDataRowElement(rawDataRow, scenario) {
|
|
292
|
+
if (scenario.bucket !== undefined) {
|
|
293
|
+
// interval column: value lives under the composite bucket key
|
|
294
|
+
return rawDataRow[scenario.type + "##" + scenario.bucket];
|
|
295
|
+
}
|
|
224
296
|
if (scenario.name === scenario.group && scenario.name === scenario.type) {
|
|
225
297
|
// Default Sum Scenario (e.g. AC)
|
|
226
298
|
return rawDataRow[scenario.name];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OrderDirection, TableType } from "../model";
|
|
2
2
|
import { QueryGroups } from "./QueryGroup";
|
|
3
|
+
import { coerceBucketKey, INTERVAL_NONE, intervalBucketSQL } from "./IntervalColumns";
|
|
3
4
|
import { QueryColumnNames, VarianceScenario } from "../../../../utils/model";
|
|
4
5
|
/**
|
|
5
6
|
* AlaSQL-based query builder that produces the complete table result set for bn-table.
|
|
@@ -101,6 +102,7 @@ export class DataQuery {
|
|
|
101
102
|
this.detectNaNCells(this.config.scenarios, res);
|
|
102
103
|
this.createThereOfDrillRows(scenarios, attributesSQL, order, res);
|
|
103
104
|
this.createPartOfDrillRows(scenarios, order, sumGroupQueries, res);
|
|
105
|
+
this.createIntervalColumns(res);
|
|
104
106
|
this.createThereOfDrillColumns(this.config.categoryThereOf, res);
|
|
105
107
|
this.calculateColumnGroupRest(res, this.config.categoryThereOf);
|
|
106
108
|
this.calculateRelativeVariances(res, relativeScenarios);
|
|
@@ -180,8 +182,11 @@ export class DataQuery {
|
|
|
180
182
|
createRestRow(rowGroupEntry, querys, groups, scenarios, queryWhereSection, order) {
|
|
181
183
|
// Generates REST Row; sumsup the Bottom (total number of rows - limit)
|
|
182
184
|
if (rowGroupEntry.totalRowCnt - this.config.limit > 0 && this.config.limit !== 0) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
// sums every column the inner subquery produces (scenario values, _cnt companions, dr_* denominators)
|
|
186
|
+
const restScenarios = this.exctractScenarioNames(scenarios)
|
|
187
|
+
.map((name) => `SUM(${name}) as ${name}`)
|
|
188
|
+
.join(", ");
|
|
189
|
+
querys.push(`SELECT ${QueryColumnNames.ROWNR}, 1 as ${QueryColumnNames.ROWGROUPINDEX} , 'ENTRY' as ${QueryColumnNames.TYPE}, 'NO_GROUP' as ${QueryColumnNames.ROWGROUP}, 'REST' as ${QueryColumnNames.CATEGORY} ${restScenarios.length > 0 ? ", " + restScenarios : ""} FROM` +
|
|
185
190
|
` (SELECT ROWNUM() AS ${QueryColumnNames.ROWNR}, ${querys.length} as ${QueryColumnNames.ROWGROUPINDEX} , 'ENTRY' as ${QueryColumnNames.TYPE}, '${rowGroupEntry.rowGroup || "NO_GROUP"}' as ${QueryColumnNames.ROWGROUP}, ${groups} ${scenarios.length > 0 ? ",".concat(scenarios) : ""} FROM ${this.fromExpr} ${queryWhereSection} GROUP BY ${groups} ORDER BY ${order[0]})` +
|
|
186
191
|
` t WHERE t.rowNr > ${this.config.limit}`);
|
|
187
192
|
}
|
|
@@ -242,8 +247,17 @@ export class DataQuery {
|
|
|
242
247
|
}
|
|
243
248
|
/** Generates a total SUM row across all groups (only for SUM / OPT table types). */
|
|
244
249
|
createTotalSumRow(querys, sumGroupQueries, scenariosSUMQuery) {
|
|
250
|
+
var _a;
|
|
245
251
|
if (TableType.SUM === this.config.type || TableType.OPT === this.config.type) {
|
|
246
|
-
|
|
252
|
+
// An empty label falls back to the SUM_TOTAL key, which tableDataSetFactory
|
|
253
|
+
// resolves to the IBCS total symbol (❖).
|
|
254
|
+
const label = ((_a = this.config.title) === null || _a === void 0 ? void 0 : _a.trim()) || "SUM_TOTAL";
|
|
255
|
+
// In an ungrouped partof table the total row is what the "in % of ❖" rows
|
|
256
|
+
// refer to, so a custom label gets the symbol prepended. The default label
|
|
257
|
+
// already IS that symbol — prefixing it would yield the literal
|
|
258
|
+
// "❖ SUM_TOTAL", which no longer matches the key and stays untranslated.
|
|
259
|
+
const prefixSymbol = this.hasPartOf && this.config.grouped === false && label !== "SUM_TOTAL";
|
|
260
|
+
const title = prefixSymbol ? `${this.i18n.get("SUM_TOTAL") || "SUM_TOTAL"} ${label}` : label;
|
|
247
261
|
querys.push(`SELECT ${querys.length} as ${QueryColumnNames.ROWGROUPINDEX},
|
|
248
262
|
'${title}' as ${QueryColumnNames.ROWGROUP},
|
|
249
263
|
'=' as ${QueryColumnNames.OPERATION},
|
|
@@ -451,6 +465,273 @@ export class DataQuery {
|
|
|
451
465
|
});
|
|
452
466
|
});
|
|
453
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Adds per-interval-bucket values to the result rows when the bn-table
|
|
470
|
+
* `interval` attribute is active. Side queries aggregate the source rows per
|
|
471
|
+
* bucket (`normalizeDate(date, …)` for date intervals, setname otherwise) at
|
|
472
|
+
* every row level (ENTRY, GROUP_SUM, SUM, DRILLELEMENT, PARTELEMENT) and the
|
|
473
|
+
* results are stored on the existing rows as composite keys
|
|
474
|
+
* `<scenario>##<bucketKey>` — the same convention as the columnthereof drill
|
|
475
|
+
* columns (which are mutually exclusive with interval).
|
|
476
|
+
*
|
|
477
|
+
* Row selection (ORDER BY / LIMIT) stays anchored on the un-bucketed base
|
|
478
|
+
* queries, so every bucket shows the same category set. REST values are
|
|
479
|
+
* computed in JS as the per-bucket sum of the categories that are not
|
|
480
|
+
* displayed, matching the un-bucketed REST query semantics.
|
|
481
|
+
*/
|
|
482
|
+
createIntervalColumns(res) {
|
|
483
|
+
var _a, _b, _c, _d, _e;
|
|
484
|
+
if (this.config.interval === INTERVAL_NONE ||
|
|
485
|
+
this.config.categoryThereOf.size > 0 ||
|
|
486
|
+
this.config.scenarios.length === 0) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const separator = "##";
|
|
490
|
+
const bucketSource = `(SELECT *, ${intervalBucketSQL(this.config.interval)} as __interval FROM ${this.fromExpr}) as p`;
|
|
491
|
+
const scenarios = this.config.scenarios
|
|
492
|
+
.map((s) => this.translateScenarioSQL(s, false, this.config.type))
|
|
493
|
+
.toString();
|
|
494
|
+
const scenariosSUMQuery = this.config.scenarios
|
|
495
|
+
.map((s) => this.translateScenarioSQL(s, true, this.config.type))
|
|
496
|
+
.toString();
|
|
497
|
+
const entryAliases = this.exctractScenarioNames(scenarios);
|
|
498
|
+
const relativeScenarios = this.getRelativeScenarios();
|
|
499
|
+
const groups = new QueryGroups(this.config);
|
|
500
|
+
const isOpt = TableType.OPT === this.config.type || TableType.OPTNOTOTAL === this.config.type;
|
|
501
|
+
const isSumTypeGrouped = this.config.grouped &&
|
|
502
|
+
(TableType.SUM === this.config.type ||
|
|
503
|
+
TableType.SUMNOTOTAL === this.config.type ||
|
|
504
|
+
TableType.OPT === this.config.type ||
|
|
505
|
+
TableType.OPTNOTOTAL === this.config.type);
|
|
506
|
+
const hasPartOfActive = this.checkConfigForPartOf() && this.config.type !== TableType.LIST;
|
|
507
|
+
const exec = (query) => {
|
|
508
|
+
try {
|
|
509
|
+
return this.db.exec(query);
|
|
510
|
+
}
|
|
511
|
+
catch (err) {
|
|
512
|
+
console.error("DataQuery: interval query failed", query, err);
|
|
513
|
+
return [];
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
// mirrors detectNaNCells + calculateRelativeVariances for a single bucket row
|
|
517
|
+
const finalizeBucketRow = (row) => {
|
|
518
|
+
this.config.scenarios.forEach((scenario) => {
|
|
519
|
+
const varianceScenario = new VarianceScenario(scenario);
|
|
520
|
+
if (varianceScenario.isValid === true) {
|
|
521
|
+
if (row[varianceScenario.base + "_cnt"] === 0 || row[varianceScenario.delta + "_cnt"] === 0) {
|
|
522
|
+
row[scenario] = Number.NaN;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
else if (row[scenario + "_cnt"] === 0) {
|
|
526
|
+
row[scenario] = Number.NaN;
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
relativeScenarios.forEach((value, key) => {
|
|
530
|
+
row[key] = row[key] / row[value];
|
|
531
|
+
});
|
|
532
|
+
return row;
|
|
533
|
+
};
|
|
534
|
+
const writeBucketValues = (target, source, bucketKey) => {
|
|
535
|
+
for (const scenario of this.config.scenarios) {
|
|
536
|
+
target[scenario + separator + bucketKey] = source[scenario];
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
const entryRowsRaw = exec(`SELECT ${groups}, __interval ${scenarios.length > 0 ? ",".concat(scenarios) : ""}
|
|
540
|
+
FROM ${bucketSource}
|
|
541
|
+
GROUP BY ${groups}, __interval`);
|
|
542
|
+
// REST rows first: the math needs the raw (not yet finalized) entry aliases
|
|
543
|
+
if (this.config.limit > 0) {
|
|
544
|
+
for (let segmentIndex = 0; segmentIndex < res.length; segmentIndex++) {
|
|
545
|
+
const restRow = res[segmentIndex].find((row) => row.type === "ENTRY" && row.category === "REST");
|
|
546
|
+
if (!restRow) {
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
// nearest preceding segment holding the displayed ENTRY rows
|
|
550
|
+
let entrySegment;
|
|
551
|
+
for (let i = segmentIndex - 1; i >= 0 && !entrySegment; i--) {
|
|
552
|
+
const candidate = res[i].filter((row) => row.type === "ENTRY" && row.category !== "REST");
|
|
553
|
+
if (candidate.length > 0) {
|
|
554
|
+
entrySegment = candidate;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (!entrySegment) {
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
const displayedCategories = new Set(entrySegment.map((row) => row.category));
|
|
561
|
+
const restGroup = entrySegment[0].rowGroup;
|
|
562
|
+
const restByBucket = new Map();
|
|
563
|
+
for (const entryRow of entryRowsRaw) {
|
|
564
|
+
if (this.config.grouped && entryRow.rowGroup !== restGroup) {
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
if (displayedCategories.has(entryRow.category)) {
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
const bucketKey = coerceBucketKey(entryRow.__interval);
|
|
571
|
+
let bucketSum = restByBucket.get(bucketKey);
|
|
572
|
+
if (!bucketSum) {
|
|
573
|
+
bucketSum = {};
|
|
574
|
+
restByBucket.set(bucketKey, bucketSum);
|
|
575
|
+
}
|
|
576
|
+
for (const alias of entryAliases) {
|
|
577
|
+
bucketSum[alias] = ((_a = bucketSum[alias]) !== null && _a !== void 0 ? _a : 0) + ((_b = entryRow[alias]) !== null && _b !== void 0 ? _b : 0);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
restByBucket.forEach((bucketSum, bucketKey) => {
|
|
581
|
+
writeBucketValues(restRow, finalizeBucketRow(bucketSum), bucketKey);
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
for (const entryRow of entryRowsRaw) {
|
|
586
|
+
const bucketKey = coerceBucketKey(entryRow.__interval);
|
|
587
|
+
finalizeBucketRow(entryRow);
|
|
588
|
+
for (const segment of res) {
|
|
589
|
+
for (const row of segment) {
|
|
590
|
+
if (row.type !== "ENTRY" || row.category === "REST" || row.category !== entryRow.category) {
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
if (this.config.grouped && row.rowGroup !== entryRow.rowGroup) {
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
if (isOpt && row.operation !== entryRow.operation) {
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
writeBucketValues(row, entryRow, bucketKey);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
const groupTotalRowsRaw = isSumTypeGrouped || (hasPartOfActive && this.config.grouped)
|
|
604
|
+
? exec(`SELECT ${QueryColumnNames.ROWGROUP}, __interval ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
|
|
605
|
+
FROM ${bucketSource}
|
|
606
|
+
GROUP BY ${QueryColumnNames.ROWGROUP}, __interval`)
|
|
607
|
+
: [];
|
|
608
|
+
const groupTotalsByKey = new Map();
|
|
609
|
+
groupTotalRowsRaw.forEach((row) => groupTotalsByKey.set(`${row.rowGroup}${separator}${coerceBucketKey(row.__interval)}`, row));
|
|
610
|
+
if (isSumTypeGrouped) {
|
|
611
|
+
for (const totalRow of groupTotalRowsRaw) {
|
|
612
|
+
const bucketKey = coerceBucketKey(totalRow.__interval);
|
|
613
|
+
const finalized = finalizeBucketRow(Object.assign({}, totalRow));
|
|
614
|
+
for (const segment of res) {
|
|
615
|
+
for (const row of segment) {
|
|
616
|
+
if (row.type === "GROUP_SUM" && row.rowGroup === totalRow.rowGroup) {
|
|
617
|
+
writeBucketValues(row, finalized, bucketKey);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
const hasTotalSumRow = TableType.SUM === this.config.type || TableType.OPT === this.config.type;
|
|
624
|
+
const sumTotalRowsRaw = hasTotalSumRow || (hasPartOfActive && !this.config.grouped)
|
|
625
|
+
? exec(`SELECT __interval ${scenariosSUMQuery.length > 0 ? ",".concat(scenariosSUMQuery) : ""}
|
|
626
|
+
FROM ${bucketSource}
|
|
627
|
+
GROUP BY __interval`)
|
|
628
|
+
: [];
|
|
629
|
+
const sumTotalsByBucket = new Map();
|
|
630
|
+
sumTotalRowsRaw.forEach((row) => sumTotalsByBucket.set(coerceBucketKey(row.__interval), row));
|
|
631
|
+
if (hasTotalSumRow) {
|
|
632
|
+
for (const totalRow of sumTotalRowsRaw) {
|
|
633
|
+
const bucketKey = coerceBucketKey(totalRow.__interval);
|
|
634
|
+
const finalized = finalizeBucketRow(Object.assign({}, totalRow));
|
|
635
|
+
for (const segment of res) {
|
|
636
|
+
for (const row of segment) {
|
|
637
|
+
if (row.type === "SUM") {
|
|
638
|
+
writeBucketValues(row, finalized, bucketKey);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
if (this.config.thereOf != null && this.config.thereOf.length > 0) {
|
|
645
|
+
const drillRows = [];
|
|
646
|
+
this.config.thereOf.forEach((element) => {
|
|
647
|
+
drillRows.push(...exec(`SELECT ${QueryColumnNames.ROWGROUP}, ${QueryColumnNames.CATEGORY}, ${QueryColumnNames.SUBCATEGORY}, __interval ${scenarios.length > 0 ? ",".concat(scenarios) : ""}
|
|
648
|
+
FROM ${bucketSource}
|
|
649
|
+
WHERE ${this.createThereOfWhereClause(element)}
|
|
650
|
+
GROUP BY ${QueryColumnNames.ROWGROUP}, ${QueryColumnNames.CATEGORY}, ${QueryColumnNames.SUBCATEGORY}, __interval`));
|
|
651
|
+
});
|
|
652
|
+
for (const drillRow of drillRows) {
|
|
653
|
+
const bucketKey = coerceBucketKey(drillRow.__interval);
|
|
654
|
+
finalizeBucketRow(drillRow);
|
|
655
|
+
for (const segment of res) {
|
|
656
|
+
for (const row of segment) {
|
|
657
|
+
if (row.type !== "DRILLELEMENT" || row.category !== drillRow.category) {
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
if (row.subCategory !== drillRow.subCategory &&
|
|
661
|
+
row.subCategory !== `${drillRow.subCategory} (${drillRow.rowGroup})`) {
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
writeBucketValues(row, drillRow, bucketKey);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
if (hasPartOfActive) {
|
|
670
|
+
let partWhere = "1 <> 1 ";
|
|
671
|
+
(_c = this.config.partOf) === null || _c === void 0 ? void 0 : _c.forEach((element) => {
|
|
672
|
+
partWhere += `OR (${QueryColumnNames.CATEGORY} = '${element.category}'`;
|
|
673
|
+
if (!(null == element.rowGroup || 0 === element.rowGroup.length || !element.rowGroup.trim())) {
|
|
674
|
+
partWhere += `and ${QueryColumnNames.ROWGROUP} = '${element.rowGroup}'`;
|
|
675
|
+
}
|
|
676
|
+
partWhere += `)`;
|
|
677
|
+
});
|
|
678
|
+
const groupName = this.config.grouped
|
|
679
|
+
? `${QueryColumnNames.ROWGROUP}`
|
|
680
|
+
: `'SUM_TOTAL' as ${QueryColumnNames.ROWGROUP}`;
|
|
681
|
+
const partRowsRaw = exec(`SELECT ${QueryColumnNames.CATEGORY}, ${groupName}, __interval ${scenarios.length > 0 ? ",".concat(scenarios) : ""}
|
|
682
|
+
FROM ${bucketSource}
|
|
683
|
+
WHERE ${partWhere}
|
|
684
|
+
GROUP BY ${QueryColumnNames.ROWGROUP}, ${QueryColumnNames.CATEGORY}, __interval`);
|
|
685
|
+
// merge rows sharing (rowGroup, category, bucket) — mirrors reduceResDrillByCategoryGroups
|
|
686
|
+
const partByKey = new Map();
|
|
687
|
+
for (const partRow of partRowsRaw) {
|
|
688
|
+
const key = `${partRow.rowGroup}${separator}${partRow.category}${separator}${coerceBucketKey(partRow.__interval)}`;
|
|
689
|
+
const existing = partByKey.get(key);
|
|
690
|
+
if (existing) {
|
|
691
|
+
for (const alias of entryAliases) {
|
|
692
|
+
existing[alias] = ((_d = existing[alias]) !== null && _d !== void 0 ? _d : 0) + ((_e = partRow[alias]) !== null && _e !== void 0 ? _e : 0);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
partByKey.set(key, partRow);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
partByKey.forEach((partRow) => {
|
|
700
|
+
const bucketKey = coerceBucketKey(partRow.__interval);
|
|
701
|
+
const totals = this.config.grouped
|
|
702
|
+
? groupTotalsByKey.get(`${partRow.rowGroup}${separator}${bucketKey}`)
|
|
703
|
+
: sumTotalsByBucket.get(bucketKey);
|
|
704
|
+
for (const alias of entryAliases) {
|
|
705
|
+
partRow[alias] = partRow[alias] / (totals ? totals[alias] : Number.NaN);
|
|
706
|
+
}
|
|
707
|
+
finalizeBucketRow(partRow);
|
|
708
|
+
for (const segment of res) {
|
|
709
|
+
for (const row of segment) {
|
|
710
|
+
if (row.type === "PARTELEMENT" && row.category === partRow.category && row.rowGroup === partRow.rowGroup) {
|
|
711
|
+
writeBucketValues(row, partRow, bucketKey);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
/** Builds the thereof filter for interval side queries (mirrors the WHERE construction in createThereOfDrillRows). */
|
|
719
|
+
createThereOfWhereClause(element) {
|
|
720
|
+
let isFirst = true;
|
|
721
|
+
let whereClause = "1 <> 1 OR ( ";
|
|
722
|
+
if (!(null == element.category || 0 === element.category.length || !element.category.trim())) {
|
|
723
|
+
whereClause += ` ${QueryColumnNames.CATEGORY} = '${element.category}'`;
|
|
724
|
+
isFirst = false;
|
|
725
|
+
}
|
|
726
|
+
if (!(null == element.rowGroup || 0 === element.rowGroup.length || !element.rowGroup.trim())) {
|
|
727
|
+
whereClause += ` ${isFirst ? "" : "AND"} ${QueryColumnNames.ROWGROUP} = '${element.rowGroup}'`;
|
|
728
|
+
isFirst = false;
|
|
729
|
+
}
|
|
730
|
+
if (!(null == element.subCategory || 0 === element.subCategory.length || !element.subCategory.trim())) {
|
|
731
|
+
whereClause += ` ${isFirst ? "" : "AND"} ${QueryColumnNames.SUBCATEGORY} = '${element.subCategory}'`;
|
|
732
|
+
}
|
|
733
|
+
return whereClause + `)`;
|
|
734
|
+
}
|
|
454
735
|
/** Collects all relative variance scenarios and maps each to its denominator column name. */
|
|
455
736
|
getRelativeScenarios() {
|
|
456
737
|
const relativeScenarios = new Map();
|