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.
package/dist/cli.js CHANGED
@@ -10432,7 +10432,7 @@ function generateAstroGlyphSvg(keyOrGlyph, options = {}) {
10432
10432
  const svg = generateGlyphSvg(glyph.primitives, options);
10433
10433
  return svg.replace("<svg ", `<svg data-astro-glyph="${escapeAttr2(glyph.key)}" data-astro-glyph-category="${glyph.category}" `);
10434
10434
  }
10435
- function getAstroWheelRenderModel(chart, options = {}) {
10435
+ function buildAstroWheelSvgModel(chart, options = {}) {
10436
10436
  const viewBox = normalizeViewBox2(options.viewBox);
10437
10437
  const palette = resolvePalette2(options.palette, options.background ?? "transparent");
10438
10438
  const excludedBodies = resolveExcludedBodies(options.excludeBodies);
@@ -10469,7 +10469,7 @@ function getAstroWheelRenderModel(chart, options = {}) {
10469
10469
  rings,
10470
10470
  scale
10471
10471
  }) : [];
10472
- const basePointLayer = buildPointLayer({
10472
+ const basePointGroup = buildPointGroup({
10473
10473
  layer: {
10474
10474
  id: "birth",
10475
10475
  label: "Birth",
@@ -10491,27 +10491,12 @@ function getAstroWheelRenderModel(chart, options = {}) {
10491
10491
  maxDisplacementDegrees: maxPointDisplacementDegrees,
10492
10492
  railVisibility
10493
10493
  });
10494
- const extraPointLayers = (options.pointLayers ?? []).map(
10495
- (layer) => buildPointLayer({
10496
- layer,
10497
- center,
10498
- angleOf: angleOf2,
10499
- rings,
10500
- scale,
10501
- palette,
10502
- excludedBodies,
10503
- pointConnectorMode,
10504
- maxDisplacementDegrees: maxPointDisplacementDegrees,
10505
- railVisibility
10506
- })
10507
- );
10508
- const pointLayers = [
10509
- ...resolvedPoints.enabled ? [basePointLayer] : [],
10510
- ...extraPointLayers
10494
+ const pointGroups = [
10495
+ ...resolvedPoints.enabled ? [basePointGroup] : []
10511
10496
  ];
10512
- const points = pointLayers.flatMap((layer) => [...layer.points]);
10497
+ const points = pointGroups.flatMap((layer) => [...layer.points]);
10513
10498
  const pointByKey = Object.fromEntries(points.map((point) => [point.key, point]));
10514
- const baseAspectLayer = resolvedAspects.enabled ? buildAspectLayer({
10499
+ const baseAspectGroup = resolvedAspects.enabled ? buildAspectGroup({
10515
10500
  layer: {
10516
10501
  id: "birth",
10517
10502
  label: "Birth aspects",
@@ -10527,25 +10512,11 @@ function getAstroWheelRenderModel(chart, options = {}) {
10527
10512
  palette,
10528
10513
  excludedBodies
10529
10514
  }) : null;
10530
- const extraAspectLayers = (options.aspectLayers ?? []).map(
10531
- (layer) => buildAspectLayer({
10532
- layer,
10533
- chart: layer.chart ?? chart,
10534
- pointByKey,
10535
- center,
10536
- angleOf: angleOf2,
10537
- rings,
10538
- palette,
10539
- excludedBodies
10540
- })
10541
- );
10542
- const aspectLayers = [
10543
- ...baseAspectLayer ? [baseAspectLayer] : [],
10544
- ...extraAspectLayers
10515
+ const aspectGroups = [
10516
+ ...baseAspectGroup ? [baseAspectGroup] : []
10545
10517
  ];
10546
- const aspectLines = aspectLayers.flatMap((layer) => [...layer.aspectLines]);
10547
- const positionRails = basePointLayer.rails;
10548
- const boundaryNotches = pointLayers.flatMap((layer) => [...layer.notches]);
10518
+ const aspectLines = aspectGroups.flatMap((layer) => [...layer.aspectLines]);
10519
+ const positionRails = basePointGroup.rails;
10549
10520
  return {
10550
10521
  viewBox,
10551
10522
  center,
@@ -10559,15 +10530,14 @@ function getAstroWheelRenderModel(chart, options = {}) {
10559
10530
  points,
10560
10531
  pointByKey,
10561
10532
  aspectLines,
10562
- pointLayers,
10563
- aspectLayers,
10533
+ pointGroups,
10534
+ aspectGroups,
10564
10535
  positionRails,
10565
- boundaryNotches,
10566
10536
  palette
10567
10537
  };
10568
10538
  }
10569
10539
  function generateAstroWheelSvg(chart, options = {}) {
10570
- const model = getAstroWheelRenderModel(chart, options);
10540
+ const model = buildAstroWheelSvgModel(chart, options);
10571
10541
  const viewBox = model.viewBox;
10572
10542
  const zodiacOptions = resolveZodiacOptions(options.zodiac);
10573
10543
  const houseOptions = resolveHouseOptions(options.houses);
@@ -10622,15 +10592,15 @@ function renderSvgDefs(push, model) {
10622
10592
  push(`</defs>`);
10623
10593
  }
10624
10594
  function renderAspects(push, model) {
10625
- if (model.aspectLayers.length === 0) {
10595
+ if (model.aspectGroups.length === 0) {
10626
10596
  return;
10627
10597
  }
10628
10598
  push(`<g id="astro-wheel-aspects" aria-label="aspects">`);
10629
- for (const layer of model.aspectLayers) {
10630
- push(`<g class="astro-wheel-aspect-layer" data-aspect-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
10599
+ for (const layer of model.aspectGroups) {
10600
+ push(`<g class="astro-wheel-aspect-group" data-aspect-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
10631
10601
  for (const aspect of layer.aspectLines) {
10632
10602
  push(
10633
- `<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"/>`
10603
+ `<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"/>`
10634
10604
  );
10635
10605
  }
10636
10606
  push(`</g>`);
@@ -10720,23 +10690,18 @@ function renderHouses(push, model, options) {
10720
10690
  push(`</g>`);
10721
10691
  }
10722
10692
  function renderPlanets(push, model) {
10723
- if (model.pointLayers.length === 0) {
10693
+ if (model.pointGroups.length === 0) {
10724
10694
  return;
10725
10695
  }
10726
10696
  push(`<g id="astro-wheel-planets" aria-label="planets">`);
10727
- for (const layer of model.pointLayers) {
10728
- renderPointLayerGuide(push, layer, model);
10697
+ for (const layer of model.pointGroups) {
10698
+ renderPointGroupGuide(push, layer, model);
10729
10699
  }
10730
- for (const notch of model.boundaryNotches) {
10731
- push(
10732
- `<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"/>`
10733
- );
10734
- }
10735
- for (const layer of model.pointLayers) {
10736
- push(`<g class="astro-wheel-point-layer" data-point-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
10700
+ for (const layer of model.pointGroups) {
10701
+ push(`<g class="astro-wheel-point-group" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
10737
10702
  for (const point of layer.points) {
10738
10703
  push(
10739
- `<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)}">`
10704
+ `<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)}">`
10740
10705
  );
10741
10706
  push(`<title>${escapeText2(point.name)} ${fmt2(point.longitude)}\xB0</title>`);
10742
10707
  push(
@@ -10757,17 +10722,17 @@ function renderPlanets(push, model) {
10757
10722
  }
10758
10723
  push(`</g>`);
10759
10724
  }
10760
- function renderPointLayerGuide(push, layer, model) {
10725
+ function renderPointGroupGuide(push, layer, model) {
10761
10726
  const isExternal = layer.radius > model.rings.houses.r2 + model.scale;
10762
10727
  if (!isExternal) {
10763
10728
  return;
10764
10729
  }
10765
10730
  push(
10766
- `<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)}"/>`
10731
+ `<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)}"/>`
10767
10732
  );
10768
10733
  }
10769
10734
  function renderGlyphOverlay(push, model) {
10770
- if (model.angleMarkers.length === 0 && model.pointLayers.length === 0) {
10735
+ if (model.angleMarkers.length === 0 && model.pointGroups.length === 0) {
10771
10736
  return;
10772
10737
  }
10773
10738
  push(`<g id="astro-wheel-glyph-layer" aria-label="chart glyphs">`);
@@ -10778,10 +10743,10 @@ function renderGlyphOverlay(push, model) {
10778
10743
  }
10779
10744
  push(`</g>`);
10780
10745
  }
10781
- if (model.pointLayers.length > 0) {
10746
+ if (model.pointGroups.length > 0) {
10782
10747
  push(`<g id="astro-wheel-point-glyphs" aria-label="planet glyphs">`);
10783
- for (const layer of model.pointLayers) {
10784
- push(`<g class="astro-wheel-point-glyph-layer" data-point-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)} glyphs"` : ""}>`);
10748
+ for (const layer of model.pointGroups) {
10749
+ push(`<g class="astro-wheel-point-glyph-layer" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)} glyphs"` : ""}>`);
10785
10750
  for (const point of layer.points) {
10786
10751
  renderPointLabelGroup(push, point, model);
10787
10752
  }
@@ -10823,7 +10788,7 @@ function angleDisplayLabel(key) {
10823
10788
  }
10824
10789
  function renderPointLabelGroup(push, point, model) {
10825
10790
  push(
10826
- `<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})">`
10791
+ `<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})">`
10827
10792
  );
10828
10793
  push(`<title>${escapeText2(pointLabelTitle(point))}</title>`);
10829
10794
  renderPointGlyph(push, point, 0, 0, point.glyphScale, model.palette.glyphHalo);
@@ -10832,7 +10797,7 @@ function renderPointLabelGroup(push, point, model) {
10832
10797
  if (!label.visible)
10833
10798
  continue;
10834
10799
  push(
10835
- `<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})">`
10800
+ `<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})">`
10836
10801
  );
10837
10802
  if (label.railId === "sign" && label.sign) {
10838
10803
  renderInlineSignGlyph(push, label.sign, 0, 0, label.glyphScale ?? label.fontSize, point.color);
@@ -10922,13 +10887,7 @@ function resolvePointGlyph(name) {
10922
10887
  return PLANET_GLYPHS[resolved] ?? ANGLE_GLYPHS[resolved] ?? null;
10923
10888
  }
10924
10889
  function getExternalPointPadding(options, scale) {
10925
- const externalLayers = options.pointLayers?.filter((layer) => layer.radius === "external") ?? [];
10926
- if (externalLayers.length === 0) {
10927
- return 0;
10928
- }
10929
- return Math.max(
10930
- ...externalLayers.map((layer) => (layer.radiusOffset ?? 18) + 36 * scale)
10931
- );
10890
+ return 0;
10932
10891
  }
10933
10892
  function buildZodiacSegments(params) {
10934
10893
  const { center, angleOf: angleOf2, rings, scale, palette } = params;
@@ -11023,7 +10982,7 @@ function buildAngleMarkers(params) {
11023
10982
  };
11024
10983
  });
11025
10984
  }
11026
- function buildPointLayer(params) {
10985
+ function buildPointGroup(params) {
11027
10986
  const {
11028
10987
  layer,
11029
10988
  center,
@@ -11037,7 +10996,7 @@ function buildPointLayer(params) {
11037
10996
  railVisibility
11038
10997
  } = params;
11039
10998
  const ring = rings.planets;
11040
- const requestedRadius = resolvePointLayerRadius(layer, rings);
10999
+ const requestedRadius = resolvePointGroupRadius(layer, rings);
11041
11000
  const requestedExternalLayer = requestedRadius > rings.houses.r2 + scale;
11042
11001
  const thickness = ring.r2 - ring.r1;
11043
11002
  const glyphFontSize = clamp(thickness * 0.68, 14 * scale, 30 * scale) * (layer.glyphScale ?? 1);
@@ -11177,15 +11136,6 @@ function buildPointLayer(params) {
11177
11136
  connector
11178
11137
  };
11179
11138
  });
11180
- const notches = buildBoundaryNotches({
11181
- layerId: layer.id,
11182
- points,
11183
- houses: layer.chart?.houses.houses ?? [],
11184
- center,
11185
- radius,
11186
- ring,
11187
- scale
11188
- });
11189
11139
  return {
11190
11140
  id: layer.id,
11191
11141
  label: layer.label,
@@ -11193,7 +11143,6 @@ function buildPointLayer(params) {
11193
11143
  tickColor,
11194
11144
  radius,
11195
11145
  rails,
11196
- notches,
11197
11146
  points
11198
11147
  };
11199
11148
  }
@@ -11225,7 +11174,7 @@ function makeAstroWheelPoint(params) {
11225
11174
  });
11226
11175
  const glyphScale = glyphFontSize * 0.66;
11227
11176
  return {
11228
- layerId: layer.id,
11177
+ groupId: layer.id,
11229
11178
  key: seed.key,
11230
11179
  name: seed.name,
11231
11180
  kind: seed.kind,
@@ -11260,13 +11209,13 @@ function makeAstroWheelPoint(params) {
11260
11209
  };
11261
11210
  }
11262
11211
  function resolveRailVisibility(input) {
11263
- if (input === "glyph-only") {
11212
+ if (!input || input === "glyph-only") {
11264
11213
  return { degree: false, sign: false, minutes: false, retrograde: false };
11265
11214
  }
11266
11215
  if (input === "compact") {
11267
11216
  return { degree: true, sign: true, minutes: false, retrograde: true };
11268
11217
  }
11269
- if (!input || input === "full") {
11218
+ if (input === "full") {
11270
11219
  return { degree: true, sign: true, minutes: true, retrograde: true };
11271
11220
  }
11272
11221
  return {
@@ -11385,84 +11334,20 @@ function buildPointLineConnector(params) {
11385
11334
  y2: params.glyphPosition.y
11386
11335
  };
11387
11336
  }
11388
- function buildBoundaryNotches(params) {
11389
- if (params.houses.length === 0)
11390
- return [];
11391
- const { center, ring, radius, scale } = params;
11392
- return params.points.flatMap((point) => {
11393
- if (!point.nearestCuspHouse || point.nearestCuspDistanceDegrees === void 0)
11394
- return [];
11395
- const displaced = circularAngleDistance(point.trueAngle, point.displayAngle) > deg2rad2(0.35);
11396
- if (!displaced)
11397
- return [];
11398
- const cusp = params.houses[point.nearestCuspHouse - 1];
11399
- const cuspAngle = point.trueAngle + deg2rad2(shortestLongitudeDistance(point.longitude, cusp.longitude));
11400
- const trueDelta = signedAngleDelta(cuspAngle, point.trueAngle);
11401
- const displayDelta = signedAngleDelta(cuspAngle, point.displayAngle);
11402
- const crossed = Math.sign(trueDelta) !== Math.sign(displayDelta) && displayDelta !== 0;
11403
- const crowds = point.nearestCuspDistanceDegrees <= 2;
11404
- if (!crossed && !crowds)
11405
- return [];
11406
- const glyphHalfAngle = Math.max(point.glyphScale * 0.62, 4 * scale) / Math.max(radius, 1);
11407
- const directed = displayDelta === 0 ? trueDelta : displayDelta;
11408
- const direction = directed >= 0 ? 1 : -1;
11409
- const endAngle = cuspAngle + directed + direction * glyphHalfAngle;
11410
- const halfThickness = Math.max(point.glyphScale * 0.9, 7 * scale);
11411
- const innerRadius = clamp(radius - halfThickness, ring.r1, ring.r2);
11412
- const outerRadius = clamp(radius + halfThickness, ring.r1, ring.r2);
11413
- return [{
11414
- id: `${params.layerId}-${point.key}-notch`,
11415
- layerId: params.layerId,
11416
- pointKey: point.key,
11417
- house: point.house ?? 0,
11418
- cuspHouse: point.nearestCuspHouse,
11419
- cuspLongitude: normalizeAngle2(cusp.longitude),
11420
- radius: outerRadius,
11421
- innerRadius,
11422
- outerRadius,
11423
- startAngle: cuspAngle,
11424
- endAngle,
11425
- path: boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle)
11426
- }];
11427
- });
11428
- }
11429
- function boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle) {
11430
- const outerCusp = polarToXY2(center.x, center.y, outerRadius, cuspAngle);
11431
- const outerEnd = polarToXY2(center.x, center.y, outerRadius, endAngle);
11432
- const innerEnd = polarToXY2(center.x, center.y, innerRadius, endAngle);
11433
- const innerCusp = polarToXY2(center.x, center.y, innerRadius, cuspAngle);
11434
- const delta = signedAngleDelta(cuspAngle, endAngle);
11435
- const sweepOuter = delta >= 0 ? 1 : 0;
11436
- const sweepInner = delta >= 0 ? 0 : 1;
11437
- return [
11438
- `M ${fmt2(outerCusp.x)} ${fmt2(outerCusp.y)}`,
11439
- `A ${fmt2(outerRadius)} ${fmt2(outerRadius)} 0 0 ${sweepOuter} ${fmt2(outerEnd.x)} ${fmt2(outerEnd.y)}`,
11440
- `L ${fmt2(innerEnd.x)} ${fmt2(innerEnd.y)}`,
11441
- `A ${fmt2(innerRadius)} ${fmt2(innerRadius)} 0 0 ${sweepInner} ${fmt2(innerCusp.x)} ${fmt2(innerCusp.y)}`,
11442
- "Z"
11443
- ].join(" ");
11444
- }
11445
- function buildAspectLayer(params) {
11337
+ function buildAspectGroup(params) {
11446
11338
  const { layer, chart, pointByKey, center, angleOf: angleOf2, rings, palette, excludedBodies } = params;
11447
- const sourceEdges = layer.edges ? layer.edges : layer.chartB ? computeCrossAspectEdges(
11448
- chart.planets,
11449
- layer.chartB.planets,
11450
- layer.aspectSpecs ?? ASTRO_WHEEL_DEFAULT_ASPECT_SPECS
11451
- ) : getSourceAspectEdges(chart, {
11339
+ const sourceEdges = layer.edges ? layer.edges : getSourceAspectEdges(chart, {
11452
11340
  enabled: true,
11453
11341
  edges: layer.edges,
11454
11342
  aspectSpecs: layer.aspectSpecs
11455
11343
  });
11456
11344
  const aspectRadius = layer.radius ?? rings.aspects.r2 * (layer.radiusScale ?? 0.96);
11457
- const layerPointPrefix = pointKeyPrefix(layer.pointLayerId);
11458
- const layerPointPrefixA = layer.pointLayerIdA ? pointKeyPrefix(layer.pointLayerIdA) : layerPointPrefix;
11459
- const layerPointPrefixB = layer.pointLayerIdB ? pointKeyPrefix(layer.pointLayerIdB) : layerPointPrefix;
11460
11345
  const aspectLines = sourceEdges.flatMap((edge) => {
11461
11346
  if (isExcludedBody(edge.planetA, excludedBodies) || isExcludedBody(edge.planetB, excludedBodies)) {
11462
11347
  return [];
11463
11348
  }
11464
- const planetAKey = layerPointPrefixA + normalizePointKey(edge.planetA);
11465
- const planetBKey = layerPointPrefixB + normalizePointKey(edge.planetB);
11349
+ const planetAKey = normalizePointKey(edge.planetA);
11350
+ const planetBKey = normalizePointKey(edge.planetB);
11466
11351
  const planetA = pointByKey[planetAKey];
11467
11352
  const planetB = pointByKey[planetBKey];
11468
11353
  if (!planetA || !planetB) {
@@ -11474,7 +11359,7 @@ function buildAspectLayer(params) {
11474
11359
  const a = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetA.longitude)) : planetA.trueAnchor;
11475
11360
  const b = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetB.longitude)) : planetB.trueAnchor;
11476
11361
  return [{
11477
- layerId: layer.id,
11362
+ groupId: layer.id,
11478
11363
  planetA: planetA.name,
11479
11364
  planetB: planetB.name,
11480
11365
  planetAKey,
@@ -11533,9 +11418,9 @@ function getPointSeeds(layer, excludedBodies) {
11533
11418
  }
11534
11419
  return seeds.filter((seed) => !isExcludedBody(seed.name, excludedBodies)).sort((a, b) => normalizeAngle2(a.longitude) - normalizeAngle2(b.longitude));
11535
11420
  }
11536
- function planetSeed(key, planet, layerId) {
11421
+ function planetSeed(key, planet, groupId) {
11537
11422
  return {
11538
- key: layerPointKey(layerId, key || planet.name),
11423
+ key: layerPointKey(groupId, key || planet.name),
11539
11424
  name: planet.name,
11540
11425
  kind: "planet",
11541
11426
  glyph: pointGlyph(planet.name),
@@ -11545,9 +11430,9 @@ function planetSeed(key, planet, layerId) {
11545
11430
  zodiacPosition: planet.zodiacPosition
11546
11431
  };
11547
11432
  }
11548
- function nodeSeed(key, node, layerId) {
11433
+ function nodeSeed(key, node, groupId) {
11549
11434
  return {
11550
- key: layerPointKey(layerId, node.name || key),
11435
+ key: layerPointKey(groupId, node.name || key),
11551
11436
  name: node.name,
11552
11437
  kind: "node",
11553
11438
  glyph: pointGlyph(node.name),
@@ -11556,9 +11441,9 @@ function nodeSeed(key, node, layerId) {
11556
11441
  zodiacPosition: node
11557
11442
  };
11558
11443
  }
11559
- function pointSeed(point, layerId) {
11444
+ function pointSeed(point, groupId) {
11560
11445
  return {
11561
- key: layerPointKey(layerId, point.key ?? point.name),
11446
+ key: layerPointKey(groupId, point.key ?? point.name),
11562
11447
  name: point.name,
11563
11448
  kind: point.kind ?? "planet",
11564
11449
  glyph: point.glyph ?? pointGlyph(point.name),
@@ -11573,7 +11458,7 @@ function solveCircularLabelAngles(items, options) {
11573
11458
  if (items.length === 0) {
11574
11459
  return [];
11575
11460
  }
11576
- const normalized = items.map((item) => ({
11461
+ const normalized = seedExactAngleClusters(items, { paddingPx, maxDisplacementRad }).map((item) => ({
11577
11462
  ...item,
11578
11463
  idealAngle: clampRad(item.idealAngle)
11579
11464
  })).sort((a, b) => a.idealAngle - b.idealAngle);
@@ -11612,8 +11497,8 @@ function solveCircularLabelAngles(items, options) {
11612
11497
  }
11613
11498
  const solved = linear.map((item) => ({
11614
11499
  ...item,
11615
- visualAngle: item.idealAngle
11616
- }));
11500
+ visualAngle: item.visualAngleSeed ?? item.idealAngle
11501
+ })).sort((a, b) => a.visualAngle - b.visualAngle);
11617
11502
  for (let iteration = 0; iteration < 50; iteration++) {
11618
11503
  const forces = new Array(solved.length).fill(0);
11619
11504
  let maxForce = 0;
@@ -11656,6 +11541,38 @@ function solveCircularLabelAngles(items, options) {
11656
11541
  visualAngle: clampRad(item.visualAngle)
11657
11542
  }));
11658
11543
  }
11544
+ function seedExactAngleClusters(items, options) {
11545
+ const seeded = items.map((item) => ({
11546
+ ...item,
11547
+ idealAngle: clampRad(item.idealAngle)
11548
+ }));
11549
+ const groups = /* @__PURE__ */ new Map();
11550
+ for (const item of seeded) {
11551
+ const key = item.idealAngle.toFixed(6);
11552
+ const group = groups.get(key);
11553
+ if (group) {
11554
+ group.push(item);
11555
+ } else {
11556
+ groups.set(key, [item]);
11557
+ }
11558
+ }
11559
+ for (const group of groups.values()) {
11560
+ if (group.length < 2) {
11561
+ continue;
11562
+ }
11563
+ const center = group[0].idealAngle;
11564
+ const largestDemand = Math.max(
11565
+ ...group.map((item) => labelAngularHalfDemand(item, options.paddingPx) * 2)
11566
+ );
11567
+ const maxStep = group.length > 1 ? options.maxDisplacementRad * 2 / (group.length - 1) : largestDemand;
11568
+ const step = Math.min(largestDemand, maxStep);
11569
+ const midpoint2 = (group.length - 1) / 2;
11570
+ group.forEach((item, index) => {
11571
+ item.visualAngleSeed = center + (index - midpoint2) * step;
11572
+ });
11573
+ }
11574
+ return seeded;
11575
+ }
11659
11576
  function clampAngleAroundIdeal(value, ideal, maxDistance) {
11660
11577
  if (!Number.isFinite(maxDistance) || maxDistance >= Math.PI) {
11661
11578
  return value;
@@ -11739,32 +11656,6 @@ function computeAspectEdges(planets, specs) {
11739
11656
  }
11740
11657
  return edges;
11741
11658
  }
11742
- function computeCrossAspectEdges(planetsA, planetsB, specs) {
11743
- const keysA = Object.keys(planetsA);
11744
- const keysB = Object.keys(planetsB);
11745
- const edges = [];
11746
- for (const keyA of keysA) {
11747
- for (const keyB of keysB) {
11748
- const planetA = planetsA[keyA];
11749
- const planetB = planetsB[keyB];
11750
- const match = getAspectMatch2(planetA.longitude, planetB.longitude, specs);
11751
- if (!match) {
11752
- continue;
11753
- }
11754
- edges.push({
11755
- planetA: keyA,
11756
- planetB: keyB,
11757
- longitudeA: normalizeAngle2(planetA.longitude),
11758
- longitudeB: normalizeAngle2(planetB.longitude),
11759
- aspect: match.spec.name,
11760
- aspectAngle: match.spec.angle,
11761
- delta: match.delta,
11762
- orb: match.orb
11763
- });
11764
- }
11765
- }
11766
- return edges;
11767
- }
11768
11659
  function getAspectMatch2(lonA, lonB, specs) {
11769
11660
  const delta = Math.min(
11770
11661
  normalizeAngle2(lonB - lonA),
@@ -11913,7 +11804,7 @@ function resolveAspectOptions(options) {
11913
11804
  aspectSpecs: options.aspectSpecs
11914
11805
  };
11915
11806
  }
11916
- function resolvePointLayerRadius(layer, rings) {
11807
+ function resolvePointGroupRadius(layer, rings) {
11917
11808
  const ring = rings.planets;
11918
11809
  if (layer.radius === "external") {
11919
11810
  return rings.houses.r2 + (layer.radiusOffset ?? 18);
@@ -11946,12 +11837,9 @@ function isExcludedBody(name, excludedBodies) {
11946
11837
  function normalizePointKey(value) {
11947
11838
  return value.trim().toLocaleLowerCase().replace(/[_-]+/g, " ").replace(/\s+/g, " ");
11948
11839
  }
11949
- function layerPointKey(layerId, value) {
11840
+ function layerPointKey(groupId, value) {
11950
11841
  const key = normalizePointKey(value);
11951
- return layerId === "birth" ? key : `${layerId}:${key}`;
11952
- }
11953
- function pointKeyPrefix(layerId) {
11954
- return !layerId || layerId === "birth" ? "" : `${layerId}:`;
11842
+ return groupId === "birth" ? key : `${groupId}:${key}`;
11955
11843
  }
11956
11844
  function renderGlyphPrimitives(push, primitives, options) {
11957
11845
  for (const p of primitives) {
@@ -21464,7 +21352,6 @@ __export(visual_exports, {
21464
21352
  generateTreeSvg: () => generateTreeSvg,
21465
21353
  getArcheometerRenderModel: () => getArcheometerRenderModel,
21466
21354
  getAstroGlyph: () => getAstroGlyph,
21467
- getAstroWheelRenderModel: () => getAstroWheelRenderModel,
21468
21355
  getRouteActivations: () => getRouteActivations,
21469
21356
  getTreeLayout: () => getTreeLayout,
21470
21357
  getTreeRenderModel: () => getTreeRenderModel,
@@ -27060,7 +26947,7 @@ var import_config3 = require("dotenv/config");
27060
26947
  // package.json
27061
26948
  var package_default = {
27062
26949
  name: "kaabalah",
27063
- version: "6.10.0",
26950
+ version: "6.11.0",
27064
26951
  description: "The de-facto library for any esoteric calculations and tooling",
27065
26952
  engines: {
27066
26953
  node: ">=18.18.0"
@@ -27146,6 +27033,7 @@ var package_default = {
27146
27033
  "test:ui": "vitest --ui --silent",
27147
27034
  "prepare-browser-test": "cp wasm/build/swisseph.wasm examples/ && cp -r ephe examples/",
27148
27035
  "generate:trees": "npx tsx examples/generate-tree-svg.ts",
27036
+ "generate:wheel": "npx tsx examples/generate-astro-wheel-svgs.ts",
27149
27037
  "generate:wheels": "npx tsx examples/generate-astro-wheel-svgs.ts",
27150
27038
  "generate:archeometer": "npx tsx examples/generate-archeometer-svg.ts",
27151
27039
  "generate:svgs": "npm run generate:trees && npm run generate:wheels && npm run generate:archeometer",
@@ -27488,7 +27376,6 @@ var COMMANDS = [
27488
27376
  { name: "no-houses", type: "boolean", default: false, description: "Hide house cusps, labels, and angle markers" },
27489
27377
  { name: "no-points", type: "boolean", default: false, description: "Hide birth planets, nodes, and vertex" },
27490
27378
  { name: "no-aspects", type: "boolean", default: false, description: "Hide aspect lines" },
27491
- { name: "render-model", type: "boolean", default: false, description: "Return wheel geometry JSON instead of SVG" },
27492
27379
  { name: "output", type: "string", description: "Write the SVG to a file instead of stdout" },
27493
27380
  { name: "viewbox-width", type: "number", description: "Override SVG viewBox width" },
27494
27381
  { name: "viewbox-height", type: "number", description: "Override SVG viewBox height" },
@@ -27500,8 +27387,7 @@ var COMMANDS = [
27500
27387
  examples: [
27501
27388
  "kaabalah astrology:wheel 1990-01-15 14:30 --lat=40.7128 --lon=-74.006 --json --compact --fields=svg",
27502
27389
  "kaabalah astrology:wheel 1990-01-15 14:30 --lat=40.7128 --lon=-74.006 --background=transparent --output=chart.svg --json",
27503
- "kaabalah astrology:wheel --input-json=- --json --compact --fields=svg < chart-wheel.json",
27504
- "kaabalah astrology:wheel 1990-01-15 14:30 --lat=40.7128 --lon=-74.006 --render-model --json --compact"
27390
+ "kaabalah astrology:wheel --input-json=- --json --compact --fields=svg < chart-wheel.json"
27505
27391
  ]
27506
27392
  },
27507
27393
  {
@@ -28849,7 +28735,6 @@ function buildAstroWheelSvgOptions(flags, inputPayload) {
28849
28735
  }
28850
28736
  if (getInputBoolean(inputPayload, "noAspects") === true || getFlagBool(flags, "no-aspects")) {
28851
28737
  options.aspects = false;
28852
- options.aspectLayers = [];
28853
28738
  }
28854
28739
  if (options.aspects !== false && inputPayload?.aspectSpecs != null && Array.isArray(inputPayload.aspectSpecs)) {
28855
28740
  options.aspects = {
@@ -29668,14 +29553,6 @@ async function cmdAstrologyWheel(args, flags, inputPayload, executionContext) {
29668
29553
  const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
29669
29554
  const wheelOptions = buildAstroWheelSvgOptions(flags, inputPayload);
29670
29555
  const outputPathFlag = getFlagString(flags, "output") ?? getInputString(inputPayload, "output");
29671
- const renderModel = getFlagBool(flags, "render-model") || getInputBoolean(inputPayload, "renderModel") === true;
29672
- if (renderModel && outputPathFlag) {
29673
- exitWithError(
29674
- "INVALID_ARGUMENT",
29675
- "--output is only supported when generating an astrology wheel SVG. Omit --render-model to write an SVG file.",
29676
- flags
29677
- );
29678
- }
29679
29556
  try {
29680
29557
  await initWasm(runtimePaths, executionContext);
29681
29558
  } catch (err) {
@@ -29691,7 +29568,6 @@ async function cmdAstrologyWheel(args, flags, inputPayload, executionContext) {
29691
29568
  latitude: input.latitude,
29692
29569
  longitude: input.longitude,
29693
29570
  houseSystem: input.houseSystem,
29694
- renderModel,
29695
29571
  output: outputPathFlag
29696
29572
  });
29697
29573
  const chart = await getBirthChart2({
@@ -29702,37 +29578,10 @@ async function cmdAstrologyWheel(args, flags, inputPayload, executionContext) {
29702
29578
  timeZoneSettings: input.timeZoneSettings
29703
29579
  });
29704
29580
  const filteredChart = filterChartAspects(chart, { maxOrb, aspectFilter });
29705
- const { generateAstroWheelSvg: generateAstroWheelSvg2, getAstroWheelRenderModel: getAstroWheelRenderModel2 } = await Promise.resolve().then(() => (init_visual(), visual_exports));
29581
+ const { generateAstroWheelSvg: generateAstroWheelSvg2 } = await Promise.resolve().then(() => (init_visual(), visual_exports));
29706
29582
  executionContext.throwIfInterrupted();
29707
29583
  const inputEcho = formatSingleChartInputEcho(input);
29708
29584
  const serializedOptions = serializeAstroWheelOptions(wheelOptions);
29709
- if (renderModel) {
29710
- const model = getAstroWheelRenderModel2(filteredChart, wheelOptions);
29711
- executionContext.throwIfInterrupted();
29712
- if (isJsonMode(flags)) {
29713
- outputJson(
29714
- {
29715
- ...model,
29716
- input: inputEcho,
29717
- options: serializedOptions
29718
- },
29719
- flags
29720
- );
29721
- return;
29722
- }
29723
- console.log(`
29724
- Astrology Wheel Render Model: ${input.dateStr} ${input.timeStr}
29725
- `);
29726
- console.log(
29727
- ` ViewBox: ${model.viewBox.minX} ${model.viewBox.minY} ${model.viewBox.width} ${model.viewBox.height}`
29728
- );
29729
- console.log(` Points: ${model.points.length}`);
29730
- console.log(` Houses: ${model.houseCusps.length}`);
29731
- console.log(` Aspects: ${model.aspectLines.length}`);
29732
- console.log(` Point layers: ${model.pointLayers.map((layer) => layer.id).join(", ") || "none"}`);
29733
- console.log();
29734
- return;
29735
- }
29736
29585
  const svg = generateAstroWheelSvg2(filteredChart, wheelOptions);
29737
29586
  executionContext.throwIfInterrupted();
29738
29587
  const bytes = Buffer.byteLength(svg, "utf8");