@bino-bi/bn-template-engine 1.0.0-next.26 → 1.0.0-next.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-5075771a.entry.js +1 -0
- package/dist/bn-template-engine/p-5d516435.entry.js +1 -0
- package/dist/bn-template-engine/p-5e90e728.entry.js +1 -0
- package/dist/bn-template-engine/p-9ef7e132.entry.js +1 -0
- package/dist/bn-template-engine/{p-f06c3703.entry.js → p-9f7a1980.entry.js} +1 -1
- package/dist/bn-template-engine/p-BeXgxHkW.js +1 -0
- package/dist/bn-template-engine/p-CH0bpt_k.js +1 -0
- package/dist/bn-template-engine/p-ClruFZD_.js +1 -0
- package/dist/bn-template-engine/{p-CTrNbSXN.js → p-DFmSrSnf.js} +1 -1
- package/dist/bn-template-engine/{p-BcLsoDrW.js → p-DI3efDSV.js} +1 -1
- package/dist/bn-template-engine/p-DXLTTILG.js +1 -0
- package/dist/bn-template-engine/p-DtP4jqG5.js +1 -0
- package/dist/bn-template-engine/p-a8281b71.entry.js +1 -0
- package/dist/bn-template-engine/p-b31277e7.entry.js +1 -0
- package/dist/bn-template-engine/p-b396ac84.entry.js +1 -0
- package/dist/cjs/{bn-asset_21.cjs.entry.js → bn-asset_28.cjs.entry.js} +21358 -6528
- package/dist/cjs/bn-grid.cjs.entry.js +4 -6
- package/dist/cjs/bn-image.cjs.entry.js +3 -5
- package/dist/cjs/bn-internationalization.cjs.entry.js +17 -6
- package/dist/cjs/bn-ruleset.cjs.entry.js +5 -5
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +2 -2
- package/dist/cjs/bn-text.cjs.entry.js +115 -43
- package/dist/cjs/{context-protocol-DcTEh1rq.js → context-protocol-C0rKepqu.js} +108 -22
- package/dist/cjs/{diagnostics-CTgbq_Gc.js → diagnostics-Cq-qDtXq.js} +1 -1
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/queryError-BZjnIW_w.js +16 -0
- package/dist/cjs/{scaling-Dsb5_NXy.js → sanitizeHtml-Yx1xn6i_.js} +467 -287
- package/dist/cjs/{withBodyObserver-DJO98AJ-.js → withBodyObserver-CaPUjuC5.js} +1 -1
- package/dist/cjs/withHasError-qGW_yqIv.js +426 -0
- package/dist/cjs/{withStyled-D0jLwCib.js → withStyled-vSfogp9J.js} +543 -42
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +37 -0
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +53 -28
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +37 -5
- package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +16 -7
- package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +67 -30
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +37 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +49 -29
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +37 -5
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +17 -7
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +34 -18
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +2 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +1 -1
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +37 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +52 -27
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +37 -5
- package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +16 -7
- package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +52 -18
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +37 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +74 -44
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +60 -19
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +218 -262
- package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +11 -4
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +16 -25
- package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +3 -2
- package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +2 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.css +37 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +122 -52
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +37 -0
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +60 -19
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +245 -250
- package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Label.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +11 -4
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +22 -34
- package/dist/collection/components/bn-chart-time/utils/helper/LabelCollisionManager.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +4 -3
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -2
- package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +2 -0
- package/dist/collection/components/bn-component-style/bn-component-style.js +14 -2
- package/dist/collection/components/bn-context/bn-context.js +92 -22
- package/dist/collection/components/bn-dataset/bn-dataset.js +246 -90
- package/dist/collection/components/bn-datasource/bn-datasource.js +169 -77
- package/dist/collection/components/bn-footer/bn-footer.js +6 -6
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +14 -3
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +25 -74
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +59 -71
- package/dist/collection/components/bn-message/bn-message.js +2 -2
- package/dist/collection/components/bn-page/bn-page.css +0 -240
- package/dist/collection/components/bn-page/bn-page.js +14 -4
- package/dist/collection/components/bn-page/pageFormats.js +69 -0
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +2 -2
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +7 -7
- package/dist/collection/components/bn-table/bn-table.css +38 -1
- package/dist/collection/components/bn-table/bn-table.js +96 -59
- package/dist/collection/components/bn-table/ibcs-table.css +39 -1
- package/dist/collection/components/bn-table/ibcs-table.js +89 -30
- package/dist/collection/components/bn-table/utils/Table.js +12 -13
- package/dist/collection/components/bn-table/utils/elements/Cell.js +9 -3
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +38 -34
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +2 -1
- package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -4
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +17 -4
- package/dist/collection/components/bn-table/utils/helper/DataQuery.js +128 -98
- package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +6 -20
- package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +9 -2
- package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
- package/dist/collection/components/bn-table/utils/model/TableAttribute.js +2 -2
- package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +3 -2
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +36 -39
- package/dist/collection/components/bn-text/utils/template.js +79 -0
- package/dist/collection/components/bn-title/bn-title.js +10 -4
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +3 -1
- package/dist/collection/components/bn-tree/bn-tree.js +119 -23
- package/dist/collection/components/bn-tree/utils/EdgeRenderer.js +59 -51
- package/dist/collection/components/bn-tree/utils/TreeLayout.js +30 -5
- package/dist/collection/components/bn-tree/utils/TreeParser.js +35 -0
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/context/context-protocol.js +1 -1
- package/dist/collection/context/scopedDb.js +47 -4
- package/dist/collection/stores/componentStyles.js +39 -0
- package/dist/collection/stores/internationalization.js +15 -13
- package/dist/collection/utils/DateStringFactory.js +17 -15
- package/dist/collection/utils/autoFit.js +2 -2
- package/dist/collection/utils/componentRegister.js +60 -16
- package/dist/collection/utils/constants.js +2 -2
- package/dist/collection/utils/dataAnalyzer.js +9 -12
- package/dist/collection/utils/emptyState.js +21 -0
- package/dist/collection/utils/formatter.js +29 -20
- package/dist/collection/utils/layoutObserver.js +1 -1
- package/dist/collection/utils/layoutState/generic.js +1 -1
- package/dist/collection/utils/layoutState/svgChartElements.js +2 -2
- package/dist/collection/utils/layoutTemplate.js +81 -0
- package/dist/collection/utils/measurementHost.js +2 -2
- package/dist/collection/utils/model/Order.js +1 -1
- package/dist/collection/utils/model/styles/SVGStyle.js +12 -4
- package/dist/collection/utils/parentDimensions.js +35 -3
- package/dist/collection/utils/queryError.js +11 -0
- package/dist/collection/utils/relativeVariance.js +14 -0
- package/dist/collection/utils/sanitizeHtml.js +30 -16
- package/dist/collection/utils/scaling.js +2 -2
- package/dist/collection/utils/stackColors.js +27 -5
- package/dist/collection/utils/stackLayout.js +71 -0
- package/dist/collection/utils/styled/attributes.js +16 -3
- package/dist/collection/utils/styled/style-sheet.js +1 -1
- package/dist/collection/utils/styled/withStyled.js +1 -1
- package/dist/collection/utils/testing/fakeGroup.js +21 -0
- package/dist/collection/utils/testing/mutationObserver.js +44 -0
- package/dist/collection/utils/testing/structureChart.js +26 -0
- package/dist/collection/utils/testing/timeChart.js +28 -0
- package/dist/collection/utils/validate.js +1 -1
- package/dist/collection/utils/withComponentStatus.js +137 -12
- package/dist/collection/utils/withInheritedProps.js +113 -64
- package/dist/collection/utils/withRuleSet.js +10 -7
- package/dist/collection/utils/withTranslation.js +3 -3
- package/dist/collection/utils/xy/FacetGrid.js +1 -1
- package/dist/collection/utils/xy/IsoCurves.js +1 -1
- package/dist/collection/utils/xy/NumericScale.js +46 -15
- package/dist/collection/utils/xy/PointLabeler.js +2 -2
- package/dist/collection/utils/xy/RadiusScale.js +2 -2
- package/dist/collection/utils/xy/SeriesPalette.js +3 -3
- package/dist/collection/utils/xy/VarianceMeasure.js +22 -4
- package/dist/collection/utils/xy/XYFrame.js +4 -4
- package/dist/collection/utils/xy/XYLegend.js +5 -7
- package/dist/collection/utils/xy/checkXYOverflow.js +32 -0
- package/dist/collection/utils/xy/formatXYValue.js +13 -0
- package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
- package/dist/collection/utils/xy/model/XYChartStyle.js +2 -0
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/LabelCollisionManager.js +1 -1
- package/dist/components/NumericScale.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGStyle.js +1 -0
- package/dist/components/TableAttribute.js +1 -0
- package/dist/components/VarianceMeasure.js +1 -1
- package/dist/components/XYChartDataRow.js +1 -1
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body2.js +1 -1
- package/dist/components/bn-card2.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- 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.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/checkXYOverflow.js +1 -0
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/emptyState.js +1 -0
- package/dist/components/formatter.js +1 -1
- package/dist/components/ibcs-chart-bubble2.js +1 -1
- package/dist/components/ibcs-chart-bullet2.js +1 -1
- package/dist/components/ibcs-chart-scatter2.js +1 -1
- 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/layoutTemplate.js +1 -0
- package/dist/components/pageFormats.js +1 -0
- package/dist/components/parentDimensions.js +1 -0
- package/dist/components/queryError.js +1 -0
- package/dist/components/relativeVariance.js +1 -0
- package/dist/components/sanitizeHtml.js +1 -1
- package/dist/components/stackColors.js +1 -1
- package/dist/components/stackLayout.js +1 -0
- package/dist/components/svg.esm.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withBodyObserver.js +1 -1
- package/dist/components/withComponentStatus.js +1 -0
- package/dist/components/withComponentStyle.js +1 -1
- package/dist/components/withDataset.js +1 -1
- package/dist/components/withHasError.js +1 -1
- package/dist/components/withRuleSet.js +1 -1
- package/dist/components/withScalingGroup.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/components/withTranslation.js +1 -1
- package/dist/esm/{bn-asset_21.entry.js → bn-asset_28.entry.js} +20948 -6125
- package/dist/esm/bn-grid.entry.js +4 -6
- package/dist/esm/bn-image.entry.js +3 -5
- package/dist/esm/bn-internationalization.entry.js +17 -6
- package/dist/esm/bn-ruleset.entry.js +5 -5
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +2 -2
- package/dist/esm/bn-text.entry.js +111 -39
- package/dist/esm/{context-protocol-B-vdGKeG.js → context-protocol-CdTp19uA.js} +106 -22
- package/dist/esm/{diagnostics-CiquIw8B.js → diagnostics-vw6TKMiT.js} +1 -1
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/queryError-ClruFZD_.js +13 -0
- package/dist/esm/{scaling-Dggyeqts.js → sanitizeHtml-C5bFtARM.js} +464 -287
- package/dist/esm/{withBodyObserver-Cb9ZC5_J.js → withBodyObserver-DD_-r04o.js} +1 -1
- package/dist/esm/withHasError-73WV2SP5.js +422 -0
- package/dist/esm/{withStyled-DoNsbwS3.js → withStyled-BDEyKd_H.js} +513 -27
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +8 -4
- package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +2 -1
- package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +14 -2
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +12 -11
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +2 -1
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +8 -5
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +1 -1
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +8 -4
- package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +2 -1
- package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +11 -1
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +13 -12
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -1
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +29 -6
- package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +4 -3
- package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -2
- package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +2 -1
- package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +2 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +19 -15
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -1
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +63 -5
- package/dist/types/components/bn-chart-time/utils/elements/AreaFill.d.ts +1 -1
- package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +9 -8
- package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -2
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +3 -2
- package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +2 -0
- package/dist/types/components/bn-context/bn-context.d.ts +15 -3
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +41 -20
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +34 -18
- package/dist/types/components/bn-footer/bn-footer.d.ts +2 -2
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -10
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +13 -6
- package/dist/types/components/bn-message/bn-message.d.ts +2 -1
- package/dist/types/components/bn-page/bn-page.d.ts +2 -1
- package/dist/types/components/bn-page/pageFormats.d.ts +40 -0
- package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +2 -2
- package/dist/types/components/bn-table/bn-table.d.ts +11 -10
- package/dist/types/components/bn-table/ibcs-table.d.ts +8 -5
- package/dist/types/components/bn-table/utils/Table.d.ts +3 -1
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -2
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +6 -4
- package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +1 -1
- package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -0
- package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +14 -5
- package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +2 -2
- package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +6 -1
- package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +2 -2
- package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +2 -0
- package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +2 -1
- package/dist/types/components/bn-text/bn-text.d.ts +20 -13
- package/dist/types/components/bn-text/utils/template.d.ts +10 -0
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +1 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -1
- package/dist/types/components/bn-tree/utils/EdgeRenderer.d.ts +18 -5
- package/dist/types/components/bn-tree/utils/TreeLayout.d.ts +5 -0
- package/dist/types/components.d.ts +226 -184
- package/dist/types/context/scopedDb.d.ts +20 -0
- package/dist/types/stores/componentStyles.d.ts +6 -0
- package/dist/types/utils/DateStringFactory.d.ts +3 -2
- package/dist/types/utils/autoFit.d.ts +2 -2
- package/dist/types/utils/componentRegister.d.ts +21 -5
- package/dist/types/utils/constants.d.ts +2 -2
- package/dist/types/utils/dataAnalyzer.d.ts +1 -1
- package/dist/types/utils/emptyState.d.ts +10 -0
- package/dist/types/utils/formatter.d.ts +7 -9
- package/dist/types/utils/layoutState/generic.d.ts +1 -1
- package/dist/types/utils/layoutState/svgChartElements.d.ts +2 -2
- package/dist/types/utils/layoutTemplate.d.ts +16 -0
- package/dist/types/utils/model/ChartStyles.d.ts +1 -1
- package/dist/types/utils/model/DataQueryResultRow.d.ts +2 -2
- package/dist/types/utils/model/Order.d.ts +1 -1
- package/dist/types/utils/model/styles/SVGStyle.d.ts +5 -1
- package/dist/types/utils/parentDimensions.d.ts +9 -0
- package/dist/types/utils/queryError.d.ts +5 -0
- package/dist/types/utils/relativeVariance.d.ts +9 -0
- package/dist/types/utils/sanitizeHtml.d.ts +2 -2
- package/dist/types/utils/scaling.d.ts +1 -1
- package/dist/types/utils/stackColors.d.ts +3 -2
- package/dist/types/utils/stackLayout.d.ts +49 -0
- package/dist/types/utils/testing/fakeGroup.d.ts +8 -0
- package/dist/types/utils/testing/mutationObserver.d.ts +5 -0
- package/dist/types/utils/testing/structureChart.d.ts +5 -0
- package/dist/types/utils/testing/timeChart.d.ts +5 -0
- package/dist/types/utils/validate.d.ts +1 -1
- package/dist/types/utils/withComponentStatus.d.ts +11 -3
- package/dist/types/utils/withInheritedProps.d.ts +42 -15
- package/dist/types/utils/withRuleSet.d.ts +2 -1
- package/dist/types/utils/withTranslation.d.ts +2 -2
- package/dist/types/utils/xy/FacetGrid.d.ts +1 -1
- package/dist/types/utils/xy/IsoCurves.d.ts +1 -1
- package/dist/types/utils/xy/NumericScale.d.ts +9 -4
- package/dist/types/utils/xy/PointLabeler.d.ts +2 -2
- package/dist/types/utils/xy/RadiusScale.d.ts +2 -2
- package/dist/types/utils/xy/SeriesPalette.d.ts +3 -3
- package/dist/types/utils/xy/VarianceMeasure.d.ts +10 -2
- package/dist/types/utils/xy/XYFrame.d.ts +4 -1
- package/dist/types/utils/xy/XYLegend.d.ts +3 -1
- package/dist/types/utils/xy/checkXYOverflow.d.ts +8 -0
- package/dist/types/utils/xy/formatXYValue.d.ts +7 -0
- package/dist/types/utils/xy/model/AxisConfig.d.ts +1 -1
- package/dist/types/utils/xy/model/XYChartStyle.d.ts +2 -0
- package/package.json +4 -2
- package/readme.md +11 -11
- package/dist/bn-template-engine/p-03304284.entry.js +0 -1
- package/dist/bn-template-engine/p-0fb02c57.entry.js +0 -1
- package/dist/bn-template-engine/p-4419db8f.entry.js +0 -1
- package/dist/bn-template-engine/p-45508f1b.entry.js +0 -1
- package/dist/bn-template-engine/p-461fdffa.entry.js +0 -1
- package/dist/bn-template-engine/p-5d7a3a77.entry.js +0 -1
- package/dist/bn-template-engine/p-62cc95b7.entry.js +0 -1
- package/dist/bn-template-engine/p-686d8e44.entry.js +0 -1
- package/dist/bn-template-engine/p-829212c3.entry.js +0 -1
- package/dist/bn-template-engine/p-B5Jd_eCX.js +0 -1
- package/dist/bn-template-engine/p-BA48JiHe.js +0 -1
- package/dist/bn-template-engine/p-BbmobTg0.js +0 -1
- package/dist/bn-template-engine/p-BcaI745G.js +0 -1
- package/dist/bn-template-engine/p-CG_Bcm6V.js +0 -1
- package/dist/bn-template-engine/p-CWWWM-XC.js +0 -1
- package/dist/bn-template-engine/p-CsJ84YRk.js +0 -1
- package/dist/bn-template-engine/p-D5e8I9Qe.js +0 -1
- package/dist/bn-template-engine/p-DVrDYxlh.js +0 -1
- package/dist/bn-template-engine/p-DjPXefnq.js +0 -1
- package/dist/bn-template-engine/p-DsTzlzxQ.js +0 -1
- package/dist/bn-template-engine/p-DtLI_CzV.js +0 -1
- package/dist/bn-template-engine/p-EtT29btN.js +0 -1
- package/dist/bn-template-engine/p-TuLpbB5O.js +0 -1
- package/dist/bn-template-engine/p-a5867a4c.entry.js +0 -1
- package/dist/bn-template-engine/p-b27009eb.entry.js +0 -1
- package/dist/bn-template-engine/p-bfa87b07.entry.js +0 -1
- package/dist/bn-template-engine/p-ceb80db3.entry.js +0 -1
- package/dist/bn-template-engine/p-fcfbb329.entry.js +0 -1
- package/dist/bn-template-engine/p-qRZrT-U3.js +0 -1
- package/dist/cjs/AxisConfig-DwiNUyYG.js +0 -233
- package/dist/cjs/LabelCollisionManager-Bv-xkeXw.js +0 -415
- package/dist/cjs/NumericScale-BAyYXpKL.js +0 -107
- package/dist/cjs/Order-2wRydarc.js +0 -87
- package/dist/cjs/SVGStyle-DoxylrEQ.js +0 -8219
- package/dist/cjs/SVGVariancesStyleGroup-CiI4GeWe.js +0 -50
- package/dist/cjs/VarianceMeasure-CQlSRzlp.js +0 -372
- package/dist/cjs/XYChartDataRow-C2FdL58s.js +0 -829
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +0 -792
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +0 -805
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +0 -678
- package/dist/cjs/bn-tree.cjs.entry.js +0 -1042
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +0 -624
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +0 -673
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +0 -667
- package/dist/cjs/sanitizeHtml-LuZr1IMd.js +0 -85
- package/dist/cjs/svgChartElements-tDA43aYj.js +0 -400
- package/dist/cjs/withHasError-BdDmiOXM.js +0 -258
- package/dist/cjs/withScalingGroup-CFIc5-6s.js +0 -73
- package/dist/components/autoFit.js +0 -1
- package/dist/components/main.js +0 -1
- package/dist/components/utils.js +0 -1
- package/dist/esm/AxisConfig-KqzWQbML.js +0 -224
- package/dist/esm/LabelCollisionManager-585bQMtP.js +0 -407
- package/dist/esm/NumericScale-DsTzlzxQ.js +0 -105
- package/dist/esm/Order-DZVWjEL_.js +0 -83
- package/dist/esm/SVGStyle-OrPkzjcb.js +0 -8209
- package/dist/esm/SVGVariancesStyleGroup-DO5QJfRQ.js +0 -48
- package/dist/esm/VarianceMeasure-DDjChp8C.js +0 -364
- package/dist/esm/XYChartDataRow-Dn83Tqh9.js +0 -820
- package/dist/esm/bn-chart-bubble.entry.js +0 -790
- package/dist/esm/bn-chart-bullet.entry.js +0 -803
- package/dist/esm/bn-chart-scatter.entry.js +0 -676
- package/dist/esm/bn-tree.entry.js +0 -1040
- package/dist/esm/ibcs-chart-bubble.entry.js +0 -622
- package/dist/esm/ibcs-chart-bullet.entry.js +0 -671
- package/dist/esm/ibcs-chart-scatter.entry.js +0 -665
- package/dist/esm/sanitizeHtml-BA48JiHe.js +0 -83
- package/dist/esm/svgChartElements-B3YClivG.js +0 -395
- package/dist/esm/withHasError-Bh1Viz52.js +0 -254
- package/dist/esm/withScalingGroup-DNBSqRC0.js +0 -71
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { C as CompareUtil } from './VarianceMeasure-DDjChp8C.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parses a raw object-prop attribute value. A blank value yields `data: null`
|
|
5
|
-
* without error. A value starting with `{` must be valid JSON describing an
|
|
6
|
-
* object. Any other bare string is treated as shorthand for
|
|
7
|
-
* `{ [shorthandKey]: value }` when a shorthand key is allowed, otherwise it
|
|
8
|
-
* is a parse error.
|
|
9
|
-
*/
|
|
10
|
-
function parseSpec(raw, shorthandKey) {
|
|
11
|
-
var _a;
|
|
12
|
-
const trimmed = (_a = raw === null || raw === void 0 ? void 0 : raw.trim()) !== null && _a !== void 0 ? _a : "";
|
|
13
|
-
if (trimmed === "" || trimmed === "null") {
|
|
14
|
-
return { data: null, parseError: false };
|
|
15
|
-
}
|
|
16
|
-
if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
17
|
-
try {
|
|
18
|
-
const parsed = JSON.parse(trimmed);
|
|
19
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
20
|
-
return { data: null, parseError: true };
|
|
21
|
-
}
|
|
22
|
-
return { data: parsed, parseError: false };
|
|
23
|
-
}
|
|
24
|
-
catch (_b) {
|
|
25
|
-
return { data: null, parseError: true };
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (shorthandKey !== null) {
|
|
29
|
-
return { data: { [shorthandKey]: trimmed }, parseError: false };
|
|
30
|
-
}
|
|
31
|
-
return { data: null, parseError: true };
|
|
32
|
-
}
|
|
33
|
-
function collectUnknownKeys(data, knownKeys) {
|
|
34
|
-
return Object.keys(data).filter((key) => !knownKeys.includes(key));
|
|
35
|
-
}
|
|
36
|
-
function readString(data, key, invalid) {
|
|
37
|
-
if (!CompareUtil.isExisting(data[key])) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
if (CompareUtil.isString(data[key])) {
|
|
41
|
-
return data[key];
|
|
42
|
-
}
|
|
43
|
-
invalid.push(key);
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
function readNumber(data, key, invalid) {
|
|
47
|
-
if (!CompareUtil.isExisting(data[key])) {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
if (CompareUtil.isNumber(data[key])) {
|
|
51
|
-
return data[key];
|
|
52
|
-
}
|
|
53
|
-
invalid.push(key);
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
function readHighlight(data, invalid) {
|
|
57
|
-
if (!CompareUtil.isExisting(data.highlight)) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
if (!CompareUtil.isObject(data.highlight) || Array.isArray(data.highlight)) {
|
|
61
|
-
invalid.push("highlight");
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
const range = data.highlight;
|
|
65
|
-
const result = {};
|
|
66
|
-
const from = readNumber(range, "from", invalid);
|
|
67
|
-
const to = readNumber(range, "to", invalid);
|
|
68
|
-
if (from !== undefined) {
|
|
69
|
-
result.from = from;
|
|
70
|
-
}
|
|
71
|
-
if (to !== undefined) {
|
|
72
|
-
result.to = to;
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
const AXIS_KEYS = ["measure", "label", "unit", "min", "max", "refLine", "highlight"];
|
|
77
|
-
function toAxisConfig(data) {
|
|
78
|
-
const invalidFields = [];
|
|
79
|
-
const measure = readString(data, "measure", invalidFields);
|
|
80
|
-
if (measure === undefined || measure.trim() === "") {
|
|
81
|
-
invalidFields.push("measure");
|
|
82
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
|
|
83
|
-
}
|
|
84
|
-
const config = { measure: measure.trim() };
|
|
85
|
-
config.label = readString(data, "label", invalidFields);
|
|
86
|
-
config.unit = readString(data, "unit", invalidFields);
|
|
87
|
-
config.min = readNumber(data, "min", invalidFields);
|
|
88
|
-
config.max = readNumber(data, "max", invalidFields);
|
|
89
|
-
config.refLine = readNumber(data, "refLine", invalidFields);
|
|
90
|
-
config.highlight = readHighlight(data, invalidFields);
|
|
91
|
-
return { config, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
|
|
92
|
-
}
|
|
93
|
-
const SIZE_KEYS = ["measure", "label", "unit", "group"];
|
|
94
|
-
function toSizeConfig(data) {
|
|
95
|
-
const invalidFields = [];
|
|
96
|
-
const measure = readString(data, "measure", invalidFields);
|
|
97
|
-
if (measure === undefined || measure.trim() === "") {
|
|
98
|
-
invalidFields.push("measure");
|
|
99
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
|
|
100
|
-
}
|
|
101
|
-
const config = { measure: measure.trim() };
|
|
102
|
-
config.label = readString(data, "label", invalidFields);
|
|
103
|
-
config.unit = readString(data, "unit", invalidFields);
|
|
104
|
-
config.group = readString(data, "group", invalidFields);
|
|
105
|
-
return { config, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
|
|
106
|
-
}
|
|
107
|
-
const SHARE_KEYS = ["measure"];
|
|
108
|
-
function toShareConfig(data) {
|
|
109
|
-
const invalidFields = [];
|
|
110
|
-
const measure = readString(data, "measure", invalidFields);
|
|
111
|
-
if (measure === undefined || measure.trim() === "") {
|
|
112
|
-
invalidFields.push("measure");
|
|
113
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
|
|
114
|
-
}
|
|
115
|
-
return { config: { measure: measure.trim() }, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
|
|
116
|
-
}
|
|
117
|
-
const ISO_KEYS = ["values", "label", "unit", "highlight"];
|
|
118
|
-
function toIsoConfig(data) {
|
|
119
|
-
const invalidFields = [];
|
|
120
|
-
let values = null;
|
|
121
|
-
if (data.values === "auto") {
|
|
122
|
-
values = "auto";
|
|
123
|
-
}
|
|
124
|
-
else if (CompareUtil.isArray(data.values) && data.values.every((v) => CompareUtil.isNumber(v))) {
|
|
125
|
-
values = data.values;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
invalidFields.push("values");
|
|
129
|
-
}
|
|
130
|
-
if (values === null) {
|
|
131
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
|
|
132
|
-
}
|
|
133
|
-
const config = { values };
|
|
134
|
-
config.label = readString(data, "label", invalidFields);
|
|
135
|
-
config.unit = readString(data, "unit", invalidFields);
|
|
136
|
-
if (CompareUtil.isExisting(data.highlight)) {
|
|
137
|
-
if (CompareUtil.isObject(data.highlight) && !Array.isArray(data.highlight)) {
|
|
138
|
-
const from = readNumber(data.highlight, "from", invalidFields);
|
|
139
|
-
if (from !== undefined) {
|
|
140
|
-
config.highlight = { from };
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
invalidFields.push("highlight");
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return { config, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
|
|
148
|
-
}
|
|
149
|
-
const LABEL_KEYS = ["points", "values", "max"];
|
|
150
|
-
function toLabelConfig(data, defaults) {
|
|
151
|
-
const invalidFields = [];
|
|
152
|
-
const config = { points: defaults.points, values: defaults.values, max: defaults.max };
|
|
153
|
-
if (CompareUtil.isExisting(data.points)) {
|
|
154
|
-
if (data.points === "auto" || data.points === "none" || data.points === "all") {
|
|
155
|
-
config.points = data.points;
|
|
156
|
-
}
|
|
157
|
-
else if (CompareUtil.isArray(data.points) && data.points.every((p) => CompareUtil.isString(p))) {
|
|
158
|
-
config.points = data.points;
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
invalidFields.push("points");
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (CompareUtil.isExisting(data.values)) {
|
|
165
|
-
if (CompareUtil.isBoolean(data.values)) {
|
|
166
|
-
config.values = data.values;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
invalidFields.push("values");
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (CompareUtil.isExisting(data.max)) {
|
|
173
|
-
if (CompareUtil.isNumber(data.max) && data.max > 0) {
|
|
174
|
-
config.max = Math.floor(data.max);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
invalidFields.push("max");
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return { config, unknownKeys: collectUnknownKeys(data, LABEL_KEYS), invalidFields };
|
|
181
|
-
}
|
|
182
|
-
const FACET_KEYS = ["level", "columns"];
|
|
183
|
-
function toFacetConfig(data) {
|
|
184
|
-
const invalidFields = [];
|
|
185
|
-
const level = CompareUtil.isString(data.level) ? data.level.toLowerCase() : null;
|
|
186
|
-
if (level !== "rowgroup" && level !== "category") {
|
|
187
|
-
invalidFields.push("level");
|
|
188
|
-
return { config: null, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
|
|
189
|
-
}
|
|
190
|
-
const config = { level };
|
|
191
|
-
if (CompareUtil.isExisting(data.columns)) {
|
|
192
|
-
if (CompareUtil.isNumber(data.columns) && data.columns >= 1) {
|
|
193
|
-
config.columns = Math.floor(data.columns);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
invalidFields.push("columns");
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return { config, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
|
|
200
|
-
}
|
|
201
|
-
const LEGEND_KEYS = ["show", "position"];
|
|
202
|
-
function toLegendConfig(data) {
|
|
203
|
-
const invalidFields = [];
|
|
204
|
-
const config = { show: true, position: "right" };
|
|
205
|
-
if (CompareUtil.isExisting(data.show)) {
|
|
206
|
-
if (CompareUtil.isBoolean(data.show)) {
|
|
207
|
-
config.show = data.show;
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
invalidFields.push("show");
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (CompareUtil.isExisting(data.position)) {
|
|
214
|
-
if (data.position === "right" || data.position === "bottom") {
|
|
215
|
-
config.position = data.position;
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
invalidFields.push("position");
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return { config, unknownKeys: collectUnknownKeys(data, LEGEND_KEYS), invalidFields };
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export { toSizeConfig as a, toShareConfig as b, toFacetConfig as c, toLabelConfig as d, toLegendConfig as e, toIsoConfig as f, parseSpec as p, toAxisConfig as t };
|
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import { F as Formatter } from './SVGStyle-OrPkzjcb.js';
|
|
2
|
-
import './VarianceMeasure-DDjChp8C.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
|
-
// One bbox() per label, not two: svg.js caches nothing, and on a detached
|
|
155
|
-
// tree each call clones the subtree into the document to measure it.
|
|
156
|
-
const box = text.bbox();
|
|
157
|
-
const boxWidth = box.w;
|
|
158
|
-
const boxHeight = box.h;
|
|
159
|
-
let rectX = 0;
|
|
160
|
-
let rectY = 0;
|
|
161
|
-
const textX = text.x();
|
|
162
|
-
let textY = text.y();
|
|
163
|
-
if (this.horizontalHookLocation === HookLocation.Left) {
|
|
164
|
-
labelAnchor = "left";
|
|
165
|
-
rectX = text.x();
|
|
166
|
-
}
|
|
167
|
-
else if (this.horizontalHookLocation === HookLocation.Center) {
|
|
168
|
-
labelAnchor = "middle";
|
|
169
|
-
rectX = text.x() - (boxWidth + 2) / 2;
|
|
170
|
-
}
|
|
171
|
-
else if (this.horizontalHookLocation === HookLocation.Right) {
|
|
172
|
-
labelAnchor = "end";
|
|
173
|
-
rectX = text.x() - boxWidth;
|
|
174
|
-
}
|
|
175
|
-
if (this.verticalHookLocation === HookLocation.Center) {
|
|
176
|
-
textY = text.y() - (boxHeight * 1.2) / 2;
|
|
177
|
-
rectY = textY + boxHeight * 0.2;
|
|
178
|
-
}
|
|
179
|
-
else if (this.verticalHookLocation === HookLocation.Top) {
|
|
180
|
-
textY -= boxHeight / 4;
|
|
181
|
-
rectY = textY + boxHeight * 0.2;
|
|
182
|
-
}
|
|
183
|
-
else if (this.verticalHookLocation === HookLocation.Bottom) {
|
|
184
|
-
textY -= boxHeight;
|
|
185
|
-
rectY = textY + boxHeight * 0.2; // + (boxHeight / 2);
|
|
186
|
-
}
|
|
187
|
-
text.move(textX, textY);
|
|
188
|
-
text.font({ anchor: labelAnchor });
|
|
189
|
-
if (this.segmentFillColor != null) {
|
|
190
|
-
text.fill(getContrastTextColor(this.segmentFillColor));
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
label
|
|
194
|
-
.rect(boxWidth + 2, boxHeight * 0.8)
|
|
195
|
-
.stroke(background)
|
|
196
|
-
.fill(background)
|
|
197
|
-
.opacity(0.9)
|
|
198
|
-
.move(rectX - 1, rectY)
|
|
199
|
-
.insertBefore(text);
|
|
200
|
-
}
|
|
201
|
-
return text;
|
|
202
|
-
}
|
|
203
|
-
createElementID(prefix, groupPrefix) {
|
|
204
|
-
return prefix + "_" + groupPrefix + "_" + this.ID_SCENARIOLABEL;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Scenario priority for label collision resolution.
|
|
210
|
-
* Lower number = higher priority. AC always wins.
|
|
211
|
-
*/
|
|
212
|
-
const SCENARIO_PRIORITY = {
|
|
213
|
-
ac: 1,
|
|
214
|
-
pp: 2,
|
|
215
|
-
fc: 3,
|
|
216
|
-
pl: 4,
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Direction a label can be placed relative to its marker.
|
|
220
|
-
*/
|
|
221
|
-
var LabelDirection;
|
|
222
|
-
(function (LabelDirection) {
|
|
223
|
-
LabelDirection[LabelDirection["Above"] = 0] = "Above";
|
|
224
|
-
LabelDirection[LabelDirection["Below"] = 1] = "Below";
|
|
225
|
-
LabelDirection[LabelDirection["Left"] = 2] = "Left";
|
|
226
|
-
LabelDirection[LabelDirection["Right"] = 3] = "Right";
|
|
227
|
-
})(LabelDirection || (LabelDirection = {}));
|
|
228
|
-
/**
|
|
229
|
-
* Manages label collision detection across multiple line series in line charts.
|
|
230
|
-
* Tracks the bounding boxes of all registered labels and detects overlaps.
|
|
231
|
-
* Supports scenario-based priority: when labels collide and cannot be repositioned,
|
|
232
|
-
* lower-priority scenario labels are hidden (AC > PP > FC > PL).
|
|
233
|
-
*
|
|
234
|
-
* Uses 4-direction placement: Above, Below, Left, Right.
|
|
235
|
-
*/
|
|
236
|
-
class LabelCollisionManager {
|
|
237
|
-
constructor() {
|
|
238
|
-
this.labels = [];
|
|
239
|
-
this.scenarioLabels = [];
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Clears all registered labels. Call this before drawing a new chart.
|
|
243
|
-
*/
|
|
244
|
-
clear() {
|
|
245
|
-
this.labels = [];
|
|
246
|
-
this.scenarioLabels = [];
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Registers a label's bounding box for collision detection.
|
|
250
|
-
*/
|
|
251
|
-
register(bounds) {
|
|
252
|
-
this.labels.push(bounds);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Checks if a label at the given bounds would collide with any existing labels.
|
|
256
|
-
*/
|
|
257
|
-
hasCollision(bounds) {
|
|
258
|
-
return this.labels.some((existing) => this.intersects(bounds, existing));
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Tries each direction in priorityOrder to find a non-colliding placement.
|
|
262
|
-
* Returns the first non-colliding LabelPlacement, or null if all 4 collide
|
|
263
|
-
* with higher-priority scenario labels (meaning this label should be hidden).
|
|
264
|
-
*
|
|
265
|
-
* @param centerX Center X position of the marker
|
|
266
|
-
* @param markerY Y position of the marker center
|
|
267
|
-
* @param width Estimated label width
|
|
268
|
-
* @param height Estimated label height
|
|
269
|
-
* @param pointIndex The data point index
|
|
270
|
-
* @param markerSize The marker size
|
|
271
|
-
* @param scenarioType e.g. "ac", "pp", "fc", "pl"
|
|
272
|
-
* @param priorityOrder Directions to try, in priority order
|
|
273
|
-
*/
|
|
274
|
-
getOptimalPlacement(centerX, markerY, width, height, pointIndex, markerSize, scenarioType, priorityOrder) {
|
|
275
|
-
const priority = SCENARIO_PRIORITY[scenarioType] || 99;
|
|
276
|
-
const gap = 8;
|
|
277
|
-
const halfMarker = markerSize / 2;
|
|
278
|
-
// Try each direction in the caller's preferred order
|
|
279
|
-
for (const direction of priorityOrder) {
|
|
280
|
-
const placement = this.calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction);
|
|
281
|
-
if (!this.hasCollision(placement.bounds)) {
|
|
282
|
-
return placement;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
// All 4 positions collide. Check if any collide ONLY with lower-priority
|
|
286
|
-
// labels (meaning we could still place here — the other label would lose).
|
|
287
|
-
// But to keep it simple: hide only if all positions collide with higher-priority labels.
|
|
288
|
-
for (const direction of priorityOrder) {
|
|
289
|
-
const placement = this.calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction);
|
|
290
|
-
if (!this.collidesWithHigherPriority(placement.bounds, priority)) {
|
|
291
|
-
// This position only collides with equal or lower priority — claim it
|
|
292
|
-
return placement;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
// All positions collide with higher-priority labels — hide
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Computes the LabelPlacement for a given direction.
|
|
300
|
-
*/
|
|
301
|
-
calculatePlacementForDirection(centerX, markerY, width, height, pointIndex, halfMarker, gap, direction) {
|
|
302
|
-
let labelX;
|
|
303
|
-
let labelY;
|
|
304
|
-
let verticalHook;
|
|
305
|
-
let horizontalHook;
|
|
306
|
-
let boundsX;
|
|
307
|
-
let boundsY;
|
|
308
|
-
switch (direction) {
|
|
309
|
-
case LabelDirection.Above:
|
|
310
|
-
labelX = centerX;
|
|
311
|
-
labelY = markerY - halfMarker - gap;
|
|
312
|
-
verticalHook = HookLocation.Bottom;
|
|
313
|
-
horizontalHook = HookLocation.Center;
|
|
314
|
-
boundsX = centerX - width / 2;
|
|
315
|
-
boundsY = markerY - halfMarker - gap - height;
|
|
316
|
-
break;
|
|
317
|
-
case LabelDirection.Below:
|
|
318
|
-
labelX = centerX;
|
|
319
|
-
labelY = markerY + halfMarker + gap;
|
|
320
|
-
verticalHook = HookLocation.Top;
|
|
321
|
-
horizontalHook = HookLocation.Center;
|
|
322
|
-
boundsX = centerX - width / 2;
|
|
323
|
-
// Top hook shifts text up by height/4, so bounds start earlier
|
|
324
|
-
boundsY = markerY + halfMarker + gap - height / 4;
|
|
325
|
-
break;
|
|
326
|
-
case LabelDirection.Left:
|
|
327
|
-
labelX = centerX - halfMarker - gap;
|
|
328
|
-
labelY = markerY;
|
|
329
|
-
verticalHook = HookLocation.Center;
|
|
330
|
-
horizontalHook = HookLocation.Right;
|
|
331
|
-
boundsX = centerX - halfMarker - gap - width;
|
|
332
|
-
// Center hook shifts text up by height*0.6
|
|
333
|
-
boundsY = markerY - height * 0.6;
|
|
334
|
-
break;
|
|
335
|
-
case LabelDirection.Right:
|
|
336
|
-
labelX = centerX + halfMarker + gap;
|
|
337
|
-
labelY = markerY;
|
|
338
|
-
verticalHook = HookLocation.Center;
|
|
339
|
-
horizontalHook = HookLocation.Left;
|
|
340
|
-
boundsX = centerX + halfMarker + gap;
|
|
341
|
-
// Center hook shifts text up by height*0.6
|
|
342
|
-
boundsY = markerY - height * 0.6;
|
|
343
|
-
break;
|
|
344
|
-
}
|
|
345
|
-
const bounds = {
|
|
346
|
-
x: boundsX,
|
|
347
|
-
y: boundsY,
|
|
348
|
-
width,
|
|
349
|
-
height,
|
|
350
|
-
pointIndex,
|
|
351
|
-
preferredHook: verticalHook,
|
|
352
|
-
};
|
|
353
|
-
return { labelX, labelY, verticalHook, horizontalHook, bounds };
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Checks if bounds collide with any registered label that has higher priority.
|
|
357
|
-
*/
|
|
358
|
-
collidesWithHigherPriority(bounds, priority) {
|
|
359
|
-
return this.labels.some((existing) => {
|
|
360
|
-
if (!existing.scenarioType)
|
|
361
|
-
return false;
|
|
362
|
-
const existingPriority = SCENARIO_PRIORITY[existing.scenarioType] || 99;
|
|
363
|
-
return existingPriority < priority && this.intersects(bounds, existing);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Checks whether a scenario label at the end of a line should be hidden
|
|
368
|
-
* because it's too close to a higher-priority scenario label.
|
|
369
|
-
*/
|
|
370
|
-
shouldHideScenarioLabel(x, y, scenarioType, proximityThreshold = 20) {
|
|
371
|
-
const priority = SCENARIO_PRIORITY[scenarioType] || 99;
|
|
372
|
-
if (priority <= 1)
|
|
373
|
-
return false; // AC is never hidden
|
|
374
|
-
return this.scenarioLabels.some((existing) => {
|
|
375
|
-
const existingPriority = SCENARIO_PRIORITY[existing.scenarioType] || 99;
|
|
376
|
-
if (existingPriority >= priority)
|
|
377
|
-
return false;
|
|
378
|
-
const dy = Math.abs(y - existing.y);
|
|
379
|
-
const dx = Math.abs(x - existing.x);
|
|
380
|
-
return dy < proximityThreshold && dx < proximityThreshold;
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Registers a scenario label position for proximity checking.
|
|
385
|
-
*/
|
|
386
|
-
registerScenarioLabel(x, y, scenarioType) {
|
|
387
|
-
this.scenarioLabels.push({ x, y, scenarioType });
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Checks if two bounding boxes intersect (overlap).
|
|
391
|
-
*/
|
|
392
|
-
intersects(a, b) {
|
|
393
|
-
return !(a.x + a.width < b.x || // a is completely to the left of b
|
|
394
|
-
b.x + b.width < a.x || // b is completely to the left of a
|
|
395
|
-
a.y + a.height < b.y || // a is completely above b
|
|
396
|
-
b.y + b.height < a.y // b is completely above a
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Gets the number of registered labels.
|
|
401
|
-
*/
|
|
402
|
-
getLabelCount() {
|
|
403
|
-
return this.labels.length;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
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 };
|