@bino-bi/bn-template-engine 1.0.0-next.21 → 1.0.0-next.22
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-99477a27.entry.js → p-445c76cd.entry.js} +1 -1
- package/dist/bn-template-engine/p-7d1083f6.entry.js +1 -0
- package/dist/bn-template-engine/{p-7e9dbc93.entry.js → p-91e5dddf.entry.js} +1 -1
- package/dist/bn-template-engine/{p-b9e94127.entry.js → p-93eaded3.entry.js} +1 -1
- package/dist/bn-template-engine/{p-BpWWgN6k.js → p-D1SJ10zl.js} +1 -1
- package/dist/bn-template-engine/p-D75i_YOP.js +1 -0
- package/dist/bn-template-engine/{p-A8xyE4b1.js → p-Da6p_F4J.js} +1 -1
- package/dist/bn-template-engine/{p-a1380d7c.entry.js → p-c3383557.entry.js} +1 -1
- package/dist/bn-template-engine/{p-ba912130.entry.js → p-cda4322a.entry.js} +1 -1
- package/dist/bn-template-engine/{p-6c7f0076.entry.js → p-e49f9170.entry.js} +1 -1
- package/dist/bn-template-engine/{p-6077155f.entry.js → p-f275b9fe.entry.js} +1 -1
- package/dist/cjs/bn-asset_21.cjs.entry.js +369 -122
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +18 -8
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +3 -3
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +3 -3
- package/dist/cjs/bn-grid.cjs.entry.js +1 -1
- package/dist/cjs/bn-image.cjs.entry.js +1 -1
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +2 -2
- package/dist/cjs/bn-tree.cjs.entry.js +1 -1
- package/dist/cjs/{layoutObserver-DUYYkDMQ.js → layoutObserver-D8leSb4j.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-BIJQ2NV1.js → scaling-B6_M_HWH.js} +82 -0
- package/dist/cjs/{withStyled-Cm9dWQhu.js → withStyled-DuwvaDMp.js} +3 -3
- package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +15 -5
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +81 -39
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +34 -0
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +80 -35
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +34 -0
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +76 -19
- package/dist/collection/components/bn-table/bn-table.js +111 -45
- package/dist/collection/components/bn-table/ibcs-table.js +37 -2
- package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +2 -2
- package/dist/collection/utils/dataAnalyzer.js +17 -8
- package/dist/collection/utils/scaling.js +79 -0
- package/dist/collection/utils/validate.js +3 -3
- package/dist/components/DataFormatDigits.js +1 -1
- package/dist/components/bn-chart-bubble.js +1 -1
- package/dist/components/bn-chart-bullet.js +1 -1
- package/dist/components/bn-chart-scatter.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-grid.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- 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/scaling.js +1 -0
- package/dist/components/validate.js +1 -1
- package/dist/components/withDataset.js +1 -1
- package/dist/components/withStyled.js +1 -1
- package/dist/esm/bn-asset_21.entry.js +369 -122
- package/dist/esm/bn-chart-bubble.entry.js +18 -8
- package/dist/esm/bn-chart-bullet.entry.js +3 -3
- package/dist/esm/bn-chart-scatter.entry.js +3 -3
- package/dist/esm/bn-grid.entry.js +1 -1
- package/dist/esm/bn-image.entry.js +1 -1
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +2 -2
- package/dist/esm/bn-tree.entry.js +1 -1
- package/dist/esm/{layoutObserver-BJBEyhNf.js → layoutObserver-DtZb2vdM.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-BGnpSN1j.js → scaling-Bw8XyrFq.js} +80 -1
- package/dist/esm/{withStyled-2l5Tx3cf.js → withStyled-41rsCSM1.js} +3 -3
- package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +5 -2
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +33 -16
- package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +35 -18
- package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -0
- package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +28 -8
- package/dist/types/components/bn-table/bn-table.d.ts +37 -17
- package/dist/types/components/bn-table/ibcs-table.d.ts +8 -0
- package/dist/types/components.d.ts +85 -51
- package/dist/types/utils/dataAnalyzer.d.ts +5 -1
- package/dist/types/utils/scaling.d.ts +63 -0
- package/dist/types/utils/validate.d.ts +2 -2
- package/package.json +1 -1
- package/readme.md +2 -0
- package/dist/bn-template-engine/p-C9i1Xsib.js +0 -1
- package/dist/bn-template-engine/p-b5274369.entry.js +0 -1
|
@@ -16,6 +16,7 @@ import { BulletLabelConfig, BulletMeasureConfig } from "./components/bn-chart-bu
|
|
|
16
16
|
import { AggregationLevel, AxisLabelsMode, ChartMode, DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "./utils/constants";
|
|
17
17
|
import { Order } from "./utils/model/Order";
|
|
18
18
|
import { BulletChartStyle } from "./components/bn-chart-bullet/utils/model/BulletChartStyle";
|
|
19
|
+
import { AutoScalingReport } from "./utils/scaling";
|
|
19
20
|
import { StructureChartStyle } from "./components/bn-chart-structure/utils/model/styles/StructureChartStyle";
|
|
20
21
|
import { DataFormatDigits } from "./utils/model/DataFormatDigits";
|
|
21
22
|
import { StackConfigParsed } from "./components/bn-chart-structure/utils/model/StructureChartComponentConfig";
|
|
@@ -39,6 +40,7 @@ export { BulletLabelConfig, BulletMeasureConfig } from "./components/bn-chart-bu
|
|
|
39
40
|
export { AggregationLevel, AxisLabelsMode, ChartMode, DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "./utils/constants";
|
|
40
41
|
export { Order } from "./utils/model/Order";
|
|
41
42
|
export { BulletChartStyle } from "./components/bn-chart-bullet/utils/model/BulletChartStyle";
|
|
43
|
+
export { AutoScalingReport } from "./utils/scaling";
|
|
42
44
|
export { StructureChartStyle } from "./components/bn-chart-structure/utils/model/styles/StructureChartStyle";
|
|
43
45
|
export { DataFormatDigits } from "./utils/model/DataFormatDigits";
|
|
44
46
|
export { StackConfigParsed } from "./components/bn-chart-structure/utils/model/StructureChartComponentConfig";
|
|
@@ -366,8 +368,8 @@ export namespace Components {
|
|
|
366
368
|
*/
|
|
367
369
|
"orderDirection": string;
|
|
368
370
|
/**
|
|
369
|
-
*
|
|
370
|
-
* @example percentage-scaling="
|
|
371
|
+
* Percentage points displayed per 1 em of bar length for relative variances — a larger value means shorter bars. | Value | Behavior | |-------------------|---------------------------------------------------------------| | `"auto"` | Auto-fit to available width | | not set / invalid | Same as auto with `AUTO_percentageScaling` warning | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
372
|
+
* @example percentage-scaling="10"
|
|
371
373
|
* @example percentage-scaling="pct-scale"
|
|
372
374
|
*/
|
|
373
375
|
"percentageScaling": string | number;
|
|
@@ -404,9 +406,9 @@ export namespace Components {
|
|
|
404
406
|
*/
|
|
405
407
|
"stack": string;
|
|
406
408
|
/**
|
|
407
|
-
*
|
|
409
|
+
* Data units displayed per 1 em of bar length (horizontal bars) — map-scale semantics: a larger value means smaller bars. | Value | Behavior | |--------------------|-------------------------------------------------------------| | `"auto"` | Auto-fit bars to fill the available container width | | not set / invalid | Same as auto, but emits `AUTO_unitScaling` warning | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | When using a custom value that causes the chart to exceed its container, a `WARN_overflow` error is emitted.
|
|
408
410
|
* @example unit-scaling="auto"
|
|
409
|
-
* @example unit-scaling="
|
|
411
|
+
* @example unit-scaling="1M"
|
|
410
412
|
* @example unit-scaling="revenue-scale"
|
|
411
413
|
*/
|
|
412
414
|
"unitScaling": string | number;
|
|
@@ -475,7 +477,7 @@ export namespace Components {
|
|
|
475
477
|
*/
|
|
476
478
|
"maxBars": number;
|
|
477
479
|
/**
|
|
478
|
-
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p //
|
|
480
|
+
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST``` <br /><br /> SiPrefix overview: ``` "Y": 1E+24,```<br /> ``` "Z": 1E+21,```<br /> ``` "E": 1E+18,```<br /> ``` "P": 1E+15,```<br /> ``` "T": 1E+12,```<br /> ``` "G": 1000000000,```<br /> ``` "M": 1000000,```<br /> ``` "k": 1000,```<br /> <br /> ``` "m": 0.001,```<br /> ``` "my" (μ): 0.000001,```<br /> ``` "n": 0.000000001,```<br /> ``` "p": 0.000000000001,```<br /> ``` "f": 0.000000000000001,```<br /> ``` "a": 0.000000000000000001,```<br /> ``` "z": 0.000000000000000000001,```<br /> ``` "y": 0.000000000000000000000001,```<br /> <br /><br /> Special modes: ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br /> ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br /> <br /><br /> ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
479
481
|
* @default "greatest"
|
|
480
482
|
*/
|
|
481
483
|
"measureScale": string;
|
|
@@ -493,8 +495,8 @@ export namespace Components {
|
|
|
493
495
|
*/
|
|
494
496
|
"orderDirection": string;
|
|
495
497
|
/**
|
|
496
|
-
*
|
|
497
|
-
* @example percentage-scaling="
|
|
498
|
+
* Percentage points displayed per 1 em of pin/bar length for relative variances — a larger value means shorter pins. | Value | Behavior | |-------------------|---------------------------------------------------------------| | `"auto"` | Auto-fit to available height (same two-pass as unit-scaling) | | not set / invalid | Same as auto with `AUTO_percentageScaling` warning | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
499
|
+
* @example percentage-scaling="10"
|
|
498
500
|
* @example percentage-scaling="pct-scale"
|
|
499
501
|
*/
|
|
500
502
|
"percentageScaling": string | number;
|
|
@@ -539,9 +541,9 @@ export namespace Components {
|
|
|
539
541
|
*/
|
|
540
542
|
"syncSpaceLeft": number;
|
|
541
543
|
/**
|
|
542
|
-
*
|
|
544
|
+
* Data units displayed per 1 em of bar length (vertical bars) — map-scale semantics: a larger value means smaller bars. | Value | Behavior | |--------------------|-------------------------------------------------------------| | `"auto"` | Auto-fit bars to fill the available container height | | not set / invalid | Same as auto, but emits `AUTO_unitScaling` warning | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
543
545
|
* @example unit-scaling="auto"
|
|
544
|
-
* @example unit-scaling="
|
|
546
|
+
* @example unit-scaling="1M"
|
|
545
547
|
* @example unit-scaling="revenue-scale"
|
|
546
548
|
*/
|
|
547
549
|
"unitScaling": string | number;
|
|
@@ -996,23 +998,25 @@ export namespace Components {
|
|
|
996
998
|
}
|
|
997
999
|
/**
|
|
998
1000
|
* Defines a named scaling value that chart and table components can reference
|
|
999
|
-
* via their `unit-scaling` or `percentage-scaling` attributes
|
|
1001
|
+
* via their `unit-scaling` or `percentage-scaling` attributes, or a bubble
|
|
1002
|
+
* chart via its `size` spec's `group` key.
|
|
1000
1003
|
* Multiple components sharing the same group name will use the same scaling
|
|
1001
1004
|
* value, allowing synchronized scaling across an entire page or section.
|
|
1002
|
-
* The reserved name `"auto"` is not allowed and
|
|
1003
|
-
*
|
|
1005
|
+
* The reserved name `"auto"` is not allowed, and neither is a name that would
|
|
1006
|
+
* parse as a number/SI value (e.g. `"1M"`); both are rejected with a warning.
|
|
1007
|
+
* @example <bn-scaling-group name="revenue" value="250k"></bn-scaling-group>
|
|
1004
1008
|
* <bn-chart-structure unit-scaling="revenue" ...></bn-chart-structure>
|
|
1005
1009
|
* <bn-table unit-scaling="revenue" ...></bn-table>
|
|
1006
1010
|
*/
|
|
1007
1011
|
interface BnScalingGroup {
|
|
1008
1012
|
/**
|
|
1009
|
-
* Unique name identifying this scaling group. Components reference this name in their `unit-scaling` or `percentage-scaling` attributes. The name `"auto"` is reserved and
|
|
1013
|
+
* Unique name identifying this scaling group. Components reference this name in their `unit-scaling` or `percentage-scaling` attributes, or in a bubble chart's `size.group`. The name `"auto"` is reserved, and names that parse as a number/SI value (`"100"`, `"1M"`) are rejected — they would be ambiguous with a literal scaling value.
|
|
1010
1014
|
*/
|
|
1011
1015
|
"name": string;
|
|
1012
1016
|
/**
|
|
1013
|
-
* The scaling value (
|
|
1017
|
+
* The scaling value: a positive number with optional SI suffix (`k`/`K` = 1e3, `M` = 1e6, `G` = 1e9, `T` = 1e12), e.g. `"250k"` or `2.5`. The unit depends on which attribute references this group: - from `unit-scaling`: data units per 1 em of bar length - from `percentage-scaling`: percentage points per 1 em of pin length - from a bubble chart's `size.group`: data units per 1 em² of bubble area
|
|
1014
1018
|
*/
|
|
1015
|
-
"value": number;
|
|
1019
|
+
"value": string | number;
|
|
1016
1020
|
}
|
|
1017
1021
|
/**
|
|
1018
1022
|
* Public-facing wrapper for the IBCS table component.
|
|
@@ -1078,7 +1082,7 @@ export namespace Components {
|
|
|
1078
1082
|
*/
|
|
1079
1083
|
"limit": number;
|
|
1080
1084
|
/**
|
|
1081
|
-
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p //
|
|
1085
|
+
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST``` <br /><br /> SiPrefix overview: ``` "Y": 1E+24,```<br /> ``` "Z": 1E+21,```<br /> ``` "E": 1E+18,```<br /> ``` "P": 1E+15,```<br /> ``` "T": 1E+12,```<br /> ``` "G": 1000000000,```<br /> ``` "M": 1000000,```<br /> ``` "k": 1000,```<br /> <br /> ``` "m": 0.001,```<br /> ``` "my" (μ): 0.000001,```<br /> ``` "n": 0.000000001,```<br /> ``` "p": 0.000000000001,```<br /> ``` "f": 0.000000000000001,```<br /> ``` "a": 0.000000000000000001,```<br /> ``` "z": 0.000000000000000000001,```<br /> ``` "y": 0.000000000000000000000001,```<br /> <br /><br /> Special modes: ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br /> ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br /> <br /><br /> ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
1082
1086
|
* @default "greatest"
|
|
1083
1087
|
*/
|
|
1084
1088
|
"measureScale": string;
|
|
@@ -1108,10 +1112,10 @@ export namespace Components {
|
|
|
1108
1112
|
*/
|
|
1109
1113
|
"partof": string;
|
|
1110
1114
|
/**
|
|
1111
|
-
*
|
|
1112
|
-
* @example percentage-scaling="
|
|
1115
|
+
* Percentage points displayed per 1 em of pin length for relative variance pin charts (ΔPY%) — a larger value means shorter pins. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest pin to the pin area | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_percentageScaling` warning | Default: `"2"` (a +2 % variance pin is 1 em long)
|
|
1116
|
+
* @example percentage-scaling="10"
|
|
1113
1117
|
* @example percentage-scaling="pct-scale"
|
|
1114
|
-
* @default
|
|
1118
|
+
* @default "2"
|
|
1115
1119
|
*/
|
|
1116
1120
|
"percentageScaling": string | number;
|
|
1117
1121
|
/**
|
|
@@ -1162,10 +1166,10 @@ export namespace Components {
|
|
|
1162
1166
|
*/
|
|
1163
1167
|
"type": string;
|
|
1164
1168
|
/**
|
|
1165
|
-
*
|
|
1166
|
-
* @example unit-scaling="
|
|
1169
|
+
* Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) — map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are shown with an arrow indicator. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
|
|
1170
|
+
* @example unit-scaling="1M"
|
|
1167
1171
|
* @example unit-scaling="revenue-scale"
|
|
1168
|
-
* @default
|
|
1172
|
+
* @default "100"
|
|
1169
1173
|
*/
|
|
1170
1174
|
"unitScaling": string | number;
|
|
1171
1175
|
/**
|
|
@@ -1589,6 +1593,10 @@ export namespace Components {
|
|
|
1589
1593
|
* @default 10
|
|
1590
1594
|
*/
|
|
1591
1595
|
"pixelPerUnit": number;
|
|
1596
|
+
/**
|
|
1597
|
+
* Internal wrapper channel: called with the auto-fitted values (px for one data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so the outer `bn-chart-structure` can surface them in its AUTO_* warnings. Not for end users.
|
|
1598
|
+
*/
|
|
1599
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
1592
1600
|
"ruleSetConfig"?: RuleSetConfig;
|
|
1593
1601
|
/**
|
|
1594
1602
|
* @default []
|
|
@@ -1700,6 +1708,10 @@ export namespace Components {
|
|
|
1700
1708
|
* @default 2
|
|
1701
1709
|
*/
|
|
1702
1710
|
"pixelPerUnit": number;
|
|
1711
|
+
/**
|
|
1712
|
+
* Internal wrapper channel: called with the auto-fitted values (px for one data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so the outer `bn-chart-time` can surface them in its AUTO_* warnings. Not for end users.
|
|
1713
|
+
*/
|
|
1714
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
1703
1715
|
"ruleSetConfig"?: RuleSetConfig;
|
|
1704
1716
|
/**
|
|
1705
1717
|
* @default []
|
|
@@ -1818,6 +1830,10 @@ export namespace Components {
|
|
|
1818
1830
|
* @default 0.5
|
|
1819
1831
|
*/
|
|
1820
1832
|
"percentageScaling": number;
|
|
1833
|
+
/**
|
|
1834
|
+
* Internal wrapper channel: called with the auto-fitted scaling values (em per unit / em per percentage point) whenever one of them was auto-resolved, so the outer `bn-table` can surface them in its AUTO_* warnings. Not for end users.
|
|
1835
|
+
*/
|
|
1836
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
1821
1837
|
"ruleSetConfig"?: RuleSetConfig;
|
|
1822
1838
|
/**
|
|
1823
1839
|
* @default 1
|
|
@@ -2114,11 +2130,13 @@ declare global {
|
|
|
2114
2130
|
};
|
|
2115
2131
|
/**
|
|
2116
2132
|
* Defines a named scaling value that chart and table components can reference
|
|
2117
|
-
* via their `unit-scaling` or `percentage-scaling` attributes
|
|
2133
|
+
* via their `unit-scaling` or `percentage-scaling` attributes, or a bubble
|
|
2134
|
+
* chart via its `size` spec's `group` key.
|
|
2118
2135
|
* Multiple components sharing the same group name will use the same scaling
|
|
2119
2136
|
* value, allowing synchronized scaling across an entire page or section.
|
|
2120
|
-
* The reserved name `"auto"` is not allowed and
|
|
2121
|
-
*
|
|
2137
|
+
* The reserved name `"auto"` is not allowed, and neither is a name that would
|
|
2138
|
+
* parse as a number/SI value (e.g. `"1M"`); both are rejected with a warning.
|
|
2139
|
+
* @example <bn-scaling-group name="revenue" value="250k"></bn-scaling-group>
|
|
2122
2140
|
* <bn-chart-structure unit-scaling="revenue" ...></bn-chart-structure>
|
|
2123
2141
|
* <bn-table unit-scaling="revenue" ...></bn-table>
|
|
2124
2142
|
*/
|
|
@@ -2617,8 +2635,8 @@ declare namespace LocalJSX {
|
|
|
2617
2635
|
*/
|
|
2618
2636
|
"orderDirection": string;
|
|
2619
2637
|
/**
|
|
2620
|
-
*
|
|
2621
|
-
* @example percentage-scaling="
|
|
2638
|
+
* Percentage points displayed per 1 em of bar length for relative variances — a larger value means shorter bars. | Value | Behavior | |-------------------|---------------------------------------------------------------| | `"auto"` | Auto-fit to available width | | not set / invalid | Same as auto with `AUTO_percentageScaling` warning | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
2639
|
+
* @example percentage-scaling="10"
|
|
2622
2640
|
* @example percentage-scaling="pct-scale"
|
|
2623
2641
|
*/
|
|
2624
2642
|
"percentageScaling": string | number;
|
|
@@ -2655,9 +2673,9 @@ declare namespace LocalJSX {
|
|
|
2655
2673
|
*/
|
|
2656
2674
|
"stack"?: string;
|
|
2657
2675
|
/**
|
|
2658
|
-
*
|
|
2676
|
+
* Data units displayed per 1 em of bar length (horizontal bars) — map-scale semantics: a larger value means smaller bars. | Value | Behavior | |--------------------|-------------------------------------------------------------| | `"auto"` | Auto-fit bars to fill the available container width | | not set / invalid | Same as auto, but emits `AUTO_unitScaling` warning | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | When using a custom value that causes the chart to exceed its container, a `WARN_overflow` error is emitted.
|
|
2659
2677
|
* @example unit-scaling="auto"
|
|
2660
|
-
* @example unit-scaling="
|
|
2678
|
+
* @example unit-scaling="1M"
|
|
2661
2679
|
* @example unit-scaling="revenue-scale"
|
|
2662
2680
|
*/
|
|
2663
2681
|
"unitScaling": string | number;
|
|
@@ -2726,7 +2744,7 @@ declare namespace LocalJSX {
|
|
|
2726
2744
|
*/
|
|
2727
2745
|
"maxBars"?: number;
|
|
2728
2746
|
/**
|
|
2729
|
-
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p //
|
|
2747
|
+
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST``` <br /><br /> SiPrefix overview: ``` "Y": 1E+24,```<br /> ``` "Z": 1E+21,```<br /> ``` "E": 1E+18,```<br /> ``` "P": 1E+15,```<br /> ``` "T": 1E+12,```<br /> ``` "G": 1000000000,```<br /> ``` "M": 1000000,```<br /> ``` "k": 1000,```<br /> <br /> ``` "m": 0.001,```<br /> ``` "my" (μ): 0.000001,```<br /> ``` "n": 0.000000001,```<br /> ``` "p": 0.000000000001,```<br /> ``` "f": 0.000000000000001,```<br /> ``` "a": 0.000000000000000001,```<br /> ``` "z": 0.000000000000000000001,```<br /> ``` "y": 0.000000000000000000000001,```<br /> <br /><br /> Special modes: ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br /> ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br /> <br /><br /> ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
2730
2748
|
* @default "greatest"
|
|
2731
2749
|
*/
|
|
2732
2750
|
"measureScale"?: string;
|
|
@@ -2744,8 +2762,8 @@ declare namespace LocalJSX {
|
|
|
2744
2762
|
*/
|
|
2745
2763
|
"orderDirection": string;
|
|
2746
2764
|
/**
|
|
2747
|
-
*
|
|
2748
|
-
* @example percentage-scaling="
|
|
2765
|
+
* Percentage points displayed per 1 em of pin/bar length for relative variances — a larger value means shorter pins. | Value | Behavior | |-------------------|---------------------------------------------------------------| | `"auto"` | Auto-fit to available height (same two-pass as unit-scaling) | | not set / invalid | Same as auto with `AUTO_percentageScaling` warning | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
2766
|
+
* @example percentage-scaling="10"
|
|
2749
2767
|
* @example percentage-scaling="pct-scale"
|
|
2750
2768
|
*/
|
|
2751
2769
|
"percentageScaling": string | number;
|
|
@@ -2790,9 +2808,9 @@ declare namespace LocalJSX {
|
|
|
2790
2808
|
*/
|
|
2791
2809
|
"syncSpaceLeft"?: number;
|
|
2792
2810
|
/**
|
|
2793
|
-
*
|
|
2811
|
+
* Data units displayed per 1 em of bar length (vertical bars) — map-scale semantics: a larger value means smaller bars. | Value | Behavior | |--------------------|-------------------------------------------------------------| | `"auto"` | Auto-fit bars to fill the available container height | | not set / invalid | Same as auto, but emits `AUTO_unitScaling` warning | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling |
|
|
2794
2812
|
* @example unit-scaling="auto"
|
|
2795
|
-
* @example unit-scaling="
|
|
2813
|
+
* @example unit-scaling="1M"
|
|
2796
2814
|
* @example unit-scaling="revenue-scale"
|
|
2797
2815
|
*/
|
|
2798
2816
|
"unitScaling": string | number;
|
|
@@ -3245,23 +3263,25 @@ declare namespace LocalJSX {
|
|
|
3245
3263
|
}
|
|
3246
3264
|
/**
|
|
3247
3265
|
* Defines a named scaling value that chart and table components can reference
|
|
3248
|
-
* via their `unit-scaling` or `percentage-scaling` attributes
|
|
3266
|
+
* via their `unit-scaling` or `percentage-scaling` attributes, or a bubble
|
|
3267
|
+
* chart via its `size` spec's `group` key.
|
|
3249
3268
|
* Multiple components sharing the same group name will use the same scaling
|
|
3250
3269
|
* value, allowing synchronized scaling across an entire page or section.
|
|
3251
|
-
* The reserved name `"auto"` is not allowed and
|
|
3252
|
-
*
|
|
3270
|
+
* The reserved name `"auto"` is not allowed, and neither is a name that would
|
|
3271
|
+
* parse as a number/SI value (e.g. `"1M"`); both are rejected with a warning.
|
|
3272
|
+
* @example <bn-scaling-group name="revenue" value="250k"></bn-scaling-group>
|
|
3253
3273
|
* <bn-chart-structure unit-scaling="revenue" ...></bn-chart-structure>
|
|
3254
3274
|
* <bn-table unit-scaling="revenue" ...></bn-table>
|
|
3255
3275
|
*/
|
|
3256
3276
|
interface BnScalingGroup {
|
|
3257
3277
|
/**
|
|
3258
|
-
* Unique name identifying this scaling group. Components reference this name in their `unit-scaling` or `percentage-scaling` attributes. The name `"auto"` is reserved and
|
|
3278
|
+
* Unique name identifying this scaling group. Components reference this name in their `unit-scaling` or `percentage-scaling` attributes, or in a bubble chart's `size.group`. The name `"auto"` is reserved, and names that parse as a number/SI value (`"100"`, `"1M"`) are rejected — they would be ambiguous with a literal scaling value.
|
|
3259
3279
|
*/
|
|
3260
3280
|
"name": string;
|
|
3261
3281
|
/**
|
|
3262
|
-
* The scaling value (
|
|
3282
|
+
* The scaling value: a positive number with optional SI suffix (`k`/`K` = 1e3, `M` = 1e6, `G` = 1e9, `T` = 1e12), e.g. `"250k"` or `2.5`. The unit depends on which attribute references this group: - from `unit-scaling`: data units per 1 em of bar length - from `percentage-scaling`: percentage points per 1 em of pin length - from a bubble chart's `size.group`: data units per 1 em² of bubble area
|
|
3263
3283
|
*/
|
|
3264
|
-
"value": number;
|
|
3284
|
+
"value": string | number;
|
|
3265
3285
|
}
|
|
3266
3286
|
/**
|
|
3267
3287
|
* Public-facing wrapper for the IBCS table component.
|
|
@@ -3327,7 +3347,7 @@ declare namespace LocalJSX {
|
|
|
3327
3347
|
*/
|
|
3328
3348
|
"limit"?: number;
|
|
3329
3349
|
/**
|
|
3330
|
-
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p //
|
|
3350
|
+
* Sets the SiPrefix of the Mesaurements and converts the original value. <br /><br /> values: <br /> ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST``` <br /><br /> SiPrefix overview: ``` "Y": 1E+24,```<br /> ``` "Z": 1E+21,```<br /> ``` "E": 1E+18,```<br /> ``` "P": 1E+15,```<br /> ``` "T": 1E+12,```<br /> ``` "G": 1000000000,```<br /> ``` "M": 1000000,```<br /> ``` "k": 1000,```<br /> <br /> ``` "m": 0.001,```<br /> ``` "my" (μ): 0.000001,```<br /> ``` "n": 0.000000001,```<br /> ``` "p": 0.000000000001,```<br /> ``` "f": 0.000000000000001,```<br /> ``` "a": 0.000000000000000001,```<br /> ``` "z": 0.000000000000000000001,```<br /> ``` "y": 0.000000000000000000000001,```<br /> <br /><br /> Special modes: ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br /> ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br /> <br /><br /> ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
3331
3351
|
* @default "greatest"
|
|
3332
3352
|
*/
|
|
3333
3353
|
"measureScale"?: string;
|
|
@@ -3357,10 +3377,10 @@ declare namespace LocalJSX {
|
|
|
3357
3377
|
*/
|
|
3358
3378
|
"partof"?: string;
|
|
3359
3379
|
/**
|
|
3360
|
-
*
|
|
3361
|
-
* @example percentage-scaling="
|
|
3380
|
+
* Percentage points displayed per 1 em of pin length for relative variance pin charts (ΔPY%) — a larger value means shorter pins. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest pin to the pin area | | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_percentageScaling` warning | Default: `"2"` (a +2 % variance pin is 1 em long)
|
|
3381
|
+
* @example percentage-scaling="10"
|
|
3362
3382
|
* @example percentage-scaling="pct-scale"
|
|
3363
|
-
* @default
|
|
3383
|
+
* @default "2"
|
|
3364
3384
|
*/
|
|
3365
3385
|
"percentageScaling"?: string | number;
|
|
3366
3386
|
/**
|
|
@@ -3411,10 +3431,10 @@ declare namespace LocalJSX {
|
|
|
3411
3431
|
*/
|
|
3412
3432
|
"type"?: string;
|
|
3413
3433
|
/**
|
|
3414
|
-
*
|
|
3415
|
-
* @example unit-scaling="
|
|
3434
|
+
* Data units displayed per 1 em of bar length for absolute variance bar charts (ΔPY) — map-scale semantics: a larger value means smaller bars. Bars exceeding barColumnWidth are shown with an arrow indicator. | Value | Behavior | |------------------|----------------------------------------------------------------| | `"auto"` | Auto-fit the largest bar to the bar column width | | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` | | group name | References a `<bn-scaling-group>` for synchronized scaling | | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning | Default: `"100"` (1 em of bar represents 100 units)
|
|
3435
|
+
* @example unit-scaling="1M"
|
|
3416
3436
|
* @example unit-scaling="revenue-scale"
|
|
3417
|
-
* @default
|
|
3437
|
+
* @default "100"
|
|
3418
3438
|
*/
|
|
3419
3439
|
"unitScaling"?: string | number;
|
|
3420
3440
|
/**
|
|
@@ -3835,6 +3855,10 @@ declare namespace LocalJSX {
|
|
|
3835
3855
|
* @default 10
|
|
3836
3856
|
*/
|
|
3837
3857
|
"pixelPerUnit"?: number;
|
|
3858
|
+
/**
|
|
3859
|
+
* Internal wrapper channel: called with the auto-fitted values (px for one data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so the outer `bn-chart-structure` can surface them in its AUTO_* warnings. Not for end users.
|
|
3860
|
+
*/
|
|
3861
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
3838
3862
|
"ruleSetConfig"?: RuleSetConfig;
|
|
3839
3863
|
/**
|
|
3840
3864
|
* @default []
|
|
@@ -3946,6 +3970,10 @@ declare namespace LocalJSX {
|
|
|
3946
3970
|
* @default 2
|
|
3947
3971
|
*/
|
|
3948
3972
|
"pixelPerUnit"?: number;
|
|
3973
|
+
/**
|
|
3974
|
+
* Internal wrapper channel: called with the auto-fitted values (px for one data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so the outer `bn-chart-time` can surface them in its AUTO_* warnings. Not for end users.
|
|
3975
|
+
*/
|
|
3976
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
3949
3977
|
"ruleSetConfig"?: RuleSetConfig;
|
|
3950
3978
|
/**
|
|
3951
3979
|
* @default []
|
|
@@ -4064,6 +4092,10 @@ declare namespace LocalJSX {
|
|
|
4064
4092
|
* @default 0.5
|
|
4065
4093
|
*/
|
|
4066
4094
|
"percentageScaling"?: number;
|
|
4095
|
+
/**
|
|
4096
|
+
* Internal wrapper channel: called with the auto-fitted scaling values (em per unit / em per percentage point) whenever one of them was auto-resolved, so the outer `bn-table` can surface them in its AUTO_* warnings. Not for end users.
|
|
4097
|
+
*/
|
|
4098
|
+
"reportAutoScaling"?: (report: AutoScalingReport) => void;
|
|
4067
4099
|
"ruleSetConfig"?: RuleSetConfig;
|
|
4068
4100
|
/**
|
|
4069
4101
|
* @default 1
|
|
@@ -4378,7 +4410,7 @@ declare namespace LocalJSX {
|
|
|
4378
4410
|
}
|
|
4379
4411
|
interface BnScalingGroupAttributes {
|
|
4380
4412
|
"name": string;
|
|
4381
|
-
"value":
|
|
4413
|
+
"value": string;
|
|
4382
4414
|
}
|
|
4383
4415
|
interface BnTableAttributes {
|
|
4384
4416
|
"scale": string;
|
|
@@ -4688,11 +4720,13 @@ declare module "@stencil/core" {
|
|
|
4688
4720
|
"bn-ruleset": LocalJSX.IntrinsicElements["bn-ruleset"] & JSXBase.HTMLAttributes<HTMLBnRulesetElement>;
|
|
4689
4721
|
/**
|
|
4690
4722
|
* Defines a named scaling value that chart and table components can reference
|
|
4691
|
-
* via their `unit-scaling` or `percentage-scaling` attributes
|
|
4723
|
+
* via their `unit-scaling` or `percentage-scaling` attributes, or a bubble
|
|
4724
|
+
* chart via its `size` spec's `group` key.
|
|
4692
4725
|
* Multiple components sharing the same group name will use the same scaling
|
|
4693
4726
|
* value, allowing synchronized scaling across an entire page or section.
|
|
4694
|
-
* The reserved name `"auto"` is not allowed and
|
|
4695
|
-
*
|
|
4727
|
+
* The reserved name `"auto"` is not allowed, and neither is a name that would
|
|
4728
|
+
* parse as a number/SI value (e.g. `"1M"`); both are rejected with a warning.
|
|
4729
|
+
* @example <bn-scaling-group name="revenue" value="250k"></bn-scaling-group>
|
|
4696
4730
|
* <bn-chart-structure unit-scaling="revenue" ...></bn-chart-structure>
|
|
4697
4731
|
* <bn-table unit-scaling="revenue" ...></bn-table>
|
|
4698
4732
|
*/
|
|
@@ -50,7 +50,11 @@ export declare class DataAnalyzer {
|
|
|
50
50
|
* - `null` with data: defaults to GREATEST auto-detection
|
|
51
51
|
*/
|
|
52
52
|
static calculateMeasureScale(db: AlaSQLDatabase, fromExpr: string, scenarios: string[], mode: string | null): SiPrefix;
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Maps an absolute numeric value to the best-fitting SI prefix based on
|
|
55
|
+
* its decimal magnitude. Values in (0.001, 1000) keep the identity prefix.
|
|
56
|
+
* Magnitudes beyond the covered SI range clamp to the outermost prefix.
|
|
57
|
+
*/
|
|
54
58
|
private static determinePrefix;
|
|
55
59
|
/** Looks up an explicit SI prefix string in the NumeralFigure enum. */
|
|
56
60
|
private static lookupPrefix;
|
|
@@ -20,3 +20,66 @@ export interface ScalingConfig {
|
|
|
20
20
|
* numeric string (-> factor mode). Invalid non-numeric strings fall back to empty.
|
|
21
21
|
*/
|
|
22
22
|
export declare function parseScaling(scale: string | undefined): ScalingConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Result of parsing a scaling value (`unit-scaling`, `percentage-scaling`,
|
|
25
|
+
* or a `bn-scaling-group` value) with the shared grammar.
|
|
26
|
+
*/
|
|
27
|
+
export type ParsedScalingValue = {
|
|
28
|
+
kind: "auto";
|
|
29
|
+
} | {
|
|
30
|
+
kind: "number";
|
|
31
|
+
value: number;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "invalid";
|
|
34
|
+
raw: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Parses a raw scaling value with the shared grammar used by
|
|
38
|
+
* `unit-scaling` / `percentage-scaling` and `<bn-scaling-group>`:
|
|
39
|
+
*
|
|
40
|
+
* - `"auto"` (trimmed, case-insensitive) -> `{ kind: "auto" }`
|
|
41
|
+
* - a positive number with optional SI suffix (`"250000"`, `"2.5M"`, `"1 k"`;
|
|
42
|
+
* suffixes `k`/`K` = 1e3, `M` = 1e6, `G` = 1e9, `T` = 1e12) -> `{ kind: "number" }`
|
|
43
|
+
* - anything else (blank, signs, exponent notation, lowercase `m`/`g`/`t`,
|
|
44
|
+
* zero, negatives, non-finite) -> `{ kind: "invalid" }`
|
|
45
|
+
*/
|
|
46
|
+
export declare function parseScalingValue(raw: string | number | null | undefined): ParsedScalingValue;
|
|
47
|
+
/**
|
|
48
|
+
* Result of resolving a scaling value against the scaling groups in scope.
|
|
49
|
+
* Group values and literal numbers carry identical units, so both resolve
|
|
50
|
+
* to `{ kind: "value" }`.
|
|
51
|
+
*/
|
|
52
|
+
export type ResolvedScalingValue = {
|
|
53
|
+
kind: "value";
|
|
54
|
+
value: number;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "auto";
|
|
57
|
+
} | {
|
|
58
|
+
kind: "invalid";
|
|
59
|
+
raw: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Resolves a raw `unit-scaling` / `percentage-scaling` value.
|
|
63
|
+
* Resolution order: `auto` -> scaling-group lookup (trimmed name) ->
|
|
64
|
+
* number/SI parse -> invalid. `auto` wins over a group of the same name
|
|
65
|
+
* because the name is reserved.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveScalingValue(raw: string | number | null | undefined, groups: ReadonlyMap<string, number>): ResolvedScalingValue;
|
|
68
|
+
/**
|
|
69
|
+
* Formats a positive value with the same SI suffixes the parser accepts,
|
|
70
|
+
* rounded to 3 significant digits (`250000` -> `"250k"`). Values just below
|
|
71
|
+
* a suffix boundary may round up across it (`999999` -> `"1000k"`) — fine
|
|
72
|
+
* for warning messages, which is all this is used for.
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatScalingValue(value: number): string;
|
|
75
|
+
/**
|
|
76
|
+
* Payload an inner rendering component reports to its wrapper after
|
|
77
|
+
* auto-fitting a scaling value. Members are only set for the values that
|
|
78
|
+
* were actually auto-resolved, in the INNER component's native units
|
|
79
|
+
* (charts: px for one data unit / px per 1.0 fraction; table: em for one
|
|
80
|
+
* data unit / em per percentage point).
|
|
81
|
+
*/
|
|
82
|
+
export interface AutoScalingReport {
|
|
83
|
+
unit?: number;
|
|
84
|
+
percentage?: number;
|
|
85
|
+
}
|
|
@@ -51,8 +51,8 @@ export declare function isValidi18nMode(value: string): boolean;
|
|
|
51
51
|
export declare function isValidMeasureType(value: string): boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Validates a measure-scale attribute value.
|
|
54
|
-
* Accepted values: `"_"` (no scaling), SI prefix letters (k, M, G, T, P, E, Z, Y, m, etc
|
|
55
|
-
* or auto-detection modes `"GREATEST"` / `"LEAST"`.
|
|
54
|
+
* Accepted values: `"_"` (no scaling), SI prefix letters (k, M, G, T, P, E, Z, Y, m, etc.;
|
|
55
|
+
* micro as `"my"` or `"μ"`), or auto-detection modes `"GREATEST"` / `"LEAST"`.
|
|
56
56
|
*/
|
|
57
57
|
export declare function isValidMeasureScale(value: string): boolean;
|
|
58
58
|
export declare function validateI18nString(value: string): string[];
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -146,10 +146,12 @@ All components must be wrapped in a **`<bn-context>`** element, which provides s
|
|
|
146
146
|
|-----------|-------------|
|
|
147
147
|
| [`<bn-component-style>`](src/components/bn-component-style/readme.md) | Theme/style configuration |
|
|
148
148
|
| [`<bn-internationalization>`](src/components/bn-internationalization/readme.md) | Translation/locale configuration |
|
|
149
|
+
| [`<bn-scaling-group>`](src/components/bn-scaling-group/readme.md) | Named scaling value shared across charts and tables |
|
|
149
150
|
|
|
150
151
|
## Concept Guides
|
|
151
152
|
|
|
152
153
|
- [Data Model](doc/data-model.md) — Scenarios, variances, grouping fields, operations
|
|
154
|
+
- [Scaling](doc/scaling.md) — Units-per-em bar scaling, scaling groups, `scale`, `measure-scale`
|
|
153
155
|
- [Theming](doc/theming.md) — Colors, fonts, chart styles, style layers
|
|
154
156
|
- [Internationalization](doc/internationalization.md) — Locale setup, translations, scenario labels
|
|
155
157
|
- [Installation](doc/installation.md) — npm, CDN, framework integration
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,c as n}from"./p-BgIpdpfH.js";import{r as e}from"./p-B4JfKvVT.js";import{g as o,f as a}from"./p-B_d-jp99.js";const s=(t,n)=>{const e=[],o=[];for(const a of n)(t(a)?e:o).push(a);return[e,o]},i="WARN_use_dataset",r=(t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:i,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(i)},l=(a,i,l)=>{let c,u,f=[],d=[],p=[];const m=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=u.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},v=()=>{f.forEach((t=>t())),f=[],d.forEach((t=>{t&&(f.push(u.db.subscribe(t,(()=>m(t,!1)))),m(t,!1),(t=>{if(l){const n=u.datasetsMeta.get(t);n&&l(t,n)}})(t))})),p.forEach((t=>{t&&(f.push(u.db.subscribe(t.substring(1),(()=>m(t,!0)))),m(t,!0))}))},h=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,d]=s((t=>t.startsWith("$")),o(a).getAttribute("datasets").split(",")),r(a,p),v())}))})),b=a.connectedCallback;a.connectedCallback=()=>{const n=o(a);u=t(n),[p,d]=s((t=>t.startsWith("$")),(n.getAttribute("datasets")||"").split(",")),r(a,p),v(),h.observe(n,{attributes:!0,attributeFilter:["datasets"]}),l&&(c=u.datasetsMeta.on("set",((t,n)=>{d.includes(t)&&l(t,n)}))),e(b,a)};const g=a.disconnectedCallback;return a.disconnectedCallback=()=>{h.disconnect(),f.forEach((t=>t())),f=[],e(c),n(o(a)),e(g,a)},t=>{d=t,v()}},c="inherited-page",u="bn-layout-page";function f(t){return"inherited-closest"===t||t===c}function d(t,n){let e=t.parentNode;for(;e;){if(e instanceof HTMLElement){const t=e.nodeName.toLowerCase();if(n===c){if(t===u)return e}else if("bn-layout-card"===t||t===u)return e}if(e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}}const p=(t,n)=>{const s=new Map;let i,r=null;const l=t.connectedCallback;t.connectedCallback=()=>{(()=>{const e=o(t);s.clear();const l=[];for(const o of n){const n=t[o.propName];if("string"!=typeof n||!f(n))continue;if(i||(i=d(e,n)),!i)continue;const a=i.getAttribute(o.ancestorAttr);null!=a&&s.set(o.propName,a),l.push(o.ancestorAttr)}i&&l.length>0&&(r=new MutationObserver((()=>{for(const e of n){if(!f(t[e.propName]))continue;const n=i.getAttribute(e.ancestorAttr);null!=n?s.set(e.propName,n):s.delete(e.propName)}a(t)})),r.observe(i,{attributes:!0,attributeFilter:l}))})(),e(l,t)};const c=t.disconnectedCallback;return t.disconnectedCallback=()=>{r&&(r.disconnect(),r=null),i=void 0,s.clear(),e(c,t)},(t,n)=>{if(f(n))return s.get(t)}},m=s=>{let i,r,l,c=null;const u=()=>{var t;const n=o(s);if(c&&(c.disconnect(),c=null),r=null!==(t=n.getAttribute("i18n-namespace"))&&void 0!==t?t:n.getAttribute("namespace"),null!=r)return;const e=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(n);e&&(r=e.getAttribute("i18n-namespace"),c=new MutationObserver((()=>{u(),a(s)})),c.observe(e,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=new MutationObserver((t=>{t.forEach((t=>{"i18n-namespace"!==t.attributeName&&"namespace"!==t.attributeName||(u(),a(s))}))})),d=s.connectedCallback;s.connectedCallback=()=>{const n=o(s);l=t(n),f.observe(n,{attributes:!0,attributeFilter:["i18n-namespace","namespace"]}),u(),i=l.internationalization.on("set",(t=>{t!==r&&"_system"!==t||a(s)})),e(d,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{f.disconnect(),c&&(c.disconnect(),c=null),e(i),n(o(s)),e(p,s)},{t:(t,n)=>{var e,a,i,c,u;t.startsWith(".")&&(t=o(s).localName+t);const f=l.internationalization.state,d=l.context.state.locale,p=null!==(i=null===(a=null===(e=f[r])||void 0===e?void 0:e[d])||void 0===a?void 0:a[t])&&void 0!==i?i:null===(u=null===(c=f._system)||void 0===c?void 0:c[d])||void 0===u?void 0:u[t];return null==p?t:p.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};function v(t,n=!1){const e=h(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),a=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),s=function(t,n=!1){let e=h(t),o=0,a=null,s=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),a=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(s*=t),e=b(e),o++;continue}const t=getComputedStyle(e),i=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${i} clientH=${e.clientHeight} h=${t.height}`),null===a)if("hidden"===i||"scroll"===i||"auto"===i)a=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(a)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(a=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=b(e),o++}return null!==a?a/s:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/s:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(a)}, h=${Math.round(s)}`,"overflow:",o.overflow),{width:Math.max(0,a),height:Math.max(0,s)}}function h(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function b(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function g(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}export{m as a,p as b,d as f,v as g,f as i,g as p,l as w}
|