@eaprelsky/nocturna-wheel 4.0.1 → 4.0.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.
@@ -293,7 +293,7 @@
293
293
  /**
294
294
  * IconData.js
295
295
  * Auto-generated module containing inline SVG icons as data URLs
296
- * Generated at: 2025-11-27T18:13:39.810Z
296
+ * Generated at: 2025-12-21T14:49:28.184Z
297
297
  *
298
298
  * This file is automatically generated by the build process.
299
299
  * Do not edit manually - changes will be overwritten.
@@ -2337,41 +2337,26 @@
2337
2337
  // Offset needed to place Ascendant (house 1 cusp) at 0 degrees (top side)
2338
2338
  ascendantAlignmentOffset = (360 - ascendantLon) % 360;
2339
2339
  }
2340
-
2341
- // Create array of houses with their rotated angles and original indices
2342
- const housesWithAngles = [];
2340
+
2341
+ // Render house numbers at the CENTER of each house sector.
2342
+ // If house cusp data is available, compute the midpoint between cusp[i] and cusp[i+1] (with proper 0/360 wrap).
2343
+ // Otherwise, fall back to equal 30° houses.
2343
2344
  for (let i = 0; i < 12; i++) {
2344
- let baseAngle;
2345
+ const houseNumber = i + 1;
2346
+
2347
+ let midAngle;
2345
2348
  if (this.houseData && this.houseData.length >= 12) {
2346
- baseAngle = this.getHouseLongitude(this.houseData[i]);
2349
+ const startLon = this.getHouseLongitude(this.houseData[i]);
2350
+ const endLon = this.getHouseLongitude(this.houseData[(i + 1) % 12]);
2351
+ const arc = (endLon - startLon + 360) % 360; // always move forward through the zodiac
2352
+ const midLon = (startLon + arc / 2) % 360;
2353
+ midAngle = (midLon + ascendantAlignmentOffset + rotationAngle) % 360;
2347
2354
  } else {
2348
- baseAngle = i * 30; // Default if no data
2355
+ // Equal houses: center of each 30° segment
2356
+ midAngle = (i * 30 + 15 + rotationAngle) % 360;
2349
2357
  }
2350
- const rotatedAngle = (baseAngle + ascendantAlignmentOffset + rotationAngle) % 360;
2351
2358
 
2352
- housesWithAngles.push({
2353
- originalIndex: i,
2354
- baseAngle: baseAngle,
2355
- rotatedAngle: rotatedAngle
2356
- });
2357
- }
2358
-
2359
- // Sort by rotated angle to determine visual order
2360
- housesWithAngles.sort((a, b) => a.rotatedAngle - b.rotatedAngle);
2361
-
2362
- // Find which house is Ascendant (originally index 0) after rotation
2363
- const ascendantVisualIndex = housesWithAngles.findIndex(h => h.originalIndex === 0);
2364
-
2365
- // Render houses with correct numbering based on visual position
2366
- housesWithAngles.forEach((house, visualIndex) => {
2367
- const houseAngle = house.rotatedAngle;
2368
-
2369
- // Calculate house number based on position relative to Ascendant
2370
- // Counter-clockwise from Ascendant
2371
- const houseNumber = ((visualIndex - ascendantVisualIndex + 12) % 12) + 1;
2372
-
2373
- // Offset text from house line clockwise
2374
- const angle = (houseAngle + 15) % 360; // Place in middle of house segment, apply modulo
2359
+ const angle = midAngle;
2375
2360
 
2376
2361
  // Calculate position for house number
2377
2362
  const point = this.svgUtils.pointOnCircle(this.centerX, this.centerY, this.numberRadius, angle);
@@ -2412,7 +2397,7 @@
2412
2397
 
2413
2398
  parentGroup.appendChild(text);
2414
2399
  elements.push(text);
2415
- });
2400
+ }
2416
2401
 
2417
2402
  return elements;
2418
2403
  }
@@ -2867,8 +2852,8 @@
2867
2852
  const adjustedPositions = [...positions];
2868
2853
 
2869
2854
  // The minimum angular distance needed to prevent overlap at base radius
2870
- // Add safety factor to ensure visual separation
2871
- const minAngularDistance = (minDistance / baseRadius) * (180 / Math.PI) * 1.3; // 30% extra spacing
2855
+ // minDistance already includes the desired spacing (iconSize * 1.5)
2856
+ const minAngularDistance = (minDistance / baseRadius) * (180 / Math.PI);
2872
2857
  console.log(`PlanetPositionCalculator: Minimum angular distance: ${minAngularDistance.toFixed(2)}°`);
2873
2858
 
2874
2859
  // Sort positions by longitude for overlap detection
@@ -3045,8 +3030,8 @@
3045
3030
  let centerAngle = (sumAngles / n) % 360;
3046
3031
 
3047
3032
  // Determine minimum arc needed for n planets with minimum spacing
3048
- // Add extra spacing factor to ensure planets don't overlap
3049
- const minRequiredArc = (n - 1) * minAngularDistance * 1.2; // 20% extra spacing
3033
+ // minAngularDistance already includes the desired spacing
3034
+ const minRequiredArc = (n - 1) * minAngularDistance;
3050
3035
 
3051
3036
  // Always use at least the minimum required arc
3052
3037
  const spanToUse = Math.max(minRequiredArc, totalArc);
@@ -3134,7 +3119,8 @@
3134
3119
  // Define parameters for collision detection and distribution
3135
3120
  const iconSize = 24;
3136
3121
  const baseRadius = planets[0].iconRadius; // Use the iconRadius from the first planet
3137
- const minDistance = iconSize * 1.2;
3122
+ // Minimum distance = icon diameter + half diameter (0.5 * iconSize spacing between icons)
3123
+ const minDistance = iconSize * 1.5;
3138
3124
 
3139
3125
  // Prepare planets array in format expected by PlanetPositionCalculator
3140
3126
  const positions = planets.map((planet, index) => ({
@@ -3316,7 +3302,8 @@
3316
3302
  // Define parameters for collision detection and distribution
3317
3303
  const iconSize = 18; // Smaller size for secondary planets
3318
3304
  const baseRadius = planets[0].iconRadius; // Use the iconRadius from the first planet
3319
- const minDistance = iconSize * 1.1; // Slightly tighter packing
3305
+ // Minimum distance = icon diameter + half diameter (0.5 * iconSize spacing between icons)
3306
+ const minDistance = iconSize * 1.5;
3320
3307
 
3321
3308
  // Prepare planets array in format expected by PlanetPositionCalculator
3322
3309
  const positions = planets.map((planet, index) => ({