@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,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { isBlankInput, isTableCategoryWidth, isValidBoolean, isValidDataFormat, isValidDirection, isValidInteger, isValidMeasureScale, isValidMeasureType, isValidNumber, isValidTableType, validateColumnThereOfJsonStr, validateOrderList, validatePartOfJsonStr, validateScenarioList, validateThereOfJsonStr, validateVariancesList, } from "../../utils/validate";
|
|
2
|
+
import { isBlankInput, isTableBarColumnWidth, isTableCategoryWidth, isValidBoolean, isValidDataFormat, isValidDirection, isValidInteger, isValidMeasureScale, isValidMeasureType, isValidNumber, isValidTableType, validateColumnThereOfJsonStr, validateOrderList, validatePartOfJsonStr, validateScenarioList, validateThereOfJsonStr, validateVariancesList, } from "../../utils/validate";
|
|
3
3
|
import withDataset from "../../utils/withDataset";
|
|
4
4
|
import withComponentStatus from "../../utils/withComponentStatus";
|
|
5
5
|
import { globalLabelKeys } from "../../stores/internationalization";
|
|
@@ -9,7 +9,7 @@ import withComponentStyle from "../../utils/withComponentStyle";
|
|
|
9
9
|
import withHasError from "../../utils/withHasError";
|
|
10
10
|
import { getParentDimensions } from "../../utils/parentDimensions";
|
|
11
11
|
import { parseScaling } from "../../utils/scaling";
|
|
12
|
-
import { DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "../../utils/constants";
|
|
12
|
+
import { BAR_COLUMN_WIDTH_EM, DataFormat, I18nMode, MeasureType, TableBarColumnWidth, TableCategoryWidth, } from "../../utils/constants";
|
|
13
13
|
import { TableType } from "./utils/model";
|
|
14
14
|
import { OrderColumn, OrderDirection } from "../../utils/model/Order";
|
|
15
15
|
/**
|
|
@@ -57,14 +57,16 @@ export class Table {
|
|
|
57
57
|
*/
|
|
58
58
|
this.measureUnit = "";
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
60
|
+
* Set width of bar chart columns. Controls the max bar/pin width in pixels.
|
|
61
|
+
* <br /><br />
|
|
62
|
+
* values:<br />
|
|
63
|
+
* ``` w5 // w10 // w15 // w20 // w25 // w30 // w40 // w60 // w80 // w100 ```
|
|
64
|
+
*/
|
|
65
|
+
this.barColumnWidth = "w10";
|
|
66
|
+
/**
|
|
67
|
+
* Pixels per unit for absolute variance bar charts (ΔPY).
|
|
68
|
+
* Controls bar width: barWidth = value × unitScaling.
|
|
69
|
+
* Bars exceeding barColumnWidth are shown with an arrow indicator.
|
|
68
70
|
* <br /><br />
|
|
69
71
|
* Default: 0.01
|
|
70
72
|
*/
|
|
@@ -312,6 +314,19 @@ export class Table {
|
|
|
312
314
|
this.errors.remove(errId);
|
|
313
315
|
}
|
|
314
316
|
}
|
|
317
|
+
validateBarColumnWidth(newValue) {
|
|
318
|
+
const errId = "ERR_barColumnWidth";
|
|
319
|
+
if (!isTableBarColumnWidth(newValue)) {
|
|
320
|
+
this.errors.addOrReplace({
|
|
321
|
+
id: errId,
|
|
322
|
+
type: "warning",
|
|
323
|
+
message: "barColumnWidth: invalid value '" + newValue + "' is not supported.",
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
this.errors.remove(errId);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
315
330
|
validateUnitScaling(newValue) {
|
|
316
331
|
const errId = "ERR_unitScaling";
|
|
317
332
|
if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
@@ -572,6 +587,7 @@ export class Table {
|
|
|
572
587
|
this.validateColumnThereOf(this.columnthereof);
|
|
573
588
|
this.validateShowMeasureScale(this.showMeasureScale);
|
|
574
589
|
this.validateBarColumns(this.barColumns);
|
|
590
|
+
this.validateBarColumnWidth(this.barColumnWidth);
|
|
575
591
|
this.validateUnitScaling(this.unitScaling);
|
|
576
592
|
this.validatePercentageScaling(this.percentageScaling);
|
|
577
593
|
this.validateScaling(this.scale);
|
|
@@ -799,6 +815,15 @@ export class Table {
|
|
|
799
815
|
}
|
|
800
816
|
return this.filter;
|
|
801
817
|
}
|
|
818
|
+
prepareBarColumnWidth() {
|
|
819
|
+
var _a;
|
|
820
|
+
const key = (_a = this.barColumnWidth) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
821
|
+
const preset = TableBarColumnWidth[key];
|
|
822
|
+
if (preset) {
|
|
823
|
+
return BAR_COLUMN_WIDTH_EM[preset];
|
|
824
|
+
}
|
|
825
|
+
return BAR_COLUMN_WIDTH_EM[TableBarColumnWidth.W10];
|
|
826
|
+
}
|
|
802
827
|
prepareBarColumns() {
|
|
803
828
|
if (isBlankInput(this.barColumns)) {
|
|
804
829
|
return [];
|
|
@@ -878,7 +903,7 @@ export class Table {
|
|
|
878
903
|
render() {
|
|
879
904
|
const fontStyles = this.getFontStyles();
|
|
880
905
|
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
881
|
-
return (h(Host, { key: '
|
|
906
|
+
return (h(Host, { key: '788f67af1bbc37c0ffe1467503e0708ec52a7f53', style: fontStyles }, h("div", { key: '3f9bcc8cddc8bbdf88681ca3d0ee35e67aa1a04f' }, h("ibcs-table", { key: '74657d8bca08c78313db7f497c0d7267eee97d00', data: this.data, "table-title": this.prepareTableTitle(), scenarios: this.prepareScenarios(), "scenarios-data-format": this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), type: this.prepareTableType(), "category-width": this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), "i18n-mode": this.prepareI18nMode(), "measure-scale": this.prepareMeasureScale(), "measure-type": this.prepareMeasureType(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), scaleFactor: effectiveFactor }))));
|
|
882
907
|
}
|
|
883
908
|
static get is() { return "bn-table"; }
|
|
884
909
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1033,6 +1058,26 @@ export class Table {
|
|
|
1033
1058
|
"reflect": false,
|
|
1034
1059
|
"attribute": "bar-columns"
|
|
1035
1060
|
},
|
|
1061
|
+
"barColumnWidth": {
|
|
1062
|
+
"type": "string",
|
|
1063
|
+
"mutable": false,
|
|
1064
|
+
"complexType": {
|
|
1065
|
+
"original": "string",
|
|
1066
|
+
"resolved": "string",
|
|
1067
|
+
"references": {}
|
|
1068
|
+
},
|
|
1069
|
+
"required": false,
|
|
1070
|
+
"optional": false,
|
|
1071
|
+
"docs": {
|
|
1072
|
+
"tags": [],
|
|
1073
|
+
"text": "Set width of bar chart columns. Controls the max bar/pin width in pixels.\n<br /><br />\nvalues:<br />\n``` w5 // w10 // w15 // w20 // w25 // w30 // w40 // w60 // w80 // w100 ```"
|
|
1074
|
+
},
|
|
1075
|
+
"getter": false,
|
|
1076
|
+
"setter": false,
|
|
1077
|
+
"reflect": false,
|
|
1078
|
+
"attribute": "bar-column-width",
|
|
1079
|
+
"defaultValue": "\"w10\""
|
|
1080
|
+
},
|
|
1036
1081
|
"unitScaling": {
|
|
1037
1082
|
"type": "any",
|
|
1038
1083
|
"mutable": false,
|
|
@@ -1045,7 +1090,7 @@ export class Table {
|
|
|
1045
1090
|
"optional": false,
|
|
1046
1091
|
"docs": {
|
|
1047
1092
|
"tags": [],
|
|
1048
|
-
"text": "
|
|
1093
|
+
"text": "Pixels per unit for absolute variance bar charts (\u0394PY).\nControls bar width: barWidth = value \u00D7 unitScaling.\nBars exceeding barColumnWidth are shown with an arrow indicator.\n<br /><br />\nDefault: 0.01"
|
|
1049
1094
|
},
|
|
1050
1095
|
"getter": false,
|
|
1051
1096
|
"setter": false,
|
|
@@ -1416,6 +1461,9 @@ export class Table {
|
|
|
1416
1461
|
}, {
|
|
1417
1462
|
"propName": "barColumns",
|
|
1418
1463
|
"methodName": "validateBarColumns"
|
|
1464
|
+
}, {
|
|
1465
|
+
"propName": "barColumnWidth",
|
|
1466
|
+
"methodName": "validateBarColumnWidth"
|
|
1419
1467
|
}, {
|
|
1420
1468
|
"propName": "unitScaling",
|
|
1421
1469
|
"methodName": "validateUnitScaling"
|
|
@@ -47,35 +47,38 @@ td.neg_neutral {
|
|
|
47
47
|
text-align: right;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.category-inf {
|
|
51
|
-
max-width: 1000em;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
50
|
.category-w100 {
|
|
51
|
+
min-width: 100em;
|
|
55
52
|
max-width: 100em;
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.category-w50 {
|
|
56
|
+
min-width: 50em;
|
|
59
57
|
max-width: 50em;
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
.category-w25 {
|
|
61
|
+
min-width: 25em;
|
|
63
62
|
max-width: 25em;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
.category-w20 {
|
|
66
|
+
min-width: 20em;
|
|
67
67
|
max-width: 20em;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.category-w15 {
|
|
71
|
+
min-width: 15em;
|
|
71
72
|
max-width: 15em;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
.category-w10 {
|
|
76
|
+
min-width: 10em;
|
|
75
77
|
max-width: 10em;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
.category-w5 {
|
|
81
|
+
min-width: 5em;
|
|
79
82
|
max-width: 5em;
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -287,7 +290,6 @@ td {
|
|
|
287
290
|
-webkit-box-sizing: border-box;
|
|
288
291
|
border-top: 0.1em dashed #ddd;
|
|
289
292
|
padding-left: 0.5em;
|
|
290
|
-
max-width: 15em;
|
|
291
293
|
white-space: nowrap;
|
|
292
294
|
overflow: hidden;
|
|
293
295
|
text-overflow: ellipsis;
|
|
@@ -48,6 +48,7 @@ export class IbcsTable {
|
|
|
48
48
|
this.measureType = MeasureType.VOLUME;
|
|
49
49
|
this.filter = "";
|
|
50
50
|
this.barColumns = [];
|
|
51
|
+
this.barColumnMaxWidth = 30;
|
|
51
52
|
this.unitScaling = 0.01;
|
|
52
53
|
this.percentageScaling = 0.5;
|
|
53
54
|
this.scaleFactor = 1;
|
|
@@ -63,7 +64,7 @@ export class IbcsTable {
|
|
|
63
64
|
const errorMsg = this.i18n.get("NO_DATA") || "==No Data==";
|
|
64
65
|
return h("p", { class: "warning" }, errorMsg);
|
|
65
66
|
}
|
|
66
|
-
return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.
|
|
67
|
+
return (h("table", null, h("thead", null, this.table.getHeader().map((row) => (h("tr", { class: row.cssStyle }, row.getCells().map((cell) => (h("th", { colSpan: cell.colSpan, class: cell.cssStyle }, cell.getAsHeaderList().map((line, i, arr) => (h("span", null, i === arr.length - 1 ? (h("span", { class: line === " " ? "table-footer" : "" }, line, cell.drawPrefix(), " ")) : (h("span", null, line, cell.drawPrefix(), h("br", null))))))))))))), h("tbody", null, this.table.getBody().map((row) => (h("tr", { class: row.cssStyle }, row === null || row === void 0 ? void 0 : row.getCells().map((cell) => (h("td", { colSpan: cell.colSpan, class: cell.type ? `${cell.cssStyle} ${cell.type}` : cell.cssStyle }, cell.prefix != null ? (h("span", { class: cell.cssStyle + " " + cell.prefixStyle }, cell.drawPrefix())) : (""), cell.isBarChart && cell.columnStats ? (h(CellBarChart, { value: cell.value, scenario: cell.key, columnStats: cell.columnStats, height: 18 * this.scaleFactor, isRelative: cell.key.startsWith("dr"), isPositiveGood: cell.key.endsWith("_pos"), measureScale: cell.measureScale, maxBarWidth: this.barColumnMaxWidth, styles: this.barChartStyles })) : (cell.draw(this.componentDataFormatDigits)))))))))));
|
|
67
68
|
};
|
|
68
69
|
return h(Host, null, helper());
|
|
69
70
|
}
|
|
@@ -691,6 +692,26 @@ export class IbcsTable {
|
|
|
691
692
|
"setter": false,
|
|
692
693
|
"defaultValue": "[]"
|
|
693
694
|
},
|
|
695
|
+
"barColumnMaxWidth": {
|
|
696
|
+
"type": "number",
|
|
697
|
+
"mutable": false,
|
|
698
|
+
"complexType": {
|
|
699
|
+
"original": "number",
|
|
700
|
+
"resolved": "number",
|
|
701
|
+
"references": {}
|
|
702
|
+
},
|
|
703
|
+
"required": false,
|
|
704
|
+
"optional": false,
|
|
705
|
+
"docs": {
|
|
706
|
+
"tags": [],
|
|
707
|
+
"text": ""
|
|
708
|
+
},
|
|
709
|
+
"getter": false,
|
|
710
|
+
"setter": false,
|
|
711
|
+
"reflect": false,
|
|
712
|
+
"attribute": "bar-column-max-width",
|
|
713
|
+
"defaultValue": "30"
|
|
714
|
+
},
|
|
694
715
|
"unitScaling": {
|
|
695
716
|
"type": "number",
|
|
696
717
|
"mutable": false,
|
|
@@ -150,34 +150,74 @@ function getBarStroke(varianceStyle) {
|
|
|
150
150
|
// Solid and hatched bars don't need visible stroke
|
|
151
151
|
return { stroke: "none", strokeWidth: 0 };
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Renders a zigzag break indicator at a given x position, matching the structure chart style.
|
|
155
|
+
* Two mirrored zigzag lines with a white background covering the break gap.
|
|
156
|
+
*/
|
|
157
|
+
function renderZigzagBreak(breakX, breakGap, yTop, barHeight, s) {
|
|
158
|
+
const midX = breakX + breakGap / 2;
|
|
159
|
+
const halfGap = breakGap * 0.35;
|
|
160
|
+
const zigCount = 3;
|
|
161
|
+
const segHeight = barHeight / zigCount;
|
|
162
|
+
const amplitude = breakGap * 0.3;
|
|
163
|
+
let leftPath = `M ${midX - halfGap} ${yTop}`;
|
|
164
|
+
for (let i = 0; i < zigCount; i++) {
|
|
165
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
166
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
167
|
+
leftPath += ` L ${midX - halfGap - amplitude} ${y1} L ${midX - halfGap} ${y2}`;
|
|
168
|
+
}
|
|
169
|
+
let rightPath = `M ${midX + halfGap} ${yTop}`;
|
|
170
|
+
for (let i = 0; i < zigCount; i++) {
|
|
171
|
+
const y1 = yTop + segHeight * (i + 0.5);
|
|
172
|
+
const y2 = yTop + segHeight * (i + 1);
|
|
173
|
+
rightPath += ` L ${midX + halfGap + amplitude} ${y1} L ${midX + halfGap} ${y2}`;
|
|
174
|
+
}
|
|
175
|
+
return [
|
|
176
|
+
h("rect", { x: breakX, y: yTop - 1, width: breakGap, height: barHeight + 2, fill: "#ffffff" }),
|
|
177
|
+
h("path", { d: leftPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
178
|
+
h("path", { d: rightPath, fill: "none", stroke: "#000000", "stroke-width": 1 * s }),
|
|
179
|
+
];
|
|
180
|
+
}
|
|
153
181
|
/**
|
|
154
182
|
* Renders an absolute variance bar chart (d_ prefix).
|
|
155
183
|
* Horizontal bar with centered axis, green for positive, red for negative.
|
|
156
|
-
*
|
|
184
|
+
* When a bar exceeds maxBarWidth it is drawn as an overdrive bar:
|
|
185
|
+
* base segment + zigzag break + proportional overdrive stub (like structure chart).
|
|
157
186
|
*
|
|
158
187
|
* Layout: [left label area][bar area with axis][right label area]
|
|
159
|
-
* Uses unitScaling to determine bar width (pixels per unit of measure).
|
|
160
188
|
*/
|
|
161
189
|
const AbsoluteVarianceBar = (props) => {
|
|
162
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
190
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
163
191
|
const s = styles.scaleFactor;
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
|
|
192
|
+
const fs = styles.fontSize;
|
|
193
|
+
const labelAreaWidth = 38 * s;
|
|
194
|
+
const maxBarWidth = maxBarWidthEm * fs;
|
|
195
|
+
// Overdrive layout constants
|
|
196
|
+
const breakGap = 4 * s;
|
|
197
|
+
const overdriveZoneWidth = maxBarWidth * 0.15;
|
|
198
|
+
const cutWidth = maxBarWidth - breakGap - overdriveZoneWidth;
|
|
199
|
+
// Direct unit scaling via fontSize
|
|
200
|
+
const scaledWidth = Math.abs(value) * styles.unitScaling * fs;
|
|
201
|
+
const isExtreme = scaledWidth > cutWidth;
|
|
202
|
+
// Compute proportional overdrive width across the column
|
|
203
|
+
const maxScaledWidth = columnStats.absMax * styles.unitScaling * fs;
|
|
204
|
+
const maxOverflow = Math.max(0, maxScaledWidth - cutWidth);
|
|
205
|
+
const overflowAmount = Math.max(0, scaledWidth - cutWidth);
|
|
206
|
+
const overdriveWidth = maxOverflow > 0 ? (overflowAmount / maxOverflow) * overdriveZoneWidth : 0;
|
|
207
|
+
// Adaptive axis placement based on data range
|
|
208
|
+
const hasNeg = columnStats.min < 0;
|
|
209
|
+
const hasPos = columnStats.max > 0;
|
|
210
|
+
const negBarWidth = hasNeg ? maxBarWidth : 0;
|
|
211
|
+
const posBarWidth = hasPos ? maxBarWidth : 0;
|
|
212
|
+
const barAreaWidth = negBarWidth + posBarWidth;
|
|
213
|
+
const totalWidth = (hasNeg ? labelAreaWidth : 0) + barAreaWidth + (hasPos ? labelAreaWidth : 0);
|
|
168
214
|
const padding = 2 * s;
|
|
169
215
|
const barHeight = height - padding * 2;
|
|
170
|
-
const axisX =
|
|
171
|
-
// Calculate bar width using unitScaling (pixels per unit)
|
|
172
|
-
// Clamp to maxBarWidth to prevent overflow
|
|
173
|
-
const scaledWidth = Math.abs(value) * styles.unitScaling * s;
|
|
174
|
-
const barWidth = Math.min(scaledWidth, maxBarWidth);
|
|
175
|
-
const isPositive = value >= 0;
|
|
176
|
-
const barX = isPositive ? axisX : axisX - barWidth;
|
|
216
|
+
const axisX = (hasNeg ? labelAreaWidth : 0) + negBarWidth;
|
|
177
217
|
const barY = padding;
|
|
218
|
+
const isPositive = value >= 0;
|
|
178
219
|
// Get style based on column type (scenario vs variance)
|
|
179
220
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
180
|
-
// Pattern prefix for scenarios uses scenario type, for variances uses pos/neg
|
|
181
221
|
const patternPrefix = isScenarioColumn(scenario)
|
|
182
222
|
? getScenarioType(scenario)
|
|
183
223
|
: isPositiveGood
|
|
@@ -190,12 +230,14 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
190
230
|
const fillValue = getBarFill(barStyle, patternPrefix);
|
|
191
231
|
const { stroke: barStroke, strokeWidth: barStrokeWidth } = getBarStroke(barStyle);
|
|
192
232
|
const displayValue = formattedValue || formatValue(value, false, measureScale);
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
//
|
|
196
|
-
const
|
|
233
|
+
// Normal bar width (clamped to cutWidth when extreme)
|
|
234
|
+
const baseBarWidth = isExtreme ? cutWidth : scaledWidth;
|
|
235
|
+
// Label position accounts for overdrive
|
|
236
|
+
const totalVisualWidth = isExtreme ? cutWidth + breakGap + overdriveWidth : scaledWidth;
|
|
237
|
+
const labelX = isPositive ? axisX + totalVisualWidth + 4 * s : axisX - totalVisualWidth - 4 * s;
|
|
197
238
|
const labelAnchor = isPositive ? "start" : "end";
|
|
198
|
-
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }),
|
|
239
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart absolute-variance", style: { overflow: "visible" } }, h(PatternDefs, { styles: styles }), h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), baseBarWidth > 0 && (h("rect", { x: isPositive ? axisX : axisX - baseBarWidth, y: barY, width: baseBarWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme && overdriveWidth > 0 && (h("rect", { x: isPositive ? axisX + cutWidth + breakGap : axisX - cutWidth - breakGap - overdriveWidth, y: barY, width: overdriveWidth, height: barHeight, fill: fillValue, stroke: barStroke, "stroke-width": barStrokeWidth * s })), isExtreme &&
|
|
240
|
+
renderZigzagBreak(isPositive ? axisX + cutWidth : axisX - cutWidth - breakGap, breakGap, barY, barHeight, s), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": labelAnchor, fill: styles.fontColor, "font-size": fs, "font-family": styles.fontFamily }, displayValue)));
|
|
199
241
|
};
|
|
200
242
|
/**
|
|
201
243
|
* Renders a relative variance pin chart (dr_ prefix).
|
|
@@ -205,30 +247,36 @@ const AbsoluteVarianceBar = (props) => {
|
|
|
205
247
|
* Uses percentageScaling to determine pin length (pixels per percentage point).
|
|
206
248
|
*/
|
|
207
249
|
const RelativeVariancePin = (props) => {
|
|
208
|
-
const { value, scenario, height, isPositiveGood, formattedValue, measureScale, styles = DEFAULT_STYLES } = props;
|
|
250
|
+
const { value, scenario, columnStats, height, isPositiveGood, formattedValue, measureScale, maxBarWidth: maxBarWidthEm = 10, styles = DEFAULT_STYLES, } = props;
|
|
209
251
|
const s = styles.scaleFactor;
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const
|
|
252
|
+
const fs = styles.fontSize;
|
|
253
|
+
// Pin length is ~2/3 of bar width for visual balance
|
|
254
|
+
const maxPinLength = Math.round(maxBarWidthEm * 0.67 * fs);
|
|
255
|
+
const pinPadding = 5 * s;
|
|
256
|
+
// Adaptive axis placement based on data range
|
|
257
|
+
const hasNeg = columnStats.min < 0;
|
|
258
|
+
const hasPos = columnStats.max > 0;
|
|
259
|
+
const negPinWidth = hasNeg ? maxPinLength + pinPadding : 0;
|
|
260
|
+
const posPinWidth = hasPos ? maxPinLength + pinPadding : 0;
|
|
261
|
+
const pinAreaWidth = negPinWidth + posPinWidth;
|
|
262
|
+
const labelAreaWidth = 45 * s;
|
|
213
263
|
const totalWidth = pinAreaWidth + labelAreaWidth;
|
|
214
|
-
const axisX =
|
|
264
|
+
const axisX = negPinWidth;
|
|
215
265
|
const centerY = height / 2;
|
|
216
|
-
//
|
|
217
|
-
// Value is in decimal form (e.g., 0.5 = 50%), multiply by 100 to get percentage
|
|
266
|
+
// Direct unit scaling via fontSize
|
|
218
267
|
const percentValue = Math.abs(value) * 100;
|
|
219
|
-
const scaledLength = percentValue * styles.percentageScaling *
|
|
268
|
+
const scaledLength = percentValue * styles.percentageScaling * fs;
|
|
269
|
+
const isExtreme = scaledLength > maxPinLength;
|
|
220
270
|
const pinLength = Math.min(scaledLength, maxPinLength);
|
|
221
271
|
const isPositive = value >= 0;
|
|
222
272
|
const pinEndX = isPositive ? axisX + pinLength : axisX - pinLength;
|
|
223
273
|
// Get style based on column type (scenario vs variance)
|
|
224
274
|
const barStyle = getBarStyle(scenario, value, isPositiveGood, styles);
|
|
225
275
|
const dotRadius = 3 * s;
|
|
226
|
-
// Show arrow for extreme values (when pin would exceed max length)
|
|
227
|
-
const isExtreme = scaledLength > maxPinLength;
|
|
228
276
|
const displayValue = formattedValue || formatValue(value, true, measureScale);
|
|
229
277
|
// Label always on the right side after the pin area
|
|
230
278
|
const labelX = pinAreaWidth + 4 * s;
|
|
231
|
-
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${
|
|
279
|
+
return (h("svg", { width: totalWidth, height: height, class: "cell-bar-chart relative-variance", style: { overflow: "visible" } }, h("line", { x1: axisX, y1: 0, x2: axisX, y2: height, stroke: AXIS_COLOR, "stroke-width": 1 * s }), !isExtreme && h("circle", { cx: pinEndX, cy: centerY, r: dotRadius, fill: styles.fontColor }), h("line", { x1: axisX, y1: centerY, x2: pinEndX, y2: centerY, stroke: barStyle.fill, "stroke-width": 2 * s }), isExtreme && isPositive && (h("polygon", { points: `${axisX + maxPinLength},${centerY} ${axisX + maxPinLength - 6 * s},${centerY - 3 * s} ${axisX + maxPinLength - 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), isExtreme && !isPositive && (h("polygon", { points: `${axisX - maxPinLength},${centerY} ${axisX - maxPinLength + 6 * s},${centerY - 3 * s} ${axisX - maxPinLength + 6 * s},${centerY + 3 * s}`, fill: barStyle.fill })), h("text", { x: labelX, y: height / 2, dy: "0.35em", "text-anchor": "start", fill: styles.fontColor, "font-size": fs, "font-style": "italic", "font-family": styles.fontFamily }, displayValue)));
|
|
232
280
|
};
|
|
233
281
|
/**
|
|
234
282
|
* CellBarChart - Renders IBCS-compliant variance bar charts.
|
|
@@ -79,7 +79,9 @@ export class TableRow {
|
|
|
79
79
|
if (isSecondaryElement) {
|
|
80
80
|
prefixStyle = "prefix-second";
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
if (columnType) {
|
|
83
|
+
cssStyle = `${cssStyle} ${columnType}`;
|
|
84
|
+
}
|
|
83
85
|
const cell = new Cell(scenario, this.elements.length, value, cssStyle, cellType, prefix, prefixStyle, 1, measureScale);
|
|
84
86
|
cell.isBarChart = isBarChart;
|
|
85
87
|
cell.columnStats = columnStats;
|
|
@@ -113,9 +113,11 @@ export class TableDataSetFactory {
|
|
|
113
113
|
if (!barColumns || barColumns.length === 0) {
|
|
114
114
|
return statsMap;
|
|
115
115
|
}
|
|
116
|
-
//
|
|
116
|
+
// Collect all values per column for median calculation
|
|
117
|
+
const valuesMap = new Map();
|
|
117
118
|
for (const column of barColumns) {
|
|
118
|
-
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0 });
|
|
119
|
+
statsMap.set(column, { min: Infinity, max: -Infinity, absMax: 0, median: 0 });
|
|
120
|
+
valuesMap.set(column, []);
|
|
119
121
|
}
|
|
120
122
|
// Iterate through all groups and rows
|
|
121
123
|
for (const groupData of queryData) {
|
|
@@ -126,17 +128,24 @@ export class TableDataSetFactory {
|
|
|
126
128
|
const stats = statsMap.get(column);
|
|
127
129
|
stats.min = Math.min(stats.min, value);
|
|
128
130
|
stats.max = Math.max(stats.max, value);
|
|
131
|
+
valuesMap.get(column).push(Math.abs(value));
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
// Finalize absMax values
|
|
136
|
+
// Finalize absMax and median values
|
|
134
137
|
for (const [column, stats] of statsMap) {
|
|
135
138
|
if (stats.min === Infinity || stats.max === -Infinity) {
|
|
136
139
|
stats.min = 0;
|
|
137
140
|
stats.max = 0;
|
|
138
141
|
}
|
|
139
142
|
stats.absMax = Math.max(Math.abs(stats.min), Math.abs(stats.max));
|
|
143
|
+
const absValues = valuesMap.get(column);
|
|
144
|
+
if (absValues.length > 0) {
|
|
145
|
+
absValues.sort((a, b) => a - b);
|
|
146
|
+
const mid = Math.floor(absValues.length / 2);
|
|
147
|
+
stats.median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
148
|
+
}
|
|
140
149
|
statsMap.set(column, stats);
|
|
141
150
|
}
|
|
142
151
|
return statsMap;
|
|
@@ -17,12 +17,14 @@ export class ColumnStatistics {
|
|
|
17
17
|
for (const column of columns) {
|
|
18
18
|
let min = Infinity;
|
|
19
19
|
let max = -Infinity;
|
|
20
|
+
const absValues = [];
|
|
20
21
|
for (const group of data) {
|
|
21
22
|
for (const row of group) {
|
|
22
23
|
const value = this.extractValue(row, column);
|
|
23
24
|
if (value !== null && !isNaN(value)) {
|
|
24
25
|
min = Math.min(min, value);
|
|
25
26
|
max = Math.max(max, value);
|
|
27
|
+
absValues.push(Math.abs(value));
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -32,7 +34,13 @@ export class ColumnStatistics {
|
|
|
32
34
|
max = 0;
|
|
33
35
|
}
|
|
34
36
|
const absMax = Math.max(Math.abs(min), Math.abs(max));
|
|
35
|
-
|
|
37
|
+
let median = 0;
|
|
38
|
+
if (absValues.length > 0) {
|
|
39
|
+
absValues.sort((a, b) => a - b);
|
|
40
|
+
const mid = Math.floor(absValues.length / 2);
|
|
41
|
+
median = absValues.length % 2 === 0 ? (absValues[mid - 1] + absValues[mid]) / 2 : absValues[mid];
|
|
42
|
+
}
|
|
43
|
+
statsMap.set(column, { min, max, absMax, median });
|
|
36
44
|
}
|
|
37
45
|
return statsMap;
|
|
38
46
|
}
|
|
@@ -41,6 +41,7 @@ export const SYSTEM_STYLE_DEFAULTS = {
|
|
|
41
41
|
neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 },
|
|
42
42
|
neu: { stroke: "#808080", fill: "#808080", width: 0.1 },
|
|
43
43
|
},
|
|
44
|
+
stackColors: ["#000000", "#c0c0c0", "#808080"],
|
|
44
45
|
padding: {
|
|
45
46
|
top: 10,
|
|
46
47
|
left: 10,
|
|
@@ -83,6 +84,7 @@ export const SYSTEM_STYLE_DEFAULTS = {
|
|
|
83
84
|
neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 },
|
|
84
85
|
neu: { stroke: "#808080", fill: "#808080", width: 0.1 },
|
|
85
86
|
},
|
|
87
|
+
stackColors: ["#000000", "#c0c0c0", "#808080"],
|
|
86
88
|
padding: {
|
|
87
89
|
top: 10,
|
|
88
90
|
left: 10,
|
|
@@ -82,6 +82,33 @@ export var TableCategoryWidth;
|
|
|
82
82
|
TableCategoryWidth["W10"] = "w10";
|
|
83
83
|
TableCategoryWidth["W5"] = "w5";
|
|
84
84
|
})(TableCategoryWidth || (TableCategoryWidth = {}));
|
|
85
|
+
/** Width preset for inline bar/pin chart columns. Value = max bar width in em. */
|
|
86
|
+
export var TableBarColumnWidth;
|
|
87
|
+
(function (TableBarColumnWidth) {
|
|
88
|
+
TableBarColumnWidth["W5"] = "w5";
|
|
89
|
+
TableBarColumnWidth["W10"] = "w10";
|
|
90
|
+
TableBarColumnWidth["W15"] = "w15";
|
|
91
|
+
TableBarColumnWidth["W20"] = "w20";
|
|
92
|
+
TableBarColumnWidth["W25"] = "w25";
|
|
93
|
+
TableBarColumnWidth["W30"] = "w30";
|
|
94
|
+
TableBarColumnWidth["W40"] = "w40";
|
|
95
|
+
TableBarColumnWidth["W60"] = "w60";
|
|
96
|
+
TableBarColumnWidth["W80"] = "w80";
|
|
97
|
+
TableBarColumnWidth["W100"] = "w100";
|
|
98
|
+
})(TableBarColumnWidth || (TableBarColumnWidth = {}));
|
|
99
|
+
/** Maps TableBarColumnWidth presets to max bar width in em. */
|
|
100
|
+
export const BAR_COLUMN_WIDTH_EM = {
|
|
101
|
+
[TableBarColumnWidth.W5]: 5,
|
|
102
|
+
[TableBarColumnWidth.W10]: 10,
|
|
103
|
+
[TableBarColumnWidth.W15]: 15,
|
|
104
|
+
[TableBarColumnWidth.W20]: 20,
|
|
105
|
+
[TableBarColumnWidth.W25]: 25,
|
|
106
|
+
[TableBarColumnWidth.W30]: 30,
|
|
107
|
+
[TableBarColumnWidth.W40]: 40,
|
|
108
|
+
[TableBarColumnWidth.W60]: 60,
|
|
109
|
+
[TableBarColumnWidth.W80]: 80,
|
|
110
|
+
[TableBarColumnWidth.W100]: 100,
|
|
111
|
+
};
|
|
85
112
|
/**
|
|
86
113
|
* Three-level row hierarchy for grouping and drill-down: rowGroup > category > subCategory.
|
|
87
114
|
* Index variants (e.g. ROWGROUPINDEX) provide stable numeric sort keys that preserve
|
|
@@ -127,13 +154,16 @@ export var ChartMode;
|
|
|
127
154
|
ChartMode["LINE"] = "line";
|
|
128
155
|
ChartMode["AUTO"] = "auto";
|
|
129
156
|
})(ChartMode || (ChartMode = {}));
|
|
130
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Stacking dimension for multi-segment bar charts.
|
|
159
|
+
* - SCENARIOS: stack the scenarios from the `scenarios` prop end-to-end
|
|
160
|
+
* - DIMENSIONS: stack by the next-lower hierarchy level derived from the `level` prop
|
|
161
|
+
* (rowGroup → category, category → subCategory)
|
|
162
|
+
*/
|
|
131
163
|
export var StackBy;
|
|
132
164
|
(function (StackBy) {
|
|
133
|
-
StackBy["
|
|
134
|
-
StackBy["
|
|
135
|
-
StackBy["SUBCATEGORY"] = "subcategory";
|
|
136
|
-
StackBy["ROWGROUP"] = "rowgroup";
|
|
165
|
+
StackBy["SCENARIOS"] = "scenarios";
|
|
166
|
+
StackBy["DIMENSIONS"] = "dimensions";
|
|
137
167
|
})(StackBy || (StackBy = {}));
|
|
138
168
|
/**
|
|
139
169
|
* How stacked values are presented.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import hash from "@emotion/hash";
|
|
2
|
+
import { gunzipSync } from "fflate";
|
|
3
|
+
/**
|
|
4
|
+
* Compute a short deterministic hash of a string.
|
|
5
|
+
*/
|
|
6
|
+
export function computeContentHash(text) {
|
|
7
|
+
return hash(text);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Decode a compressed payload in the format `<hash>:<base64_gzip>`.
|
|
11
|
+
* Returns the embedded hash and the decompressed JSON string.
|
|
12
|
+
*/
|
|
13
|
+
export function decodeCompressedContent(text) {
|
|
14
|
+
const colonIndex = text.indexOf(":");
|
|
15
|
+
if (colonIndex === -1) {
|
|
16
|
+
throw new Error("Invalid compressed format: missing ':' separator");
|
|
17
|
+
}
|
|
18
|
+
const embeddedHash = text.slice(0, colonIndex);
|
|
19
|
+
const base64Data = text.slice(colonIndex + 1);
|
|
20
|
+
const binaryString = atob(base64Data);
|
|
21
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
22
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
23
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
24
|
+
}
|
|
25
|
+
const decompressed = gunzipSync(bytes);
|
|
26
|
+
const json = new TextDecoder().decode(decompressed);
|
|
27
|
+
return { hash: embeddedHash, json };
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Default fill colors cycled through for stacked chart segments. */
|
|
2
|
-
export const STACK_FILLS = ["#
|
|
2
|
+
export const STACK_FILLS = ["#000000", "#c0c0c0", "#808080"];
|
|
3
3
|
/** Default stroke colors cycled through for stacked chart segments. */
|
|
4
|
-
export const STACK_STROKES = ["#
|
|
4
|
+
export const STACK_STROKES = ["#000000", "#c0c0c0", "#808080"];
|
|
5
5
|
/**
|
|
6
6
|
* IBCS rendering order: back-to-front (PL behind FC behind PP behind AC).
|
|
7
7
|
* Used to ensure correct visual layering when scenarios overlap.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These are used in component @Watch methods to warn about malformed attribute values
|
|
6
6
|
* without crashing the component.
|
|
7
7
|
*/
|
|
8
|
-
import { AggregationLevel, AxisLabelsMode, DataFormat, I18nMode, MeasureType, Scenarios, Sentiments, TableCategoryWidth, TableType, } from "./constants";
|
|
8
|
+
import { AggregationLevel, AxisLabelsMode, DataFormat, I18nMode, MeasureType, Scenarios, Sentiments, TableBarColumnWidth, TableCategoryWidth, TableType, } from "./constants";
|
|
9
9
|
import { DateDistance, DateLink } from "./DateStringFactory";
|
|
10
10
|
import { OrderColumn, OrderDirection } from "./model/Order";
|
|
11
11
|
/**
|
|
@@ -264,6 +264,9 @@ export function validateStylesString(value) {
|
|
|
264
264
|
export function isTableCategoryWidth(value) {
|
|
265
265
|
return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in TableCategoryWidth;
|
|
266
266
|
}
|
|
267
|
+
export function isTableBarColumnWidth(value) {
|
|
268
|
+
return (value === null || value === void 0 ? void 0 : value.toUpperCase().trim()) in TableBarColumnWidth;
|
|
269
|
+
}
|
|
267
270
|
export function validateColumnThereOfJsonStr(value) {
|
|
268
271
|
if (isBlankInput(value)) {
|
|
269
272
|
return [];
|
|
@@ -291,7 +294,7 @@ export function validateStackConfig(value) {
|
|
|
291
294
|
errors.push("stack: 'by' is required");
|
|
292
295
|
}
|
|
293
296
|
else {
|
|
294
|
-
const validBy = ["
|
|
297
|
+
const validBy = ["scenarios", "dimensions"];
|
|
295
298
|
if (!validBy.includes(config.by)) {
|
|
296
299
|
errors.push(`stack: 'by' must be one of: ${validBy.join(", ")}`);
|
|
297
300
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./alasql.min.js";import{
|
|
1
|
+
import{a as e}from"./alasql.min.js";import{j as t}from"./Order.js";class a{constructor(e="",t=1){this.prefix=e,this.value=t}}var s;!function(e){e[e.Y=1e24]="Y",e[e.Z=1e21]="Z",e[e.E=1e18]="E",e[e.P=1e15]="P",e[e.T=1e12]="T",e[e.G=1e9]="G",e[e.M=1e6]="M",e[e.k=1e3]="k",e[e.h=100]="h",e[e.da=10]="da",e[e.d=.1]="d",e[e.c=.01]="c",e[e.m=.001]="m",e[e.my=1e-6]="my",e[e.n=1e-9]="n",e[e.p=1e-12]="p",e[e.f=1e-15]="f",e[e.a=1e-18]="a",e[e.z=1e-21]="z",e[e.y=1e-24]="y"}(s||(s={}));class r{static calculateMeasureScale(t,s,r){var n;if("_"===r)return new a;if(null!=r&&[...this.unitsLeast,...this.unitsGreat].includes(r))return this.lookupPrefix(r);if(0===s.length)return new a;const i=`SELECT MAX(GREATEST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`,u=`SELECT MIN(LEAST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`;let c=i;"LEAST"===(null==r?void 0:r.toUpperCase())&&(c=u);const l=null===(n=e(c,[t])[0])||void 0===n?void 0:n.prefixvalue;return this.determinePrefix(Math.abs(l))}static determinePrefix(e){if(e>=1e3){const t=Math.floor(Math.floor(Math.abs(e)).toString().length/3),s=+Math.pow(1e3,t);return new a(this.unitsGreat[t-1],s)}if(e<=.001){const t=Math.floor(Math.abs(e).toString().length/3),s=1/Math.pow(1e3,t);return new a(this.unitsLeast[t-1],s)}return new a}static lookupPrefix(e){return new a(e,s[e])}}r.unitsGreat=["k","M","G","T","P","E","Z","Y"],r.unitsLeast=["m","my","n","p","P","f","a","z","y"];class n{constructor(e=2,t=1){this.percent=e,this.decimal=t}}class i{adapt(e){const a=new n;return t.isNumber(e.percent)&&(a.percent=e.percent),t.isNumber(e.decimal)&&(a.decimal=e.decimal),a}default(){return new n}}export{r as D,a as S,n as a,i as b}
|