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/{chunk-PPIKM3QA.mjs → chunk-4MACEIWO.mjs} +89 -201
- package/dist/chunk-4MACEIWO.mjs.map +1 -0
- package/dist/{chunk-GHHOLWAG.js → chunk-XUD2HQUG.js} +88 -201
- package/dist/chunk-XUD2HQUG.js.map +1 -0
- package/dist/cli.js +90 -241
- package/dist/cli.js.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -46
- package/dist/index.mjs +1 -1
- package/dist/visual/index.d.mts +3 -101
- package/dist/visual/index.d.ts +3 -101
- package/dist/visual/index.js +42 -46
- package/dist/visual/index.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-GHHOLWAG.js.map +0 -1
- package/dist/chunk-PPIKM3QA.mjs.map +0 -1
|
@@ -1346,7 +1346,7 @@ function generateAstroGlyphSvg(keyOrGlyph, options = {}) {
|
|
|
1346
1346
|
const svg = generateGlyphSvg(glyph.primitives, options);
|
|
1347
1347
|
return svg.replace("<svg ", `<svg data-astro-glyph="${escapeAttr2(glyph.key)}" data-astro-glyph-category="${glyph.category}" `);
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function buildAstroWheelSvgModel(chart, options = {}) {
|
|
1350
1350
|
const viewBox = normalizeViewBox2(options.viewBox);
|
|
1351
1351
|
const palette = resolvePalette2(options.palette, options.background ?? "transparent");
|
|
1352
1352
|
const excludedBodies = resolveExcludedBodies(options.excludeBodies);
|
|
@@ -1354,7 +1354,7 @@ function getAstroWheelRenderModel(chart, options = {}) {
|
|
|
1354
1354
|
viewBox.width / ASTRO_WHEEL_DEFAULT_VIEWBOX.width,
|
|
1355
1355
|
viewBox.height / ASTRO_WHEEL_DEFAULT_VIEWBOX.height
|
|
1356
1356
|
);
|
|
1357
|
-
const padding = options.padding ?? round2(18 * scale + getExternalPointPadding(
|
|
1357
|
+
const padding = options.padding ?? round2(18 * scale + getExternalPointPadding());
|
|
1358
1358
|
const center = {
|
|
1359
1359
|
x: round2(viewBox.minX + viewBox.width / 2),
|
|
1360
1360
|
y: round2(viewBox.minY + viewBox.height / 2)
|
|
@@ -1383,7 +1383,7 @@ function getAstroWheelRenderModel(chart, options = {}) {
|
|
|
1383
1383
|
rings,
|
|
1384
1384
|
scale
|
|
1385
1385
|
}) : [];
|
|
1386
|
-
const
|
|
1386
|
+
const basePointGroup = buildPointGroup({
|
|
1387
1387
|
layer: {
|
|
1388
1388
|
id: "birth",
|
|
1389
1389
|
label: "Birth",
|
|
@@ -1405,27 +1405,12 @@ function getAstroWheelRenderModel(chart, options = {}) {
|
|
|
1405
1405
|
maxDisplacementDegrees: maxPointDisplacementDegrees,
|
|
1406
1406
|
railVisibility
|
|
1407
1407
|
});
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1410
|
-
layer,
|
|
1411
|
-
center,
|
|
1412
|
-
angleOf: angleOf2,
|
|
1413
|
-
rings,
|
|
1414
|
-
scale,
|
|
1415
|
-
palette,
|
|
1416
|
-
excludedBodies,
|
|
1417
|
-
pointConnectorMode,
|
|
1418
|
-
maxDisplacementDegrees: maxPointDisplacementDegrees,
|
|
1419
|
-
railVisibility
|
|
1420
|
-
})
|
|
1421
|
-
);
|
|
1422
|
-
const pointLayers = [
|
|
1423
|
-
...resolvedPoints.enabled ? [basePointLayer] : [],
|
|
1424
|
-
...extraPointLayers
|
|
1408
|
+
const pointGroups = [
|
|
1409
|
+
...resolvedPoints.enabled ? [basePointGroup] : []
|
|
1425
1410
|
];
|
|
1426
|
-
const points =
|
|
1411
|
+
const points = pointGroups.flatMap((layer) => [...layer.points]);
|
|
1427
1412
|
const pointByKey = Object.fromEntries(points.map((point) => [point.key, point]));
|
|
1428
|
-
const
|
|
1413
|
+
const baseAspectGroup = resolvedAspects.enabled ? buildAspectGroup({
|
|
1429
1414
|
layer: {
|
|
1430
1415
|
id: "birth",
|
|
1431
1416
|
label: "Birth aspects",
|
|
@@ -1441,25 +1426,11 @@ function getAstroWheelRenderModel(chart, options = {}) {
|
|
|
1441
1426
|
palette,
|
|
1442
1427
|
excludedBodies
|
|
1443
1428
|
}) : null;
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
layer,
|
|
1447
|
-
chart: layer.chart ?? chart,
|
|
1448
|
-
pointByKey,
|
|
1449
|
-
center,
|
|
1450
|
-
angleOf: angleOf2,
|
|
1451
|
-
rings,
|
|
1452
|
-
palette,
|
|
1453
|
-
excludedBodies
|
|
1454
|
-
})
|
|
1455
|
-
);
|
|
1456
|
-
const aspectLayers = [
|
|
1457
|
-
...baseAspectLayer ? [baseAspectLayer] : [],
|
|
1458
|
-
...extraAspectLayers
|
|
1429
|
+
const aspectGroups = [
|
|
1430
|
+
...baseAspectGroup ? [baseAspectGroup] : []
|
|
1459
1431
|
];
|
|
1460
|
-
const aspectLines =
|
|
1461
|
-
const positionRails =
|
|
1462
|
-
const boundaryNotches = pointLayers.flatMap((layer) => [...layer.notches]);
|
|
1432
|
+
const aspectLines = aspectGroups.flatMap((layer) => [...layer.aspectLines]);
|
|
1433
|
+
const positionRails = basePointGroup.rails;
|
|
1463
1434
|
return {
|
|
1464
1435
|
viewBox,
|
|
1465
1436
|
center,
|
|
@@ -1473,15 +1444,14 @@ function getAstroWheelRenderModel(chart, options = {}) {
|
|
|
1473
1444
|
points,
|
|
1474
1445
|
pointByKey,
|
|
1475
1446
|
aspectLines,
|
|
1476
|
-
|
|
1477
|
-
|
|
1447
|
+
pointGroups,
|
|
1448
|
+
aspectGroups,
|
|
1478
1449
|
positionRails,
|
|
1479
|
-
boundaryNotches,
|
|
1480
1450
|
palette
|
|
1481
1451
|
};
|
|
1482
1452
|
}
|
|
1483
1453
|
function generateAstroWheelSvg(chart, options = {}) {
|
|
1484
|
-
const model =
|
|
1454
|
+
const model = buildAstroWheelSvgModel(chart, options);
|
|
1485
1455
|
const viewBox = model.viewBox;
|
|
1486
1456
|
const zodiacOptions = resolveZodiacOptions(options.zodiac);
|
|
1487
1457
|
const houseOptions = resolveHouseOptions(options.houses);
|
|
@@ -1536,15 +1506,15 @@ function renderSvgDefs(push, model) {
|
|
|
1536
1506
|
push(`</defs>`);
|
|
1537
1507
|
}
|
|
1538
1508
|
function renderAspects(push, model) {
|
|
1539
|
-
if (model.
|
|
1509
|
+
if (model.aspectGroups.length === 0) {
|
|
1540
1510
|
return;
|
|
1541
1511
|
}
|
|
1542
1512
|
push(`<g id="astro-wheel-aspects" aria-label="aspects">`);
|
|
1543
|
-
for (const layer of model.
|
|
1544
|
-
push(`<g class="astro-wheel-aspect-
|
|
1513
|
+
for (const layer of model.aspectGroups) {
|
|
1514
|
+
push(`<g class="astro-wheel-aspect-group" data-aspect-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
|
|
1545
1515
|
for (const aspect of layer.aspectLines) {
|
|
1546
1516
|
push(
|
|
1547
|
-
`<line data-aspect-
|
|
1517
|
+
`<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"/>`
|
|
1548
1518
|
);
|
|
1549
1519
|
}
|
|
1550
1520
|
push(`</g>`);
|
|
@@ -1634,23 +1604,18 @@ function renderHouses(push, model, options) {
|
|
|
1634
1604
|
push(`</g>`);
|
|
1635
1605
|
}
|
|
1636
1606
|
function renderPlanets(push, model) {
|
|
1637
|
-
if (model.
|
|
1607
|
+
if (model.pointGroups.length === 0) {
|
|
1638
1608
|
return;
|
|
1639
1609
|
}
|
|
1640
1610
|
push(`<g id="astro-wheel-planets" aria-label="planets">`);
|
|
1641
|
-
for (const layer of model.
|
|
1642
|
-
|
|
1611
|
+
for (const layer of model.pointGroups) {
|
|
1612
|
+
renderPointGroupGuide(push, layer, model);
|
|
1643
1613
|
}
|
|
1644
|
-
for (const
|
|
1645
|
-
push(
|
|
1646
|
-
`<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"/>`
|
|
1647
|
-
);
|
|
1648
|
-
}
|
|
1649
|
-
for (const layer of model.pointLayers) {
|
|
1650
|
-
push(`<g class="astro-wheel-point-layer" data-point-layer="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
|
|
1614
|
+
for (const layer of model.pointGroups) {
|
|
1615
|
+
push(`<g class="astro-wheel-point-group" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)}"` : ""}>`);
|
|
1651
1616
|
for (const point of layer.points) {
|
|
1652
1617
|
push(
|
|
1653
|
-
`<g class="astro-wheel-point" data-point-
|
|
1618
|
+
`<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)}">`
|
|
1654
1619
|
);
|
|
1655
1620
|
push(`<title>${escapeText2(point.name)} ${fmt2(point.longitude)}\xB0</title>`);
|
|
1656
1621
|
push(
|
|
@@ -1671,17 +1636,17 @@ function renderPlanets(push, model) {
|
|
|
1671
1636
|
}
|
|
1672
1637
|
push(`</g>`);
|
|
1673
1638
|
}
|
|
1674
|
-
function
|
|
1639
|
+
function renderPointGroupGuide(push, layer, model) {
|
|
1675
1640
|
const isExternal = layer.radius > model.rings.houses.r2 + model.scale;
|
|
1676
1641
|
if (!isExternal) {
|
|
1677
1642
|
return;
|
|
1678
1643
|
}
|
|
1679
1644
|
push(
|
|
1680
|
-
`<circle class="astro-wheel-external-point-ring" data-point-
|
|
1645
|
+
`<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)}"/>`
|
|
1681
1646
|
);
|
|
1682
1647
|
}
|
|
1683
1648
|
function renderGlyphOverlay(push, model) {
|
|
1684
|
-
if (model.angleMarkers.length === 0 && model.
|
|
1649
|
+
if (model.angleMarkers.length === 0 && model.pointGroups.length === 0) {
|
|
1685
1650
|
return;
|
|
1686
1651
|
}
|
|
1687
1652
|
push(`<g id="astro-wheel-glyph-layer" aria-label="chart glyphs">`);
|
|
@@ -1692,10 +1657,10 @@ function renderGlyphOverlay(push, model) {
|
|
|
1692
1657
|
}
|
|
1693
1658
|
push(`</g>`);
|
|
1694
1659
|
}
|
|
1695
|
-
if (model.
|
|
1660
|
+
if (model.pointGroups.length > 0) {
|
|
1696
1661
|
push(`<g id="astro-wheel-point-glyphs" aria-label="planet glyphs">`);
|
|
1697
|
-
for (const layer of model.
|
|
1698
|
-
push(`<g class="astro-wheel-point-glyph-layer" data-point-
|
|
1662
|
+
for (const layer of model.pointGroups) {
|
|
1663
|
+
push(`<g class="astro-wheel-point-glyph-layer" data-point-group="${escapeAttr2(layer.id)}"${layer.label ? ` aria-label="${escapeAttr2(layer.label)} glyphs"` : ""}>`);
|
|
1699
1664
|
for (const point of layer.points) {
|
|
1700
1665
|
renderPointLabelGroup(push, point, model);
|
|
1701
1666
|
}
|
|
@@ -1737,7 +1702,7 @@ function angleDisplayLabel(key) {
|
|
|
1737
1702
|
}
|
|
1738
1703
|
function renderPointLabelGroup(push, point, model) {
|
|
1739
1704
|
push(
|
|
1740
|
-
`<g class="astro-wheel-point-label" data-point-
|
|
1705
|
+
`<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})">`
|
|
1741
1706
|
);
|
|
1742
1707
|
push(`<title>${escapeText2(pointLabelTitle(point))}</title>`);
|
|
1743
1708
|
renderPointGlyph(push, point, 0, 0, point.glyphScale, model.palette.glyphHalo);
|
|
@@ -1746,7 +1711,7 @@ function renderPointLabelGroup(push, point, model) {
|
|
|
1746
1711
|
if (!label.visible)
|
|
1747
1712
|
continue;
|
|
1748
1713
|
push(
|
|
1749
|
-
`<g class="astro-wheel-position-rail-label" data-point-
|
|
1714
|
+
`<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})">`
|
|
1750
1715
|
);
|
|
1751
1716
|
if (label.railId === "sign" && label.sign) {
|
|
1752
1717
|
renderInlineSignGlyph(push, label.sign, 0, 0, label.glyphScale ?? label.fontSize, point.color);
|
|
@@ -1864,13 +1829,7 @@ function resolvePointGlyph(name) {
|
|
|
1864
1829
|
return PLANET_GLYPHS[resolved] ?? ANGLE_GLYPHS[resolved] ?? null;
|
|
1865
1830
|
}
|
|
1866
1831
|
function getExternalPointPadding(options, scale) {
|
|
1867
|
-
|
|
1868
|
-
if (externalLayers.length === 0) {
|
|
1869
|
-
return 0;
|
|
1870
|
-
}
|
|
1871
|
-
return Math.max(
|
|
1872
|
-
...externalLayers.map((layer) => (layer.radiusOffset ?? 18) + 36 * scale)
|
|
1873
|
-
);
|
|
1832
|
+
return 0;
|
|
1874
1833
|
}
|
|
1875
1834
|
function buildZodiacSegments(params) {
|
|
1876
1835
|
const { center, angleOf: angleOf2, rings, scale, palette } = params;
|
|
@@ -1965,7 +1924,7 @@ function buildAngleMarkers(params) {
|
|
|
1965
1924
|
};
|
|
1966
1925
|
});
|
|
1967
1926
|
}
|
|
1968
|
-
function
|
|
1927
|
+
function buildPointGroup(params) {
|
|
1969
1928
|
const {
|
|
1970
1929
|
layer,
|
|
1971
1930
|
center,
|
|
@@ -1979,7 +1938,7 @@ function buildPointLayer(params) {
|
|
|
1979
1938
|
railVisibility
|
|
1980
1939
|
} = params;
|
|
1981
1940
|
const ring = rings.planets;
|
|
1982
|
-
const requestedRadius =
|
|
1941
|
+
const requestedRadius = resolvePointGroupRadius(layer, rings);
|
|
1983
1942
|
const requestedExternalLayer = requestedRadius > rings.houses.r2 + scale;
|
|
1984
1943
|
const thickness = ring.r2 - ring.r1;
|
|
1985
1944
|
const glyphFontSize = clamp(thickness * 0.68, 14 * scale, 30 * scale) * (layer.glyphScale ?? 1);
|
|
@@ -2119,15 +2078,6 @@ function buildPointLayer(params) {
|
|
|
2119
2078
|
connector
|
|
2120
2079
|
};
|
|
2121
2080
|
});
|
|
2122
|
-
const notches = buildBoundaryNotches({
|
|
2123
|
-
layerId: layer.id,
|
|
2124
|
-
points,
|
|
2125
|
-
houses: layer.chart?.houses.houses ?? [],
|
|
2126
|
-
center,
|
|
2127
|
-
radius,
|
|
2128
|
-
ring,
|
|
2129
|
-
scale
|
|
2130
|
-
});
|
|
2131
2081
|
return {
|
|
2132
2082
|
id: layer.id,
|
|
2133
2083
|
label: layer.label,
|
|
@@ -2135,7 +2085,6 @@ function buildPointLayer(params) {
|
|
|
2135
2085
|
tickColor,
|
|
2136
2086
|
radius,
|
|
2137
2087
|
rails,
|
|
2138
|
-
notches,
|
|
2139
2088
|
points
|
|
2140
2089
|
};
|
|
2141
2090
|
}
|
|
@@ -2166,7 +2115,7 @@ function makeAstroWheelPoint(params) {
|
|
|
2166
2115
|
});
|
|
2167
2116
|
const glyphScale = glyphFontSize * 0.66;
|
|
2168
2117
|
return {
|
|
2169
|
-
|
|
2118
|
+
groupId: layer.id,
|
|
2170
2119
|
key: seed.key,
|
|
2171
2120
|
name: seed.name,
|
|
2172
2121
|
kind: seed.kind,
|
|
@@ -2201,13 +2150,13 @@ function makeAstroWheelPoint(params) {
|
|
|
2201
2150
|
};
|
|
2202
2151
|
}
|
|
2203
2152
|
function resolveRailVisibility(input) {
|
|
2204
|
-
if (input === "glyph-only") {
|
|
2153
|
+
if (!input || input === "glyph-only") {
|
|
2205
2154
|
return { degree: false, sign: false, minutes: false, retrograde: false };
|
|
2206
2155
|
}
|
|
2207
2156
|
if (input === "compact") {
|
|
2208
2157
|
return { degree: true, sign: true, minutes: false, retrograde: true };
|
|
2209
2158
|
}
|
|
2210
|
-
if (
|
|
2159
|
+
if (input === "full") {
|
|
2211
2160
|
return { degree: true, sign: true, minutes: true, retrograde: true };
|
|
2212
2161
|
}
|
|
2213
2162
|
return {
|
|
@@ -2326,83 +2275,19 @@ function buildPointLineConnector(params) {
|
|
|
2326
2275
|
y2: params.glyphPosition.y
|
|
2327
2276
|
};
|
|
2328
2277
|
}
|
|
2329
|
-
function
|
|
2330
|
-
if (params.houses.length === 0)
|
|
2331
|
-
return [];
|
|
2332
|
-
const { center, ring, radius, scale } = params;
|
|
2333
|
-
return params.points.flatMap((point) => {
|
|
2334
|
-
if (!point.nearestCuspHouse || point.nearestCuspDistanceDegrees === void 0)
|
|
2335
|
-
return [];
|
|
2336
|
-
const displaced = circularAngleDistance(point.trueAngle, point.displayAngle) > deg2rad2(0.35);
|
|
2337
|
-
if (!displaced)
|
|
2338
|
-
return [];
|
|
2339
|
-
const cusp = params.houses[point.nearestCuspHouse - 1];
|
|
2340
|
-
const cuspAngle = point.trueAngle + deg2rad2(shortestLongitudeDistance(point.longitude, cusp.longitude));
|
|
2341
|
-
const trueDelta = signedAngleDelta(cuspAngle, point.trueAngle);
|
|
2342
|
-
const displayDelta = signedAngleDelta(cuspAngle, point.displayAngle);
|
|
2343
|
-
const crossed = Math.sign(trueDelta) !== Math.sign(displayDelta) && displayDelta !== 0;
|
|
2344
|
-
const crowds = point.nearestCuspDistanceDegrees <= 2;
|
|
2345
|
-
if (!crossed && !crowds)
|
|
2346
|
-
return [];
|
|
2347
|
-
const glyphHalfAngle = Math.max(point.glyphScale * 0.62, 4 * scale) / Math.max(radius, 1);
|
|
2348
|
-
const directed = displayDelta === 0 ? trueDelta : displayDelta;
|
|
2349
|
-
const direction = directed >= 0 ? 1 : -1;
|
|
2350
|
-
const endAngle = cuspAngle + directed + direction * glyphHalfAngle;
|
|
2351
|
-
const halfThickness = Math.max(point.glyphScale * 0.9, 7 * scale);
|
|
2352
|
-
const innerRadius = clamp(radius - halfThickness, ring.r1, ring.r2);
|
|
2353
|
-
const outerRadius = clamp(radius + halfThickness, ring.r1, ring.r2);
|
|
2354
|
-
return [{
|
|
2355
|
-
id: `${params.layerId}-${point.key}-notch`,
|
|
2356
|
-
layerId: params.layerId,
|
|
2357
|
-
pointKey: point.key,
|
|
2358
|
-
house: point.house ?? 0,
|
|
2359
|
-
cuspHouse: point.nearestCuspHouse,
|
|
2360
|
-
cuspLongitude: normalizeAngle(cusp.longitude),
|
|
2361
|
-
radius: outerRadius,
|
|
2362
|
-
innerRadius,
|
|
2363
|
-
outerRadius,
|
|
2364
|
-
startAngle: cuspAngle,
|
|
2365
|
-
endAngle,
|
|
2366
|
-
path: boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle)
|
|
2367
|
-
}];
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
function boundaryNotchPath(center, innerRadius, outerRadius, cuspAngle, endAngle) {
|
|
2371
|
-
const outerCusp = polarToXY2(center.x, center.y, outerRadius, cuspAngle);
|
|
2372
|
-
const outerEnd = polarToXY2(center.x, center.y, outerRadius, endAngle);
|
|
2373
|
-
const innerEnd = polarToXY2(center.x, center.y, innerRadius, endAngle);
|
|
2374
|
-
const innerCusp = polarToXY2(center.x, center.y, innerRadius, cuspAngle);
|
|
2375
|
-
const delta = signedAngleDelta(cuspAngle, endAngle);
|
|
2376
|
-
const sweepOuter = delta >= 0 ? 1 : 0;
|
|
2377
|
-
const sweepInner = delta >= 0 ? 0 : 1;
|
|
2378
|
-
return [
|
|
2379
|
-
`M ${fmt2(outerCusp.x)} ${fmt2(outerCusp.y)}`,
|
|
2380
|
-
`A ${fmt2(outerRadius)} ${fmt2(outerRadius)} 0 0 ${sweepOuter} ${fmt2(outerEnd.x)} ${fmt2(outerEnd.y)}`,
|
|
2381
|
-
`L ${fmt2(innerEnd.x)} ${fmt2(innerEnd.y)}`,
|
|
2382
|
-
`A ${fmt2(innerRadius)} ${fmt2(innerRadius)} 0 0 ${sweepInner} ${fmt2(innerCusp.x)} ${fmt2(innerCusp.y)}`,
|
|
2383
|
-
"Z"
|
|
2384
|
-
].join(" ");
|
|
2385
|
-
}
|
|
2386
|
-
function buildAspectLayer(params) {
|
|
2278
|
+
function buildAspectGroup(params) {
|
|
2387
2279
|
const { layer, chart, pointByKey, center, angleOf: angleOf2, rings, palette, excludedBodies } = params;
|
|
2388
|
-
const sourceEdges = layer.edges ? layer.edges :
|
|
2389
|
-
chart.planets,
|
|
2390
|
-
layer.chartB.planets,
|
|
2391
|
-
layer.aspectSpecs ?? ASTRO_WHEEL_DEFAULT_ASPECT_SPECS
|
|
2392
|
-
) : getSourceAspectEdges(chart, {
|
|
2280
|
+
const sourceEdges = layer.edges ? layer.edges : getSourceAspectEdges(chart, {
|
|
2393
2281
|
edges: layer.edges,
|
|
2394
2282
|
aspectSpecs: layer.aspectSpecs
|
|
2395
2283
|
});
|
|
2396
2284
|
const aspectRadius = layer.radius ?? rings.aspects.r2 * (layer.radiusScale ?? 0.96);
|
|
2397
|
-
const layerPointPrefix = pointKeyPrefix(layer.pointLayerId);
|
|
2398
|
-
const layerPointPrefixA = layer.pointLayerIdA ? pointKeyPrefix(layer.pointLayerIdA) : layerPointPrefix;
|
|
2399
|
-
const layerPointPrefixB = layer.pointLayerIdB ? pointKeyPrefix(layer.pointLayerIdB) : layerPointPrefix;
|
|
2400
2285
|
const aspectLines = sourceEdges.flatMap((edge) => {
|
|
2401
2286
|
if (isExcludedBody(edge.planetA, excludedBodies) || isExcludedBody(edge.planetB, excludedBodies)) {
|
|
2402
2287
|
return [];
|
|
2403
2288
|
}
|
|
2404
|
-
const planetAKey =
|
|
2405
|
-
const planetBKey =
|
|
2289
|
+
const planetAKey = normalizePointKey(edge.planetA);
|
|
2290
|
+
const planetBKey = normalizePointKey(edge.planetB);
|
|
2406
2291
|
const planetA = pointByKey[planetAKey];
|
|
2407
2292
|
const planetB = pointByKey[planetBKey];
|
|
2408
2293
|
if (!planetA || !planetB) {
|
|
@@ -2414,7 +2299,7 @@ function buildAspectLayer(params) {
|
|
|
2414
2299
|
const a = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetA.longitude)) : planetA.trueAnchor;
|
|
2415
2300
|
const b = layer.radius || layer.radiusScale ? polarToXY2(center.x, center.y, aspectRadius, angleOf2(planetB.longitude)) : planetB.trueAnchor;
|
|
2416
2301
|
return [{
|
|
2417
|
-
|
|
2302
|
+
groupId: layer.id,
|
|
2418
2303
|
planetA: planetA.name,
|
|
2419
2304
|
planetB: planetB.name,
|
|
2420
2305
|
planetAKey,
|
|
@@ -2473,9 +2358,9 @@ function getPointSeeds(layer, excludedBodies) {
|
|
|
2473
2358
|
}
|
|
2474
2359
|
return seeds.filter((seed) => !isExcludedBody(seed.name, excludedBodies)).sort((a, b) => normalizeAngle(a.longitude) - normalizeAngle(b.longitude));
|
|
2475
2360
|
}
|
|
2476
|
-
function planetSeed(key, planet,
|
|
2361
|
+
function planetSeed(key, planet, groupId) {
|
|
2477
2362
|
return {
|
|
2478
|
-
key: layerPointKey(
|
|
2363
|
+
key: layerPointKey(groupId, key || planet.name),
|
|
2479
2364
|
name: planet.name,
|
|
2480
2365
|
kind: "planet",
|
|
2481
2366
|
glyph: pointGlyph(planet.name),
|
|
@@ -2485,9 +2370,9 @@ function planetSeed(key, planet, layerId) {
|
|
|
2485
2370
|
zodiacPosition: planet.zodiacPosition
|
|
2486
2371
|
};
|
|
2487
2372
|
}
|
|
2488
|
-
function nodeSeed(key, node,
|
|
2373
|
+
function nodeSeed(key, node, groupId) {
|
|
2489
2374
|
return {
|
|
2490
|
-
key: layerPointKey(
|
|
2375
|
+
key: layerPointKey(groupId, node.name || key),
|
|
2491
2376
|
name: node.name,
|
|
2492
2377
|
kind: "node",
|
|
2493
2378
|
glyph: pointGlyph(node.name),
|
|
@@ -2496,9 +2381,9 @@ function nodeSeed(key, node, layerId) {
|
|
|
2496
2381
|
zodiacPosition: node
|
|
2497
2382
|
};
|
|
2498
2383
|
}
|
|
2499
|
-
function pointSeed(point,
|
|
2384
|
+
function pointSeed(point, groupId) {
|
|
2500
2385
|
return {
|
|
2501
|
-
key: layerPointKey(
|
|
2386
|
+
key: layerPointKey(groupId, point.key ?? point.name),
|
|
2502
2387
|
name: point.name,
|
|
2503
2388
|
kind: point.kind ?? "planet",
|
|
2504
2389
|
glyph: point.glyph ?? pointGlyph(point.name),
|
|
@@ -2513,7 +2398,7 @@ function solveCircularLabelAngles(items, options) {
|
|
|
2513
2398
|
if (items.length === 0) {
|
|
2514
2399
|
return [];
|
|
2515
2400
|
}
|
|
2516
|
-
const normalized = items.map((item) => ({
|
|
2401
|
+
const normalized = seedExactAngleClusters(items, { paddingPx, maxDisplacementRad }).map((item) => ({
|
|
2517
2402
|
...item,
|
|
2518
2403
|
idealAngle: clampRad(item.idealAngle)
|
|
2519
2404
|
})).sort((a, b) => a.idealAngle - b.idealAngle);
|
|
@@ -2552,8 +2437,8 @@ function solveCircularLabelAngles(items, options) {
|
|
|
2552
2437
|
}
|
|
2553
2438
|
const solved = linear.map((item) => ({
|
|
2554
2439
|
...item,
|
|
2555
|
-
visualAngle: item.idealAngle
|
|
2556
|
-
}));
|
|
2440
|
+
visualAngle: item.visualAngleSeed ?? item.idealAngle
|
|
2441
|
+
})).sort((a, b) => a.visualAngle - b.visualAngle);
|
|
2557
2442
|
for (let iteration = 0; iteration < 50; iteration++) {
|
|
2558
2443
|
const forces = new Array(solved.length).fill(0);
|
|
2559
2444
|
let maxForce = 0;
|
|
@@ -2596,6 +2481,38 @@ function solveCircularLabelAngles(items, options) {
|
|
|
2596
2481
|
visualAngle: clampRad(item.visualAngle)
|
|
2597
2482
|
}));
|
|
2598
2483
|
}
|
|
2484
|
+
function seedExactAngleClusters(items, options) {
|
|
2485
|
+
const seeded = items.map((item) => ({
|
|
2486
|
+
...item,
|
|
2487
|
+
idealAngle: clampRad(item.idealAngle)
|
|
2488
|
+
}));
|
|
2489
|
+
const groups = /* @__PURE__ */ new Map();
|
|
2490
|
+
for (const item of seeded) {
|
|
2491
|
+
const key = item.idealAngle.toFixed(6);
|
|
2492
|
+
const group = groups.get(key);
|
|
2493
|
+
if (group) {
|
|
2494
|
+
group.push(item);
|
|
2495
|
+
} else {
|
|
2496
|
+
groups.set(key, [item]);
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
for (const group of groups.values()) {
|
|
2500
|
+
if (group.length < 2) {
|
|
2501
|
+
continue;
|
|
2502
|
+
}
|
|
2503
|
+
const center = group[0].idealAngle;
|
|
2504
|
+
const largestDemand = Math.max(
|
|
2505
|
+
...group.map((item) => labelAngularHalfDemand(item, options.paddingPx) * 2)
|
|
2506
|
+
);
|
|
2507
|
+
const maxStep = group.length > 1 ? options.maxDisplacementRad * 2 / (group.length - 1) : largestDemand;
|
|
2508
|
+
const step = Math.min(largestDemand, maxStep);
|
|
2509
|
+
const midpoint2 = (group.length - 1) / 2;
|
|
2510
|
+
group.forEach((item, index) => {
|
|
2511
|
+
item.visualAngleSeed = center + (index - midpoint2) * step;
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
return seeded;
|
|
2515
|
+
}
|
|
2599
2516
|
function clampAngleAroundIdeal(value, ideal, maxDistance) {
|
|
2600
2517
|
if (!Number.isFinite(maxDistance) || maxDistance >= Math.PI) {
|
|
2601
2518
|
return value;
|
|
@@ -2679,32 +2596,6 @@ function computeAspectEdges(planets, specs) {
|
|
|
2679
2596
|
}
|
|
2680
2597
|
return edges;
|
|
2681
2598
|
}
|
|
2682
|
-
function computeCrossAspectEdges(planetsA, planetsB, specs) {
|
|
2683
|
-
const keysA = Object.keys(planetsA);
|
|
2684
|
-
const keysB = Object.keys(planetsB);
|
|
2685
|
-
const edges = [];
|
|
2686
|
-
for (const keyA of keysA) {
|
|
2687
|
-
for (const keyB of keysB) {
|
|
2688
|
-
const planetA = planetsA[keyA];
|
|
2689
|
-
const planetB = planetsB[keyB];
|
|
2690
|
-
const match = getAspectMatch(planetA.longitude, planetB.longitude, specs);
|
|
2691
|
-
if (!match) {
|
|
2692
|
-
continue;
|
|
2693
|
-
}
|
|
2694
|
-
edges.push({
|
|
2695
|
-
planetA: keyA,
|
|
2696
|
-
planetB: keyB,
|
|
2697
|
-
longitudeA: normalizeAngle(planetA.longitude),
|
|
2698
|
-
longitudeB: normalizeAngle(planetB.longitude),
|
|
2699
|
-
aspect: match.spec.name,
|
|
2700
|
-
aspectAngle: match.spec.angle,
|
|
2701
|
-
delta: match.delta,
|
|
2702
|
-
orb: match.orb
|
|
2703
|
-
});
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
return edges;
|
|
2707
|
-
}
|
|
2708
2599
|
function getAspectMatch(lonA, lonB, specs) {
|
|
2709
2600
|
const delta = Math.min(
|
|
2710
2601
|
normalizeAngle(lonB - lonA),
|
|
@@ -2853,7 +2744,7 @@ function resolveAspectOptions(options) {
|
|
|
2853
2744
|
aspectSpecs: options.aspectSpecs
|
|
2854
2745
|
};
|
|
2855
2746
|
}
|
|
2856
|
-
function
|
|
2747
|
+
function resolvePointGroupRadius(layer, rings) {
|
|
2857
2748
|
const ring = rings.planets;
|
|
2858
2749
|
if (layer.radius === "external") {
|
|
2859
2750
|
return rings.houses.r2 + (layer.radiusOffset ?? 18);
|
|
@@ -2886,12 +2777,9 @@ function isExcludedBody(name, excludedBodies) {
|
|
|
2886
2777
|
function normalizePointKey(value) {
|
|
2887
2778
|
return value.trim().toLocaleLowerCase().replace(/[_-]+/g, " ").replace(/\s+/g, " ");
|
|
2888
2779
|
}
|
|
2889
|
-
function layerPointKey(
|
|
2780
|
+
function layerPointKey(groupId, value) {
|
|
2890
2781
|
const key = normalizePointKey(value);
|
|
2891
|
-
return
|
|
2892
|
-
}
|
|
2893
|
-
function pointKeyPrefix(layerId) {
|
|
2894
|
-
return !layerId || layerId === "birth" ? "" : `${layerId}:`;
|
|
2782
|
+
return groupId === "birth" ? key : `${groupId}:${key}`;
|
|
2895
2783
|
}
|
|
2896
2784
|
function renderGlyphPrimitives(push, primitives, options) {
|
|
2897
2785
|
for (const p of primitives) {
|
|
@@ -3996,10 +3884,9 @@ exports.generateGlyphSvg = generateGlyphSvg;
|
|
|
3996
3884
|
exports.generateTreeSvg = generateTreeSvg;
|
|
3997
3885
|
exports.getArcheometerRenderModel = getArcheometerRenderModel;
|
|
3998
3886
|
exports.getAstroGlyph = getAstroGlyph;
|
|
3999
|
-
exports.getAstroWheelRenderModel = getAstroWheelRenderModel;
|
|
4000
3887
|
exports.getRouteActivations = getRouteActivations;
|
|
4001
3888
|
exports.getTreeLayout = getTreeLayout;
|
|
4002
3889
|
exports.getTreeRenderModel = getTreeRenderModel;
|
|
4003
3890
|
exports.listAstroGlyphs = listAstroGlyphs;
|
|
4004
3891
|
//# sourceMappingURL=out.js.map
|
|
4005
|
-
//# sourceMappingURL=chunk-
|
|
3892
|
+
//# sourceMappingURL=chunk-XUD2HQUG.js.map
|