@bino-bi/bn-template-engine 1.0.0-next.45 → 1.0.0-next.47
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/index.esm.js +1 -1
- package/dist/bn-template-engine/{p-DVE0-sOv.js → p-3ktFZb1x.js} +1 -1
- package/dist/bn-template-engine/p-444a231f.entry.js +1 -0
- package/dist/bn-template-engine/{p-48871742.entry.js → p-6ab684a9.entry.js} +1 -1
- package/dist/bn-template-engine/p-7pLJBHT2.js +1 -0
- package/dist/bn-template-engine/{p-5a64f90f.entry.js → p-9a24e486.entry.js} +1 -1
- package/dist/bn-template-engine/p-BL07yV8P.js +1 -0
- package/dist/bn-template-engine/p-DXtYQE4s.js +1 -0
- package/dist/bn-template-engine/p-DY5fMUX8.js +1 -0
- package/dist/bn-template-engine/{p-qpZjVnX5.js → p-Dvlw60RF.js} +1 -1
- package/dist/bn-template-engine/p-GstO_GU5.js +2 -0
- package/dist/bn-template-engine/p-a6017fce.entry.js +1 -0
- package/dist/bn-template-engine/{p-8b28c9bd.entry.js → p-b3f5eba0.entry.js} +1 -1
- package/dist/bn-template-engine/p-ddc1b2a9.entry.js +1 -0
- package/dist/bn-template-engine/p-hV2evPFR.js +1 -0
- package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +657 -114
- package/dist/cjs/bn-grid.cjs.entry.js +164 -37
- package/dist/cjs/bn-image.cjs.entry.js +3 -3
- package/dist/cjs/bn-internationalization.cjs.entry.js +3 -3
- package/dist/cjs/bn-ruleset.cjs.entry.js +3 -3
- package/dist/cjs/bn-template-engine.cjs.js +2 -2
- package/dist/cjs/bn-text.cjs.entry.js +4 -4
- package/dist/cjs/index-CM6022qm.js +66 -0
- package/dist/cjs/{index-DGis1BzT.js → index-DwBbheYB.js} +2 -1
- package/dist/cjs/index.cjs.js +6 -14
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{localFrame-U3Qs0psw.js → localFrame-C4RBw_zT.js} +1 -1
- package/dist/cjs/types-BngAWYMW.js +17 -0
- package/dist/cjs/{withBodyObserver-S-FGHpAX.js → withBodyObserver-CIGVLQEB.js} +2 -2
- package/dist/cjs/{withHasError-BkBrsCpI.js → withHasError-CZFrIJw0.js} +12 -6
- package/dist/cjs/{withStyled-BZb6snOx.js → withStyled-DHKHBdRb.js} +41 -6
- package/dist/cjs/{withTranslation-1qTs5Fi7.js → withTranslation-CLwC9a8V.js} +3 -3
- package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +33 -2
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +112 -16
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +3 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.js +113 -3
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +261 -22
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +224 -14
- package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -9
- package/dist/collection/components/bn-chart-time/utils/elements/Axis.js +9 -1
- package/dist/collection/components/bn-chart-time/utils/elements/Column.js +10 -4
- package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -6
- package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +9 -3
- package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +2 -2
- package/dist/collection/components/bn-chart-time/utils/model/DataPoint.js +9 -6
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +15 -0
- package/dist/collection/components/bn-context/bn-context.js +86 -1
- package/dist/collection/components/bn-grid/bn-grid.js +118 -24
- package/dist/collection/components/bn-grid/utils/cellLayout.js +55 -9
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +4 -2
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +23 -1
- package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.css +10 -0
- package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.js +23 -1
- package/dist/collection/components/bn-title/bn-title.js +40 -2
- package/dist/collection/index.js +1 -0
- package/dist/collection/stores/componentStyles.js +9 -3
- package/dist/collection/stores/internationalization.js +2 -2
- package/dist/collection/utils/DateStringFactory.js +19 -0
- package/dist/collection/utils/model/DataFormatDigits.js +4 -2
- package/dist/collection/utils/model/VarianceScenario.js +13 -0
- package/dist/collection/utils/notation.js +56 -0
- package/dist/collection/utils/validate.js +4 -0
- package/dist/collection/utils/withComponentStyle.js +14 -4
- package/dist/components/bn-annotation-layer.js +1 -1
- package/dist/components/bn-annotation-list.js +1 -1
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body.js +1 -1
- package/dist/components/bn-card.js +1 -1
- package/dist/components/bn-chart-bubble-renderer.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet-renderer.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter-renderer.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure-renderer.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time-renderer.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-footer.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-message.js +1 -1
- package/dist/components/bn-page.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-renderer.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title-renderer.js +1 -1
- package/dist/components/bn-title.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-fKJx8WtW.js → p-2t-lysdb.js} +1 -1
- package/dist/components/{p-2eicD9rF.js → p-4xaxuPVU.js} +1 -1
- package/dist/components/p-6242qMx1.js +1 -0
- package/dist/components/p-6gET6YXc.js +1 -0
- package/dist/components/p-BFWvVe7v.js +1 -0
- package/dist/components/{p-CyfGkLMh.js → p-BFoRIqDi.js} +1 -1
- package/dist/components/p-BP2sJ8k9.js +1 -0
- package/dist/components/{p-B4L069XF.js → p-BgdoWKFY.js} +1 -1
- package/dist/components/{p-BzjGUtYh.js → p-BjgkgCAQ.js} +1 -1
- package/dist/components/p-BnmylmXF.js +2 -0
- package/dist/components/p-Bp5Xj4-s.js +1 -0
- package/dist/components/{p-Dq9dG0Kr.js → p-BrQCbmG0.js} +1 -1
- package/dist/components/{p-NBaq67dL.js → p-C-3TOa6K.js} +1 -1
- package/dist/components/{p-M2k_I8lv.js → p-C8rpOS5t.js} +1 -1
- package/dist/components/{p-BfUdaxZ9.js → p-CG-iY7pQ.js} +1 -1
- package/dist/components/{p-B2bvM2Ig.js → p-CLjuZoiT.js} +1 -1
- package/dist/components/p-CUoPUIej.js +1 -0
- package/dist/components/p-CZzlLTQc.js +1 -0
- package/dist/components/p-CmvpJzLd.js +1 -0
- package/dist/components/{p-CvEdUq8i.js → p-CrZ_O3DT.js} +1 -1
- package/dist/components/{p-eWxolPDU.js → p-CytMTBFu.js} +1 -1
- package/dist/components/{p-4vVbchX2.js → p-D32TsLzd.js} +1 -1
- package/dist/components/p-D3hr9wra.js +1 -0
- package/dist/components/{p-BXg3v5AO.js → p-DDo-fu3v.js} +1 -1
- package/dist/components/{p-B5tixDPM.js → p-DFybNETX.js} +1 -1
- package/dist/components/p-DJSj3oQq.js +1 -0
- package/dist/components/p-DMAaBt7n.js +1 -0
- package/dist/components/{p-Cel0a6ma.js → p-DRU71K0s.js} +1 -1
- package/dist/components/p-DRmphEA0.js +1 -0
- package/dist/components/{p-9mUU4itF.js → p-DUZCLRVu.js} +1 -1
- package/dist/components/p-DY5fMUX8.js +1 -0
- package/dist/components/p-D_K7tYhY.js +1 -0
- package/dist/components/{p-DaOm9YwQ.js → p-DdvG1D18.js} +1 -1
- package/dist/components/p-Do4GqlMV.js +1 -0
- package/dist/components/p-Dw3rv_Y9.js +1 -0
- package/dist/components/{p-BXXjh6We.js → p-Dyzb4ika.js} +1 -1
- package/dist/components/p-JG4Sx1lE.js +1 -0
- package/dist/components/p-TNX3alPU.js +1 -0
- package/dist/components/p-Uc0zvXcQ.js +1 -0
- package/dist/components/p-VtNvNyZK.js +1 -0
- package/dist/components/{p-Y9bth2Y_.js → p-Zuxd3z0q.js} +1 -1
- package/dist/components/{p-7ieJFBUk.js → p-dO0utE8m.js} +1 -1
- package/dist/components/{p-16rjcQ0t.js → p-j42D1yrQ.js} +1 -1
- package/dist/components/p-ja0FCkHB.js +1 -0
- package/dist/esm/bn-annotation-layer_30.entry.js +646 -103
- package/dist/esm/bn-grid.entry.js +163 -36
- package/dist/esm/bn-image.entry.js +3 -3
- package/dist/esm/bn-internationalization.entry.js +3 -3
- package/dist/esm/bn-ruleset.entry.js +3 -3
- package/dist/esm/bn-template-engine.js +3 -3
- package/dist/esm/bn-text.entry.js +4 -4
- package/dist/esm/index-DZHir0Ol.js +60 -0
- package/dist/esm/{index-CCZcKl0Q.js → index-GstO_GU5.js} +2 -2
- package/dist/esm/index.js +2 -15
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{localFrame-BNWPPaQa.js → localFrame-WNu1bAPm.js} +1 -1
- package/dist/esm/types-DY5fMUX8.js +15 -0
- package/dist/esm/{withBodyObserver-AHQAUV85.js → withBodyObserver-wJgSN1Pj.js} +2 -2
- package/dist/esm/{withHasError-B6Lvj9Cq.js → withHasError-BDWEBrrb.js} +12 -6
- package/dist/esm/{withStyled-CzzXg64f.js → withStyled-CTZFjg4L.js} +40 -7
- package/dist/esm/{withTranslation-C1gL7wSU.js → withTranslation-BESW5BNq.js} +3 -3
- package/dist/schemas/theme.schema.json +18 -0
- package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +11 -0
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +16 -0
- package/dist/types/components/bn-chart-structure/utils/elements/Needle.d.ts +2 -1
- package/dist/types/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.d.ts +8 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +46 -1
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +37 -0
- package/dist/types/components/bn-chart-time/utils/elements/Axis.d.ts +2 -0
- package/dist/types/components/bn-chart-time/utils/elements/Needle.d.ts +2 -1
- package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +1 -1
- package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +6 -1
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +6 -0
- package/dist/types/components/bn-context/bn-context.d.ts +25 -0
- package/dist/types/components/bn-grid/bn-grid.d.ts +23 -0
- package/dist/types/components/bn-grid/utils/cellLayout.d.ts +39 -3
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -1
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +9 -0
- package/dist/types/components/bn-title/bn-title-renderer/bn-title-renderer.d.ts +2 -0
- package/dist/types/components/bn-title/bn-title.d.ts +10 -0
- package/dist/types/components.d.ts +199 -6
- package/dist/types/index.d.ts +2 -0
- package/dist/types/stores/componentStyles.d.ts +8 -0
- package/dist/types/utils/DateStringFactory.d.ts +4 -0
- package/dist/types/utils/layoutState/types.d.ts +3 -0
- package/dist/types/utils/model/VarianceScenario.d.ts +2 -0
- package/dist/types/utils/notation.d.ts +78 -0
- package/dist/types/utils/validate.d.ts +2 -0
- package/dist/types/utils/withComponentStyle.d.ts +6 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-1b002bd5.entry.js +0 -1
- package/dist/bn-template-engine/p-750b2c82.entry.js +0 -1
- package/dist/bn-template-engine/p-CCZcKl0Q.js +0 -2
- package/dist/bn-template-engine/p-D0tNATZq.js +0 -1
- package/dist/bn-template-engine/p-DF9sfwBN.js +0 -1
- package/dist/bn-template-engine/p-EcC0qLtU.js +0 -1
- package/dist/bn-template-engine/p-b0dfc113.entry.js +0 -1
- package/dist/components/p-1B_s8oPY.js +0 -1
- package/dist/components/p-AwH1w8Mu.js +0 -1
- package/dist/components/p-BPGLOHUe.js +0 -1
- package/dist/components/p-BiSytXUy.js +0 -1
- package/dist/components/p-C2ycO60j.js +0 -1
- package/dist/components/p-C3gYq-HU.js +0 -1
- package/dist/components/p-CEf5X8MZ.js +0 -1
- package/dist/components/p-Chuj-LpI.js +0 -1
- package/dist/components/p-CniN8ALm.js +0 -1
- package/dist/components/p-D40Am1Ap.js +0 -1
- package/dist/components/p-D6YGOYV1.js +0 -2
- package/dist/components/p-DDvWTgk1.js +0 -1
- package/dist/components/p-DJUffGeB.js +0 -1
- package/dist/components/p-DQl2K2Xl.js +0 -1
- package/dist/components/p-DjPWZfry.js +0 -1
- package/dist/components/p-DnDL1pPc.js +0 -1
- package/dist/components/p-Do4oPrkE.js +0 -1
- package/dist/components/p-DwuXVo2h.js +0 -1
- package/dist/components/p-sLbQ7yZ1.js +0 -1
- package/dist/components/p-xIWChKGS.js +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { r as registerInstance, h, a as Host, g as getElement, f as forceUpdate, d as writeTask, F as Fragment$1 } from './index-
|
|
2
|
-
import { S as SYSTEM_STYLE_DEFAULTS, w as withComponentStatus, a as withHasError, g as getStores, C as ComponentRegister, r as runIfExisits, c as clearStoresCache, h as hasInlineJs, d as globalLabelKeys, e as SYSTEM_RULESET_DEFAULTS, X as XY_SERIES_PALETTE, i as getDefaultExportFromCjs, D as DateTime, j as resolveSeriesColor, m as markTreatment, s as shade, k as sourceExpr, l as reportOverflow, u as unknownStyleKeys, n as getOrCreateStores } from './withHasError-
|
|
3
|
-
import { a as withComponentStyle, m as merge, C as CompareUtil, i as isBlankInput, b as isValidInteger, w as withStyled, c as isValidMeasureToken, r as resolveMeasure, s as scenarioFamily, d as scenarioSlotNumber, e as axisInValueUnits, f as isRelativeMeasure, v as validateOrderList, g as isValidDirection, A as AggregationLevel, O as OrderDirection, h as Order, j as OrderColumn, k as
|
|
4
|
-
import { s as sanitizeHtml, g as getParentDimensions, b as getClippedHeight, i as isInheritedValue, f as findLayoutAncestors, r as readInherited, a as withDataset, w as withTranslation, p as parseScaling, c as strokeWidthPx, d as resolveScalingValue, e as formatScalingValue, h as withInheritedProps, j as parseScalingValue } from './withTranslation-
|
|
5
|
-
import { w as withBodyObserver } from './withBodyObserver-
|
|
6
|
-
import { r as readDiagnostics, m as measure, a as resolveStandaloneId, l as localFrameOf, o as originsFor, b as assignIds, c as resolveOwnIdentity, t as toLayoutRect, d as measureContent, e as measureSign } from './localFrame-
|
|
7
|
-
import { LAYOUT_STATE_VERSION } from './
|
|
1
|
+
import { r as registerInstance, h, a as Host, g as getElement, f as forceUpdate, d as writeTask, e as createEvent, F as Fragment$1 } from './index-GstO_GU5.js';
|
|
2
|
+
import { S as SYSTEM_STYLE_DEFAULTS, w as withComponentStatus, a as withHasError, g as getStores, C as ComponentRegister, r as runIfExisits, c as clearStoresCache, h as hasInlineJs, d as globalLabelKeys, e as SYSTEM_RULESET_DEFAULTS, X as XY_SERIES_PALETTE, i as getDefaultExportFromCjs, D as DateTime, j as resolveSeriesColor, m as markTreatment, s as shade, k as sourceExpr, l as reportOverflow, u as unknownStyleKeys, n as getOrCreateStores } from './withHasError-BDWEBrrb.js';
|
|
3
|
+
import { a as withComponentStyle, m as merge, C as CompareUtil, i as isBlankInput, b as isValidInteger, w as withStyled, c as isValidMeasureToken, r as resolveMeasure, s as scenarioFamily, d as scenarioSlotNumber, e as axisInValueUnits, f as isRelativeMeasure, v as validateOrderList, g as isValidDirection, A as AggregationLevel, O as OrderDirection, h as Order, j as OrderColumn, k as isNoScenarios, l as validateScenarioList, n as validateVariancesList, o as isValidLevel, p as isValidMeasureScale, q as validateStackConfig, S as StackBy, t as StackOrder, u as StackMode, x as AdapterUtils, y as OrderAdapter, N as NOT_AVAILABLE, z as relativeVariance, B as isValidNumber, D as isValidDateFormat, E as isValidAxisLabelsMode, F as DateDistance, G as AxisLabelsMode, H as ChartMode, I as DateStringFactory, R as RELATIVE_STACK_UNITS, J as mergeStyleLayers, K as murmur2, L as validateBarColumnsList, M as isTableBarColumnWidth, P as isValidDataFormat, Q as isValidTableType, T as validateThereOfJsonStr, U as isValidThereofPosition, V as validatePartOfJsonStr, W as validateTableOrderList, X as isValidMeasureType, Y as isTableCategoryWidth, Z as validateColumnThereOfJsonStr, _ as validateAttributesJsonStr, $ as DataFormat, a0 as ThereofPosition, a1 as TableType$2, a2 as normalizeOrderToken, a3 as I18nMode, a4 as TableCategoryWidth, a5 as MeasureType, a6 as parseTableAttributeExpression, a7 as BAR_COLUMN_WIDTH_EM, a8 as TableBarColumnWidth, a9 as TableRowType, aa as FIELD_IDENTIFIER_REGEX, ab as parseOrderToken, ac as Scenarios, ad as OrderDirection$1, ae as FactoryState$3, af as validateMeasureList, ag as isValidDate, ah as isValidDateLink, ai as DateLink } from './withStyled-CTZFjg4L.js';
|
|
4
|
+
import { s as sanitizeHtml, g as getParentDimensions, b as getClippedHeight, i as isInheritedValue, f as findLayoutAncestors, r as readInherited, a as withDataset, w as withTranslation, p as parseScaling, c as strokeWidthPx, d as resolveScalingValue, e as formatScalingValue, h as withInheritedProps, j as parseScalingValue } from './withTranslation-BESW5BNq.js';
|
|
5
|
+
import { w as withBodyObserver } from './withBodyObserver-wJgSN1Pj.js';
|
|
6
|
+
import { r as readDiagnostics, m as measure, a as resolveStandaloneId, l as localFrameOf, o as originsFor, b as assignIds, c as resolveOwnIdentity, t as toLayoutRect, d as measureContent, e as measureSign } from './localFrame-WNu1bAPm.js';
|
|
7
|
+
import { L as LAYOUT_STATE_VERSION } from './types-DY5fMUX8.js';
|
|
8
8
|
import { e as errorText, r as reportQueryError } from './queryError-ClruFZD_.js';
|
|
9
|
+
import { I as IBCS_LINE_STYLES, S as SCENARIO_AREA_STYLES, D as DASH_ARRAY, b as buildNotation } from './index-DZHir0Ol.js';
|
|
9
10
|
|
|
10
11
|
const COLOR_NAME = /^[a-z][a-z0-9-]*$/i;
|
|
11
12
|
/**
|
|
@@ -319,6 +320,7 @@ const AnnotationLayer = class {
|
|
|
319
320
|
this.scheduled = false;
|
|
320
321
|
this.run = 0;
|
|
321
322
|
this.observed = new WeakSet();
|
|
323
|
+
this.observedAround = new WeakSet();
|
|
322
324
|
this.reported = new Set();
|
|
323
325
|
/**
|
|
324
326
|
* Places the marks after the next paint. The layer counts as working until
|
|
@@ -346,6 +348,7 @@ const AnnotationLayer = class {
|
|
|
346
348
|
this.stores = getStores(this.element);
|
|
347
349
|
this.pageKey = annotationPageKey(this.element);
|
|
348
350
|
this.observed = new WeakSet();
|
|
351
|
+
this.observedAround = new WeakSet();
|
|
349
352
|
this.resizeObserver = new ResizeObserver(this.schedule);
|
|
350
353
|
this.mutationObserver = new MutationObserver(this.schedule);
|
|
351
354
|
this.observeSize(this.element);
|
|
@@ -412,7 +415,10 @@ const AnnotationLayer = class {
|
|
|
412
415
|
await Promise.all(visuals.map((visual) => { var _a; return (_a = visual.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(visual); }));
|
|
413
416
|
if (run !== this.run)
|
|
414
417
|
return;
|
|
415
|
-
visuals.forEach((visual) =>
|
|
418
|
+
visuals.forEach((visual) => {
|
|
419
|
+
this.observe(visual);
|
|
420
|
+
this.observeAround(visual, page);
|
|
421
|
+
});
|
|
416
422
|
const states = new Map();
|
|
417
423
|
await Promise.all(visuals.map(async (visual) => {
|
|
418
424
|
var _a;
|
|
@@ -571,6 +577,28 @@ const AnnotationLayer = class {
|
|
|
571
577
|
};
|
|
572
578
|
walk(visual.shadowRoot);
|
|
573
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* A component around a target can move it without resizing anything: a
|
|
582
|
+
* grid pads a cell down to line up a baseline, and writes that into its own
|
|
583
|
+
* shadow root, or into the style of a card in the cell.
|
|
584
|
+
*/
|
|
585
|
+
observeAround(visual, page) {
|
|
586
|
+
var _a, _b;
|
|
587
|
+
for (let el = visual.parentElement; el && el !== page; el = el.parentElement) {
|
|
588
|
+
if (this.observedAround.has(el))
|
|
589
|
+
continue;
|
|
590
|
+
this.observedAround.add(el);
|
|
591
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(el, { attributes: true, attributeFilter: ["style"] });
|
|
592
|
+
if (el.shadowRoot) {
|
|
593
|
+
(_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.observe(el.shadowRoot, {
|
|
594
|
+
childList: true,
|
|
595
|
+
subtree: true,
|
|
596
|
+
attributes: true,
|
|
597
|
+
attributeFilter: ["style", "class"],
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
574
602
|
observeSize(element) {
|
|
575
603
|
var _a;
|
|
576
604
|
if (!this.observed.has(element)) {
|
|
@@ -595,7 +623,7 @@ const AnnotationLayer = class {
|
|
|
595
623
|
return (h("g", { class: "mark arrow", "data-label": (_b = mark.badge) === null || _b === void 0 ? void 0 : _b.label }, h("line", { x1: mark.x1, y1: mark.y1, x2: mark.x2, y2: mark.y2, style: { stroke: color, strokeWidth: "1.5" } }), h("polygon", { points: mark.head, style: { fill: color } }), this.renderBadge(mark.badge, color)));
|
|
596
624
|
}
|
|
597
625
|
render() {
|
|
598
|
-
return (h(Host, { key: '
|
|
626
|
+
return (h(Host, { key: 'd4d027728ae578a5ced829a3f86f0137530551fc' }, h("svg", { key: 'a3813930e420db9fdd618bc38c38941295cf4c22', ref: (el) => (this.svg = el) }, this.marks.map((mark) => this.renderMark(mark)))));
|
|
599
627
|
}
|
|
600
628
|
get element() { return getElement(this); }
|
|
601
629
|
static get watchers() { return {
|
|
@@ -2591,6 +2619,19 @@ function resolveSentiment(direction, operation, signedValues) {
|
|
|
2591
2619
|
const subtracts = !signedValues && operation === "-";
|
|
2592
2620
|
return (direction === "op") !== subtracts ? "pos" : "neg";
|
|
2593
2621
|
}
|
|
2622
|
+
/** The scenarios a list of variances is calculated from, each once, in order. */
|
|
2623
|
+
function variancesScenarios(variances) {
|
|
2624
|
+
const scenarios = [];
|
|
2625
|
+
for (const variance of variances) {
|
|
2626
|
+
const parsed = new VarianceScenario(variance);
|
|
2627
|
+
for (const scenario of parsed.isValid ? [parsed.base, parsed.delta] : []) {
|
|
2628
|
+
if (!scenarios.includes(scenario)) {
|
|
2629
|
+
scenarios.push(scenario);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
return scenarios;
|
|
2634
|
+
}
|
|
2594
2635
|
|
|
2595
2636
|
const FAMILIES = ["ac", "pp", "fc", "pl"];
|
|
2596
2637
|
const SLOT_BY_COLOR_INDEX = { 10: "ac", 20: "pp", 30: "fc", 50: "pl" };
|
|
@@ -14234,7 +14275,7 @@ const Chart$1 = class Chart {
|
|
|
14234
14275
|
}
|
|
14235
14276
|
validateScenario(newValue) {
|
|
14236
14277
|
const errId = "WARN_scenarios";
|
|
14237
|
-
if (isInheritedValue(newValue)) {
|
|
14278
|
+
if (isInheritedValue(newValue) || isNoScenarios(newValue)) {
|
|
14238
14279
|
this.errors.remove(errId);
|
|
14239
14280
|
return;
|
|
14240
14281
|
}
|
|
@@ -14380,6 +14421,25 @@ const Chart$1 = class Chart {
|
|
|
14380
14421
|
this.errors.remove(errId);
|
|
14381
14422
|
}
|
|
14382
14423
|
}
|
|
14424
|
+
validateDataFormatDigitsDecimal(newValue) {
|
|
14425
|
+
this.validateDigits("dataFormatDigitsDecimal", newValue);
|
|
14426
|
+
}
|
|
14427
|
+
validateDataFormatDigitsPercent(newValue) {
|
|
14428
|
+
this.validateDigits("dataFormatDigitsPercent", newValue);
|
|
14429
|
+
}
|
|
14430
|
+
validateDigits(name, value) {
|
|
14431
|
+
const errId = `WARN_${name}`;
|
|
14432
|
+
if (!isValidInteger(value) || Number(value) < 0 || Number(value) > 100) {
|
|
14433
|
+
this.errors.addOrReplace({
|
|
14434
|
+
id: errId,
|
|
14435
|
+
type: "warning",
|
|
14436
|
+
message: name + ": invalid value '" + value + "' is not supported.",
|
|
14437
|
+
});
|
|
14438
|
+
}
|
|
14439
|
+
else {
|
|
14440
|
+
this.errors.remove(errId);
|
|
14441
|
+
}
|
|
14442
|
+
}
|
|
14383
14443
|
validateStack(newValue) {
|
|
14384
14444
|
const errId = "WARN_stack";
|
|
14385
14445
|
const errors = validateStackConfig(newValue);
|
|
@@ -14485,6 +14545,14 @@ const Chart$1 = class Chart {
|
|
|
14485
14545
|
* @example measure-unit="EUR"
|
|
14486
14546
|
*/
|
|
14487
14547
|
this.measureUnit = "";
|
|
14548
|
+
/**
|
|
14549
|
+
* Number of decimal digits of the value labels
|
|
14550
|
+
*/
|
|
14551
|
+
this.dataFormatDigitsDecimal = 1;
|
|
14552
|
+
/**
|
|
14553
|
+
* Number of decimal digits of the percent labels (relative variances, shares of a 100 % stack)
|
|
14554
|
+
*/
|
|
14555
|
+
this.dataFormatDigitsPercent = 2;
|
|
14488
14556
|
/**
|
|
14489
14557
|
* Stacking configuration as a JSON string. When set, bars are drawn as
|
|
14490
14558
|
* stacked segments instead of side-by-side.
|
|
@@ -14577,6 +14645,8 @@ const Chart$1 = class Chart {
|
|
|
14577
14645
|
componentWillLoad() {
|
|
14578
14646
|
this.validateFilter(this.filter);
|
|
14579
14647
|
this.validateScenario(this.scenarios);
|
|
14648
|
+
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
14649
|
+
this.validateDataFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
14580
14650
|
this.validateVariances(this.variances);
|
|
14581
14651
|
this.validateUnitScaling(this.unitScaling);
|
|
14582
14652
|
//this.validateSelectedStyle(this.selectedStyle);
|
|
@@ -14756,8 +14826,7 @@ const Chart$1 = class Chart {
|
|
|
14756
14826
|
}
|
|
14757
14827
|
prepareDimension() {
|
|
14758
14828
|
const parent = getParentDimensions(this.element);
|
|
14759
|
-
const
|
|
14760
|
-
const segmentCount = 1 + variancesList.length;
|
|
14829
|
+
const segmentCount = Math.max(1, this.prepareSegments().length);
|
|
14761
14830
|
this.canvasWidthSegmented = parent.width / segmentCount;
|
|
14762
14831
|
return { width: this.canvasWidthSegmented, height: parent.height };
|
|
14763
14832
|
}
|
|
@@ -14768,6 +14837,10 @@ const Chart$1 = class Chart {
|
|
|
14768
14837
|
this.errors.remove("AUTO_scenarios");
|
|
14769
14838
|
return scenarios.value.split(",").map((entry) => entry.trim());
|
|
14770
14839
|
}
|
|
14840
|
+
if (isNoScenarios(scenarios.value)) {
|
|
14841
|
+
this.errors.remove("AUTO_scenarios");
|
|
14842
|
+
return [];
|
|
14843
|
+
}
|
|
14771
14844
|
const isAuto = ((_a = scenarios.value) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
14772
14845
|
if (isBlankInput(scenarios.value) || isAuto) {
|
|
14773
14846
|
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
@@ -14796,6 +14869,15 @@ const Chart$1 = class Chart {
|
|
|
14796
14869
|
}
|
|
14797
14870
|
return variances === null || variances === void 0 ? void 0 : variances.split(",").map((entry) => entry.trim());
|
|
14798
14871
|
}
|
|
14872
|
+
/** `scenarios="none"`: the chart draws its variances only. */
|
|
14873
|
+
hidesScenarios() {
|
|
14874
|
+
const scenarios = this.resolveInherited("scenarios", this.scenarios);
|
|
14875
|
+
return !scenarios.inherited && isNoScenarios(scenarios.value);
|
|
14876
|
+
}
|
|
14877
|
+
/** The segments side by side: `""` is the base chart, else one variance. */
|
|
14878
|
+
prepareSegments() {
|
|
14879
|
+
return this.hidesScenarios() ? this.prepareVariances() : ["", ...this.prepareVariances()];
|
|
14880
|
+
}
|
|
14799
14881
|
prepareHideCategories(idx) {
|
|
14800
14882
|
return idx >= 1 || !this.showCategories;
|
|
14801
14883
|
}
|
|
@@ -14964,7 +15046,8 @@ const Chart$1 = class Chart {
|
|
|
14964
15046
|
});
|
|
14965
15047
|
}
|
|
14966
15048
|
prepareChartTitle(idx) {
|
|
14967
|
-
|
|
15049
|
+
// a variance keeps its own name as title
|
|
15050
|
+
if (idx >= 1 || this.hidesScenarios()) {
|
|
14968
15051
|
return "";
|
|
14969
15052
|
}
|
|
14970
15053
|
return this.chartTitle;
|
|
@@ -15074,10 +15157,11 @@ const Chart$1 = class Chart {
|
|
|
15074
15157
|
const ppu = this.preparePixelPerUnit();
|
|
15075
15158
|
const ppp = this.preparePixelPerPercentage();
|
|
15076
15159
|
const stackConfig = this.prepareStackConfig();
|
|
15077
|
-
const
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15160
|
+
const isBase = localScenarioString === "";
|
|
15161
|
+
const scenarios = this.hidesScenarios() ? variancesScenarios([localScenarioString]) : this.prepareScenarios();
|
|
15162
|
+
// Dimension stacking uses only the first scenario. Only the base chart draws a stack, a variance needs both of its scenarios
|
|
15163
|
+
const effectiveScenarios = isBase && (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
15164
|
+
return (h("bn-chart-structure-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideCategories: this.prepareHideCategories(idx), pixelPerUnit: ppu, pixelPerPercentage: ppp, reportAutoScaling: this.handleAutoScalingReport, errors: this.errors, limit: this.prepareLimit(), styles: this.prepareStyle(), i18n: this.prepareI18n(), order: this.prepareOrder(), level: this.prepareLevel(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(idx), stackConfig: stackConfig, dataFormatDigits: { percent: this.dataFormatDigitsPercent, decimal: this.dataFormatDigitsDecimal }, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
|
|
15081
15165
|
}
|
|
15082
15166
|
/**
|
|
15083
15167
|
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
@@ -15104,7 +15188,7 @@ const Chart$1 = class Chart {
|
|
|
15104
15188
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
15105
15189
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * factor;
|
|
15106
15190
|
const variances = this.prepareVariances();
|
|
15107
|
-
const layout = collectChartFacadeLayout(this.element, "bn-chart-structure-renderer",
|
|
15191
|
+
const layout = collectChartFacadeLayout(this.element, "bn-chart-structure-renderer", this.prepareSegments().map((segment) => segment || "base"), origins, detail);
|
|
15108
15192
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15109
15193
|
const firstInner = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("bn-chart-structure-renderer");
|
|
15110
15194
|
const state = {
|
|
@@ -15195,13 +15279,19 @@ const Chart$1 = class Chart {
|
|
|
15195
15279
|
});
|
|
15196
15280
|
}
|
|
15197
15281
|
render() {
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
|
|
15282
|
+
const scenariosArray = this.prepareSegments();
|
|
15283
|
+
if (scenariosArray.length === 0) {
|
|
15284
|
+
this.errors.addOrReplace({
|
|
15285
|
+
id: "WARN_scenarios_none",
|
|
15286
|
+
type: "warning",
|
|
15287
|
+
message: "scenarios: none needs at least one variance, the chart is empty.",
|
|
15288
|
+
});
|
|
15289
|
+
}
|
|
15290
|
+
else {
|
|
15291
|
+
this.errors.remove("WARN_scenarios_none");
|
|
15202
15292
|
}
|
|
15203
15293
|
const fontStyles = this.getFontStyles();
|
|
15204
|
-
return (h(Host, { key: '
|
|
15294
|
+
return (h(Host, { key: 'a9b487fd43e785b1f14d0599ad0145a248b35f5d', style: fontStyles }, h("div", { key: '950ab383346b288ab17c2a1bbdfcfcd240e0f4d8', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
15205
15295
|
}
|
|
15206
15296
|
get element() { return getElement(this); }
|
|
15207
15297
|
static get watchers() { return {
|
|
@@ -15235,6 +15325,12 @@ const Chart$1 = class Chart {
|
|
|
15235
15325
|
"measureScale": [{
|
|
15236
15326
|
"validateMeasureScale": 0
|
|
15237
15327
|
}],
|
|
15328
|
+
"dataFormatDigitsDecimal": [{
|
|
15329
|
+
"validateDataFormatDigitsDecimal": 0
|
|
15330
|
+
}],
|
|
15331
|
+
"dataFormatDigitsPercent": [{
|
|
15332
|
+
"validateDataFormatDigitsPercent": 0
|
|
15333
|
+
}],
|
|
15238
15334
|
"stack": [{
|
|
15239
15335
|
"validateStack": 0
|
|
15240
15336
|
}],
|
|
@@ -16944,11 +17040,11 @@ let Needle$1 = class Needle {
|
|
|
16944
17040
|
(_a = this.label) === null || _a === void 0 ? void 0 : _a.updateGroup(newGroup);
|
|
16945
17041
|
return this;
|
|
16946
17042
|
}
|
|
16947
|
-
draw() {
|
|
17043
|
+
draw(dataFormatDigits = { percent: 2, decimal: 1 }) {
|
|
16948
17044
|
var _a, _b, _c;
|
|
16949
17045
|
if (((_a = this.dataPoint) === null || _a === void 0 ? void 0 : _a.value) === undefined) {
|
|
16950
17046
|
// reference 0: the label says "n/a", there is no pin
|
|
16951
|
-
(_b = this.label) === null || _b === void 0 ? void 0 : _b.draw();
|
|
17047
|
+
(_b = this.label) === null || _b === void 0 ? void 0 : _b.draw(dataFormatDigits);
|
|
16952
17048
|
return this;
|
|
16953
17049
|
}
|
|
16954
17050
|
if (this.isEmpty()) {
|
|
@@ -16978,7 +17074,7 @@ let Needle$1 = class Needle {
|
|
|
16978
17074
|
.stroke(strokeStyle)
|
|
16979
17075
|
.cy(this.dimensions.yPos)
|
|
16980
17076
|
.x(this.dimensions.xPos);
|
|
16981
|
-
(_c = this.label) === null || _c === void 0 ? void 0 : _c.draw();
|
|
17077
|
+
(_c = this.label) === null || _c === void 0 ? void 0 : _c.draw(dataFormatDigits);
|
|
16982
17078
|
}
|
|
16983
17079
|
createDimensions(position, dataPoint, index) {
|
|
16984
17080
|
if (dataPoint.getScaledPercentUnit() < 0) {
|
|
@@ -18192,7 +18288,7 @@ class StructureChart {
|
|
|
18192
18288
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
18193
18289
|
dataModel.forEach((elements, index) => {
|
|
18194
18290
|
if (elements["type"] === VarianceType$1.RELATIVE) {
|
|
18195
|
-
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw();
|
|
18291
|
+
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits);
|
|
18196
18292
|
}
|
|
18197
18293
|
else {
|
|
18198
18294
|
scenarioFactory.createVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
@@ -18504,10 +18600,12 @@ class DataFormatDigits {
|
|
|
18504
18600
|
class DataFormatDigitsAdapter {
|
|
18505
18601
|
adapt(data) {
|
|
18506
18602
|
const prefix = new DataFormatDigits();
|
|
18507
|
-
|
|
18603
|
+
// Intl.NumberFormat throws outside 0 to 100
|
|
18604
|
+
const valid = (value) => CompareUtil.isNumber(value) && Number.isInteger(value) && value >= 0 && value <= 100;
|
|
18605
|
+
if (valid(data.percent)) {
|
|
18508
18606
|
prefix.percent = data.percent;
|
|
18509
18607
|
}
|
|
18510
|
-
if (
|
|
18608
|
+
if (valid(data.decimal)) {
|
|
18511
18609
|
prefix.decimal = data.decimal;
|
|
18512
18610
|
}
|
|
18513
18611
|
return prefix;
|
|
@@ -18835,7 +18933,7 @@ const Chart = class {
|
|
|
18835
18933
|
}
|
|
18836
18934
|
validateScenario(newValue) {
|
|
18837
18935
|
const errId = "WARN_scenarios";
|
|
18838
|
-
if (isInheritedValue(newValue)) {
|
|
18936
|
+
if (isInheritedValue(newValue) || isNoScenarios(newValue)) {
|
|
18839
18937
|
this.errors.remove(errId);
|
|
18840
18938
|
return;
|
|
18841
18939
|
}
|
|
@@ -19023,6 +19121,51 @@ const Chart = class {
|
|
|
19023
19121
|
this.errors.remove(errId);
|
|
19024
19122
|
}
|
|
19025
19123
|
}
|
|
19124
|
+
validateDataFormatDigitsDecimal(newValue) {
|
|
19125
|
+
this.validateDigits("dataFormatDigitsDecimal", newValue);
|
|
19126
|
+
}
|
|
19127
|
+
validateDataFormatDigitsPercent(newValue) {
|
|
19128
|
+
this.validateDigits("dataFormatDigitsPercent", newValue);
|
|
19129
|
+
}
|
|
19130
|
+
validateDigits(name, value) {
|
|
19131
|
+
const errId = `WARN_${name}`;
|
|
19132
|
+
if (!isValidInteger(value) || Number(value) < 0 || Number(value) > 100) {
|
|
19133
|
+
this.errors.addOrReplace({
|
|
19134
|
+
id: errId,
|
|
19135
|
+
type: "warning",
|
|
19136
|
+
message: name + ": invalid value '" + value + "' is not supported.",
|
|
19137
|
+
});
|
|
19138
|
+
}
|
|
19139
|
+
else {
|
|
19140
|
+
this.errors.remove(errId);
|
|
19141
|
+
}
|
|
19142
|
+
}
|
|
19143
|
+
validateAxisLabelsStep(newValue) {
|
|
19144
|
+
const errId = "WARN_axisLabelsStep";
|
|
19145
|
+
if (!isValidInteger(newValue) || Number(newValue) < 1) {
|
|
19146
|
+
this.errors.addOrReplace({
|
|
19147
|
+
id: errId,
|
|
19148
|
+
type: "warning",
|
|
19149
|
+
message: "axisLabelsStep: invalid value '" + newValue + "' is not supported.",
|
|
19150
|
+
});
|
|
19151
|
+
}
|
|
19152
|
+
else {
|
|
19153
|
+
this.errors.remove(errId);
|
|
19154
|
+
}
|
|
19155
|
+
}
|
|
19156
|
+
validateAxisTitlePosition(newValue) {
|
|
19157
|
+
const errId = "WARN_axisTitlePosition";
|
|
19158
|
+
if (!isBlankInput(newValue) && !["left", "right", "none"].includes(newValue.trim().toLowerCase())) {
|
|
19159
|
+
this.errors.addOrReplace({
|
|
19160
|
+
id: errId,
|
|
19161
|
+
type: "warning",
|
|
19162
|
+
message: "axisTitlePosition: invalid value '" + newValue + "' is not supported.",
|
|
19163
|
+
});
|
|
19164
|
+
}
|
|
19165
|
+
else {
|
|
19166
|
+
this.errors.remove(errId);
|
|
19167
|
+
}
|
|
19168
|
+
}
|
|
19026
19169
|
constructor(hostRef) {
|
|
19027
19170
|
registerInstance(this, hostRef);
|
|
19028
19171
|
/** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
|
|
@@ -19161,6 +19304,35 @@ const Chart = class {
|
|
|
19161
19304
|
* measureUnit displayed in table.
|
|
19162
19305
|
*/
|
|
19163
19306
|
this.measureUnit = "";
|
|
19307
|
+
/**
|
|
19308
|
+
* Number of decimal digits of the value labels
|
|
19309
|
+
*/
|
|
19310
|
+
this.dataFormatDigitsDecimal = 1;
|
|
19311
|
+
/**
|
|
19312
|
+
* Number of decimal digits of the percent labels (relative variances)
|
|
19313
|
+
*/
|
|
19314
|
+
this.dataFormatDigitsPercent = 2;
|
|
19315
|
+
/**
|
|
19316
|
+
* Prints only every n-th category label, starting with the first period.
|
|
19317
|
+
* 2 labels every second period. Bar mode only.
|
|
19318
|
+
*/
|
|
19319
|
+
this.axisLabelsStep = 1;
|
|
19320
|
+
/**
|
|
19321
|
+
* For a series that changes its scenario along the time axis, for example
|
|
19322
|
+
* AC up to this year and PL after it. In a period where the first scenario
|
|
19323
|
+
* has no value, the next scenario with a value is drawn in its place with
|
|
19324
|
+
* its value label. A vertical line marks the change, and the scenario names
|
|
19325
|
+
* stand under the axis. Variances with the same reference and type share
|
|
19326
|
+
* one row. Bar mode without stack only.
|
|
19327
|
+
*/
|
|
19328
|
+
this.scenarioSwitch = false;
|
|
19329
|
+
/**
|
|
19330
|
+
* Where the axis title stands (the chart title, or the name of a variance).
|
|
19331
|
+
* <br /><br />
|
|
19332
|
+
* values:<br />
|
|
19333
|
+
* ```left // right // none```
|
|
19334
|
+
*/
|
|
19335
|
+
this.axisTitlePosition = "left";
|
|
19164
19336
|
this.pixelPerUnitGroupMap = new Map();
|
|
19165
19337
|
this._autoScaleGuard = false;
|
|
19166
19338
|
this._lastObservedWidth = 0;
|
|
@@ -19239,6 +19411,10 @@ const Chart = class {
|
|
|
19239
19411
|
this.validateMaxBars(this.maxBars);
|
|
19240
19412
|
this.validateStack(this.stack);
|
|
19241
19413
|
this.validateScaling(this.scale);
|
|
19414
|
+
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
19415
|
+
this.validateDataFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
19416
|
+
this.validateAxisLabelsStep(this.axisLabelsStep);
|
|
19417
|
+
this.validateAxisTitlePosition(this.axisTitlePosition);
|
|
19242
19418
|
}
|
|
19243
19419
|
/**
|
|
19244
19420
|
* Content width from the rendered SVG width attributes (segments stack
|
|
@@ -19452,14 +19628,14 @@ const Chart = class {
|
|
|
19452
19628
|
prepareDimension() {
|
|
19453
19629
|
const parent = getParentDimensions(this.element);
|
|
19454
19630
|
const scenariosList = this.prepareScenarios();
|
|
19455
|
-
const
|
|
19456
|
-
this.canvasWidthSegmented = parent.width / (scenariosList.length +
|
|
19631
|
+
const segments = this.prepareSegments();
|
|
19632
|
+
this.canvasWidthSegmented = parent.width / (scenariosList.length + this.prepareVariances().length || 1);
|
|
19457
19633
|
this._lastAppliedHeight = parent.height;
|
|
19458
19634
|
// The base chart and each variance render as vertically stacked segments
|
|
19459
19635
|
// (see render()), so each one may only claim its share of the height.
|
|
19460
19636
|
// The measure-scale footer (first segment only) renders below its SVG:
|
|
19461
19637
|
// reserve roughly one em for it so the fitted charts leave it room.
|
|
19462
|
-
const segmentCount = 1
|
|
19638
|
+
const segmentCount = Math.max(1, segments.length);
|
|
19463
19639
|
const footerAllowance = this.showMeasureScale ? this.getEffectiveFontPx() : 0;
|
|
19464
19640
|
return { width: this.canvasWidthSegmented, height: Math.max(0, parent.height - footerAllowance) / segmentCount };
|
|
19465
19641
|
}
|
|
@@ -19470,6 +19646,10 @@ const Chart = class {
|
|
|
19470
19646
|
this.errors.remove("AUTO_scenarios");
|
|
19471
19647
|
return scenarios.value.split(",").map((entry) => entry.trim());
|
|
19472
19648
|
}
|
|
19649
|
+
if (isNoScenarios(scenarios.value)) {
|
|
19650
|
+
this.errors.remove("AUTO_scenarios");
|
|
19651
|
+
return [];
|
|
19652
|
+
}
|
|
19473
19653
|
const isAuto = ((_a = scenarios.value) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
19474
19654
|
if (isBlankInput(scenarios.value) || isAuto) {
|
|
19475
19655
|
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
@@ -19491,6 +19671,40 @@ const Chart = class {
|
|
|
19491
19671
|
this.errors.remove("AUTO_scenarios");
|
|
19492
19672
|
return (_d = scenarios.value) === null || _d === void 0 ? void 0 : _d.split(",").map((entry) => entry.trim());
|
|
19493
19673
|
}
|
|
19674
|
+
/** `scenarios="none"`: the chart draws its variances only. */
|
|
19675
|
+
hidesScenarios() {
|
|
19676
|
+
const scenarios = this.resolveInherited("scenarios", this.scenarios);
|
|
19677
|
+
return !scenarios.inherited && isNoScenarios(scenarios.value);
|
|
19678
|
+
}
|
|
19679
|
+
/**
|
|
19680
|
+
* The stacked segments, bottom to top: `[]` is the base chart, else the
|
|
19681
|
+
* variances of one row. With `scenarioSwitch`, variances of one type over
|
|
19682
|
+
* the same reference share a row.
|
|
19683
|
+
*/
|
|
19684
|
+
prepareSegments() {
|
|
19685
|
+
const rows = this.hidesScenarios() ? [] : [[]];
|
|
19686
|
+
const rowByKey = new Map();
|
|
19687
|
+
for (const variance of this.prepareVariances()) {
|
|
19688
|
+
const parsed = new VarianceScenario(variance);
|
|
19689
|
+
const key = `${parsed.type}:${parsed.delta}`;
|
|
19690
|
+
const row = this.scenarioSwitch && parsed.isValid ? rowByKey.get(key) : undefined;
|
|
19691
|
+
if (row) {
|
|
19692
|
+
row.push(variance);
|
|
19693
|
+
continue;
|
|
19694
|
+
}
|
|
19695
|
+
const created = [variance];
|
|
19696
|
+
rows.push(created);
|
|
19697
|
+
if (parsed.isValid) {
|
|
19698
|
+
rowByKey.set(key, created);
|
|
19699
|
+
}
|
|
19700
|
+
}
|
|
19701
|
+
return rows;
|
|
19702
|
+
}
|
|
19703
|
+
prepareAxisTitlePosition() {
|
|
19704
|
+
var _a;
|
|
19705
|
+
const position = (_a = this.axisTitlePosition) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase();
|
|
19706
|
+
return position === "right" || position === "none" ? position : "left";
|
|
19707
|
+
}
|
|
19494
19708
|
prepareAvg() {
|
|
19495
19709
|
return this.showOverlayAvg;
|
|
19496
19710
|
}
|
|
@@ -19521,7 +19735,7 @@ const Chart = class {
|
|
|
19521
19735
|
}
|
|
19522
19736
|
}
|
|
19523
19737
|
}
|
|
19524
|
-
if (scenarios.length > 0 && missing.length > 0) {
|
|
19738
|
+
if (!this.hidesScenarios() && scenarios.length > 0 && missing.length > 0) {
|
|
19525
19739
|
this.errors.addOrReplace({
|
|
19526
19740
|
id: errId,
|
|
19527
19741
|
type: "warning",
|
|
@@ -19536,7 +19750,7 @@ const Chart = class {
|
|
|
19536
19750
|
return idx >= 1 || !this.showCategories;
|
|
19537
19751
|
}
|
|
19538
19752
|
prepareI18n() {
|
|
19539
|
-
const i18nMetaLabelsLocal = ["no-data"];
|
|
19753
|
+
const i18nMetaLabelsLocal = ["no-data", "date-format-short-year"];
|
|
19540
19754
|
const i18nMetaLabelsGlobal = globalLabelKeys;
|
|
19541
19755
|
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
19542
19756
|
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
@@ -19646,14 +19860,17 @@ const Chart = class {
|
|
|
19646
19860
|
if (this.syncSpaceLeft > -1) {
|
|
19647
19861
|
return this.syncSpaceLeft;
|
|
19648
19862
|
}
|
|
19649
|
-
|
|
19863
|
+
// without a title on the left only the scenario names stand there
|
|
19864
|
+
const titles = this.prepareAxisTitlePosition() === "left" ? [...this.prepareVariances(), this.chartTitle] : [];
|
|
19865
|
+
const leftSideOffset = Formatter.getMaxWidthOfArrayItems([...titles, ...this.prepareScenarios()], preparedI18n, preparedStyle);
|
|
19650
19866
|
//if(leftSideOffset < this.syncSpaceLeft) {
|
|
19651
19867
|
// return this.syncSpaceLeft;
|
|
19652
19868
|
//}
|
|
19653
19869
|
return leftSideOffset;
|
|
19654
19870
|
}
|
|
19655
19871
|
prepareChartTitle(idx) {
|
|
19656
|
-
|
|
19872
|
+
// a variance keeps its own name as title
|
|
19873
|
+
if (idx >= 1 || this.hidesScenarios()) {
|
|
19657
19874
|
return "";
|
|
19658
19875
|
}
|
|
19659
19876
|
return this.chartTitle;
|
|
@@ -19805,16 +20022,18 @@ const Chart = class {
|
|
|
19805
20022
|
prepareMaxBars() {
|
|
19806
20023
|
return Math.floor(Number(this.maxBars) || 28);
|
|
19807
20024
|
}
|
|
19808
|
-
chartTemplate(
|
|
20025
|
+
chartTemplate(segmentVariances, idx) {
|
|
19809
20026
|
const preparedI18n = this.prepareI18n();
|
|
19810
20027
|
const preparedStyle = this.prepareStyle();
|
|
19811
20028
|
const fullParentWidth = getParentDimensions(this.element).width;
|
|
19812
20029
|
const ppu = this.preparePixelPerUnit();
|
|
19813
20030
|
const ppp = this.preparePixelPerPercentage();
|
|
19814
20031
|
const stackConfig = this.prepareStackConfig();
|
|
19815
|
-
const
|
|
19816
|
-
const
|
|
19817
|
-
|
|
20032
|
+
const isBase = segmentVariances.length === 0;
|
|
20033
|
+
const scenarios = this.hidesScenarios() ? variancesScenarios(segmentVariances) : this.prepareScenarios();
|
|
20034
|
+
// only the base chart draws a stack, a variance needs both of its scenarios
|
|
20035
|
+
const effectiveScenarios = isBase && (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
20036
|
+
return (h("bn-chart-time-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: segmentVariances.length > 0 ? segmentVariances : [""], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu, pixelPerPercentage: ppp, reportAutoScaling: this.handleAutoScalingReport, errors: this.errors, leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), dataFormatDigits: { percent: this.dataFormatDigitsPercent, decimal: this.dataFormatDigitsDecimal }, axisLabelsStep: Math.max(1, Math.floor(Number(this.axisLabelsStep) || 1)), scenarioSwitch: this.scenarioSwitch, axisTitlePosition: this.prepareAxisTitlePosition(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
|
|
19818
20037
|
}
|
|
19819
20038
|
/**
|
|
19820
20039
|
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
@@ -19841,7 +20060,7 @@ const Chart = class {
|
|
|
19841
20060
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
19842
20061
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * factor;
|
|
19843
20062
|
const variances = this.prepareVariances();
|
|
19844
|
-
const layout = collectChartFacadeLayout(this.element, "bn-chart-time-renderer",
|
|
20063
|
+
const layout = collectChartFacadeLayout(this.element, "bn-chart-time-renderer", this.prepareSegments().map((segment) => (segment.length > 0 ? segment.join(",") : "base")), origins, detail);
|
|
19845
20064
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19846
20065
|
const firstInner = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("bn-chart-time-renderer");
|
|
19847
20066
|
const state = {
|
|
@@ -19933,14 +20152,20 @@ const Chart = class {
|
|
|
19933
20152
|
});
|
|
19934
20153
|
}
|
|
19935
20154
|
render() {
|
|
19936
|
-
|
|
19937
|
-
const
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
20155
|
+
this.checkVarianceScenarios(this.prepareVariances());
|
|
20156
|
+
const segments = this.prepareSegments();
|
|
20157
|
+
if (segments.length === 0) {
|
|
20158
|
+
this.errors.addOrReplace({
|
|
20159
|
+
id: "WARN_scenarios_none",
|
|
20160
|
+
type: "warning",
|
|
20161
|
+
message: "scenarios: none needs at least one variance, the chart is empty.",
|
|
20162
|
+
});
|
|
20163
|
+
}
|
|
20164
|
+
else {
|
|
20165
|
+
this.errors.remove("WARN_scenarios_none");
|
|
19941
20166
|
}
|
|
19942
20167
|
const fontStyles = this.getFontStyles();
|
|
19943
|
-
return (h(Host, { key: '
|
|
20168
|
+
return (h(Host, { key: '530c7c27c23afc339ca03506f2cb608774e8a7ed', style: fontStyles }, h("div", { key: '99bbe8fa9d17ef14bbb6a3b5e2dce21025cdc40c', class: "container" }, segments.map(this.chartTemplate))));
|
|
19944
20169
|
}
|
|
19945
20170
|
get element() { return getElement(this); }
|
|
19946
20171
|
static get watchers() { return {
|
|
@@ -19982,6 +20207,18 @@ const Chart = class {
|
|
|
19982
20207
|
}],
|
|
19983
20208
|
"measureScale": [{
|
|
19984
20209
|
"validateMeasureScale": 0
|
|
20210
|
+
}],
|
|
20211
|
+
"dataFormatDigitsDecimal": [{
|
|
20212
|
+
"validateDataFormatDigitsDecimal": 0
|
|
20213
|
+
}],
|
|
20214
|
+
"dataFormatDigitsPercent": [{
|
|
20215
|
+
"validateDataFormatDigitsPercent": 0
|
|
20216
|
+
}],
|
|
20217
|
+
"axisLabelsStep": [{
|
|
20218
|
+
"validateAxisLabelsStep": 0
|
|
20219
|
+
}],
|
|
20220
|
+
"axisTitlePosition": [{
|
|
20221
|
+
"validateAxisTitlePosition": 0
|
|
19985
20222
|
}]
|
|
19986
20223
|
}; }
|
|
19987
20224
|
};
|
|
@@ -20420,6 +20657,8 @@ class CustomPattern {
|
|
|
20420
20657
|
*/
|
|
20421
20658
|
class DataPoint {
|
|
20422
20659
|
constructor(value, scenario, pixelPerUnit, variance) {
|
|
20660
|
+
/** Relative variances beyond this fraction are cut. Infinity when the chart has room for the full pin. */
|
|
20661
|
+
this.percentClamp = DataPoint.PERCENT_CLAMP;
|
|
20423
20662
|
this.value = value;
|
|
20424
20663
|
this.scenario = scenario;
|
|
20425
20664
|
this.pixelPerUnit = pixelPerUnit || 1;
|
|
@@ -20446,7 +20685,7 @@ class DataPoint {
|
|
|
20446
20685
|
return this.value * this.pixelPerUnit;
|
|
20447
20686
|
}
|
|
20448
20687
|
/**
|
|
20449
|
-
* Returns the percentage value scaled to pixel height, clipped at +/-145
|
|
20688
|
+
* Returns the percentage value scaled to pixel height, clipped at +/-145% unless the clamp is lifted.
|
|
20450
20689
|
*
|
|
20451
20690
|
* Values beyond +/-1.45 (145%) are clamped to prevent extreme bars from
|
|
20452
20691
|
* distorting the chart layout. Use {@link isClipped} to check if clipping occurred.
|
|
@@ -20455,11 +20694,11 @@ class DataPoint {
|
|
|
20455
20694
|
if (this.value == null) {
|
|
20456
20695
|
return 0;
|
|
20457
20696
|
}
|
|
20458
|
-
if (this.value >
|
|
20459
|
-
return
|
|
20697
|
+
if (this.value > this.percentClamp) {
|
|
20698
|
+
return this.percentClamp * this.pixelPerUnit;
|
|
20460
20699
|
}
|
|
20461
|
-
if (this.value < -
|
|
20462
|
-
return -
|
|
20700
|
+
if (this.value < -this.percentClamp) {
|
|
20701
|
+
return -this.percentClamp * this.pixelPerUnit;
|
|
20463
20702
|
}
|
|
20464
20703
|
return this.value * this.pixelPerUnit;
|
|
20465
20704
|
}
|
|
@@ -20490,7 +20729,7 @@ class DataPoint {
|
|
|
20490
20729
|
if (this.value == null) {
|
|
20491
20730
|
return false;
|
|
20492
20731
|
}
|
|
20493
|
-
return Math.abs(this.value) >
|
|
20732
|
+
return Math.abs(this.value) > this.percentClamp;
|
|
20494
20733
|
}
|
|
20495
20734
|
/** Returns the fixed display value (145) shown on clipped percentage bars. */
|
|
20496
20735
|
getClippedValue() {
|
|
@@ -20502,6 +20741,7 @@ class DataPoint {
|
|
|
20502
20741
|
return (_a = this.scenario) === null || _a === void 0 ? void 0 : _a.slice(0, 2);
|
|
20503
20742
|
}
|
|
20504
20743
|
}
|
|
20744
|
+
DataPoint.PERCENT_CLAMP = 1.45;
|
|
20505
20745
|
|
|
20506
20746
|
// import { IAdapter } from "../../../../utils/helper/IAdapter";
|
|
20507
20747
|
// import { CompareUtil } from "../../../../utils/helper/CompareUtil";
|
|
@@ -20764,6 +21004,7 @@ class Axis {
|
|
|
20764
21004
|
this.scenarioType = axis.scenarioType;
|
|
20765
21005
|
this.labelText = axis.labelText || null;
|
|
20766
21006
|
this.isRelative = axis.isRelative || false;
|
|
21007
|
+
this.titlePosition = axis.titlePosition || "left";
|
|
20767
21008
|
this.position = position;
|
|
20768
21009
|
this.svgGroup = svgParentGroup.group().id(this.ID_AXIS);
|
|
20769
21010
|
}
|
|
@@ -20771,12 +21012,19 @@ class Axis {
|
|
|
20771
21012
|
if (null == text) {
|
|
20772
21013
|
text = "";
|
|
20773
21014
|
}
|
|
21015
|
+
if (this.titlePosition === "right") {
|
|
21016
|
+
group
|
|
21017
|
+
.text(text)
|
|
21018
|
+
.addClass(this.CSS_AXIS_TITLE)
|
|
21019
|
+
.move(this.position.getAxisEndPositionX() + this.position.spacings.labelToColumn, this.position.getAxisTitlePositionY(true, this.isRelative));
|
|
21020
|
+
return;
|
|
21021
|
+
}
|
|
20774
21022
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20775
21023
|
const title = group.text(text).addClass(this.CSS_AXIS_TITLE).attr("text-anchor", "middle");
|
|
20776
21024
|
title.move(this.position.getAxisTitlePositionX(group), this.position.getAxisTitlePositionY(true, this.isRelative));
|
|
20777
21025
|
}
|
|
20778
21026
|
draw() {
|
|
20779
|
-
if (this.labelText) {
|
|
21027
|
+
if (this.labelText && this.titlePosition !== "none") {
|
|
20780
21028
|
this.drawAxisTitle(this.svgGroup, this.labelText);
|
|
20781
21029
|
}
|
|
20782
21030
|
this.svgGroup
|
|
@@ -20861,16 +21109,22 @@ class Column {
|
|
|
20861
21109
|
return this;
|
|
20862
21110
|
}
|
|
20863
21111
|
draw(dataFormatDigits = { percent: 2, decimal: 1 }, measureScale = new SiPrefix()) {
|
|
20864
|
-
var _a;
|
|
21112
|
+
var _a, _b, _c;
|
|
20865
21113
|
// TODE: JHE: Remove DataFOrmatDigits Type Duplicates
|
|
20866
21114
|
if (this.isEmpty()) {
|
|
20867
21115
|
return this;
|
|
20868
21116
|
}
|
|
20869
21117
|
const scenarioStyle = this.getScenarioStyle();
|
|
20870
|
-
|
|
20871
|
-
|
|
21118
|
+
let strokeStyle = this.convertToSVGStyle(scenarioStyle, "stroke");
|
|
21119
|
+
let fillStyle = this.getFillStyle(scenarioStyle);
|
|
21120
|
+
if (this.isVarianceColumn && this.dataPoint.notation === "pl") {
|
|
21121
|
+
// outlined like a plan column: the colour of the variance on the edge only
|
|
21122
|
+
const planWidth = Number((_b = (_a = this.columnBarStyles) === null || _a === void 0 ? void 0 : _a.pl) === null || _b === void 0 ? void 0 : _b.width);
|
|
21123
|
+
strokeStyle = { color: (scenarioStyle === null || scenarioStyle === void 0 ? void 0 : scenarioStyle.fill) || this.FALLBACK_COLOUR, width: planWidth > 0 ? planWidth : 1 };
|
|
21124
|
+
fillStyle = this.styles.fontStyles.background || "#ffffff";
|
|
21125
|
+
}
|
|
20872
21126
|
this.scenarioGroup.attr(dataPointAttributes(this.dataPoint.key));
|
|
20873
|
-
(
|
|
21127
|
+
(_c = this.columnGroup) === null || _c === void 0 ? void 0 : _c.attr(dataPointAttributes(this.dataPoint.key, "element"));
|
|
20874
21128
|
if (this.columnGroup != null) {
|
|
20875
21129
|
if (this.isOverflowing && this.overflowConfig) {
|
|
20876
21130
|
this.drawOverdriveBar(fillStyle, strokeStyle);
|
|
@@ -21237,11 +21491,11 @@ class Needle {
|
|
|
21237
21491
|
(_a = this.dataLabel) === null || _a === void 0 ? void 0 : _a.updateGroup(newGroup);
|
|
21238
21492
|
return this;
|
|
21239
21493
|
}
|
|
21240
|
-
draw() {
|
|
21494
|
+
draw(dataFormatDigits = { percent: 2, decimal: 1 }) {
|
|
21241
21495
|
var _a, _b, _c;
|
|
21242
21496
|
if (((_a = this.dataPoint) === null || _a === void 0 ? void 0 : _a.value) === undefined) {
|
|
21243
21497
|
// reference 0: the label says "n/a", there is no pin
|
|
21244
|
-
(_b = this.dataLabel) === null || _b === void 0 ? void 0 : _b.draw();
|
|
21498
|
+
(_b = this.dataLabel) === null || _b === void 0 ? void 0 : _b.draw(true, dataFormatDigits);
|
|
21245
21499
|
return this;
|
|
21246
21500
|
}
|
|
21247
21501
|
if (this.isEmpty()) {
|
|
@@ -21261,6 +21515,12 @@ class Needle {
|
|
|
21261
21515
|
fillStyle = polygonPattern.pattern;
|
|
21262
21516
|
}
|
|
21263
21517
|
}
|
|
21518
|
+
if (this.dataPoint.notation === "pl") {
|
|
21519
|
+
// outlined like a plan column: the colour of the variance on the edge only
|
|
21520
|
+
strokeStyle.color = (scenarioStyle === null || scenarioStyle === void 0 ? void 0 : scenarioStyle.fill) || strokeStyle.color;
|
|
21521
|
+
strokeStyle.width = Math.max(1, Number(strokeStyle.width) || 0);
|
|
21522
|
+
fillStyle = this.styles.fontStyles.background || "#ffffff";
|
|
21523
|
+
}
|
|
21264
21524
|
if (this.dimensions.clipped) {
|
|
21265
21525
|
this.createClippedNeedleHead(fillStyle, strokeStyle);
|
|
21266
21526
|
}
|
|
@@ -21273,7 +21533,7 @@ class Needle {
|
|
|
21273
21533
|
.y(this.dimensions.yPos)
|
|
21274
21534
|
.fill(fillStyle)
|
|
21275
21535
|
.stroke(strokeStyle);
|
|
21276
|
-
(_c = this.dataLabel) === null || _c === void 0 ? void 0 : _c.draw();
|
|
21536
|
+
(_c = this.dataLabel) === null || _c === void 0 ? void 0 : _c.draw(true, dataFormatDigits);
|
|
21277
21537
|
}
|
|
21278
21538
|
createDimensions(position, dataPoint, index) {
|
|
21279
21539
|
if (dataPoint.getScaledPercentUnit() < 0) {
|
|
@@ -21340,12 +21600,6 @@ class Needle {
|
|
|
21340
21600
|
}
|
|
21341
21601
|
}
|
|
21342
21602
|
|
|
21343
|
-
const IBCS_LINE_STYLES = {
|
|
21344
|
-
ac: { markerFill: "#000000", markerStroke: "#000000", lineColor: "#000000" },
|
|
21345
|
-
pp: { markerFill: "#999999", markerStroke: "#999999", lineColor: "#999999" },
|
|
21346
|
-
fc: { markerFill: "#ffffff", markerStroke: "#000000", lineColor: "#000000", lineDashArray: "4,4" },
|
|
21347
|
-
pl: { markerFill: "#ffffff", markerStroke: "#000000", lineColor: "#000000" },
|
|
21348
|
-
};
|
|
21349
21603
|
class LineSeries {
|
|
21350
21604
|
constructor(position, styles, dataPoints, scenarioGroup, labelGroup, scenarioName, scenarioLabel, _i18n, collisionManager = null,
|
|
21351
21605
|
/** Style slot (ac, pp, fc, pl) of the line. Without it the scenario name decides. */
|
|
@@ -21704,15 +21958,6 @@ class StackedColumn {
|
|
|
21704
21958
|
}
|
|
21705
21959
|
}
|
|
21706
21960
|
|
|
21707
|
-
/**
|
|
21708
|
-
* IBCS-style area fill colors for stacked area charts.
|
|
21709
|
-
*/
|
|
21710
|
-
const SCENARIO_AREA_STYLES = {
|
|
21711
|
-
ac: { fill: "#000000", opacity: 0.3, lineColor: "#000000" },
|
|
21712
|
-
pp: { fill: "#999999", opacity: 0.3, lineColor: "#999999" },
|
|
21713
|
-
fc: { fill: "#000000", opacity: 0.2, lineColor: "#000000", dashArray: "4,4" },
|
|
21714
|
-
pl: { fill: "#000000", opacity: 0.1, lineColor: "#000000" },
|
|
21715
|
-
};
|
|
21716
21961
|
const GRAYSCALE_AREA_STYLES = [
|
|
21717
21962
|
{ fill: "#000000", opacity: 0.3 },
|
|
21718
21963
|
{ fill: "#555555", opacity: 0.25 },
|
|
@@ -21988,12 +22233,12 @@ class ScenarioFactory {
|
|
|
21988
22233
|
}
|
|
21989
22234
|
return new Line(this.position, this.styles, dataPoint, previousDataPoint, index, isPrimaryColumn, columnGroup, lineLabel).updateLabelGroup(labelGroup);
|
|
21990
22235
|
}
|
|
21991
|
-
createPrimaryBar(dataPoint, index) {
|
|
22236
|
+
createPrimaryBar(dataPoint, index, withScenarioLabel = true) {
|
|
21992
22237
|
const isPrimaryColumn = true;
|
|
21993
22238
|
const columnGroup = this.svgGroups.scenario1.group().id("" + index);
|
|
21994
22239
|
const labelGroup = this.svgGroups.scenario1Label.group().id("" + index);
|
|
21995
22240
|
let columnLabel = null;
|
|
21996
|
-
if (this.isLastDataPoint(index)) {
|
|
22241
|
+
if (withScenarioLabel && this.isLastDataPoint(index)) {
|
|
21997
22242
|
columnLabel = `${this.i18n.get(dataPoint.scenario) || dataPoint.scenario}`;
|
|
21998
22243
|
}
|
|
21999
22244
|
return new Column(this.position, this.styles, dataPoint, index, isPrimaryColumn, columnGroup, columnLabel, this.overflowConfig).updateLabelGroup(labelGroup);
|
|
@@ -22216,6 +22461,11 @@ class TimeChart {
|
|
|
22216
22461
|
this.availableWidth = 0;
|
|
22217
22462
|
this.overflowConfig = null;
|
|
22218
22463
|
this.lastScenarios = [];
|
|
22464
|
+
this.axisLabelsStep = 1;
|
|
22465
|
+
this.scenarioSwitch = false;
|
|
22466
|
+
this.axisTitlePosition = "left";
|
|
22467
|
+
/** Periods in which more than one variance of a shared row has a value. */
|
|
22468
|
+
this.varianceOverlaps = 0;
|
|
22219
22469
|
this.db = db;
|
|
22220
22470
|
this.tableName = tableName;
|
|
22221
22471
|
this.ruleSet = ruleSet || new IBCSRuleSet();
|
|
@@ -22270,7 +22520,8 @@ class TimeChart {
|
|
|
22270
22520
|
this.position.padding.top +
|
|
22271
22521
|
this.position.padding.bottom +
|
|
22272
22522
|
this.position.spacings.labelToAxis +
|
|
22273
|
-
fontSize
|
|
22523
|
+
fontSize + // axis labels approximate height
|
|
22524
|
+
this.switchNamesHeight();
|
|
22274
22525
|
const overdriveZoneHeight = fontSize * 1.5;
|
|
22275
22526
|
const breakGap = fontSize * 0.3;
|
|
22276
22527
|
const cutHeight = availableHeight - nonBarOverhead - overdriveZoneHeight - breakGap;
|
|
@@ -22294,7 +22545,7 @@ class TimeChart {
|
|
|
22294
22545
|
};
|
|
22295
22546
|
}
|
|
22296
22547
|
setConfig(config) {
|
|
22297
|
-
var _a;
|
|
22548
|
+
var _a, _b, _c, _d;
|
|
22298
22549
|
this.state = FactoryState$1.DIRTY;
|
|
22299
22550
|
// Must precede setSource/populateModel: the locale is baked into the
|
|
22300
22551
|
// normalizeDate() SQL as well as into the axis date labels.
|
|
@@ -22307,11 +22558,14 @@ class TimeChart {
|
|
|
22307
22558
|
this.pixelPerPercentage = config.pixelPerPercentage;
|
|
22308
22559
|
this.axisLabelsMode = config.axisLabelsMode;
|
|
22309
22560
|
this.intervalSpanLimit = config.intervalSpanLimit;
|
|
22561
|
+
this.axisLabelsStep = (_a = config.axisLabelsStep) !== null && _a !== void 0 ? _a : 1;
|
|
22562
|
+
this.scenarioSwitch = (_b = config.scenarioSwitch) !== null && _b !== void 0 ? _b : false;
|
|
22563
|
+
this.axisTitlePosition = (_c = config.axisTitlePosition) !== null && _c !== void 0 ? _c : "left";
|
|
22310
22564
|
this.dateInterval = this.findDateInterval(config.dateInterval);
|
|
22311
22565
|
this.dataModel = this.populateModel(scenarios, this.dateInterval);
|
|
22312
22566
|
this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
|
|
22313
22567
|
this.configTitle = config.title;
|
|
22314
|
-
this.configVariances = (
|
|
22568
|
+
this.configVariances = (_d = config === null || config === void 0 ? void 0 : config.variances) !== null && _d !== void 0 ? _d : [];
|
|
22315
22569
|
this.updateTitle();
|
|
22316
22570
|
this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
|
|
22317
22571
|
this.smallestVarianceDataPointValue = this.findSmallestDataPointValue(this.variancesDataModel);
|
|
@@ -22379,8 +22633,10 @@ class TimeChart {
|
|
|
22379
22633
|
}
|
|
22380
22634
|
/** Derives the variance title from the stored config and the current i18n map. */
|
|
22381
22635
|
updateTitle() {
|
|
22382
|
-
var _a;
|
|
22383
|
-
|
|
22636
|
+
var _a, _b;
|
|
22637
|
+
// variances that share a row have the same reference: the first one names the row
|
|
22638
|
+
const variance = this.scenarioSwitch ? (_a = this.configVariances) === null || _a === void 0 ? void 0 : _a[0] : (_b = this.configVariances) === null || _b === void 0 ? void 0 : _b.toString();
|
|
22639
|
+
this.title = this.configTitle || Formatter.translateScenarioLabel(variance, this.i18n);
|
|
22384
22640
|
}
|
|
22385
22641
|
/**
|
|
22386
22642
|
* Resolves the dataset (a table or view in the shared alasql database) and
|
|
@@ -22421,7 +22677,15 @@ class TimeChart {
|
|
|
22421
22677
|
// Also consider bbox-based measurement as a fallback (works for rects)
|
|
22422
22678
|
const bboxWidth = Math.max(this.axisCategoryArea.width, this.scenariosArea.width);
|
|
22423
22679
|
const bboxTotal = bboxWidth > 0 ? bboxWidth + this.position.leftSideLabelLength : 0;
|
|
22424
|
-
|
|
22680
|
+
let titleEnd = 0;
|
|
22681
|
+
if (this.axisTitlePosition === "right" && this.title) {
|
|
22682
|
+
const titleWidth = CalculateSize(this.title, {
|
|
22683
|
+
font: this.styles.fontStyles.font,
|
|
22684
|
+
fontSize: this.styles.fontStyles.size + "px",
|
|
22685
|
+
}).width;
|
|
22686
|
+
titleEnd = axisEnd + this.position.spacings.labelToColumn + titleWidth + this.styles.padding.right;
|
|
22687
|
+
}
|
|
22688
|
+
return Math.max(axisEnd + labelBuffer, bboxTotal, titleEnd);
|
|
22425
22689
|
}
|
|
22426
22690
|
getAllocatedCanvasHeight() {
|
|
22427
22691
|
if (this.smallestVarianceDataPointValue.value == null ||
|
|
@@ -22452,7 +22716,91 @@ class TimeChart {
|
|
|
22452
22716
|
const bboxHeight = isOnSameAxisSide
|
|
22453
22717
|
? this.axisCategoryArea.height + this.scenariosArea.height
|
|
22454
22718
|
: this.scenariosArea.height;
|
|
22455
|
-
return Math.max(analyticalHeight, bboxHeight);
|
|
22719
|
+
return Math.max(analyticalHeight, bboxHeight) + this.switchNamesHeight();
|
|
22720
|
+
}
|
|
22721
|
+
/** Room for the scenario names under the category labels of a series that changes its scenario. */
|
|
22722
|
+
switchNamesHeight() {
|
|
22723
|
+
return !this.hideAxisLabels && this.switchRuns().length > 1 ? this.position.dataLabelHeight : 0;
|
|
22724
|
+
}
|
|
22725
|
+
/** True for a scenario slot that has a value in this period. */
|
|
22726
|
+
static hasValue(dataPoint) {
|
|
22727
|
+
return dataPoint != null && !dataPoint.isEmpty() && dataPoint.value != null && !Number.isNaN(dataPoint.value);
|
|
22728
|
+
}
|
|
22729
|
+
/**
|
|
22730
|
+
* The slots that continue the first scenario: they have values, and only in
|
|
22731
|
+
* periods where the first scenario has none. Empty without `scenarioSwitch`.
|
|
22732
|
+
*/
|
|
22733
|
+
followerSlots() {
|
|
22734
|
+
if (!this.scenarioSwitch || this.stackConfig != null || this.determineEffectiveChartMode() !== ChartMode.BAR) {
|
|
22735
|
+
return [];
|
|
22736
|
+
}
|
|
22737
|
+
return ["scenario2", "scenario3", "scenario4"].filter((slot) => {
|
|
22738
|
+
let values = 0;
|
|
22739
|
+
for (const row of this.dataModel) {
|
|
22740
|
+
if (TimeChart.hasValue(row[slot])) {
|
|
22741
|
+
if (TimeChart.hasValue(row.scenario1)) {
|
|
22742
|
+
return false;
|
|
22743
|
+
}
|
|
22744
|
+
values++;
|
|
22745
|
+
}
|
|
22746
|
+
}
|
|
22747
|
+
return values > 0;
|
|
22748
|
+
});
|
|
22749
|
+
}
|
|
22750
|
+
/** The slot drawn as the column of a period: the first scenario, else the first follower with a value. */
|
|
22751
|
+
visibleSlot(row, followers) {
|
|
22752
|
+
var _a;
|
|
22753
|
+
if (TimeChart.hasValue(row.scenario1)) {
|
|
22754
|
+
return "scenario1";
|
|
22755
|
+
}
|
|
22756
|
+
return (_a = followers.find((slot) => TimeChart.hasValue(row[slot]))) !== null && _a !== void 0 ? _a : null;
|
|
22757
|
+
}
|
|
22758
|
+
/** Runs of periods with the same visible scenario. A period without a value belongs to the run before it. */
|
|
22759
|
+
switchRuns() {
|
|
22760
|
+
const followers = this.followerSlots();
|
|
22761
|
+
if (followers.length === 0) {
|
|
22762
|
+
return [];
|
|
22763
|
+
}
|
|
22764
|
+
const runs = [];
|
|
22765
|
+
this.dataModel.forEach((row, index) => {
|
|
22766
|
+
const slot = this.visibleSlot(row, followers);
|
|
22767
|
+
const scenario = slot ? row[slot].scenario : null;
|
|
22768
|
+
const last = runs[runs.length - 1];
|
|
22769
|
+
if (scenario == null || (last === null || last === void 0 ? void 0 : last.scenario) === scenario) {
|
|
22770
|
+
if (last)
|
|
22771
|
+
last.to = index;
|
|
22772
|
+
return;
|
|
22773
|
+
}
|
|
22774
|
+
runs.push({ scenario, from: index, to: index });
|
|
22775
|
+
});
|
|
22776
|
+
return runs;
|
|
22777
|
+
}
|
|
22778
|
+
/** Number of periods where variances of one row overlap. The component warns about it. */
|
|
22779
|
+
getVarianceOverlaps() {
|
|
22780
|
+
return this.varianceOverlaps;
|
|
22781
|
+
}
|
|
22782
|
+
/**
|
|
22783
|
+
* Lifts the 145 % cut of relative variances when the uncut pins fit into
|
|
22784
|
+
* `availableHeight`. Only for a fixed percentage scale: the author chose it,
|
|
22785
|
+
* so a long pin is cut for lack of room only.
|
|
22786
|
+
*/
|
|
22787
|
+
fitRelativeVariances(availableHeight) {
|
|
22788
|
+
const points = this.variancesDataModel
|
|
22789
|
+
.filter((entry) => entry.type === VarianceType.RELATIVE)
|
|
22790
|
+
.map((entry) => entry.scenario1);
|
|
22791
|
+
if (points.length === 0 || !points.some((point) => point.isClipped())) {
|
|
22792
|
+
return;
|
|
22793
|
+
}
|
|
22794
|
+
const setClamp = (clamp) => {
|
|
22795
|
+
points.forEach((point) => (point.percentClamp = clamp));
|
|
22796
|
+
this.updatePosition(this.lastScenarios);
|
|
22797
|
+
};
|
|
22798
|
+
setClamp(Number.POSITIVE_INFINITY);
|
|
22799
|
+
this.layout();
|
|
22800
|
+
// an unknown height on either side keeps the cut
|
|
22801
|
+
if (!(availableHeight > 0) || !(this.getAllocatedCanvasHeight() <= availableHeight)) {
|
|
22802
|
+
setClamp(DataPoint.PERCENT_CLAMP);
|
|
22803
|
+
}
|
|
22456
22804
|
}
|
|
22457
22805
|
/**
|
|
22458
22806
|
* Total column extent (data units) proportional to pixelPerUnit, covering
|
|
@@ -22955,6 +23303,11 @@ class TimeChart {
|
|
|
22955
23303
|
if (dataModel != null && dataModel.length > 0) {
|
|
22956
23304
|
firstRow = dataModel[0];
|
|
22957
23305
|
}
|
|
23306
|
+
this.varianceOverlaps = 0;
|
|
23307
|
+
const parsed = variancesConfig.map((variance) => new VarianceScenario(variance));
|
|
23308
|
+
if (this.scenarioSwitch && parsed.filter((variance) => variance.isValid).length > 1) {
|
|
23309
|
+
return this.populateSharedVarianceRow(variancesConfig, parsed, dataModel, firstRow);
|
|
23310
|
+
}
|
|
22958
23311
|
for (const varianceScenario in variancesConfig) {
|
|
22959
23312
|
const scenarios = new VarianceScenario(variancesConfig[varianceScenario]);
|
|
22960
23313
|
if (scenarios.isValid) {
|
|
@@ -22984,6 +23337,47 @@ class TimeChart {
|
|
|
22984
23337
|
}
|
|
22985
23338
|
return varianceModel;
|
|
22986
23339
|
}
|
|
23340
|
+
/**
|
|
23341
|
+
* One row for several variances over the same reference: each period shows
|
|
23342
|
+
* the first variance that has a value there, in the notation of its scenario.
|
|
23343
|
+
*/
|
|
23344
|
+
populateSharedVarianceRow(variancesConfig, parsed, dataModel, firstRow) {
|
|
23345
|
+
const varianceModel = [];
|
|
23346
|
+
const valid = parsed.map((variance, index) => ({ variance, name: variancesConfig[index] }));
|
|
23347
|
+
const candidates = valid.filter((entry) => entry.variance.isValid);
|
|
23348
|
+
const isRelative = candidates[0].variance.type === "dr";
|
|
23349
|
+
const pixelPerUnit = isRelative ? this.pixelPerPercentage : this.pixelPerUnit;
|
|
23350
|
+
dataModel.forEach((row, index) => {
|
|
23351
|
+
let point = null;
|
|
23352
|
+
let values = 0;
|
|
23353
|
+
for (const { variance, name } of candidates) {
|
|
23354
|
+
const value = this.calculateVariance(variance, row, this.mapScenarios(variance, firstRow));
|
|
23355
|
+
if (value === null || Number.isNaN(value)) {
|
|
23356
|
+
continue;
|
|
23357
|
+
}
|
|
23358
|
+
values++;
|
|
23359
|
+
if (point == null) {
|
|
23360
|
+
point = new DataPoint(value, variance.delta, pixelPerUnit, variance.direction);
|
|
23361
|
+
point.notation = variance.base.slice(0, 2);
|
|
23362
|
+
point.key = { date: TimeChart.pointDate(row.date), scenario: name };
|
|
23363
|
+
}
|
|
23364
|
+
}
|
|
23365
|
+
if (values > 1) {
|
|
23366
|
+
this.varianceOverlaps++;
|
|
23367
|
+
}
|
|
23368
|
+
varianceModel.push({
|
|
23369
|
+
id: index,
|
|
23370
|
+
category: row.category,
|
|
23371
|
+
type: isRelative ? VarianceType.RELATIVE : VarianceType.ABSOLUTE,
|
|
23372
|
+
date: row.date,
|
|
23373
|
+
scenario1: point !== null && point !== void 0 ? point : new DataPoint(null, candidates[0].variance.delta, pixelPerUnit, candidates[0].variance.direction),
|
|
23374
|
+
scenario2: new DataPoint(null, null, null, null),
|
|
23375
|
+
scenario3: new DataPoint(null, null, null, null),
|
|
23376
|
+
scenario4: new DataPoint(null, null, null, null),
|
|
23377
|
+
});
|
|
23378
|
+
});
|
|
23379
|
+
return varianceModel;
|
|
23380
|
+
}
|
|
22987
23381
|
calculateVariance(scenarios, element, scenarioMap) {
|
|
22988
23382
|
const scenarioBase = scenarioMap.get(scenarios.base);
|
|
22989
23383
|
const scenarioDelta = scenarioMap.get(scenarios.delta);
|
|
@@ -23026,6 +23420,11 @@ class TimeChart {
|
|
|
23026
23420
|
createDateFactory() {
|
|
23027
23421
|
const factory = new DateStringFactory();
|
|
23028
23422
|
factory.setLocale(this.locale);
|
|
23423
|
+
// a Luxon pattern from the translations, for example ’yy
|
|
23424
|
+
const shortYear = this.i18n.get("date-format-short-year");
|
|
23425
|
+
if (typeof shortYear === "string" && /y/.test(shortYear) && !shortYear.includes("date-format")) {
|
|
23426
|
+
factory.patchDateFormatShort({ year: shortYear });
|
|
23427
|
+
}
|
|
23029
23428
|
return factory;
|
|
23030
23429
|
}
|
|
23031
23430
|
/**
|
|
@@ -23070,6 +23469,12 @@ class TimeChart {
|
|
|
23070
23469
|
if (elements["type"] === VarianceType.RELATIVE) {
|
|
23071
23470
|
isRelative = true;
|
|
23072
23471
|
}
|
|
23472
|
+
// in smart mode a period that starts a year or month carries that part alone, so it is never skipped
|
|
23473
|
+
const carriesBoundary = this.axisLabelsMode === AxisLabelsMode.SMART &&
|
|
23474
|
+
dateStringFactory.isSmartBoundary(elements.date, this.dateInterval);
|
|
23475
|
+
if (index % this.axisLabelsStep !== 0 && !carriesBoundary) {
|
|
23476
|
+
return;
|
|
23477
|
+
}
|
|
23073
23478
|
let datelabel = dateStringFactory.getDateString(elements.date, this.dateInterval);
|
|
23074
23479
|
if (this.axisLabelsMode === AxisLabelsMode.SMART) {
|
|
23075
23480
|
datelabel = dateStringFactory.getSmartDateString(elements.date, this.dateInterval);
|
|
@@ -23093,6 +23498,7 @@ class TimeChart {
|
|
|
23093
23498
|
scenarioType: this.axisScenario,
|
|
23094
23499
|
labelText: this.title,
|
|
23095
23500
|
isRelative: isRelative,
|
|
23501
|
+
titlePosition: this.axisTitlePosition,
|
|
23096
23502
|
}, this.position, axisLabelGroup).draw();
|
|
23097
23503
|
// svg.js's width()/height() getters each default to their own bbox() call,
|
|
23098
23504
|
// so reading both measures the group twice. Measure once.
|
|
@@ -23101,17 +23507,65 @@ class TimeChart {
|
|
|
23101
23507
|
height: axisBox.height,
|
|
23102
23508
|
width: axisBox.width,
|
|
23103
23509
|
};
|
|
23510
|
+
this.drawScenarioSwitch(svgContainer);
|
|
23511
|
+
}
|
|
23512
|
+
/**
|
|
23513
|
+
* A vertical line where the visible scenario of the series changes, and the
|
|
23514
|
+
* scenario names under the category labels. Drawn after the axis is
|
|
23515
|
+
* measured, so it does not change the allocated size by itself.
|
|
23516
|
+
*/
|
|
23517
|
+
drawScenarioSwitch(svgContainer) {
|
|
23518
|
+
const runs = this.switchRuns();
|
|
23519
|
+
if (runs.length < 2) {
|
|
23520
|
+
return;
|
|
23521
|
+
}
|
|
23522
|
+
const group = svgContainer.group().id("ScenarioSwitch");
|
|
23523
|
+
const namesHeight = this.switchNamesHeight();
|
|
23524
|
+
const height = this.getAllocatedCanvasHeight();
|
|
23525
|
+
const bottom = namesHeight > 0 ? height - this.styles.padding.bottom : height;
|
|
23526
|
+
const lineWidth = Math.max(1, this.position.spacings.auxiliaryLineWidth);
|
|
23527
|
+
runs.slice(1).forEach((run) => {
|
|
23528
|
+
const x = (this.position.getColumnCenterPositionX(run.from - 1) + this.position.getColumnCenterPositionX(run.from)) / 2;
|
|
23529
|
+
group
|
|
23530
|
+
.line(x, 0, x, bottom)
|
|
23531
|
+
.stroke({ color: this.styles.fontStyles.color || "#000000", width: lineWidth })
|
|
23532
|
+
.addClass("scenario-switch");
|
|
23533
|
+
});
|
|
23534
|
+
if (namesHeight === 0) {
|
|
23535
|
+
return;
|
|
23536
|
+
}
|
|
23537
|
+
runs.forEach((run) => {
|
|
23538
|
+
const center = (this.position.getColumnCenterPositionX(run.from) + this.position.getColumnCenterPositionX(run.to)) / 2;
|
|
23539
|
+
new Label$1(group, center, bottom - namesHeight, "SWITCH_" + run.scenario, Formatter.translateScenarioLabel(run.scenario, this.i18n), this.styles, HookLocation$1.Top, HookLocation$1.Center).forceStringTypeDraw();
|
|
23540
|
+
});
|
|
23104
23541
|
}
|
|
23105
23542
|
drawScenarios(dataModel, svgContainer) {
|
|
23106
23543
|
const columnGroup = svgContainer.group().id("Scenarios");
|
|
23107
23544
|
const scenarioFactory = new ScenarioFactory(this.position, columnGroup, this.scenarioStyles(), dataModel.length, this.i18n);
|
|
23108
23545
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
23109
23546
|
let hasValidPrim = false;
|
|
23547
|
+
const followers = this.followerSlots();
|
|
23110
23548
|
dataModel.forEach((elements, index) => {
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23549
|
+
// a follower takes the place of the first scenario: full column with value label, named under the axis
|
|
23550
|
+
const visible = followers.length > 0 ? this.visibleSlot(elements, followers) : "scenario1";
|
|
23551
|
+
if (visible != null && visible !== "scenario1") {
|
|
23552
|
+
scenarioFactory
|
|
23553
|
+
.createPrimaryBar(elements[visible], index, false)
|
|
23554
|
+
.draw(this.dataFormatDigits, this.measureScale);
|
|
23555
|
+
hasValidPrim = true;
|
|
23556
|
+
}
|
|
23557
|
+
else {
|
|
23558
|
+
scenarioFactory.createPrimaryBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
23559
|
+
}
|
|
23560
|
+
if (visible !== "scenario2") {
|
|
23561
|
+
scenarioFactory.createSecondaryBar(elements["scenario2"], index).draw();
|
|
23562
|
+
}
|
|
23563
|
+
if (visible !== "scenario3") {
|
|
23564
|
+
scenarioFactory.createPrimaryMarker(elements["scenario3"], index).draw();
|
|
23565
|
+
}
|
|
23566
|
+
if (visible !== "scenario4") {
|
|
23567
|
+
scenarioFactory.createSecondaryMarker(elements["scenario4"], index).draw();
|
|
23568
|
+
}
|
|
23115
23569
|
if (elements["scenario1"].isEmpty() === false) {
|
|
23116
23570
|
hasValidPrim = true;
|
|
23117
23571
|
}
|
|
@@ -23293,9 +23747,9 @@ class TimeChart {
|
|
|
23293
23747
|
.stroke({
|
|
23294
23748
|
color: "#999999",
|
|
23295
23749
|
width: 1,
|
|
23296
|
-
dasharray:
|
|
23750
|
+
dasharray: DASH_ARRAY,
|
|
23297
23751
|
})
|
|
23298
|
-
.attr("stroke-dasharray",
|
|
23752
|
+
.attr("stroke-dasharray", DASH_ARRAY);
|
|
23299
23753
|
}
|
|
23300
23754
|
drawVarianceScenario(dataModel, svgContainer) {
|
|
23301
23755
|
const columnGroup = svgContainer.group().id("Scenarios");
|
|
@@ -23303,7 +23757,7 @@ class TimeChart {
|
|
|
23303
23757
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
23304
23758
|
dataModel.forEach((elements, index) => {
|
|
23305
23759
|
if (elements["type"] === VarianceType.RELATIVE) {
|
|
23306
|
-
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw();
|
|
23760
|
+
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits);
|
|
23307
23761
|
}
|
|
23308
23762
|
else {
|
|
23309
23763
|
scenarioFactory.createVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
@@ -23743,6 +24197,12 @@ class TimeChartComponentConfig {
|
|
|
23743
24197
|
this.stackConfig = null;
|
|
23744
24198
|
/** When true, line charts extend to the full width of the chart area. */
|
|
23745
24199
|
this.lineFullWidth = true;
|
|
24200
|
+
/** Print every n-th category label only. */
|
|
24201
|
+
this.axisLabelsStep = 1;
|
|
24202
|
+
/** One series that changes its scenario along the time axis, see `bn-chart-time`. */
|
|
24203
|
+
this.scenarioSwitch = false;
|
|
24204
|
+
/** Side of the axis title: left, right or none. */
|
|
24205
|
+
this.axisTitlePosition = "left";
|
|
23746
24206
|
/** Locale used for date-axis labels and SQL date normalization; set from the bn-context locale. */
|
|
23747
24207
|
this.locale = "de";
|
|
23748
24208
|
}
|
|
@@ -23825,6 +24285,15 @@ class TimeChartComponentConfigAdapter {
|
|
|
23825
24285
|
if (CompareUtil.isBoolean(data.lineFullWidth)) {
|
|
23826
24286
|
config.lineFullWidth = data.lineFullWidth;
|
|
23827
24287
|
}
|
|
24288
|
+
if (CompareUtil.isNumber(data.axisLabelsStep) && data.axisLabelsStep >= 1) {
|
|
24289
|
+
config.axisLabelsStep = data.axisLabelsStep;
|
|
24290
|
+
}
|
|
24291
|
+
if (CompareUtil.isBoolean(data.scenarioSwitch)) {
|
|
24292
|
+
config.scenarioSwitch = data.scenarioSwitch;
|
|
24293
|
+
}
|
|
24294
|
+
if (CompareUtil.isString(data.axisTitlePosition)) {
|
|
24295
|
+
config.axisTitlePosition = data.axisTitlePosition;
|
|
24296
|
+
}
|
|
23828
24297
|
if (CompareUtil.isString(data.locale)) {
|
|
23829
24298
|
config.locale = data.locale;
|
|
23830
24299
|
}
|
|
@@ -23838,6 +24307,13 @@ class TimeChartComponentConfigAdapter {
|
|
|
23838
24307
|
const bnChartTimeRendererCss = () => `:host(.no-data){display:block;box-sizing:border-box;width:100%;height:100%}:host(.no-data)>div{float:none;width:100%;height:100%}:host(.no-data) .no-data~.no-data{display:none}.empty-state{box-sizing:border-box;display:flex;align-items:center;justify-content:center;float:none;width:100%;height:100%;min-height:3em;margin:0;padding:0.5em;overflow:hidden;border:0.1em dashed #ddd;color:#808080;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);font-style:normal;text-align:center}:host{position:relative;display:inline-block}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-default{stroke:black;stroke-width:0.1em}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}.hide{opacity:0}.footer{margin:0.2em;font-size:0.6em}.footer-hide{display:none}svg#drawCanvas{display:block}`;
|
|
23839
24308
|
|
|
23840
24309
|
const BnChartTimeRenderer = class {
|
|
24310
|
+
disconnectedCallback() {
|
|
24311
|
+
var _a;
|
|
24312
|
+
if (this.overlapErrId) {
|
|
24313
|
+
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.remove(this.overlapErrId);
|
|
24314
|
+
this.overlapErrId = undefined;
|
|
24315
|
+
}
|
|
24316
|
+
}
|
|
23841
24317
|
constructor(hostRef) {
|
|
23842
24318
|
registerInstance(this, hostRef);
|
|
23843
24319
|
/**
|
|
@@ -23895,6 +24371,12 @@ const BnChartTimeRenderer = class {
|
|
|
23895
24371
|
/** @internal */
|
|
23896
24372
|
this.dataFormatDigits = { percent: 2, decimal: 1 };
|
|
23897
24373
|
/** @internal */
|
|
24374
|
+
this.axisLabelsStep = 1;
|
|
24375
|
+
/** @internal */
|
|
24376
|
+
this.scenarioSwitch = false;
|
|
24377
|
+
/** @internal */
|
|
24378
|
+
this.axisTitlePosition = "left";
|
|
24379
|
+
/** @internal */
|
|
23898
24380
|
this.parentDimensions = { width: 0, height: 0 };
|
|
23899
24381
|
withComponentStatus(this);
|
|
23900
24382
|
}
|
|
@@ -23916,12 +24398,29 @@ const BnChartTimeRenderer = class {
|
|
|
23916
24398
|
}
|
|
23917
24399
|
/** Reports a failed query as the wrapper's `ERR_sql` item. Without it the chart would only show "No Data". */
|
|
23918
24400
|
syncQueryError() {
|
|
23919
|
-
var _a, _b;
|
|
24401
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
23920
24402
|
this.queryError = (_a = this.measureScaleError) !== null && _a !== void 0 ? _a : (_b = this.chart) === null || _b === void 0 ? void 0 : _b.getQueryError();
|
|
23921
24403
|
reportQueryError(this.errors, this.queryError);
|
|
24404
|
+
const errId = `WARN_variances_overlap_${this.variances.join("_")}`;
|
|
24405
|
+
const overlaps = (_d = (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getVarianceOverlaps()) !== null && _d !== void 0 ? _d : 0;
|
|
24406
|
+
// the row can get other variances: the warning of the old list has to go
|
|
24407
|
+
if (this.overlapErrId && this.overlapErrId !== errId) {
|
|
24408
|
+
(_e = this.errors) === null || _e === void 0 ? void 0 : _e.remove(this.overlapErrId);
|
|
24409
|
+
}
|
|
24410
|
+
this.overlapErrId = overlaps > 0 ? errId : undefined;
|
|
24411
|
+
if (overlaps > 0) {
|
|
24412
|
+
(_f = this.errors) === null || _f === void 0 ? void 0 : _f.addOrReplace({
|
|
24413
|
+
id: errId,
|
|
24414
|
+
type: "warning",
|
|
24415
|
+
message: `scenarioSwitch: the variances ${this.variances.join(", ")} share a row, but ${overlaps} period(s) have more than one value. The first variance wins there.`,
|
|
24416
|
+
});
|
|
24417
|
+
}
|
|
24418
|
+
else {
|
|
24419
|
+
(_g = this.errors) === null || _g === void 0 ? void 0 : _g.remove(errId);
|
|
24420
|
+
}
|
|
23922
24421
|
}
|
|
23923
24422
|
async componentWillLoad() {
|
|
23924
|
-
var _a;
|
|
24423
|
+
var _a, _b;
|
|
23925
24424
|
const config = this.prepareConfig();
|
|
23926
24425
|
const styles = this.prepareStyle();
|
|
23927
24426
|
const availableWidth = this.containerWidth || 0;
|
|
@@ -23933,14 +24432,18 @@ const BnChartTimeRenderer = class {
|
|
|
23933
24432
|
// fitted chart fits by construction, and the overdrive's rough overhead
|
|
23934
24433
|
// estimate would falsely re-engage on it.
|
|
23935
24434
|
const unitWasAuto = config.pixelPerUnit <= 0;
|
|
24435
|
+
const percentWasAuto = config.pixelPerPercentage <= 0;
|
|
23936
24436
|
this.autoFitScaling(config, styles);
|
|
23937
24437
|
this.chart.setAvailableHeight(unitWasAuto ? 0 : ((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
24438
|
+
if (!percentWasAuto) {
|
|
24439
|
+
this.chart.fitRelativeVariances(((_b = this.parentDimensions) === null || _b === void 0 ? void 0 : _b.height) || 0);
|
|
24440
|
+
}
|
|
23938
24441
|
this.pattern = new CustomPattern(this.chart.styles);
|
|
23939
24442
|
this.chart.setPattern("hatched", this.pattern.getFCPolygonPattern());
|
|
23940
24443
|
this.syncQueryError();
|
|
23941
24444
|
}
|
|
23942
24445
|
async componentWillUpdate() {
|
|
23943
|
-
var _a;
|
|
24446
|
+
var _a, _b;
|
|
23944
24447
|
if (this.chart == null) {
|
|
23945
24448
|
return;
|
|
23946
24449
|
}
|
|
@@ -23953,8 +24456,12 @@ const BnChartTimeRenderer = class {
|
|
|
23953
24456
|
this.chart.setConfig(config);
|
|
23954
24457
|
// See componentWillLoad: no broken-bar overdrive for auto-fitted scaling
|
|
23955
24458
|
const unitWasAuto = config.pixelPerUnit <= 0;
|
|
24459
|
+
const percentWasAuto = config.pixelPerPercentage <= 0;
|
|
23956
24460
|
this.autoFitScaling(config, styles);
|
|
23957
24461
|
this.chart.setAvailableHeight(unitWasAuto ? 0 : ((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
24462
|
+
if (!percentWasAuto) {
|
|
24463
|
+
this.chart.fitRelativeVariances(((_b = this.parentDimensions) === null || _b === void 0 ? void 0 : _b.height) || 0);
|
|
24464
|
+
}
|
|
23958
24465
|
this.pattern = new CustomPattern(this.chart.styles);
|
|
23959
24466
|
this.chart.setPattern("hatched", this.pattern.getFCPolygonPattern());
|
|
23960
24467
|
this.syncQueryError();
|
|
@@ -24140,6 +24647,9 @@ const BnChartTimeRenderer = class {
|
|
|
24140
24647
|
maxBars: this.maxBars,
|
|
24141
24648
|
stackConfig: this.stackConfig,
|
|
24142
24649
|
lineFullWidth: this.lineFullWidth,
|
|
24650
|
+
axisLabelsStep: this.axisLabelsStep,
|
|
24651
|
+
scenarioSwitch: this.scenarioSwitch,
|
|
24652
|
+
axisTitlePosition: this.axisTitlePosition,
|
|
24143
24653
|
locale: ((_c = (_b = (_a = this.stores) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.state) === null || _c === void 0 ? void 0 : _c.locale) || "de",
|
|
24144
24654
|
});
|
|
24145
24655
|
}
|
|
@@ -24270,6 +24780,8 @@ function pageRule(format, orientation, renderOrientation) {
|
|
|
24270
24780
|
|
|
24271
24781
|
const bnContextCss = () => `:host{display:block}`;
|
|
24272
24782
|
|
|
24783
|
+
/** The elements that write what `getNotation()` reads. */
|
|
24784
|
+
const NOTATION_SOURCE_SELECTOR = "bn-component-style, bn-scaling-group";
|
|
24273
24785
|
/** Attributes that change the paper size, the orientation or the number of a page. */
|
|
24274
24786
|
const PAGE_ATTRIBUTES = [
|
|
24275
24787
|
"format",
|
|
@@ -24300,8 +24812,10 @@ const VISUAL_SELECTOR = "bn-annotation-layer, bn-annotation-list, bn-body, bn-ca
|
|
|
24300
24812
|
const Context = class {
|
|
24301
24813
|
constructor(hostRef) {
|
|
24302
24814
|
registerInstance(this, hostRef);
|
|
24815
|
+
this.bnNotationChange = createEvent(this, "bnNotationChange", 7);
|
|
24303
24816
|
/** The page numbers this context wrote. A number that is not in here was set by the author and is left alone. */
|
|
24304
24817
|
this.assignedPageNumbers = new WeakMap();
|
|
24818
|
+
this.notationSubscriptions = [];
|
|
24305
24819
|
withComponentStatus(this);
|
|
24306
24820
|
this.errors = withHasError(this);
|
|
24307
24821
|
}
|
|
@@ -24316,6 +24830,12 @@ const Context = class {
|
|
|
24316
24830
|
if (this.locale) {
|
|
24317
24831
|
this.stores.context.state.locale = this.locale;
|
|
24318
24832
|
}
|
|
24833
|
+
// a removed scaling group is a "set" too: its entry is set to undefined
|
|
24834
|
+
const notify = () => this.bnNotationChange.emit();
|
|
24835
|
+
this.notationSubscriptions = [
|
|
24836
|
+
this.stores.scalingGroups.on("set", notify),
|
|
24837
|
+
this.stores.componentStyles.on("set", notify),
|
|
24838
|
+
];
|
|
24319
24839
|
this.syncPages();
|
|
24320
24840
|
// pages that come, go or change their format later
|
|
24321
24841
|
this.pageObserver = new MutationObserver(() => this.syncPages());
|
|
@@ -24328,6 +24848,8 @@ const Context = class {
|
|
|
24328
24848
|
}
|
|
24329
24849
|
disconnectedCallback() {
|
|
24330
24850
|
var _a, _b;
|
|
24851
|
+
this.notationSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
24852
|
+
this.notationSubscriptions = [];
|
|
24331
24853
|
(_a = this.pageObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24332
24854
|
(_b = this.pageSizeStyle) === null || _b === void 0 ? void 0 : _b.remove();
|
|
24333
24855
|
this.pageSizeStyle = undefined;
|
|
@@ -24448,6 +24970,26 @@ const Context = class {
|
|
|
24448
24970
|
components,
|
|
24449
24971
|
};
|
|
24450
24972
|
}
|
|
24973
|
+
/**
|
|
24974
|
+
* Returns how this context draws: font, the look of the scenarios `ac`,
|
|
24975
|
+
* `pp`, `fc` and `pl`, the variance colours and the scaling groups. A
|
|
24976
|
+
* chart that is not part of this package can use it to draw like the
|
|
24977
|
+
* charts that are.
|
|
24978
|
+
*
|
|
24979
|
+
* The style values are merged like in every component: `_system`, then
|
|
24980
|
+
* `_default`, then the style named `styleName`.
|
|
24981
|
+
*
|
|
24982
|
+
* The promise resolves after every `<bn-component-style>` and
|
|
24983
|
+
* `<bn-scaling-group>` that is inside the context at the time of the call
|
|
24984
|
+
* has loaded. Listen to `bnNotationChange` for later changes.
|
|
24985
|
+
*
|
|
24986
|
+
* @param styleName - name of a `<bn-component-style>`, like the `selected-style` of a chart
|
|
24987
|
+
*/
|
|
24988
|
+
async getNotation(styleName) {
|
|
24989
|
+
const sources = Array.from(this.element.querySelectorAll(NOTATION_SOURCE_SELECTOR));
|
|
24990
|
+
await Promise.all(sources.map((el) => { var _a, _b; return (_b = (_a = el.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(el)) !== null && _b !== void 0 ? _b : Promise.resolve(); }));
|
|
24991
|
+
return buildNotation(mergeStyleLayers(this.stores.componentStyles.state, styleName), this.stores.scalingGroups.state);
|
|
24992
|
+
}
|
|
24451
24993
|
componentWillLoad() {
|
|
24452
24994
|
// stencil needs one componenet implementing all lifecycle steps to get mixing working
|
|
24453
24995
|
}
|
|
@@ -24458,7 +25000,7 @@ const Context = class {
|
|
|
24458
25000
|
componentWillUpdate() { }
|
|
24459
25001
|
componentDidUpdate() { }
|
|
24460
25002
|
render() {
|
|
24461
|
-
return (h(Host, { key: '
|
|
25003
|
+
return (h(Host, { key: 'e2c985d07c329d796c37804f492907f0f49366d2' }, h("slot", { key: '90c11954a1a9365bc46ddacb2a3b8f72bbc4e523' })));
|
|
24462
25004
|
}
|
|
24463
25005
|
get element() { return getElement(this); }
|
|
24464
25006
|
static get watchers() { return {
|
|
@@ -25977,6 +26519,7 @@ const LayoutCard = class {
|
|
|
25977
26519
|
this.cardShowBorder = true;
|
|
25978
26520
|
withComponentStatus(this);
|
|
25979
26521
|
this.errors = withHasError(this);
|
|
26522
|
+
this.componentStyle = withComponentStyle(this);
|
|
25980
26523
|
this.resolveInherited = withInheritedProps(this, [
|
|
25981
26524
|
{ propName: "titleScenarios", ancestorAttr: "title-scenarios" },
|
|
25982
26525
|
{ propName: "titleVariances", ancestorAttr: "title-variances" },
|
|
@@ -26080,7 +26623,7 @@ const LayoutCard = class {
|
|
|
26080
26623
|
var _a;
|
|
26081
26624
|
const style = this.getLayoutStyle();
|
|
26082
26625
|
const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
|
|
26083
|
-
return (h("bn-card", { key: '
|
|
26626
|
+
return (h("bn-card", { key: '3db479047905de01ac517491f2d68a9bd0a3a576', styles: this.styles, "selected-style": this.selectedStyle, class: this.setCardClass() }, h("div", { key: 'fd9948acd84ce55badf87a7e03d733d1e75a1bea', class: "cardtitle" }, h("bn-title", { key: '21200c96fb03d403fa616b093d753ea4b746c6f2', "i18n-namespace": (_a = this.i18nNamespace) !== null && _a !== void 0 ? _a : this.titleNamespace, ruleset: this.titleProp("ruleset"), "title-font-size": this.componentStyle(($) => { var _a; return (_a = $ === null || $ === void 0 ? void 0 : $["bn-layout-card"]) === null || _a === void 0 ? void 0 : _a.titleFontSize; }), "business-unit": this.titleBusinessUnit, scenarios: this.titleProp("titleScenarios"), variances: this.titleProp("titleVariances"), order: this.titleProp("titleOrder"), "order-direction": this.titleProp("titleOrderDirection"), measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), this.titleImage != null && this.titleImage !== "" ? (h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), h("bn-body", { key: 'c5b1957822ff216d33084154afdf6deb3e4426cc' }, h("div", { key: 'bc17f6f73825894641f775137eaefd5059a25cf6', style: style, "data-bn-fit-content": this.cardFitToContent ? String(this.getRowCount(this.cardLayout)) : null }, this.getSlots(arrOfSlots))), h("bn-footer", { key: 'cfbeba76eaf11358e92002d309cafae19d2525e2', text: this.footerText, "page-number": "0", "display-page-number": "false" })));
|
|
26084
26627
|
}
|
|
26085
26628
|
get element() { return getElement(this); }
|
|
26086
26629
|
};
|
|
@@ -26316,7 +26859,7 @@ const LayoutPage = class {
|
|
|
26316
26859
|
const style = this.getLayoutStyle();
|
|
26317
26860
|
const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
|
|
26318
26861
|
const rotation = this.rotation();
|
|
26319
|
-
return (h(Host, { key: '
|
|
26862
|
+
return (h(Host, { key: '2ec4b279578c40e0aa56ec89ede269abb4d2951b', style: rotation === null || rotation === void 0 ? void 0 : rotation.host }, h("bn-page", { key: 'fae96a429fad331f28fdf69e5036e6857db866c6', styles: this.styles, "selected-style": this.selectedStyle, format: this.pageFormat, orientation: this.pageOrientation, style: rotation === null || rotation === void 0 ? void 0 : rotation.page }, h("bn-message", { key: '17e10377a10a257417acc50460cc2a66e1010abd', text: this.messageText, image: this.messageImage }), h("bn-title", { key: '3149bfdb60c2782c65a3c956fe15d291b2748327', "i18n-namespace": (_a = this.i18nNamespace) !== null && _a !== void 0 ? _a : this.titleNamespace, ruleset: this.ruleset, "title-id": this.titleId, "business-unit": this.titleBusinessUnit, scenarios: this.titleScenarios, variances: this.titleVariances, order: this.titleOrder, "order-direction": this.titleOrderDirection, measures: this.titleMeasures, "date-start": this.titleDateStart, "date-end": this.titleDateEnd, "date-format": this.titleDateFormat, "date-link": this.titleDateLink }), h("bn-body", { key: '8ef72077b8656469db320af429a1226453866558' }, h("div", { key: '99b22034f2c6edbe7e25e1a3cb6873f2af287178', style: style, "data-bn-fit-content": this.pageFitToContent ? String(this.getRowCount(this.pageLayout)) : null }, this.getSlots(arrOfSlots)), h("slot", { key: '918b8f2c8991d801a0033748f37250500cf2d2e9', name: "annotations" })), h("bn-footer", { key: 'a77e27405f7fbc68c90a95c563628ddc2d708e02', text: this.footerText, "page-number": this.pageNumber, "display-page-number": this.footerDisplayPageNumber }))));
|
|
26320
26863
|
}
|
|
26321
26864
|
get element() { return getElement(this); }
|
|
26322
26865
|
};
|
|
@@ -32789,7 +33332,7 @@ const Title$1 = class Title {
|
|
|
32789
33332
|
var _a, _b, _c, _d;
|
|
32790
33333
|
return ({
|
|
32791
33334
|
"--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
32792
|
-
"--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
|
|
33335
|
+
"--bn-font-size": `${this.titleFontSize > 0 ? this.titleFontSize : ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
|
|
32793
33336
|
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
32794
33337
|
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
32795
33338
|
});
|
|
@@ -32797,7 +33340,7 @@ const Title$1 = class Title {
|
|
|
32797
33340
|
}
|
|
32798
33341
|
render() {
|
|
32799
33342
|
const fontStyles = this.getFontStyles();
|
|
32800
|
-
return (h(Host, { key: '
|
|
33343
|
+
return (h(Host, { key: '2f19926cf90c8e8738c335088f6d814be7221f05', style: fontStyles }, h("bn-title-renderer", { key: '85c4a3985352920a9eddfa166479fbde7d114971', businessUnit: this.prepareBusinessUnit(), scenarios: this.prepareScenarios(), measures: this.prepareMeasures(), timeperiod: this.prepareTitleTimePeriod(), order: this.prepareTitleOrder(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), locale: this.prepareLocale(), ruleSetConfig: this.ruleSetConfig(), titleId: this.titleId || undefined })));
|
|
32801
33344
|
}
|
|
32802
33345
|
get element() { return getElement(this); }
|
|
32803
33346
|
static get watchers() { return {
|
|
@@ -33119,7 +33662,7 @@ class TimePeriodAdapter {
|
|
|
33119
33662
|
}
|
|
33120
33663
|
}
|
|
33121
33664
|
|
|
33122
|
-
const bnTitleRendererCss = () => `:host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}p{margin:0}`;
|
|
33665
|
+
const bnTitleRendererCss = () => `:host{display:block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.measure{font-weight:bold}.with-id{display:flow-root}.title-id{float:right;margin-left:1em;font-weight:normal}div{background-color:var(--bn-font-background, white);color:var(--bn-font-color, black)}p{margin:0}`;
|
|
33123
33666
|
|
|
33124
33667
|
const BnTitleRenderer = class {
|
|
33125
33668
|
constructor(hostRef) {
|
|
@@ -33150,7 +33693,7 @@ const BnTitleRenderer = class {
|
|
|
33150
33693
|
withComponentStatus(this);
|
|
33151
33694
|
}
|
|
33152
33695
|
render() {
|
|
33153
|
-
return (h("div", { key: '
|
|
33696
|
+
return (h("div", { key: 'd32015c18f77cc23ace9a26d8bb0820acdce543a', class: this.titleId ? "with-id" : undefined }, this.titleId ? h("div", { class: "title-id" }, this.titleId) : null, h("div", { key: 'c3151be4218ff1720402865ffa4b972c974fea67', innerHTML: sanitizeHtml(this.title.unit) }), h("div", { key: '0a03e44bd5ec8d0177801bce8d1cf938a24daabb' }, this.title.measures.map((measure, index) => (h("span", null, this.isFirstElement(index) ? this.title.i18n.get("SEPARATOR_WS") : "", h("span", { class: "measure" }, measure.name), " ", measure.unit ? this.title.i18n.get("in") : "", " ", measure.unit)))), h("div", { key: 'ab32e07b35e1cc02ec26137ce392946c8f94ac73' }, this.title.dimension)));
|
|
33154
33697
|
}
|
|
33155
33698
|
componentWillLoad() {
|
|
33156
33699
|
const config = this.prepareConfig();
|