@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.19
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-19bbac66.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-74c5a95d.entry.js +1 -0
- package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
- package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
- package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
- 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-BjBz5cSL.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-CiudZRQr.js +1 -0
- package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
- package/dist/bn-template-engine/p-DY7YYmpa.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-a8291de2.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
- package/dist/bn-template-engine/p-f9dfd120.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 +16047 -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-BDrMkhc4.js +9499 -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-o03YUfn_.js +199 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
- package/dist/cjs/scaling-DKZyjWj5.js +587 -0
- package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
- package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
- package/dist/cjs/withStyled-CRiC9fzc.js +1137 -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 +125 -42
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
- 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 +160 -43
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -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 +1 -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 +1 -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 +317 -61
- package/dist/collection/components/bn-table/ibcs-table.css +8 -0
- package/dist/collection/components/bn-table/ibcs-table.js +161 -32
- package/dist/collection/components/bn-table/utils/Table.js +72 -28
- 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 +117 -22
- 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 +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 -6
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -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 +68 -0
- package/dist/collection/stores/ruleSets.js +46 -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 +50 -14
- 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-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 +16025 -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-1Yj1uKvh.js +9484 -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-BG5dOBYH.js +196 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
- package/dist/esm/scaling-CeSRcRl1.js +579 -0
- package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
- package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
- package/dist/esm/withStyled-Br2DGTPs.js +1104 -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 +16 -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 +16 -12
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
- 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-layout-card/bn-layout-card.d.ts +35 -8
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -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 +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/editor-companion/editor-companion.d.ts +2 -0
- package/dist/types/components.d.ts +1691 -120
- 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 +1 -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 +12 -4
- 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
|
@@ -7,11 +7,9 @@ import { OrderAdapter, OrderDirection } from "../../../utils/model/Order";
|
|
|
7
7
|
import { I18nMode } from "../../../utils/constants";
|
|
8
8
|
import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
|
|
9
9
|
import { StringAdapter } from "../../../utils/helper/StringAdapter";
|
|
10
|
+
import { sanitizeHtml } from "../../../utils/sanitizeHtml";
|
|
10
11
|
export class IbcsTitle {
|
|
11
12
|
constructor() {
|
|
12
|
-
// sample fuer die chrome dev console:
|
|
13
|
-
// document.querySelector("ibcs-title").setBusinessUnit("Sven")
|
|
14
|
-
// document.querySelector("ibcs-title").setProps({businessUnit: "Lalal"})
|
|
15
13
|
this.businessUnit = "";
|
|
16
14
|
this.scenarios = [];
|
|
17
15
|
this.measures = [];
|
|
@@ -36,17 +34,18 @@ export class IbcsTitle {
|
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
36
|
render() {
|
|
39
|
-
return (h("div", { key: '
|
|
37
|
+
return (h("div", { key: '7a95748a4576c654c9066efb2bfd7531238d2ed0' }, h("div", { key: '6a34ba1043660dc75b57cd029f6438d1178c34e4', innerHTML: sanitizeHtml(this.title.unit) }), h("div", { key: '6ec241e7cd6ac8a2061aab1b822973e77e2fb7cd' }, this.title.measures.map((measure, index) => (h("span", null, this.isFirstElement(index) ? this.title.i18n.get("SEPERATOR_WS") : "", h("span", { class: "measure" }, measure.name), " ", measure.unit ? this.title.i18n.get("in") : "", " ", measure.unit)))), h("div", { key: 'd6bc97cd78ec8734d4d42b2537cf61dfcac28ae4' }, this.title.dimension)));
|
|
40
38
|
}
|
|
41
39
|
componentWillLoad() {
|
|
42
40
|
const config = this.prepareConfig();
|
|
43
|
-
this.title = new Title(new IBCSRuleSet());
|
|
41
|
+
this.title = new Title(new IBCSRuleSet(this.ruleSetConfig));
|
|
44
42
|
this.title.setI18n(this.i18n);
|
|
45
43
|
this.title.setConfig(config);
|
|
46
44
|
}
|
|
47
45
|
componentWillUpdate() {
|
|
48
46
|
const config = this.prepareConfig();
|
|
49
47
|
this.title.setI18n(this.i18n);
|
|
48
|
+
this.title.setRuleSet(new IBCSRuleSet(this.ruleSetConfig));
|
|
50
49
|
this.title.setConfig(config);
|
|
51
50
|
}
|
|
52
51
|
componentWillRender() {
|
|
@@ -261,6 +260,30 @@ export class IbcsTitle {
|
|
|
261
260
|
"reflect": false,
|
|
262
261
|
"attribute": "i18n-mode",
|
|
263
262
|
"defaultValue": "I18nMode.ALL"
|
|
263
|
+
},
|
|
264
|
+
"ruleSetConfig": {
|
|
265
|
+
"type": "unknown",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "RuleSetConfig",
|
|
269
|
+
"resolved": "RuleSetConfig",
|
|
270
|
+
"references": {
|
|
271
|
+
"RuleSetConfig": {
|
|
272
|
+
"location": "import",
|
|
273
|
+
"path": "../../../stores/ruleSets",
|
|
274
|
+
"id": "src/stores/ruleSets.ts::RuleSetConfig",
|
|
275
|
+
"referenceLocation": "RuleSetConfig"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"required": false,
|
|
280
|
+
"optional": true,
|
|
281
|
+
"docs": {
|
|
282
|
+
"tags": [],
|
|
283
|
+
"text": ""
|
|
284
|
+
},
|
|
285
|
+
"getter": false,
|
|
286
|
+
"setter": false
|
|
264
287
|
}
|
|
265
288
|
};
|
|
266
289
|
}
|
|
@@ -292,7 +315,7 @@ export class IbcsTitle {
|
|
|
292
315
|
"signature": "(data: Partial<IbcsTitle>) => Promise<void>",
|
|
293
316
|
"parameters": [{
|
|
294
317
|
"name": "data",
|
|
295
|
-
"type": "{ businessUnit?: string; setBusinessUnit?: (businessUnit: string) => Promise<void>; setProps?: (data: Partial<IbcsTitle>) => Promise<void>; scenarios?: string[]; measures?: MeasureEntry[]; timeperiod?: TimePeriod; intervalSpanLimit?: number; order?: Order; i18n?: Map<string, string>; i18nMode?: I18nMode; render?: () => any; componentWillLoad?: () => void; componentWillUpdate?: () => void; componentWillRender?: () => void; }",
|
|
318
|
+
"type": "{ businessUnit?: string; setBusinessUnit?: (businessUnit: string) => Promise<void>; setProps?: (data: Partial<IbcsTitle>) => Promise<void>; scenarios?: string[]; measures?: MeasureEntry[]; timeperiod?: TimePeriod; intervalSpanLimit?: number; order?: Order; i18n?: Map<string, string>; i18nMode?: I18nMode; ruleSetConfig?: RuleSetConfig; render?: () => any; componentWillLoad?: () => void; componentWillUpdate?: () => void; componentWillRender?: () => void; }",
|
|
296
319
|
"docs": ""
|
|
297
320
|
}],
|
|
298
321
|
"references": {
|
|
@@ -23,8 +23,7 @@ export class EditorCompanion {
|
|
|
23
23
|
if (this.distinctCache.has(cacheKey)) {
|
|
24
24
|
return Promise.resolve(this.distinctCache.get(cacheKey));
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
const result = this.distinct(this.stores.datasources.get(dataSourceName) || [], key);
|
|
26
|
+
const result = this.distinct(this.queryRows(dataSourceName), key);
|
|
28
27
|
this.distinctCache.set(cacheKey, result);
|
|
29
28
|
return Promise.resolve(result);
|
|
30
29
|
}
|
|
@@ -33,13 +32,21 @@ export class EditorCompanion {
|
|
|
33
32
|
if (this.distinctCache.has(cacheKey)) {
|
|
34
33
|
return Promise.resolve(this.distinctCache.get(cacheKey));
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
const result = this.distinct(this.stores.datasets.get(datasetName) || [], key);
|
|
35
|
+
const result = this.distinct(this.queryRows(datasetName), key);
|
|
38
36
|
this.distinctCache.set(cacheKey, result);
|
|
39
37
|
return Promise.resolve(result);
|
|
40
38
|
}
|
|
41
39
|
render() {
|
|
42
|
-
return h(Fragment, { key: '
|
|
40
|
+
return h(Fragment, { key: '35a8fdaa36fb5f9b042d1fad904f9b54a58ba79c' });
|
|
41
|
+
}
|
|
42
|
+
/** Materialize a table or view from the shared db, returning [] when it doesn't exist yet. */
|
|
43
|
+
queryRows(name) {
|
|
44
|
+
try {
|
|
45
|
+
return this.stores.db.db.exec(`SELECT * FROM \`${name}\``);
|
|
46
|
+
}
|
|
47
|
+
catch (_e) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
distinct(data, key) {
|
|
45
52
|
return [...new Set(data.map((d) => d[key]))].filter((v) => v !== null && v !== undefined);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-context isolated AlaSQL database with a tiny pub/sub for table/view
|
|
3
|
+
* data changes.
|
|
4
|
+
*
|
|
5
|
+
* Each `<bn-context>` owns one `ScopedDb`. `<bn-datasource>` and the static/
|
|
6
|
+
* URL branches of `<bn-dataset>` register tables; the SQL branch of
|
|
7
|
+
* `<bn-dataset>` registers views. Consumer components subscribe by name and
|
|
8
|
+
* re-render when the producer calls `notify(name)`.
|
|
9
|
+
*
|
|
10
|
+
* @module context/scopedDb
|
|
11
|
+
*/
|
|
12
|
+
import alasql from "alasql";
|
|
13
|
+
import { DateTime } from "luxon";
|
|
14
|
+
/**
|
|
15
|
+
* Builds a SQL FROM-clause expression for a dataset, optionally filtered.
|
|
16
|
+
*
|
|
17
|
+
* Helpers (DataQuery, Table, StructureChart, TimeChart, dataAnalyzer) embed
|
|
18
|
+
* this in their queries instead of accepting `[data]` array parameters, so
|
|
19
|
+
* alasql doesn't have to ingest a fresh table on every call.
|
|
20
|
+
*/
|
|
21
|
+
export function buildFromExpr(tableName, filter) {
|
|
22
|
+
if (filter != null && filter.length > 0) {
|
|
23
|
+
return `(SELECT * FROM \`${tableName}\` WHERE ${filter}) AS __src`;
|
|
24
|
+
}
|
|
25
|
+
return `\`${tableName}\``;
|
|
26
|
+
}
|
|
27
|
+
/** Coerces an unknown value into a Luxon `DateTime`, or `undefined` if it can't be parsed. */
|
|
28
|
+
function toDateTime(value) {
|
|
29
|
+
if (value == null)
|
|
30
|
+
return undefined;
|
|
31
|
+
if (typeof value === "string") {
|
|
32
|
+
const dt = DateTime.fromISO(value);
|
|
33
|
+
return dt.isValid ? dt : undefined;
|
|
34
|
+
}
|
|
35
|
+
if (typeof value === "number") {
|
|
36
|
+
const dt = DateTime.fromMillis(value);
|
|
37
|
+
return dt.isValid ? dt : undefined;
|
|
38
|
+
}
|
|
39
|
+
// Already a DateTime-shaped object.
|
|
40
|
+
if (typeof value.isValid === "boolean") {
|
|
41
|
+
const dt = value;
|
|
42
|
+
return dt.isValid ? dt : undefined;
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* AlaSQL custom functions (UDFs) live on the `alasql.fn` global, not per-DB.
|
|
48
|
+
* Register them once at module load — multiple contexts share the registrations.
|
|
49
|
+
*
|
|
50
|
+
* Signatures are widened to `(...x: unknown[]) => unknown` to satisfy alasql's
|
|
51
|
+
* `userDefinedFunction` type; argument validation happens inside each UDF.
|
|
52
|
+
*/
|
|
53
|
+
let udfsRegistered = false;
|
|
54
|
+
function registerUdfs() {
|
|
55
|
+
if (udfsRegistered)
|
|
56
|
+
return;
|
|
57
|
+
udfsRegistered = true;
|
|
58
|
+
alasql.fn.transformOperator = ((a) => (a === "-" ? -1 : 1));
|
|
59
|
+
alasql.fn.normalizeDate = ((date, normalizationLevel, _locale) => {
|
|
60
|
+
const dt = toDateTime(date);
|
|
61
|
+
if (!dt)
|
|
62
|
+
return undefined;
|
|
63
|
+
return dt.startOf(normalizationLevel);
|
|
64
|
+
});
|
|
65
|
+
// Custom aggregate collecting unique values per group, used by bn-table attribute
|
|
66
|
+
// expressions like set(_leiter). alasql stages: 1 = init, 2 = accumulate, 3 = finalize.
|
|
67
|
+
alasql.aggr.SETAGG = (value, accumulator, stage) => {
|
|
68
|
+
if (stage === 1) {
|
|
69
|
+
return value == null ? [] : [value];
|
|
70
|
+
}
|
|
71
|
+
const acc = accumulator;
|
|
72
|
+
if (stage === 2) {
|
|
73
|
+
if (value != null && !acc.includes(value))
|
|
74
|
+
acc.push(value);
|
|
75
|
+
return acc;
|
|
76
|
+
}
|
|
77
|
+
return acc.join(", ");
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Creates a fresh isolated database with its own subscriber map. */
|
|
81
|
+
export function createScopedDb() {
|
|
82
|
+
registerUdfs();
|
|
83
|
+
const db = new alasql.Database();
|
|
84
|
+
const subscribers = new Map();
|
|
85
|
+
return {
|
|
86
|
+
db,
|
|
87
|
+
subscribe(name, cb) {
|
|
88
|
+
let set = subscribers.get(name);
|
|
89
|
+
if (!set) {
|
|
90
|
+
set = new Set();
|
|
91
|
+
subscribers.set(name, set);
|
|
92
|
+
}
|
|
93
|
+
set.add(cb);
|
|
94
|
+
return () => {
|
|
95
|
+
const s = subscribers.get(name);
|
|
96
|
+
if (!s)
|
|
97
|
+
return;
|
|
98
|
+
s.delete(cb);
|
|
99
|
+
if (s.size === 0)
|
|
100
|
+
subscribers.delete(name);
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
notify(name) {
|
|
104
|
+
const set = subscribers.get(name);
|
|
105
|
+
if (!set)
|
|
106
|
+
return;
|
|
107
|
+
for (const cb of set) {
|
|
108
|
+
try {
|
|
109
|
+
cb();
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
console.error(`[bn] subscriber for "${name}" threw`, e);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
hasTable(name) {
|
|
117
|
+
var _a;
|
|
118
|
+
return ((_a = db.tables) === null || _a === void 0 ? void 0 : _a[name]) != null;
|
|
119
|
+
},
|
|
120
|
+
hasView(name) {
|
|
121
|
+
var _a;
|
|
122
|
+
// alasql stores views in db.views (separate from db.tables)
|
|
123
|
+
// @ts-ignore - views is not in the public typings
|
|
124
|
+
return ((_a = db.views) === null || _a === void 0 ? void 0 : _a[name]) != null;
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
import { XY_SERIES_PALETTE } from "../utils/xy/SeriesPalette";
|
|
2
|
+
const xyChartStyleDefaults = () => ({
|
|
3
|
+
scaleFactors: {
|
|
4
|
+
pointRadius: 0.4,
|
|
5
|
+
bubbleMaxRadius: 3.2,
|
|
6
|
+
bubbleMinRadius: 0.35,
|
|
7
|
+
axisTickLength: 0.35,
|
|
8
|
+
labelToMark: 0.3,
|
|
9
|
+
legendSwatch: 0.9,
|
|
10
|
+
panelGap: 1.6,
|
|
11
|
+
refLineWidth: 1,
|
|
12
|
+
gridLineWidth: 1,
|
|
13
|
+
},
|
|
14
|
+
axisStyles: {
|
|
15
|
+
ac: { stroke: "#A6A6A6", fill: "#A6A6A6", width: 1 },
|
|
16
|
+
fc: { stroke: "#808080", fill: "#808080", width: 1 },
|
|
17
|
+
pp: { stroke: "#D9D9D9", fill: "#D9D9D9", width: 1 },
|
|
18
|
+
pl: { stroke: "#EFEFEF", fill: "#EFEFEF", width: 1 },
|
|
19
|
+
},
|
|
20
|
+
seriesColors: [...XY_SERIES_PALETTE],
|
|
21
|
+
padding: {
|
|
22
|
+
top: 10,
|
|
23
|
+
left: 10,
|
|
24
|
+
right: 10,
|
|
25
|
+
bottom: 10,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
1
28
|
export const SYSTEM_STYLE_DEFAULTS = {
|
|
2
29
|
global: {
|
|
3
30
|
fontFamily: "'Noto Sans', sans-serif",
|
|
@@ -92,6 +119,46 @@ export const SYSTEM_STYLE_DEFAULTS = {
|
|
|
92
119
|
bottom: 10,
|
|
93
120
|
},
|
|
94
121
|
},
|
|
122
|
+
"bn-chart-scatter": xyChartStyleDefaults(),
|
|
123
|
+
"bn-chart-bubble": xyChartStyleDefaults(),
|
|
124
|
+
"bn-chart-bullet": {
|
|
125
|
+
scaleFactors: {
|
|
126
|
+
rowHeight: 1.9,
|
|
127
|
+
barHeight: 0.66,
|
|
128
|
+
varianceHeight: 0.4,
|
|
129
|
+
targetTickHeight: 1.1,
|
|
130
|
+
targetLineWidth: 2,
|
|
131
|
+
axisLineWidth: 1,
|
|
132
|
+
labelToBar: 0.3,
|
|
133
|
+
labelToAxis: 0.3,
|
|
134
|
+
axisTickLength: 0.35,
|
|
135
|
+
tickStripHeight: 1.2,
|
|
136
|
+
},
|
|
137
|
+
axisStyles: {
|
|
138
|
+
ac: { stroke: "#121212", fill: "#121212", width: 0.1 },
|
|
139
|
+
fc: { stroke: "#121212", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" },
|
|
140
|
+
pp: { stroke: "#606060", fill: "#606060", width: 0.1 },
|
|
141
|
+
pl: { stroke: "#121212", fill: "#ffffff", width: 0.1 },
|
|
142
|
+
},
|
|
143
|
+
barStyles: {
|
|
144
|
+
ac: { stroke: "#404040", fill: "#404040", width: 0.1 },
|
|
145
|
+
fc: { stroke: "#404040", fill: "#ffffff", width: 0.5, dasharray: "4 3" },
|
|
146
|
+
pp: { stroke: "#A6A6A6", fill: "#A6A6A6", width: 0.1 },
|
|
147
|
+
pl: { stroke: "#404040", fill: "#ffffff", width: 0.1 },
|
|
148
|
+
},
|
|
149
|
+
varianceStyles: {
|
|
150
|
+
pos: { stroke: "#008f96", fill: "#008f96", width: 0.1 },
|
|
151
|
+
neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 },
|
|
152
|
+
neu: { stroke: "#808080", fill: "#808080", width: 0.1 },
|
|
153
|
+
},
|
|
154
|
+
rangeColors: ["#D9D9D9", "#EFEFEF"],
|
|
155
|
+
padding: {
|
|
156
|
+
top: 10,
|
|
157
|
+
left: 10,
|
|
158
|
+
right: 10,
|
|
159
|
+
bottom: 10,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
95
162
|
"bn-tree": {
|
|
96
163
|
edgeColor: "#404040",
|
|
97
164
|
edgeWidth: 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Factory that creates a fresh set of all
|
|
2
|
+
* Factory that creates a fresh set of all 9 `@stencil/store` instances.
|
|
3
3
|
*
|
|
4
4
|
* Called once per `<bn-context>` element so that each context owns isolated
|
|
5
5
|
* reactive state. The returned object satisfies the {@link ScopedStores} interface.
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
import { createStore } from "@stencil/store";
|
|
10
10
|
import { SYSTEM_STYLE_DEFAULTS } from "./componentStyles";
|
|
11
11
|
import { SYSTEM_I18N_DEFAULTS } from "./internationalization";
|
|
12
|
+
import { SYSTEM_RULESET_DEFAULTS } from "./ruleSets";
|
|
13
|
+
import { createScopedDb } from "../context/scopedDb";
|
|
12
14
|
export function createScopedStores() {
|
|
13
|
-
const
|
|
14
|
-
const datasets = createStore({});
|
|
15
|
+
const db = createScopedDb();
|
|
15
16
|
const datasetsMeta = createStore({});
|
|
16
17
|
const componentStyles = createStore({
|
|
17
18
|
_system: SYSTEM_STYLE_DEFAULTS,
|
|
@@ -19,13 +20,18 @@ export function createScopedStores() {
|
|
|
19
20
|
const internationalization = createStore(Object.assign({}, SYSTEM_I18N_DEFAULTS));
|
|
20
21
|
const assets = createStore({});
|
|
21
22
|
const context = createStore({ locale: "en" });
|
|
23
|
+
const scalingGroups = createStore({});
|
|
24
|
+
const ruleSets = createStore({
|
|
25
|
+
_system: SYSTEM_RULESET_DEFAULTS,
|
|
26
|
+
});
|
|
22
27
|
return {
|
|
23
|
-
|
|
24
|
-
datasets,
|
|
28
|
+
db,
|
|
25
29
|
datasetsMeta,
|
|
26
30
|
componentStyles,
|
|
27
31
|
internationalization,
|
|
28
32
|
assets,
|
|
29
33
|
context,
|
|
34
|
+
scalingGroups,
|
|
35
|
+
ruleSets,
|
|
30
36
|
};
|
|
31
37
|
}
|
|
@@ -42,6 +42,42 @@ const globalLabelKeys = [
|
|
|
42
42
|
"ibcssymbol_delta_ac_relative",
|
|
43
43
|
"ibcssymbol_delta_generic_relative",
|
|
44
44
|
];
|
|
45
|
+
/**
|
|
46
|
+
* Message keys shared by both XY charts (`bn-chart-scatter`,
|
|
47
|
+
* `bn-chart-bubble`): axis captions, legend labels, the no-data text, and
|
|
48
|
+
* one message per warning/error code the charts can raise (`{{…}}`
|
|
49
|
+
* placeholders are interpolated by `withTranslation`).
|
|
50
|
+
*/
|
|
51
|
+
const xyChartKeysDe = {
|
|
52
|
+
axis: { in: "in" },
|
|
53
|
+
legend: { title: "" },
|
|
54
|
+
"no-data": "==Keine Daten==",
|
|
55
|
+
"xy-prop-json": "{{prop}}: ungültiges JSON.",
|
|
56
|
+
"xy-measure-invalid": "{{prop}}: '{{measure}}' ist weder eine Szenario-Spalte noch ein Varianz-Token.",
|
|
57
|
+
"xy-family-mixed": "Alle Kennzahlen müssen zur selben Szenario-Familie gehören (gefunden: {{families}}).",
|
|
58
|
+
"xy-level-order": "Facet-, Serien- und Punktebene müssen in der Hierarchie streng absteigen ({{detail}}).",
|
|
59
|
+
"xy-duplicate-point": "{{count}} doppelte Punkt-Identität(en) verworfen (erste Zeile gewinnt): {{names}}. Im DataSet-SQL aggregieren.",
|
|
60
|
+
"xy-point-clipped": "{{count}} Punkt(e) außerhalb des expliziten min/max ausgeschlossen.",
|
|
61
|
+
"xy-variance-nodata": "{{count}} Zeile(n) ohne Varianzdaten ausgeschlossen.",
|
|
62
|
+
"xy-label-unknown": "Unbekannte Label-Namen: {{names}}.",
|
|
63
|
+
"xy-series-overflow": "Mehr Serien als Palettenfarben; Farben wiederholen sich aufgehellt.",
|
|
64
|
+
"xy-point-budget": "{{count}} Punkte überschreiten das Budget von 5000 Punkten; 'limit' erwägen.",
|
|
65
|
+
};
|
|
66
|
+
const xyChartKeysEn = {
|
|
67
|
+
axis: { in: "in" },
|
|
68
|
+
legend: { title: "" },
|
|
69
|
+
"no-data": "==No Data==",
|
|
70
|
+
"xy-prop-json": "{{prop}}: invalid JSON.",
|
|
71
|
+
"xy-measure-invalid": "{{prop}}: '{{measure}}' is neither a scenario column nor a variance token.",
|
|
72
|
+
"xy-family-mixed": "All measures must share one scenario family (found: {{families}}).",
|
|
73
|
+
"xy-level-order": "Facet, series, and point levels must strictly descend in the hierarchy ({{detail}}).",
|
|
74
|
+
"xy-duplicate-point": "{{count}} duplicate point identitie(s) dropped (first row wins): {{names}}. Aggregate in the DataSet SQL.",
|
|
75
|
+
"xy-point-clipped": "{{count}} point(s) outside the explicit min/max excluded.",
|
|
76
|
+
"xy-variance-nodata": "{{count}} row(s) without variance data excluded.",
|
|
77
|
+
"xy-label-unknown": "Unknown label name(s): {{names}}.",
|
|
78
|
+
"xy-series-overflow": "More series than palette colors; colors repeat with a tint step.",
|
|
79
|
+
"xy-point-budget": "{{count}} points exceed the 5000-point budget; consider 'limit'.",
|
|
80
|
+
};
|
|
45
81
|
const de = flattenObject({
|
|
46
82
|
global: {
|
|
47
83
|
ac1: "AC",
|
|
@@ -73,6 +109,22 @@ const de = flattenObject({
|
|
|
73
109
|
in: "in",
|
|
74
110
|
},
|
|
75
111
|
"bn-chart": {},
|
|
112
|
+
"bn-chart-scatter": Object.assign(Object.assign({}, xyChartKeysDe), { "xy-iso-domain": "Iso-Linien benötigen einen strikt positiven Wertebereich auf beiden Achsen; übersprungen." }),
|
|
113
|
+
"bn-chart-bubble": Object.assign(Object.assign({}, xyChartKeysDe), { legend: Object.assign(Object.assign({}, xyChartKeysDe.legend), { size: "Größe", compare: "Szenarien" }), "xy-compare-variance": "compareWith kann nicht mit Varianz-Kennzahlen auf den Achsen kombiniert werden.", "bubble-size-negative": "{{count}} Blase(n) mit negativem Größenwert ausgeschlossen.", "bubble-share-range": "{{count}} Anteilswert(e) außerhalb [0,1] wurden begrenzt.", "bubble-scale-group-unknown": "size.group '{{group}}' verweist auf keine bn-scaling-group im Kontext.", "bubble-scale-overflow": "{{count}} gruppenskalierte Blase(n) überschreiten das Panel; in Originalgröße gezeichnet." }),
|
|
114
|
+
"bn-chart-bullet": {
|
|
115
|
+
axis: { in: "in" },
|
|
116
|
+
"no-data": "==Keine Daten==",
|
|
117
|
+
target: "Ziel",
|
|
118
|
+
"bullet-prop-json": "{{prop}}: ungültiges JSON.",
|
|
119
|
+
"bullet-measure-invalid": "{{prop}}: '{{measure}}' ist keine Szenario-Spalte (ac1…pl4).",
|
|
120
|
+
"bullet-measure-same": "actual und target müssen unterschiedliche Szenarien sein ('{{measure}}').",
|
|
121
|
+
"bullet-target-none": "Kein Ziel-Szenario gefunden (pl1/pp1/fc1); nur Ist-Balken werden gezeichnet.",
|
|
122
|
+
"bullet-target-missing": "{{count}} Zeile(n) ohne Zielwert; Varianz und Marker entfallen.",
|
|
123
|
+
"bullet-target-invalid": "{{count}} Zeile(n) mit Ziel ≤ 0 können nicht normalisiert werden; Balken entfällt.",
|
|
124
|
+
"bullet-mixed-operation": "{{count}} KPI-Gruppe(n) mischen '+'- und '-'-Zeilen; Sentiment fällt auf '+' zurück.",
|
|
125
|
+
"bullet-ranges-ignored": 'ranges: im normalisierten (IBCS-)Modus ignoriert; normalize="none" setzen.',
|
|
126
|
+
"bullet-ranges-invalid": "ranges: erwartet bis zu 2 aufsteigende positive Zielanteile ({{detail}}).",
|
|
127
|
+
},
|
|
76
128
|
"bn-table": {
|
|
77
129
|
in: "in",
|
|
78
130
|
category: " ",
|
|
@@ -114,6 +166,22 @@ const en = flattenObject({
|
|
|
114
166
|
in: "in",
|
|
115
167
|
},
|
|
116
168
|
"bn-chart": {},
|
|
169
|
+
"bn-chart-scatter": Object.assign(Object.assign({}, xyChartKeysEn), { "xy-iso-domain": "Iso-lines need a strictly positive domain on both axes; skipped." }),
|
|
170
|
+
"bn-chart-bubble": Object.assign(Object.assign({}, xyChartKeysEn), { legend: Object.assign(Object.assign({}, xyChartKeysEn.legend), { size: "Size", compare: "Scenarios" }), "xy-compare-variance": "compareWith cannot be combined with variance measures on the axes.", "bubble-size-negative": "{{count}} bubble(s) with a negative size value excluded.", "bubble-share-range": "{{count}} share value(s) outside [0,1] were clamped.", "bubble-scale-group-unknown": "size.group '{{group}}' names no bn-scaling-group in scope.", "bubble-scale-overflow": "{{count}} group-scaled bubble(s) exceed the panel; rendered true-size." }),
|
|
171
|
+
"bn-chart-bullet": {
|
|
172
|
+
axis: { in: "in" },
|
|
173
|
+
"no-data": "==No Data==",
|
|
174
|
+
target: "Target",
|
|
175
|
+
"bullet-prop-json": "{{prop}}: invalid JSON.",
|
|
176
|
+
"bullet-measure-invalid": "{{prop}}: '{{measure}}' is not a scenario column (ac1…pl4).",
|
|
177
|
+
"bullet-measure-same": "actual and target must map different scenarios ('{{measure}}').",
|
|
178
|
+
"bullet-target-none": "No target scenario found (pl1/pp1/fc1); rendering actual bars only.",
|
|
179
|
+
"bullet-target-missing": "{{count}} row(s) without a target value; variance and marker omitted.",
|
|
180
|
+
"bullet-target-invalid": "{{count}} row(s) with target ≤ 0 cannot be normalized; bar omitted.",
|
|
181
|
+
"bullet-mixed-operation": "{{count}} KPI group(s) mix '+' and '-' rows; sentiment defaults to '+'.",
|
|
182
|
+
"bullet-ranges-ignored": 'ranges: ignored in normalized (IBCS) mode; set normalize="none".',
|
|
183
|
+
"bullet-ranges-invalid": "ranges: expected up to 2 ascending positive fractions of the target ({{detail}}).",
|
|
184
|
+
},
|
|
117
185
|
"bn-table": {
|
|
118
186
|
category: " ",
|
|
119
187
|
operation: " ",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive store for user-adjustable IBCS visualization rule sets.
|
|
3
|
+
*
|
|
4
|
+
* Rule sets are resolved through a three-layer merge:
|
|
5
|
+
* 1. `_system` -- built-in IBCS defaults (scenario names, color and sort indices)
|
|
6
|
+
* 2. `_default` -- optional user-level overrides applied globally
|
|
7
|
+
* 3. Named rule sets -- overrides referenced by the `ruleset` attribute
|
|
8
|
+
*
|
|
9
|
+
* The `withRuleSet` mixin merges these layers and the resulting config seeds
|
|
10
|
+
* `IBCSRuleSet`, which expands each scenario prefix to its 1-4 variants.
|
|
11
|
+
*
|
|
12
|
+
* @module stores/ruleSets
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Built-in IBCS rule-set defaults per IBCS notation standard v1.2.
|
|
16
|
+
* Sort order: PP(100s) < PL(200s) < FC(300s) < AC(400s); variance prefixes
|
|
17
|
+
* add +1000 (absolute) or +2000 (relative).
|
|
18
|
+
*/
|
|
19
|
+
export const SYSTEM_RULESET_DEFAULTS = {
|
|
20
|
+
scenarios: {
|
|
21
|
+
ac: { name: "AC", colorIndex: 10, sortIndex: 400 },
|
|
22
|
+
fc: { name: "FC", colorIndex: 30, sortIndex: 300 },
|
|
23
|
+
pl: { name: "PL", colorIndex: 50, sortIndex: 200 },
|
|
24
|
+
bu: { name: "BU", colorIndex: 50, sortIndex: 200 },
|
|
25
|
+
pp: { name: "PP", colorIndex: 20, sortIndex: 100 },
|
|
26
|
+
py: { name: "PY", colorIndex: 20, sortIndex: 100 },
|
|
27
|
+
dac: { name: "dAC", colorIndex: 10, sortIndex: 1400 },
|
|
28
|
+
dfc: { name: "dFC", colorIndex: 30, sortIndex: 1300 },
|
|
29
|
+
dpl: { name: "dPL", colorIndex: 50, sortIndex: 1200 },
|
|
30
|
+
dbu: { name: "dBU", colorIndex: 50, sortIndex: 1200 },
|
|
31
|
+
dpp: { name: "dPP", colorIndex: 20, sortIndex: 1100 },
|
|
32
|
+
dpy: { name: "dPY", colorIndex: 20, sortIndex: 1100 },
|
|
33
|
+
drac: { name: "drAC", colorIndex: 10, sortIndex: 2400 },
|
|
34
|
+
drfc: { name: "drFC", colorIndex: 30, sortIndex: 2300 },
|
|
35
|
+
drpl: { name: "drPL", colorIndex: 50, sortIndex: 2200 },
|
|
36
|
+
drbu: { name: "drBU", colorIndex: 50, sortIndex: 2200 },
|
|
37
|
+
drpp: { name: "drPP", colorIndex: 20, sortIndex: 2100 },
|
|
38
|
+
drpy: { name: "drPY", colorIndex: 20, sortIndex: 2100 },
|
|
39
|
+
},
|
|
40
|
+
fallback: {
|
|
41
|
+
name: "Series",
|
|
42
|
+
group: "Series",
|
|
43
|
+
colorIndex: 10,
|
|
44
|
+
sortIndex: 120,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -177,6 +177,11 @@ export var StackMode;
|
|
|
177
177
|
StackMode["RELATIVE"] = "relative";
|
|
178
178
|
StackMode["ABSOLUTE_RELATIVE"] = "absolute-relative";
|
|
179
179
|
})(StackMode || (StackMode = {}));
|
|
180
|
+
/**
|
|
181
|
+
* Value domain of a RELATIVE (100%) stack: the full stack spans 100 units,
|
|
182
|
+
* so pixelPerUnit is interpreted as pixels per percentage point.
|
|
183
|
+
*/
|
|
184
|
+
export const RELATIVE_STACK_UNITS = 100;
|
|
180
185
|
/** Sort order of segments within a stacked bar. DATASET preserves the original data order. */
|
|
181
186
|
export var StackOrder;
|
|
182
187
|
(function (StackOrder) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import alasql from "alasql";
|
|
2
1
|
import { SiPrefix } from "./model/SiPrefix";
|
|
3
2
|
/**
|
|
4
3
|
* SI prefix lookup table mapping prefix symbols to their numeric multipliers.
|
|
@@ -46,8 +45,8 @@ export class DataAnalyzer {
|
|
|
46
45
|
* are considered; variance columns are excluded.
|
|
47
46
|
* - `null` with data: defaults to GREATEST auto-detection
|
|
48
47
|
*/
|
|
49
|
-
static calculateMeasureScale(
|
|
50
|
-
var _a;
|
|
48
|
+
static calculateMeasureScale(db, fromExpr, scenarios, mode) {
|
|
49
|
+
var _a, _b;
|
|
51
50
|
if (mode === "_") {
|
|
52
51
|
return new SiPrefix();
|
|
53
52
|
}
|
|
@@ -56,7 +55,7 @@ export class DataAnalyzer {
|
|
|
56
55
|
return this.lookupPrefix(mode);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
if (scenarios.length === 0) {
|
|
58
|
+
if (scenarios.length === 0 || !fromExpr) {
|
|
60
59
|
return new SiPrefix();
|
|
61
60
|
}
|
|
62
61
|
// filtering wordlenght == 3, so variances are not considered
|
|
@@ -64,18 +63,25 @@ export class DataAnalyzer {
|
|
|
64
63
|
.filter((word) => word.length === 3)
|
|
65
64
|
.map((x) => "ABS(" + x + ")")
|
|
66
65
|
.toString()})) as prefixvalue
|
|
67
|
-
FROM
|
|
66
|
+
FROM ${fromExpr}`;
|
|
68
67
|
const queryMin = `SELECT MIN(LEAST(${scenarios
|
|
69
68
|
.filter((word) => word.length === 3)
|
|
70
69
|
.map((x) => "ABS(" + x + ")")
|
|
71
70
|
.toString()})) as prefixvalue
|
|
72
|
-
FROM
|
|
71
|
+
FROM ${fromExpr}`;
|
|
73
72
|
let query = queryMax;
|
|
74
73
|
if ((mode === null || mode === void 0 ? void 0 : mode.toUpperCase()) === "LEAST") {
|
|
75
74
|
query = queryMin;
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
let num;
|
|
77
|
+
try {
|
|
78
|
+
const result = db.exec(query);
|
|
79
|
+
num = (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.prefixvalue) !== null && _b !== void 0 ? _b : 0;
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
console.error("DataAnalyzer: measure-scale query failed", query, e);
|
|
83
|
+
return new SiPrefix();
|
|
84
|
+
}
|
|
79
85
|
return this.determinePrefix(Math.abs(num));
|
|
80
86
|
}
|
|
81
87
|
/** Maps an absolute numeric value to the best-fitting SI prefix based on digit count. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { merge } from "@corex/deepmerge";
|
|
2
|
+
import { SYSTEM_RULESET_DEFAULTS } from "../stores/ruleSets";
|
|
1
3
|
import { VarianceScenario } from "./model/VarianceScenario";
|
|
2
4
|
/**
|
|
3
5
|
* IBCS rule set defining scenario→style mappings per IBCS notation standard v1.2.
|
|
@@ -11,10 +13,13 @@ import { VarianceScenario } from "./model/VarianceScenario";
|
|
|
11
13
|
* Sort indices determine column display order: PP(100s) < PL(200s) < FC(300s) < AC(400s).
|
|
12
14
|
* Variance columns add +1000 (absolute) or +2000 (relative) to the base sort index.
|
|
13
15
|
* Within each group, variant number (1-4) adds multiples of 10.
|
|
16
|
+
*
|
|
17
|
+
* The built-in rules live in `SYSTEM_RULESET_DEFAULTS` (stores/ruleSets); an
|
|
18
|
+
* optional partial {@link RuleSetConfig} passed to the constructor is
|
|
19
|
+
* deep-merged over them, so `new IBCSRuleSet()` keeps the standard behavior.
|
|
14
20
|
*/
|
|
15
21
|
export class IBCSRuleSet {
|
|
16
|
-
constructor() {
|
|
17
|
-
// defines scenario sortIndex an colour PP, PL, FC, AC,
|
|
22
|
+
constructor(config) {
|
|
18
23
|
this._dateFormat = {
|
|
19
24
|
year: "YYYY",
|
|
20
25
|
quarter: "Q[Q] YYYY",
|
|
@@ -34,30 +39,13 @@ export class IBCSRuleSet {
|
|
|
34
39
|
none: "[DATE]",
|
|
35
40
|
};
|
|
36
41
|
this._scenarioMap = new Map();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
sortIndex:
|
|
42
|
-
};
|
|
43
|
-
this.
|
|
44
|
-
this.createScenarioMapEntry("fc", "FC", 30, 300);
|
|
45
|
-
this.createScenarioMapEntry("pl", "PL", 50, 200);
|
|
46
|
-
this.createScenarioMapEntry("bu", "BU", 50, 200);
|
|
47
|
-
this.createScenarioMapEntry("pp", "PP", 20, 100);
|
|
48
|
-
this.createScenarioMapEntry("py", "PY", 20, 100);
|
|
49
|
-
this.createScenarioMapEntry("dac", "dAC", 10, 1400);
|
|
50
|
-
this.createScenarioMapEntry("dfc", "dFC", 30, 1300);
|
|
51
|
-
this.createScenarioMapEntry("dpl", "dPL", 50, 1200);
|
|
52
|
-
this.createScenarioMapEntry("dbu", "dBU", 50, 1200);
|
|
53
|
-
this.createScenarioMapEntry("dpp", "dPP", 20, 1100);
|
|
54
|
-
this.createScenarioMapEntry("dpy", "dPY", 20, 1100);
|
|
55
|
-
this.createScenarioMapEntry("drac", "drAC", 10, 2400);
|
|
56
|
-
this.createScenarioMapEntry("drfc", "drFC", 30, 2300);
|
|
57
|
-
this.createScenarioMapEntry("drpl", "drPL", 50, 2200);
|
|
58
|
-
this.createScenarioMapEntry("drbu", "drBU", 50, 2200);
|
|
59
|
-
this.createScenarioMapEntry("drpp", "drPP", 20, 2100);
|
|
60
|
-
this.createScenarioMapEntry("drpy", "drPY", 20, 2100);
|
|
42
|
+
// defines scenario sortIndex an colour PP, PL, FC, AC,
|
|
43
|
+
const effective = merge([SYSTEM_RULESET_DEFAULTS, config !== null && config !== void 0 ? config : {}]);
|
|
44
|
+
Object.entries(effective.scenarios).forEach(([key, scenario]) => {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
this.createScenarioMapEntry(key, (_a = scenario.name) !== null && _a !== void 0 ? _a : key, (_b = scenario.colorIndex) !== null && _b !== void 0 ? _b : 10, (_c = scenario.sortIndex) !== null && _c !== void 0 ? _c : 0);
|
|
47
|
+
});
|
|
48
|
+
this._fallBackScenario = effective.fallback;
|
|
61
49
|
}
|
|
62
50
|
createScenarioMapEntry(key, name, colorIndex, sortIndex) {
|
|
63
51
|
const range = [1, 2, 3, 4];
|