@bino-bi/bn-template-engine 1.0.0-alpha.2 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-1265d8d3.entry.js +1 -0
- package/dist/bn-template-engine/p-15516dac.entry.js +1 -0
- package/dist/bn-template-engine/p-1c716641.entry.js +1 -0
- package/dist/bn-template-engine/p-27cc8dc0.entry.js +1 -0
- package/dist/bn-template-engine/p-4426d484.entry.js +1 -0
- package/dist/bn-template-engine/p-51f8dc9e.entry.js +1 -0
- package/dist/bn-template-engine/p-53d4e690.entry.js +1 -0
- package/dist/bn-template-engine/p-5KQYRQLK.js +1 -0
- package/dist/bn-template-engine/p-745f4596.entry.js +1 -0
- package/dist/bn-template-engine/{p-0f1504f3.entry.js → p-75e97c87.entry.js} +1 -1
- package/dist/bn-template-engine/p-7a560278.entry.js +1 -0
- package/dist/bn-template-engine/p-7ea7c325.entry.js +1 -0
- package/dist/bn-template-engine/p-945cc95d.entry.js +1 -0
- package/dist/bn-template-engine/p-BYBpC0EO.js +1 -0
- package/dist/bn-template-engine/p-BfXY5dsy.js +1 -0
- package/dist/bn-template-engine/p-BgnHJQ9Q.js +1 -0
- package/dist/bn-template-engine/{p-DgfL-ffj.js → p-Bhd_WSML.js} +1 -1
- package/dist/bn-template-engine/p-Bka-Z6jo.js +1 -0
- package/dist/bn-template-engine/p-Bnhh02CF.js +1 -0
- package/dist/bn-template-engine/p-C7dQL8CS.js +1 -0
- package/dist/bn-template-engine/p-CL1RYuNU.js +1 -0
- package/dist/bn-template-engine/p-CYwd_ZNM.js +1 -0
- package/dist/bn-template-engine/p-ChlK-T9I.js +1 -0
- package/dist/bn-template-engine/p-DHezf8pZ.js +1 -0
- package/dist/bn-template-engine/{p-DVMu6dEy.js → p-DlppAFq9.js} +1 -1
- package/dist/bn-template-engine/p-DvDDgmcV.js +1 -0
- package/dist/bn-template-engine/p-DvvwfRQG.js +1 -0
- package/dist/bn-template-engine/{p-DG-1MR_T.js → p-P7pGJBgc.js} +1 -1
- package/dist/bn-template-engine/p-b34eaf86.entry.js +1 -0
- package/dist/bn-template-engine/p-bdb8b44c.entry.js +1 -0
- package/dist/bn-template-engine/p-c44fcb8e.entry.js +1 -0
- package/dist/bn-template-engine/p-c7e1a49b.entry.js +1 -0
- package/dist/bn-template-engine/p-d9003041.entry.js +1 -0
- package/dist/bn-template-engine/p-daa7ffa3.entry.js +1 -0
- package/dist/bn-template-engine/p-e084f50a.entry.js +1 -0
- package/dist/bn-template-engine/p-eaba6658.entry.js +1 -0
- package/dist/bn-template-engine/{p-CvXqez4D.js → p-u8igQLRZ.js} +1 -1
- package/dist/cjs/{DataFormatDigits-CbIVfGEH.js → DataFormatDigits-DKcOeLNK.js} +1 -1
- package/dist/cjs/{DateStringFactory-CfkXYAMN.js → DateStringFactory-CSKvbS8K.js} +1 -1
- package/dist/cjs/{Order-DtpbD8mQ.js → Order-iG11HI4R.js} +36 -5
- package/dist/cjs/{SVGVariancesStyleGroup-D-rTWlDo.js → SVGVariancesStyleGroup-K-Tw6lOD.js} +1 -14
- package/dist/cjs/bn-asset.cjs.entry.js +5 -4
- package/dist/cjs/bn-body_4.cjs.entry.js +15 -13
- package/dist/cjs/bn-card.cjs.entry.js +5 -4
- package/dist/cjs/{ibcs-chart-structure.cjs.entry.js → bn-chart-structure_5.cjs.entry.js} +1058 -28
- package/dist/cjs/bn-chart-time.cjs.entry.js +38 -12
- package/dist/cjs/bn-component-style.cjs.entry.js +5 -4
- package/dist/cjs/bn-dataset.cjs.entry.js +38 -9
- package/dist/cjs/bn-grid.cjs.entry.js +9 -7
- package/dist/cjs/bn-image.cjs.entry.js +9 -7
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -4
- package/dist/cjs/bn-layout-card.cjs.entry.js +3 -2
- package/dist/cjs/bn-layout-page.cjs.entry.js +2 -1
- package/dist/cjs/bn-message.cjs.entry.js +5 -4
- package/dist/cjs/bn-table.cjs.entry.js +979 -0
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +3 -2
- package/dist/cjs/bn-text.cjs.entry.js +11 -9
- package/dist/cjs/bn-tree.cjs.entry.js +9 -7
- package/dist/cjs/contentDecoder-JxOldq1e.js +419 -0
- package/dist/cjs/{context-protocol-CRPmux5D.js → context-protocol-DRQWrwsA.js} +2 -0
- package/dist/cjs/editor-companion.cjs.entry.js +1 -1
- package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +57 -0
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +22 -18
- package/dist/cjs/{bn-context_5.cjs.entry.js → ibcs-table.cjs.entry.js} +159 -1259
- package/dist/cjs/{StringAdapter-ByCHdlDO.js → ibcsRuleSet-DgUoXOfd.js} +10 -10
- package/dist/cjs/index-Dm85hG6t.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-D8sIIKft.js → scaling-9Tz595RQ.js} +7 -7
- package/dist/cjs/{withHasError-B8gHkfV2.js → utils-CwHIVbbL.js} +1 -69
- package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-CKpSD8UT.js} +3 -3
- package/dist/cjs/{withComponentStatus-_x4LQZ0N.js → withComponentStatus-Bw70BhO0.js} +5 -5
- package/dist/cjs/{withComponentStyle-DMtic_9Y.js → withComponentStyle-aIbTCtfj.js} +5 -5
- package/dist/cjs/withHasError-D7ue5vAv.js +72 -0
- package/dist/cjs/{withStyled-BBtMesx3.js → withStyled-CS1Yp4sv.js} +12 -61
- package/dist/cjs/{withTranslation-CWPAIRjh.js → withTranslation-rwgyITqe.js} +5 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +226 -99
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +13 -3
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +94 -11
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +3 -4
- package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +4 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +28 -4
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +3 -3
- package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -4
- package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +4 -0
- package/dist/collection/components/bn-dataset/bn-dataset.js +49 -2
- package/dist/collection/components/bn-datasource/bn-datasource.js +46 -3
- package/dist/collection/components/bn-table/bn-table.js +60 -12
- package/dist/collection/components/bn-table/ibcs-table.css +7 -5
- package/dist/collection/components/bn-table/ibcs-table.js +22 -1
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +79 -31
- package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -1
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +12 -3
- package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +9 -1
- package/dist/collection/stores/componentStyles.js +2 -0
- package/dist/collection/utils/constants.js +35 -5
- package/dist/collection/utils/contentDecoder.js +28 -0
- package/dist/collection/utils/stackColors.js +2 -2
- package/dist/collection/utils/validate.js +5 -2
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/Order.js +1 -1
- package/dist/components/SVGVariancesStyleGroup.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/contentDecoder.js +1 -0
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/emotion-hash.esm.js +1 -0
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/ibcsRuleSet.js +1 -1
- package/dist/components/validate.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/esm/{DataFormatDigits-DYdbRX-1.js → DataFormatDigits-oSZ1hBKE.js} +1 -1
- package/dist/esm/{DateStringFactory-DRcbojUT.js → DateStringFactory-CSGz6TDk.js} +1 -1
- package/dist/esm/{Order-DdexOqTs.js → Order-Bnhh02CF.js} +36 -6
- package/dist/esm/{SVGVariancesStyleGroup-D0Cwprv1.js → SVGVariancesStyleGroup-CqTjrZYg.js} +2 -13
- package/dist/esm/bn-asset.entry.js +5 -4
- package/dist/esm/bn-body_4.entry.js +11 -9
- package/dist/esm/bn-card.entry.js +5 -4
- package/dist/esm/{ibcs-chart-structure.entry.js → bn-chart-structure_5.entry.js} +1048 -22
- package/dist/esm/bn-chart-time.entry.js +38 -12
- package/dist/esm/bn-component-style.entry.js +5 -4
- package/dist/esm/bn-dataset.entry.js +35 -6
- package/dist/esm/bn-grid.entry.js +9 -7
- package/dist/esm/bn-image.entry.js +9 -7
- package/dist/esm/bn-internationalization.entry.js +5 -4
- package/dist/esm/bn-layout-card.entry.js +3 -2
- package/dist/esm/bn-layout-page.entry.js +2 -1
- package/dist/esm/bn-message.entry.js +5 -4
- package/dist/esm/bn-table.entry.js +977 -0
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +3 -2
- package/dist/esm/bn-text.entry.js +11 -9
- package/dist/esm/bn-tree.entry.js +9 -7
- package/dist/esm/contentDecoder-oMmxz6nJ.js +416 -0
- package/dist/esm/{context-protocol-Bz5klD-F.js → context-protocol-BHnQsVsr.js} +2 -0
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/emotion-hash.esm-BYBpC0EO.js +55 -0
- package/dist/esm/ibcs-chart-time.entry.js +15 -11
- package/dist/esm/{bn-context_5.entry.js → ibcs-table.entry.js} +106 -1202
- package/dist/esm/{StringAdapter-CTL-Dvzp.js → ibcsRuleSet-K4ytuA1f.js} +10 -10
- package/dist/esm/index-DHezf8pZ.js +65 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-C6K8FYSF.js → scaling-Cehc74IE.js} +2 -2
- package/dist/esm/{withHasError-B3QX2emi.js → utils-DvvwfRQG.js} +1 -69
- package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-FQ8NwCIz.js} +1 -1
- package/dist/esm/{withComponentStatus-DodoSXe-.js → withComponentStatus-DWjDYtZ7.js} +1 -1
- package/dist/esm/{withComponentStyle-BerJY64r.js → withComponentStyle-9uP_hcDq.js} +2 -2
- package/dist/esm/withHasError-FyY5mQ_3.js +70 -0
- package/dist/esm/{withStyled-DCipbf2O.js → withStyled--qQWquTH.js} +9 -59
- package/dist/esm/{withTranslation-mimbJdER.js → withTranslation-BqD0Kp7b.js} +2 -2
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +155 -109
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +7 -0
- package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +1 -0
- package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +1 -0
- package/dist/types/components/bn-dataset/bn-dataset.d.ts +6 -0
- package/dist/types/components/bn-datasource/bn-datasource.d.ts +8 -0
- package/dist/types/components/bn-table/bn-table.d.ts +12 -8
- package/dist/types/components/bn-table/ibcs-table.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/Cell.d.ts +1 -0
- package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +1 -0
- package/dist/types/components.d.ts +118 -34
- package/dist/types/stores/componentStyles.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +23 -5
- package/dist/types/utils/contentDecoder.d.ts +12 -0
- package/dist/types/utils/validate.d.ts +1 -0
- package/package.json +2 -1
- package/dist/bn-template-engine/p--PSoPbDM.js +0 -1
- package/dist/bn-template-engine/p-05a82a77.entry.js +0 -1
- package/dist/bn-template-engine/p-0ca8dc17.entry.js +0 -1
- package/dist/bn-template-engine/p-1d9a3be9.entry.js +0 -1
- package/dist/bn-template-engine/p-35638ad0.entry.js +0 -1
- package/dist/bn-template-engine/p-37881d05.entry.js +0 -1
- package/dist/bn-template-engine/p-3b894997.entry.js +0 -1
- package/dist/bn-template-engine/p-50e49732.entry.js +0 -1
- package/dist/bn-template-engine/p-60a7fc59.entry.js +0 -1
- package/dist/bn-template-engine/p-6c7c0455.entry.js +0 -1
- package/dist/bn-template-engine/p-6da93eae.entry.js +0 -1
- package/dist/bn-template-engine/p-701e1578.entry.js +0 -1
- package/dist/bn-template-engine/p-BSfqOkN_.js +0 -1
- package/dist/bn-template-engine/p-CRLgp9-v.js +0 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
- package/dist/bn-template-engine/p-DRikHQE-.js +0 -1
- package/dist/bn-template-engine/p-DVo6aZUE.js +0 -1
- package/dist/bn-template-engine/p-DdexOqTs.js +0 -1
- package/dist/bn-template-engine/p-DyRaC0MB.js +0 -1
- package/dist/bn-template-engine/p-a95ccc16.entry.js +0 -1
- package/dist/bn-template-engine/p-b7bec050.entry.js +0 -1
- package/dist/bn-template-engine/p-bc59ea5c.entry.js +0 -1
- package/dist/bn-template-engine/p-d279b578.entry.js +0 -1
- package/dist/bn-template-engine/p-dd9dd407.entry.js +0 -1
- package/dist/bn-template-engine/p-e102a490.entry.js +0 -1
- package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
- package/dist/bn-template-engine/p-f89e55c6.entry.js +0 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
- package/dist/cjs/bn-chart-structure.cjs.entry.js +0 -700
- package/dist/esm/bn-chart-structure.entry.js +0 -698
|
@@ -1,698 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-JNHhIe7t.js';
|
|
2
|
-
import { v as validateScenarioList, a as validateVariancesList, i as isValidNumber, b as isValidLevel, c as validateOrderList, d as isValidDirection, e as isValidInteger, f as isValidBoolean, g as isValidMeasureScale, h as validateStackConfig, w as withStyled, j as isBlankInput } from './withStyled-DCipbf2O.js';
|
|
3
|
-
import { w as withDataset, g as getParentDimensions, p as parseScaling } from './scaling-C6K8FYSF.js';
|
|
4
|
-
import { w as withComponentStatus } from './withComponentStatus-DodoSXe-.js';
|
|
5
|
-
import { w as withTranslation } from './withTranslation-mimbJdER.js';
|
|
6
|
-
import { a as globalLabelKeys } from './context-protocol-Bz5klD-F.js';
|
|
7
|
-
import { w as withComponentStyle } from './withComponentStyle-BerJY64r.js';
|
|
8
|
-
import { w as withHasError } from './withHasError-B3QX2emi.js';
|
|
9
|
-
import { A as AggregationLevel, O as OrderDirection, a as OrderColumn, S as StackOrder, b as StackMode } from './Order-DdexOqTs.js';
|
|
10
|
-
import './DateStringFactory-DRcbojUT.js';
|
|
11
|
-
|
|
12
|
-
const bnChartStructureCss = () => `:host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.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-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}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}`;
|
|
13
|
-
|
|
14
|
-
const Chart = class {
|
|
15
|
-
validateScenario(newValue) {
|
|
16
|
-
const invalidScenarios = validateScenarioList(newValue);
|
|
17
|
-
const errId = "ERR_scenarios";
|
|
18
|
-
if (invalidScenarios.length > 0) {
|
|
19
|
-
this.errors.addOrReplace({
|
|
20
|
-
id: errId,
|
|
21
|
-
type: "warning",
|
|
22
|
-
message: "scenarios: invalid value(s) '" + JSON.stringify(invalidScenarios) + "' are not supported.",
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
this.errors.remove(errId);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
validateVariances(newValue) {
|
|
30
|
-
const errIdVar = "ERR_variances";
|
|
31
|
-
const invalidVariances = validateVariancesList(newValue);
|
|
32
|
-
if (invalidVariances.length > 0) {
|
|
33
|
-
this.errors.addOrReplace({
|
|
34
|
-
id: errIdVar,
|
|
35
|
-
type: "warning",
|
|
36
|
-
message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
this.errors.remove(errIdVar);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
validateUnitScaling(newValue) {
|
|
44
|
-
const errId = "ERR_unitScaling";
|
|
45
|
-
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
46
|
-
this.errors.addOrReplace({
|
|
47
|
-
id: errId,
|
|
48
|
-
type: "warning",
|
|
49
|
-
message: "unitScaling: invalid value(s) '" + newValue + "' are not supported.",
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.errors.remove(errId);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
validatePercentageScaling(newValue) {
|
|
57
|
-
const errId = "ERR_percentageScaling";
|
|
58
|
-
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
59
|
-
this.errors.addOrReplace({
|
|
60
|
-
id: errId,
|
|
61
|
-
type: "warning",
|
|
62
|
-
message: "percentageScaling: invalid value(s) '" + newValue + "' are not supported.",
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this.errors.remove(errId);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
validateLevel(newValue) {
|
|
70
|
-
const errId = "ERR_level";
|
|
71
|
-
if (!isValidLevel(newValue)) {
|
|
72
|
-
this.errors.addOrReplace({
|
|
73
|
-
id: errId,
|
|
74
|
-
type: "warning",
|
|
75
|
-
message: "level: invalid value(s) '" + newValue + "' are not supported.",
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.errors.remove(errId);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
validateOrderList(newValue) {
|
|
83
|
-
const invalidElements = validateOrderList(newValue);
|
|
84
|
-
const errId = "ERR_order";
|
|
85
|
-
if (invalidElements.length > 0) {
|
|
86
|
-
this.errors.addOrReplace({
|
|
87
|
-
id: errId,
|
|
88
|
-
type: "warning",
|
|
89
|
-
message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.errors.remove(errId);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
validateOrderDirection(newValue) {
|
|
97
|
-
const errId = "ERR_orderDirection";
|
|
98
|
-
if (!isValidDirection(newValue)) {
|
|
99
|
-
this.errors.addOrReplace({
|
|
100
|
-
id: errId,
|
|
101
|
-
type: "warning",
|
|
102
|
-
message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
this.errors.remove(errId);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
validateLimit(newValue) {
|
|
110
|
-
const errId = "ERR_limit";
|
|
111
|
-
if (!isValidInteger(newValue)) {
|
|
112
|
-
this.errors.addOrReplace({
|
|
113
|
-
id: errId,
|
|
114
|
-
type: "warning",
|
|
115
|
-
message: "limit: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
this.errors.remove(errId);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
validateShowCategories(newValue) {
|
|
123
|
-
const errId = "ERR_showCategories";
|
|
124
|
-
if (!isValidBoolean(newValue)) {
|
|
125
|
-
this.errors.addOrReplace({
|
|
126
|
-
id: errId,
|
|
127
|
-
type: "warning",
|
|
128
|
-
message: "showCategories: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
this.errors.remove(errId);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
validateMeasureScale(newValue) {
|
|
136
|
-
const errId = "ERR_measureScale";
|
|
137
|
-
if (!isValidMeasureScale(newValue)) {
|
|
138
|
-
this.errors.addOrReplace({
|
|
139
|
-
id: errId,
|
|
140
|
-
type: "warning",
|
|
141
|
-
message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
this.errors.remove(errId);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
validateShowMeasureScale(newValue) {
|
|
149
|
-
const errId = "ERR_grouped";
|
|
150
|
-
if (!isValidBoolean(newValue)) {
|
|
151
|
-
this.errors.addOrReplace({
|
|
152
|
-
id: errId,
|
|
153
|
-
type: "warning",
|
|
154
|
-
message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
this.errors.remove(errId);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
validateStack(newValue) {
|
|
162
|
-
const errId = "ERR_stack";
|
|
163
|
-
const errors = validateStackConfig(newValue);
|
|
164
|
-
if (errors.length > 0) {
|
|
165
|
-
this.errors.addOrReplace({
|
|
166
|
-
id: errId,
|
|
167
|
-
type: "warning",
|
|
168
|
-
message: errors.join("; "),
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
this.errors.remove(errId);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
validateScaling(newValue) {
|
|
176
|
-
if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
|
|
177
|
-
this.errors.remove("ERR_scale");
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const num = Number(newValue);
|
|
181
|
-
if (isNaN(num) || num <= 0) {
|
|
182
|
-
this.errors.addOrReplace({
|
|
183
|
-
id: "ERR_scale",
|
|
184
|
-
type: "warning",
|
|
185
|
-
message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
this.errors.remove("ERR_scale");
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
constructor(hostRef) {
|
|
193
|
-
registerInstance(this, hostRef);
|
|
194
|
-
this.data = [];
|
|
195
|
-
this.datasetMeta = null;
|
|
196
|
-
this.appliedScaleFactor = 1;
|
|
197
|
-
/**
|
|
198
|
-
* Custom chart title
|
|
199
|
-
*/
|
|
200
|
-
this.chartTitle = "";
|
|
201
|
-
/**
|
|
202
|
-
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
203
|
-
* rows before rendering (e.g. `"rowGroup = 'Revenue'"`).
|
|
204
|
-
*/
|
|
205
|
-
this.filter = "";
|
|
206
|
-
/** set translaton mode.
|
|
207
|
-
* <br /><br />
|
|
208
|
-
* values:<br />
|
|
209
|
-
* ``` all // none // meta ```
|
|
210
|
-
*/
|
|
211
|
-
/**
|
|
212
|
-
* Set the maximum number of bars for each
|
|
213
|
-
* group. The value 0 means *no limit*
|
|
214
|
-
* <br /><br />
|
|
215
|
-
* rows wich where cut by the limit are cumulated as REST
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
this.limit = 0;
|
|
219
|
-
this.showCategories = "true";
|
|
220
|
-
/**
|
|
221
|
-
* Sets the SiPrefix of the Mesaurements and converts the
|
|
222
|
-
* original value.
|
|
223
|
-
* <br /><br />
|
|
224
|
-
* values: <br />
|
|
225
|
-
* ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
|
|
226
|
-
* <br /><br />
|
|
227
|
-
* SiPrefix overview:
|
|
228
|
-
* ``` "Y": 1E+24,```<br />
|
|
229
|
-
* ``` "Z": 1E+21,```<br />
|
|
230
|
-
* ``` "E": 1E+18,```<br />
|
|
231
|
-
* ``` "P": 1E+15,```<br />
|
|
232
|
-
* ``` "T": 1E+12,```<br />
|
|
233
|
-
* ``` "G": 1000000000,```<br />
|
|
234
|
-
* ``` "M": 1000000,```<br />
|
|
235
|
-
* ``` "k": 1000,```<br />
|
|
236
|
-
* <br />
|
|
237
|
-
* ``` "m": 0.001,```<br />
|
|
238
|
-
* ``` "μ": 0.000001,```<br />
|
|
239
|
-
* ``` "n": 0.000000001,```<br />
|
|
240
|
-
* ``` "p": 0.000000000001,```<br />
|
|
241
|
-
* ``` "f": 0.000000000000001,```<br />
|
|
242
|
-
* ``` "a": 0.000000000000000001,```<br />
|
|
243
|
-
* ``` "z": 0.000000000000000000001,```<br />
|
|
244
|
-
* ``` "y": 0.000000000000000000000001,```<br />
|
|
245
|
-
* <br /><br />
|
|
246
|
-
* Special modes:
|
|
247
|
-
* ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
248
|
-
* ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
249
|
-
*<br /><br />
|
|
250
|
-
* ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*/
|
|
254
|
-
this.measureScale = "greatest";
|
|
255
|
-
/**
|
|
256
|
-
* Toggles display of measure units in table header
|
|
257
|
-
* <br /><br />
|
|
258
|
-
* values: <br />
|
|
259
|
-
* ```true // false```
|
|
260
|
-
*/
|
|
261
|
-
this.showMeasureScale = "false";
|
|
262
|
-
/**
|
|
263
|
-
* measureUnit displayed in table.
|
|
264
|
-
*/
|
|
265
|
-
this.measureUnit = "";
|
|
266
|
-
/**
|
|
267
|
-
* Stacking configuration for the chart as a JSON string.
|
|
268
|
-
*
|
|
269
|
-
* When set, bars are drawn stacked (additive layers) instead of side-by-side.
|
|
270
|
-
*
|
|
271
|
-
* @default '' (empty — no stacking)
|
|
272
|
-
* @example stack='{"by":"scenario"}'
|
|
273
|
-
*/
|
|
274
|
-
this.stack = "";
|
|
275
|
-
this.scenariosArray = [""];
|
|
276
|
-
this.pixelPerUnitGroupMap = new Map();
|
|
277
|
-
this._autoScaleGuard = false;
|
|
278
|
-
withStyled(this);
|
|
279
|
-
withComponentStatus(this);
|
|
280
|
-
withDataset(this, (_name, data) => {
|
|
281
|
-
this.data = (data || []);
|
|
282
|
-
}, (_name, meta) => {
|
|
283
|
-
this.datasetMeta = meta;
|
|
284
|
-
});
|
|
285
|
-
this.chartTemplate = this.chartTemplate.bind(this);
|
|
286
|
-
this.errors = withHasError(this);
|
|
287
|
-
this.componentStyle = withComponentStyle(this);
|
|
288
|
-
this.t = withTranslation(this).t;
|
|
289
|
-
}
|
|
290
|
-
componentWillLoad() {
|
|
291
|
-
this.validateScenario(this.scenarios);
|
|
292
|
-
this.validateVariances(this.variances);
|
|
293
|
-
this.validateUnitScaling(this.unitScaling);
|
|
294
|
-
//this.validateSelectedStyle(this.selectedStyle);
|
|
295
|
-
this.validateLevel(this.level);
|
|
296
|
-
this.validateOrderDirection(this.orderDirection);
|
|
297
|
-
this.validateOrderList(this.order);
|
|
298
|
-
this.validateShowCategories(this.showCategories);
|
|
299
|
-
this.validateMeasureScale(this.measureScale);
|
|
300
|
-
this.validateShowMeasureScale(this.showMeasureScale);
|
|
301
|
-
this.validateStack(this.stack);
|
|
302
|
-
this.validateScaling(this.scale);
|
|
303
|
-
}
|
|
304
|
-
componentDidRender() {
|
|
305
|
-
var _a, _b;
|
|
306
|
-
const { mode } = parseScaling(this.scale);
|
|
307
|
-
if (mode !== "auto" && mode !== "empty") {
|
|
308
|
-
this._autoScaleGuard = false;
|
|
309
|
-
// Keep existing width-based overflow warning for non-auto modes
|
|
310
|
-
const parent = getParentDimensions(this.element);
|
|
311
|
-
const errId = "WARN_overflow";
|
|
312
|
-
if (parent.width > 0 && this.element.scrollWidth > parent.width + 1) {
|
|
313
|
-
this.errors.addOrReplace({
|
|
314
|
-
id: errId,
|
|
315
|
-
type: "warning",
|
|
316
|
-
message: "Chart exceeds available space and will be cut off. Check unit-scaling value.",
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
this.errors.remove(errId);
|
|
321
|
-
}
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (this._autoScaleGuard) {
|
|
325
|
-
this._autoScaleGuard = false;
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
const host = this.element;
|
|
329
|
-
const { height: parentHeight } = getParentDimensions(host);
|
|
330
|
-
if (parentHeight <= 0)
|
|
331
|
-
return;
|
|
332
|
-
// Measure at base (unscaled) font size to get true content height
|
|
333
|
-
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
334
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
|
|
335
|
-
// Reading scrollHeight forces a synchronous reflow at base size
|
|
336
|
-
const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".container");
|
|
337
|
-
const unscaledHeight = (_b = div === null || div === void 0 ? void 0 : div.scrollHeight) !== null && _b !== void 0 ? _b : host.scrollHeight;
|
|
338
|
-
if (unscaledHeight <= parentHeight + 1) {
|
|
339
|
-
this.errors.remove("AUTO_scale");
|
|
340
|
-
if (this.appliedScaleFactor !== 1) {
|
|
341
|
-
this._autoScaleGuard = true;
|
|
342
|
-
this.appliedScaleFactor = 1;
|
|
343
|
-
}
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
const computedFactor = (parentHeight - 1) / unscaledHeight;
|
|
347
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
348
|
-
if (mode === "empty") {
|
|
349
|
-
this.errors.addOrReplace({
|
|
350
|
-
id: "AUTO_scale",
|
|
351
|
-
type: "warning",
|
|
352
|
-
message: `Auto-scaled chart by factor ${computedFactor.toFixed(3)}`,
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
else {
|
|
356
|
-
this.errors.remove("AUTO_scale");
|
|
357
|
-
}
|
|
358
|
-
if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
|
|
359
|
-
this._autoScaleGuard = true;
|
|
360
|
-
this.appliedScaleFactor = computedFactor;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
prepareDimension() {
|
|
364
|
-
const parent = getParentDimensions(this.element);
|
|
365
|
-
this.canvasWidthSegmented = parent.width / this.scenariosArray.length;
|
|
366
|
-
return { width: this.canvasWidthSegmented, height: parent.height };
|
|
367
|
-
}
|
|
368
|
-
prepareScenarios() {
|
|
369
|
-
var _a, _b, _c, _d;
|
|
370
|
-
const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
371
|
-
if (isBlankInput(this.scenarios) || isAuto) {
|
|
372
|
-
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
373
|
-
if (!isAuto) {
|
|
374
|
-
this.errors.addOrReplace({
|
|
375
|
-
id: "AUTO_scenarios",
|
|
376
|
-
type: "warning",
|
|
377
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
this.errors.remove("AUTO_scenarios");
|
|
382
|
-
}
|
|
383
|
-
return this.datasetMeta.availableScenarios;
|
|
384
|
-
}
|
|
385
|
-
return [];
|
|
386
|
-
}
|
|
387
|
-
this.errors.remove("AUTO_scenarios");
|
|
388
|
-
return (_d = this.scenarios) === null || _d === void 0 ? void 0 : _d.split(",").map((entry) => entry.trim());
|
|
389
|
-
}
|
|
390
|
-
prepareVariances() {
|
|
391
|
-
var _a;
|
|
392
|
-
if (isBlankInput(this.variances)) {
|
|
393
|
-
return [];
|
|
394
|
-
}
|
|
395
|
-
return (_a = this.variances) === null || _a === void 0 ? void 0 : _a.split(",").map((entry) => entry.trim());
|
|
396
|
-
}
|
|
397
|
-
prepareHideCategories(idx) {
|
|
398
|
-
return idx >= 1 || this.showCategories !== "true";
|
|
399
|
-
}
|
|
400
|
-
prepareI18n() {
|
|
401
|
-
const i18nMetaLabelsLocal = [];
|
|
402
|
-
const i18nMetaLabelsGlobal = globalLabelKeys;
|
|
403
|
-
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
404
|
-
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
405
|
-
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
406
|
-
}
|
|
407
|
-
preparePixelPerUnit() {
|
|
408
|
-
var _a;
|
|
409
|
-
if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
|
|
410
|
-
this.errors.remove("AUTO_unitScaling");
|
|
411
|
-
return this.pixelPerUnitGroupMap.get(this.unitScaling);
|
|
412
|
-
}
|
|
413
|
-
// Explicit 'auto' → auto-calculate silently
|
|
414
|
-
if (((_a = this.unitScaling) === null || _a === void 0 ? void 0 : _a.toString().trim().toLowerCase()) === "auto") {
|
|
415
|
-
this.errors.remove("AUTO_unitScaling");
|
|
416
|
-
return 0;
|
|
417
|
-
}
|
|
418
|
-
const numeric = Number(this.unitScaling);
|
|
419
|
-
if (!isNaN(numeric) && numeric > 0) {
|
|
420
|
-
this.errors.remove("AUTO_unitScaling");
|
|
421
|
-
return numeric;
|
|
422
|
-
}
|
|
423
|
-
// Not set / invalid → auto-calculate with warning
|
|
424
|
-
this.errors.addOrReplace({
|
|
425
|
-
id: "AUTO_unitScaling",
|
|
426
|
-
type: "warning",
|
|
427
|
-
message: `unit-scaling: not set, auto-calculated to fit available space.`,
|
|
428
|
-
});
|
|
429
|
-
return 0;
|
|
430
|
-
}
|
|
431
|
-
preparePixelPerPercentage() {
|
|
432
|
-
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
433
|
-
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
434
|
-
}
|
|
435
|
-
return Number(this.percentageScaling) * 100;
|
|
436
|
-
}
|
|
437
|
-
prepareLevel() {
|
|
438
|
-
var _a, _b, _c;
|
|
439
|
-
const isAuto = ((_a = this.level) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
440
|
-
if (isBlankInput(this.level) || isAuto) {
|
|
441
|
-
if ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedLevel) {
|
|
442
|
-
if (!isAuto) {
|
|
443
|
-
this.errors.addOrReplace({
|
|
444
|
-
id: "AUTO_level",
|
|
445
|
-
type: "warning",
|
|
446
|
-
message: `level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`,
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
this.errors.remove("AUTO_level");
|
|
451
|
-
}
|
|
452
|
-
return AggregationLevel[this.datasetMeta.suggestedLevel.toUpperCase()];
|
|
453
|
-
}
|
|
454
|
-
return undefined;
|
|
455
|
-
}
|
|
456
|
-
this.errors.remove("AUTO_level");
|
|
457
|
-
return AggregationLevel[(_c = this.level) === null || _c === void 0 ? void 0 : _c.toUpperCase()];
|
|
458
|
-
}
|
|
459
|
-
prepareOrder() {
|
|
460
|
-
var _a, _b, _c;
|
|
461
|
-
const isAuto = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
462
|
-
let orderStr;
|
|
463
|
-
if (isBlankInput(this.order) || isAuto) {
|
|
464
|
-
if ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedOrder) {
|
|
465
|
-
if (!isAuto) {
|
|
466
|
-
this.errors.addOrReplace({
|
|
467
|
-
id: "AUTO_order",
|
|
468
|
-
type: "warning",
|
|
469
|
-
message: `order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`,
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
this.errors.remove("AUTO_order");
|
|
474
|
-
}
|
|
475
|
-
orderStr = this.datasetMeta.suggestedOrder;
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
orderStr = this.order;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
this.errors.remove("AUTO_order");
|
|
483
|
-
orderStr = this.order;
|
|
484
|
-
}
|
|
485
|
-
const tableOrder = {
|
|
486
|
-
hierarchy: orderStr === null || orderStr === void 0 ? void 0 : orderStr.split(",").map((entry) => OrderColumn[entry === null || entry === void 0 ? void 0 : entry.toUpperCase()]),
|
|
487
|
-
direction: OrderDirection[(_c = this.orderDirection) === null || _c === void 0 ? void 0 : _c.toUpperCase()],
|
|
488
|
-
};
|
|
489
|
-
return tableOrder;
|
|
490
|
-
}
|
|
491
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
492
|
-
prepareStyle() {
|
|
493
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
494
|
-
return this.componentStyle(($) => {
|
|
495
|
-
const baseFontSize = $["global"]["fontSizePx"];
|
|
496
|
-
const scaledFontSize = baseFontSize * effectiveFactor;
|
|
497
|
-
return {
|
|
498
|
-
scaleFactors: {
|
|
499
|
-
scenarioOffset: $["bn-chart-structure"]["scaleFactors"]["scenarioOffset"],
|
|
500
|
-
scenarioLabelToBar: $["bn-chart-structure"]["scaleFactors"]["scenarioLabelToBar"],
|
|
501
|
-
labelToBar: $["bn-chart-structure"]["scaleFactors"]["labelToBar"],
|
|
502
|
-
labelToAxis: $["bn-chart-structure"]["scaleFactors"]["labelToAxis"],
|
|
503
|
-
needleWidth: $["bn-chart-structure"]["scaleFactors"]["needleWidth"],
|
|
504
|
-
needleHeadWidth: $["bn-chart-structure"]["scaleFactors"]["needleHeadWidth"],
|
|
505
|
-
barWidth: $["bn-chart-structure"]["scaleFactors"]["barWidth"],
|
|
506
|
-
varianceAxisLineWidth: $["bn-chart-structure"]["scaleFactors"]["varianceAxisLineWidth"],
|
|
507
|
-
axisLineWidth: $["bn-chart-structure"]["scaleFactors"]["axisLineWidth"],
|
|
508
|
-
auxiliaryLineWidth: $["bn-chart-structure"]["scaleFactors"]["auxiliaryLineWidth"],
|
|
509
|
-
scenarioLineWidth: $["bn-chart-structure"]["scaleFactors"]["scenarioLineWidth"],
|
|
510
|
-
markerWidth: $["bn-chart-structure"]["scaleFactors"]["markerWidth"],
|
|
511
|
-
markerOffset: $["bn-chart-structure"]["scaleFactors"]["markerOffset"],
|
|
512
|
-
categoryWidth: $["bn-chart-structure"]["scaleFactors"]["categoryWidth"],
|
|
513
|
-
axisTickLength: $["bn-chart-structure"]["scaleFactors"]["axisTickLength"],
|
|
514
|
-
},
|
|
515
|
-
fontStyles: {
|
|
516
|
-
font: `${scaledFontSize}px ${$["global"]["fontFamily"]}`,
|
|
517
|
-
size: scaledFontSize,
|
|
518
|
-
color: $["global"]["fontColor"],
|
|
519
|
-
background: $["global"]["fontBackgroundColor"],
|
|
520
|
-
leading: 1.8,
|
|
521
|
-
},
|
|
522
|
-
axisStyles: $["bn-chart-structure"]["axisStyles"],
|
|
523
|
-
barStyles: $["bn-chart-structure"]["barStyles"],
|
|
524
|
-
varianceStyles: $["bn-chart-structure"]["varianceStyles"],
|
|
525
|
-
padding: $["bn-chart-structure"]["padding"],
|
|
526
|
-
pattern: null,
|
|
527
|
-
};
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
prepareChartTitle(idx) {
|
|
531
|
-
if (idx >= 1) {
|
|
532
|
-
return "";
|
|
533
|
-
}
|
|
534
|
-
return this.chartTitle;
|
|
535
|
-
}
|
|
536
|
-
prepareStackConfig() {
|
|
537
|
-
if (isBlankInput(this.stack)) {
|
|
538
|
-
return null;
|
|
539
|
-
}
|
|
540
|
-
try {
|
|
541
|
-
const parsed = JSON.parse(this.stack);
|
|
542
|
-
return {
|
|
543
|
-
by: parsed.by,
|
|
544
|
-
mode: parsed.mode || StackMode.ABSOLUTE,
|
|
545
|
-
order: parsed.order || StackOrder.DATASET,
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
catch (_a) {
|
|
549
|
-
return null;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
prepareFilter() {
|
|
553
|
-
if (this.filter.length === 0) {
|
|
554
|
-
return "";
|
|
555
|
-
}
|
|
556
|
-
return this.filter;
|
|
557
|
-
}
|
|
558
|
-
prepareLimit() {
|
|
559
|
-
return Math.floor(Number(this.limit) || 0);
|
|
560
|
-
}
|
|
561
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
562
|
-
getDataStructure() {
|
|
563
|
-
const dataSetStructure = {
|
|
564
|
-
IStructureChartDataRow: {
|
|
565
|
-
operation: { type: "string", isOptional: false, description: "" },
|
|
566
|
-
rowGroup: { type: "string", isOptional: false, description: "" },
|
|
567
|
-
rowGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
568
|
-
category: { type: "string", isOptional: false, description: "" },
|
|
569
|
-
categoryIndex: { type: "number", isOptional: false, description: "" },
|
|
570
|
-
subCategory: { type: "string", isOptional: false, description: "" },
|
|
571
|
-
subCategoryIndex: { type: "number", isOptional: false, description: "" },
|
|
572
|
-
columnGroup: { type: "string", isOptional: false, description: "" },
|
|
573
|
-
columnGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
574
|
-
columnSubGroup: { type: "string", isOptional: false, description: "" },
|
|
575
|
-
columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
576
|
-
ac1: { type: "number", isOptional: false, description: "" },
|
|
577
|
-
ac2: { type: "number", isOptional: false, description: "" },
|
|
578
|
-
ac3: { type: "number", isOptional: false, description: "" },
|
|
579
|
-
ac4: { type: "number", isOptional: false, description: "" },
|
|
580
|
-
pp1: { type: "number", isOptional: false, description: "" },
|
|
581
|
-
pp2: { type: "number", isOptional: false, description: "" },
|
|
582
|
-
pp3: { type: "number", isOptional: false, description: "" },
|
|
583
|
-
pp4: { type: "number", isOptional: false, description: "" },
|
|
584
|
-
fc1: { type: "number", isOptional: false, description: "" },
|
|
585
|
-
fc2: { type: "number", isOptional: false, description: "" },
|
|
586
|
-
fc3: { type: "number", isOptional: false, description: "" },
|
|
587
|
-
fc4: { type: "number", isOptional: false, description: "" },
|
|
588
|
-
pl1: { type: "number", isOptional: false, description: "" },
|
|
589
|
-
pl2: { type: "number", isOptional: false, description: "" },
|
|
590
|
-
pl3: { type: "number", isOptional: false, description: "" },
|
|
591
|
-
pl4: { type: "number", isOptional: false, description: "" },
|
|
592
|
-
},
|
|
593
|
-
};
|
|
594
|
-
return dataSetStructure;
|
|
595
|
-
}
|
|
596
|
-
prepareMeasureScale() {
|
|
597
|
-
if (isBlankInput(this.measureScale)) {
|
|
598
|
-
return "GREATEST";
|
|
599
|
-
}
|
|
600
|
-
if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
|
|
601
|
-
return this.measureScale.trim();
|
|
602
|
-
}
|
|
603
|
-
if (this.measureScale.trim().toUpperCase() === "LEAST") {
|
|
604
|
-
return this.measureScale.trim();
|
|
605
|
-
}
|
|
606
|
-
return "GREATEST";
|
|
607
|
-
}
|
|
608
|
-
prepareShowMeasureScale(idx) {
|
|
609
|
-
return idx === 0 && this.showMeasureScale === "true";
|
|
610
|
-
}
|
|
611
|
-
prepareMeasureUnit() {
|
|
612
|
-
if (this.measureUnit === "" || this.measureUnit == null) {
|
|
613
|
-
return "";
|
|
614
|
-
}
|
|
615
|
-
return this.measureUnit;
|
|
616
|
-
}
|
|
617
|
-
chartTemplate(localScenarioString, idx) {
|
|
618
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
619
|
-
const ppu = this.preparePixelPerUnit();
|
|
620
|
-
const ppp = this.preparePixelPerPercentage();
|
|
621
|
-
return (h("ibcs-chart-structure", { data: this.data, chartTitle: this.prepareChartTitle(idx), scenarios: this.prepareScenarios(), variances: [localScenarioString], hideCategories: this.prepareHideCategories(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, 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: this.prepareStackConfig(), parentDimensions: this.prepareDimension() }));
|
|
622
|
-
}
|
|
623
|
-
getEffectiveScaleFactor() {
|
|
624
|
-
const { mode, factor } = parseScaling(this.scale);
|
|
625
|
-
if (mode === "factor")
|
|
626
|
-
return factor;
|
|
627
|
-
if (mode === "auto" || mode === "empty")
|
|
628
|
-
return this.appliedScaleFactor;
|
|
629
|
-
return 1;
|
|
630
|
-
}
|
|
631
|
-
getFontStyles() {
|
|
632
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
633
|
-
return this.componentStyle(($) => {
|
|
634
|
-
var _a, _b, _c, _d;
|
|
635
|
-
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
636
|
-
return {
|
|
637
|
-
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
638
|
-
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
639
|
-
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
640
|
-
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
641
|
-
};
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
render() {
|
|
645
|
-
let scenariosArray = [""];
|
|
646
|
-
const variancesArray = this.prepareVariances();
|
|
647
|
-
if (variancesArray.length > 0) {
|
|
648
|
-
scenariosArray = [...scenariosArray, ...variancesArray];
|
|
649
|
-
}
|
|
650
|
-
const fontStyles = this.getFontStyles();
|
|
651
|
-
return (h(Host, { key: 'c8ad939fbe92ab4a01af1e5ce17e097dbb5eab56', style: fontStyles }, h("div", { key: 'd786c49dd808c2dd9093ede7100e16ac52f50689', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
652
|
-
}
|
|
653
|
-
get element() { return getElement(this); }
|
|
654
|
-
static get watchers() { return {
|
|
655
|
-
"scenarios": [{
|
|
656
|
-
"validateScenario": 0
|
|
657
|
-
}],
|
|
658
|
-
"variances": [{
|
|
659
|
-
"validateVariances": 0
|
|
660
|
-
}],
|
|
661
|
-
"unitScaling": [{
|
|
662
|
-
"validateUnitScaling": 0
|
|
663
|
-
}],
|
|
664
|
-
"percentageScaling": [{
|
|
665
|
-
"validatePercentageScaling": 0
|
|
666
|
-
}],
|
|
667
|
-
"level": [{
|
|
668
|
-
"validateLevel": 0
|
|
669
|
-
}],
|
|
670
|
-
"order": [{
|
|
671
|
-
"validateOrderList": 0
|
|
672
|
-
}],
|
|
673
|
-
"orderDirection": [{
|
|
674
|
-
"validateOrderDirection": 0
|
|
675
|
-
}],
|
|
676
|
-
"limit": [{
|
|
677
|
-
"validateLimit": 0
|
|
678
|
-
}],
|
|
679
|
-
"showCategories": [{
|
|
680
|
-
"validateShowCategories": 0
|
|
681
|
-
}],
|
|
682
|
-
"measureScale": [{
|
|
683
|
-
"validateMeasureScale": 0
|
|
684
|
-
}],
|
|
685
|
-
"showMeasureScale": [{
|
|
686
|
-
"validateShowMeasureScale": 0
|
|
687
|
-
}],
|
|
688
|
-
"stack": [{
|
|
689
|
-
"validateStack": 0
|
|
690
|
-
}],
|
|
691
|
-
"scale": [{
|
|
692
|
-
"validateScaling": 0
|
|
693
|
-
}]
|
|
694
|
-
}; }
|
|
695
|
-
};
|
|
696
|
-
Chart.style = bnChartStructureCss();
|
|
697
|
-
|
|
698
|
-
export { Chart as bn_chart_structure };
|