qvac-charts 0.1.1 → 0.1.2

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.
@@ -39,6 +39,9 @@ export function normalize(input, maps) {
39
39
  throw new RangeError(`A chart takes at most ${MAX_ITEMS} items, got ${input.data.length}`);
40
40
  }
41
41
  const spec = arranged(finite(input), maps);
42
+ if (spec.data.length === 0) {
43
+ throw new RangeError('A change needs each item twice, once per moment, named in group');
44
+ }
42
45
  const notes = new Map((spec.annotations ?? []).map((a) => [a.label, a.text]));
43
46
  const raw = Math.max(...spec.data.map((d) => Math.abs(d.value)));
44
47
  const named = spec.unit === 'percent' ? 1 : (multipliers[spec.scale ?? ''] ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qvac-charts",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Renders a small JSON chart spec into an SVG, on Bare and Node",
5
5
  "type": "module",
6
6
  "exports": {