@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,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var withHasError = require('./withHasError-
|
|
5
|
-
var withStyled = require('./withStyled-
|
|
6
|
-
var withTranslation = require('./withTranslation-
|
|
7
|
-
var withBodyObserver = require('./withBodyObserver-
|
|
8
|
-
var localFrame = require('./localFrame-
|
|
9
|
-
var
|
|
3
|
+
var index = require('./index-DwBbheYB.js');
|
|
4
|
+
var withHasError = require('./withHasError-CZFrIJw0.js');
|
|
5
|
+
var withStyled = require('./withStyled-DHKHBdRb.js');
|
|
6
|
+
var withTranslation = require('./withTranslation-CLwC9a8V.js');
|
|
7
|
+
var withBodyObserver = require('./withBodyObserver-CIGVLQEB.js');
|
|
8
|
+
var localFrame = require('./localFrame-C4RBw_zT.js');
|
|
9
|
+
var types = require('./types-BngAWYMW.js');
|
|
10
10
|
var queryError = require('./queryError-BZjnIW_w.js');
|
|
11
|
+
var index$1 = require('./index-CM6022qm.js');
|
|
11
12
|
|
|
12
13
|
const COLOR_NAME = /^[a-z][a-z0-9-]*$/i;
|
|
13
14
|
/**
|
|
@@ -321,6 +322,7 @@ const AnnotationLayer = class {
|
|
|
321
322
|
this.scheduled = false;
|
|
322
323
|
this.run = 0;
|
|
323
324
|
this.observed = new WeakSet();
|
|
325
|
+
this.observedAround = new WeakSet();
|
|
324
326
|
this.reported = new Set();
|
|
325
327
|
/**
|
|
326
328
|
* Places the marks after the next paint. The layer counts as working until
|
|
@@ -348,6 +350,7 @@ const AnnotationLayer = class {
|
|
|
348
350
|
this.stores = withHasError.getStores(this.element);
|
|
349
351
|
this.pageKey = annotationPageKey(this.element);
|
|
350
352
|
this.observed = new WeakSet();
|
|
353
|
+
this.observedAround = new WeakSet();
|
|
351
354
|
this.resizeObserver = new ResizeObserver(this.schedule);
|
|
352
355
|
this.mutationObserver = new MutationObserver(this.schedule);
|
|
353
356
|
this.observeSize(this.element);
|
|
@@ -414,7 +417,10 @@ const AnnotationLayer = class {
|
|
|
414
417
|
await Promise.all(visuals.map((visual) => { var _a; return (_a = visual.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(visual); }));
|
|
415
418
|
if (run !== this.run)
|
|
416
419
|
return;
|
|
417
|
-
visuals.forEach((visual) =>
|
|
420
|
+
visuals.forEach((visual) => {
|
|
421
|
+
this.observe(visual);
|
|
422
|
+
this.observeAround(visual, page);
|
|
423
|
+
});
|
|
418
424
|
const states = new Map();
|
|
419
425
|
await Promise.all(visuals.map(async (visual) => {
|
|
420
426
|
var _a;
|
|
@@ -573,6 +579,28 @@ const AnnotationLayer = class {
|
|
|
573
579
|
};
|
|
574
580
|
walk(visual.shadowRoot);
|
|
575
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* A component around a target can move it without resizing anything: a
|
|
584
|
+
* grid pads a cell down to line up a baseline, and writes that into its own
|
|
585
|
+
* shadow root, or into the style of a card in the cell.
|
|
586
|
+
*/
|
|
587
|
+
observeAround(visual, page) {
|
|
588
|
+
var _a, _b;
|
|
589
|
+
for (let el = visual.parentElement; el && el !== page; el = el.parentElement) {
|
|
590
|
+
if (this.observedAround.has(el))
|
|
591
|
+
continue;
|
|
592
|
+
this.observedAround.add(el);
|
|
593
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(el, { attributes: true, attributeFilter: ["style"] });
|
|
594
|
+
if (el.shadowRoot) {
|
|
595
|
+
(_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.observe(el.shadowRoot, {
|
|
596
|
+
childList: true,
|
|
597
|
+
subtree: true,
|
|
598
|
+
attributes: true,
|
|
599
|
+
attributeFilter: ["style", "class"],
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
576
604
|
observeSize(element) {
|
|
577
605
|
var _a;
|
|
578
606
|
if (!this.observed.has(element)) {
|
|
@@ -597,7 +625,7 @@ const AnnotationLayer = class {
|
|
|
597
625
|
return (index.h("g", { class: "mark arrow", "data-label": (_b = mark.badge) === null || _b === void 0 ? void 0 : _b.label }, index.h("line", { x1: mark.x1, y1: mark.y1, x2: mark.x2, y2: mark.y2, style: { stroke: color, strokeWidth: "1.5" } }), index.h("polygon", { points: mark.head, style: { fill: color } }), this.renderBadge(mark.badge, color)));
|
|
598
626
|
}
|
|
599
627
|
render() {
|
|
600
|
-
return (index.h(index.Host, { key: '
|
|
628
|
+
return (index.h(index.Host, { key: 'd4d027728ae578a5ced829a3f86f0137530551fc' }, index.h("svg", { key: 'a3813930e420db9fdd618bc38c38941295cf4c22', ref: (el) => (this.svg = el) }, this.marks.map((mark) => this.renderMark(mark)))));
|
|
601
629
|
}
|
|
602
630
|
get element() { return index.getElement(this); }
|
|
603
631
|
static get watchers() { return {
|
|
@@ -758,7 +786,7 @@ function readFontSizePx(el) {
|
|
|
758
786
|
function buildGenericState(el, origins) {
|
|
759
787
|
var _a;
|
|
760
788
|
return {
|
|
761
|
-
version:
|
|
789
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
762
790
|
tag: el.localName,
|
|
763
791
|
id: localFrame.resolveStandaloneId(el),
|
|
764
792
|
slot: (_a = el.getAttribute("slot")) !== null && _a !== void 0 ? _a : undefined,
|
|
@@ -1181,7 +1209,7 @@ function collectXYElements(svgRoot, origins) {
|
|
|
1181
1209
|
function collectXYFacadeState(host, innerTag, title, em, origins, detail) {
|
|
1182
1210
|
var _a, _b, _c, _d;
|
|
1183
1211
|
const state = {
|
|
1184
|
-
version:
|
|
1212
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
1185
1213
|
tag: host.localName,
|
|
1186
1214
|
id: localFrame.resolveStandaloneId(host),
|
|
1187
1215
|
slot: (_a = host.getAttribute("slot")) !== null && _a !== void 0 ? _a : undefined,
|
|
@@ -2593,6 +2621,19 @@ function resolveSentiment(direction, operation, signedValues) {
|
|
|
2593
2621
|
const subtracts = !signedValues && operation === "-";
|
|
2594
2622
|
return (direction === "op") !== subtracts ? "pos" : "neg";
|
|
2595
2623
|
}
|
|
2624
|
+
/** The scenarios a list of variances is calculated from, each once, in order. */
|
|
2625
|
+
function variancesScenarios(variances) {
|
|
2626
|
+
const scenarios = [];
|
|
2627
|
+
for (const variance of variances) {
|
|
2628
|
+
const parsed = new VarianceScenario(variance);
|
|
2629
|
+
for (const scenario of parsed.isValid ? [parsed.base, parsed.delta] : []) {
|
|
2630
|
+
if (!scenarios.includes(scenario)) {
|
|
2631
|
+
scenarios.push(scenario);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
return scenarios;
|
|
2636
|
+
}
|
|
2596
2637
|
|
|
2597
2638
|
const FAMILIES = ["ac", "pp", "fc", "pl"];
|
|
2598
2639
|
const SLOT_BY_COLOR_INDEX = { 10: "ac", 20: "pp", 30: "fc", 50: "pl" };
|
|
@@ -14236,7 +14277,7 @@ const Chart$1 = class Chart {
|
|
|
14236
14277
|
}
|
|
14237
14278
|
validateScenario(newValue) {
|
|
14238
14279
|
const errId = "WARN_scenarios";
|
|
14239
|
-
if (withTranslation.isInheritedValue(newValue)) {
|
|
14280
|
+
if (withTranslation.isInheritedValue(newValue) || withStyled.isNoScenarios(newValue)) {
|
|
14240
14281
|
this.errors.remove(errId);
|
|
14241
14282
|
return;
|
|
14242
14283
|
}
|
|
@@ -14382,6 +14423,25 @@ const Chart$1 = class Chart {
|
|
|
14382
14423
|
this.errors.remove(errId);
|
|
14383
14424
|
}
|
|
14384
14425
|
}
|
|
14426
|
+
validateDataFormatDigitsDecimal(newValue) {
|
|
14427
|
+
this.validateDigits("dataFormatDigitsDecimal", newValue);
|
|
14428
|
+
}
|
|
14429
|
+
validateDataFormatDigitsPercent(newValue) {
|
|
14430
|
+
this.validateDigits("dataFormatDigitsPercent", newValue);
|
|
14431
|
+
}
|
|
14432
|
+
validateDigits(name, value) {
|
|
14433
|
+
const errId = `WARN_${name}`;
|
|
14434
|
+
if (!withStyled.isValidInteger(value) || Number(value) < 0 || Number(value) > 100) {
|
|
14435
|
+
this.errors.addOrReplace({
|
|
14436
|
+
id: errId,
|
|
14437
|
+
type: "warning",
|
|
14438
|
+
message: name + ": invalid value '" + value + "' is not supported.",
|
|
14439
|
+
});
|
|
14440
|
+
}
|
|
14441
|
+
else {
|
|
14442
|
+
this.errors.remove(errId);
|
|
14443
|
+
}
|
|
14444
|
+
}
|
|
14385
14445
|
validateStack(newValue) {
|
|
14386
14446
|
const errId = "WARN_stack";
|
|
14387
14447
|
const errors = withStyled.validateStackConfig(newValue);
|
|
@@ -14487,6 +14547,14 @@ const Chart$1 = class Chart {
|
|
|
14487
14547
|
* @example measure-unit="EUR"
|
|
14488
14548
|
*/
|
|
14489
14549
|
this.measureUnit = "";
|
|
14550
|
+
/**
|
|
14551
|
+
* Number of decimal digits of the value labels
|
|
14552
|
+
*/
|
|
14553
|
+
this.dataFormatDigitsDecimal = 1;
|
|
14554
|
+
/**
|
|
14555
|
+
* Number of decimal digits of the percent labels (relative variances, shares of a 100 % stack)
|
|
14556
|
+
*/
|
|
14557
|
+
this.dataFormatDigitsPercent = 2;
|
|
14490
14558
|
/**
|
|
14491
14559
|
* Stacking configuration as a JSON string. When set, bars are drawn as
|
|
14492
14560
|
* stacked segments instead of side-by-side.
|
|
@@ -14579,6 +14647,8 @@ const Chart$1 = class Chart {
|
|
|
14579
14647
|
componentWillLoad() {
|
|
14580
14648
|
this.validateFilter(this.filter);
|
|
14581
14649
|
this.validateScenario(this.scenarios);
|
|
14650
|
+
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
14651
|
+
this.validateDataFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
14582
14652
|
this.validateVariances(this.variances);
|
|
14583
14653
|
this.validateUnitScaling(this.unitScaling);
|
|
14584
14654
|
//this.validateSelectedStyle(this.selectedStyle);
|
|
@@ -14758,8 +14828,7 @@ const Chart$1 = class Chart {
|
|
|
14758
14828
|
}
|
|
14759
14829
|
prepareDimension() {
|
|
14760
14830
|
const parent = withTranslation.getParentDimensions(this.element);
|
|
14761
|
-
const
|
|
14762
|
-
const segmentCount = 1 + variancesList.length;
|
|
14831
|
+
const segmentCount = Math.max(1, this.prepareSegments().length);
|
|
14763
14832
|
this.canvasWidthSegmented = parent.width / segmentCount;
|
|
14764
14833
|
return { width: this.canvasWidthSegmented, height: parent.height };
|
|
14765
14834
|
}
|
|
@@ -14770,6 +14839,10 @@ const Chart$1 = class Chart {
|
|
|
14770
14839
|
this.errors.remove("AUTO_scenarios");
|
|
14771
14840
|
return scenarios.value.split(",").map((entry) => entry.trim());
|
|
14772
14841
|
}
|
|
14842
|
+
if (withStyled.isNoScenarios(scenarios.value)) {
|
|
14843
|
+
this.errors.remove("AUTO_scenarios");
|
|
14844
|
+
return [];
|
|
14845
|
+
}
|
|
14773
14846
|
const isAuto = ((_a = scenarios.value) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
14774
14847
|
if (withStyled.isBlankInput(scenarios.value) || isAuto) {
|
|
14775
14848
|
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
@@ -14798,6 +14871,15 @@ const Chart$1 = class Chart {
|
|
|
14798
14871
|
}
|
|
14799
14872
|
return variances === null || variances === void 0 ? void 0 : variances.split(",").map((entry) => entry.trim());
|
|
14800
14873
|
}
|
|
14874
|
+
/** `scenarios="none"`: the chart draws its variances only. */
|
|
14875
|
+
hidesScenarios() {
|
|
14876
|
+
const scenarios = this.resolveInherited("scenarios", this.scenarios);
|
|
14877
|
+
return !scenarios.inherited && withStyled.isNoScenarios(scenarios.value);
|
|
14878
|
+
}
|
|
14879
|
+
/** The segments side by side: `""` is the base chart, else one variance. */
|
|
14880
|
+
prepareSegments() {
|
|
14881
|
+
return this.hidesScenarios() ? this.prepareVariances() : ["", ...this.prepareVariances()];
|
|
14882
|
+
}
|
|
14801
14883
|
prepareHideCategories(idx) {
|
|
14802
14884
|
return idx >= 1 || !this.showCategories;
|
|
14803
14885
|
}
|
|
@@ -14966,7 +15048,8 @@ const Chart$1 = class Chart {
|
|
|
14966
15048
|
});
|
|
14967
15049
|
}
|
|
14968
15050
|
prepareChartTitle(idx) {
|
|
14969
|
-
|
|
15051
|
+
// a variance keeps its own name as title
|
|
15052
|
+
if (idx >= 1 || this.hidesScenarios()) {
|
|
14970
15053
|
return "";
|
|
14971
15054
|
}
|
|
14972
15055
|
return this.chartTitle;
|
|
@@ -15076,10 +15159,11 @@ const Chart$1 = class Chart {
|
|
|
15076
15159
|
const ppu = this.preparePixelPerUnit();
|
|
15077
15160
|
const ppp = this.preparePixelPerPercentage();
|
|
15078
15161
|
const stackConfig = this.prepareStackConfig();
|
|
15079
|
-
const
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15162
|
+
const isBase = localScenarioString === "";
|
|
15163
|
+
const scenarios = this.hidesScenarios() ? variancesScenarios([localScenarioString]) : this.prepareScenarios();
|
|
15164
|
+
// Dimension stacking uses only the first scenario. Only the base chart draws a stack, a variance needs both of its scenarios
|
|
15165
|
+
const effectiveScenarios = isBase && (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === withStyled.StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
15166
|
+
return (index.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() }));
|
|
15083
15167
|
}
|
|
15084
15168
|
/**
|
|
15085
15169
|
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
@@ -15106,11 +15190,11 @@ const Chart$1 = class Chart {
|
|
|
15106
15190
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
15107
15191
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * factor;
|
|
15108
15192
|
const variances = this.prepareVariances();
|
|
15109
|
-
const layout = collectChartFacadeLayout(this.element, "bn-chart-structure-renderer",
|
|
15193
|
+
const layout = collectChartFacadeLayout(this.element, "bn-chart-structure-renderer", this.prepareSegments().map((segment) => segment || "base"), origins, detail);
|
|
15110
15194
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15111
15195
|
const firstInner = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("bn-chart-structure-renderer");
|
|
15112
15196
|
const state = {
|
|
15113
|
-
version:
|
|
15197
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
15114
15198
|
tag: this.element.localName,
|
|
15115
15199
|
id: localFrame.resolveStandaloneId(this.element),
|
|
15116
15200
|
slot: (_c = this.element.getAttribute("slot")) !== null && _c !== void 0 ? _c : undefined,
|
|
@@ -15197,13 +15281,19 @@ const Chart$1 = class Chart {
|
|
|
15197
15281
|
});
|
|
15198
15282
|
}
|
|
15199
15283
|
render() {
|
|
15200
|
-
|
|
15201
|
-
|
|
15202
|
-
|
|
15203
|
-
|
|
15284
|
+
const scenariosArray = this.prepareSegments();
|
|
15285
|
+
if (scenariosArray.length === 0) {
|
|
15286
|
+
this.errors.addOrReplace({
|
|
15287
|
+
id: "WARN_scenarios_none",
|
|
15288
|
+
type: "warning",
|
|
15289
|
+
message: "scenarios: none needs at least one variance, the chart is empty.",
|
|
15290
|
+
});
|
|
15291
|
+
}
|
|
15292
|
+
else {
|
|
15293
|
+
this.errors.remove("WARN_scenarios_none");
|
|
15204
15294
|
}
|
|
15205
15295
|
const fontStyles = this.getFontStyles();
|
|
15206
|
-
return (index.h(index.Host, { key: '
|
|
15296
|
+
return (index.h(index.Host, { key: 'a9b487fd43e785b1f14d0599ad0145a248b35f5d', style: fontStyles }, index.h("div", { key: '950ab383346b288ab17c2a1bbdfcfcd240e0f4d8', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
15207
15297
|
}
|
|
15208
15298
|
get element() { return index.getElement(this); }
|
|
15209
15299
|
static get watchers() { return {
|
|
@@ -15237,6 +15327,12 @@ const Chart$1 = class Chart {
|
|
|
15237
15327
|
"measureScale": [{
|
|
15238
15328
|
"validateMeasureScale": 0
|
|
15239
15329
|
}],
|
|
15330
|
+
"dataFormatDigitsDecimal": [{
|
|
15331
|
+
"validateDataFormatDigitsDecimal": 0
|
|
15332
|
+
}],
|
|
15333
|
+
"dataFormatDigitsPercent": [{
|
|
15334
|
+
"validateDataFormatDigitsPercent": 0
|
|
15335
|
+
}],
|
|
15240
15336
|
"stack": [{
|
|
15241
15337
|
"validateStack": 0
|
|
15242
15338
|
}],
|
|
@@ -16946,11 +17042,11 @@ let Needle$1 = class Needle {
|
|
|
16946
17042
|
(_a = this.label) === null || _a === void 0 ? void 0 : _a.updateGroup(newGroup);
|
|
16947
17043
|
return this;
|
|
16948
17044
|
}
|
|
16949
|
-
draw() {
|
|
17045
|
+
draw(dataFormatDigits = { percent: 2, decimal: 1 }) {
|
|
16950
17046
|
var _a, _b, _c;
|
|
16951
17047
|
if (((_a = this.dataPoint) === null || _a === void 0 ? void 0 : _a.value) === undefined) {
|
|
16952
17048
|
// reference 0: the label says "n/a", there is no pin
|
|
16953
|
-
(_b = this.label) === null || _b === void 0 ? void 0 : _b.draw();
|
|
17049
|
+
(_b = this.label) === null || _b === void 0 ? void 0 : _b.draw(dataFormatDigits);
|
|
16954
17050
|
return this;
|
|
16955
17051
|
}
|
|
16956
17052
|
if (this.isEmpty()) {
|
|
@@ -16980,7 +17076,7 @@ let Needle$1 = class Needle {
|
|
|
16980
17076
|
.stroke(strokeStyle)
|
|
16981
17077
|
.cy(this.dimensions.yPos)
|
|
16982
17078
|
.x(this.dimensions.xPos);
|
|
16983
|
-
(_c = this.label) === null || _c === void 0 ? void 0 : _c.draw();
|
|
17079
|
+
(_c = this.label) === null || _c === void 0 ? void 0 : _c.draw(dataFormatDigits);
|
|
16984
17080
|
}
|
|
16985
17081
|
createDimensions(position, dataPoint, index) {
|
|
16986
17082
|
if (dataPoint.getScaledPercentUnit() < 0) {
|
|
@@ -18194,7 +18290,7 @@ class StructureChart {
|
|
|
18194
18290
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
18195
18291
|
dataModel.forEach((elements, index) => {
|
|
18196
18292
|
if (elements["type"] === VarianceType$1.RELATIVE) {
|
|
18197
|
-
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw();
|
|
18293
|
+
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits);
|
|
18198
18294
|
}
|
|
18199
18295
|
else {
|
|
18200
18296
|
scenarioFactory.createVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
@@ -18506,10 +18602,12 @@ class DataFormatDigits {
|
|
|
18506
18602
|
class DataFormatDigitsAdapter {
|
|
18507
18603
|
adapt(data) {
|
|
18508
18604
|
const prefix = new DataFormatDigits();
|
|
18509
|
-
|
|
18605
|
+
// Intl.NumberFormat throws outside 0 to 100
|
|
18606
|
+
const valid = (value) => withStyled.CompareUtil.isNumber(value) && Number.isInteger(value) && value >= 0 && value <= 100;
|
|
18607
|
+
if (valid(data.percent)) {
|
|
18510
18608
|
prefix.percent = data.percent;
|
|
18511
18609
|
}
|
|
18512
|
-
if (
|
|
18610
|
+
if (valid(data.decimal)) {
|
|
18513
18611
|
prefix.decimal = data.decimal;
|
|
18514
18612
|
}
|
|
18515
18613
|
return prefix;
|
|
@@ -18837,7 +18935,7 @@ const Chart = class {
|
|
|
18837
18935
|
}
|
|
18838
18936
|
validateScenario(newValue) {
|
|
18839
18937
|
const errId = "WARN_scenarios";
|
|
18840
|
-
if (withTranslation.isInheritedValue(newValue)) {
|
|
18938
|
+
if (withTranslation.isInheritedValue(newValue) || withStyled.isNoScenarios(newValue)) {
|
|
18841
18939
|
this.errors.remove(errId);
|
|
18842
18940
|
return;
|
|
18843
18941
|
}
|
|
@@ -19025,6 +19123,51 @@ const Chart = class {
|
|
|
19025
19123
|
this.errors.remove(errId);
|
|
19026
19124
|
}
|
|
19027
19125
|
}
|
|
19126
|
+
validateDataFormatDigitsDecimal(newValue) {
|
|
19127
|
+
this.validateDigits("dataFormatDigitsDecimal", newValue);
|
|
19128
|
+
}
|
|
19129
|
+
validateDataFormatDigitsPercent(newValue) {
|
|
19130
|
+
this.validateDigits("dataFormatDigitsPercent", newValue);
|
|
19131
|
+
}
|
|
19132
|
+
validateDigits(name, value) {
|
|
19133
|
+
const errId = `WARN_${name}`;
|
|
19134
|
+
if (!withStyled.isValidInteger(value) || Number(value) < 0 || Number(value) > 100) {
|
|
19135
|
+
this.errors.addOrReplace({
|
|
19136
|
+
id: errId,
|
|
19137
|
+
type: "warning",
|
|
19138
|
+
message: name + ": invalid value '" + value + "' is not supported.",
|
|
19139
|
+
});
|
|
19140
|
+
}
|
|
19141
|
+
else {
|
|
19142
|
+
this.errors.remove(errId);
|
|
19143
|
+
}
|
|
19144
|
+
}
|
|
19145
|
+
validateAxisLabelsStep(newValue) {
|
|
19146
|
+
const errId = "WARN_axisLabelsStep";
|
|
19147
|
+
if (!withStyled.isValidInteger(newValue) || Number(newValue) < 1) {
|
|
19148
|
+
this.errors.addOrReplace({
|
|
19149
|
+
id: errId,
|
|
19150
|
+
type: "warning",
|
|
19151
|
+
message: "axisLabelsStep: invalid value '" + newValue + "' is not supported.",
|
|
19152
|
+
});
|
|
19153
|
+
}
|
|
19154
|
+
else {
|
|
19155
|
+
this.errors.remove(errId);
|
|
19156
|
+
}
|
|
19157
|
+
}
|
|
19158
|
+
validateAxisTitlePosition(newValue) {
|
|
19159
|
+
const errId = "WARN_axisTitlePosition";
|
|
19160
|
+
if (!withStyled.isBlankInput(newValue) && !["left", "right", "none"].includes(newValue.trim().toLowerCase())) {
|
|
19161
|
+
this.errors.addOrReplace({
|
|
19162
|
+
id: errId,
|
|
19163
|
+
type: "warning",
|
|
19164
|
+
message: "axisTitlePosition: invalid value '" + newValue + "' is not supported.",
|
|
19165
|
+
});
|
|
19166
|
+
}
|
|
19167
|
+
else {
|
|
19168
|
+
this.errors.remove(errId);
|
|
19169
|
+
}
|
|
19170
|
+
}
|
|
19028
19171
|
constructor(hostRef) {
|
|
19029
19172
|
index.registerInstance(this, hostRef);
|
|
19030
19173
|
/** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
|
|
@@ -19163,6 +19306,35 @@ const Chart = class {
|
|
|
19163
19306
|
* measureUnit displayed in table.
|
|
19164
19307
|
*/
|
|
19165
19308
|
this.measureUnit = "";
|
|
19309
|
+
/**
|
|
19310
|
+
* Number of decimal digits of the value labels
|
|
19311
|
+
*/
|
|
19312
|
+
this.dataFormatDigitsDecimal = 1;
|
|
19313
|
+
/**
|
|
19314
|
+
* Number of decimal digits of the percent labels (relative variances)
|
|
19315
|
+
*/
|
|
19316
|
+
this.dataFormatDigitsPercent = 2;
|
|
19317
|
+
/**
|
|
19318
|
+
* Prints only every n-th category label, starting with the first period.
|
|
19319
|
+
* 2 labels every second period. Bar mode only.
|
|
19320
|
+
*/
|
|
19321
|
+
this.axisLabelsStep = 1;
|
|
19322
|
+
/**
|
|
19323
|
+
* For a series that changes its scenario along the time axis, for example
|
|
19324
|
+
* AC up to this year and PL after it. In a period where the first scenario
|
|
19325
|
+
* has no value, the next scenario with a value is drawn in its place with
|
|
19326
|
+
* its value label. A vertical line marks the change, and the scenario names
|
|
19327
|
+
* stand under the axis. Variances with the same reference and type share
|
|
19328
|
+
* one row. Bar mode without stack only.
|
|
19329
|
+
*/
|
|
19330
|
+
this.scenarioSwitch = false;
|
|
19331
|
+
/**
|
|
19332
|
+
* Where the axis title stands (the chart title, or the name of a variance).
|
|
19333
|
+
* <br /><br />
|
|
19334
|
+
* values:<br />
|
|
19335
|
+
* ```left // right // none```
|
|
19336
|
+
*/
|
|
19337
|
+
this.axisTitlePosition = "left";
|
|
19166
19338
|
this.pixelPerUnitGroupMap = new Map();
|
|
19167
19339
|
this._autoScaleGuard = false;
|
|
19168
19340
|
this._lastObservedWidth = 0;
|
|
@@ -19241,6 +19413,10 @@ const Chart = class {
|
|
|
19241
19413
|
this.validateMaxBars(this.maxBars);
|
|
19242
19414
|
this.validateStack(this.stack);
|
|
19243
19415
|
this.validateScaling(this.scale);
|
|
19416
|
+
this.validateDataFormatDigitsDecimal(this.dataFormatDigitsDecimal);
|
|
19417
|
+
this.validateDataFormatDigitsPercent(this.dataFormatDigitsPercent);
|
|
19418
|
+
this.validateAxisLabelsStep(this.axisLabelsStep);
|
|
19419
|
+
this.validateAxisTitlePosition(this.axisTitlePosition);
|
|
19244
19420
|
}
|
|
19245
19421
|
/**
|
|
19246
19422
|
* Content width from the rendered SVG width attributes (segments stack
|
|
@@ -19454,14 +19630,14 @@ const Chart = class {
|
|
|
19454
19630
|
prepareDimension() {
|
|
19455
19631
|
const parent = withTranslation.getParentDimensions(this.element);
|
|
19456
19632
|
const scenariosList = this.prepareScenarios();
|
|
19457
|
-
const
|
|
19458
|
-
this.canvasWidthSegmented = parent.width / (scenariosList.length +
|
|
19633
|
+
const segments = this.prepareSegments();
|
|
19634
|
+
this.canvasWidthSegmented = parent.width / (scenariosList.length + this.prepareVariances().length || 1);
|
|
19459
19635
|
this._lastAppliedHeight = parent.height;
|
|
19460
19636
|
// The base chart and each variance render as vertically stacked segments
|
|
19461
19637
|
// (see render()), so each one may only claim its share of the height.
|
|
19462
19638
|
// The measure-scale footer (first segment only) renders below its SVG:
|
|
19463
19639
|
// reserve roughly one em for it so the fitted charts leave it room.
|
|
19464
|
-
const segmentCount = 1
|
|
19640
|
+
const segmentCount = Math.max(1, segments.length);
|
|
19465
19641
|
const footerAllowance = this.showMeasureScale ? this.getEffectiveFontPx() : 0;
|
|
19466
19642
|
return { width: this.canvasWidthSegmented, height: Math.max(0, parent.height - footerAllowance) / segmentCount };
|
|
19467
19643
|
}
|
|
@@ -19472,6 +19648,10 @@ const Chart = class {
|
|
|
19472
19648
|
this.errors.remove("AUTO_scenarios");
|
|
19473
19649
|
return scenarios.value.split(",").map((entry) => entry.trim());
|
|
19474
19650
|
}
|
|
19651
|
+
if (withStyled.isNoScenarios(scenarios.value)) {
|
|
19652
|
+
this.errors.remove("AUTO_scenarios");
|
|
19653
|
+
return [];
|
|
19654
|
+
}
|
|
19475
19655
|
const isAuto = ((_a = scenarios.value) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
19476
19656
|
if (withStyled.isBlankInput(scenarios.value) || isAuto) {
|
|
19477
19657
|
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
@@ -19493,6 +19673,40 @@ const Chart = class {
|
|
|
19493
19673
|
this.errors.remove("AUTO_scenarios");
|
|
19494
19674
|
return (_d = scenarios.value) === null || _d === void 0 ? void 0 : _d.split(",").map((entry) => entry.trim());
|
|
19495
19675
|
}
|
|
19676
|
+
/** `scenarios="none"`: the chart draws its variances only. */
|
|
19677
|
+
hidesScenarios() {
|
|
19678
|
+
const scenarios = this.resolveInherited("scenarios", this.scenarios);
|
|
19679
|
+
return !scenarios.inherited && withStyled.isNoScenarios(scenarios.value);
|
|
19680
|
+
}
|
|
19681
|
+
/**
|
|
19682
|
+
* The stacked segments, bottom to top: `[]` is the base chart, else the
|
|
19683
|
+
* variances of one row. With `scenarioSwitch`, variances of one type over
|
|
19684
|
+
* the same reference share a row.
|
|
19685
|
+
*/
|
|
19686
|
+
prepareSegments() {
|
|
19687
|
+
const rows = this.hidesScenarios() ? [] : [[]];
|
|
19688
|
+
const rowByKey = new Map();
|
|
19689
|
+
for (const variance of this.prepareVariances()) {
|
|
19690
|
+
const parsed = new VarianceScenario(variance);
|
|
19691
|
+
const key = `${parsed.type}:${parsed.delta}`;
|
|
19692
|
+
const row = this.scenarioSwitch && parsed.isValid ? rowByKey.get(key) : undefined;
|
|
19693
|
+
if (row) {
|
|
19694
|
+
row.push(variance);
|
|
19695
|
+
continue;
|
|
19696
|
+
}
|
|
19697
|
+
const created = [variance];
|
|
19698
|
+
rows.push(created);
|
|
19699
|
+
if (parsed.isValid) {
|
|
19700
|
+
rowByKey.set(key, created);
|
|
19701
|
+
}
|
|
19702
|
+
}
|
|
19703
|
+
return rows;
|
|
19704
|
+
}
|
|
19705
|
+
prepareAxisTitlePosition() {
|
|
19706
|
+
var _a;
|
|
19707
|
+
const position = (_a = this.axisTitlePosition) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase();
|
|
19708
|
+
return position === "right" || position === "none" ? position : "left";
|
|
19709
|
+
}
|
|
19496
19710
|
prepareAvg() {
|
|
19497
19711
|
return this.showOverlayAvg;
|
|
19498
19712
|
}
|
|
@@ -19523,7 +19737,7 @@ const Chart = class {
|
|
|
19523
19737
|
}
|
|
19524
19738
|
}
|
|
19525
19739
|
}
|
|
19526
|
-
if (scenarios.length > 0 && missing.length > 0) {
|
|
19740
|
+
if (!this.hidesScenarios() && scenarios.length > 0 && missing.length > 0) {
|
|
19527
19741
|
this.errors.addOrReplace({
|
|
19528
19742
|
id: errId,
|
|
19529
19743
|
type: "warning",
|
|
@@ -19538,7 +19752,7 @@ const Chart = class {
|
|
|
19538
19752
|
return idx >= 1 || !this.showCategories;
|
|
19539
19753
|
}
|
|
19540
19754
|
prepareI18n() {
|
|
19541
|
-
const i18nMetaLabelsLocal = ["no-data"];
|
|
19755
|
+
const i18nMetaLabelsLocal = ["no-data", "date-format-short-year"];
|
|
19542
19756
|
const i18nMetaLabelsGlobal = withHasError.globalLabelKeys;
|
|
19543
19757
|
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
19544
19758
|
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
@@ -19648,14 +19862,17 @@ const Chart = class {
|
|
|
19648
19862
|
if (this.syncSpaceLeft > -1) {
|
|
19649
19863
|
return this.syncSpaceLeft;
|
|
19650
19864
|
}
|
|
19651
|
-
|
|
19865
|
+
// without a title on the left only the scenario names stand there
|
|
19866
|
+
const titles = this.prepareAxisTitlePosition() === "left" ? [...this.prepareVariances(), this.chartTitle] : [];
|
|
19867
|
+
const leftSideOffset = Formatter.getMaxWidthOfArrayItems([...titles, ...this.prepareScenarios()], preparedI18n, preparedStyle);
|
|
19652
19868
|
//if(leftSideOffset < this.syncSpaceLeft) {
|
|
19653
19869
|
// return this.syncSpaceLeft;
|
|
19654
19870
|
//}
|
|
19655
19871
|
return leftSideOffset;
|
|
19656
19872
|
}
|
|
19657
19873
|
prepareChartTitle(idx) {
|
|
19658
|
-
|
|
19874
|
+
// a variance keeps its own name as title
|
|
19875
|
+
if (idx >= 1 || this.hidesScenarios()) {
|
|
19659
19876
|
return "";
|
|
19660
19877
|
}
|
|
19661
19878
|
return this.chartTitle;
|
|
@@ -19807,16 +20024,18 @@ const Chart = class {
|
|
|
19807
20024
|
prepareMaxBars() {
|
|
19808
20025
|
return Math.floor(Number(this.maxBars) || 28);
|
|
19809
20026
|
}
|
|
19810
|
-
chartTemplate(
|
|
20027
|
+
chartTemplate(segmentVariances, idx) {
|
|
19811
20028
|
const preparedI18n = this.prepareI18n();
|
|
19812
20029
|
const preparedStyle = this.prepareStyle();
|
|
19813
20030
|
const fullParentWidth = withTranslation.getParentDimensions(this.element).width;
|
|
19814
20031
|
const ppu = this.preparePixelPerUnit();
|
|
19815
20032
|
const ppp = this.preparePixelPerPercentage();
|
|
19816
20033
|
const stackConfig = this.prepareStackConfig();
|
|
19817
|
-
const
|
|
19818
|
-
const
|
|
19819
|
-
|
|
20034
|
+
const isBase = segmentVariances.length === 0;
|
|
20035
|
+
const scenarios = this.hidesScenarios() ? variancesScenarios(segmentVariances) : this.prepareScenarios();
|
|
20036
|
+
// only the base chart draws a stack, a variance needs both of its scenarios
|
|
20037
|
+
const effectiveScenarios = isBase && (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === withStyled.StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
20038
|
+
return (index.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() }));
|
|
19820
20039
|
}
|
|
19821
20040
|
/**
|
|
19822
20041
|
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
@@ -19843,11 +20062,11 @@ const Chart = class {
|
|
|
19843
20062
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
19844
20063
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * factor;
|
|
19845
20064
|
const variances = this.prepareVariances();
|
|
19846
|
-
const layout = collectChartFacadeLayout(this.element, "bn-chart-time-renderer",
|
|
20065
|
+
const layout = collectChartFacadeLayout(this.element, "bn-chart-time-renderer", this.prepareSegments().map((segment) => (segment.length > 0 ? segment.join(",") : "base")), origins, detail);
|
|
19847
20066
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19848
20067
|
const firstInner = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("bn-chart-time-renderer");
|
|
19849
20068
|
const state = {
|
|
19850
|
-
version:
|
|
20069
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
19851
20070
|
tag: this.element.localName,
|
|
19852
20071
|
id: localFrame.resolveStandaloneId(this.element),
|
|
19853
20072
|
slot: (_c = this.element.getAttribute("slot")) !== null && _c !== void 0 ? _c : undefined,
|
|
@@ -19935,14 +20154,20 @@ const Chart = class {
|
|
|
19935
20154
|
});
|
|
19936
20155
|
}
|
|
19937
20156
|
render() {
|
|
19938
|
-
|
|
19939
|
-
const
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
20157
|
+
this.checkVarianceScenarios(this.prepareVariances());
|
|
20158
|
+
const segments = this.prepareSegments();
|
|
20159
|
+
if (segments.length === 0) {
|
|
20160
|
+
this.errors.addOrReplace({
|
|
20161
|
+
id: "WARN_scenarios_none",
|
|
20162
|
+
type: "warning",
|
|
20163
|
+
message: "scenarios: none needs at least one variance, the chart is empty.",
|
|
20164
|
+
});
|
|
20165
|
+
}
|
|
20166
|
+
else {
|
|
20167
|
+
this.errors.remove("WARN_scenarios_none");
|
|
19943
20168
|
}
|
|
19944
20169
|
const fontStyles = this.getFontStyles();
|
|
19945
|
-
return (index.h(index.Host, { key: '
|
|
20170
|
+
return (index.h(index.Host, { key: '530c7c27c23afc339ca03506f2cb608774e8a7ed', style: fontStyles }, index.h("div", { key: '99bbe8fa9d17ef14bbb6a3b5e2dce21025cdc40c', class: "container" }, segments.map(this.chartTemplate))));
|
|
19946
20171
|
}
|
|
19947
20172
|
get element() { return index.getElement(this); }
|
|
19948
20173
|
static get watchers() { return {
|
|
@@ -19984,6 +20209,18 @@ const Chart = class {
|
|
|
19984
20209
|
}],
|
|
19985
20210
|
"measureScale": [{
|
|
19986
20211
|
"validateMeasureScale": 0
|
|
20212
|
+
}],
|
|
20213
|
+
"dataFormatDigitsDecimal": [{
|
|
20214
|
+
"validateDataFormatDigitsDecimal": 0
|
|
20215
|
+
}],
|
|
20216
|
+
"dataFormatDigitsPercent": [{
|
|
20217
|
+
"validateDataFormatDigitsPercent": 0
|
|
20218
|
+
}],
|
|
20219
|
+
"axisLabelsStep": [{
|
|
20220
|
+
"validateAxisLabelsStep": 0
|
|
20221
|
+
}],
|
|
20222
|
+
"axisTitlePosition": [{
|
|
20223
|
+
"validateAxisTitlePosition": 0
|
|
19987
20224
|
}]
|
|
19988
20225
|
}; }
|
|
19989
20226
|
};
|
|
@@ -20422,6 +20659,8 @@ class CustomPattern {
|
|
|
20422
20659
|
*/
|
|
20423
20660
|
class DataPoint {
|
|
20424
20661
|
constructor(value, scenario, pixelPerUnit, variance) {
|
|
20662
|
+
/** Relative variances beyond this fraction are cut. Infinity when the chart has room for the full pin. */
|
|
20663
|
+
this.percentClamp = DataPoint.PERCENT_CLAMP;
|
|
20425
20664
|
this.value = value;
|
|
20426
20665
|
this.scenario = scenario;
|
|
20427
20666
|
this.pixelPerUnit = pixelPerUnit || 1;
|
|
@@ -20448,7 +20687,7 @@ class DataPoint {
|
|
|
20448
20687
|
return this.value * this.pixelPerUnit;
|
|
20449
20688
|
}
|
|
20450
20689
|
/**
|
|
20451
|
-
* Returns the percentage value scaled to pixel height, clipped at +/-145
|
|
20690
|
+
* Returns the percentage value scaled to pixel height, clipped at +/-145% unless the clamp is lifted.
|
|
20452
20691
|
*
|
|
20453
20692
|
* Values beyond +/-1.45 (145%) are clamped to prevent extreme bars from
|
|
20454
20693
|
* distorting the chart layout. Use {@link isClipped} to check if clipping occurred.
|
|
@@ -20457,11 +20696,11 @@ class DataPoint {
|
|
|
20457
20696
|
if (this.value == null) {
|
|
20458
20697
|
return 0;
|
|
20459
20698
|
}
|
|
20460
|
-
if (this.value >
|
|
20461
|
-
return
|
|
20699
|
+
if (this.value > this.percentClamp) {
|
|
20700
|
+
return this.percentClamp * this.pixelPerUnit;
|
|
20462
20701
|
}
|
|
20463
|
-
if (this.value < -
|
|
20464
|
-
return -
|
|
20702
|
+
if (this.value < -this.percentClamp) {
|
|
20703
|
+
return -this.percentClamp * this.pixelPerUnit;
|
|
20465
20704
|
}
|
|
20466
20705
|
return this.value * this.pixelPerUnit;
|
|
20467
20706
|
}
|
|
@@ -20492,7 +20731,7 @@ class DataPoint {
|
|
|
20492
20731
|
if (this.value == null) {
|
|
20493
20732
|
return false;
|
|
20494
20733
|
}
|
|
20495
|
-
return Math.abs(this.value) >
|
|
20734
|
+
return Math.abs(this.value) > this.percentClamp;
|
|
20496
20735
|
}
|
|
20497
20736
|
/** Returns the fixed display value (145) shown on clipped percentage bars. */
|
|
20498
20737
|
getClippedValue() {
|
|
@@ -20504,6 +20743,7 @@ class DataPoint {
|
|
|
20504
20743
|
return (_a = this.scenario) === null || _a === void 0 ? void 0 : _a.slice(0, 2);
|
|
20505
20744
|
}
|
|
20506
20745
|
}
|
|
20746
|
+
DataPoint.PERCENT_CLAMP = 1.45;
|
|
20507
20747
|
|
|
20508
20748
|
// import { IAdapter } from "../../../../utils/helper/IAdapter";
|
|
20509
20749
|
// import { CompareUtil } from "../../../../utils/helper/CompareUtil";
|
|
@@ -20766,6 +21006,7 @@ class Axis {
|
|
|
20766
21006
|
this.scenarioType = axis.scenarioType;
|
|
20767
21007
|
this.labelText = axis.labelText || null;
|
|
20768
21008
|
this.isRelative = axis.isRelative || false;
|
|
21009
|
+
this.titlePosition = axis.titlePosition || "left";
|
|
20769
21010
|
this.position = position;
|
|
20770
21011
|
this.svgGroup = svgParentGroup.group().id(this.ID_AXIS);
|
|
20771
21012
|
}
|
|
@@ -20773,12 +21014,19 @@ class Axis {
|
|
|
20773
21014
|
if (null == text) {
|
|
20774
21015
|
text = "";
|
|
20775
21016
|
}
|
|
21017
|
+
if (this.titlePosition === "right") {
|
|
21018
|
+
group
|
|
21019
|
+
.text(text)
|
|
21020
|
+
.addClass(this.CSS_AXIS_TITLE)
|
|
21021
|
+
.move(this.position.getAxisEndPositionX() + this.position.spacings.labelToColumn, this.position.getAxisTitlePositionY(true, this.isRelative));
|
|
21022
|
+
return;
|
|
21023
|
+
}
|
|
20776
21024
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20777
21025
|
const title = group.text(text).addClass(this.CSS_AXIS_TITLE).attr("text-anchor", "middle");
|
|
20778
21026
|
title.move(this.position.getAxisTitlePositionX(group), this.position.getAxisTitlePositionY(true, this.isRelative));
|
|
20779
21027
|
}
|
|
20780
21028
|
draw() {
|
|
20781
|
-
if (this.labelText) {
|
|
21029
|
+
if (this.labelText && this.titlePosition !== "none") {
|
|
20782
21030
|
this.drawAxisTitle(this.svgGroup, this.labelText);
|
|
20783
21031
|
}
|
|
20784
21032
|
this.svgGroup
|
|
@@ -20863,16 +21111,22 @@ class Column {
|
|
|
20863
21111
|
return this;
|
|
20864
21112
|
}
|
|
20865
21113
|
draw(dataFormatDigits = { percent: 2, decimal: 1 }, measureScale = new SiPrefix()) {
|
|
20866
|
-
var _a;
|
|
21114
|
+
var _a, _b, _c;
|
|
20867
21115
|
// TODE: JHE: Remove DataFOrmatDigits Type Duplicates
|
|
20868
21116
|
if (this.isEmpty()) {
|
|
20869
21117
|
return this;
|
|
20870
21118
|
}
|
|
20871
21119
|
const scenarioStyle = this.getScenarioStyle();
|
|
20872
|
-
|
|
20873
|
-
|
|
21120
|
+
let strokeStyle = this.convertToSVGStyle(scenarioStyle, "stroke");
|
|
21121
|
+
let fillStyle = this.getFillStyle(scenarioStyle);
|
|
21122
|
+
if (this.isVarianceColumn && this.dataPoint.notation === "pl") {
|
|
21123
|
+
// outlined like a plan column: the colour of the variance on the edge only
|
|
21124
|
+
const planWidth = Number((_b = (_a = this.columnBarStyles) === null || _a === void 0 ? void 0 : _a.pl) === null || _b === void 0 ? void 0 : _b.width);
|
|
21125
|
+
strokeStyle = { color: (scenarioStyle === null || scenarioStyle === void 0 ? void 0 : scenarioStyle.fill) || this.FALLBACK_COLOUR, width: planWidth > 0 ? planWidth : 1 };
|
|
21126
|
+
fillStyle = this.styles.fontStyles.background || "#ffffff";
|
|
21127
|
+
}
|
|
20874
21128
|
this.scenarioGroup.attr(dataPointAttributes(this.dataPoint.key));
|
|
20875
|
-
(
|
|
21129
|
+
(_c = this.columnGroup) === null || _c === void 0 ? void 0 : _c.attr(dataPointAttributes(this.dataPoint.key, "element"));
|
|
20876
21130
|
if (this.columnGroup != null) {
|
|
20877
21131
|
if (this.isOverflowing && this.overflowConfig) {
|
|
20878
21132
|
this.drawOverdriveBar(fillStyle, strokeStyle);
|
|
@@ -21239,11 +21493,11 @@ class Needle {
|
|
|
21239
21493
|
(_a = this.dataLabel) === null || _a === void 0 ? void 0 : _a.updateGroup(newGroup);
|
|
21240
21494
|
return this;
|
|
21241
21495
|
}
|
|
21242
|
-
draw() {
|
|
21496
|
+
draw(dataFormatDigits = { percent: 2, decimal: 1 }) {
|
|
21243
21497
|
var _a, _b, _c;
|
|
21244
21498
|
if (((_a = this.dataPoint) === null || _a === void 0 ? void 0 : _a.value) === undefined) {
|
|
21245
21499
|
// reference 0: the label says "n/a", there is no pin
|
|
21246
|
-
(_b = this.dataLabel) === null || _b === void 0 ? void 0 : _b.draw();
|
|
21500
|
+
(_b = this.dataLabel) === null || _b === void 0 ? void 0 : _b.draw(true, dataFormatDigits);
|
|
21247
21501
|
return this;
|
|
21248
21502
|
}
|
|
21249
21503
|
if (this.isEmpty()) {
|
|
@@ -21263,6 +21517,12 @@ class Needle {
|
|
|
21263
21517
|
fillStyle = polygonPattern.pattern;
|
|
21264
21518
|
}
|
|
21265
21519
|
}
|
|
21520
|
+
if (this.dataPoint.notation === "pl") {
|
|
21521
|
+
// outlined like a plan column: the colour of the variance on the edge only
|
|
21522
|
+
strokeStyle.color = (scenarioStyle === null || scenarioStyle === void 0 ? void 0 : scenarioStyle.fill) || strokeStyle.color;
|
|
21523
|
+
strokeStyle.width = Math.max(1, Number(strokeStyle.width) || 0);
|
|
21524
|
+
fillStyle = this.styles.fontStyles.background || "#ffffff";
|
|
21525
|
+
}
|
|
21266
21526
|
if (this.dimensions.clipped) {
|
|
21267
21527
|
this.createClippedNeedleHead(fillStyle, strokeStyle);
|
|
21268
21528
|
}
|
|
@@ -21275,7 +21535,7 @@ class Needle {
|
|
|
21275
21535
|
.y(this.dimensions.yPos)
|
|
21276
21536
|
.fill(fillStyle)
|
|
21277
21537
|
.stroke(strokeStyle);
|
|
21278
|
-
(_c = this.dataLabel) === null || _c === void 0 ? void 0 : _c.draw();
|
|
21538
|
+
(_c = this.dataLabel) === null || _c === void 0 ? void 0 : _c.draw(true, dataFormatDigits);
|
|
21279
21539
|
}
|
|
21280
21540
|
createDimensions(position, dataPoint, index) {
|
|
21281
21541
|
if (dataPoint.getScaledPercentUnit() < 0) {
|
|
@@ -21342,12 +21602,6 @@ class Needle {
|
|
|
21342
21602
|
}
|
|
21343
21603
|
}
|
|
21344
21604
|
|
|
21345
|
-
const IBCS_LINE_STYLES = {
|
|
21346
|
-
ac: { markerFill: "#000000", markerStroke: "#000000", lineColor: "#000000" },
|
|
21347
|
-
pp: { markerFill: "#999999", markerStroke: "#999999", lineColor: "#999999" },
|
|
21348
|
-
fc: { markerFill: "#ffffff", markerStroke: "#000000", lineColor: "#000000", lineDashArray: "4,4" },
|
|
21349
|
-
pl: { markerFill: "#ffffff", markerStroke: "#000000", lineColor: "#000000" },
|
|
21350
|
-
};
|
|
21351
21605
|
class LineSeries {
|
|
21352
21606
|
constructor(position, styles, dataPoints, scenarioGroup, labelGroup, scenarioName, scenarioLabel, _i18n, collisionManager = null,
|
|
21353
21607
|
/** Style slot (ac, pp, fc, pl) of the line. Without it the scenario name decides. */
|
|
@@ -21405,7 +21659,7 @@ class LineSeries {
|
|
|
21405
21659
|
getLineStyle() {
|
|
21406
21660
|
var _a, _b, _c;
|
|
21407
21661
|
const scenarioType = (_a = this.lineSlot) !== null && _a !== void 0 ? _a : (((_c = (_b = this.scenarioName) === null || _b === void 0 ? void 0 : _b.slice(0, 2)) === null || _c === void 0 ? void 0 : _c.toLowerCase()) || "ac");
|
|
21408
|
-
return IBCS_LINE_STYLES[scenarioType] || IBCS_LINE_STYLES.ac;
|
|
21662
|
+
return index$1.IBCS_LINE_STYLES[scenarioType] || index$1.IBCS_LINE_STYLES.ac;
|
|
21409
21663
|
}
|
|
21410
21664
|
/**
|
|
21411
21665
|
* Extracts the scenario variant number (1-4) from the scenario name.
|
|
@@ -21706,15 +21960,6 @@ class StackedColumn {
|
|
|
21706
21960
|
}
|
|
21707
21961
|
}
|
|
21708
21962
|
|
|
21709
|
-
/**
|
|
21710
|
-
* IBCS-style area fill colors for stacked area charts.
|
|
21711
|
-
*/
|
|
21712
|
-
const SCENARIO_AREA_STYLES = {
|
|
21713
|
-
ac: { fill: "#000000", opacity: 0.3, lineColor: "#000000" },
|
|
21714
|
-
pp: { fill: "#999999", opacity: 0.3, lineColor: "#999999" },
|
|
21715
|
-
fc: { fill: "#000000", opacity: 0.2, lineColor: "#000000", dashArray: "4,4" },
|
|
21716
|
-
pl: { fill: "#000000", opacity: 0.1, lineColor: "#000000" },
|
|
21717
|
-
};
|
|
21718
21963
|
const GRAYSCALE_AREA_STYLES = [
|
|
21719
21964
|
{ fill: "#000000", opacity: 0.3 },
|
|
21720
21965
|
{ fill: "#555555", opacity: 0.25 },
|
|
@@ -21753,7 +21998,7 @@ class AreaFill {
|
|
|
21753
21998
|
let opacity;
|
|
21754
21999
|
if (this.isScenarioStack && this.scenarioType) {
|
|
21755
22000
|
const prefix = this.scenarioType.slice(0, 2).toLowerCase();
|
|
21756
|
-
const style = SCENARIO_AREA_STYLES[prefix] || SCENARIO_AREA_STYLES["ac"];
|
|
22001
|
+
const style = index$1.SCENARIO_AREA_STYLES[prefix] || index$1.SCENARIO_AREA_STYLES["ac"];
|
|
21757
22002
|
fill = style.fill;
|
|
21758
22003
|
opacity = style.opacity;
|
|
21759
22004
|
}
|
|
@@ -21775,7 +22020,7 @@ class AreaFill {
|
|
|
21775
22020
|
let dashArray;
|
|
21776
22021
|
if (this.isScenarioStack && this.scenarioType) {
|
|
21777
22022
|
const prefix = this.scenarioType.slice(0, 2).toLowerCase();
|
|
21778
|
-
const style = SCENARIO_AREA_STYLES[prefix] || SCENARIO_AREA_STYLES["ac"];
|
|
22023
|
+
const style = index$1.SCENARIO_AREA_STYLES[prefix] || index$1.SCENARIO_AREA_STYLES["ac"];
|
|
21779
22024
|
lineColor = style.lineColor;
|
|
21780
22025
|
dashArray = style.dashArray;
|
|
21781
22026
|
}
|
|
@@ -21990,12 +22235,12 @@ class ScenarioFactory {
|
|
|
21990
22235
|
}
|
|
21991
22236
|
return new Line(this.position, this.styles, dataPoint, previousDataPoint, index, isPrimaryColumn, columnGroup, lineLabel).updateLabelGroup(labelGroup);
|
|
21992
22237
|
}
|
|
21993
|
-
createPrimaryBar(dataPoint, index) {
|
|
22238
|
+
createPrimaryBar(dataPoint, index, withScenarioLabel = true) {
|
|
21994
22239
|
const isPrimaryColumn = true;
|
|
21995
22240
|
const columnGroup = this.svgGroups.scenario1.group().id("" + index);
|
|
21996
22241
|
const labelGroup = this.svgGroups.scenario1Label.group().id("" + index);
|
|
21997
22242
|
let columnLabel = null;
|
|
21998
|
-
if (this.isLastDataPoint(index)) {
|
|
22243
|
+
if (withScenarioLabel && this.isLastDataPoint(index)) {
|
|
21999
22244
|
columnLabel = `${this.i18n.get(dataPoint.scenario) || dataPoint.scenario}`;
|
|
22000
22245
|
}
|
|
22001
22246
|
return new Column(this.position, this.styles, dataPoint, index, isPrimaryColumn, columnGroup, columnLabel, this.overflowConfig).updateLabelGroup(labelGroup);
|
|
@@ -22218,6 +22463,11 @@ class TimeChart {
|
|
|
22218
22463
|
this.availableWidth = 0;
|
|
22219
22464
|
this.overflowConfig = null;
|
|
22220
22465
|
this.lastScenarios = [];
|
|
22466
|
+
this.axisLabelsStep = 1;
|
|
22467
|
+
this.scenarioSwitch = false;
|
|
22468
|
+
this.axisTitlePosition = "left";
|
|
22469
|
+
/** Periods in which more than one variance of a shared row has a value. */
|
|
22470
|
+
this.varianceOverlaps = 0;
|
|
22221
22471
|
this.db = db;
|
|
22222
22472
|
this.tableName = tableName;
|
|
22223
22473
|
this.ruleSet = ruleSet || new IBCSRuleSet();
|
|
@@ -22272,7 +22522,8 @@ class TimeChart {
|
|
|
22272
22522
|
this.position.padding.top +
|
|
22273
22523
|
this.position.padding.bottom +
|
|
22274
22524
|
this.position.spacings.labelToAxis +
|
|
22275
|
-
fontSize
|
|
22525
|
+
fontSize + // axis labels approximate height
|
|
22526
|
+
this.switchNamesHeight();
|
|
22276
22527
|
const overdriveZoneHeight = fontSize * 1.5;
|
|
22277
22528
|
const breakGap = fontSize * 0.3;
|
|
22278
22529
|
const cutHeight = availableHeight - nonBarOverhead - overdriveZoneHeight - breakGap;
|
|
@@ -22296,7 +22547,7 @@ class TimeChart {
|
|
|
22296
22547
|
};
|
|
22297
22548
|
}
|
|
22298
22549
|
setConfig(config) {
|
|
22299
|
-
var _a;
|
|
22550
|
+
var _a, _b, _c, _d;
|
|
22300
22551
|
this.state = FactoryState$1.DIRTY;
|
|
22301
22552
|
// Must precede setSource/populateModel: the locale is baked into the
|
|
22302
22553
|
// normalizeDate() SQL as well as into the axis date labels.
|
|
@@ -22309,11 +22560,14 @@ class TimeChart {
|
|
|
22309
22560
|
this.pixelPerPercentage = config.pixelPerPercentage;
|
|
22310
22561
|
this.axisLabelsMode = config.axisLabelsMode;
|
|
22311
22562
|
this.intervalSpanLimit = config.intervalSpanLimit;
|
|
22563
|
+
this.axisLabelsStep = (_a = config.axisLabelsStep) !== null && _a !== void 0 ? _a : 1;
|
|
22564
|
+
this.scenarioSwitch = (_b = config.scenarioSwitch) !== null && _b !== void 0 ? _b : false;
|
|
22565
|
+
this.axisTitlePosition = (_c = config.axisTitlePosition) !== null && _c !== void 0 ? _c : "left";
|
|
22312
22566
|
this.dateInterval = this.findDateInterval(config.dateInterval);
|
|
22313
22567
|
this.dataModel = this.populateModel(scenarios, this.dateInterval);
|
|
22314
22568
|
this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
|
|
22315
22569
|
this.configTitle = config.title;
|
|
22316
|
-
this.configVariances = (
|
|
22570
|
+
this.configVariances = (_d = config === null || config === void 0 ? void 0 : config.variances) !== null && _d !== void 0 ? _d : [];
|
|
22317
22571
|
this.updateTitle();
|
|
22318
22572
|
this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
|
|
22319
22573
|
this.smallestVarianceDataPointValue = this.findSmallestDataPointValue(this.variancesDataModel);
|
|
@@ -22381,8 +22635,10 @@ class TimeChart {
|
|
|
22381
22635
|
}
|
|
22382
22636
|
/** Derives the variance title from the stored config and the current i18n map. */
|
|
22383
22637
|
updateTitle() {
|
|
22384
|
-
var _a;
|
|
22385
|
-
|
|
22638
|
+
var _a, _b;
|
|
22639
|
+
// variances that share a row have the same reference: the first one names the row
|
|
22640
|
+
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();
|
|
22641
|
+
this.title = this.configTitle || Formatter.translateScenarioLabel(variance, this.i18n);
|
|
22386
22642
|
}
|
|
22387
22643
|
/**
|
|
22388
22644
|
* Resolves the dataset (a table or view in the shared alasql database) and
|
|
@@ -22423,7 +22679,15 @@ class TimeChart {
|
|
|
22423
22679
|
// Also consider bbox-based measurement as a fallback (works for rects)
|
|
22424
22680
|
const bboxWidth = Math.max(this.axisCategoryArea.width, this.scenariosArea.width);
|
|
22425
22681
|
const bboxTotal = bboxWidth > 0 ? bboxWidth + this.position.leftSideLabelLength : 0;
|
|
22426
|
-
|
|
22682
|
+
let titleEnd = 0;
|
|
22683
|
+
if (this.axisTitlePosition === "right" && this.title) {
|
|
22684
|
+
const titleWidth = CalculateSize(this.title, {
|
|
22685
|
+
font: this.styles.fontStyles.font,
|
|
22686
|
+
fontSize: this.styles.fontStyles.size + "px",
|
|
22687
|
+
}).width;
|
|
22688
|
+
titleEnd = axisEnd + this.position.spacings.labelToColumn + titleWidth + this.styles.padding.right;
|
|
22689
|
+
}
|
|
22690
|
+
return Math.max(axisEnd + labelBuffer, bboxTotal, titleEnd);
|
|
22427
22691
|
}
|
|
22428
22692
|
getAllocatedCanvasHeight() {
|
|
22429
22693
|
if (this.smallestVarianceDataPointValue.value == null ||
|
|
@@ -22454,7 +22718,91 @@ class TimeChart {
|
|
|
22454
22718
|
const bboxHeight = isOnSameAxisSide
|
|
22455
22719
|
? this.axisCategoryArea.height + this.scenariosArea.height
|
|
22456
22720
|
: this.scenariosArea.height;
|
|
22457
|
-
return Math.max(analyticalHeight, bboxHeight);
|
|
22721
|
+
return Math.max(analyticalHeight, bboxHeight) + this.switchNamesHeight();
|
|
22722
|
+
}
|
|
22723
|
+
/** Room for the scenario names under the category labels of a series that changes its scenario. */
|
|
22724
|
+
switchNamesHeight() {
|
|
22725
|
+
return !this.hideAxisLabels && this.switchRuns().length > 1 ? this.position.dataLabelHeight : 0;
|
|
22726
|
+
}
|
|
22727
|
+
/** True for a scenario slot that has a value in this period. */
|
|
22728
|
+
static hasValue(dataPoint) {
|
|
22729
|
+
return dataPoint != null && !dataPoint.isEmpty() && dataPoint.value != null && !Number.isNaN(dataPoint.value);
|
|
22730
|
+
}
|
|
22731
|
+
/**
|
|
22732
|
+
* The slots that continue the first scenario: they have values, and only in
|
|
22733
|
+
* periods where the first scenario has none. Empty without `scenarioSwitch`.
|
|
22734
|
+
*/
|
|
22735
|
+
followerSlots() {
|
|
22736
|
+
if (!this.scenarioSwitch || this.stackConfig != null || this.determineEffectiveChartMode() !== withStyled.ChartMode.BAR) {
|
|
22737
|
+
return [];
|
|
22738
|
+
}
|
|
22739
|
+
return ["scenario2", "scenario3", "scenario4"].filter((slot) => {
|
|
22740
|
+
let values = 0;
|
|
22741
|
+
for (const row of this.dataModel) {
|
|
22742
|
+
if (TimeChart.hasValue(row[slot])) {
|
|
22743
|
+
if (TimeChart.hasValue(row.scenario1)) {
|
|
22744
|
+
return false;
|
|
22745
|
+
}
|
|
22746
|
+
values++;
|
|
22747
|
+
}
|
|
22748
|
+
}
|
|
22749
|
+
return values > 0;
|
|
22750
|
+
});
|
|
22751
|
+
}
|
|
22752
|
+
/** The slot drawn as the column of a period: the first scenario, else the first follower with a value. */
|
|
22753
|
+
visibleSlot(row, followers) {
|
|
22754
|
+
var _a;
|
|
22755
|
+
if (TimeChart.hasValue(row.scenario1)) {
|
|
22756
|
+
return "scenario1";
|
|
22757
|
+
}
|
|
22758
|
+
return (_a = followers.find((slot) => TimeChart.hasValue(row[slot]))) !== null && _a !== void 0 ? _a : null;
|
|
22759
|
+
}
|
|
22760
|
+
/** Runs of periods with the same visible scenario. A period without a value belongs to the run before it. */
|
|
22761
|
+
switchRuns() {
|
|
22762
|
+
const followers = this.followerSlots();
|
|
22763
|
+
if (followers.length === 0) {
|
|
22764
|
+
return [];
|
|
22765
|
+
}
|
|
22766
|
+
const runs = [];
|
|
22767
|
+
this.dataModel.forEach((row, index) => {
|
|
22768
|
+
const slot = this.visibleSlot(row, followers);
|
|
22769
|
+
const scenario = slot ? row[slot].scenario : null;
|
|
22770
|
+
const last = runs[runs.length - 1];
|
|
22771
|
+
if (scenario == null || (last === null || last === void 0 ? void 0 : last.scenario) === scenario) {
|
|
22772
|
+
if (last)
|
|
22773
|
+
last.to = index;
|
|
22774
|
+
return;
|
|
22775
|
+
}
|
|
22776
|
+
runs.push({ scenario, from: index, to: index });
|
|
22777
|
+
});
|
|
22778
|
+
return runs;
|
|
22779
|
+
}
|
|
22780
|
+
/** Number of periods where variances of one row overlap. The component warns about it. */
|
|
22781
|
+
getVarianceOverlaps() {
|
|
22782
|
+
return this.varianceOverlaps;
|
|
22783
|
+
}
|
|
22784
|
+
/**
|
|
22785
|
+
* Lifts the 145 % cut of relative variances when the uncut pins fit into
|
|
22786
|
+
* `availableHeight`. Only for a fixed percentage scale: the author chose it,
|
|
22787
|
+
* so a long pin is cut for lack of room only.
|
|
22788
|
+
*/
|
|
22789
|
+
fitRelativeVariances(availableHeight) {
|
|
22790
|
+
const points = this.variancesDataModel
|
|
22791
|
+
.filter((entry) => entry.type === VarianceType.RELATIVE)
|
|
22792
|
+
.map((entry) => entry.scenario1);
|
|
22793
|
+
if (points.length === 0 || !points.some((point) => point.isClipped())) {
|
|
22794
|
+
return;
|
|
22795
|
+
}
|
|
22796
|
+
const setClamp = (clamp) => {
|
|
22797
|
+
points.forEach((point) => (point.percentClamp = clamp));
|
|
22798
|
+
this.updatePosition(this.lastScenarios);
|
|
22799
|
+
};
|
|
22800
|
+
setClamp(Number.POSITIVE_INFINITY);
|
|
22801
|
+
this.layout();
|
|
22802
|
+
// an unknown height on either side keeps the cut
|
|
22803
|
+
if (!(availableHeight > 0) || !(this.getAllocatedCanvasHeight() <= availableHeight)) {
|
|
22804
|
+
setClamp(DataPoint.PERCENT_CLAMP);
|
|
22805
|
+
}
|
|
22458
22806
|
}
|
|
22459
22807
|
/**
|
|
22460
22808
|
* Total column extent (data units) proportional to pixelPerUnit, covering
|
|
@@ -22957,6 +23305,11 @@ class TimeChart {
|
|
|
22957
23305
|
if (dataModel != null && dataModel.length > 0) {
|
|
22958
23306
|
firstRow = dataModel[0];
|
|
22959
23307
|
}
|
|
23308
|
+
this.varianceOverlaps = 0;
|
|
23309
|
+
const parsed = variancesConfig.map((variance) => new VarianceScenario(variance));
|
|
23310
|
+
if (this.scenarioSwitch && parsed.filter((variance) => variance.isValid).length > 1) {
|
|
23311
|
+
return this.populateSharedVarianceRow(variancesConfig, parsed, dataModel, firstRow);
|
|
23312
|
+
}
|
|
22960
23313
|
for (const varianceScenario in variancesConfig) {
|
|
22961
23314
|
const scenarios = new VarianceScenario(variancesConfig[varianceScenario]);
|
|
22962
23315
|
if (scenarios.isValid) {
|
|
@@ -22986,6 +23339,47 @@ class TimeChart {
|
|
|
22986
23339
|
}
|
|
22987
23340
|
return varianceModel;
|
|
22988
23341
|
}
|
|
23342
|
+
/**
|
|
23343
|
+
* One row for several variances over the same reference: each period shows
|
|
23344
|
+
* the first variance that has a value there, in the notation of its scenario.
|
|
23345
|
+
*/
|
|
23346
|
+
populateSharedVarianceRow(variancesConfig, parsed, dataModel, firstRow) {
|
|
23347
|
+
const varianceModel = [];
|
|
23348
|
+
const valid = parsed.map((variance, index) => ({ variance, name: variancesConfig[index] }));
|
|
23349
|
+
const candidates = valid.filter((entry) => entry.variance.isValid);
|
|
23350
|
+
const isRelative = candidates[0].variance.type === "dr";
|
|
23351
|
+
const pixelPerUnit = isRelative ? this.pixelPerPercentage : this.pixelPerUnit;
|
|
23352
|
+
dataModel.forEach((row, index) => {
|
|
23353
|
+
let point = null;
|
|
23354
|
+
let values = 0;
|
|
23355
|
+
for (const { variance, name } of candidates) {
|
|
23356
|
+
const value = this.calculateVariance(variance, row, this.mapScenarios(variance, firstRow));
|
|
23357
|
+
if (value === null || Number.isNaN(value)) {
|
|
23358
|
+
continue;
|
|
23359
|
+
}
|
|
23360
|
+
values++;
|
|
23361
|
+
if (point == null) {
|
|
23362
|
+
point = new DataPoint(value, variance.delta, pixelPerUnit, variance.direction);
|
|
23363
|
+
point.notation = variance.base.slice(0, 2);
|
|
23364
|
+
point.key = { date: TimeChart.pointDate(row.date), scenario: name };
|
|
23365
|
+
}
|
|
23366
|
+
}
|
|
23367
|
+
if (values > 1) {
|
|
23368
|
+
this.varianceOverlaps++;
|
|
23369
|
+
}
|
|
23370
|
+
varianceModel.push({
|
|
23371
|
+
id: index,
|
|
23372
|
+
category: row.category,
|
|
23373
|
+
type: isRelative ? VarianceType.RELATIVE : VarianceType.ABSOLUTE,
|
|
23374
|
+
date: row.date,
|
|
23375
|
+
scenario1: point !== null && point !== void 0 ? point : new DataPoint(null, candidates[0].variance.delta, pixelPerUnit, candidates[0].variance.direction),
|
|
23376
|
+
scenario2: new DataPoint(null, null, null, null),
|
|
23377
|
+
scenario3: new DataPoint(null, null, null, null),
|
|
23378
|
+
scenario4: new DataPoint(null, null, null, null),
|
|
23379
|
+
});
|
|
23380
|
+
});
|
|
23381
|
+
return varianceModel;
|
|
23382
|
+
}
|
|
22989
23383
|
calculateVariance(scenarios, element, scenarioMap) {
|
|
22990
23384
|
const scenarioBase = scenarioMap.get(scenarios.base);
|
|
22991
23385
|
const scenarioDelta = scenarioMap.get(scenarios.delta);
|
|
@@ -23028,6 +23422,11 @@ class TimeChart {
|
|
|
23028
23422
|
createDateFactory() {
|
|
23029
23423
|
const factory = new withStyled.DateStringFactory();
|
|
23030
23424
|
factory.setLocale(this.locale);
|
|
23425
|
+
// a Luxon pattern from the translations, for example ’yy
|
|
23426
|
+
const shortYear = this.i18n.get("date-format-short-year");
|
|
23427
|
+
if (typeof shortYear === "string" && /y/.test(shortYear) && !shortYear.includes("date-format")) {
|
|
23428
|
+
factory.patchDateFormatShort({ year: shortYear });
|
|
23429
|
+
}
|
|
23031
23430
|
return factory;
|
|
23032
23431
|
}
|
|
23033
23432
|
/**
|
|
@@ -23072,6 +23471,12 @@ class TimeChart {
|
|
|
23072
23471
|
if (elements["type"] === VarianceType.RELATIVE) {
|
|
23073
23472
|
isRelative = true;
|
|
23074
23473
|
}
|
|
23474
|
+
// in smart mode a period that starts a year or month carries that part alone, so it is never skipped
|
|
23475
|
+
const carriesBoundary = this.axisLabelsMode === withStyled.AxisLabelsMode.SMART &&
|
|
23476
|
+
dateStringFactory.isSmartBoundary(elements.date, this.dateInterval);
|
|
23477
|
+
if (index % this.axisLabelsStep !== 0 && !carriesBoundary) {
|
|
23478
|
+
return;
|
|
23479
|
+
}
|
|
23075
23480
|
let datelabel = dateStringFactory.getDateString(elements.date, this.dateInterval);
|
|
23076
23481
|
if (this.axisLabelsMode === withStyled.AxisLabelsMode.SMART) {
|
|
23077
23482
|
datelabel = dateStringFactory.getSmartDateString(elements.date, this.dateInterval);
|
|
@@ -23095,6 +23500,7 @@ class TimeChart {
|
|
|
23095
23500
|
scenarioType: this.axisScenario,
|
|
23096
23501
|
labelText: this.title,
|
|
23097
23502
|
isRelative: isRelative,
|
|
23503
|
+
titlePosition: this.axisTitlePosition,
|
|
23098
23504
|
}, this.position, axisLabelGroup).draw();
|
|
23099
23505
|
// svg.js's width()/height() getters each default to their own bbox() call,
|
|
23100
23506
|
// so reading both measures the group twice. Measure once.
|
|
@@ -23103,17 +23509,65 @@ class TimeChart {
|
|
|
23103
23509
|
height: axisBox.height,
|
|
23104
23510
|
width: axisBox.width,
|
|
23105
23511
|
};
|
|
23512
|
+
this.drawScenarioSwitch(svgContainer);
|
|
23513
|
+
}
|
|
23514
|
+
/**
|
|
23515
|
+
* A vertical line where the visible scenario of the series changes, and the
|
|
23516
|
+
* scenario names under the category labels. Drawn after the axis is
|
|
23517
|
+
* measured, so it does not change the allocated size by itself.
|
|
23518
|
+
*/
|
|
23519
|
+
drawScenarioSwitch(svgContainer) {
|
|
23520
|
+
const runs = this.switchRuns();
|
|
23521
|
+
if (runs.length < 2) {
|
|
23522
|
+
return;
|
|
23523
|
+
}
|
|
23524
|
+
const group = svgContainer.group().id("ScenarioSwitch");
|
|
23525
|
+
const namesHeight = this.switchNamesHeight();
|
|
23526
|
+
const height = this.getAllocatedCanvasHeight();
|
|
23527
|
+
const bottom = namesHeight > 0 ? height - this.styles.padding.bottom : height;
|
|
23528
|
+
const lineWidth = Math.max(1, this.position.spacings.auxiliaryLineWidth);
|
|
23529
|
+
runs.slice(1).forEach((run) => {
|
|
23530
|
+
const x = (this.position.getColumnCenterPositionX(run.from - 1) + this.position.getColumnCenterPositionX(run.from)) / 2;
|
|
23531
|
+
group
|
|
23532
|
+
.line(x, 0, x, bottom)
|
|
23533
|
+
.stroke({ color: this.styles.fontStyles.color || "#000000", width: lineWidth })
|
|
23534
|
+
.addClass("scenario-switch");
|
|
23535
|
+
});
|
|
23536
|
+
if (namesHeight === 0) {
|
|
23537
|
+
return;
|
|
23538
|
+
}
|
|
23539
|
+
runs.forEach((run) => {
|
|
23540
|
+
const center = (this.position.getColumnCenterPositionX(run.from) + this.position.getColumnCenterPositionX(run.to)) / 2;
|
|
23541
|
+
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();
|
|
23542
|
+
});
|
|
23106
23543
|
}
|
|
23107
23544
|
drawScenarios(dataModel, svgContainer) {
|
|
23108
23545
|
const columnGroup = svgContainer.group().id("Scenarios");
|
|
23109
23546
|
const scenarioFactory = new ScenarioFactory(this.position, columnGroup, this.scenarioStyles(), dataModel.length, this.i18n);
|
|
23110
23547
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
23111
23548
|
let hasValidPrim = false;
|
|
23549
|
+
const followers = this.followerSlots();
|
|
23112
23550
|
dataModel.forEach((elements, index) => {
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23551
|
+
// a follower takes the place of the first scenario: full column with value label, named under the axis
|
|
23552
|
+
const visible = followers.length > 0 ? this.visibleSlot(elements, followers) : "scenario1";
|
|
23553
|
+
if (visible != null && visible !== "scenario1") {
|
|
23554
|
+
scenarioFactory
|
|
23555
|
+
.createPrimaryBar(elements[visible], index, false)
|
|
23556
|
+
.draw(this.dataFormatDigits, this.measureScale);
|
|
23557
|
+
hasValidPrim = true;
|
|
23558
|
+
}
|
|
23559
|
+
else {
|
|
23560
|
+
scenarioFactory.createPrimaryBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
23561
|
+
}
|
|
23562
|
+
if (visible !== "scenario2") {
|
|
23563
|
+
scenarioFactory.createSecondaryBar(elements["scenario2"], index).draw();
|
|
23564
|
+
}
|
|
23565
|
+
if (visible !== "scenario3") {
|
|
23566
|
+
scenarioFactory.createPrimaryMarker(elements["scenario3"], index).draw();
|
|
23567
|
+
}
|
|
23568
|
+
if (visible !== "scenario4") {
|
|
23569
|
+
scenarioFactory.createSecondaryMarker(elements["scenario4"], index).draw();
|
|
23570
|
+
}
|
|
23117
23571
|
if (elements["scenario1"].isEmpty() === false) {
|
|
23118
23572
|
hasValidPrim = true;
|
|
23119
23573
|
}
|
|
@@ -23295,9 +23749,9 @@ class TimeChart {
|
|
|
23295
23749
|
.stroke({
|
|
23296
23750
|
color: "#999999",
|
|
23297
23751
|
width: 1,
|
|
23298
|
-
dasharray:
|
|
23752
|
+
dasharray: index$1.DASH_ARRAY,
|
|
23299
23753
|
})
|
|
23300
|
-
.attr("stroke-dasharray",
|
|
23754
|
+
.attr("stroke-dasharray", index$1.DASH_ARRAY);
|
|
23301
23755
|
}
|
|
23302
23756
|
drawVarianceScenario(dataModel, svgContainer) {
|
|
23303
23757
|
const columnGroup = svgContainer.group().id("Scenarios");
|
|
@@ -23305,7 +23759,7 @@ class TimeChart {
|
|
|
23305
23759
|
scenarioFactory.setOverflowConfig(this.overflowConfig);
|
|
23306
23760
|
dataModel.forEach((elements, index) => {
|
|
23307
23761
|
if (elements["type"] === VarianceType.RELATIVE) {
|
|
23308
|
-
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw();
|
|
23762
|
+
scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits);
|
|
23309
23763
|
}
|
|
23310
23764
|
else {
|
|
23311
23765
|
scenarioFactory.createVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
|
|
@@ -23745,6 +24199,12 @@ class TimeChartComponentConfig {
|
|
|
23745
24199
|
this.stackConfig = null;
|
|
23746
24200
|
/** When true, line charts extend to the full width of the chart area. */
|
|
23747
24201
|
this.lineFullWidth = true;
|
|
24202
|
+
/** Print every n-th category label only. */
|
|
24203
|
+
this.axisLabelsStep = 1;
|
|
24204
|
+
/** One series that changes its scenario along the time axis, see `bn-chart-time`. */
|
|
24205
|
+
this.scenarioSwitch = false;
|
|
24206
|
+
/** Side of the axis title: left, right or none. */
|
|
24207
|
+
this.axisTitlePosition = "left";
|
|
23748
24208
|
/** Locale used for date-axis labels and SQL date normalization; set from the bn-context locale. */
|
|
23749
24209
|
this.locale = "de";
|
|
23750
24210
|
}
|
|
@@ -23827,6 +24287,15 @@ class TimeChartComponentConfigAdapter {
|
|
|
23827
24287
|
if (withStyled.CompareUtil.isBoolean(data.lineFullWidth)) {
|
|
23828
24288
|
config.lineFullWidth = data.lineFullWidth;
|
|
23829
24289
|
}
|
|
24290
|
+
if (withStyled.CompareUtil.isNumber(data.axisLabelsStep) && data.axisLabelsStep >= 1) {
|
|
24291
|
+
config.axisLabelsStep = data.axisLabelsStep;
|
|
24292
|
+
}
|
|
24293
|
+
if (withStyled.CompareUtil.isBoolean(data.scenarioSwitch)) {
|
|
24294
|
+
config.scenarioSwitch = data.scenarioSwitch;
|
|
24295
|
+
}
|
|
24296
|
+
if (withStyled.CompareUtil.isString(data.axisTitlePosition)) {
|
|
24297
|
+
config.axisTitlePosition = data.axisTitlePosition;
|
|
24298
|
+
}
|
|
23830
24299
|
if (withStyled.CompareUtil.isString(data.locale)) {
|
|
23831
24300
|
config.locale = data.locale;
|
|
23832
24301
|
}
|
|
@@ -23840,6 +24309,13 @@ class TimeChartComponentConfigAdapter {
|
|
|
23840
24309
|
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}`;
|
|
23841
24310
|
|
|
23842
24311
|
const BnChartTimeRenderer = class {
|
|
24312
|
+
disconnectedCallback() {
|
|
24313
|
+
var _a;
|
|
24314
|
+
if (this.overlapErrId) {
|
|
24315
|
+
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.remove(this.overlapErrId);
|
|
24316
|
+
this.overlapErrId = undefined;
|
|
24317
|
+
}
|
|
24318
|
+
}
|
|
23843
24319
|
constructor(hostRef) {
|
|
23844
24320
|
index.registerInstance(this, hostRef);
|
|
23845
24321
|
/**
|
|
@@ -23897,6 +24373,12 @@ const BnChartTimeRenderer = class {
|
|
|
23897
24373
|
/** @internal */
|
|
23898
24374
|
this.dataFormatDigits = { percent: 2, decimal: 1 };
|
|
23899
24375
|
/** @internal */
|
|
24376
|
+
this.axisLabelsStep = 1;
|
|
24377
|
+
/** @internal */
|
|
24378
|
+
this.scenarioSwitch = false;
|
|
24379
|
+
/** @internal */
|
|
24380
|
+
this.axisTitlePosition = "left";
|
|
24381
|
+
/** @internal */
|
|
23900
24382
|
this.parentDimensions = { width: 0, height: 0 };
|
|
23901
24383
|
withHasError.withComponentStatus(this);
|
|
23902
24384
|
}
|
|
@@ -23918,12 +24400,29 @@ const BnChartTimeRenderer = class {
|
|
|
23918
24400
|
}
|
|
23919
24401
|
/** Reports a failed query as the wrapper's `ERR_sql` item. Without it the chart would only show "No Data". */
|
|
23920
24402
|
syncQueryError() {
|
|
23921
|
-
var _a, _b;
|
|
24403
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
23922
24404
|
this.queryError = (_a = this.measureScaleError) !== null && _a !== void 0 ? _a : (_b = this.chart) === null || _b === void 0 ? void 0 : _b.getQueryError();
|
|
23923
24405
|
queryError.reportQueryError(this.errors, this.queryError);
|
|
24406
|
+
const errId = `WARN_variances_overlap_${this.variances.join("_")}`;
|
|
24407
|
+
const overlaps = (_d = (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getVarianceOverlaps()) !== null && _d !== void 0 ? _d : 0;
|
|
24408
|
+
// the row can get other variances: the warning of the old list has to go
|
|
24409
|
+
if (this.overlapErrId && this.overlapErrId !== errId) {
|
|
24410
|
+
(_e = this.errors) === null || _e === void 0 ? void 0 : _e.remove(this.overlapErrId);
|
|
24411
|
+
}
|
|
24412
|
+
this.overlapErrId = overlaps > 0 ? errId : undefined;
|
|
24413
|
+
if (overlaps > 0) {
|
|
24414
|
+
(_f = this.errors) === null || _f === void 0 ? void 0 : _f.addOrReplace({
|
|
24415
|
+
id: errId,
|
|
24416
|
+
type: "warning",
|
|
24417
|
+
message: `scenarioSwitch: the variances ${this.variances.join(", ")} share a row, but ${overlaps} period(s) have more than one value. The first variance wins there.`,
|
|
24418
|
+
});
|
|
24419
|
+
}
|
|
24420
|
+
else {
|
|
24421
|
+
(_g = this.errors) === null || _g === void 0 ? void 0 : _g.remove(errId);
|
|
24422
|
+
}
|
|
23924
24423
|
}
|
|
23925
24424
|
async componentWillLoad() {
|
|
23926
|
-
var _a;
|
|
24425
|
+
var _a, _b;
|
|
23927
24426
|
const config = this.prepareConfig();
|
|
23928
24427
|
const styles = this.prepareStyle();
|
|
23929
24428
|
const availableWidth = this.containerWidth || 0;
|
|
@@ -23935,14 +24434,18 @@ const BnChartTimeRenderer = class {
|
|
|
23935
24434
|
// fitted chart fits by construction, and the overdrive's rough overhead
|
|
23936
24435
|
// estimate would falsely re-engage on it.
|
|
23937
24436
|
const unitWasAuto = config.pixelPerUnit <= 0;
|
|
24437
|
+
const percentWasAuto = config.pixelPerPercentage <= 0;
|
|
23938
24438
|
this.autoFitScaling(config, styles);
|
|
23939
24439
|
this.chart.setAvailableHeight(unitWasAuto ? 0 : ((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
24440
|
+
if (!percentWasAuto) {
|
|
24441
|
+
this.chart.fitRelativeVariances(((_b = this.parentDimensions) === null || _b === void 0 ? void 0 : _b.height) || 0);
|
|
24442
|
+
}
|
|
23940
24443
|
this.pattern = new CustomPattern(this.chart.styles);
|
|
23941
24444
|
this.chart.setPattern("hatched", this.pattern.getFCPolygonPattern());
|
|
23942
24445
|
this.syncQueryError();
|
|
23943
24446
|
}
|
|
23944
24447
|
async componentWillUpdate() {
|
|
23945
|
-
var _a;
|
|
24448
|
+
var _a, _b;
|
|
23946
24449
|
if (this.chart == null) {
|
|
23947
24450
|
return;
|
|
23948
24451
|
}
|
|
@@ -23955,8 +24458,12 @@ const BnChartTimeRenderer = class {
|
|
|
23955
24458
|
this.chart.setConfig(config);
|
|
23956
24459
|
// See componentWillLoad: no broken-bar overdrive for auto-fitted scaling
|
|
23957
24460
|
const unitWasAuto = config.pixelPerUnit <= 0;
|
|
24461
|
+
const percentWasAuto = config.pixelPerPercentage <= 0;
|
|
23958
24462
|
this.autoFitScaling(config, styles);
|
|
23959
24463
|
this.chart.setAvailableHeight(unitWasAuto ? 0 : ((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
|
|
24464
|
+
if (!percentWasAuto) {
|
|
24465
|
+
this.chart.fitRelativeVariances(((_b = this.parentDimensions) === null || _b === void 0 ? void 0 : _b.height) || 0);
|
|
24466
|
+
}
|
|
23960
24467
|
this.pattern = new CustomPattern(this.chart.styles);
|
|
23961
24468
|
this.chart.setPattern("hatched", this.pattern.getFCPolygonPattern());
|
|
23962
24469
|
this.syncQueryError();
|
|
@@ -24142,6 +24649,9 @@ const BnChartTimeRenderer = class {
|
|
|
24142
24649
|
maxBars: this.maxBars,
|
|
24143
24650
|
stackConfig: this.stackConfig,
|
|
24144
24651
|
lineFullWidth: this.lineFullWidth,
|
|
24652
|
+
axisLabelsStep: this.axisLabelsStep,
|
|
24653
|
+
scenarioSwitch: this.scenarioSwitch,
|
|
24654
|
+
axisTitlePosition: this.axisTitlePosition,
|
|
24145
24655
|
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",
|
|
24146
24656
|
});
|
|
24147
24657
|
}
|
|
@@ -24272,6 +24782,8 @@ function pageRule(format, orientation, renderOrientation) {
|
|
|
24272
24782
|
|
|
24273
24783
|
const bnContextCss = () => `:host{display:block}`;
|
|
24274
24784
|
|
|
24785
|
+
/** The elements that write what `getNotation()` reads. */
|
|
24786
|
+
const NOTATION_SOURCE_SELECTOR = "bn-component-style, bn-scaling-group";
|
|
24275
24787
|
/** Attributes that change the paper size, the orientation or the number of a page. */
|
|
24276
24788
|
const PAGE_ATTRIBUTES = [
|
|
24277
24789
|
"format",
|
|
@@ -24302,8 +24814,10 @@ const VISUAL_SELECTOR = "bn-annotation-layer, bn-annotation-list, bn-body, bn-ca
|
|
|
24302
24814
|
const Context = class {
|
|
24303
24815
|
constructor(hostRef) {
|
|
24304
24816
|
index.registerInstance(this, hostRef);
|
|
24817
|
+
this.bnNotationChange = index.createEvent(this, "bnNotationChange", 7);
|
|
24305
24818
|
/** The page numbers this context wrote. A number that is not in here was set by the author and is left alone. */
|
|
24306
24819
|
this.assignedPageNumbers = new WeakMap();
|
|
24820
|
+
this.notationSubscriptions = [];
|
|
24307
24821
|
withHasError.withComponentStatus(this);
|
|
24308
24822
|
this.errors = withHasError.withHasError(this);
|
|
24309
24823
|
}
|
|
@@ -24318,6 +24832,12 @@ const Context = class {
|
|
|
24318
24832
|
if (this.locale) {
|
|
24319
24833
|
this.stores.context.state.locale = this.locale;
|
|
24320
24834
|
}
|
|
24835
|
+
// a removed scaling group is a "set" too: its entry is set to undefined
|
|
24836
|
+
const notify = () => this.bnNotationChange.emit();
|
|
24837
|
+
this.notationSubscriptions = [
|
|
24838
|
+
this.stores.scalingGroups.on("set", notify),
|
|
24839
|
+
this.stores.componentStyles.on("set", notify),
|
|
24840
|
+
];
|
|
24321
24841
|
this.syncPages();
|
|
24322
24842
|
// pages that come, go or change their format later
|
|
24323
24843
|
this.pageObserver = new MutationObserver(() => this.syncPages());
|
|
@@ -24330,6 +24850,8 @@ const Context = class {
|
|
|
24330
24850
|
}
|
|
24331
24851
|
disconnectedCallback() {
|
|
24332
24852
|
var _a, _b;
|
|
24853
|
+
this.notationSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
24854
|
+
this.notationSubscriptions = [];
|
|
24333
24855
|
(_a = this.pageObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
24334
24856
|
(_b = this.pageSizeStyle) === null || _b === void 0 ? void 0 : _b.remove();
|
|
24335
24857
|
this.pageSizeStyle = undefined;
|
|
@@ -24421,7 +24943,7 @@ const Context = class {
|
|
|
24421
24943
|
catch (_a) {
|
|
24422
24944
|
const zero = { x: 0, y: 0, width: 0, height: 0 };
|
|
24423
24945
|
fallback = {
|
|
24424
|
-
version:
|
|
24946
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
24425
24947
|
tag: el.localName,
|
|
24426
24948
|
id: el.localName,
|
|
24427
24949
|
rect: { context: Object.assign({}, zero), component: Object.assign({}, zero) },
|
|
@@ -24440,7 +24962,7 @@ const Context = class {
|
|
|
24440
24962
|
state.id = ids[index];
|
|
24441
24963
|
});
|
|
24442
24964
|
return {
|
|
24443
|
-
version:
|
|
24965
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
24444
24966
|
generatedAt: new Date().toISOString(),
|
|
24445
24967
|
detail,
|
|
24446
24968
|
context: {
|
|
@@ -24450,6 +24972,26 @@ const Context = class {
|
|
|
24450
24972
|
components,
|
|
24451
24973
|
};
|
|
24452
24974
|
}
|
|
24975
|
+
/**
|
|
24976
|
+
* Returns how this context draws: font, the look of the scenarios `ac`,
|
|
24977
|
+
* `pp`, `fc` and `pl`, the variance colours and the scaling groups. A
|
|
24978
|
+
* chart that is not part of this package can use it to draw like the
|
|
24979
|
+
* charts that are.
|
|
24980
|
+
*
|
|
24981
|
+
* The style values are merged like in every component: `_system`, then
|
|
24982
|
+
* `_default`, then the style named `styleName`.
|
|
24983
|
+
*
|
|
24984
|
+
* The promise resolves after every `<bn-component-style>` and
|
|
24985
|
+
* `<bn-scaling-group>` that is inside the context at the time of the call
|
|
24986
|
+
* has loaded. Listen to `bnNotationChange` for later changes.
|
|
24987
|
+
*
|
|
24988
|
+
* @param styleName - name of a `<bn-component-style>`, like the `selected-style` of a chart
|
|
24989
|
+
*/
|
|
24990
|
+
async getNotation(styleName) {
|
|
24991
|
+
const sources = Array.from(this.element.querySelectorAll(NOTATION_SOURCE_SELECTOR));
|
|
24992
|
+
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(); }));
|
|
24993
|
+
return index$1.buildNotation(withStyled.mergeStyleLayers(this.stores.componentStyles.state, styleName), this.stores.scalingGroups.state);
|
|
24994
|
+
}
|
|
24453
24995
|
componentWillLoad() {
|
|
24454
24996
|
// stencil needs one componenet implementing all lifecycle steps to get mixing working
|
|
24455
24997
|
}
|
|
@@ -24460,7 +25002,7 @@ const Context = class {
|
|
|
24460
25002
|
componentWillUpdate() { }
|
|
24461
25003
|
componentDidUpdate() { }
|
|
24462
25004
|
render() {
|
|
24463
|
-
return (index.h(index.Host, { key: '
|
|
25005
|
+
return (index.h(index.Host, { key: 'e2c985d07c329d796c37804f492907f0f49366d2' }, index.h("slot", { key: '90c11954a1a9365bc46ddacb2a3b8f72bbc4e523' })));
|
|
24464
25006
|
}
|
|
24465
25007
|
get element() { return index.getElement(this); }
|
|
24466
25008
|
static get watchers() { return {
|
|
@@ -25979,6 +26521,7 @@ const LayoutCard = class {
|
|
|
25979
26521
|
this.cardShowBorder = true;
|
|
25980
26522
|
withHasError.withComponentStatus(this);
|
|
25981
26523
|
this.errors = withHasError.withHasError(this);
|
|
26524
|
+
this.componentStyle = withStyled.withComponentStyle(this);
|
|
25982
26525
|
this.resolveInherited = withTranslation.withInheritedProps(this, [
|
|
25983
26526
|
{ propName: "titleScenarios", ancestorAttr: "title-scenarios" },
|
|
25984
26527
|
{ propName: "titleVariances", ancestorAttr: "title-variances" },
|
|
@@ -26082,7 +26625,7 @@ const LayoutCard = class {
|
|
|
26082
26625
|
var _a;
|
|
26083
26626
|
const style = this.getLayoutStyle();
|
|
26084
26627
|
const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
|
|
26085
|
-
return (index.h("bn-card", { key: '
|
|
26628
|
+
return (index.h("bn-card", { key: '3db479047905de01ac517491f2d68a9bd0a3a576', styles: this.styles, "selected-style": this.selectedStyle, class: this.setCardClass() }, index.h("div", { key: 'fd9948acd84ce55badf87a7e03d733d1e75a1bea', class: "cardtitle" }, index.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 !== "" ? (index.h("img", { class: "image", src: this.prepareTitleImage(this.titleImage) })) : ("")), index.h("bn-body", { key: 'c5b1957822ff216d33084154afdf6deb3e4426cc' }, index.h("div", { key: 'bc17f6f73825894641f775137eaefd5059a25cf6', style: style, "data-bn-fit-content": this.cardFitToContent ? String(this.getRowCount(this.cardLayout)) : null }, this.getSlots(arrOfSlots))), index.h("bn-footer", { key: 'cfbeba76eaf11358e92002d309cafae19d2525e2', text: this.footerText, "page-number": "0", "display-page-number": "false" })));
|
|
26086
26629
|
}
|
|
26087
26630
|
get element() { return index.getElement(this); }
|
|
26088
26631
|
};
|
|
@@ -26318,7 +26861,7 @@ const LayoutPage = class {
|
|
|
26318
26861
|
const style = this.getLayoutStyle();
|
|
26319
26862
|
const arrOfSlots = this.extractSlotNames(style["grid-template-areas"]);
|
|
26320
26863
|
const rotation = this.rotation();
|
|
26321
|
-
return (index.h(index.Host, { key: '
|
|
26864
|
+
return (index.h(index.Host, { key: '2ec4b279578c40e0aa56ec89ede269abb4d2951b', style: rotation === null || rotation === void 0 ? void 0 : rotation.host }, index.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 }, index.h("bn-message", { key: '17e10377a10a257417acc50460cc2a66e1010abd', text: this.messageText, image: this.messageImage }), index.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 }), index.h("bn-body", { key: '8ef72077b8656469db320af429a1226453866558' }, index.h("div", { key: '99b22034f2c6edbe7e25e1a3cb6873f2af287178', style: style, "data-bn-fit-content": this.pageFitToContent ? String(this.getRowCount(this.pageLayout)) : null }, this.getSlots(arrOfSlots)), index.h("slot", { key: '918b8f2c8991d801a0033748f37250500cf2d2e9', name: "annotations" })), index.h("bn-footer", { key: 'a77e27405f7fbc68c90a95c563628ddc2d708e02', text: this.footerText, "page-number": this.pageNumber, "display-page-number": this.footerDisplayPageNumber }))));
|
|
26322
26865
|
}
|
|
26323
26866
|
get element() { return index.getElement(this); }
|
|
26324
26867
|
};
|
|
@@ -28057,7 +28600,7 @@ const Table$1 = class Table {
|
|
|
28057
28600
|
const effectiveFactor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
28058
28601
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; }) * effectiveFactor;
|
|
28059
28602
|
const state = {
|
|
28060
|
-
version:
|
|
28603
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
28061
28604
|
tag: this.element.localName,
|
|
28062
28605
|
id: localFrame.resolveStandaloneId(this.element),
|
|
28063
28606
|
slot: (_b = this.element.getAttribute("slot")) !== null && _b !== void 0 ? _b : undefined,
|
|
@@ -32791,7 +33334,7 @@ const Title$1 = class Title {
|
|
|
32791
33334
|
var _a, _b, _c, _d;
|
|
32792
33335
|
return ({
|
|
32793
33336
|
"--bn-font-family": ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
32794
|
-
"--bn-font-size": `${((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
|
|
33337
|
+
"--bn-font-size": `${this.titleFontSize > 0 ? this.titleFontSize : ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontSizePx"]) || 13.3333}px`,
|
|
32795
33338
|
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
32796
33339
|
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
32797
33340
|
});
|
|
@@ -32799,7 +33342,7 @@ const Title$1 = class Title {
|
|
|
32799
33342
|
}
|
|
32800
33343
|
render() {
|
|
32801
33344
|
const fontStyles = this.getFontStyles();
|
|
32802
|
-
return (index.h(index.Host, { key: '
|
|
33345
|
+
return (index.h(index.Host, { key: '2f19926cf90c8e8738c335088f6d814be7221f05', style: fontStyles }, index.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 })));
|
|
32803
33346
|
}
|
|
32804
33347
|
get element() { return index.getElement(this); }
|
|
32805
33348
|
static get watchers() { return {
|
|
@@ -33121,7 +33664,7 @@ class TimePeriodAdapter {
|
|
|
33121
33664
|
}
|
|
33122
33665
|
}
|
|
33123
33666
|
|
|
33124
|
-
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}`;
|
|
33667
|
+
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}`;
|
|
33125
33668
|
|
|
33126
33669
|
const BnTitleRenderer = class {
|
|
33127
33670
|
constructor(hostRef) {
|
|
@@ -33152,7 +33695,7 @@ const BnTitleRenderer = class {
|
|
|
33152
33695
|
withHasError.withComponentStatus(this);
|
|
33153
33696
|
}
|
|
33154
33697
|
render() {
|
|
33155
|
-
return (index.h("div", { key: '
|
|
33698
|
+
return (index.h("div", { key: 'd32015c18f77cc23ace9a26d8bb0820acdce543a', class: this.titleId ? "with-id" : undefined }, this.titleId ? index.h("div", { class: "title-id" }, this.titleId) : null, index.h("div", { key: 'c3151be4218ff1720402865ffa4b972c974fea67', innerHTML: withTranslation.sanitizeHtml(this.title.unit) }), index.h("div", { key: '0a03e44bd5ec8d0177801bce8d1cf938a24daabb' }, this.title.measures.map((measure, index$1) => (index.h("span", null, this.isFirstElement(index$1) ? this.title.i18n.get("SEPARATOR_WS") : "", index.h("span", { class: "measure" }, measure.name), " ", measure.unit ? this.title.i18n.get("in") : "", " ", measure.unit)))), index.h("div", { key: 'ab32e07b35e1cc02ec26137ce392946c8f94ac73' }, this.title.dimension)));
|
|
33156
33699
|
}
|
|
33157
33700
|
componentWillLoad() {
|
|
33158
33701
|
const config = this.prepareConfig();
|
|
@@ -34010,7 +34553,7 @@ const ChartTree = class {
|
|
|
34010
34553
|
const origins = localFrame.originsFor(this.element);
|
|
34011
34554
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
34012
34555
|
const state = {
|
|
34013
|
-
version:
|
|
34556
|
+
version: types.LAYOUT_STATE_VERSION,
|
|
34014
34557
|
tag: this.element.localName,
|
|
34015
34558
|
id: localFrame.resolveStandaloneId(this.element),
|
|
34016
34559
|
slot: (_b = this.element.getAttribute("slot")) !== null && _b !== void 0 ? _b : undefined,
|