@eaprelsky/nocturna-wheel 4.0.0 → 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.
@@ -287,7 +287,7 @@ class IconProvider {
287
287
  /**
288
288
  * IconData.js
289
289
  * Auto-generated module containing inline SVG icons as data URLs
290
- * Generated at: 2025-11-23T10:05:25.858Z
290
+ * Generated at: 2025-12-21T14:49:27.435Z
291
291
  *
292
292
  * This file is automatically generated by the build process.
293
293
  * Do not edit manually - changes will be overwritten.
@@ -2331,21 +2331,26 @@ class HouseRenderer extends BaseRenderer {
2331
2331
  // Offset needed to place Ascendant (house 1 cusp) at 0 degrees (top side)
2332
2332
  ascendantAlignmentOffset = (360 - ascendantLon) % 360;
2333
2333
  }
2334
-
2335
- // Add Roman numerals for house numbers
2334
+
2335
+ // Render house numbers at the CENTER of each house sector.
2336
+ // If house cusp data is available, compute the midpoint between cusp[i] and cusp[i+1] (with proper 0/360 wrap).
2337
+ // Otherwise, fall back to equal 30° houses.
2336
2338
  for (let i = 0; i < 12; i++) {
2337
- // Get house angle with rotation
2338
- let baseHouseAngle;
2339
+ const houseNumber = i + 1;
2340
+
2341
+ let midAngle;
2339
2342
  if (this.houseData && this.houseData.length >= 12) {
2340
- baseHouseAngle = this.getHouseLongitude(this.houseData[i]);
2343
+ const startLon = this.getHouseLongitude(this.houseData[i]);
2344
+ const endLon = this.getHouseLongitude(this.houseData[(i + 1) % 12]);
2345
+ const arc = (endLon - startLon + 360) % 360; // always move forward through the zodiac
2346
+ const midLon = (startLon + arc / 2) % 360;
2347
+ midAngle = (midLon + ascendantAlignmentOffset + rotationAngle) % 360;
2341
2348
  } else {
2342
- baseHouseAngle = i * 30; // Default if no data
2349
+ // Equal houses: center of each 30° segment
2350
+ midAngle = (i * 30 + 15 + rotationAngle) % 360;
2343
2351
  }
2344
- // Apply alignment offset and user rotation
2345
- const houseAngle = (baseHouseAngle + ascendantAlignmentOffset + rotationAngle) % 360;
2346
2352
 
2347
- // Offset text from house line clockwise
2348
- const angle = (houseAngle + 15) % 360; // Place in middle of house segment, apply modulo
2353
+ const angle = midAngle;
2349
2354
 
2350
2355
  // Calculate position for house number
2351
2356
  const point = this.svgUtils.pointOnCircle(this.centerX, this.centerY, this.numberRadius, angle);
@@ -2378,11 +2383,11 @@ class HouseRenderer extends BaseRenderer {
2378
2383
  text.setAttribute("dominant-baseline", "middle");
2379
2384
  }
2380
2385
 
2381
- // Set house number as text (Roman numeral)
2382
- text.textContent = AstrologyUtils.houseToRoman(i + 1);
2386
+ // Set house number as text (Roman numeral) - now based on visual position
2387
+ text.textContent = AstrologyUtils.houseToRoman(houseNumber);
2383
2388
 
2384
2389
  // Add tooltip with house information
2385
- this.svgUtils.addTooltip(text, `House ${i + 1}`);
2390
+ this.svgUtils.addTooltip(text, `House ${houseNumber}`);
2386
2391
 
2387
2392
  parentGroup.appendChild(text);
2388
2393
  elements.push(text);
@@ -2841,8 +2846,8 @@ class PlanetPositionCalculator {
2841
2846
  const adjustedPositions = [...positions];
2842
2847
 
2843
2848
  // The minimum angular distance needed to prevent overlap at base radius
2844
- // Add safety factor to ensure visual separation
2845
- const minAngularDistance = (minDistance / baseRadius) * (180 / Math.PI) * 1.3; // 30% extra spacing
2849
+ // minDistance already includes the desired spacing (iconSize * 1.5)
2850
+ const minAngularDistance = (minDistance / baseRadius) * (180 / Math.PI);
2846
2851
  console.log(`PlanetPositionCalculator: Minimum angular distance: ${minAngularDistance.toFixed(2)}°`);
2847
2852
 
2848
2853
  // Sort positions by longitude for overlap detection
@@ -3019,8 +3024,8 @@ class PlanetPositionCalculator {
3019
3024
  let centerAngle = (sumAngles / n) % 360;
3020
3025
 
3021
3026
  // Determine minimum arc needed for n planets with minimum spacing
3022
- // Add extra spacing factor to ensure planets don't overlap
3023
- const minRequiredArc = (n - 1) * minAngularDistance * 1.2; // 20% extra spacing
3027
+ // minAngularDistance already includes the desired spacing
3028
+ const minRequiredArc = (n - 1) * minAngularDistance;
3024
3029
 
3025
3030
  // Always use at least the minimum required arc
3026
3031
  const spanToUse = Math.max(minRequiredArc, totalArc);
@@ -3108,7 +3113,8 @@ class PrimaryPlanetRenderer extends BasePlanetRenderer {
3108
3113
  // Define parameters for collision detection and distribution
3109
3114
  const iconSize = 24;
3110
3115
  const baseRadius = planets[0].iconRadius; // Use the iconRadius from the first planet
3111
- const minDistance = iconSize * 1.2;
3116
+ // Minimum distance = icon diameter + half diameter (0.5 * iconSize spacing between icons)
3117
+ const minDistance = iconSize * 1.5;
3112
3118
 
3113
3119
  // Prepare planets array in format expected by PlanetPositionCalculator
3114
3120
  const positions = planets.map((planet, index) => ({
@@ -3290,7 +3296,8 @@ class SecondaryPlanetRenderer extends BasePlanetRenderer {
3290
3296
  // Define parameters for collision detection and distribution
3291
3297
  const iconSize = 18; // Smaller size for secondary planets
3292
3298
  const baseRadius = planets[0].iconRadius; // Use the iconRadius from the first planet
3293
- const minDistance = iconSize * 1.1; // Slightly tighter packing
3299
+ // Minimum distance = icon diameter + half diameter (0.5 * iconSize spacing between icons)
3300
+ const minDistance = iconSize * 1.5;
3294
3301
 
3295
3302
  // Prepare planets array in format expected by PlanetPositionCalculator
3296
3303
  const positions = planets.map((planet, index) => ({