kaabalah 6.10.0 → 6.11.0

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.
@@ -1344,7 +1344,7 @@ function generateAstroGlyphSvg(keyOrGlyph, options = {}) {
1344
1344
  const svg = generateGlyphSvg(glyph.primitives, options);
1345
1345
  return svg.replace("<svg ", `<svg data-astro-glyph="${escapeAttr2(glyph.key)}" data-astro-glyph-category="${glyph.category}" `);
1346
1346
  }
1347
- function getAstroWheelRenderModel(chart, options = {}) {
1347
+ function buildAstroWheelSvgModel(chart, options = {}) {
1348
1348
  const viewBox = normalizeViewBox2(options.viewBox);
1349
1349
  const palette = resolvePalette2(options.palette, options.background ?? "transparent");
1350
1350
  const excludedBodies = resolveExcludedBodies(options.excludeBodies);
@@ -1352,7 +1352,7 @@ function getAstroWheelRenderModel(chart, options = {}) {
1352
1352
  viewBox.width / ASTRO_WHEEL_DEFAULT_VIEWBOX.width,
1353
1353
  viewBox.height / ASTRO_WHEEL_DEFAULT_VIEWBOX.height
1354
1354
  );
1355
- const padding = options.padding ?? round2(18 * scale + getExternalPointPadding(options, scale));
1355
+ const padding = options.padding ?? round2(18 * scale + getExternalPointPadding());
1356
1356
  const center = {
1357
1357
  x: round2(viewBox.minX + viewBox.width / 2),
1358
1358
  y: round2(viewBox.minY + viewBox.height / 2)
@@ -1381,7 +1381,7 @@ function getAstroWheelRenderModel(chart, options = {}) {
1381
1381
  rings,
1382
1382
  scale
1383
1383
  }) : [];
1384
- const basePointLayer = buildPointLayer({
1384
+ const basePointGroup = buildPointGroup({
1385
1385
  layer: {
1386
1386
  id: "birth",
1387
1387
  label: "Birth",
@@ -1403,27 +1403,12 @@ function getAstroWheelRenderModel(chart, options = {}) {
1403
1403
  maxDisplacementDegrees: maxPointDisplacementDegrees,
1404
1404
  railVisibility
1405
1405
  });
1406
- const extraPointLayers = (options.pointLayers ?? []).map(
1407
- (layer) => buildPointLayer({
1408
- layer,
1409
- center,
1410
- angleOf: angleOf2,
1411
- rings,
1412
- scale,
1413
- palette,
1414
- excludedBodies,
1415
- pointConnectorMode,
1416
- maxDisplacementDegrees: maxPointDisplacementDegrees,
1417
- railVisibility
1418
- })
1419
- );
1420
- const pointLayers = [
1421
- ...resolvedPoints.enabled ? [basePointLayer] : [],
1422
- ...extraPointLayers
1406
+ const pointGroups = [
1407
+ ...resolvedPoints.enabled ? [basePointGroup] : []
1423
1408
  ];
1424
- const points = pointLayers.flatMap((layer) => [...layer.points]);
1409
+ const points = pointGroups.flatMap((layer) => [...layer.points]);
1425
1410
  const pointByKey = Object.fromEntries(points.map((point) => [point.key, point]));
1426
- const baseAspectLayer = resolvedAspects.enabled ? buildAspectLayer({
1411
+ const baseAspectGroup = resolvedAspects.enabled ? buildAspectGroup({
1427
1412
  layer: {
1428
1413
  id: "birth",
1429
1414
  label: "Birth aspects",
@@ -1439,25 +1424,11 @@ function getAstroWheelRenderModel(chart, options = {}) {
1439
1424
  palette,
1440
1425
  excludedBodies
1441
1426
  }) : null;
1442
- const extraAspectLayers = (options.aspectLayers ?? []).map(
1443
- (layer) => buildAspectLayer({
1444
- layer,
1445
- chart: layer.chart ?? chart,
1446
- pointByKey,
1447
- center,
1448
- angleOf: angleOf2,
1449
- rings,
1450
- palette,
1451
- excludedBodies
1452
- })
1453
- );
1454
- const aspectLayers = [
1455
- ...baseAspectLayer ? [baseAspectLayer] : [],
1456
- ...extraAspectLayers
1427
+ const aspectGroups = [
1428
+ ...baseAspectGroup ? [baseAspectGroup] : []
1457
1429
  ];
1458
- const aspectLines = aspectLayers.flatMap((layer) => [...layer.aspectLines]);
1459
- const positionRails = basePointLayer.rails;
1460
- const boundaryNotches = pointLayers.flatMap((layer) => [...layer.notches]);
1430
+ const aspectLines = aspectGroups.flatMap((layer) => [...layer.aspectLines]);
1431
+ const positionRails = basePointGroup.rails;
1461
1432
  return {
1462
1433
  viewBox,
1463
1434
  center,
@@ -1471,15 +1442,14 @@ function getAstroWheelRenderModel(chart, options = {}) {
1471
1442
  points,
1472
1443
  pointByKey,
1473
1444
  aspectLines,
1474
- pointLayers,
1475
- aspectLayers,
1445
+ pointGroups,
1446
+ aspectGroups,
1476
1447
  positionRails,
1477
- boundaryNotches,
1478
1448
  palette
1479
1449
  };
1480
1450
  }
1481
1451
  function generateAstroWheelSvg(chart, options = {}) {
1482
- const model = getAstroWheelRenderModel(chart, options);
1452
+ const model = buildAstroWheelSvgModel(chart, options);
1483
1453
  const viewBox = model.viewBox;
1484
1454
  const zodiacOptions = resolveZodiacOptions(options.zodiac);
1485
1455
  const houseOptions = resolveHouseOptions(options.houses);
@@ -1534,15 +1504,15 @@ function renderSvgDefs(push, model) {
1534
1504
  push(`</defs>`);
1535
1505
  }
1536
1506
  function renderAspects(push, model) {
1537
- if (model.aspectLayers.length === 0) {
1507
+ if (model.aspectGroups.length === 0) {
1538
1508
  return;
1539
1509
  }
1540
1510
  push(`<g id="astro-wheel-aspects" aria-label="aspects">`);
1541
- for (const layer of model.aspectLayers) {
1542
- push(`<g class="astro-wheel-aspect-layer" data-aspect-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
1511
+ for (const layer of model.aspectGroups) {
1512
+ push(`<g class="astro-wheel-aspect-group" data-aspect-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
1543
1513
  for (const aspect of layer.aspectLines) {
1544
1514
  push(
1545
- `<line data-aspect-layer="${escapeAttr2(aspect.layerId)}" data-aspect="${escapeAttr2(aspect.aspect)}" data-planet-a="${escapeAttr2(aspect.planetA)}" data-planet-b="${escapeAttr2(aspect.planetB)}" x1="${fmt2(aspect.line.x1)}" y1="${fmt2(aspect.line.y1)}" x2="${fmt2(aspect.line.x2)}" y2="${fmt2(aspect.line.y2)}" stroke="${escapeAttr2(aspect.color)}" stroke-opacity="${fmt2(aspect.opacity)}" stroke-width="${fmt2(aspect.strokeWidth * model.scale)}" stroke-linecap="round"/>`
1515
+ `<line data-aspect-group="${escapeAttr2(aspect.groupId)}" data-aspect="${escapeAttr2(aspect.aspect)}" data-planet-a="${escapeAttr2(aspect.planetA)}" data-planet-b="${escapeAttr2(aspect.planetB)}" x1="${fmt2(aspect.line.x1)}" y1="${fmt2(aspect.line.y1)}" x2="${fmt2(aspect.line.x2)}" y2="${fmt2(aspect.line.y2)}" stroke="${escapeAttr2(aspect.color)}" stroke-opacity="${fmt2(aspect.opacity)}" stroke-width="${fmt2(aspect.strokeWidth * model.scale)}" stroke-linecap="round"/>`
1546
1516
  );
1547
1517
  }
1548
1518
  push(`</g>`);
@@ -1632,23 +1602,18 @@ function renderHouses(push, model, options) {
1632
1602
  push(`</g>`);
1633
1603
  }
1634
1604
  function renderPlanets(push, model) {
1635
- if (model.pointLayers.length === 0) {
1605
+ if (model.pointGroups.length === 0) {
1636
1606
  return;
1637
1607
  }
1638
1608
  push(`<g id="astro-wheel-planets" aria-label="planets">`);
1639
- for (const layer of model.pointLayers) {
1640
- renderPointLayerGuide(push, layer, model);
1609
+ for (const layer of model.pointGroups) {
1610
+ renderPointGroupGuide(push, layer, model);
1641
1611
  }
1642
- for (const notch of model.boundaryNotches) {
1643
- push(
1644
- `<path class="astro-wheel-boundary-notch" data-point-layer="${escapeAttr2(notch.layerId)}" data-point-key="${escapeAttr2(notch.pointKey)}" data-house="${notch.house}" data-cusp-house="${notch.cuspHouse}" d="${escapeAttr2(notch.path)}" fill="none" stroke="${escapeAttr2(model.palette.houseLine)}" stroke-opacity="0.6" stroke-width="${fmt2(1.1 * model.scale)}" stroke-linejoin="round" stroke-linecap="round"/>`
1645
- );
1646
- }
1647
- for (const layer of model.pointLayers) {
1648
- push(`<g class="astro-wheel-point-layer" data-point-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
1612
+ for (const layer of model.pointGroups) {
1613
+ push(`<g class="astro-wheel-point-group" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
1649
1614
  for (const point of layer.points) {
1650
1615
  push(
1651
- `<g class="astro-wheel-point" data-point-layer="${escapeAttr2(point.layerId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-point-kind="${point.kind}" data-longitude="${fmt2(point.longitude)}">`
1616
+ `<g class="astro-wheel-point" data-point-group="${escapeAttr2(point.groupId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-point-kind="${point.kind}" data-longitude="${fmt2(point.longitude)}">`
1652
1617
  );
1653
1618
  push(`<title>${escapeText2(point.name)} ${fmt2(point.longitude)}\xB0</title>`);
1654
1619
  push(
@@ -1669,17 +1634,17 @@ function renderPlanets(push, model) {
1669
1634
  }
1670
1635
  push(`</g>`);
1671
1636
  }
1672
- function renderPointLayerGuide(push, layer, model) {
1637
+ function renderPointGroupGuide(push, layer, model) {
1673
1638
  const isExternal = layer.radius > model.rings.houses.r2 + model.scale;
1674
1639
  if (!isExternal) {
1675
1640
  return;
1676
1641
  }
1677
1642
  push(
1678
- `<circle class="astro-wheel-external-point-ring" data-point-layer="${escapeAttr2(layer.id)}" cx="${fmt2(model.center.x)}" cy="${fmt2(model.center.y)}" r="${fmt2(layer.radius)}" fill="none" stroke="${escapeAttr2(layer.tickColor)}" stroke-opacity="0.32" stroke-width="${fmt2(1.15 * model.scale)}"/>`
1643
+ `<circle class="astro-wheel-external-point-ring" data-point-group="${escapeAttr2(layer.id)}" cx="${fmt2(model.center.x)}" cy="${fmt2(model.center.y)}" r="${fmt2(layer.radius)}" fill="none" stroke="${escapeAttr2(layer.tickColor)}" stroke-opacity="0.32" stroke-width="${fmt2(1.15 * model.scale)}"/>`
1679
1644
  );
1680
1645
  }
1681
1646
  function renderGlyphOverlay(push, model) {
1682
- if (model.angleMarkers.length === 0 && model.pointLayers.length === 0) {
1647
+ if (model.angleMarkers.length === 0 && model.pointGroups.length === 0) {
1683
1648
  return;
1684
1649
  }
1685
1650
  push(`<g id="astro-wheel-glyph-layer" aria-label="chart glyphs">`);
@@ -1690,10 +1655,10 @@ function renderGlyphOverlay(push, model) {
1690
1655
  }
1691
1656
  push(`</g>`);
1692
1657
  }
1693
- if (model.pointLayers.length > 0) {
1658
+ if (model.pointGroups.length > 0) {
1694
1659
  push(`<g id="astro-wheel-point-glyphs" aria-label="planet glyphs">`);
1695
- for (const layer of model.pointLayers) {
1696
- push(`<g class="astro-wheel-point-glyph-layer" data-point-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)} glyphs"` : ""}>`);
1660
+ for (const layer of model.pointGroups) {
1661
+ push(`<g class="astro-wheel-point-glyph-layer" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)} glyphs"` : ""}>`);
1697
1662
  for (const point of layer.points) {
1698
1663
  renderPointLabelGroup(push, point, model);
1699
1664
  }
@@ -1735,7 +1700,7 @@ function angleDisplayLabel(key) {
1735
1700
  }
1736
1701
  function renderPointLabelGroup(push, point, model) {
1737
1702
  push(
1738
- `<g class="astro-wheel-point-label" data-point-layer="${escapeAttr2(point.layerId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-point-kind="${point.kind}" data-longitude="${fmt2(point.longitude)}" data-display-longitude="${fmt2(point.displayLongitude)}" data-house="${point.house ?? ""}" transform="translate(${fmt2(point.glyphPosition.x)} ${fmt2(point.glyphPosition.y)})" filter="url(#${GLYPH_OUTLINE_FILTER_ID})">`
1703
+ `<g class="astro-wheel-point-label" data-point-group="${escapeAttr2(point.groupId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-point-kind="${point.kind}" data-longitude="${fmt2(point.longitude)}" data-display-longitude="${fmt2(point.displayLongitude)}" data-house="${point.house ?? ""}" transform="translate(${fmt2(point.glyphPosition.x)} ${fmt2(point.glyphPosition.y)})" filter="url(#${GLYPH_OUTLINE_FILTER_ID})">`
1739
1704
  );
1740
1705
  push(`<title>${escapeText2(pointLabelTitle(point))}</title>`);
1741
1706
  renderPointGlyph(push, point, 0, 0, point.glyphScale, model.palette.glyphHalo);
@@ -1744,7 +1709,7 @@ function renderPointLabelGroup(push, point, model) {
1744
1709
  if (!label.visible)
1745
1710
  continue;
1746
1711
  push(
1747
- `<g class="astro-wheel-position-rail-label" data-point-layer="${escapeAttr2(point.layerId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-position-rail="${label.railId}" transform="translate(${fmt2(label.position.x)} ${fmt2(label.position.y)})" filter="url(#${GLYPH_OUTLINE_FILTER_ID})">`
1712
+ `<g class="astro-wheel-position-rail-label" data-point-group="${escapeAttr2(point.groupId)}" data-point-key="${escapeAttr2(point.key)}" data-point-name="${escapeAttr2(point.name)}" data-position-rail="${label.railId}" transform="translate(${fmt2(label.position.x)} ${fmt2(label.position.y)})" filter="url(#${GLYPH_OUTLINE_FILTER_ID})">`
1748
1713
  );
1749
1714
  if (label.railId === "sign" && label.sign) {
1750
1715
  renderInlineSignGlyph(push, label.sign, 0, 0, label.glyphScale ?? label.fontSize, point.color);
@@ -1862,13 +1827,7 @@ function resolvePointGlyph(name) {
1862
1827
  return PLANET_GLYPHS[resolved] ?? ANGLE_GLYPHS[resolved] ?? null;
1863
1828
  }
1864
1829
  function getExternalPointPadding(options, scale) {
1865
- const externalLayers = options.pointLayers?.filter((layer) => layer.radius === "external") ?? [];
1866
- if (externalLayers.length === 0) {
1867
- return 0;
1868
- }
1869
- return Math.max(
1870
- ...externalLayers.map((layer) => (layer.radiusOffset ?? 18) + 36 * scale)
1871
- );
1830
+ return 0;
1872
1831
  }
1873
1832
  function buildZodiacSegments(params) {
1874
1833
  const { center, angleOf: angleOf2, rings, scale, palette } = params;
@@ -1963,7 +1922,7 @@ function buildAngleMarkers(params) {
1963
1922
  };
1964
1923
  });
1965
1924
  }
1966
- function buildPointLayer(params) {
1925
+ function buildPointGroup(params) {
1967
1926
  const {
1968
1927
  layer,
1969
1928
  center,
@@ -1977,7 +1936,7 @@ function buildPointLayer(params) {
1977
1936
  railVisibility
1978
1937
  } = params;
1979
1938
  const ring = rings.planets;
1980
- const requestedRadius = resolvePointLayerRadius(layer, rings);
1939
+ const requestedRadius = resolvePointGroupRadius(layer, rings);
1981
1940
  const requestedExternalLayer = requestedRadius > rings.houses.r2 + scale;
1982
1941
  const thickness = ring.r2 - ring.r1;
1983
1942
  const glyphFontSize = clamp(thickness * 0.68, 14 * scale, 30 * scale) * (layer.glyphScale ?? 1);
@@ -2117,15 +2076,6 @@ function buildPointLayer(params) {
2117
2076
  connector
2118
2077
  };
2119
2078
  });
2120
- const notches = buildBoundaryNotches({
2121
- layerId: layer.id,
2122
- points,
2123
- houses: layer.chart?.houses.houses ?? [],
2124
- center,
2125
- radius,
2126
- ring,
2127
- scale
2128
- });
2129
2079
  return {
2130
2080
  id: layer.id,
2131
2081
  label: layer.label,
@@ -2133,7 +2083,6 @@ function buildPointLayer(params) {
2133
2083
  tickColor,
2134
2084
  radius,
2135
2085
  rails,
2136
- notches,
2137
2086
  points
2138
2087
  };
2139
2088
  }
@@ -2164,7 +2113,7 @@ function makeAstroWheelPoint(params) {
2164
2113
  });
2165
2114
  const glyphScale = glyphFontSize * 0.66;
2166
2115
  return {
2167
- layerId: layer.id,
2116
+ groupId: layer.id,
2168
2117
  key: seed.key,
2169
2118
  name: seed.name,
2170
2119
  kind: seed.kind,
@@ -2199,13 +2148,13 @@ function makeAstroWheelPoint(params) {
2199
2148
  };
2200
2149
  }
2201
2150
  function resolveRailVisibility(input) {
2202
- if (input === "glyph-only") {
2151
+ if (!input || input === "glyph-only") {
2203
2152
  return { degree: false, sign: false, minutes: false, retrograde: false };
2204
2153
  }
2205
2154
  if (input === "compact") {
2206
2155
  return { degree: true, sign: true, minutes: false, retrograde: true };
2207
2156
  }
2208
- if (!input || input === "full") {
2157
+ if (input === "full") {
2209
2158
  return { degree: true, sign: true, minutes: true, retrograde: true };
2210
2159
  }
2211
2160
  return {
@@ -2324,83 +2273,19 @@ function buildPointLineConnector(params) {
2324
2273
  y2: params.glyphPosition.y
2325
2274
  };
2326
2275
  }
2327
- function buildBoundaryNotches(params) {
2328
- if (params.houses.length === 0)
2329
- return [];
2330
- const { center, ring, radius, scale } = params;
2331
- return params.points.flatMap((point) => {
2332
- if (!point.nearestCuspHouse || point.nearestCuspDistanceDegrees === void 0)
2333
- return [];
2334
- const displaced = circularAngleDistance(point.trueAngle, point.displayAngle) > deg2rad2(0.35);
2335
- if (!displaced)
2336
- return [];
2337
- const cusp = params.houses[point.nearestCuspHouse - 1];
2338
- const cuspAngle = point.trueAngle + deg2rad2(shortestLongitudeDistance(point.longitude, cusp.longitude));
2339
- const trueDelta = signedAngleDelta(cuspAngle, point.trueAngle);
2340
- const displayDelta = signedAngleDelta(cuspAngle, point.displayAngle);
2341
- const crossed = Math.sign(trueDelta) !== Math.sign(displayDelta) && displayDelta !== 0;
2342
- const crowds = point.nearestCuspDistanceDegrees <= 2;
2343
- if (!crossed && !crowds)
2344
- return [];
2345
- const glyphHalfAngle = Math.max(point.glyphScale * 0.62, 4 * scale) / Math.max(radius, 1);
2346
- const directed = displayDelta === 0 ? trueDelta : displayDelta;
2347
- const direction = directed >= 0 ? 1 : -1;
2348
- const endAngle = cuspAngle + directed + direction * glyphHalfAngle;
2349
- const halfThickness = Math.max(point.glyphScale * 0.9, 7 * scale);
2350
- const innerRadius = clamp(radius - halfThickness, ring.r1, ring.r2);
2351
- const outerRadius = clamp(radius + halfThickness, ring.r1, ring.r2);
2352
- return [{
2353
- id: `${params.layerId}-${point.key}-notch`,
2354
- layerId: params.layerId,
2355
- pointKey: point.key,
2356
- house: point.house ?? 0,
2357
- cuspHouse: point.nearestCuspHouse,
2358
- cuspLongitude: normalizeAngle(cusp.longitude),
2359
- radius: outerRadius,
2360
- innerRadius,
2361
- outerRadius,
2362
- startAngle: cuspAngle,
2363
- endAngle,
2364
- path: boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle)
2365
- }];
2366
- });
2367
- }
2368
- function boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle) {
2369
- const outerCusp = polarToXY2(center.x, center.y, outerRadius, cuspAngle);
2370
- const outerEnd = polarToXY2(center.x, center.y, outerRadius, endAngle);
2371
- const innerEnd = polarToXY2(center.x, center.y, innerRadius, endAngle);
2372
- const innerCusp = polarToXY2(center.x, center.y, innerRadius, cuspAngle);
2373
- const delta = signedAngleDelta(cuspAngle, endAngle);
2374
- const sweepOuter = delta >= 0 ? 1 : 0;
2375
- const sweepInner = delta >= 0 ? 0 : 1;
2376
- return [
2377
- `M ${fmt2(outerCusp.x)} ${fmt2(outerCusp.y)}`,
2378
- `A ${fmt2(outerRadius)} ${fmt2(outerRadius)} 0 0 ${sweepOuter} ${fmt2(outerEnd.x)} ${fmt2(outerEnd.y)}`,
2379
- `L ${fmt2(innerEnd.x)} ${fmt2(innerEnd.y)}`,
2380
- `A ${fmt2(innerRadius)} ${fmt2(innerRadius)} 0 0 ${sweepInner} ${fmt2(innerCusp.x)} ${fmt2(innerCusp.y)}`,
2381
- "Z"
2382
- ].join(" ");
2383
- }
2384
- function buildAspectLayer(params) {
2276
+ function buildAspectGroup(params) {
2385
2277
  const { layer, chart, pointByKey, center, angleOf: angleOf2, rings, palette, excludedBodies } = params;
2386
- const sourceEdges = layer.edges ? layer.edges : layer.chartB ? computeCrossAspectEdges(
2387
- chart.planets,
2388
- layer.chartB.planets,
2389
- layer.aspectSpecs ?? ASTRO_WHEEL_DEFAULT_ASPECT_SPECS
2390
- ) : getSourceAspectEdges(chart, {
2278
+ const sourceEdges = layer.edges ? layer.edges : getSourceAspectEdges(chart, {
2391
2279
  edges: layer.edges,
2392
2280
  aspectSpecs: layer.aspectSpecs
2393
2281
  });
2394
2282
  const aspectRadius = layer.radius ?? rings.aspects.r2 * (layer.radiusScale ?? 0.96);
2395
- const layerPointPrefix = pointKeyPrefix(layer.pointLayerId);
2396
- const layerPointPrefixA = layer.pointLayerIdA ? pointKeyPrefix(layer.pointLayerIdA) : layerPointPrefix;
2397
- const layerPointPrefixB = layer.pointLayerIdB ? pointKeyPrefix(layer.pointLayerIdB) : layerPointPrefix;
2398
2283
  const aspectLines = sourceEdges.flatMap((edge) => {
2399
2284
  if (isExcludedBody(edge.planetA, excludedBodies) || isExcludedBody(edge.planetB, excludedBodies)) {
2400
2285
  return [];
2401
2286
  }
2402
- const planetAKey = layerPointPrefixA + normalizePointKey(edge.planetA);
2403
- const planetBKey = layerPointPrefixB + normalizePointKey(edge.planetB);
2287
+ const planetAKey = normalizePointKey(edge.planetA);
2288
+ const planetBKey = normalizePointKey(edge.planetB);
2404
2289
  const planetA = pointByKey[planetAKey];
2405
2290
  const planetB = pointByKey[planetBKey];
2406
2291
  if (!planetA || !planetB) {
@@ -2412,7 +2297,7 @@ function buildAspectLayer(params) {
2412
2297
  const a = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetA.longitude)) : planetA.trueAnchor;
2413
2298
  const b = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetB.longitude)) : planetB.trueAnchor;
2414
2299
  return [{
2415
- layerId: layer.id,
2300
+ groupId: layer.id,
2416
2301
  planetA: planetA.name,
2417
2302
  planetB: planetB.name,
2418
2303
  planetAKey,
@@ -2471,9 +2356,9 @@ function getPointSeeds(layer, excludedBodies) {
2471
2356
  }
2472
2357
  return seeds.filter((seed) => !isExcludedBody(seed.name, excludedBodies)).sort((a, b) => normalizeAngle(a.longitude) - normalizeAngle(b.longitude));
2473
2358
  }
2474
- function planetSeed(key, planet, layerId) {
2359
+ function planetSeed(key, planet, groupId) {
2475
2360
  return {
2476
- key: layerPointKey(layerId, key || planet.name),
2361
+ key: layerPointKey(groupId, key || planet.name),
2477
2362
  name: planet.name,
2478
2363
  kind: "planet",
2479
2364
  glyph: pointGlyph(planet.name),
@@ -2483,9 +2368,9 @@ function planetSeed(key, planet, layerId) {
2483
2368
  zodiacPosition: planet.zodiacPosition
2484
2369
  };
2485
2370
  }
2486
- function nodeSeed(key, node, layerId) {
2371
+ function nodeSeed(key, node, groupId) {
2487
2372
  return {
2488
- key: layerPointKey(layerId, node.name || key),
2373
+ key: layerPointKey(groupId, node.name || key),
2489
2374
  name: node.name,
2490
2375
  kind: "node",
2491
2376
  glyph: pointGlyph(node.name),
@@ -2494,9 +2379,9 @@ function nodeSeed(key, node, layerId) {
2494
2379
  zodiacPosition: node
2495
2380
  };
2496
2381
  }
2497
- function pointSeed(point, layerId) {
2382
+ function pointSeed(point, groupId) {
2498
2383
  return {
2499
- key: layerPointKey(layerId, point.key ?? point.name),
2384
+ key: layerPointKey(groupId, point.key ?? point.name),
2500
2385
  name: point.name,
2501
2386
  kind: point.kind ?? "planet",
2502
2387
  glyph: point.glyph ?? pointGlyph(point.name),
@@ -2511,7 +2396,7 @@ function solveCircularLabelAngles(items, options) {
2511
2396
  if (items.length === 0) {
2512
2397
  return [];
2513
2398
  }
2514
- const normalized = items.map((item) => ({
2399
+ const normalized = seedExactAngleClusters(items, { paddingPx, maxDisplacementRad }).map((item) => ({
2515
2400
  ...item,
2516
2401
  idealAngle: clampRad(item.idealAngle)
2517
2402
  })).sort((a, b) => a.idealAngle - b.idealAngle);
@@ -2550,8 +2435,8 @@ function solveCircularLabelAngles(items, options) {
2550
2435
  }
2551
2436
  const solved = linear.map((item) => ({
2552
2437
  ...item,
2553
- visualAngle: item.idealAngle
2554
- }));
2438
+ visualAngle: item.visualAngleSeed ?? item.idealAngle
2439
+ })).sort((a, b) => a.visualAngle - b.visualAngle);
2555
2440
  for (let iteration = 0; iteration < 50; iteration++) {
2556
2441
  const forces = new Array(solved.length).fill(0);
2557
2442
  let maxForce = 0;
@@ -2594,6 +2479,38 @@ function solveCircularLabelAngles(items, options) {
2594
2479
  visualAngle: clampRad(item.visualAngle)
2595
2480
  }));
2596
2481
  }
2482
+ function seedExactAngleClusters(items, options) {
2483
+ const seeded = items.map((item) => ({
2484
+ ...item,
2485
+ idealAngle: clampRad(item.idealAngle)
2486
+ }));
2487
+ const groups = /* @__PURE__ */ new Map();
2488
+ for (const item of seeded) {
2489
+ const key = item.idealAngle.toFixed(6);
2490
+ const group = groups.get(key);
2491
+ if (group) {
2492
+ group.push(item);
2493
+ } else {
2494
+ groups.set(key, [item]);
2495
+ }
2496
+ }
2497
+ for (const group of groups.values()) {
2498
+ if (group.length < 2) {
2499
+ continue;
2500
+ }
2501
+ const center = group[0].idealAngle;
2502
+ const largestDemand = Math.max(
2503
+ ...group.map((item) => labelAngularHalfDemand(item, options.paddingPx) * 2)
2504
+ );
2505
+ const maxStep = group.length > 1 ? options.maxDisplacementRad * 2 / (group.length - 1) : largestDemand;
2506
+ const step = Math.min(largestDemand, maxStep);
2507
+ const midpoint2 = (group.length - 1) / 2;
2508
+ group.forEach((item, index) => {
2509
+ item.visualAngleSeed = center + (index - midpoint2) * step;
2510
+ });
2511
+ }
2512
+ return seeded;
2513
+ }
2597
2514
  function clampAngleAroundIdeal(value, ideal, maxDistance) {
2598
2515
  if (!Number.isFinite(maxDistance) || maxDistance >= Math.PI) {
2599
2516
  return value;
@@ -2677,32 +2594,6 @@ function computeAspectEdges(planets, specs) {
2677
2594
  }
2678
2595
  return edges;
2679
2596
  }
2680
- function computeCrossAspectEdges(planetsA, planetsB, specs) {
2681
- const keysA = Object.keys(planetsA);
2682
- const keysB = Object.keys(planetsB);
2683
- const edges = [];
2684
- for (const keyA of keysA) {
2685
- for (const keyB of keysB) {
2686
- const planetA = planetsA[keyA];
2687
- const planetB = planetsB[keyB];
2688
- const match = getAspectMatch(planetA.longitude, planetB.longitude, specs);
2689
- if (!match) {
2690
- continue;
2691
- }
2692
- edges.push({
2693
- planetA: keyA,
2694
- planetB: keyB,
2695
- longitudeA: normalizeAngle(planetA.longitude),
2696
- longitudeB: normalizeAngle(planetB.longitude),
2697
- aspect: match.spec.name,
2698
- aspectAngle: match.spec.angle,
2699
- delta: match.delta,
2700
- orb: match.orb
2701
- });
2702
- }
2703
- }
2704
- return edges;
2705
- }
2706
2597
  function getAspectMatch(lonA, lonB, specs) {
2707
2598
  const delta = Math.min(
2708
2599
  normalizeAngle(lonB - lonA),
@@ -2851,7 +2742,7 @@ function resolveAspectOptions(options) {
2851
2742
  aspectSpecs: options.aspectSpecs
2852
2743
  };
2853
2744
  }
2854
- function resolvePointLayerRadius(layer, rings) {
2745
+ function resolvePointGroupRadius(layer, rings) {
2855
2746
  const ring = rings.planets;
2856
2747
  if (layer.radius === "external") {
2857
2748
  return rings.houses.r2 + (layer.radiusOffset ?? 18);
@@ -2884,12 +2775,9 @@ function isExcludedBody(name, excludedBodies) {
2884
2775
  function normalizePointKey(value) {
2885
2776
  return value.trim().toLocaleLowerCase().replace(/[_-]+/g, " ").replace(/\s+/g, " ");
2886
2777
  }
2887
- function layerPointKey(layerId, value) {
2778
+ function layerPointKey(groupId, value) {
2888
2779
  const key = normalizePointKey(value);
2889
- return layerId === "birth" ? key : `${layerId}:${key}`;
2890
- }
2891
- function pointKeyPrefix(layerId) {
2892
- return !layerId || layerId === "birth" ? "" : `${layerId}:`;
2780
+ return groupId === "birth" ? key : `${groupId}:${key}`;
2893
2781
  }
2894
2782
  function renderGlyphPrimitives(push, primitives, options) {
2895
2783
  for (const p of primitives) {
@@ -3957,6 +3845,6 @@ function escapeAttr3(value) {
3957
3845
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3958
3846
  }
3959
3847
 
3960
- export { ANGLE_GLYPHS, ANGLE_GLYPH_PRIMITIVES, ARCHEOMETER_DEFAULT_VIEWBOX, ASPECT_GLYPHS, ASPECT_GLYPH_PRIMITIVES, ASTRO_GLYPHS, ASTRO_WHEEL_DEFAULT_ASPECT_SPECS, ASTRO_WHEEL_DEFAULT_VIEWBOX, ASTRO_WHEEL_POINT_GLYPHS, ASTRO_WHEEL_ZODIAC_SIGNS, DEFAULT_ARCHEOMETER_MUSICAL_NOTES, DEFAULT_ARCHEOMETER_PLANETS, DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES, DEFAULT_ARCHEOMETER_TRIANGLES, DEFAULT_ARCHEOMETER_TRIANGLE_LABELS, DEFAULT_ARCHEOMETER_UTTERANCE, DEFAULT_ARCHEOMETER_ZODIAC, DEFAULT_ARCHETYPE_MUSICAL_NOTES, DEFAULT_ARCHETYPE_PLANETS, DEFAULT_ARCHETYPE_TRIANGLES, DEFAULT_ARCHETYPE_UTTERANCE, DEFAULT_ARCHETYPE_ZODIAC, PLANET_GLYPHS, PLANET_GLYPH_PRIMITIVES, TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, ZODIAC_GLYPHS, ZODIAC_GLYPH_PRIMITIVES, generateArcheometerSvg, generateAstroGlyphSvg, generateAstroWheelSvg, generateGlyphSvg, generateTreeSvg, getArcheometerRenderModel, getAstroGlyph, getAstroWheelRenderModel, getRouteActivations, getTreeLayout, getTreeRenderModel, listAstroGlyphs };
3848
+ export { ANGLE_GLYPHS, ANGLE_GLYPH_PRIMITIVES, ARCHEOMETER_DEFAULT_VIEWBOX, ASPECT_GLYPHS, ASPECT_GLYPH_PRIMITIVES, ASTRO_GLYPHS, ASTRO_WHEEL_DEFAULT_ASPECT_SPECS, ASTRO_WHEEL_DEFAULT_VIEWBOX, ASTRO_WHEEL_POINT_GLYPHS, ASTRO_WHEEL_ZODIAC_SIGNS, DEFAULT_ARCHEOMETER_MUSICAL_NOTES, DEFAULT_ARCHEOMETER_PLANETS, DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES, DEFAULT_ARCHEOMETER_TRIANGLES, DEFAULT_ARCHEOMETER_TRIANGLE_LABELS, DEFAULT_ARCHEOMETER_UTTERANCE, DEFAULT_ARCHEOMETER_ZODIAC, DEFAULT_ARCHETYPE_MUSICAL_NOTES, DEFAULT_ARCHETYPE_PLANETS, DEFAULT_ARCHETYPE_TRIANGLES, DEFAULT_ARCHETYPE_UTTERANCE, DEFAULT_ARCHETYPE_ZODIAC, PLANET_GLYPHS, PLANET_GLYPH_PRIMITIVES, TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, ZODIAC_GLYPHS, ZODIAC_GLYPH_PRIMITIVES, generateArcheometerSvg, generateAstroGlyphSvg, generateAstroWheelSvg, generateGlyphSvg, generateTreeSvg, getArcheometerRenderModel, getAstroGlyph, getRouteActivations, getTreeLayout, getTreeRenderModel, listAstroGlyphs };
3961
3849
  //# sourceMappingURL=out.js.map
3962
- //# sourceMappingURL=chunk-PPIKM3QA.mjs.map
3850
+ //# sourceMappingURL=chunk-4MACEIWO.mjs.map