@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.
Files changed (186) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-0107f0cc.entry.js +1 -0
  3. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  4. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  5. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  6. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  7. package/dist/bn-template-engine/p-5651417d.entry.js +1 -0
  8. package/dist/bn-template-engine/p-5bfdc1e5.entry.js +1 -0
  9. package/dist/bn-template-engine/p-6b75762d.entry.js +1 -0
  10. package/dist/bn-template-engine/{p-1a1fd8eb.entry.js → p-7bdc0e28.entry.js} +1 -1
  11. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  12. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  13. package/dist/bn-template-engine/{p-CIXlJoMr.js → p-BZV1b5VH.js} +1 -1
  14. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  15. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  16. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  17. package/dist/bn-template-engine/{p-44L8rZSd.js → p-CBqUr7I8.js} +1 -1
  18. package/dist/bn-template-engine/{p-COXiPUfj.js → p-CPzF3Q2m.js} +1 -1
  19. package/dist/bn-template-engine/{p-DHibUOw5.js → p-CiudZRQr.js} +1 -1
  20. package/dist/bn-template-engine/{p-B2KOyHRY.js → p-Dg9OcXAO.js} +1 -1
  21. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  22. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  23. package/dist/bn-template-engine/p-a130cb43.entry.js +1 -0
  24. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  25. package/dist/bn-template-engine/p-dc745c32.entry.js +1 -0
  26. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  27. package/dist/bn-template-engine/{p-d3fc17ee.entry.js → p-f3d1fa06.entry.js} +1 -1
  28. package/dist/bn-template-engine/p-fcb43f2c.entry.js +1 -0
  29. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  30. package/dist/cjs/{AxisConfig-B_GMRfX_.js → AxisConfig-VnVelfSV.js} +1 -1
  31. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  32. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  33. package/dist/cjs/Order-DobBozQC.js +87 -0
  34. package/dist/cjs/{LabelCollisionManager-8HGn9W0V.js → SVGStyle-BQOmGWLX.js} +2 -409
  35. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  36. package/dist/cjs/{VarianceMeasure-DEOzP-XZ.js → VarianceMeasure-NY9yhiNV.js} +1 -1
  37. package/dist/cjs/{XYChartDataRow-CDl1Ofnv.js → XYChartDataRow-B7OKrAcC.js} +7 -111
  38. package/dist/cjs/bn-asset_21.cjs.entry.js +221 -263
  39. package/dist/cjs/bn-chart-bubble.cjs.entry.js +8 -7
  40. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  41. package/dist/cjs/bn-chart-scatter.cjs.entry.js +8 -7
  42. package/dist/cjs/bn-grid.cjs.entry.js +5 -4
  43. package/dist/cjs/bn-image.cjs.entry.js +5 -4
  44. package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
  45. package/dist/cjs/bn-ruleset.cjs.entry.js +2 -2
  46. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  47. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  48. package/dist/cjs/bn-text.cjs.entry.js +6 -5
  49. package/dist/cjs/bn-tree.cjs.entry.js +4 -3
  50. package/dist/cjs/{context-protocol-CIuyJKkK.js → context-protocol-BDrMkhc4.js} +66 -0
  51. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  52. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +20 -18
  53. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  54. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +19 -17
  55. package/dist/cjs/{layoutObserver-CJWRV_y6.js → layoutObserver-p0wXIWFg.js} +2 -2
  56. package/dist/cjs/loader.cjs.js +1 -1
  57. package/dist/cjs/{scaling-B4UPXivZ.js → scaling-BmqxcNOf.js} +1 -1
  58. package/dist/cjs/{withScalingGroup-D832DQKp.js → withScalingGroup-BmcRlWBs.js} +1 -1
  59. package/dist/cjs/{withStyled-COxuhL-N.js → withStyled-CRiC9fzc.js} +5 -86
  60. package/dist/collection/collection-manifest.json +2 -0
  61. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  62. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  63. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  64. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  65. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  66. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  67. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  68. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  69. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +1 -1
  70. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +1 -1
  71. package/dist/collection/components/bn-chart-time/bn-chart-time.js +1 -1
  72. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  73. package/dist/collection/components/bn-context/bn-context.js +1 -1
  74. package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
  75. package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
  76. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  77. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  78. package/dist/collection/components/bn-image/bn-image.js +1 -1
  79. package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
  80. package/dist/collection/components/bn-layout-card/bn-layout-card.js +1 -1
  81. package/dist/collection/components/bn-layout-page/bn-layout-page.js +1 -1
  82. package/dist/collection/components/bn-message/bn-message.js +1 -1
  83. package/dist/collection/components/bn-page/bn-page.js +1 -1
  84. package/dist/collection/components/bn-ruleset/bn-ruleset.js +1 -1
  85. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
  86. package/dist/collection/components/bn-table/bn-table.js +1 -1
  87. package/dist/collection/components/bn-template/bn-template.js +1 -1
  88. package/dist/collection/components/bn-text/bn-text.js +1 -1
  89. package/dist/collection/components/bn-title/bn-title.js +1 -1
  90. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
  91. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  92. package/dist/collection/stores/componentStyles.js +38 -0
  93. package/dist/collection/stores/internationalization.js +28 -0
  94. package/dist/components/NumericScale.js +1 -0
  95. package/dist/components/Order.js +1 -1
  96. package/dist/components/XYChartDataRow.js +1 -1
  97. package/dist/components/bn-chart-bullet.d.ts +11 -0
  98. package/dist/components/bn-chart-bullet.js +1 -0
  99. package/dist/components/bn-chart-scatter.js +1 -1
  100. package/dist/components/bn-chart-structure.js +1 -1
  101. package/dist/components/bn-chart-time.js +1 -1
  102. package/dist/components/bn-component-style.js +1 -1
  103. package/dist/components/bn-context.js +1 -1
  104. package/dist/components/bn-dataset.js +1 -1
  105. package/dist/components/bn-datasource.js +1 -1
  106. package/dist/components/bn-footer2.js +1 -1
  107. package/dist/components/bn-grid.js +1 -1
  108. package/dist/components/bn-image.js +1 -1
  109. package/dist/components/bn-internationalization.js +1 -1
  110. package/dist/components/bn-layout-card.js +1 -1
  111. package/dist/components/bn-layout-page.js +1 -1
  112. package/dist/components/bn-message2.js +1 -1
  113. package/dist/components/bn-page2.js +1 -1
  114. package/dist/components/bn-ruleset.js +1 -1
  115. package/dist/components/bn-scaling-group.js +1 -1
  116. package/dist/components/bn-table.js +1 -1
  117. package/dist/components/bn-template.js +1 -1
  118. package/dist/components/bn-text.js +1 -1
  119. package/dist/components/bn-title2.js +1 -1
  120. package/dist/components/context-protocol.js +1 -1
  121. package/dist/components/editor-companion.js +1 -1
  122. package/dist/components/ibcs-chart-bubble2.js +1 -1
  123. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  124. package/dist/components/ibcs-chart-bullet.js +1 -0
  125. package/dist/components/ibcs-chart-bullet2.js +1 -0
  126. package/dist/components/ibcs-chart-scatter2.js +1 -1
  127. package/dist/components/ibcs-chart-structure2.js +1 -1
  128. package/dist/components/ibcs-chart-time2.js +1 -1
  129. package/dist/components/ibcs-table2.js +1 -1
  130. package/dist/components/ibcs-title2.js +1 -1
  131. package/dist/components/main.js +1 -0
  132. package/dist/components/stackColors.js +1 -1
  133. package/dist/esm/{AxisConfig-BwUQrme0.js → AxisConfig-C_zWCKlL.js} +1 -1
  134. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  135. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  136. package/dist/esm/Order-BPeWfygb.js +83 -0
  137. package/dist/esm/{LabelCollisionManager-DZP5Vl8T.js → SVGStyle-BxEDw9zh.js} +3 -403
  138. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  139. package/dist/esm/{VarianceMeasure-Cxshx01h.js → VarianceMeasure-DnwNKspZ.js} +1 -1
  140. package/dist/esm/{XYChartDataRow-FF_VxRnF.js → XYChartDataRow-DeV4r-Wm.js} +5 -108
  141. package/dist/esm/bn-asset_21.entry.js +25 -67
  142. package/dist/esm/bn-chart-bubble.entry.js +8 -7
  143. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  144. package/dist/esm/bn-chart-scatter.entry.js +8 -7
  145. package/dist/esm/bn-grid.entry.js +5 -4
  146. package/dist/esm/bn-image.entry.js +5 -4
  147. package/dist/esm/bn-internationalization.entry.js +2 -2
  148. package/dist/esm/bn-ruleset.entry.js +2 -2
  149. package/dist/esm/bn-template-engine.js +1 -1
  150. package/dist/esm/bn-template.entry.js +1 -1
  151. package/dist/esm/bn-text.entry.js +6 -5
  152. package/dist/esm/bn-tree.entry.js +4 -3
  153. package/dist/esm/{context-protocol-BNHTlllP.js → context-protocol-1Yj1uKvh.js} +66 -0
  154. package/dist/esm/editor-companion.entry.js +2 -2
  155. package/dist/esm/ibcs-chart-bubble.entry.js +6 -4
  156. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  157. package/dist/esm/ibcs-chart-scatter.entry.js +6 -4
  158. package/dist/esm/{layoutObserver-D5FY_lQa.js → layoutObserver-DCbmpGrz.js} +2 -2
  159. package/dist/esm/loader.js +1 -1
  160. package/dist/esm/{scaling-B7Pa0d_s.js → scaling-B_k50v9z.js} +1 -1
  161. package/dist/esm/{withScalingGroup-DBheBsP4.js → withScalingGroup-Br70pAv9.js} +1 -1
  162. package/dist/esm/{withStyled-DTvj2nar.js → withStyled-Br2DGTPs.js} +4 -83
  163. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  164. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  165. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  166. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  167. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  168. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  169. package/dist/types/components.d.ts +399 -4
  170. package/dist/types/stores/componentStyles.d.ts +20 -0
  171. package/package.json +1 -1
  172. package/dist/bn-template-engine/p-172499ac.entry.js +0 -1
  173. package/dist/bn-template-engine/p-19e65c04.entry.js +0 -1
  174. package/dist/bn-template-engine/p-2849c367.entry.js +0 -1
  175. package/dist/bn-template-engine/p-5dd11fcc.entry.js +0 -1
  176. package/dist/bn-template-engine/p-63f891d9.entry.js +0 -1
  177. package/dist/bn-template-engine/p-72f63181.entry.js +0 -1
  178. package/dist/bn-template-engine/p-836ad6f3.entry.js +0 -1
  179. package/dist/bn-template-engine/p-BnOTt2YD.js +0 -1
  180. package/dist/bn-template-engine/p-CDPTCKVx.js +0 -1
  181. package/dist/bn-template-engine/p-CPZIJpxn.js +0 -1
  182. package/dist/bn-template-engine/p-a50da0f0.entry.js +0 -1
  183. package/dist/bn-template-engine/p-a9a34fb2.entry.js +0 -1
  184. package/dist/bn-template-engine/p-b0369558.entry.js +0 -1
  185. package/dist/bn-template-engine/p-f8c46905.entry.js +0 -1
  186. 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-DEOzP-XZ.js');
4
- var contextProtocol = require('./context-protocol-CIuyJKkK.js');
5
- var LabelCollisionManager = require('./LabelCollisionManager-8HGn9W0V.js');
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(LabelCollisionManager.Formatter.number(tick, "decimal", config.xDecimals, config.xDecimals))
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(LabelCollisionManager.Formatter.number(tick, "decimal", config.yDecimals, config.yDecimals))
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 = LabelCollisionManager.CalculateSize(text, {
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;