@bino-bi/bn-template-engine 1.0.0-alpha.8 → 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 +9 -3
- 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 +127 -41
- 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 +162 -42
- 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/bn-tree/bn-tree.js +5 -1
- 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 +9 -3
- 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-0d41c5d8.entry.js +0 -1
- package/dist/bn-template-engine/p-67538176.entry.js +0 -1
- package/dist/bn-template-engine/p-825a07a8.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-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 -23541
- 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 -23520
- 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
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { F as Formatter } from './SVGStyle-BxEDw9zh.js';
|
|
2
|
+
import './VarianceMeasure-DnwNKspZ.js';
|
|
3
|
+
|
|
4
|
+
/** SI metric prefix for number scaling (e.g. prefix="M", value=1000000 divides displayed values by one million). */
|
|
5
|
+
class SiPrefix {
|
|
6
|
+
constructor(prefix = "", value = 1) {
|
|
7
|
+
this.prefix = prefix;
|
|
8
|
+
this.value = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Default fill colors cycled through for stacked chart segments. */
|
|
13
|
+
/**
|
|
14
|
+
* IBCS rendering order: back-to-front (PL behind FC behind PP behind AC).
|
|
15
|
+
* Used to ensure correct visual layering when scenarios overlap.
|
|
16
|
+
*/
|
|
17
|
+
const IBCS_LAYER_ORDER = ["pl", "fc", "pp", "ac"];
|
|
18
|
+
/** Strips the trailing numeric suffix from a scenario key (e.g. "ac1" -> "ac"). */
|
|
19
|
+
function getScenarioPrefix(scenario) {
|
|
20
|
+
return scenario.replace(/\d+$/, "");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns black or white text color for readable contrast against the given
|
|
24
|
+
* hex background, using the W3C relative luminance formula.
|
|
25
|
+
*/
|
|
26
|
+
function getContrastTextColor(hexFill) {
|
|
27
|
+
const r = parseInt(hexFill.slice(1, 3), 16);
|
|
28
|
+
const g = parseInt(hexFill.slice(3, 5), 16);
|
|
29
|
+
const b = parseInt(hexFill.slice(5, 7), 16);
|
|
30
|
+
return 0.299 * r + 0.587 * g + 0.114 * b > 128 ? "#000000" : "#ffffff";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// import { DataFormatDigits } from "../../../../utils/model/DataFormatDigits";
|
|
34
|
+
// import { SiPrefix } from "../../../../utils/model/SiPrefix";
|
|
35
|
+
/**
|
|
36
|
+
* Anchor point for label positioning relative to its coordinates.
|
|
37
|
+
* Vertical hooks control how the label is offset from its Y coordinate;
|
|
38
|
+
* horizontal hooks control text-anchor alignment (start/middle/end).
|
|
39
|
+
*/
|
|
40
|
+
var HookLocation;
|
|
41
|
+
(function (HookLocation) {
|
|
42
|
+
HookLocation[HookLocation["Left"] = 0] = "Left";
|
|
43
|
+
HookLocation[HookLocation["Center"] = 1] = "Center";
|
|
44
|
+
HookLocation[HookLocation["Right"] = 2] = "Right";
|
|
45
|
+
HookLocation[HookLocation["Top"] = 3] = "Top";
|
|
46
|
+
HookLocation[HookLocation["Bottom"] = 4] = "Bottom";
|
|
47
|
+
})(HookLocation || (HookLocation = {}));
|
|
48
|
+
/**
|
|
49
|
+
* SVG text label used across all chart elements (columns, needles, markers, axes).
|
|
50
|
+
*
|
|
51
|
+
* Handles numeric formatting via Formatter.number() with configurable type (decimal/percent),
|
|
52
|
+
* digit precision, and SI prefix scaling. Variance labels prepend a "+" sign for positive values.
|
|
53
|
+
*
|
|
54
|
+
* The label is drawn with a semi-transparent white background rectangle to ensure
|
|
55
|
+
* readability over chart geometry. For stacked segments, the background is omitted
|
|
56
|
+
* and text color is derived from the segment fill for contrast.
|
|
57
|
+
*
|
|
58
|
+
* Positioning uses a two-axis hook system: verticalHookLocation shifts the label
|
|
59
|
+
* above/below/centered on the Y coordinate, horizontalHookLocation sets the SVG
|
|
60
|
+
* text-anchor (start/middle/end) relative to X.
|
|
61
|
+
*/
|
|
62
|
+
class Label {
|
|
63
|
+
constructor(parent, xPosition, yPosition, groupPrefix, value, styles, verticalHookLocation, horizontalHookLocation) {
|
|
64
|
+
this.ID_SCENARIOLABEL = "Label";
|
|
65
|
+
this.CSS_CATEGORIES = "categories";
|
|
66
|
+
this.isRelativeLabel = false;
|
|
67
|
+
this.segmentFillColor = null;
|
|
68
|
+
this.x = xPosition;
|
|
69
|
+
this.y = yPosition;
|
|
70
|
+
this.value = value;
|
|
71
|
+
this.group = parent.group().id(this.createElementID(parent.toString(), groupPrefix));
|
|
72
|
+
this.styles = styles;
|
|
73
|
+
this.isVarianceLabel = false;
|
|
74
|
+
this.verticalHookLocation = verticalHookLocation || HookLocation.Top;
|
|
75
|
+
this.horizontalHookLocation = horizontalHookLocation || HookLocation.Left;
|
|
76
|
+
}
|
|
77
|
+
setToVarianceLabel() {
|
|
78
|
+
this.isVarianceLabel = true;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
setToRelativeVarianceLabel() {
|
|
82
|
+
this.isVarianceLabel = true;
|
|
83
|
+
this.isRelativeLabel = true;
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
setSegmentFill(color) {
|
|
87
|
+
this.segmentFillColor = color;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
updateGroup(newGroup) {
|
|
91
|
+
this.group = newGroup;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
draw(displayLabel = true, dataFormatDigits = { percent: 2, decimal: 1 }, measureScale = new SiPrefix()) {
|
|
95
|
+
if (this.isEmpty()) {
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
const label = this.group;
|
|
99
|
+
let valueStr;
|
|
100
|
+
let prefix = "";
|
|
101
|
+
if (Number.isNaN(Number(this.value)) === false) {
|
|
102
|
+
const value = this.value;
|
|
103
|
+
let type = "percent";
|
|
104
|
+
let digits = dataFormatDigits.percent;
|
|
105
|
+
let digitsMin = dataFormatDigits.percent;
|
|
106
|
+
let scale = 1;
|
|
107
|
+
if (this.isRelativeLabel === false) {
|
|
108
|
+
digits = dataFormatDigits.decimal;
|
|
109
|
+
digitsMin = dataFormatDigits.decimal;
|
|
110
|
+
scale = measureScale.value;
|
|
111
|
+
type = "decimal";
|
|
112
|
+
}
|
|
113
|
+
valueStr = Formatter.number(Number(value), type, digits, digitsMin, scale);
|
|
114
|
+
if (this.isVarianceLabel && Number(this.value) >= 0) {
|
|
115
|
+
prefix = "+";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
valueStr = "" + this.value;
|
|
120
|
+
// displayLabel = false;
|
|
121
|
+
}
|
|
122
|
+
const labelStr = prefix + valueStr;
|
|
123
|
+
const text = this.drawLabel(label, labelStr);
|
|
124
|
+
if (displayLabel === false) {
|
|
125
|
+
text.addClass("hide");
|
|
126
|
+
label.addClass("hide");
|
|
127
|
+
}
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
isEmpty() {
|
|
131
|
+
return this.value == null || "" === this.value;
|
|
132
|
+
}
|
|
133
|
+
setPos(xPosition, yPosition) {
|
|
134
|
+
this.x = xPosition;
|
|
135
|
+
this.y = yPosition;
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
forceStringTypeDraw() {
|
|
139
|
+
const label = this.group;
|
|
140
|
+
const labelStr = "" + this.value;
|
|
141
|
+
this.drawLabel(label, labelStr);
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
drawLabel(label, labelStr) {
|
|
145
|
+
const background = this.styles.fontStyles.background || "#ffffff";
|
|
146
|
+
//let text = label.text(labelStr)
|
|
147
|
+
// .leading(1)
|
|
148
|
+
// .addClass(this.CSS_CATEGORIES)
|
|
149
|
+
// .font({anchor: 'middle'})
|
|
150
|
+
// .move(this.x, this.y);
|
|
151
|
+
let labelAnchor = "start";
|
|
152
|
+
const text = label.text(labelStr);
|
|
153
|
+
text.move(this.x, this.y);
|
|
154
|
+
const boxWidth = text.bbox().w;
|
|
155
|
+
const boxHeight = text.bbox().h;
|
|
156
|
+
let rectX = 0;
|
|
157
|
+
let rectY = 0;
|
|
158
|
+
const textX = text.x();
|
|
159
|
+
let textY = text.y();
|
|
160
|
+
if (this.horizontalHookLocation === HookLocation.Left) {
|
|
161
|
+
labelAnchor = "left";
|
|
162
|
+
rectX = text.x();
|
|
163
|
+
}
|
|
164
|
+
else if (this.horizontalHookLocation === HookLocation.Center) {
|
|
165
|
+
labelAnchor = "middle";
|
|
166
|
+
rectX = text.x() - (boxWidth + 2) / 2;
|
|
167
|
+
}
|
|
168
|
+
else if (this.horizontalHookLocation === HookLocation.Right) {
|
|
169
|
+
labelAnchor = "end";
|
|
170
|
+
rectX = text.x() - boxWidth;
|
|
171
|
+
}
|
|
172
|
+
if (this.verticalHookLocation === HookLocation.Center) {
|
|
173
|
+
textY = text.y() - (boxHeight * 1.2) / 2;
|
|
174
|
+
rectY = textY + boxHeight * 0.2;
|
|
175
|
+
}
|
|
176
|
+
else if (this.verticalHookLocation === HookLocation.Top) {
|
|
177
|
+
textY -= boxHeight / 4;
|
|
178
|
+
rectY = textY + boxHeight * 0.2;
|
|
179
|
+
}
|
|
180
|
+
else if (this.verticalHookLocation === HookLocation.Bottom) {
|
|
181
|
+
textY -= boxHeight;
|
|
182
|
+
rectY = textY + boxHeight * 0.2; // + (boxHeight / 2);
|
|
183
|
+
}
|
|
184
|
+
text.move(textX, textY);
|
|
185
|
+
text.font({ anchor: labelAnchor });
|
|
186
|
+
if (this.segmentFillColor != null) {
|
|
187
|
+
text.fill(getContrastTextColor(this.segmentFillColor));
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
label
|
|
191
|
+
.rect(boxWidth + 2, boxHeight * 0.8)
|
|
192
|
+
.stroke(background)
|
|
193
|
+
.fill(background)
|
|
194
|
+
.opacity(0.9)
|
|
195
|
+
.move(rectX - 1, rectY)
|
|
196
|
+
.insertBefore(text);
|
|
197
|
+
}
|
|
198
|
+
return text;
|
|
199
|
+
}
|
|
200
|
+
createElementID(prefix, groupPrefix) {
|
|
201
|
+
return prefix + "_" + groupPrefix + "_" + this.ID_SCENARIOLABEL;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Scenario priority for label collision resolution.
|
|
207
|
+
* Lower number = higher priority. AC always wins.
|
|
208
|
+
*/
|
|
209
|
+
const SCENARIO_PRIORITY = {
|
|
210
|
+
ac: 1,
|
|
211
|
+
pp: 2,
|
|
212
|
+
fc: 3,
|
|
213
|
+
pl: 4,
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Direction a label can be placed relative to its marker.
|
|
217
|
+
*/
|
|
218
|
+
var LabelDirection;
|
|
219
|
+
(function (LabelDirection) {
|
|
220
|
+
LabelDirection[LabelDirection["Above"] = 0] = "Above";
|
|
221
|
+
LabelDirection[LabelDirection["Below"] = 1] = "Below";
|
|
222
|
+
LabelDirection[LabelDirection["Left"] = 2] = "Left";
|
|
223
|
+
LabelDirection[LabelDirection["Right"] = 3] = "Right";
|
|
224
|
+
})(LabelDirection || (LabelDirection = {}));
|
|
225
|
+
/**
|
|
226
|
+
* Manages label collision detection across multiple line series in line charts.
|
|
227
|
+
* Tracks the bounding boxes of all registered labels and detects overlaps.
|
|
228
|
+
* Supports scenario-based priority: when labels collide and cannot be repositioned,
|
|
229
|
+
* lower-priority scenario labels are hidden (AC > PP > FC > PL).
|
|
230
|
+
*
|
|
231
|
+
* Uses 4-direction placement: Above, Below, Left, Right.
|
|
232
|
+
*/
|
|
233
|
+
class LabelCollisionManager {
|
|
234
|
+
constructor() {
|
|
235
|
+
this.labels = [];
|
|
236
|
+
this.scenarioLabels = [];
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Clears all registered labels. Call this before drawing a new chart.
|
|
240
|
+
*/
|
|
241
|
+
clear() {
|
|
242
|
+
this.labels = [];
|
|
243
|
+
this.scenarioLabels = [];
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Registers a label's bounding box for collision detection.
|
|
247
|
+
*/
|
|
248
|
+
register(bounds) {
|
|
249
|
+
this.labels.push(bounds);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Checks if a label at the given bounds would collide with any existing labels.
|
|
253
|
+
*/
|
|
254
|
+
hasCollision(bounds) {
|
|
255
|
+
return this.labels.some((existing) => this.intersects(bounds, existing));
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Tries each direction in priorityOrder to find a non-colliding placement.
|
|
259
|
+
* Returns the first non-colliding LabelPlacement, or null if all 4 collide
|
|
260
|
+
* with higher-priority scenario labels (meaning this label should be hidden).
|
|
261
|
+
*
|
|
262
|
+
* @param centerX Center X position of the marker
|
|
263
|
+
* @param markerY Y position of the marker center
|
|
264
|
+
* @param width Estimated label width
|
|
265
|
+
* @param height Estimated label height
|
|
266
|
+
* @param pointIndex The data point index
|
|
267
|
+
* @param markerSize The marker size
|
|
268
|
+
* @param scenarioType e.g. "ac", "pp", "fc", "pl"
|
|
269
|
+
* @param priorityOrder Directions to try, in priority order
|
|
270
|
+
*/
|
|
271
|
+
getOptimalPlacement(centerX, markerY, width, height, pointIndex, markerSize, scenarioType, priorityOrder) {
|
|
272
|
+
const priority = SCENARIO_PRIORITY[scenarioType] || 99;
|
|
273
|
+
const gap = 8;
|
|
274
|
+
const halfMarker = markerSize / 2;
|
|
275
|
+
// Try each direction in the caller's preferred order
|
|
276
|
+
for (const direction of priorityOrder) {
|
|
277
|
+
const placement = this.calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction);
|
|
278
|
+
if (!this.hasCollision(placement.bounds)) {
|
|
279
|
+
return placement;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
// All 4 positions collide. Check if any collide ONLY with lower-priority
|
|
283
|
+
// labels (meaning we could still place here — the other label would lose).
|
|
284
|
+
// But to keep it simple: hide only if all positions collide with higher-priority labels.
|
|
285
|
+
for (const direction of priorityOrder) {
|
|
286
|
+
const placement = this.calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction);
|
|
287
|
+
if (!this.collidesWithHigherPriority(placement.bounds, priority)) {
|
|
288
|
+
// This position only collides with equal or lower priority — claim it
|
|
289
|
+
return placement;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// All positions collide with higher-priority labels — hide
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Computes the LabelPlacement for a given direction.
|
|
297
|
+
*/
|
|
298
|
+
calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction) {
|
|
299
|
+
let labelX;
|
|
300
|
+
let labelY;
|
|
301
|
+
let verticalHook;
|
|
302
|
+
let horizontalHook;
|
|
303
|
+
let boundsX;
|
|
304
|
+
let boundsY;
|
|
305
|
+
switch (direction) {
|
|
306
|
+
case LabelDirection.Above:
|
|
307
|
+
labelX = centerX;
|
|
308
|
+
labelY = markerY - halfMarker - gap;
|
|
309
|
+
verticalHook = HookLocation.Bottom;
|
|
310
|
+
horizontalHook = HookLocation.Center;
|
|
311
|
+
boundsX = centerX - width / 2;
|
|
312
|
+
boundsY = markerY - halfMarker - gap - height;
|
|
313
|
+
break;
|
|
314
|
+
case LabelDirection.Below:
|
|
315
|
+
labelX = centerX;
|
|
316
|
+
labelY = markerY + halfMarker + gap;
|
|
317
|
+
verticalHook = HookLocation.Top;
|
|
318
|
+
horizontalHook = HookLocation.Center;
|
|
319
|
+
boundsX = centerX - width / 2;
|
|
320
|
+
// Top hook shifts text up by height/4, so bounds start earlier
|
|
321
|
+
boundsY = markerY + halfMarker + gap - height / 4;
|
|
322
|
+
break;
|
|
323
|
+
case LabelDirection.Left:
|
|
324
|
+
labelX = centerX - halfMarker - gap;
|
|
325
|
+
labelY = markerY;
|
|
326
|
+
verticalHook = HookLocation.Center;
|
|
327
|
+
horizontalHook = HookLocation.Right;
|
|
328
|
+
boundsX = centerX - halfMarker - gap - width;
|
|
329
|
+
// Center hook shifts text up by height*0.6
|
|
330
|
+
boundsY = markerY - height * 0.6;
|
|
331
|
+
break;
|
|
332
|
+
case LabelDirection.Right:
|
|
333
|
+
labelX = centerX + halfMarker + gap;
|
|
334
|
+
labelY = markerY;
|
|
335
|
+
verticalHook = HookLocation.Center;
|
|
336
|
+
horizontalHook = HookLocation.Left;
|
|
337
|
+
boundsX = centerX + halfMarker + gap;
|
|
338
|
+
// Center hook shifts text up by height*0.6
|
|
339
|
+
boundsY = markerY - height * 0.6;
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
const bounds = {
|
|
343
|
+
x: boundsX,
|
|
344
|
+
y: boundsY,
|
|
345
|
+
width,
|
|
346
|
+
height,
|
|
347
|
+
pointIndex,
|
|
348
|
+
preferredHook: verticalHook,
|
|
349
|
+
};
|
|
350
|
+
return { labelX, labelY, verticalHook, horizontalHook, bounds };
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Checks if bounds collide with any registered label that has higher priority.
|
|
354
|
+
*/
|
|
355
|
+
collidesWithHigherPriority(bounds, priority) {
|
|
356
|
+
return this.labels.some((existing) => {
|
|
357
|
+
if (!existing.scenarioType)
|
|
358
|
+
return false;
|
|
359
|
+
const existingPriority = SCENARIO_PRIORITY[existing.scenarioType] || 99;
|
|
360
|
+
return existingPriority < priority && this.intersects(bounds, existing);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Checks whether a scenario label at the end of a line should be hidden
|
|
365
|
+
* because it's too close to a higher-priority scenario label.
|
|
366
|
+
*/
|
|
367
|
+
shouldHideScenarioLabel(x, y, scenarioType, proximityThreshold = 20) {
|
|
368
|
+
const priority = SCENARIO_PRIORITY[scenarioType] || 99;
|
|
369
|
+
if (priority <= 1)
|
|
370
|
+
return false; // AC is never hidden
|
|
371
|
+
return this.scenarioLabels.some((existing) => {
|
|
372
|
+
const existingPriority = SCENARIO_PRIORITY[existing.scenarioType] || 99;
|
|
373
|
+
if (existingPriority >= priority)
|
|
374
|
+
return false;
|
|
375
|
+
const dy = Math.abs(y - existing.y);
|
|
376
|
+
const dx = Math.abs(x - existing.x);
|
|
377
|
+
return dy < proximityThreshold && dx < proximityThreshold;
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Registers a scenario label position for proximity checking.
|
|
382
|
+
*/
|
|
383
|
+
registerScenarioLabel(x, y, scenarioType) {
|
|
384
|
+
this.scenarioLabels.push({ x, y, scenarioType });
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Checks if two bounding boxes intersect (overlap).
|
|
388
|
+
*/
|
|
389
|
+
intersects(a, b) {
|
|
390
|
+
return !(a.x + a.width < b.x || // a is completely to the left of b
|
|
391
|
+
b.x + b.width < a.x || // b is completely to the left of a
|
|
392
|
+
a.y + a.height < b.y || // a is completely above b
|
|
393
|
+
b.y + b.height < a.y // b is completely above a
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Gets the number of registered labels.
|
|
398
|
+
*/
|
|
399
|
+
getLabelCount() {
|
|
400
|
+
return this.labels.length;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export { HookLocation as H, IBCS_LAYER_ORDER as I, LabelCollisionManager as L, SiPrefix as S, getScenarioPrefix as a, Label as b, LabelDirection as c, SCENARIO_PRIORITY as d, getContrastTextColor as g };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear numeric scale with nice-tick generation for the XY charts.
|
|
3
|
+
*
|
|
4
|
+
* Domains default to the data extent padded 4% on each side; zero-inclusion
|
|
5
|
+
* is NOT forced — points encode by position, not length, so IBCS's
|
|
6
|
+
* zero-baseline rule for bars does not apply. Explicit `min`/`max`
|
|
7
|
+
* overrides disable the padding on that side.
|
|
8
|
+
*/
|
|
9
|
+
class NumericScale {
|
|
10
|
+
constructor(domainMin, domainMax, rangeMin, rangeMax) {
|
|
11
|
+
this.domainMin = domainMin;
|
|
12
|
+
this.domainMax = domainMax;
|
|
13
|
+
this.rangeMin = rangeMin;
|
|
14
|
+
this.rangeMax = rangeMax;
|
|
15
|
+
}
|
|
16
|
+
/** Maps a domain value to range (pixel) coordinates. */
|
|
17
|
+
scale(value) {
|
|
18
|
+
const span = this.domainMax - this.domainMin;
|
|
19
|
+
if (span === 0) {
|
|
20
|
+
return (this.rangeMin + this.rangeMax) / 2;
|
|
21
|
+
}
|
|
22
|
+
return this.rangeMin + ((value - this.domainMin) / span) * (this.rangeMax - this.rangeMin);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Computes the domain from a data extent: 4% padding on each side,
|
|
26
|
+
* overridden per side by explicit `min`/`max`. Degenerate extents
|
|
27
|
+
* (single value) are widened symmetrically.
|
|
28
|
+
*/
|
|
29
|
+
static domain(dataMin, dataMax, override, pad = 0.04) {
|
|
30
|
+
let span = dataMax - dataMin;
|
|
31
|
+
if (span === 0) {
|
|
32
|
+
const widen = dataMin === 0 ? 1 : Math.abs(dataMin) * 0.1;
|
|
33
|
+
dataMin -= widen;
|
|
34
|
+
dataMax += widen;
|
|
35
|
+
span = dataMax - dataMin;
|
|
36
|
+
}
|
|
37
|
+
const min = (override === null || override === void 0 ? void 0 : override.min) !== undefined ? override.min : dataMin - span * pad;
|
|
38
|
+
const max = (override === null || override === void 0 ? void 0 : override.max) !== undefined ? override.max : dataMax + span * pad;
|
|
39
|
+
return [min, max];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Picks a nice step size from the 1-2-2.5-5 ladder so that the span
|
|
43
|
+
* yields close to `targetCount` ticks.
|
|
44
|
+
*/
|
|
45
|
+
static niceStep(span, targetCount) {
|
|
46
|
+
if (span <= 0 || targetCount <= 0) {
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
const rawStep = span / targetCount;
|
|
50
|
+
const magnitude = Math.pow(10, Math.floor(Math.log10(rawStep)));
|
|
51
|
+
const normalized = rawStep / magnitude;
|
|
52
|
+
let mantissa;
|
|
53
|
+
if (normalized <= 1) {
|
|
54
|
+
mantissa = 1;
|
|
55
|
+
}
|
|
56
|
+
else if (normalized <= 2) {
|
|
57
|
+
mantissa = 2;
|
|
58
|
+
}
|
|
59
|
+
else if (normalized <= 2.5) {
|
|
60
|
+
mantissa = 2.5;
|
|
61
|
+
}
|
|
62
|
+
else if (normalized <= 5) {
|
|
63
|
+
mantissa = 5;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
mantissa = 10;
|
|
67
|
+
}
|
|
68
|
+
return mantissa * magnitude;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Nice tick values inside the domain, aiming for `targetCount` ticks
|
|
72
|
+
* (the renderer picks 4–8 depending on panel size).
|
|
73
|
+
*/
|
|
74
|
+
ticks(targetCount) {
|
|
75
|
+
const span = this.domainMax - this.domainMin;
|
|
76
|
+
if (span <= 0) {
|
|
77
|
+
return [this.domainMin];
|
|
78
|
+
}
|
|
79
|
+
const step = NumericScale.niceStep(span, targetCount);
|
|
80
|
+
const first = Math.ceil(this.domainMin / step) * step;
|
|
81
|
+
const ticks = [];
|
|
82
|
+
// Guard against floating-point drift at the domain edge.
|
|
83
|
+
for (let tick = first; tick <= this.domainMax + step * 1e-9; tick += step) {
|
|
84
|
+
ticks.push(Math.abs(tick) < step * 1e-9 ? 0 : tick);
|
|
85
|
+
}
|
|
86
|
+
return ticks;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Decimal places (0–2) needed to render the given ticks without
|
|
90
|
+
* ambiguity between adjacent values.
|
|
91
|
+
*/
|
|
92
|
+
static tickDecimals(ticks) {
|
|
93
|
+
let decimals = 0;
|
|
94
|
+
for (const tick of ticks) {
|
|
95
|
+
const text = String(tick);
|
|
96
|
+
const dot = text.indexOf(".");
|
|
97
|
+
if (dot >= 0) {
|
|
98
|
+
decimals = Math.max(decimals, Math.min(2, text.length - dot - 1));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return decimals;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { NumericScale as N };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { C as CompareUtil } from './VarianceMeasure-DnwNKspZ.js';
|
|
2
|
+
|
|
3
|
+
/** Shared utilities for the adapter layer, used by all component config adapters. */
|
|
4
|
+
class AdapterUtils {
|
|
5
|
+
/** Returns the trimmed string value, or an empty string if the input is not a string. */
|
|
6
|
+
static adaptDefaultString(data) {
|
|
7
|
+
if (CompareUtil.isString(data)) {
|
|
8
|
+
return data.trim();
|
|
9
|
+
}
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Safely adapts an array of untyped records through a typed adapter.
|
|
14
|
+
* If `data` is not an array, returns an empty array instead of throwing.
|
|
15
|
+
*/
|
|
16
|
+
static adaptArray(data, adapter) {
|
|
17
|
+
const targetArray = [];
|
|
18
|
+
if (CompareUtil.isArray(data)) {
|
|
19
|
+
data.forEach((b) => {
|
|
20
|
+
targetArray.push(adapter.adapt(b));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return targetArray;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var OrderDirection;
|
|
28
|
+
(function (OrderDirection) {
|
|
29
|
+
OrderDirection["ASC"] = "asc";
|
|
30
|
+
OrderDirection["DESC"] = "desc";
|
|
31
|
+
})(OrderDirection || (OrderDirection = {}));
|
|
32
|
+
/** Valid columns for ORDER BY in AlaSQL queries — includes hierarchy dimensions and all 16 scenario slots. */
|
|
33
|
+
var OrderColumn;
|
|
34
|
+
(function (OrderColumn) {
|
|
35
|
+
OrderColumn["ROWGROUP"] = "rowGroup";
|
|
36
|
+
OrderColumn["ROWGROUPINDEX"] = "rowGroupIndex";
|
|
37
|
+
OrderColumn["CATEGORY"] = "category";
|
|
38
|
+
OrderColumn["CATEGORYINDEX"] = "categoryIndex";
|
|
39
|
+
OrderColumn["SUBCATEGORY"] = "subCategory";
|
|
40
|
+
OrderColumn["SUBCATEGORYINDEX"] = "subCategoryIndex";
|
|
41
|
+
OrderColumn["AC1"] = "ac1";
|
|
42
|
+
OrderColumn["AC2"] = "ac2";
|
|
43
|
+
OrderColumn["AC3"] = "ac3";
|
|
44
|
+
OrderColumn["AC4"] = "ac4";
|
|
45
|
+
OrderColumn["PP1"] = "pp1";
|
|
46
|
+
OrderColumn["PP2"] = "pp2";
|
|
47
|
+
OrderColumn["PP3"] = "pp3";
|
|
48
|
+
OrderColumn["PP4"] = "pp4";
|
|
49
|
+
OrderColumn["FC1"] = "fc1";
|
|
50
|
+
OrderColumn["FC2"] = "fc2";
|
|
51
|
+
OrderColumn["FC3"] = "fc3";
|
|
52
|
+
OrderColumn["FC4"] = "fc4";
|
|
53
|
+
OrderColumn["PL1"] = "pl1";
|
|
54
|
+
OrderColumn["PL2"] = "pl2";
|
|
55
|
+
OrderColumn["PL3"] = "pl3";
|
|
56
|
+
OrderColumn["PL4"] = "pl4";
|
|
57
|
+
})(OrderColumn || (OrderColumn = {}));
|
|
58
|
+
class Order {
|
|
59
|
+
/**
|
|
60
|
+
* @param hierarchy Columns for multi-level sorting, applied left-to-right (e.g. `["rowGroup", "category"]`).
|
|
61
|
+
* @param direction Sort direction applied to all hierarchy levels.
|
|
62
|
+
*/
|
|
63
|
+
constructor(hierarchy = ["category"], direction = OrderDirection.ASC) {
|
|
64
|
+
this.hierarchy = hierarchy;
|
|
65
|
+
this.direction = direction;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
class OrderAdapter {
|
|
69
|
+
constructor(stringAdapter) {
|
|
70
|
+
this.stringAdapter = stringAdapter;
|
|
71
|
+
}
|
|
72
|
+
adapt(data) {
|
|
73
|
+
var _a;
|
|
74
|
+
const hierarchy = AdapterUtils.adaptArray(data.hierarchy, this.stringAdapter);
|
|
75
|
+
const order = OrderDirection[(_a = data.direction) === null || _a === void 0 ? void 0 : _a.toUpperCase()] || OrderDirection.ASC;
|
|
76
|
+
return new Order(hierarchy.map((str) => OrderColumn[str.toUpperCase()] || OrderColumn.CATEGORY), order);
|
|
77
|
+
}
|
|
78
|
+
default() {
|
|
79
|
+
return new Order(["category"], OrderDirection.ASC);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { AdapterUtils as A, OrderDirection as O, Order as a, OrderColumn as b, OrderAdapter as c };
|