@bino-bi/bn-template-engine 1.0.0-next.30 → 1.0.0-next.32
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-64803a42.entry.js → p-14d021be.entry.js} +1 -1
- package/dist/bn-template-engine/p-225cd474.entry.js +1 -0
- package/dist/bn-template-engine/p-58b10778.entry.js +1 -0
- package/dist/bn-template-engine/{p-40ba7f43.entry.js → p-7d475277.entry.js} +1 -1
- package/dist/bn-template-engine/p-9f3cbc5f.entry.js +1 -0
- package/dist/bn-template-engine/p-BNCLKXjM.js +1 -0
- package/dist/bn-template-engine/{p-B8AjeKja.js → p-BTbeDWM9.js} +1 -1
- package/dist/bn-template-engine/{p-Z2rUaSh_.js → p-BjR3nkhl.js} +1 -1
- package/dist/bn-template-engine/p-CHZ50kEY.js +1 -0
- package/dist/bn-template-engine/p-CJfJQT0m.js +1 -0
- package/dist/bn-template-engine/p-ce39e111.entry.js +1 -0
- package/dist/cjs/bn-annotation-layer_30.cjs.entry.js +191 -68
- package/dist/cjs/bn-grid.cjs.entry.js +465 -34
- package/dist/cjs/bn-image.cjs.entry.js +2 -2
- package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
- package/dist/cjs/bn-ruleset.cjs.entry.js +2 -2
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{diagnostics-C4Ggts3w.js → localFrame-P5SDUOto.js} +90 -1
- package/dist/cjs/{withBodyObserver-BK4idxqG.js → withBodyObserver-B1_hmuUz.js} +1 -1
- package/dist/cjs/{withHasError-CqvcS23z.js → withHasError-3kR2tdhJ.js} +4 -0
- package/dist/cjs/{withStyled-70D4Isgt.js → withStyled-Ds3e64Nz.js} +1 -1
- package/dist/cjs/{withTranslation-C6Pye2CM.js → withTranslation-Cjvvs3gL.js} +2 -2
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +32 -2
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +32 -2
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +3 -1
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +32 -2
- package/dist/collection/components/bn-chart-structure/bn-chart-structure-renderer/bn-chart-structure-renderer.js +1 -1
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +33 -2
- package/dist/collection/components/bn-chart-time/bn-chart-time-renderer/bn-chart-time-renderer.js +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +33 -2
- package/dist/collection/components/bn-grid/bn-grid.js +454 -26
- package/dist/collection/components/bn-grid/utils/cellLayout.js +111 -0
- package/dist/collection/components/bn-table/bn-table.js +39 -2
- package/dist/collection/stores/componentStyles.js +4 -0
- package/dist/collection/utils/layoutState/baseline.js +67 -0
- package/dist/collection/utils/layoutState/index.js +2 -0
- package/dist/collection/utils/layoutState/localFrame.js +87 -0
- package/dist/collection/utils/layoutState/svgChartElements.js +6 -2
- package/dist/collection/utils/xy/XYFrame.js +3 -1
- package/dist/components/bn-annotation-layer.js +1 -1
- package/dist/components/bn-annotation-list.js +1 -1
- package/dist/components/bn-asset.js +1 -1
- package/dist/components/bn-body.js +1 -1
- package/dist/components/bn-card.js +1 -1
- package/dist/components/bn-chart-bubble-renderer.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet-renderer.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter-renderer.js +1 -1
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure-renderer.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time-renderer.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message.js +1 -1
- package/dist/components/bn-page.js +1 -1
- package/dist/components/bn-ruleset.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table-renderer.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/p-0gehv1XG.js +1 -0
- package/dist/components/{p-Bs-YxJEt.js → p-8a2-IS-y.js} +1 -1
- package/dist/components/p-B2jqpOF9.js +1 -0
- package/dist/components/{p-BWBHlztH.js → p-BPJsmv3o.js} +1 -1
- package/dist/components/{p-BXrPfAvP.js → p-BVtD8O36.js} +1 -1
- package/dist/components/p-BcOud3dQ.js +1 -0
- package/dist/components/{p-DsOaqeTN.js → p-BoUkFdpu.js} +1 -1
- package/dist/components/p-BohXdw3-.js +1 -0
- package/dist/components/p-C6XrNN2m.js +1 -0
- package/dist/components/{p-Dm55bMs2.js → p-CDoSPw-I.js} +1 -1
- package/dist/components/p-CMCnX0iM.js +1 -0
- package/dist/components/{p-Ds_BSK8v.js → p-ClGOhg6P.js} +1 -1
- package/dist/components/p-CujsXn-l.js +1 -0
- package/dist/components/{p-Ba9PUiBp.js → p-D4FY_yoG.js} +1 -1
- package/dist/components/{p-DIyUaSBg.js → p-D6cWoDk1.js} +1 -1
- package/dist/components/p-D7X69xMg.js +1 -0
- package/dist/components/{p-B1nL0yOa.js → p-DSkyHSIL.js} +1 -1
- package/dist/components/{p-BSV_vyqs.js → p-De82WP7z.js} +1 -1
- package/dist/components/p-DyO09Jk6.js +1 -0
- package/dist/components/{p-WzaayhTX.js → p-Ku08TQL1.js} +1 -1
- package/dist/components/p-t4xPltK2.js +1 -0
- package/dist/components/{p-ey23VlID.js → p-yH-XxIy9.js} +1 -1
- package/dist/components/{p-X9hpquOX.js → p-z56_ZQ42.js} +1 -1
- package/dist/components/{p-B7uwck1J.js → p-zf8cTH63.js} +1 -1
- package/dist/esm/bn-annotation-layer_30.entry.js +140 -17
- package/dist/esm/bn-grid.entry.js +456 -25
- package/dist/esm/bn-image.entry.js +2 -2
- package/dist/esm/bn-internationalization.entry.js +2 -2
- package/dist/esm/bn-ruleset.entry.js +2 -2
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{diagnostics-Cyqy1zDT.js → localFrame-IW84cmdb.js} +90 -2
- package/dist/esm/{withBodyObserver-JcRB9OPQ.js → withBodyObserver-CAnnvrE_.js} +1 -1
- package/dist/esm/{withHasError-l3cMN-oP.js → withHasError-Cj_MzZ8Q.js} +4 -0
- package/dist/esm/{withStyled-DGOiR00Q.js → withStyled-B-cbWCe2.js} +1 -1
- package/dist/esm/{withTranslation-BpO8BC5B.js → withTranslation-_8q-7Y9C.js} +2 -2
- package/dist/schemas/theme.schema.json +14 -0
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +6 -1
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +6 -1
- package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +6 -1
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +6 -1
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +6 -1
- package/dist/types/components/bn-grid/bn-grid.d.ts +79 -3
- package/dist/types/components/bn-grid/utils/cellLayout.d.ts +47 -0
- package/dist/types/components/bn-table/bn-table.d.ts +8 -1
- package/dist/types/components.d.ts +94 -7
- package/dist/types/stores/componentStyles.d.ts +6 -0
- package/dist/types/utils/layoutState/baseline.d.ts +17 -0
- package/dist/types/utils/layoutState/index.d.ts +2 -0
- package/dist/types/utils/layoutState/localFrame.d.ts +17 -0
- package/dist/types/utils/layoutState/svgChartElements.d.ts +3 -1
- package/dist/types/utils/layoutState/types.d.ts +12 -2
- package/package.json +1 -1
- package/dist/bn-template-engine/p-132ad556.entry.js +0 -1
- package/dist/bn-template-engine/p-17d71782.entry.js +0 -1
- package/dist/bn-template-engine/p-467871f3.entry.js +0 -1
- package/dist/bn-template-engine/p-CrT83eO4.js +0 -1
- package/dist/bn-template-engine/p-D_DzKxRV.js +0 -1
- package/dist/bn-template-engine/p-c41c0a1b.entry.js +0 -1
- package/dist/bn-template-engine/p-yc69rwuH.js +0 -1
- package/dist/components/p-BDS_jiow.js +0 -1
- package/dist/components/p-BIIDTtcR.js +0 -1
- package/dist/components/p-BVKLCz2k.js +0 -1
- package/dist/components/p-CkW23yp2.js +0 -1
- package/dist/components/p-DUHp_9X-.js +0 -1
- package/dist/components/p-Dq1AzGKX.js +0 -1
- package/dist/components/p-U3zkcEJZ.js +0 -1
- package/dist/components/p-jbp6YiHf.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DGis1BzT.js');
|
|
4
|
-
var withHasError = require('./withHasError-
|
|
5
|
-
var withStyled = require('./withStyled-
|
|
6
|
-
var withTranslation = require('./withTranslation-
|
|
7
|
-
var withBodyObserver = require('./withBodyObserver-
|
|
8
|
-
var
|
|
4
|
+
var withHasError = require('./withHasError-3kR2tdhJ.js');
|
|
5
|
+
var withStyled = require('./withStyled-Ds3e64Nz.js');
|
|
6
|
+
var withTranslation = require('./withTranslation-Cjvvs3gL.js');
|
|
7
|
+
var withBodyObserver = require('./withBodyObserver-B1_hmuUz.js');
|
|
8
|
+
var localFrame = require('./localFrame-P5SDUOto.js');
|
|
9
9
|
var index$1 = require('./index.cjs.js');
|
|
10
10
|
var queryError = require('./queryError-BZjnIW_w.js');
|
|
11
11
|
|
|
@@ -760,16 +760,83 @@ function buildGenericState(el, origins) {
|
|
|
760
760
|
return {
|
|
761
761
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
762
762
|
tag: el.localName,
|
|
763
|
-
id:
|
|
763
|
+
id: localFrame.resolveStandaloneId(el),
|
|
764
764
|
slot: (_a = el.getAttribute("slot")) !== null && _a !== void 0 ? _a : undefined,
|
|
765
|
-
rect:
|
|
765
|
+
rect: localFrame.measure(el, origins),
|
|
766
766
|
em: { fontSizePx: readFontSizePx(el), appliedScaleFactor: 1 },
|
|
767
767
|
regions: [],
|
|
768
768
|
metadata: {},
|
|
769
|
-
diagnostics:
|
|
769
|
+
diagnostics: localFrame.readDiagnostics(el),
|
|
770
770
|
};
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
+
/** Marks the element a chart wants to be aligned on, where its markup has no other stable hook. */
|
|
774
|
+
const BASELINE_ATTRIBUTE = "data-bn-baseline";
|
|
775
|
+
const round2 = (value) => Math.round(value * 100) / 100;
|
|
776
|
+
/**
|
|
777
|
+
* Baseline of one axis line: a horizontal line gives its y and its left end,
|
|
778
|
+
* a vertical line its x and its top end.
|
|
779
|
+
*/
|
|
780
|
+
function lineBaseline(line, frame) {
|
|
781
|
+
const rect = frame.toLocal(line.getBoundingClientRect());
|
|
782
|
+
if (rect.width >= rect.height) {
|
|
783
|
+
return { x: round2(rect.x), y: round2(rect.y + rect.height / 2) };
|
|
784
|
+
}
|
|
785
|
+
return { x: round2(rect.x + rect.width / 2), y: round2(rect.y) };
|
|
786
|
+
}
|
|
787
|
+
/** Baseline of a plot frame: its bottom edge (the x axis) and its left edge (the y axis). */
|
|
788
|
+
function frameBaseline(frame, local) {
|
|
789
|
+
const rect = local.toLocal(frame.getBoundingClientRect());
|
|
790
|
+
return { x: round2(rect.x), y: round2(rect.y + rect.height) };
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Baseline of a chart segment SVG, in the layout px of `host`: the first
|
|
794
|
+
* marked frame or axis line, else the first line of the `#axis` group. `{}`
|
|
795
|
+
* when there is none, for example before the chart has drawn.
|
|
796
|
+
*/
|
|
797
|
+
function readSvgBaseline(svgRoot, host) {
|
|
798
|
+
const marked = svgRoot.querySelector(`[${BASELINE_ATTRIBUTE}]`);
|
|
799
|
+
const el = marked !== null && marked !== void 0 ? marked : svgRoot.querySelector('g[id="axis"] line');
|
|
800
|
+
if (!el)
|
|
801
|
+
return {};
|
|
802
|
+
const frame = localFrame.localFrameOf(host);
|
|
803
|
+
return el.getAttribute(BASELINE_ATTRIBUTE) === "frame" ? frameBaseline(el, frame) : lineBaseline(el, frame);
|
|
804
|
+
}
|
|
805
|
+
/** Baseline of the first `innerTag` renderer in a chart facade (the base segment, in DOM order). */
|
|
806
|
+
function readChartBaseline(host, innerTag) {
|
|
807
|
+
var _a, _b, _c;
|
|
808
|
+
const svg = (_c = (_b = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(innerTag)) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("svg#drawCanvas");
|
|
809
|
+
return svg ? readSvgBaseline(svg, host) : {};
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Baseline of a rendered `<table>`, in the layout px of `host`: y is the
|
|
813
|
+
* bottom of the header, x the left edge of the first value column (the cell
|
|
814
|
+
* after the category column of the last header row, else of the first body row).
|
|
815
|
+
*/
|
|
816
|
+
function readTableBaseline(table, host) {
|
|
817
|
+
var _a;
|
|
818
|
+
if (!table)
|
|
819
|
+
return {};
|
|
820
|
+
const frame = localFrame.localFrameOf(host);
|
|
821
|
+
const baseline = {};
|
|
822
|
+
const thead = table.querySelector("thead");
|
|
823
|
+
if (thead) {
|
|
824
|
+
const rect = frame.toLocal(thead.getBoundingClientRect());
|
|
825
|
+
baseline.y = round2(rect.y + rect.height);
|
|
826
|
+
}
|
|
827
|
+
const rows = (section) => section ? Array.from(section.children).filter((child) => child.localName === "tr") : [];
|
|
828
|
+
const headerRows = rows(thead);
|
|
829
|
+
const row = (_a = headerRows[headerRows.length - 1]) !== null && _a !== void 0 ? _a : rows(table.querySelector("tbody"))[0];
|
|
830
|
+
// an operation column can come before the category column (table type opt)
|
|
831
|
+
const cells = row ? Array.from(row.children) : [];
|
|
832
|
+
const category = cells.findIndex((cell) => cell.classList.contains("category"));
|
|
833
|
+
const valueCell = cells[category >= 0 ? category + 1 : 1];
|
|
834
|
+
if (valueCell) {
|
|
835
|
+
baseline.x = round2(frame.toLocal(valueCell.getBoundingClientRect()).x);
|
|
836
|
+
}
|
|
837
|
+
return baseline;
|
|
838
|
+
}
|
|
839
|
+
|
|
773
840
|
const KEY_ATTRIBUTES = [
|
|
774
841
|
["rowGroup", "data-bn-row-group"],
|
|
775
842
|
["category", "data-bn-category"],
|
|
@@ -903,7 +970,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
903
970
|
segment,
|
|
904
971
|
scenario: scenarioOf(group, svgRoot),
|
|
905
972
|
index: (_a = indexOfGroup(group.id)) !== null && _a !== void 0 ? _a : walkIndex,
|
|
906
|
-
rect:
|
|
973
|
+
rect: localFrame.measure(group, origins),
|
|
907
974
|
point: readLayoutPoint(group),
|
|
908
975
|
};
|
|
909
976
|
elements.push(bar);
|
|
@@ -922,7 +989,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
922
989
|
segment,
|
|
923
990
|
scenario: `stack:${(_c = (_b = (_a = point === null || point === void 0 ? void 0 : point.scenario) !== null && _a !== void 0 ? _a : point === null || point === void 0 ? void 0 : point.subCategory) !== null && _b !== void 0 ? _b : point === null || point === void 0 ? void 0 : point.category) !== null && _c !== void 0 ? _c : ""}`,
|
|
924
991
|
index: Number(match[1]),
|
|
925
|
-
rect:
|
|
992
|
+
rect: localFrame.measure(group, origins),
|
|
926
993
|
point,
|
|
927
994
|
};
|
|
928
995
|
elements.push(bar);
|
|
@@ -943,7 +1010,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
943
1010
|
text,
|
|
944
1011
|
segment,
|
|
945
1012
|
index: (_c = indexOfGroup(group.id)) !== null && _c !== void 0 ? _c : walkIndex,
|
|
946
|
-
rect:
|
|
1013
|
+
rect: localFrame.measure(group, origins),
|
|
947
1014
|
point: readLayoutPoint(group),
|
|
948
1015
|
};
|
|
949
1016
|
elements.push(label);
|
|
@@ -960,7 +1027,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
960
1027
|
kind: "point",
|
|
961
1028
|
series: point.scenario,
|
|
962
1029
|
index: index !== null && index !== void 0 ? index : walkIndex,
|
|
963
|
-
rect:
|
|
1030
|
+
rect: localFrame.measure(el, origins),
|
|
964
1031
|
point,
|
|
965
1032
|
};
|
|
966
1033
|
elements.push(mark);
|
|
@@ -973,7 +1040,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
973
1040
|
text: (_c = (_b = el.textContent) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : "",
|
|
974
1041
|
segment,
|
|
975
1042
|
index,
|
|
976
|
-
rect:
|
|
1043
|
+
rect: localFrame.measure(el, origins),
|
|
977
1044
|
point,
|
|
978
1045
|
};
|
|
979
1046
|
elements.push(label);
|
|
@@ -981,7 +1048,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
981
1048
|
svgRoot.querySelectorAll('g[id="axis"] line').forEach((line) => {
|
|
982
1049
|
var _a;
|
|
983
1050
|
const styleClass = ((_a = line.getAttribute("class")) !== null && _a !== void 0 ? _a : "").split(/\s+/).find((cls) => cls.startsWith("axis-"));
|
|
984
|
-
const rect =
|
|
1051
|
+
const rect = localFrame.measure(line, origins);
|
|
985
1052
|
const axis = {
|
|
986
1053
|
kind: "axis",
|
|
987
1054
|
style: styleClass === null || styleClass === void 0 ? void 0 : styleClass.slice("axis-".length),
|
|
@@ -1003,7 +1070,7 @@ function collectChartSegmentElements(svgRoot, segment, origins) {
|
|
|
1003
1070
|
role: hasClass$1(textEl, "categories") ? "title" : "category",
|
|
1004
1071
|
text,
|
|
1005
1072
|
segment,
|
|
1006
|
-
rect:
|
|
1073
|
+
rect: localFrame.measure(textEl, origins),
|
|
1007
1074
|
};
|
|
1008
1075
|
elements.push(label);
|
|
1009
1076
|
});
|
|
@@ -1031,7 +1098,7 @@ function countPrimaryDataPoints(svgRoot) {
|
|
|
1031
1098
|
*/
|
|
1032
1099
|
function collectChartFacadeLayout(host, innerTag, segments, origins, detail) {
|
|
1033
1100
|
var _a, _b;
|
|
1034
|
-
const layout = { regions: [], barCount: 0 };
|
|
1101
|
+
const layout = { regions: [], barCount: 0, baseline: {} };
|
|
1035
1102
|
const elements = [];
|
|
1036
1103
|
const inners = Array.from((_b = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(innerTag)) !== null && _b !== void 0 ? _b : []);
|
|
1037
1104
|
inners.forEach((inner, index) => {
|
|
@@ -1039,9 +1106,11 @@ function collectChartFacadeLayout(host, innerTag, segments, origins, detail) {
|
|
|
1039
1106
|
const segment = (_a = segments[index]) !== null && _a !== void 0 ? _a : `segment${index}`;
|
|
1040
1107
|
const svg = (_b = inner.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("svg#drawCanvas");
|
|
1041
1108
|
if (svg) {
|
|
1042
|
-
layout.regions.push({ id: `canvas:${segment}`, rect:
|
|
1043
|
-
if (index === 0)
|
|
1109
|
+
layout.regions.push({ id: `canvas:${segment}`, rect: localFrame.measure(svg, origins) });
|
|
1110
|
+
if (index === 0) {
|
|
1044
1111
|
layout.barCount = countPrimaryDataPoints(svg);
|
|
1112
|
+
layout.baseline = readSvgBaseline(svg, host);
|
|
1113
|
+
}
|
|
1045
1114
|
if (detail === "full") {
|
|
1046
1115
|
elements.push(...collectChartSegmentElements(svg, segment, origins));
|
|
1047
1116
|
}
|
|
@@ -1050,7 +1119,7 @@ function collectChartFacadeLayout(host, innerTag, segments, origins, detail) {
|
|
|
1050
1119
|
const footer = (_c = inner.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector(".footer");
|
|
1051
1120
|
const footerText = (_d = footer === null || footer === void 0 ? void 0 : footer.textContent) === null || _d === void 0 ? void 0 : _d.trim();
|
|
1052
1121
|
if (footerText) {
|
|
1053
|
-
elements.push({ kind: "label", role: "footer", text: footerText, segment, rect:
|
|
1122
|
+
elements.push({ kind: "label", role: "footer", text: footerText, segment, rect: localFrame.measure(footer, origins) });
|
|
1054
1123
|
}
|
|
1055
1124
|
}
|
|
1056
1125
|
});
|
|
@@ -1067,7 +1136,7 @@ function collectChartFacadeLayout(host, innerTag, segments, origins, detail) {
|
|
|
1067
1136
|
function collectXYElements(svgRoot, origins) {
|
|
1068
1137
|
const elements = [];
|
|
1069
1138
|
svgRoot.querySelectorAll("circle, ellipse").forEach((mark, index) => {
|
|
1070
|
-
const point = { kind: "point", index, rect:
|
|
1139
|
+
const point = { kind: "point", index, rect: localFrame.measure(mark, origins), point: readLayoutPoint(mark) };
|
|
1071
1140
|
elements.push(point);
|
|
1072
1141
|
});
|
|
1073
1142
|
svgRoot.querySelectorAll('rect[data-bn-part="element"]').forEach((mark, index) => {
|
|
@@ -1078,7 +1147,7 @@ function collectXYElements(svgRoot, origins) {
|
|
|
1078
1147
|
segment: "base",
|
|
1079
1148
|
scenario: point === null || point === void 0 ? void 0 : point.scenario,
|
|
1080
1149
|
index: (_a = ownIndex(mark)) !== null && _a !== void 0 ? _a : index,
|
|
1081
|
-
rect:
|
|
1150
|
+
rect: localFrame.measure(mark, origins),
|
|
1082
1151
|
point,
|
|
1083
1152
|
};
|
|
1084
1153
|
elements.push(bar);
|
|
@@ -1092,7 +1161,7 @@ function collectXYElements(svgRoot, origins) {
|
|
|
1092
1161
|
kind: "label",
|
|
1093
1162
|
role: "data",
|
|
1094
1163
|
text,
|
|
1095
|
-
rect:
|
|
1164
|
+
rect: localFrame.measure(textEl, origins),
|
|
1096
1165
|
point: readLayoutPoint(textEl),
|
|
1097
1166
|
};
|
|
1098
1167
|
elements.push(label);
|
|
@@ -1109,18 +1178,19 @@ function collectXYFacadeState(host, innerTag, title, em, origins, detail) {
|
|
|
1109
1178
|
const state = {
|
|
1110
1179
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
1111
1180
|
tag: host.localName,
|
|
1112
|
-
id:
|
|
1181
|
+
id: localFrame.resolveStandaloneId(host),
|
|
1113
1182
|
slot: (_a = host.getAttribute("slot")) !== null && _a !== void 0 ? _a : undefined,
|
|
1114
|
-
rect:
|
|
1183
|
+
rect: localFrame.measure(host, origins),
|
|
1115
1184
|
em,
|
|
1116
1185
|
regions: [],
|
|
1117
1186
|
metadata: { title },
|
|
1118
|
-
diagnostics:
|
|
1187
|
+
diagnostics: localFrame.readDiagnostics(host),
|
|
1119
1188
|
};
|
|
1120
1189
|
const svg = (_d = (_c = (_b = host.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(innerTag)) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector("svg#drawCanvas");
|
|
1121
1190
|
if (svg) {
|
|
1122
|
-
state.regions.push({ id: "canvas", rect:
|
|
1191
|
+
state.regions.push({ id: "canvas", rect: localFrame.measure(svg, origins) });
|
|
1123
1192
|
state.metadata.pointCount = svg.querySelectorAll("circle, ellipse").length;
|
|
1193
|
+
state.baseline = readSvgBaseline(svg, host);
|
|
1124
1194
|
if (detail === "full") {
|
|
1125
1195
|
state.elements = collectXYElements(svg, origins);
|
|
1126
1196
|
}
|
|
@@ -2292,6 +2362,13 @@ const ChartBubble = class {
|
|
|
2292
2362
|
};
|
|
2293
2363
|
});
|
|
2294
2364
|
}
|
|
2365
|
+
/**
|
|
2366
|
+
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
2367
|
+
* top-left corner. `y` is the x axis (the bottom of the plot frame), `x` the y axis (its left edge), of the first panel when faceted. Empty before the chart has drawn.
|
|
2368
|
+
*/
|
|
2369
|
+
async getBaseline() {
|
|
2370
|
+
return readChartBaseline(this.element, "bn-chart-bubble-renderer");
|
|
2371
|
+
}
|
|
2295
2372
|
/**
|
|
2296
2373
|
* Lazily generates this chart's layout state: host box (context- and
|
|
2297
2374
|
* component-relative, CSS px), the canvas region, point count and
|
|
@@ -2303,7 +2380,7 @@ const ChartBubble = class {
|
|
|
2303
2380
|
async getLayoutState(options) {
|
|
2304
2381
|
var _a;
|
|
2305
2382
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
2306
|
-
const origins =
|
|
2383
|
+
const origins = localFrame.originsFor(this.element);
|
|
2307
2384
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
2308
2385
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
2309
2386
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -2409,7 +2486,7 @@ const ChartBubble = class {
|
|
|
2409
2486
|
return (index.h("bn-chart-bubble-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.chartTitle, x: x, y: y, size: size, share: share, compareFamily: this.prepareCompareFamily(), labels: this.prepareLabels(), legend: this.prepareLegend(), facet: facet, pointLevel: pointLevel, seriesLevel: this.prepareSeriesLevel(pointLevel), aspect: this.prepareAspect(), limit: this.prepareLimit(), filter: this.filter, sizeAreaPerUnit: this.prepareSizeAreaPerUnit(), styles: preparedStyle, i18n: preparedI18n, containerWidth: fullParentWidth, ruleSetConfig: this.ruleSetConfig(), errors: this.errors, translator: this.translateForInner }));
|
|
2410
2487
|
}
|
|
2411
2488
|
render() {
|
|
2412
|
-
return (index.h(index.Host, { key: '
|
|
2489
|
+
return (index.h(index.Host, { key: '2b15b5b4fc32db48b951e82ecc87f25b0afcc9f8', style: this.getFontStyles() }, index.h("div", { key: '210d8622e1785b8c882f9c9a2fa2072af0e857b6', class: "container" }, this.chartTemplate())));
|
|
2413
2490
|
}
|
|
2414
2491
|
get element() { return index.getElement(this); }
|
|
2415
2492
|
static get watchers() { return {
|
|
@@ -9992,7 +10069,8 @@ class XYFrame {
|
|
|
9992
10069
|
.stroke({
|
|
9993
10070
|
color: this.styles.axisStyles.ac.stroke,
|
|
9994
10071
|
width: withTranslation.strokeWidthPx(this.styles.scaleFactors.gridLineWidth, this.em),
|
|
9995
|
-
})
|
|
10072
|
+
})
|
|
10073
|
+
.attr(BASELINE_ATTRIBUTE, "frame");
|
|
9996
10074
|
}
|
|
9997
10075
|
/** Tick labels along the outer edges (no tick marks - template style). */
|
|
9998
10076
|
drawTickLabels(group, config) {
|
|
@@ -11800,6 +11878,13 @@ const ChartBullet = class {
|
|
|
11800
11878
|
};
|
|
11801
11879
|
});
|
|
11802
11880
|
}
|
|
11881
|
+
/**
|
|
11882
|
+
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
11883
|
+
* top-left corner. The vertical zero line gives `x` and its top end `y`. Empty before the chart has drawn.
|
|
11884
|
+
*/
|
|
11885
|
+
async getBaseline() {
|
|
11886
|
+
return readChartBaseline(this.element, "bn-chart-bullet-renderer");
|
|
11887
|
+
}
|
|
11803
11888
|
/**
|
|
11804
11889
|
* Lazily generates this chart's layout state: host box (context- and
|
|
11805
11890
|
* component-relative, CSS px), the canvas region and diagnostics. With
|
|
@@ -11811,7 +11896,7 @@ const ChartBullet = class {
|
|
|
11811
11896
|
async getLayoutState(options) {
|
|
11812
11897
|
var _a;
|
|
11813
11898
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
11814
|
-
const origins =
|
|
11899
|
+
const origins = localFrame.originsFor(this.element);
|
|
11815
11900
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
11816
11901
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
11817
11902
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -11891,7 +11976,7 @@ const ChartBullet = class {
|
|
|
11891
11976
|
return (index.h("bn-chart-bullet-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.chartTitle, actual: actual, target: target, ranges: ranges, normalizeMode: normalize, showVariances: this.prepareShowVariances(), level: this.prepareLevel(), order: this.prepareOrder(), limit: this.prepareLimit(), labels: this.prepareLabels(), filter: this.filter, styles: this.prepareStyle(), i18n: this.prepareI18n(), containerWidth: withTranslation.getParentDimensions(this.element).width, ruleSetConfig: this.ruleSetConfig(), errors: this.errors, translator: this.translateForInner }));
|
|
11892
11977
|
}
|
|
11893
11978
|
render() {
|
|
11894
|
-
return (index.h(index.Host, { key: '
|
|
11979
|
+
return (index.h(index.Host, { key: 'cdd2404977255a330652806671d1bea76c796769', style: this.getFontStyles() }, index.h("div", { key: '0b8cfeb6209083f9144c5824bceecb9b02578f02', class: "container" }, this.chartTemplate())));
|
|
11895
11980
|
}
|
|
11896
11981
|
get element() { return index.getElement(this); }
|
|
11897
11982
|
static get watchers() { return {
|
|
@@ -12303,7 +12388,8 @@ class BulletChart {
|
|
|
12303
12388
|
});
|
|
12304
12389
|
root
|
|
12305
12390
|
.line(plotX, rowsTop - 0.2 * em, plotX, rowsBottom + 0.2 * em)
|
|
12306
|
-
.stroke({ color: this.styles.axisStyles.ac.stroke, width: withTranslation.strokeWidthPx(factors.axisLineWidth, this.em) })
|
|
12391
|
+
.stroke({ color: this.styles.axisStyles.ac.stroke, width: withTranslation.strokeWidthPx(factors.axisLineWidth, this.em) })
|
|
12392
|
+
.attr(BASELINE_ATTRIBUTE, "axis");
|
|
12307
12393
|
// Stable, empty hook for a future annotation layer.
|
|
12308
12394
|
container.group().addClass("annotations");
|
|
12309
12395
|
}
|
|
@@ -13233,6 +13319,13 @@ const ChartScatter = class {
|
|
|
13233
13319
|
};
|
|
13234
13320
|
});
|
|
13235
13321
|
}
|
|
13322
|
+
/**
|
|
13323
|
+
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
13324
|
+
* top-left corner. `y` is the x axis (the bottom of the plot frame), `x` the y axis (its left edge), of the first panel when faceted. Empty before the chart has drawn.
|
|
13325
|
+
*/
|
|
13326
|
+
async getBaseline() {
|
|
13327
|
+
return readChartBaseline(this.element, "bn-chart-scatter-renderer");
|
|
13328
|
+
}
|
|
13236
13329
|
/**
|
|
13237
13330
|
* Lazily generates this chart's layout state: host box (context- and
|
|
13238
13331
|
* component-relative, CSS px), the canvas region, point count and
|
|
@@ -13244,7 +13337,7 @@ const ChartScatter = class {
|
|
|
13244
13337
|
async getLayoutState(options) {
|
|
13245
13338
|
var _a;
|
|
13246
13339
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
13247
|
-
const origins =
|
|
13340
|
+
const origins = localFrame.originsFor(this.element);
|
|
13248
13341
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
13249
13342
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
13250
13343
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -13331,7 +13424,7 @@ const ChartScatter = class {
|
|
|
13331
13424
|
return (index.h("bn-chart-scatter-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.chartTitle, x: x, y: y, iso: this.prepareIso(), labels: this.prepareLabels(), legend: this.prepareLegend(), facet: facet, pointLevel: pointLevel, seriesLevel: this.prepareSeriesLevel(pointLevel), aspect: this.prepareAspect(), limit: this.prepareLimit(), filter: this.filter, styles: preparedStyle, i18n: preparedI18n, containerWidth: fullParentWidth, ruleSetConfig: this.ruleSetConfig(), errors: this.errors, translator: this.translateForInner }));
|
|
13332
13425
|
}
|
|
13333
13426
|
render() {
|
|
13334
|
-
return (index.h(index.Host, { key: '
|
|
13427
|
+
return (index.h(index.Host, { key: '4947af836a9c76b089bc07fb1f4df8c248aa4f62', style: this.getFontStyles() }, index.h("div", { key: '16abbc30d255d224aefecf9e337d3b23d449828a', class: "container" }, this.chartTemplate())));
|
|
13335
13428
|
}
|
|
13336
13429
|
get element() { return index.getElement(this); }
|
|
13337
13430
|
static get watchers() { return {
|
|
@@ -14961,6 +15054,13 @@ const Chart$1 = class Chart {
|
|
|
14961
15054
|
const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === withStyled.StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
14962
15055
|
return (index.h("bn-chart-structure-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideCategories: this.prepareHideCategories(idx), pixelPerUnit: ppu, pixelPerPercentage: ppp, reportAutoScaling: this.handleAutoScalingReport, errors: this.errors, limit: this.prepareLimit(), styles: this.prepareStyle(), i18n: this.prepareI18n(), order: this.prepareOrder(), level: this.prepareLevel(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(idx), stackConfig: stackConfig, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
|
|
14963
15056
|
}
|
|
15057
|
+
/**
|
|
15058
|
+
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
15059
|
+
* top-left corner. The vertical value axis of the base segment gives `x` and its top end `y`. Empty before the chart has drawn.
|
|
15060
|
+
*/
|
|
15061
|
+
async getBaseline() {
|
|
15062
|
+
return readChartBaseline(this.element, "bn-chart-structure-renderer");
|
|
15063
|
+
}
|
|
14964
15064
|
/**
|
|
14965
15065
|
* Lazily generates this chart's layout state: host box (context- and
|
|
14966
15066
|
* component-relative, CSS px), one `canvas:<segment>` region per rendered
|
|
@@ -14973,7 +15073,7 @@ const Chart$1 = class Chart {
|
|
|
14973
15073
|
async getLayoutState(options) {
|
|
14974
15074
|
var _a, _b, _c, _d;
|
|
14975
15075
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
14976
|
-
const origins =
|
|
15076
|
+
const origins = localFrame.originsFor(this.element);
|
|
14977
15077
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
14978
15078
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
14979
15079
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -14985,9 +15085,9 @@ const Chart$1 = class Chart {
|
|
|
14985
15085
|
const state = {
|
|
14986
15086
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
14987
15087
|
tag: this.element.localName,
|
|
14988
|
-
id:
|
|
15088
|
+
id: localFrame.resolveStandaloneId(this.element),
|
|
14989
15089
|
slot: (_c = this.element.getAttribute("slot")) !== null && _c !== void 0 ? _c : undefined,
|
|
14990
|
-
rect:
|
|
15090
|
+
rect: localFrame.measure(this.element, origins),
|
|
14991
15091
|
em: { fontSizePx, appliedScaleFactor: factor },
|
|
14992
15092
|
regions: layout.regions,
|
|
14993
15093
|
metadata: {
|
|
@@ -14997,8 +15097,9 @@ const Chart$1 = class Chart {
|
|
|
14997
15097
|
barCount: layout.barCount,
|
|
14998
15098
|
hasNoData: layout.barCount === 0,
|
|
14999
15099
|
},
|
|
15000
|
-
diagnostics:
|
|
15100
|
+
diagnostics: localFrame.readDiagnostics(this.element),
|
|
15001
15101
|
scaling: this.resolveScalingInfo(fontSizePx),
|
|
15102
|
+
baseline: layout.baseline,
|
|
15002
15103
|
};
|
|
15003
15104
|
if (layout.elements)
|
|
15004
15105
|
state.elements = layout.elements;
|
|
@@ -15075,7 +15176,7 @@ const Chart$1 = class Chart {
|
|
|
15075
15176
|
scenariosArray = [...scenariosArray, ...variancesArray];
|
|
15076
15177
|
}
|
|
15077
15178
|
const fontStyles = this.getFontStyles();
|
|
15078
|
-
return (index.h(index.Host, { key: '
|
|
15179
|
+
return (index.h(index.Host, { key: '5018d7c289272f154a10d266210ae62c2ce8448e', style: fontStyles }, index.h("div", { key: '1229588dbef454c12e715fecf7489fe3a352db81', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
15079
15180
|
}
|
|
15080
15181
|
get element() { return index.getElement(this); }
|
|
15081
15182
|
static get watchers() { return {
|
|
@@ -18452,7 +18553,7 @@ const BnChartStructureRenderer = class {
|
|
|
18452
18553
|
const errorMsg = (_a = this.i18n.get("no-data")) !== null && _a !== void 0 ? _a : "No Data";
|
|
18453
18554
|
return (index.h(index.Host, { class: "no-data" }, index.h("div", { class: "empty-state" }, errorMsg)));
|
|
18454
18555
|
}
|
|
18455
|
-
return (index.h(index.Host, null, index.h("div", { innerHTML: (_b = this.pattern) === null || _b === void 0 ? void 0 : _b.toString(), class: "hidePatternContainer" }), index.h("div", { class: this.showMeasureScale ? "footer" : "footer-hide" }, (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getFooter()), index.h("div", { innerHTML: (_d = this.chart) === null || _d === void 0 ? void 0 : _d.toString() })));
|
|
18556
|
+
return (index.h(index.Host, null, index.h("div", { innerHTML: (_b = this.pattern) === null || _b === void 0 ? void 0 : _b.toString(), class: "hidePatternContainer", style: { width: "0", height: "0", overflow: "hidden" } }), index.h("div", { class: this.showMeasureScale ? "footer" : "footer-hide" }, (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getFooter()), index.h("div", { innerHTML: (_d = this.chart) === null || _d === void 0 ? void 0 : _d.toString() })));
|
|
18456
18557
|
}
|
|
18457
18558
|
/** Reports a failed query as the wrapper's `ERR_sql` item. Without it the chart would only show "No Data". */
|
|
18458
18559
|
syncQueryError() {
|
|
@@ -19683,6 +19784,13 @@ const Chart = class {
|
|
|
19683
19784
|
const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === withStyled.StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
19684
19785
|
return (index.h("bn-chart-time-renderer", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu, pixelPerPercentage: ppp, reportAutoScaling: this.handleAutoScalingReport, errors: this.errors, leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
|
|
19685
19786
|
}
|
|
19787
|
+
/**
|
|
19788
|
+
* The line this chart wants to be aligned on, in CSS px from the host's
|
|
19789
|
+
* top-left corner. A horizontal axis line gives `y` and its left end `x`. The category axis of the base segment sits at zero, so negative bars hang below it. Empty before the chart has drawn.
|
|
19790
|
+
*/
|
|
19791
|
+
async getBaseline() {
|
|
19792
|
+
return readChartBaseline(this.element, "bn-chart-time-renderer");
|
|
19793
|
+
}
|
|
19686
19794
|
/**
|
|
19687
19795
|
* Lazily generates this chart's layout state: host box (context- and
|
|
19688
19796
|
* component-relative, CSS px), one `canvas:<segment>` region per rendered
|
|
@@ -19695,7 +19803,7 @@ const Chart = class {
|
|
|
19695
19803
|
async getLayoutState(options) {
|
|
19696
19804
|
var _a, _b, _c, _d;
|
|
19697
19805
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
19698
|
-
const origins =
|
|
19806
|
+
const origins = localFrame.originsFor(this.element);
|
|
19699
19807
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
19700
19808
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
19701
19809
|
const factor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -19707,9 +19815,9 @@ const Chart = class {
|
|
|
19707
19815
|
const state = {
|
|
19708
19816
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
19709
19817
|
tag: this.element.localName,
|
|
19710
|
-
id:
|
|
19818
|
+
id: localFrame.resolveStandaloneId(this.element),
|
|
19711
19819
|
slot: (_c = this.element.getAttribute("slot")) !== null && _c !== void 0 ? _c : undefined,
|
|
19712
|
-
rect:
|
|
19820
|
+
rect: localFrame.measure(this.element, origins),
|
|
19713
19821
|
em: { fontSizePx, appliedScaleFactor: factor },
|
|
19714
19822
|
regions: layout.regions,
|
|
19715
19823
|
metadata: {
|
|
@@ -19720,8 +19828,9 @@ const Chart = class {
|
|
|
19720
19828
|
chartMode: this.chartMode || undefined,
|
|
19721
19829
|
hasNoData: layout.barCount === 0,
|
|
19722
19830
|
},
|
|
19723
|
-
diagnostics:
|
|
19831
|
+
diagnostics: localFrame.readDiagnostics(this.element),
|
|
19724
19832
|
scaling: this.resolveScalingInfo(fontSizePx),
|
|
19833
|
+
baseline: layout.baseline,
|
|
19725
19834
|
};
|
|
19726
19835
|
if (layout.elements)
|
|
19727
19836
|
state.elements = layout.elements;
|
|
@@ -19799,7 +19908,7 @@ const Chart = class {
|
|
|
19799
19908
|
scenariosArray = [...scenariosArray, ...variancesArray];
|
|
19800
19909
|
}
|
|
19801
19910
|
const fontStyles = this.getFontStyles();
|
|
19802
|
-
return (index.h(index.Host, { key: '
|
|
19911
|
+
return (index.h(index.Host, { key: '959245cc54fe058c46e1c2ae07c454b52cf280bc', style: fontStyles }, index.h("div", { key: '8c2d94dd9192696388f2137a055aff013abfe0db', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
19803
19912
|
}
|
|
19804
19913
|
get element() { return index.getElement(this); }
|
|
19805
19914
|
static get watchers() { return {
|
|
@@ -23769,7 +23878,7 @@ const BnChartTimeRenderer = class {
|
|
|
23769
23878
|
const errorMsg = (_a = this.i18n.get("no-data")) !== null && _a !== void 0 ? _a : "No Data";
|
|
23770
23879
|
return (index.h(index.Host, { class: "no-data" }, index.h("div", { class: "empty-state" }, errorMsg)));
|
|
23771
23880
|
}
|
|
23772
|
-
return (index.h(index.Host, null, index.h("div", { innerHTML: (_b = this.pattern) === null || _b === void 0 ? void 0 : _b.toString(), class: "hidePatternContainer" }), index.h("div", { class: this.showMeasureScale ? "footer" : "footer-hide" }, (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getFooter()), index.h("div", { innerHTML: (_d = this.chart) === null || _d === void 0 ? void 0 : _d.toString() })));
|
|
23881
|
+
return (index.h(index.Host, null, index.h("div", { innerHTML: (_b = this.pattern) === null || _b === void 0 ? void 0 : _b.toString(), class: "hidePatternContainer", style: { width: "0", height: "0", overflow: "hidden" } }), index.h("div", { class: this.showMeasureScale ? "footer" : "footer-hide" }, (_c = this.chart) === null || _c === void 0 ? void 0 : _c.getFooter()), index.h("div", { innerHTML: (_d = this.chart) === null || _d === void 0 ? void 0 : _d.toString() })));
|
|
23773
23882
|
}
|
|
23774
23883
|
/** Reports a failed query as the wrapper's `ERR_sql` item. Without it the chart would only show "No Data". */
|
|
23775
23884
|
syncQueryError() {
|
|
@@ -24290,7 +24399,7 @@ const Context = class {
|
|
|
24290
24399
|
return fallback;
|
|
24291
24400
|
}
|
|
24292
24401
|
}));
|
|
24293
|
-
const ids =
|
|
24402
|
+
const ids = localFrame.assignIds(hosts.map((el) => ({ tag: el.localName, explicitId: localFrame.resolveOwnIdentity(el) })));
|
|
24294
24403
|
components.forEach((state, index) => {
|
|
24295
24404
|
state.id = ids[index];
|
|
24296
24405
|
});
|
|
@@ -24299,7 +24408,7 @@ const Context = class {
|
|
|
24299
24408
|
generatedAt: new Date().toISOString(),
|
|
24300
24409
|
detail,
|
|
24301
24410
|
context: {
|
|
24302
|
-
viewport:
|
|
24411
|
+
viewport: localFrame.toLayoutRect(contextRect),
|
|
24303
24412
|
locale: (_b = this.stores) === null || _b === void 0 ? void 0 : _b.context.state.locale,
|
|
24304
24413
|
},
|
|
24305
24414
|
components,
|
|
@@ -27783,6 +27892,19 @@ const Table$1 = class Table {
|
|
|
27783
27892
|
};
|
|
27784
27893
|
return dataSetStructure;
|
|
27785
27894
|
}
|
|
27895
|
+
/**
|
|
27896
|
+
* The line this table wants to be aligned on, in CSS px from the host's
|
|
27897
|
+
* top-left corner: `y` is the bottom of the header, `x` the left edge of
|
|
27898
|
+
* the first value column. Empty before the table has drawn.
|
|
27899
|
+
*/
|
|
27900
|
+
async getBaseline() {
|
|
27901
|
+
return this.readBaseline();
|
|
27902
|
+
}
|
|
27903
|
+
readBaseline() {
|
|
27904
|
+
var _a, _b, _c;
|
|
27905
|
+
const table = (_c = (_b = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("bn-table-renderer")) === null || _b === void 0 ? void 0 : _b.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("table");
|
|
27906
|
+
return readTableBaseline(table, this.element);
|
|
27907
|
+
}
|
|
27786
27908
|
/**
|
|
27787
27909
|
* Lazily generates this table's layout state: host box (context- and
|
|
27788
27910
|
* component-relative, CSS px), header/body regions, row/column/cell counts,
|
|
@@ -27794,7 +27916,7 @@ const Table$1 = class Table {
|
|
|
27794
27916
|
async getLayoutState(options) {
|
|
27795
27917
|
var _a, _b, _c, _d;
|
|
27796
27918
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
27797
|
-
const origins =
|
|
27919
|
+
const origins = localFrame.originsFor(this.element);
|
|
27798
27920
|
const rawFactor = this.getEffectiveScaleFactor();
|
|
27799
27921
|
// Auto-scale can be mid-measurement (or unmeasurable in tests) - report a sane factor.
|
|
27800
27922
|
const effectiveFactor = Number.isFinite(rawFactor) && rawFactor > 0 ? rawFactor : 1;
|
|
@@ -27802,14 +27924,15 @@ const Table$1 = class Table {
|
|
|
27802
27924
|
const state = {
|
|
27803
27925
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
27804
27926
|
tag: this.element.localName,
|
|
27805
|
-
id:
|
|
27927
|
+
id: localFrame.resolveStandaloneId(this.element),
|
|
27806
27928
|
slot: (_b = this.element.getAttribute("slot")) !== null && _b !== void 0 ? _b : undefined,
|
|
27807
|
-
rect:
|
|
27929
|
+
rect: localFrame.measure(this.element, origins),
|
|
27808
27930
|
em: { fontSizePx, appliedScaleFactor: effectiveFactor },
|
|
27809
27931
|
regions: [],
|
|
27810
27932
|
metadata: {},
|
|
27811
|
-
diagnostics:
|
|
27933
|
+
diagnostics: localFrame.readDiagnostics(this.element),
|
|
27812
27934
|
scaling: this.resolveScalingInfo(fontSizePx),
|
|
27935
|
+
baseline: this.readBaseline(),
|
|
27813
27936
|
};
|
|
27814
27937
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27815
27938
|
const inner = (_c = this.element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("bn-table-renderer");
|
|
@@ -27892,7 +28015,7 @@ const Table$1 = class Table {
|
|
|
27892
28015
|
render() {
|
|
27893
28016
|
const fontStyles = this.getFontStyles();
|
|
27894
28017
|
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
27895
|
-
return (index.h(index.Host, { key: '
|
|
28018
|
+
return (index.h(index.Host, { key: '3110b347db709058dbdf329ac4fd0aaa8d72d2e2', style: fontStyles }, index.h("div", { key: 'e4dd33f91433c45b3ca185291f10286df88c0449' }, index.h("bn-table-renderer", { key: '02ad73dbe3c97320e97face0432ccf592c0265d0', tableName: this.datasetName, dataVersion: this.dataVersion, sumTitle: this.prepareSumTitle(), scenarios: this.prepareScenarios(), scenariosDataFormat: this.prepareDataFormat(), grouped: this.prepareGrouped(), limit: this.prepareLimit(), showGroupTitle: this.prepareShowGroupTitle(), thereof: this.prepareThereOf(), partof: this.preparePartOf(), order: this.prepareOrder(), categorythereof: this.prepareColumnThereOf(), attributeColumns: this.prepareAttributes(), type: this.prepareTableType(), categoryWidth: this.prepareCategoryWidth(), dataFormatDigits: this.prepareDataFormatDigits(), i18n: this.prepareI18n(), i18nMode: this.prepareI18nMode(), measureScale: this.prepareMeasureScale(), measureType: this.prepareMeasureType(), measureUnit: this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(), filter: this.prepareFilter(), barColumns: this.prepareBarColumns(), interval: this.prepareInterval(), barColumnMaxWidth: this.prepareBarColumnWidth(), unitScaling: this.prepareUnitScaling(), percentageScaling: this.preparePercentageScaling(), reportAutoScaling: this.handleAutoScalingReport, errors: this.errors, scaleFactor: effectiveFactor, ruleSetConfig: this.ruleSetConfig(), selectedStyle: this.selectedStyle }))));
|
|
27896
28019
|
}
|
|
27897
28020
|
get element() { return index.getElement(this); }
|
|
27898
28021
|
static get watchers() { return {
|
|
@@ -30920,9 +31043,9 @@ const BnTableRenderer = class {
|
|
|
30920
31043
|
const thead = tableEl.querySelector("thead");
|
|
30921
31044
|
const tbody = tableEl.querySelector("tbody");
|
|
30922
31045
|
if (thead)
|
|
30923
|
-
result.regions.push({ id: "header", rect:
|
|
31046
|
+
result.regions.push({ id: "header", rect: localFrame.measure(thead, origins) });
|
|
30924
31047
|
if (tbody)
|
|
30925
|
-
result.regions.push({ id: "body", rect:
|
|
31048
|
+
result.regions.push({ id: "body", rect: localFrame.measure(tbody, origins) });
|
|
30926
31049
|
const headerRows = this.table.getHeader();
|
|
30927
31050
|
const bodyRows = this.table.getBody();
|
|
30928
31051
|
const columns = this.table.getColumns();
|
|
@@ -30945,7 +31068,7 @@ const BnTableRenderer = class {
|
|
|
30945
31068
|
section,
|
|
30946
31069
|
index: rowIndex,
|
|
30947
31070
|
type: row.type,
|
|
30948
|
-
rect:
|
|
31071
|
+
rect: localFrame.measure(tr, origins),
|
|
30949
31072
|
point: readLayoutPoint(tr),
|
|
30950
31073
|
});
|
|
30951
31074
|
const cells = row.getCells();
|
|
@@ -30970,12 +31093,12 @@ const BnTableRenderer = class {
|
|
|
30970
31093
|
value: (_a = cell.value) !== null && _a !== void 0 ? _a : undefined,
|
|
30971
31094
|
text: ((_b = domCell.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || undefined,
|
|
30972
31095
|
type: cell.type || undefined,
|
|
30973
|
-
rect:
|
|
31096
|
+
rect: localFrame.measure(domCell, origins),
|
|
30974
31097
|
point: readLayoutPoint(domCell),
|
|
30975
31098
|
};
|
|
30976
31099
|
if (entry.point) {
|
|
30977
|
-
entry.content =
|
|
30978
|
-
entry.contentSign =
|
|
31100
|
+
entry.content = localFrame.measureContent(domCell, origins);
|
|
31101
|
+
entry.contentSign = localFrame.measureSign(domCell) || undefined;
|
|
30979
31102
|
}
|
|
30980
31103
|
const barSvg = domCell.querySelector("svg.cell-bar-chart");
|
|
30981
31104
|
if (barSvg) {
|
|
@@ -30985,7 +31108,7 @@ const BnTableRenderer = class {
|
|
|
30985
31108
|
: barSvg.classList.contains("relative-variance")
|
|
30986
31109
|
? "relative"
|
|
30987
31110
|
: "absolute",
|
|
30988
|
-
rect:
|
|
31111
|
+
rect: localFrame.measure(barSvg, origins),
|
|
30989
31112
|
};
|
|
30990
31113
|
}
|
|
30991
31114
|
elements.push(entry);
|
|
@@ -32747,25 +32870,25 @@ const ChartTree = class {
|
|
|
32747
32870
|
async getLayoutState(options) {
|
|
32748
32871
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
32749
32872
|
const detail = (_a = options === null || options === void 0 ? void 0 : options.detail) !== null && _a !== void 0 ? _a : "summary";
|
|
32750
|
-
const origins =
|
|
32873
|
+
const origins = localFrame.originsFor(this.element);
|
|
32751
32874
|
const fontSizePx = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
32752
32875
|
const state = {
|
|
32753
32876
|
version: index$1.LAYOUT_STATE_VERSION,
|
|
32754
32877
|
tag: this.element.localName,
|
|
32755
|
-
id:
|
|
32878
|
+
id: localFrame.resolveStandaloneId(this.element),
|
|
32756
32879
|
slot: (_b = this.element.getAttribute("slot")) !== null && _b !== void 0 ? _b : undefined,
|
|
32757
|
-
rect:
|
|
32880
|
+
rect: localFrame.measure(this.element, origins),
|
|
32758
32881
|
em: { fontSizePx, appliedScaleFactor: 1 },
|
|
32759
32882
|
regions: [],
|
|
32760
32883
|
metadata: {
|
|
32761
32884
|
nodeCount: (_d = (_c = this.treeConfig) === null || _c === void 0 ? void 0 : _c.allNodes.size) !== null && _d !== void 0 ? _d : 0,
|
|
32762
32885
|
edgeCount: (_f = (_e = this.treeConfig) === null || _e === void 0 ? void 0 : _e.edges.length) !== null && _f !== void 0 ? _f : 0,
|
|
32763
32886
|
},
|
|
32764
|
-
diagnostics:
|
|
32887
|
+
diagnostics: localFrame.readDiagnostics(this.element),
|
|
32765
32888
|
};
|
|
32766
32889
|
const grid = (_g = this.element.shadowRoot) === null || _g === void 0 ? void 0 : _g.querySelector(".tree-grid");
|
|
32767
32890
|
if (grid)
|
|
32768
|
-
state.regions.push({ id: "grid", rect:
|
|
32891
|
+
state.regions.push({ id: "grid", rect: localFrame.measure(grid, origins) });
|
|
32769
32892
|
if (detail !== "full" || !this.treeConfig) {
|
|
32770
32893
|
return state;
|
|
32771
32894
|
}
|
|
@@ -32774,7 +32897,7 @@ const ChartTree = class {
|
|
|
32774
32897
|
const slotted = this.element.querySelector(`[slot="${nodeId}"]`);
|
|
32775
32898
|
if (!slotted)
|
|
32776
32899
|
continue;
|
|
32777
|
-
const node = { kind: "node", nodeId, rect:
|
|
32900
|
+
const node = { kind: "node", nodeId, rect: localFrame.measure(slotted, origins) };
|
|
32778
32901
|
elements.push(node);
|
|
32779
32902
|
}
|
|
32780
32903
|
// Pair model edges with the rendered paths, replicating renderEdges()'s
|
|
@@ -32793,7 +32916,7 @@ const ChartTree = class {
|
|
|
32793
32916
|
to: edge.to,
|
|
32794
32917
|
operator: edge.operator,
|
|
32795
32918
|
path: (_k = pathEl.getAttribute("d")) !== null && _k !== void 0 ? _k : undefined,
|
|
32796
|
-
rect:
|
|
32919
|
+
rect: localFrame.measure(pathEl, origins),
|
|
32797
32920
|
};
|
|
32798
32921
|
elements.push(edgeElement);
|
|
32799
32922
|
}
|
|
@@ -32802,7 +32925,7 @@ const ChartTree = class {
|
|
|
32802
32925
|
const text = (_b = (_a = group.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "";
|
|
32803
32926
|
if (!text)
|
|
32804
32927
|
return;
|
|
32805
|
-
const operator = { kind: "label", role: "operator", text, rect:
|
|
32928
|
+
const operator = { kind: "label", role: "operator", text, rect: localFrame.measure(group, origins) };
|
|
32806
32929
|
elements.push(operator);
|
|
32807
32930
|
});
|
|
32808
32931
|
state.elements = elements;
|