@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.20
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/LICENSE +203 -21
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-28d5c266.entry.js +1 -0
- package/dist/bn-template-engine/p-2d3ea756.entry.js +1 -0
- package/dist/bn-template-engine/p-2fba7c99.entry.js +1 -0
- package/dist/bn-template-engine/p-6077155f.entry.js +1 -0
- package/dist/bn-template-engine/p-687032d5.entry.js +1 -0
- package/dist/bn-template-engine/p-6c7f0076.entry.js +1 -0
- package/dist/bn-template-engine/p-6lOdN-fB.js +1 -0
- package/dist/bn-template-engine/p-7e9dbc93.entry.js +1 -0
- package/dist/bn-template-engine/p-99477a27.entry.js +1 -0
- package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
- package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
- package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
- package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
- package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
- package/dist/bn-template-engine/p-C5uvAEKI.js +1 -0
- package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
- package/dist/bn-template-engine/p-C9i1Xsib.js +1 -0
- package/dist/bn-template-engine/p-CJThzFZm.js +1 -0
- package/dist/bn-template-engine/p-CYE0I1Mx.js +1 -0
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-DwYUTvvI.js +1 -0
- package/dist/bn-template-engine/p-a1380d7c.entry.js +1 -0
- package/dist/bn-template-engine/p-a4ea9a79.entry.js +1 -0
- package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
- package/dist/bn-template-engine/p-b9e94127.entry.js +1 -0
- package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
- package/dist/bn-template-engine/p-de29986f.entry.js +1 -0
- package/dist/bn-template-engine/p-eEfqksk-.js +1 -0
- package/dist/bn-template-engine/p-fFtEvsY-.js +1 -0
- package/dist/cjs/AxisConfig-D7CAyPLO.js +233 -0
- package/dist/cjs/LabelCollisionManager-DkdQ9Xdg.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-IPfAP0q8.js +87 -0
- package/dist/cjs/SVGStyle-BD8jApd4.js +8209 -0
- package/dist/cjs/SVGVariancesStyleGroup-BaWzR951.js +50 -0
- package/dist/cjs/VarianceMeasure-BBWTgv2e.js +372 -0
- package/dist/cjs/XYChartDataRow-BoR0CTfl.js +829 -0
- package/dist/cjs/bn-asset_21.cjs.entry.js +16105 -0
- 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 +10 -8
- 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-BBhT9B52.js +9505 -0
- package/dist/cjs/editor-companion.cjs.entry.js +13 -6
- 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-DUYYkDMQ.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-BIJQ2NV1.js +589 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-D5clRvRe.js +73 -0
- package/dist/cjs/withStyled-Cm9dWQhu.js +1168 -0
- package/dist/collection/collection-manifest.json +9 -1
- package/dist/collection/components/bn-body/bn-body.css +1 -0
- package/dist/collection/components/bn-card/bn-card.css +2 -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 +126 -43
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +104 -37
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +101 -60
- package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +161 -44
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +97 -32
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +151 -75
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +10 -4
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +20 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
- package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +20 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
- 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.css +3 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
- package/dist/collection/components/bn-table/bn-table.js +318 -62
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +162 -33
- package/dist/collection/components/bn-table/utils/Table.js +72 -29
- 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 +120 -23
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
- 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/TableAttribute.js +46 -0
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
- 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 +31 -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 +52 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +7 -4
- package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
- package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
- package/dist/collection/components/bn-tree/bn-tree.js +19 -0
- package/dist/collection/components/editor-companion/editor-companion.js +12 -5
- package/dist/collection/context/scopedDb.js +127 -0
- package/dist/collection/stores/componentStyles.js +67 -0
- package/dist/collection/stores/createScopedStores.js +11 -5
- package/dist/collection/stores/internationalization.js +77 -3
- package/dist/collection/stores/ruleSets.js +46 -0
- package/dist/collection/utils/DateStringFactory.js +31 -0
- package/dist/collection/utils/constants.js +5 -0
- package/dist/collection/utils/dataAnalyzer.js +14 -8
- package/dist/collection/utils/ibcsRuleSet.js +14 -26
- package/dist/collection/utils/layoutObserver.js +88 -0
- package/dist/collection/utils/parentDimensions.js +71 -15
- package/dist/collection/utils/sanitizeHtml.js +81 -0
- package/dist/collection/utils/validate.js +47 -0
- package/dist/collection/utils/withBodyObserver.js +12 -7
- package/dist/collection/utils/withComponentStyle.js +3 -5
- package/dist/collection/utils/withDataset.js +43 -39
- package/dist/collection/utils/withDatasource.js +28 -18
- package/dist/collection/utils/withInheritedProps.js +26 -1
- package/dist/collection/utils/withRuleSet.js +105 -0
- package/dist/collection/utils/withScalingGroup.js +69 -0
- package/dist/collection/utils/withTranslation.js +53 -15
- 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/DateStringFactory.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-body2.js +1 -1
- package/dist/components/bn-card2.js +1 -1
- 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.d.ts +11 -0
- package/dist/components/bn-scaling-group.js +1 -0
- 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 -0
- package/dist/components/luxon.js +1 -0
- 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/withBodyObserver.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/components/withTranslation.js +1 -1
- package/dist/esm/AxisConfig-ByIP5J-9.js +224 -0
- package/dist/esm/LabelCollisionManager-DaNiDiM9.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BQeJE_yi.js +83 -0
- package/dist/esm/SVGStyle-BwBlY3Km.js +8199 -0
- package/dist/esm/SVGVariancesStyleGroup-BpGW4CvN.js +48 -0
- package/dist/esm/VarianceMeasure-CE3N8Bea.js +364 -0
- package/dist/esm/XYChartDataRow-DeMI1JKU.js +820 -0
- package/dist/esm/bn-asset_21.entry.js +16083 -0
- 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 +10 -8
- 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-d8MHrEo8.js +9490 -0
- package/dist/esm/editor-companion.entry.js +13 -6
- 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-BJBEyhNf.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-BGnpSN1j.js +581 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-CC3UcvC5.js +71 -0
- package/dist/esm/withStyled-2l5Tx3cf.js +1135 -0
- 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 +19 -5
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +21 -12
- package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
- package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +21 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +7 -3
- package/dist/types/components/bn-context/bn-context.d.ts +8 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
- package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +39 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +36 -1
- 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-scaling-group/bn-scaling-group.d.ts +37 -0
- package/dist/types/components/bn-table/bn-table.d.ts +74 -12
- package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
- package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
- 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 +17 -9
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
- 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/TableAttribute.d.ts +22 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
- package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
- package/dist/types/components/bn-title/bn-title.d.ts +12 -1
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +4 -0
- package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
- package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
- package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
- package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1725 -116
- package/dist/types/context/context-protocol.d.ts +7 -3
- package/dist/types/context/scopedDb.d.ts +37 -0
- package/dist/types/stores/componentStyles.d.ts +41 -0
- package/dist/types/stores/createScopedStores.d.ts +4 -2
- package/dist/types/stores/ruleSets.d.ts +40 -0
- package/dist/types/utils/DateStringFactory.d.ts +20 -1
- package/dist/types/utils/constants.d.ts +5 -0
- package/dist/types/utils/dataAnalyzer.d.ts +2 -1
- package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
- package/dist/types/utils/layoutObserver.d.ts +27 -0
- package/dist/types/utils/model/ChartStyles.d.ts +2 -1
- package/dist/types/utils/parentDimensions.d.ts +1 -1
- package/dist/types/utils/sanitizeHtml.d.ts +6 -0
- package/dist/types/utils/validate.d.ts +18 -0
- package/dist/types/utils/withDataset.d.ts +6 -2
- package/dist/types/utils/withDatasource.d.ts +3 -3
- package/dist/types/utils/withInheritedProps.d.ts +19 -0
- package/dist/types/utils/withRuleSet.d.ts +24 -0
- package/dist/types/utils/withScalingGroup.d.ts +14 -0
- package/dist/types/utils/withTranslation.d.ts +15 -5
- 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 +5 -4
- package/readme.md +9 -5
- package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
- package/dist/bn-template-engine/p-67538176.entry.js +0 -1
- package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
- package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
- package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
- package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
- package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
- package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
- package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
- package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
- package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
- package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
- package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
- package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
- package/dist/cjs/scaling-CIAClQR5.js +0 -314
- package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
- package/dist/collection/stores/datasets.js +0 -14
- package/dist/collection/stores/datasources.js +0 -14
- package/dist/components/_commonjsHelpers.js +0 -1
- package/dist/components/alasql.min.js +0 -1
- package/dist/components/ibcsRuleSet.js +0 -1
- package/dist/components/scaling.js +0 -1
- package/dist/components/withInheritedProps.js +0 -1
- package/dist/esm/bn-asset_20.entry.js +0 -23526
- package/dist/esm/context-protocol-DdbSplvE.js +0 -656
- package/dist/esm/scaling-DGKKkuL9.js +0 -309
- package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
- package/dist/types/stores/datasets.d.ts +0 -14
- package/dist/types/stores/datasources.d.ts +0 -14
|
@@ -4,12 +4,12 @@ import { DataPoint, Scenario } from "./model";
|
|
|
4
4
|
import { AreaFill, Axis, HookLocation, Label, StackedColumn, } from "./elements";
|
|
5
5
|
import { ScenarioFactory } from "./factories";
|
|
6
6
|
import { LabelCollisionManager, SCENARIO_PRIORITY } from "./helper";
|
|
7
|
-
import alasql from "alasql";
|
|
8
7
|
import CalculateSize from "calculate-size";
|
|
9
8
|
import { ScaleFactorsTimeChart } from "./model/styles/ScaleFactorsTimeChart";
|
|
10
9
|
import { DateTime } from "luxon";
|
|
10
|
+
import { buildFromExpr } from "../../../context/scopedDb";
|
|
11
11
|
import { DateDistance, DateStringFactory } from "../../../utils/DateStringFactory";
|
|
12
|
-
import { AxisLabelsMode, ChartMode, StackBy, StackMode } from "../../../utils/constants";
|
|
12
|
+
import { AxisLabelsMode, ChartMode, RELATIVE_STACK_UNITS, StackBy, StackMode, } from "../../../utils/constants";
|
|
13
13
|
import { getScenarioPrefix, IBCS_LAYER_ORDER } from "../../../utils/stackColors";
|
|
14
14
|
import { Formatter } from "../../../utils";
|
|
15
15
|
import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
|
|
@@ -50,11 +50,14 @@ var VarianceType;
|
|
|
50
50
|
* Auto chart mode: when dataModel.length exceeds maxBars, switches from bar to line.
|
|
51
51
|
*/
|
|
52
52
|
export class TimeChart {
|
|
53
|
-
constructor(ruleSet, config, styles, availableWidth = 0) {
|
|
53
|
+
constructor(ruleSet, db, tableName, config, styles, availableWidth = 0) {
|
|
54
54
|
this.CSS_CATEGORIES = "categories";
|
|
55
55
|
this.dataModel = [];
|
|
56
56
|
this.variancesDataModel = [];
|
|
57
57
|
this.title = "";
|
|
58
|
+
/** Raw config inputs the title derives from; kept so setI18n can recompute it. */
|
|
59
|
+
this.configTitle = "";
|
|
60
|
+
this.configVariances = [];
|
|
58
61
|
this.smallestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
|
|
59
62
|
this.highestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
|
|
60
63
|
this.smallestVarianceDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
|
|
@@ -63,7 +66,8 @@ export class TimeChart {
|
|
|
63
66
|
this.pixelPerPercentage = 1;
|
|
64
67
|
this.hideAxisLabels = false;
|
|
65
68
|
this.axisScenario = Scenario.AC1;
|
|
66
|
-
this.
|
|
69
|
+
this.fromExpr = "";
|
|
70
|
+
this.rowCount = 0;
|
|
67
71
|
this.axisCategoryArea = { width: 0, height: 0 };
|
|
68
72
|
this.scenariosArea = { width: 0, height: 0 };
|
|
69
73
|
this.state = FactoryState.DIRTY;
|
|
@@ -81,36 +85,29 @@ export class TimeChart {
|
|
|
81
85
|
this.chartMode = ChartMode.BAR;
|
|
82
86
|
this.maxBars = 28;
|
|
83
87
|
this.stackConfig = null;
|
|
88
|
+
this.scenarioPropOrder = [];
|
|
84
89
|
this.lineFullWidth = true;
|
|
85
90
|
this.availableWidth = 0;
|
|
86
91
|
this.overflowConfig = null;
|
|
87
92
|
this.lastScenarios = [];
|
|
88
|
-
this.
|
|
93
|
+
this.db = db;
|
|
94
|
+
this.tableName = tableName;
|
|
89
95
|
this.ruleSet = ruleSet || new IBCSRuleSet();
|
|
90
96
|
this.i18n = this.createI18n(new Map());
|
|
91
97
|
this.styles = styles;
|
|
92
98
|
this.availableWidth = availableWidth;
|
|
93
99
|
this.setConfig(config);
|
|
94
|
-
this.position = this.createElementPosition(
|
|
100
|
+
this.position = this.createElementPosition(this.lastScenarios);
|
|
95
101
|
}
|
|
96
102
|
updatePosition(scenarios) {
|
|
97
103
|
this.position = this.createElementPosition(scenarios);
|
|
98
104
|
}
|
|
99
|
-
initSQLFunctions() {
|
|
100
|
-
alasql.fn.transformOperator = function (a) {
|
|
101
|
-
return a === "-" ? -1 : 1;
|
|
102
|
-
};
|
|
103
|
-
// @ts-ignore
|
|
104
|
-
alasql.fn.normalizeDate = function (date, normalizationLevel, _locale) {
|
|
105
|
-
if (date === undefined || !date.isValid) {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
return date.startOf(normalizationLevel);
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
105
|
setStyles(newStyle) {
|
|
112
106
|
this.styles = newStyle;
|
|
113
107
|
}
|
|
108
|
+
setRuleSet(ruleSet) {
|
|
109
|
+
this.ruleSet = ruleSet || new IBCSRuleSet();
|
|
110
|
+
}
|
|
114
111
|
setAvailableWidth(w) {
|
|
115
112
|
this.availableWidth = w;
|
|
116
113
|
}
|
|
@@ -173,17 +170,23 @@ export class TimeChart {
|
|
|
173
170
|
setConfig(config) {
|
|
174
171
|
var _a;
|
|
175
172
|
this.state = FactoryState.DIRTY;
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
// Must precede setSource/populateModel: the locale is baked into the
|
|
174
|
+
// normalizeDate() SQL as well as into the axis date labels.
|
|
175
|
+
this.locale = config.locale;
|
|
176
|
+
this.scenarioPropOrder = [...config.scenarios];
|
|
177
|
+
const scenarios = this.sortScenariosbyVisualisationRules(config.scenarios);
|
|
178
|
+
this.setSource(config.filter);
|
|
178
179
|
this.hideAxisLabels = config.hideAxisLabels || false;
|
|
179
180
|
this.pixelPerUnit = config.pixelPerUnit;
|
|
180
181
|
this.pixelPerPercentage = config.pixelPerPercentage;
|
|
181
182
|
this.axisLabelsMode = config.axisLabelsMode;
|
|
182
183
|
this.intervalSpanLimit = config.intervalSpanLimit;
|
|
183
184
|
this.dateInterval = this.findDateInterval(config.dateInterval);
|
|
184
|
-
this.dataModel = this.populateModel(
|
|
185
|
+
this.dataModel = this.populateModel(scenarios, this.dateInterval, config.level, config.sortOrder);
|
|
185
186
|
this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
|
|
186
|
-
this.
|
|
187
|
+
this.configTitle = config.title;
|
|
188
|
+
this.configVariances = (_a = config === null || config === void 0 ? void 0 : config.variances) !== null && _a !== void 0 ? _a : [];
|
|
189
|
+
this.updateTitle();
|
|
187
190
|
this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
|
|
188
191
|
this.smallestVarianceDataPointValue = this.findSmallestDataPointValue(this.variancesDataModel);
|
|
189
192
|
this.highestDataPointValue = this.findHighestDataPointValue(this.dataModel);
|
|
@@ -199,8 +202,8 @@ export class TimeChart {
|
|
|
199
202
|
this.maxBars = config.maxBars;
|
|
200
203
|
this.stackConfig = config.stackConfig;
|
|
201
204
|
this.lineFullWidth = config.lineFullWidth;
|
|
202
|
-
this.lastScenarios =
|
|
203
|
-
this.updatePosition(
|
|
205
|
+
this.lastScenarios = scenarios;
|
|
206
|
+
this.updatePosition(scenarios);
|
|
204
207
|
}
|
|
205
208
|
getFooter() {
|
|
206
209
|
if (this.measureScale.value === 1 && this.measureUnit === "") {
|
|
@@ -208,9 +211,10 @@ export class TimeChart {
|
|
|
208
211
|
}
|
|
209
212
|
return Formatter.translateScenarioLabel("in", this.i18n) + " " + this.measureScale.prefix + this.measureUnit;
|
|
210
213
|
}
|
|
211
|
-
|
|
214
|
+
/** Returns a new array; the input keeps the `scenarios` prop order (the config is reused across rebuilds). */
|
|
215
|
+
sortScenariosbyVisualisationRules(scenarios) {
|
|
212
216
|
const self = this;
|
|
213
|
-
|
|
217
|
+
return [...scenarios]
|
|
214
218
|
.sort((n1, n2) => {
|
|
215
219
|
return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
|
|
216
220
|
})
|
|
@@ -231,33 +235,36 @@ export class TimeChart {
|
|
|
231
235
|
*/
|
|
232
236
|
setI18n(i18n) {
|
|
233
237
|
this.i18n = this.createI18n(i18n);
|
|
238
|
+
// The variance title bakes translated scenario labels in, and setI18n
|
|
239
|
+
// arrives after the constructor's setConfig — recompute it here so the
|
|
240
|
+
// first render doesn't keep the built-in labels (e.g. ΔPY vs ΔVorjahr).
|
|
241
|
+
this.updateTitle();
|
|
242
|
+
}
|
|
243
|
+
/** Derives the variance title from the stored config and the current i18n map. */
|
|
244
|
+
updateTitle() {
|
|
245
|
+
var _a;
|
|
246
|
+
this.title = this.configTitle || Formatter.translateScenarioLabel((_a = this.configVariances) === null || _a === void 0 ? void 0 : _a.toString(), this.i18n);
|
|
234
247
|
}
|
|
235
248
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* @param data
|
|
241
|
-
* @param filter - data filter
|
|
242
|
-
* @param customColumnNameMap Custon ColumnNameMap can be used if data uses non standard columnames
|
|
249
|
+
* Resolves the dataset (a table or view in the shared alasql database) and
|
|
250
|
+
* caches its row count. Subsequent queries reference the source by name —
|
|
251
|
+
* alasql doesn't have to ingest a fresh array per call.
|
|
243
252
|
*/
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
setSource(filter) {
|
|
254
|
+
var _a, _b;
|
|
255
|
+
this.state = FactoryState.DIRTY;
|
|
256
|
+
if (!this.tableName) {
|
|
257
|
+
this.fromExpr = "";
|
|
258
|
+
this.rowCount = 0;
|
|
246
259
|
return;
|
|
247
260
|
}
|
|
248
|
-
this.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
this.preparedDataSet = alasql(`SELECT * FROM ? WHERE ${filter}`, [data]);
|
|
253
|
-
}
|
|
254
|
-
catch (e) {
|
|
255
|
-
console.error("TimeChart: filter query failed, using unfiltered data", filter, e);
|
|
256
|
-
this.preparedDataSet = data;
|
|
257
|
-
}
|
|
261
|
+
this.fromExpr = buildFromExpr(this.tableName, filter);
|
|
262
|
+
try {
|
|
263
|
+
const r = this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);
|
|
264
|
+
this.rowCount = ((_b = (_a = r[0]) === null || _a === void 0 ? void 0 : _a.cnt) !== null && _b !== void 0 ? _b : 0);
|
|
258
265
|
}
|
|
259
|
-
|
|
260
|
-
this.
|
|
266
|
+
catch (_e) {
|
|
267
|
+
this.rowCount = 0;
|
|
261
268
|
}
|
|
262
269
|
}
|
|
263
270
|
getAllocatedCanvasWidth() {
|
|
@@ -414,6 +421,7 @@ export class TimeChart {
|
|
|
414
421
|
return new Map([...defaultI18n, ...i18n]);
|
|
415
422
|
}
|
|
416
423
|
createElementPosition(scenarios) {
|
|
424
|
+
var _a;
|
|
417
425
|
let maxLabelLengthLeft;
|
|
418
426
|
// only need scenarios written on the leftside of bar/ marker
|
|
419
427
|
const scenarioLabelLeft = CalculateSize(scenarios
|
|
@@ -449,6 +457,12 @@ export class TimeChart {
|
|
|
449
457
|
min = this.smallestDataPointValue;
|
|
450
458
|
max = this.highestDataPointValue;
|
|
451
459
|
}
|
|
460
|
+
// In relative (100%) stacking the vertical domain is 0..RELATIVE_STACK_UNITS percent,
|
|
461
|
+
// not the raw data values — use a virtual max so axis position, canvas height and
|
|
462
|
+
// auto-fit all agree on the percent domain.
|
|
463
|
+
if (((_a = this.stackConfig) === null || _a === void 0 ? void 0 : _a.mode) === StackMode.RELATIVE) {
|
|
464
|
+
max = new DataPoint(RELATIVE_STACK_UNITS, max.scenario, this.pixelPerUnit, max.variance);
|
|
465
|
+
}
|
|
452
466
|
// When overflow config is active, create a virtual max so the coordinate system
|
|
453
467
|
// allocates exactly cutHeight + breakGap + overdriveZoneHeight instead of the
|
|
454
468
|
// full (clipped) bar height.
|
|
@@ -516,8 +530,7 @@ export class TimeChart {
|
|
|
516
530
|
return result;
|
|
517
531
|
}
|
|
518
532
|
populateModel(selectedScenarios, dateInterval, _level, _sortOrder) {
|
|
519
|
-
|
|
520
|
-
if (((_a = this.preparedDataSet) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
533
|
+
if (this.rowCount === 0 || !this.fromExpr) {
|
|
521
534
|
return [];
|
|
522
535
|
}
|
|
523
536
|
const select = ``;
|
|
@@ -559,17 +572,41 @@ export class TimeChart {
|
|
|
559
572
|
return localDateInterval;
|
|
560
573
|
}
|
|
561
574
|
queryMinMaxDates() {
|
|
562
|
-
var _a, _b
|
|
563
|
-
|
|
564
|
-
|
|
575
|
+
var _a, _b;
|
|
576
|
+
let result;
|
|
577
|
+
try {
|
|
578
|
+
result = this.db.exec(`SELECT MAX(${"date"}) as maxdate, MIN(${"date"}) as mindate FROM ${this.fromExpr}`);
|
|
579
|
+
}
|
|
580
|
+
catch (e) {
|
|
581
|
+
console.error("TimeChart: min/max date query failed", e);
|
|
582
|
+
return [{}];
|
|
583
|
+
}
|
|
584
|
+
// `date` rows in the shared db are typically ISO strings (raw JSON) or millis;
|
|
585
|
+
// accept both so existing fixtures and live JSON data both work.
|
|
565
586
|
if (((_a = result[0]) === null || _a === void 0 ? void 0 : _a.mindate) != null) {
|
|
566
|
-
result[0].mindate =
|
|
587
|
+
result[0].mindate = TimeChart.coerceDateTime(result[0].mindate);
|
|
567
588
|
}
|
|
568
|
-
if (((
|
|
569
|
-
result[0].maxdate =
|
|
589
|
+
if (((_b = result[0]) === null || _b === void 0 ? void 0 : _b.maxdate) != null) {
|
|
590
|
+
result[0].maxdate = TimeChart.coerceDateTime(result[0].maxdate);
|
|
570
591
|
}
|
|
571
592
|
return result;
|
|
572
593
|
}
|
|
594
|
+
static coerceDateTime(v) {
|
|
595
|
+
if (v == null)
|
|
596
|
+
return undefined;
|
|
597
|
+
if (typeof v === "string") {
|
|
598
|
+
const dt = DateTime.fromISO(v);
|
|
599
|
+
return dt.isValid ? dt : undefined;
|
|
600
|
+
}
|
|
601
|
+
if (typeof v === "number") {
|
|
602
|
+
const dt = DateTime.fromMillis(v);
|
|
603
|
+
return dt.isValid ? dt : undefined;
|
|
604
|
+
}
|
|
605
|
+
if (typeof v.isValid === "boolean") {
|
|
606
|
+
return v;
|
|
607
|
+
}
|
|
608
|
+
return undefined;
|
|
609
|
+
}
|
|
573
610
|
queryDataSet(dateInterval, select, order) {
|
|
574
611
|
const scenarios = [
|
|
575
612
|
"ac1",
|
|
@@ -590,13 +627,15 @@ export class TimeChart {
|
|
|
590
627
|
"pl4",
|
|
591
628
|
];
|
|
592
629
|
const dateSelect = `normalizeDate([date], '${dateInterval}' , '${this.locale}') as calcdate`;
|
|
593
|
-
|
|
630
|
+
let result;
|
|
631
|
+
try {
|
|
632
|
+
result = this.db.exec(`SELECT ${"p.calcdate"} ${select},
|
|
594
633
|
${scenarios
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
634
|
+
.map((scenario) => {
|
|
635
|
+
return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
|
|
636
|
+
})
|
|
637
|
+
.join(",")}
|
|
638
|
+
|
|
600
639
|
FROM (SELECT ${dateSelect} ${select},
|
|
601
640
|
ac1,
|
|
602
641
|
ac2,
|
|
@@ -614,9 +653,14 @@ export class TimeChart {
|
|
|
614
653
|
pl2,
|
|
615
654
|
pl3,
|
|
616
655
|
pl4
|
|
617
|
-
FROM
|
|
656
|
+
FROM ${this.fromExpr}) as p
|
|
618
657
|
GROUP BY ${"calcdate"} ${order}
|
|
619
|
-
ORDER BY ${"calcdate asc"}
|
|
658
|
+
ORDER BY ${"calcdate asc"}`);
|
|
659
|
+
}
|
|
660
|
+
catch (e) {
|
|
661
|
+
console.error("TimeChart: queryDataSet failed", e);
|
|
662
|
+
return [];
|
|
663
|
+
}
|
|
620
664
|
return result;
|
|
621
665
|
}
|
|
622
666
|
createDataRows(result, selectedScenarios) {
|
|
@@ -735,6 +779,7 @@ export class TimeChart {
|
|
|
735
779
|
}
|
|
736
780
|
createDateFactory() {
|
|
737
781
|
const factory = new DateStringFactory();
|
|
782
|
+
factory.setLocale(this.locale);
|
|
738
783
|
return factory;
|
|
739
784
|
}
|
|
740
785
|
drawAxisAndLabels(dataModel, svgContainer) {
|
|
@@ -990,6 +1035,17 @@ export class TimeChart {
|
|
|
990
1035
|
};
|
|
991
1036
|
return columnGroup;
|
|
992
1037
|
}
|
|
1038
|
+
/** Restore the original `scenarios` prop order for stacked segments (IBCS sort reorders the slots). */
|
|
1039
|
+
sortSegmentsByPropOrder(segments) {
|
|
1040
|
+
if (this.scenarioPropOrder.length === 0)
|
|
1041
|
+
return;
|
|
1042
|
+
const order = this.scenarioPropOrder;
|
|
1043
|
+
segments.sort((a, b) => {
|
|
1044
|
+
const ia = order.indexOf(a.scenario);
|
|
1045
|
+
const ib = order.indexOf(b.scenario);
|
|
1046
|
+
return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
993
1049
|
/**
|
|
994
1050
|
* Draw stacked bar columns. Supports stacking by scenario or by data dimension.
|
|
995
1051
|
* When stacking by scenario with multiple scenario types (e.g. ac+pl),
|
|
@@ -1011,6 +1067,7 @@ export class TimeChart {
|
|
|
1011
1067
|
segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
|
|
1012
1068
|
}
|
|
1013
1069
|
}
|
|
1070
|
+
this.sortSegmentsByPropOrder(segments);
|
|
1014
1071
|
}
|
|
1015
1072
|
else {
|
|
1016
1073
|
const dp = elements["scenario1"];
|
|
@@ -1110,12 +1167,14 @@ export class TimeChart {
|
|
|
1110
1167
|
}
|
|
1111
1168
|
if (segments.length === 0)
|
|
1112
1169
|
return;
|
|
1170
|
+
this.sortSegmentsByPropOrder(segments);
|
|
1113
1171
|
const prefixes = new Set(segments.map((s) => getScenarioPrefix(s.scenario)));
|
|
1114
1172
|
const axisY = this.position.getColumnPositionY();
|
|
1115
1173
|
const xBase = this.position.getColumnCenterPositionX(0) - this.position.getColumnWidth() / 2;
|
|
1116
1174
|
const labelX = xBase - this.position.spacings.labelToColumn;
|
|
1117
1175
|
if (prefixes.size > 1) {
|
|
1118
|
-
// Overlay mode: one header per group
|
|
1176
|
+
// Overlay mode: one header per group — front group centered on its bar,
|
|
1177
|
+
// back groups aligned with their bar's top edge
|
|
1119
1178
|
const groupMap = new Map();
|
|
1120
1179
|
for (const seg of segments) {
|
|
1121
1180
|
const prefix = getScenarioPrefix(seg.scenario);
|
|
@@ -1133,11 +1192,17 @@ export class TimeChart {
|
|
|
1133
1192
|
for (const [prefix, segs] of groupMap) {
|
|
1134
1193
|
groups.push({ prefix, segments: segs });
|
|
1135
1194
|
}
|
|
1136
|
-
groups.forEach((group) => {
|
|
1195
|
+
groups.forEach((group, groupIdx) => {
|
|
1137
1196
|
const groupTotal = group.segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
|
|
1138
1197
|
const pixelPerUnit = group.segments[0].dataPoint.pixelPerUnit;
|
|
1139
|
-
const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE
|
|
1140
|
-
|
|
1198
|
+
const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE
|
|
1199
|
+
? RELATIVE_STACK_UNITS * pixelPerUnit
|
|
1200
|
+
: groupTotal * pixelPerUnit;
|
|
1201
|
+
// The front-most group (drawn last, e.g. AC) is fully visible, so its
|
|
1202
|
+
// label is centered on the bar. Back groups are mostly hidden behind it
|
|
1203
|
+
// and only peek out at the top, so their labels align with the bar's top edge.
|
|
1204
|
+
const isFrontGroup = groupIdx === groups.length - 1;
|
|
1205
|
+
const centerY = isFrontGroup ? axisY - groupPixelHeight / 2 : axisY - groupPixelHeight;
|
|
1141
1206
|
const labelText = this.i18n.get(group.prefix + "1") || group.prefix.toUpperCase();
|
|
1142
1207
|
new Label(headerGroup, labelX, centerY, "STACK_HEADER", labelText, this.styles, HookLocation.Center, HookLocation.Right).forceStringTypeDraw();
|
|
1143
1208
|
});
|
|
@@ -1155,7 +1220,7 @@ export class TimeChart {
|
|
|
1155
1220
|
let segmentHeight;
|
|
1156
1221
|
if (this.stackConfig.mode === StackMode.RELATIVE) {
|
|
1157
1222
|
const proportion = total !== 0 ? Math.abs(seg.value) / total : 0;
|
|
1158
|
-
segmentHeight = proportion * pixelPerUnit;
|
|
1223
|
+
segmentHeight = proportion * RELATIVE_STACK_UNITS * pixelPerUnit;
|
|
1159
1224
|
}
|
|
1160
1225
|
else {
|
|
1161
1226
|
segmentHeight = Math.abs(seg.value * pixelPerUnit);
|
|
@@ -1196,6 +1261,15 @@ export class TimeChart {
|
|
|
1196
1261
|
activeLayers.push(key);
|
|
1197
1262
|
}
|
|
1198
1263
|
}
|
|
1264
|
+
if (isScenarioStack && this.scenarioPropOrder.length > 0) {
|
|
1265
|
+
const order = this.scenarioPropOrder;
|
|
1266
|
+
activeLayers.sort((a, b) => {
|
|
1267
|
+
var _a, _b, _c, _d;
|
|
1268
|
+
const ia = order.indexOf((_b = (_a = dataModel[0][a]) === null || _a === void 0 ? void 0 : _a.scenario) !== null && _b !== void 0 ? _b : "");
|
|
1269
|
+
const ib = order.indexOf((_d = (_c = dataModel[0][b]) === null || _c === void 0 ? void 0 : _c.scenario) !== null && _d !== void 0 ? _d : "");
|
|
1270
|
+
return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1199
1273
|
// Compute cumulative values
|
|
1200
1274
|
for (let layerIdx = 0; layerIdx < activeLayers.length; layerIdx++) {
|
|
1201
1275
|
const key = activeLayers[layerIdx];
|
|
@@ -1229,7 +1303,7 @@ export class TimeChart {
|
|
|
1229
1303
|
x: this.position.getColumnCenterPositionX(idx),
|
|
1230
1304
|
y: axisY -
|
|
1231
1305
|
(stackMode === StackMode.RELATIVE
|
|
1232
|
-
? val * pixelPerUnit //
|
|
1306
|
+
? val * RELATIVE_STACK_UNITS * pixelPerUnit // val is a 0..1 cumulative proportion
|
|
1233
1307
|
: val * pixelPerUnit),
|
|
1234
1308
|
}));
|
|
1235
1309
|
};
|
|
@@ -1281,12 +1355,14 @@ export class TimeChart {
|
|
|
1281
1355
|
}
|
|
1282
1356
|
}
|
|
1283
1357
|
leftOuterJoinDates(result, dateInterval) {
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
return
|
|
1289
|
-
}
|
|
1358
|
+
const validDates = result
|
|
1359
|
+
.map((e) => e.calcdate)
|
|
1360
|
+
.filter((d) => d != null && typeof d.isValid === "boolean" && d.isValid);
|
|
1361
|
+
if (validDates.length === 0) {
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
const to = DateTime.max(...validDates);
|
|
1365
|
+
const from = DateTime.min(...validDates);
|
|
1290
1366
|
const dateRange = new DateStringFactory().datesBetween(from, to, dateInterval, this.intervalSpanLimit);
|
|
1291
1367
|
const dateRangeEntries = new Map();
|
|
1292
1368
|
dateRange.forEach((element, idx) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HookLocation, Label } from "./Label";
|
|
2
2
|
import { SiPrefix } from "../../../../utils/model/SiPrefix";
|
|
3
|
-
import { StackMode } from "../../../../utils/constants";
|
|
3
|
+
import { RELATIVE_STACK_UNITS, StackMode } from "../../../../utils/constants";
|
|
4
4
|
/**
|
|
5
5
|
* Renders a single segment within a stacked bar column in a time chart.
|
|
6
6
|
*
|
|
@@ -44,8 +44,8 @@ export class StackedColumn {
|
|
|
44
44
|
if (this.stackMode === StackMode.RELATIVE) {
|
|
45
45
|
// 100% stacked: segment height is proportion of total
|
|
46
46
|
const proportion = this.totalValue !== 0 ? Math.abs(value) / Math.abs(this.totalValue) : 0;
|
|
47
|
-
//
|
|
48
|
-
const totalPixelHeight =
|
|
47
|
+
// Full stack spans RELATIVE_STACK_UNITS percent; pixelPerUnit = pixels per percentage point
|
|
48
|
+
const totalPixelHeight = RELATIVE_STACK_UNITS * pixelPerUnit;
|
|
49
49
|
segmentHeight = proportion * totalPixelHeight;
|
|
50
50
|
const baselinePixels = (this.baselineValue / Math.abs(this.totalValue)) * totalPixelHeight;
|
|
51
51
|
yPos = axisY - baselinePixels - segmentHeight;
|
|
@@ -54,20 +54,23 @@ export class TimeChartComponentConfig {
|
|
|
54
54
|
this.stackConfig = null;
|
|
55
55
|
/** When true, line charts extend to the full width of the chart area. */
|
|
56
56
|
this.lineFullWidth = true;
|
|
57
|
+
/** Locale used for date-axis labels and SQL date normalization; set from the bn-context locale. */
|
|
58
|
+
this.locale = "de";
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Converts untyped JSON into a validated {@link TimeChartComponentConfig}.
|
|
61
63
|
*
|
|
62
|
-
*
|
|
64
|
+
* Reads from the shared alasql database for measure-scale auto-calculation.
|
|
63
65
|
*/
|
|
64
66
|
export class TimeChartComponentConfigAdapter {
|
|
65
|
-
constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter,
|
|
67
|
+
constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter, db, fromExpr) {
|
|
66
68
|
this.dataRowAdapter = dataRowAdapter;
|
|
67
69
|
this.orderAdapter = orderAdapter;
|
|
68
70
|
this.stringAdapter = stringAdapter;
|
|
69
71
|
this.dataFormatDigitsAdapter = dataFormatDigitsAdapter;
|
|
70
|
-
this.
|
|
72
|
+
this.db = db;
|
|
73
|
+
this.fromExpr = fromExpr;
|
|
71
74
|
}
|
|
72
75
|
adapt(data) {
|
|
73
76
|
const dataSet = AdapterUtils.adaptArray(data.data, this.dataRowAdapter);
|
|
@@ -113,7 +116,7 @@ export class TimeChartComponentConfigAdapter {
|
|
|
113
116
|
config.filter = data.filter;
|
|
114
117
|
}
|
|
115
118
|
if (CompareUtil.isExisting(data.measureScale)) {
|
|
116
|
-
config.measureScale = DataAnalyzer.calculateMeasureScale(this.
|
|
119
|
+
config.measureScale = DataAnalyzer.calculateMeasureScale(this.db, this.fromExpr, config.scenarios, data.measureScale);
|
|
117
120
|
}
|
|
118
121
|
if (CompareUtil.isString(data.measureUnit)) {
|
|
119
122
|
config.measureUnit = data.measureUnit;
|
|
@@ -142,6 +145,9 @@ export class TimeChartComponentConfigAdapter {
|
|
|
142
145
|
if (CompareUtil.isBoolean(data.lineFullWidth)) {
|
|
143
146
|
config.lineFullWidth = data.lineFullWidth;
|
|
144
147
|
}
|
|
148
|
+
if (CompareUtil.isString(data.locale)) {
|
|
149
|
+
config.locale = data.locale;
|
|
150
|
+
}
|
|
145
151
|
return config;
|
|
146
152
|
}
|
|
147
153
|
default() {
|
|
@@ -28,7 +28,7 @@ export class ComponentStyle {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return h(Host, { key: '
|
|
31
|
+
return h(Host, { key: '9138ba4914f990823213f637bdc65274669bfe86' });
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "bn-component-style"; }
|
|
34
34
|
static get originalStyleUrls() {
|
|
@@ -49,7 +49,7 @@ export class Context {
|
|
|
49
49
|
componentWillUpdate() { }
|
|
50
50
|
componentDidUpdate() { }
|
|
51
51
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
52
|
+
return (h(Host, { key: '3c27b95cb769f4871f06453c73faa2a15dd04aa6' }, h("slot", { key: '4965ab0122454b1b84d463146e949e432adbd06c' })));
|
|
53
53
|
}
|
|
54
54
|
static get is() { return "bn-context"; }
|
|
55
55
|
static get encapsulation() { return "shadow"; }
|
|
@@ -83,6 +83,25 @@ export class Context {
|
|
|
83
83
|
"setter": false,
|
|
84
84
|
"reflect": false,
|
|
85
85
|
"attribute": "locale"
|
|
86
|
+
},
|
|
87
|
+
"i18nNamespace": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "string",
|
|
92
|
+
"resolved": "string",
|
|
93
|
+
"references": {}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": false,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": "Default i18n namespace for every component inside this context.\nResolved at runtime from the `i18n-namespace` attribute by the nearest\nancestor lookup in `withTranslation`; a namespace set on a page, card,\ntree, grid, or the component itself wins. Declared so the attribute is\npart of the typed public API rather than a bare DOM attribute."
|
|
100
|
+
},
|
|
101
|
+
"getter": false,
|
|
102
|
+
"setter": false,
|
|
103
|
+
"reflect": true,
|
|
104
|
+
"attribute": "i18n-namespace"
|
|
86
105
|
}
|
|
87
106
|
};
|
|
88
107
|
}
|