@bino-bi/bn-template-engine 1.0.0-next.65 → 1.0.0-next.66

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.
@@ -25180,15 +25180,19 @@ class TimeChart {
25180
25180
  const series = new Set(column.scenarios);
25181
25181
  const bases = [...new Set(candidates.map((entry) => entry.variance.base))];
25182
25182
  const deltas = [...new Set(candidates.map((entry) => entry.variance.delta))];
25183
- // a row for a part of the series only has no total: the reference of the dataset is the one of the whole total
25184
- const covered = new Set([...bases, ...deltas].filter((name) => series.has(name))).size;
25185
- if (covered > 0 && covered < series.size) {
25183
+ // a total needs the whole series on one side and none of it on the other: a row for a part
25184
+ // of the series, or one that sets parts of the series against each other, has no total
25185
+ const inBases = bases.filter((name) => series.has(name)).length;
25186
+ const inDeltas = deltas.filter((name) => series.has(name)).length;
25187
+ if ((inBases > 0 && inDeltas > 0) || (inBases + inDeltas > 0 && inBases + inDeltas < series.size)) {
25186
25188
  return null;
25187
25189
  }
25188
25190
  // a 0 is a scenario without a value in this total, as for the parts
25189
25191
  const has = (name) => Number.isFinite(data[name]) && data[name] !== 0;
25190
25192
  const side = (names) => {
25191
- const used = names.some((name) => series.has(name)) ? names.filter(has) : names.slice(0, 1).filter(has);
25193
+ // of the side with the series only the series counts, of the other side the first name
25194
+ const ofSeries = names.filter((name) => series.has(name));
25195
+ const used = (ofSeries.length > 0 ? ofSeries : names.slice(0, 1)).filter(has);
25192
25196
  return used.length > 0 ? used.reduce((sum, name) => sum + data[name], 0) : null;
25193
25197
  };
25194
25198
  const baseSide = side(bases);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bino-bi/bn-template-engine",
3
- "version": "1.0.0-next.65",
3
+ "version": "1.0.0-next.66",
4
4
  "description": "IBCS-compliant web components for business intelligence tables and charts",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",