@constela/core 0.21.0 → 0.21.1

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 (2) hide show
  1. package/dist/index.js +10 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3585,18 +3585,18 @@ function getActivityRingLayout(data, valueKey, cx, cy, outerRadius, ringWidth, r
3585
3585
  return typeof v === "number" ? v : 0;
3586
3586
  });
3587
3587
  const max = Math.max(...values);
3588
- if (max === 0) {
3589
- return data.map((_, i) => ({
3590
- radius: numOuterRadius - numRingWidth / 2 - i * (numRingWidth + numRingGap),
3591
- angle: 0,
3588
+ const minRadius = numRingWidth / 2;
3589
+ const rings = [];
3590
+ for (let i = 0; i < data.length; i++) {
3591
+ const radius = numOuterRadius - numRingWidth / 2 - i * (numRingWidth + numRingGap);
3592
+ if (radius < minRadius) break;
3593
+ rings.push({
3594
+ radius,
3595
+ angle: max === 0 ? 0 : (values[i] ?? 0) / max * 2 * Math.PI,
3592
3596
  maxAngle: 2 * Math.PI
3593
- }));
3597
+ });
3594
3598
  }
3595
- return data.map((_, i) => ({
3596
- radius: numOuterRadius - numRingWidth / 2 - i * (numRingWidth + numRingGap),
3597
- angle: (values[i] ?? 0) / max * 2 * Math.PI,
3598
- maxAngle: 2 * Math.PI
3599
- }));
3599
+ return rings;
3600
3600
  }
3601
3601
  function getChartDefaultColors(palette) {
3602
3602
  const palettes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constela/core",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Core types, schema, and validator for Constela UI framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",