@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
|
@@ -3,13 +3,16 @@ import { isBlankInput, isValidAxisLabelsMode, isValidBoolean, isValidDateFormat,
|
|
|
3
3
|
import withDataset from "../../utils/withDataset";
|
|
4
4
|
import withComponentStatus from "../../utils/withComponentStatus";
|
|
5
5
|
import withTranslation from "../../utils/withTranslation";
|
|
6
|
+
import withScalingGroup from "../../utils/withScalingGroup";
|
|
6
7
|
import { globalLabelKeys } from "../../stores/internationalization";
|
|
7
8
|
import { withStyled } from "../../utils/styled/withStyled";
|
|
8
9
|
import withComponentStyle from "../../utils/withComponentStyle";
|
|
10
|
+
import withRuleSet from "../../utils/withRuleSet";
|
|
9
11
|
import withHasError from "../../utils/withHasError";
|
|
10
12
|
import withInheritedProps, { isInheritedValue } from "../../utils/withInheritedProps";
|
|
11
13
|
import { getParentDimensions } from "../../utils/parentDimensions";
|
|
12
14
|
import { parseScaling } from "../../utils/scaling";
|
|
15
|
+
import { observeParentResize } from "../../utils/layoutObserver";
|
|
13
16
|
import { OrderColumn, OrderDirection } from "../../utils/model/Order";
|
|
14
17
|
import { Formatter } from "../../utils/formatter";
|
|
15
18
|
import { AxisLabelsMode, ChartMode, StackBy, StackMode, StackOrder } from "../../utils/constants";
|
|
@@ -112,7 +115,8 @@ export class Chart {
|
|
|
112
115
|
}
|
|
113
116
|
validatePercentageScaling(newValue) {
|
|
114
117
|
const errId = "ERR_percentageScaling";
|
|
115
|
-
|
|
118
|
+
const isAuto = (newValue === null || newValue === void 0 ? void 0 : newValue.toString().trim().toLowerCase()) === "auto";
|
|
119
|
+
if (!isAuto && !isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
116
120
|
this.errors.addOrReplace({
|
|
117
121
|
id: errId,
|
|
118
122
|
type: "warning",
|
|
@@ -336,9 +340,13 @@ export class Chart {
|
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
342
|
constructor() {
|
|
339
|
-
|
|
343
|
+
/** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
|
|
344
|
+
this.datasetName = "";
|
|
345
|
+
/** Bumped on every data update so Stencil re-renders even when the name is unchanged. */
|
|
346
|
+
this.dataVersion = 0;
|
|
340
347
|
this.datasetMeta = null;
|
|
341
348
|
this.appliedScaleFactor = 1;
|
|
349
|
+
this.layoutObserver = null;
|
|
342
350
|
/**
|
|
343
351
|
* Custom chart title
|
|
344
352
|
*/
|
|
@@ -394,7 +402,9 @@ export class Chart {
|
|
|
394
402
|
* scenario by this data dimension. Must be finer than `level`.
|
|
395
403
|
* - `mode` (optional, default `"absolute"`):
|
|
396
404
|
* - `"absolute"` — additive stacking, axis shows absolute units.
|
|
397
|
-
* - `"relative"` — 100% stacking, axis shows 0%–100%.
|
|
405
|
+
* - `"relative"` — 100% stacking, axis shows 0%–100%. `unit-scaling` is
|
|
406
|
+
* interpreted as pixels per percentage point (e.g. `0.4` → 40px full
|
|
407
|
+
* stack); `"auto"` fits the stack to the available height as usual.
|
|
398
408
|
* - `"absolute-relative"` — bar height is absolute (real value), but
|
|
399
409
|
* segment labels inside show percentages.
|
|
400
410
|
* - `order` (optional, default `"dataset"`): Segment order within each stack.
|
|
@@ -475,16 +485,22 @@ export class Chart {
|
|
|
475
485
|
this.measureUnit = "";
|
|
476
486
|
this.pixelPerUnitGroupMap = new Map();
|
|
477
487
|
this._autoScaleGuard = false;
|
|
488
|
+
this._lastObservedWidth = 0;
|
|
489
|
+
this._settleTimer = null;
|
|
490
|
+
this._lastAppliedHeight = 0;
|
|
478
491
|
withStyled(this);
|
|
479
492
|
withComponentStatus(this);
|
|
480
|
-
withDataset(this, (
|
|
481
|
-
this.
|
|
493
|
+
withDataset(this, (name, _data) => {
|
|
494
|
+
this.datasetName = (name === null || name === void 0 ? void 0 : name.startsWith("$")) ? name.substring(1) : name || "";
|
|
495
|
+
this.dataVersion = this.dataVersion + 1;
|
|
482
496
|
}, (_name, meta) => {
|
|
483
497
|
this.datasetMeta = meta;
|
|
484
498
|
});
|
|
485
499
|
this.chartTemplate = this.chartTemplate.bind(this);
|
|
486
500
|
this.errors = withHasError(this);
|
|
501
|
+
withScalingGroup(this);
|
|
487
502
|
this.componentStyle = withComponentStyle(this);
|
|
503
|
+
this.ruleSetConfig = withRuleSet(this);
|
|
488
504
|
this.t = withTranslation(this).t;
|
|
489
505
|
this.resolveInherited = withInheritedProps(this, [
|
|
490
506
|
{ propName: "scenarios", ancestorAttr: "title-scenarios" },
|
|
@@ -517,11 +533,9 @@ export class Chart {
|
|
|
517
533
|
this.validateScaling(this.scale);
|
|
518
534
|
}
|
|
519
535
|
componentDidRender() {
|
|
520
|
-
var _a, _b;
|
|
521
536
|
const { mode } = parseScaling(this.scale);
|
|
522
537
|
if (mode !== "auto" && mode !== "empty") {
|
|
523
538
|
this._autoScaleGuard = false;
|
|
524
|
-
// Keep existing width-based overflow warning for non-auto modes
|
|
525
539
|
const parent = getParentDimensions(this.element);
|
|
526
540
|
const errId = "WARN_overflow";
|
|
527
541
|
if (parent.width > 0 && this.element.scrollWidth > parent.width + 1) {
|
|
@@ -544,23 +558,25 @@ export class Chart {
|
|
|
544
558
|
const { width: parentWidth } = getParentDimensions(host);
|
|
545
559
|
if (parentWidth <= 0)
|
|
546
560
|
return;
|
|
547
|
-
//
|
|
561
|
+
// Keep observer tracking in sync so the observer callback does not
|
|
562
|
+
// trigger spurious forceUpdate calls with stale threshold values.
|
|
563
|
+
this._lastObservedWidth = parentWidth;
|
|
548
564
|
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
549
|
-
host.
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
if (
|
|
565
|
+
const currentWidth = host.scrollWidth;
|
|
566
|
+
const currentFactor = this.appliedScaleFactor;
|
|
567
|
+
// Content fits at current factor — done. Don't reset to factor 1;
|
|
568
|
+
// the content only fits BECAUSE of the current factor.
|
|
569
|
+
if (currentWidth <= parentWidth + 1) {
|
|
554
570
|
this.errors.remove("AUTO_scale");
|
|
555
|
-
if (this.appliedScaleFactor !== 1) {
|
|
556
|
-
this._autoScaleGuard = true;
|
|
557
|
-
writeTask(() => {
|
|
558
|
-
this.appliedScaleFactor = 1;
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
571
|
return;
|
|
562
572
|
}
|
|
563
|
-
|
|
573
|
+
// Content overflows. Compute a new factor based on the ratio of
|
|
574
|
+
// parent to current content width, scaled by the current factor.
|
|
575
|
+
const computedFactor = Math.max(0.3, (currentFactor * (parentWidth - 1)) / currentWidth);
|
|
576
|
+
// Only apply if the change is significant (> 1% of current factor).
|
|
577
|
+
if (Math.abs(computedFactor - currentFactor) < 0.01) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
564
580
|
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
565
581
|
if (mode === "empty") {
|
|
566
582
|
this.errors.addOrReplace({
|
|
@@ -572,25 +588,75 @@ export class Chart {
|
|
|
572
588
|
else {
|
|
573
589
|
this.errors.remove("AUTO_scale");
|
|
574
590
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
});
|
|
580
|
-
}
|
|
591
|
+
this._autoScaleGuard = true;
|
|
592
|
+
writeTask(() => {
|
|
593
|
+
this.appliedScaleFactor = computedFactor;
|
|
594
|
+
});
|
|
581
595
|
}
|
|
582
596
|
componentDidLoad() {
|
|
583
|
-
//
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
597
|
+
// Watch for size changes (window resize, card relayout).
|
|
598
|
+
this.layoutObserver = observeParentResize(this.element, () => {
|
|
599
|
+
if (this._autoScaleGuard)
|
|
600
|
+
return;
|
|
601
|
+
const { width } = getParentDimensions(this.element);
|
|
602
|
+
// Only react to WIDTH changes — this chart scales by width.
|
|
603
|
+
// Height changes (e.g. from page-fit-to-content auto grid rows)
|
|
604
|
+
// are irrelevant and would cause an infinite render loop.
|
|
605
|
+
if (width > 0 && Math.abs(width - this._lastObservedWidth) > 2) {
|
|
606
|
+
this._lastObservedWidth = width;
|
|
607
|
+
forceUpdate(this);
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
// Double-rAF: guarantees the browser completed at least one full
|
|
611
|
+
// paint cycle so all nested card/body/grid layouts are finalized.
|
|
612
|
+
requestAnimationFrame(() => {
|
|
588
613
|
requestAnimationFrame(() => {
|
|
614
|
+
if (this._autoScaleGuard)
|
|
615
|
+
return;
|
|
589
616
|
const { width } = getParentDimensions(this.element);
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
617
|
+
this._lastObservedWidth = width;
|
|
618
|
+
forceUpdate(this);
|
|
593
619
|
});
|
|
620
|
+
});
|
|
621
|
+
this.settleParentHeight();
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The initial renders can measure mid-hydration, before ancestor CSS
|
|
625
|
+
* (fixed page height, overflow) is applied, so the height used for
|
|
626
|
+
* auto-fit may be a transient value — and the resize observer above
|
|
627
|
+
* deliberately ignores height changes. Re-measure on a short backoff
|
|
628
|
+
* schedule and re-render when the measurement no longer matches the
|
|
629
|
+
* height the last render actually used (_lastAppliedHeight, recorded
|
|
630
|
+
* in prepareDimension). The schedule is finite, so this cannot feed a
|
|
631
|
+
* render loop.
|
|
632
|
+
*/
|
|
633
|
+
settleParentHeight() {
|
|
634
|
+
const delays = [150, 400, 1000, 2500];
|
|
635
|
+
const check = () => {
|
|
636
|
+
this._settleTimer = null;
|
|
637
|
+
if (!this.element.isConnected)
|
|
638
|
+
return;
|
|
639
|
+
const { height } = getParentDimensions(this.element);
|
|
640
|
+
// 8px threshold: hydration corrections are large (hundreds of px);
|
|
641
|
+
// small jitter must not cause re-renders, because every re-render
|
|
642
|
+
// gives the width-overflow font scaler a chance to ratchet down.
|
|
643
|
+
if (height > 0 && Math.abs(height - this._lastAppliedHeight) > 8 && !this._autoScaleGuard) {
|
|
644
|
+
forceUpdate(this);
|
|
645
|
+
}
|
|
646
|
+
const next = delays.shift();
|
|
647
|
+
if (next !== undefined) {
|
|
648
|
+
this._settleTimer = setTimeout(check, next);
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
this._settleTimer = setTimeout(check, delays.shift());
|
|
652
|
+
}
|
|
653
|
+
disconnectedCallback() {
|
|
654
|
+
var _a;
|
|
655
|
+
(_a = this.layoutObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
656
|
+
this.layoutObserver = null;
|
|
657
|
+
if (this._settleTimer != null) {
|
|
658
|
+
clearTimeout(this._settleTimer);
|
|
659
|
+
this._settleTimer = null;
|
|
594
660
|
}
|
|
595
661
|
}
|
|
596
662
|
prepareDimension() {
|
|
@@ -598,6 +664,7 @@ export class Chart {
|
|
|
598
664
|
const scenariosList = this.prepareScenarios();
|
|
599
665
|
const variancesList = this.prepareVariances();
|
|
600
666
|
this.canvasWidthSegmented = parent.width / (scenariosList.length + variancesList.length || 1);
|
|
667
|
+
this._lastAppliedHeight = parent.height;
|
|
601
668
|
return { width: this.canvasWidthSegmented, height: parent.height };
|
|
602
669
|
}
|
|
603
670
|
prepareScenarios() {
|
|
@@ -679,10 +746,25 @@ export class Chart {
|
|
|
679
746
|
return 0;
|
|
680
747
|
}
|
|
681
748
|
preparePixelPerPercentage() {
|
|
749
|
+
var _a;
|
|
682
750
|
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
683
751
|
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
684
752
|
}
|
|
685
|
-
|
|
753
|
+
if (((_a = this.percentageScaling) === null || _a === void 0 ? void 0 : _a.toString().trim().toLowerCase()) === "auto") {
|
|
754
|
+
this.errors.remove("AUTO_percentageScaling");
|
|
755
|
+
return 0;
|
|
756
|
+
}
|
|
757
|
+
const numeric = Number(this.percentageScaling);
|
|
758
|
+
if (!isNaN(numeric) && numeric > 0) {
|
|
759
|
+
this.errors.remove("AUTO_percentageScaling");
|
|
760
|
+
return numeric * 100;
|
|
761
|
+
}
|
|
762
|
+
this.errors.addOrReplace({
|
|
763
|
+
id: "AUTO_percentageScaling",
|
|
764
|
+
type: "warning",
|
|
765
|
+
message: `percentage-scaling: not set, auto-calculated to fit available space.`,
|
|
766
|
+
});
|
|
767
|
+
return 0;
|
|
686
768
|
}
|
|
687
769
|
prepareLevel() {
|
|
688
770
|
var _a, _b, _c;
|
|
@@ -956,7 +1038,7 @@ export class Chart {
|
|
|
956
1038
|
const stackConfig = this.prepareStackConfig();
|
|
957
1039
|
const scenarios = this.prepareScenarios();
|
|
958
1040
|
const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
959
|
-
return (h("ibcs-chart-time", {
|
|
1041
|
+
return (h("ibcs-chart-time", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, order: this.prepareOrder(), level: this.prepareLevel(), dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
|
|
960
1042
|
}
|
|
961
1043
|
getEffectiveScaleFactor() {
|
|
962
1044
|
const { mode, factor } = parseScaling(this.scale);
|
|
@@ -986,7 +1068,7 @@ export class Chart {
|
|
|
986
1068
|
scenariosArray = [...scenariosArray, ...variancesArray];
|
|
987
1069
|
}
|
|
988
1070
|
const fontStyles = this.getFontStyles();
|
|
989
|
-
return (h(Host, { key: '
|
|
1071
|
+
return (h(Host, { key: 'df8b91008f6f0d178bd3df91eb99a338f1734f27', style: fontStyles }, h("div", { key: '094f47f7f698b8cd87096066ae608b67c1258d71', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
990
1072
|
}
|
|
991
1073
|
static get is() { return "bn-chart-time"; }
|
|
992
1074
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1002,6 +1084,25 @@ export class Chart {
|
|
|
1002
1084
|
}
|
|
1003
1085
|
static get properties() {
|
|
1004
1086
|
return {
|
|
1087
|
+
"ruleset": {
|
|
1088
|
+
"type": "string",
|
|
1089
|
+
"mutable": false,
|
|
1090
|
+
"complexType": {
|
|
1091
|
+
"original": "string",
|
|
1092
|
+
"resolved": "string",
|
|
1093
|
+
"references": {}
|
|
1094
|
+
},
|
|
1095
|
+
"required": false,
|
|
1096
|
+
"optional": true,
|
|
1097
|
+
"docs": {
|
|
1098
|
+
"tags": [],
|
|
1099
|
+
"text": "Name of a registered IBCS rule set (see `bn-ruleset`) used for scenario\nordering. Supports `\"inherited-closest\"` / `\"inherited-page\"` to take\nover the value from an ancestor `bn-layout-card` / `bn-layout-page`."
|
|
1100
|
+
},
|
|
1101
|
+
"getter": false,
|
|
1102
|
+
"setter": false,
|
|
1103
|
+
"reflect": true,
|
|
1104
|
+
"attribute": "ruleset"
|
|
1105
|
+
},
|
|
1005
1106
|
"chartTitle": {
|
|
1006
1107
|
"type": "string",
|
|
1007
1108
|
"mutable": false,
|
|
@@ -1131,8 +1232,17 @@ export class Chart {
|
|
|
1131
1232
|
"required": true,
|
|
1132
1233
|
"optional": false,
|
|
1133
1234
|
"docs": {
|
|
1134
|
-
"tags": [
|
|
1135
|
-
|
|
1235
|
+
"tags": [{
|
|
1236
|
+
"name": "example",
|
|
1237
|
+
"text": "unit-scaling=\"auto\""
|
|
1238
|
+
}, {
|
|
1239
|
+
"name": "example",
|
|
1240
|
+
"text": "unit-scaling=\"0.05\""
|
|
1241
|
+
}, {
|
|
1242
|
+
"name": "example",
|
|
1243
|
+
"text": "unit-scaling=\"revenue-scale\""
|
|
1244
|
+
}],
|
|
1245
|
+
"text": "Controls vertical bar scaling (pixels per data unit).\n\n| Value | Behavior |\n|----------------|-----------------------------------------------------------------|\n| `\"auto\"` | Auto-fit bars to fill the available container height |\n| not set / `\"\"` | Same as auto, but emits `AUTO_unitScaling` warning |\n| `\"0.03\"`, `1` | Explicit pixels-per-unit value; bars scale proportionally |\n| group name | References a `<bn-scaling-group>` for synchronized scaling |"
|
|
1136
1246
|
},
|
|
1137
1247
|
"getter": false,
|
|
1138
1248
|
"setter": false,
|
|
@@ -1150,8 +1260,14 @@ export class Chart {
|
|
|
1150
1260
|
"required": true,
|
|
1151
1261
|
"optional": false,
|
|
1152
1262
|
"docs": {
|
|
1153
|
-
"tags": [
|
|
1154
|
-
|
|
1263
|
+
"tags": [{
|
|
1264
|
+
"name": "example",
|
|
1265
|
+
"text": "percentage-scaling=\"50\""
|
|
1266
|
+
}, {
|
|
1267
|
+
"name": "example",
|
|
1268
|
+
"text": "percentage-scaling=\"pct-scale\""
|
|
1269
|
+
}],
|
|
1270
|
+
"text": "Pixels per percentage point for relative variance bars/pins.\n\n| Value | Behavior |\n|----------------|---------------------------------------------------------------|\n| `\"auto\"` | Auto-fit to available height (same two-pass as unit-scaling) |\n| not set / `\"\"` | Same as auto with `AUTO_percentageScaling` warning |\n| `\"50\"`, `1.5` | Explicit pixels-per-percentage-point value |\n| group name | References a `<bn-scaling-group>` for synchronized scaling |"
|
|
1155
1271
|
},
|
|
1156
1272
|
"getter": false,
|
|
1157
1273
|
"setter": false,
|
|
@@ -1295,7 +1411,7 @@ export class Chart {
|
|
|
1295
1411
|
"name": "example",
|
|
1296
1412
|
"text": "// Stack by category, relative mode\nstack='{\"by\":\"category\",\"mode\":\"relative\"}'"
|
|
1297
1413
|
}],
|
|
1298
|
-
"text": "Stacking configuration for the chart as a JSON string.\n\nWhen set, bars/columns are drawn stacked (additive layers) instead of\nside-by-side. In line mode (`chart-mode=\"line\"`), stacking produces a\nstacked area chart with filled regions between cumulative lines.\n\n**JSON schema:**\n```json\n{\n \"by\": \"scenario\" | \"category\" | \"subcategory\" | \"rowgroup\",\n \"mode\": \"absolute\" | \"relative\" | \"absolute-relative\",\n \"order\": \"asc\" | \"desc\" | \"dataset\"\n}\n```\n\n- `by` (required): The dimension to stack.\n - `\"scenario\"` \u2014 stack the scenarios from the `scenarios` prop as layers.\n - `\"category\"` / `\"subcategory\"` / `\"rowgroup\"` \u2014 decompose a single\n scenario by this data dimension. Must be finer than `level`.\n- `mode` (optional, default `\"absolute\"`):\n - `\"absolute\"` \u2014 additive stacking, axis shows absolute units.\n - `\"relative\"` \u2014 100% stacking, axis shows 0%\u2013100
|
|
1414
|
+
"text": "Stacking configuration for the chart as a JSON string.\n\nWhen set, bars/columns are drawn stacked (additive layers) instead of\nside-by-side. In line mode (`chart-mode=\"line\"`), stacking produces a\nstacked area chart with filled regions between cumulative lines.\n\n**JSON schema:**\n```json\n{\n \"by\": \"scenario\" | \"category\" | \"subcategory\" | \"rowgroup\",\n \"mode\": \"absolute\" | \"relative\" | \"absolute-relative\",\n \"order\": \"asc\" | \"desc\" | \"dataset\"\n}\n```\n\n- `by` (required): The dimension to stack.\n - `\"scenario\"` \u2014 stack the scenarios from the `scenarios` prop as layers.\n - `\"category\"` / `\"subcategory\"` / `\"rowgroup\"` \u2014 decompose a single\n scenario by this data dimension. Must be finer than `level`.\n- `mode` (optional, default `\"absolute\"`):\n - `\"absolute\"` \u2014 additive stacking, axis shows absolute units.\n - `\"relative\"` \u2014 100% stacking, axis shows 0%\u2013100%. `unit-scaling` is\n interpreted as pixels per percentage point (e.g. `0.4` \u2192 40px full\n stack); `\"auto\"` fits the stack to the available height as usual.\n - `\"absolute-relative\"` \u2014 bar height is absolute (real value), but\n segment labels inside show percentages.\n- `order` (optional, default `\"dataset\"`): Segment order within each stack.\n `\"asc\"` / `\"desc\"` sort segments by value; `\"dataset\"` preserves the\n original data/scenario order."
|
|
1299
1415
|
},
|
|
1300
1416
|
"getter": false,
|
|
1301
1417
|
"setter": false,
|
|
@@ -1505,7 +1621,8 @@ export class Chart {
|
|
|
1505
1621
|
}
|
|
1506
1622
|
static get states() {
|
|
1507
1623
|
return {
|
|
1508
|
-
"
|
|
1624
|
+
"datasetName": {},
|
|
1625
|
+
"dataVersion": {},
|
|
1509
1626
|
"datasetMeta": {},
|
|
1510
1627
|
"appliedScaleFactor": {}
|
|
1511
1628
|
};
|
|
@@ -3,6 +3,8 @@ import { TimeChart } from "./utils/TimeChart";
|
|
|
3
3
|
import { CustomPattern } from "./utils/helper";
|
|
4
4
|
import { TimeChartComponentConfigAdapter, } from "./utils/model/TimeChartComponentConfig";
|
|
5
5
|
import { TimeChartDataRowAdapter } from "./utils/model/TimeChartDataRow";
|
|
6
|
+
import { getStores } from "../../context/context-protocol";
|
|
7
|
+
import { buildFromExpr } from "../../context/scopedDb";
|
|
6
8
|
import { TimeChartStylesAdapter } from "./utils/model/styles/TimeChartStyle";
|
|
7
9
|
import { ScaleFactorsTimeChartAdapter } from "./utils/model/styles/ScaleFactorsTimeChart";
|
|
8
10
|
import { DateDistance } from "../../utils/DateStringFactory";
|
|
@@ -18,8 +20,10 @@ import { SVGStyleGroupAdapter } from "../../utils/model/styles/SVGStyleGroup";
|
|
|
18
20
|
import { SVGVariancesStyleGroupAdapter } from "../../utils/model/styles/SVGVariancesStyleGroup";
|
|
19
21
|
export class IbcsChartTime {
|
|
20
22
|
constructor() {
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
+
/** Name of the dataset (table or view in the shared alasql database). */
|
|
24
|
+
this.tableName = "";
|
|
25
|
+
/** Bumped by `bn-chart-time` when the dataset changes; triggers re-render. */
|
|
26
|
+
this.dataVersion = 0;
|
|
23
27
|
this.scenarios = [];
|
|
24
28
|
this.variances = []; //["dfc_ac_neg"]
|
|
25
29
|
this.hideAxisLabels = false; //false
|
|
@@ -50,6 +54,11 @@ export class IbcsChartTime {
|
|
|
50
54
|
this.dataFormatDigits = { percent: 2, decimal: 1 };
|
|
51
55
|
this.parentDimensions = { width: 0, height: 0 };
|
|
52
56
|
}
|
|
57
|
+
getDb() {
|
|
58
|
+
if (!this.stores)
|
|
59
|
+
this.stores = getStores(this.element);
|
|
60
|
+
return this.stores.db.db;
|
|
61
|
+
}
|
|
53
62
|
render() {
|
|
54
63
|
var _a, _b, _c;
|
|
55
64
|
if (this.chart === undefined) {
|
|
@@ -66,7 +75,7 @@ export class IbcsChartTime {
|
|
|
66
75
|
const config = this.prepareConfig();
|
|
67
76
|
const styles = this.prepareStyle();
|
|
68
77
|
const availableWidth = this.containerWidth || 0;
|
|
69
|
-
this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
|
|
78
|
+
this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
|
|
70
79
|
this.chart.setI18n(this.i18n);
|
|
71
80
|
this.autoFitScaling(config, styles);
|
|
72
81
|
this.chart.setAvailableHeight(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
@@ -83,6 +92,7 @@ export class IbcsChartTime {
|
|
|
83
92
|
this.chart.setI18n(this.i18n);
|
|
84
93
|
this.chart.setStyles(styles);
|
|
85
94
|
this.chart.setAvailableWidth(this.containerWidth || 0);
|
|
95
|
+
this.chart.setRuleSet(new IBCSRuleSet(this.ruleSetConfig));
|
|
86
96
|
this.chart.setConfig(config);
|
|
87
97
|
this.autoFitScaling(config, styles);
|
|
88
98
|
this.chart.setAvailableHeight(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
@@ -90,26 +100,35 @@ export class IbcsChartTime {
|
|
|
90
100
|
this.chart.setPattern("fc", this.pattern.getFCPolygonPattern());
|
|
91
101
|
}
|
|
92
102
|
/**
|
|
93
|
-
* Two-pass auto-fit
|
|
94
|
-
*
|
|
95
|
-
*
|
|
103
|
+
* Two-pass auto-fit for pixelPerUnit and/or pixelPerPercentage.
|
|
104
|
+
* When either is 0 (auto mode), renders a measurement pass at 1,
|
|
105
|
+
* computes the ratio to fit ~90% of the available height, and rebuilds.
|
|
106
|
+
* Explicit (> 0) values are never overridden.
|
|
96
107
|
*/
|
|
97
108
|
autoFitScaling(config, styles) {
|
|
98
109
|
var _a;
|
|
99
|
-
|
|
100
|
-
|
|
110
|
+
const autoUnit = config.pixelPerUnit <= 0;
|
|
111
|
+
const autoPercent = config.pixelPerPercentage <= 0;
|
|
112
|
+
if (!autoUnit && !autoPercent) {
|
|
113
|
+
return; // Both explicit — nothing to auto-fit
|
|
101
114
|
}
|
|
102
115
|
const targetHeight = (_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height;
|
|
103
116
|
const availableWidth = this.containerWidth || 0;
|
|
104
117
|
if (!targetHeight || targetHeight <= 0) {
|
|
105
|
-
|
|
106
|
-
|
|
118
|
+
if (autoUnit)
|
|
119
|
+
config.pixelPerUnit = 1;
|
|
120
|
+
if (autoPercent)
|
|
121
|
+
config.pixelPerPercentage = 50;
|
|
122
|
+
this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
|
|
107
123
|
this.chart.setI18n(this.i18n);
|
|
108
124
|
return;
|
|
109
125
|
}
|
|
110
|
-
// First pass
|
|
111
|
-
|
|
112
|
-
|
|
126
|
+
// First pass: set auto values to 1 and measure SVG height
|
|
127
|
+
if (autoUnit)
|
|
128
|
+
config.pixelPerUnit = 1;
|
|
129
|
+
if (autoPercent)
|
|
130
|
+
config.pixelPerPercentage = 1;
|
|
131
|
+
this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
|
|
113
132
|
this.chart.setI18n(this.i18n);
|
|
114
133
|
this.chart.toString();
|
|
115
134
|
const svgHeight = this.chart.getAllocatedCanvasHeight();
|
|
@@ -117,9 +136,13 @@ export class IbcsChartTime {
|
|
|
117
136
|
return;
|
|
118
137
|
}
|
|
119
138
|
// Scale so the chart fits in ~90% of the available height
|
|
120
|
-
|
|
139
|
+
const ratio = (targetHeight * 0.9) / svgHeight;
|
|
140
|
+
if (autoUnit)
|
|
141
|
+
config.pixelPerUnit = ratio;
|
|
142
|
+
if (autoPercent)
|
|
143
|
+
config.pixelPerPercentage = ratio;
|
|
121
144
|
// Second pass with the corrected scaling
|
|
122
|
-
this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
|
|
145
|
+
this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
|
|
123
146
|
this.chart.setI18n(this.i18n);
|
|
124
147
|
}
|
|
125
148
|
async componentWillRender() {
|
|
@@ -143,8 +166,9 @@ export class IbcsChartTime {
|
|
|
143
166
|
//}
|
|
144
167
|
}
|
|
145
168
|
prepareConfig() {
|
|
146
|
-
|
|
147
|
-
|
|
169
|
+
const db = this.getDb();
|
|
170
|
+
const fromExpr = this.tableName ? buildFromExpr(this.tableName, this.filter) : "";
|
|
171
|
+
return new TimeChartComponentConfigAdapter(new TimeChartDataRowAdapter(), new OrderAdapter(new StringAdapter()), new StringAdapter(), new DataFormatDigitsAdapter(), db, fromExpr).adapt({
|
|
148
172
|
scenarios: this.scenarios,
|
|
149
173
|
variances: this.variances,
|
|
150
174
|
title: this.chartTitle,
|
|
@@ -188,30 +212,45 @@ export class IbcsChartTime {
|
|
|
188
212
|
}
|
|
189
213
|
static get properties() {
|
|
190
214
|
return {
|
|
191
|
-
"
|
|
192
|
-
"type": "
|
|
215
|
+
"tableName": {
|
|
216
|
+
"type": "string",
|
|
193
217
|
"mutable": false,
|
|
194
218
|
"complexType": {
|
|
195
|
-
"original": "
|
|
196
|
-
"resolved": "
|
|
197
|
-
"references": {
|
|
198
|
-
"TimeChartDataRow": {
|
|
199
|
-
"location": "import",
|
|
200
|
-
"path": "./utils/model/TimeChartDataRow",
|
|
201
|
-
"id": "src/components/bn-chart-time/utils/model/TimeChartDataRow.ts::TimeChartDataRow",
|
|
202
|
-
"referenceLocation": "TimeChartDataRow"
|
|
203
|
-
}
|
|
204
|
-
}
|
|
219
|
+
"original": "string",
|
|
220
|
+
"resolved": "string",
|
|
221
|
+
"references": {}
|
|
205
222
|
},
|
|
206
223
|
"required": false,
|
|
207
224
|
"optional": false,
|
|
208
225
|
"docs": {
|
|
209
226
|
"tags": [],
|
|
210
|
-
"text": ""
|
|
227
|
+
"text": "Name of the dataset (table or view in the shared alasql database)."
|
|
211
228
|
},
|
|
212
229
|
"getter": false,
|
|
213
230
|
"setter": false,
|
|
214
|
-
"
|
|
231
|
+
"reflect": false,
|
|
232
|
+
"attribute": "table-name",
|
|
233
|
+
"defaultValue": "\"\""
|
|
234
|
+
},
|
|
235
|
+
"dataVersion": {
|
|
236
|
+
"type": "number",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "number",
|
|
240
|
+
"resolved": "number",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Bumped by `bn-chart-time` when the dataset changes; triggers re-render."
|
|
248
|
+
},
|
|
249
|
+
"getter": false,
|
|
250
|
+
"setter": false,
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"attribute": "data-version",
|
|
253
|
+
"defaultValue": "0"
|
|
215
254
|
},
|
|
216
255
|
"chartTitle": {
|
|
217
256
|
"type": "string",
|
|
@@ -822,6 +861,30 @@ export class IbcsChartTime {
|
|
|
822
861
|
"getter": false,
|
|
823
862
|
"setter": false,
|
|
824
863
|
"defaultValue": "{ width: 0, height: 0 }"
|
|
864
|
+
},
|
|
865
|
+
"ruleSetConfig": {
|
|
866
|
+
"type": "unknown",
|
|
867
|
+
"mutable": false,
|
|
868
|
+
"complexType": {
|
|
869
|
+
"original": "RuleSetConfig",
|
|
870
|
+
"resolved": "RuleSetConfig",
|
|
871
|
+
"references": {
|
|
872
|
+
"RuleSetConfig": {
|
|
873
|
+
"location": "import",
|
|
874
|
+
"path": "../../stores/ruleSets",
|
|
875
|
+
"id": "src/stores/ruleSets.ts::RuleSetConfig",
|
|
876
|
+
"referenceLocation": "RuleSetConfig"
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
"required": false,
|
|
881
|
+
"optional": true,
|
|
882
|
+
"docs": {
|
|
883
|
+
"tags": [],
|
|
884
|
+
"text": ""
|
|
885
|
+
},
|
|
886
|
+
"getter": false,
|
|
887
|
+
"setter": false
|
|
825
888
|
}
|
|
826
889
|
};
|
|
827
890
|
}
|