@bino-bi/bn-template-engine 1.0.0-alpha.17 → 1.0.0-alpha.18
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-0107f0cc.entry.js +1 -0
- package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
- package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
- package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
- package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
- package/dist/bn-template-engine/p-5651417d.entry.js +1 -0
- package/dist/bn-template-engine/p-5bfdc1e5.entry.js +1 -0
- package/dist/bn-template-engine/p-6b75762d.entry.js +1 -0
- package/dist/bn-template-engine/{p-1a1fd8eb.entry.js → p-7bdc0e28.entry.js} +1 -1
- package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
- package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
- package/dist/bn-template-engine/{p-CIXlJoMr.js → p-BZV1b5VH.js} +1 -1
- package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
- package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
- package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
- package/dist/bn-template-engine/{p-44L8rZSd.js → p-CBqUr7I8.js} +1 -1
- package/dist/bn-template-engine/{p-COXiPUfj.js → p-CPzF3Q2m.js} +1 -1
- package/dist/bn-template-engine/{p-DHibUOw5.js → p-CiudZRQr.js} +1 -1
- package/dist/bn-template-engine/{p-B2KOyHRY.js → p-Dg9OcXAO.js} +1 -1
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
- package/dist/bn-template-engine/p-a130cb43.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-dc745c32.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/{p-d3fc17ee.entry.js → p-f3d1fa06.entry.js} +1 -1
- package/dist/bn-template-engine/p-fcb43f2c.entry.js +1 -0
- package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
- package/dist/cjs/{AxisConfig-B_GMRfX_.js → AxisConfig-VnVelfSV.js} +1 -1
- package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-DobBozQC.js +87 -0
- package/dist/cjs/{LabelCollisionManager-8HGn9W0V.js → SVGStyle-BQOmGWLX.js} +2 -409
- package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
- package/dist/cjs/{VarianceMeasure-DEOzP-XZ.js → VarianceMeasure-NY9yhiNV.js} +1 -1
- package/dist/cjs/{XYChartDataRow-CDl1Ofnv.js → XYChartDataRow-B7OKrAcC.js} +7 -111
- package/dist/cjs/bn-asset_21.cjs.entry.js +221 -263
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +8 -7
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +8 -7
- package/dist/cjs/bn-grid.cjs.entry.js +5 -4
- package/dist/cjs/bn-image.cjs.entry.js +5 -4
- 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-template.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +6 -5
- package/dist/cjs/bn-tree.cjs.entry.js +4 -3
- package/dist/cjs/{context-protocol-CIuyJKkK.js → context-protocol-BDrMkhc4.js} +66 -0
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +20 -18
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +19 -17
- package/dist/cjs/{layoutObserver-CJWRV_y6.js → layoutObserver-p0wXIWFg.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-B4UPXivZ.js → scaling-BmqxcNOf.js} +1 -1
- package/dist/cjs/{withScalingGroup-D832DQKp.js → withScalingGroup-BmcRlWBs.js} +1 -1
- package/dist/cjs/{withStyled-COxuhL-N.js → withStyled-CRiC9fzc.js} +5 -86
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +1 -1
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +1 -1
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +1 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
- package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +1 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +1 -1
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +1 -1
- package/dist/collection/components/bn-message/bn-message.js +1 -1
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +1 -1
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
- package/dist/collection/components/bn-table/bn-table.js +1 -1
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +1 -1
- package/dist/collection/components/bn-title/bn-title.js +1 -1
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/stores/componentStyles.js +38 -0
- package/dist/collection/stores/internationalization.js +28 -0
- package/dist/components/NumericScale.js +1 -0
- package/dist/components/Order.js +1 -1
- package/dist/components/XYChartDataRow.js +1 -1
- package/dist/components/bn-chart-bullet.d.ts +11 -0
- package/dist/components/bn-chart-bullet.js +1 -0
- 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-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-footer2.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-message2.js +1 -1
- package/dist/components/bn-page2.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.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/ibcs-chart-bubble2.js +1 -1
- package/dist/components/ibcs-chart-bullet.d.ts +11 -0
- package/dist/components/ibcs-chart-bullet.js +1 -0
- package/dist/components/ibcs-chart-bullet2.js +1 -0
- package/dist/components/ibcs-chart-scatter2.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/ibcs-title2.js +1 -1
- package/dist/components/main.js +1 -0
- package/dist/components/stackColors.js +1 -1
- package/dist/esm/{AxisConfig-BwUQrme0.js → AxisConfig-C_zWCKlL.js} +1 -1
- package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BPeWfygb.js +83 -0
- package/dist/esm/{LabelCollisionManager-DZP5Vl8T.js → SVGStyle-BxEDw9zh.js} +3 -403
- package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
- package/dist/esm/{VarianceMeasure-Cxshx01h.js → VarianceMeasure-DnwNKspZ.js} +1 -1
- package/dist/esm/{XYChartDataRow-FF_VxRnF.js → XYChartDataRow-DeV4r-Wm.js} +5 -108
- package/dist/esm/bn-asset_21.entry.js +25 -67
- package/dist/esm/bn-chart-bubble.entry.js +8 -7
- package/dist/esm/bn-chart-bullet.entry.js +783 -0
- package/dist/esm/bn-chart-scatter.entry.js +8 -7
- package/dist/esm/bn-grid.entry.js +5 -4
- package/dist/esm/bn-image.entry.js +5 -4
- 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-template.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +6 -5
- package/dist/esm/bn-tree.entry.js +4 -3
- package/dist/esm/{context-protocol-BNHTlllP.js → context-protocol-1Yj1uKvh.js} +66 -0
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/ibcs-chart-bubble.entry.js +6 -4
- package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
- package/dist/esm/ibcs-chart-scatter.entry.js +6 -4
- package/dist/esm/{layoutObserver-D5FY_lQa.js → layoutObserver-DCbmpGrz.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-B7Pa0d_s.js → scaling-B_k50v9z.js} +1 -1
- package/dist/esm/{withScalingGroup-DBheBsP4.js → withScalingGroup-Br70pAv9.js} +1 -1
- package/dist/esm/{withStyled-DTvj2nar.js → withStyled-Br2DGTPs.js} +4 -83
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
- package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
- package/dist/types/components.d.ts +399 -4
- package/dist/types/stores/componentStyles.d.ts +20 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-172499ac.entry.js +0 -1
- package/dist/bn-template-engine/p-19e65c04.entry.js +0 -1
- package/dist/bn-template-engine/p-2849c367.entry.js +0 -1
- package/dist/bn-template-engine/p-5dd11fcc.entry.js +0 -1
- package/dist/bn-template-engine/p-63f891d9.entry.js +0 -1
- package/dist/bn-template-engine/p-72f63181.entry.js +0 -1
- package/dist/bn-template-engine/p-836ad6f3.entry.js +0 -1
- package/dist/bn-template-engine/p-BnOTt2YD.js +0 -1
- package/dist/bn-template-engine/p-CDPTCKVx.js +0 -1
- package/dist/bn-template-engine/p-CPZIJpxn.js +0 -1
- package/dist/bn-template-engine/p-a50da0f0.entry.js +0 -1
- package/dist/bn-template-engine/p-a9a34fb2.entry.js +0 -1
- package/dist/bn-template-engine/p-b0369558.entry.js +0 -1
- package/dist/bn-template-engine/p-f8c46905.entry.js +0 -1
- package/dist/bn-template-engine/p-lIy3SJs2.js +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var VarianceMeasure = require('./VarianceMeasure-
|
|
4
|
-
var contextProtocol = require('./context-protocol-
|
|
5
|
-
var LabelCollisionManager = require('./LabelCollisionManager-
|
|
3
|
+
var VarianceMeasure = require('./VarianceMeasure-NY9yhiNV.js');
|
|
4
|
+
var contextProtocol = require('./context-protocol-BDrMkhc4.js');
|
|
5
|
+
var LabelCollisionManager = require('./LabelCollisionManager-nfD5P__k.js');
|
|
6
|
+
var SVGStyle = require('./SVGStyle-BQOmGWLX.js');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Aggregates all style configuration for an XY chart (scatter/bubble):
|
|
@@ -161,110 +162,6 @@ class FacetGrid {
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
/**
|
|
165
|
-
* Linear numeric scale with nice-tick generation for the XY charts.
|
|
166
|
-
*
|
|
167
|
-
* Domains default to the data extent padded 4% on each side; zero-inclusion
|
|
168
|
-
* is NOT forced — points encode by position, not length, so IBCS's
|
|
169
|
-
* zero-baseline rule for bars does not apply. Explicit `min`/`max`
|
|
170
|
-
* overrides disable the padding on that side.
|
|
171
|
-
*/
|
|
172
|
-
class NumericScale {
|
|
173
|
-
constructor(domainMin, domainMax, rangeMin, rangeMax) {
|
|
174
|
-
this.domainMin = domainMin;
|
|
175
|
-
this.domainMax = domainMax;
|
|
176
|
-
this.rangeMin = rangeMin;
|
|
177
|
-
this.rangeMax = rangeMax;
|
|
178
|
-
}
|
|
179
|
-
/** Maps a domain value to range (pixel) coordinates. */
|
|
180
|
-
scale(value) {
|
|
181
|
-
const span = this.domainMax - this.domainMin;
|
|
182
|
-
if (span === 0) {
|
|
183
|
-
return (this.rangeMin + this.rangeMax) / 2;
|
|
184
|
-
}
|
|
185
|
-
return this.rangeMin + ((value - this.domainMin) / span) * (this.rangeMax - this.rangeMin);
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Computes the domain from a data extent: 4% padding on each side,
|
|
189
|
-
* overridden per side by explicit `min`/`max`. Degenerate extents
|
|
190
|
-
* (single value) are widened symmetrically.
|
|
191
|
-
*/
|
|
192
|
-
static domain(dataMin, dataMax, override, pad = 0.04) {
|
|
193
|
-
let span = dataMax - dataMin;
|
|
194
|
-
if (span === 0) {
|
|
195
|
-
const widen = dataMin === 0 ? 1 : Math.abs(dataMin) * 0.1;
|
|
196
|
-
dataMin -= widen;
|
|
197
|
-
dataMax += widen;
|
|
198
|
-
span = dataMax - dataMin;
|
|
199
|
-
}
|
|
200
|
-
const min = (override === null || override === void 0 ? void 0 : override.min) !== undefined ? override.min : dataMin - span * pad;
|
|
201
|
-
const max = (override === null || override === void 0 ? void 0 : override.max) !== undefined ? override.max : dataMax + span * pad;
|
|
202
|
-
return [min, max];
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Picks a nice step size from the 1-2-2.5-5 ladder so that the span
|
|
206
|
-
* yields close to `targetCount` ticks.
|
|
207
|
-
*/
|
|
208
|
-
static niceStep(span, targetCount) {
|
|
209
|
-
if (span <= 0 || targetCount <= 0) {
|
|
210
|
-
return 1;
|
|
211
|
-
}
|
|
212
|
-
const rawStep = span / targetCount;
|
|
213
|
-
const magnitude = Math.pow(10, Math.floor(Math.log10(rawStep)));
|
|
214
|
-
const normalized = rawStep / magnitude;
|
|
215
|
-
let mantissa;
|
|
216
|
-
if (normalized <= 1) {
|
|
217
|
-
mantissa = 1;
|
|
218
|
-
}
|
|
219
|
-
else if (normalized <= 2) {
|
|
220
|
-
mantissa = 2;
|
|
221
|
-
}
|
|
222
|
-
else if (normalized <= 2.5) {
|
|
223
|
-
mantissa = 2.5;
|
|
224
|
-
}
|
|
225
|
-
else if (normalized <= 5) {
|
|
226
|
-
mantissa = 5;
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
mantissa = 10;
|
|
230
|
-
}
|
|
231
|
-
return mantissa * magnitude;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Nice tick values inside the domain, aiming for `targetCount` ticks
|
|
235
|
-
* (the renderer picks 4–8 depending on panel size).
|
|
236
|
-
*/
|
|
237
|
-
ticks(targetCount) {
|
|
238
|
-
const span = this.domainMax - this.domainMin;
|
|
239
|
-
if (span <= 0) {
|
|
240
|
-
return [this.domainMin];
|
|
241
|
-
}
|
|
242
|
-
const step = NumericScale.niceStep(span, targetCount);
|
|
243
|
-
const first = Math.ceil(this.domainMin / step) * step;
|
|
244
|
-
const ticks = [];
|
|
245
|
-
// Guard against floating-point drift at the domain edge.
|
|
246
|
-
for (let tick = first; tick <= this.domainMax + step * 1e-9; tick += step) {
|
|
247
|
-
ticks.push(Math.abs(tick) < step * 1e-9 ? 0 : tick);
|
|
248
|
-
}
|
|
249
|
-
return ticks;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Decimal places (0–2) needed to render the given ticks without
|
|
253
|
-
* ambiguity between adjacent values.
|
|
254
|
-
*/
|
|
255
|
-
static tickDecimals(ticks) {
|
|
256
|
-
let decimals = 0;
|
|
257
|
-
for (const tick of ticks) {
|
|
258
|
-
const text = String(tick);
|
|
259
|
-
const dot = text.indexOf(".");
|
|
260
|
-
if (dot >= 0) {
|
|
261
|
-
decimals = Math.max(decimals, Math.min(2, text.length - dot - 1));
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return decimals;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
165
|
const ANCHORS = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];
|
|
269
166
|
const DIAGONAL = Math.SQRT1_2;
|
|
270
167
|
/**
|
|
@@ -446,7 +343,7 @@ class XYFrame {
|
|
|
446
343
|
for (const tick of config.ticksX) {
|
|
447
344
|
const x = this.xScale.scale(tick);
|
|
448
345
|
group
|
|
449
|
-
.text(
|
|
346
|
+
.text(SVGStyle.Formatter.number(tick, "decimal", config.xDecimals, config.xDecimals))
|
|
450
347
|
.font(Object.assign(Object.assign({}, font), { anchor: "middle" }))
|
|
451
348
|
.fill(color)
|
|
452
349
|
.attr({ x, y: this.rect.y + this.rect.height + gap + this.em * 0.8, "font-family": family });
|
|
@@ -456,7 +353,7 @@ class XYFrame {
|
|
|
456
353
|
for (const tick of config.ticksY) {
|
|
457
354
|
const y = this.yScale.scale(tick);
|
|
458
355
|
group
|
|
459
|
-
.text(
|
|
356
|
+
.text(SVGStyle.Formatter.number(tick, "decimal", config.yDecimals, config.yDecimals))
|
|
460
357
|
.font(Object.assign(Object.assign({}, font), { anchor: "end" }))
|
|
461
358
|
.fill(color)
|
|
462
359
|
.attr({ x: this.rect.x - gap, y: y + this.em * 0.35, "font-family": family });
|
|
@@ -499,7 +396,7 @@ class XYLegend {
|
|
|
499
396
|
return this.styles.scaleFactors.legendSwatch * this.em;
|
|
500
397
|
}
|
|
501
398
|
textWidth(text, bold = false) {
|
|
502
|
-
const width =
|
|
399
|
+
const width = SVGStyle.CalculateSize(text, {
|
|
503
400
|
font: this.styles.fontStyles.font,
|
|
504
401
|
fontSize: this.styles.fontStyles.size + "px",
|
|
505
402
|
fontWeight: bold ? "bold" : "normal",
|
|
@@ -923,7 +820,6 @@ function resolveXYData(rows, opts) {
|
|
|
923
820
|
}
|
|
924
821
|
|
|
925
822
|
exports.FacetGrid = FacetGrid;
|
|
926
|
-
exports.NumericScale = NumericScale;
|
|
927
823
|
exports.PointLabeler = PointLabeler;
|
|
928
824
|
exports.ScaleFactorsXYChartAdapter = ScaleFactorsXYChartAdapter;
|
|
929
825
|
exports.XYChartDataRowAdapter = XYChartDataRowAdapter;
|