kaabalah 6.4.4 → 6.5.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-EVH4J5E2.mjs → chunk-BKNWKD32.mjs} +364 -23
- package/dist/chunk-BKNWKD32.mjs.map +1 -0
- package/dist/{chunk-EMTVK46M.js → chunk-SW5O2BJI.js} +364 -22
- package/dist/chunk-SW5O2BJI.js.map +1 -0
- package/dist/cli.js +535 -27
- 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 +11 -7
- package/dist/index.mjs +1 -1
- package/dist/visual/index.d.mts +116 -1
- package/dist/visual/index.d.ts +116 -1
- package/dist/visual/index.js +11 -7
- package/dist/visual/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-EMTVK46M.js.map +0 -1
- package/dist/chunk-EVH4J5E2.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,4 +6,4 @@ export { OduNumbers, calculateOdu } from './ifa/index.mjs';
|
|
|
6
6
|
export { MASTER_NUMBERS, NumerologyData, NumerologyData as NumerologyModuleTypes, calculateChallenges, calculateCycles, calculateFibonacciCycle, calculateKaabalisticLifePath, calculatePersonalCycles, calculatePersonalMonths, calculatePersonalPeriods, calculatePersonalYear, calculateStraightAcrossReductionLifePath, getDateEnergies, isMasterNumber, reduceToSingle, reduceToSingleWithSteps } from './numerology/index.mjs';
|
|
7
7
|
export { AstrologyTreeChartInput, BuildKaabalisticMapDataInput, GematriaTreeInput, HouseNumber, HouseThemeAxis, HouseThemeLookup, HouseThemeProfile, HouseThemeScope, KaabalisticAngleCorrespondenceLookup, KaabalisticCorrespondenceLookup, KaabalisticCorrespondenceResult, KaabalisticCorrespondenceSource, KaabalisticCorrespondenceTarget, KaabalisticCountsEntry, KaabalisticHebrewLetterCorrespondenceLookup, KaabalisticItemConnection, KaabalisticMapData, KaabalisticMarkerDescriptor, KaabalisticMarkerKind, KaabalisticMarkerMapping, KaabalisticMarkerSourceType, KaabalisticNodeCorrespondenceLookup, KaabalisticNumberCorrespondenceLookup, KaabalisticPlanetCorrespondenceLookup, KaabalisticSignCorrespondenceLookup, KaabalisticSignLookup, KaabalisticSummaryTarget, KaabalisticSymbolMetadata, KaabalisticTargetId, KaabalisticTargetType, NumerologyTreeInput, OCCULT_THEME_STOPWORDS, OccultThemeCorrespondence, OccultThemeCorrespondences, TarotMajorArchetypeReference, TarotThemeCorrespondences, TarotThemeLookup, TarotThemeProfile, TokenizeOccultThemeTextOptions, buildKaabalisticMapData, getAngleSymbolMetadata, getAstrologyTreeMarkers, getGematriaTreeMarkers, getHouseThemeProfile, getKaabalisticCorrespondenceTargets, getNodeSymbolMetadata, getNumerologyTreeMarkers, getPlanetSymbolMetadata, getTarotThemeProfile, getZodiacSignSymbolMetadata, listAngleSymbolMetadata, listHouseThemeProfiles, listNodeSymbolMetadata, listPlanetSymbolMetadata, listTarotThemeProfiles, listZodiacSignSymbolMetadata, tokenizeOccultThemeText } from './semantic/index.mjs';
|
|
8
8
|
export { ARKANNUS, DEFAULT_TAROT_TREE_ID, Deck, DrawTarotSpreadOptions, MajorArcana, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, TarotArchetype, TarotArchetypeLookup, TarotAssetPathType, TarotAstrologyCorrespondence, TarotAstrologyCorrespondenceType, TarotCard, TarotCardKind, TarotCardProfile, TarotCorrespondenceNode, TarotCorrespondenceNodeType, TarotCorrespondenceProfile, TarotCorrespondenceProfileBase, TarotCourtAstrologyCorrespondenceProfile, TarotCourtRank, TarotDeckDescription, TarotDeckId, TarotDeckMetadata, TarotImageLookup, TarotInquirerGender, TarotMajorCorrespondenceProfile, TarotMinorCorrespondenceProfile, TarotPageCorrespondenceProfile, TarotPathCorrespondence, TarotRepresentation, TarotSpreadCardConstraint, TarotSpreadCardType, TarotSpreadContextKey, TarotSpreadDefinition, TarotSpreadDrawResult, TarotSpreadId, TarotSpreadInquirerRule, TarotSpreadMinorRank, TarotSpreadResolvedSelectionCard, TarotSpreadSelectionCard, TarotSpreadSelectionContext, TarotSpreadSlotDefinition, TarotSpreadSlotMetadata, TarotSpreadValidationErrorCode, TarotSpreadValidationInput, TarotSpreadValidationIssue, TarotSpreadValidationResult, TarotTreeId, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection } from './tarot/index.mjs';
|
|
9
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, TreeLayout, TreeLayoutCoordinate, TreeLayoutMap, TreeLayoutPath, TreePathId, TreeSphereId, TreeSphereName, TreeSvgCustomPalette, TreeSvgDaathLayer, TreeSvgHighlights, TreeSvgOptions, TreeSvgPalette, TreeSvgViewBox, generateTreeSvg, getTreeLayout } from './visual/index.mjs';
|
|
9
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, TreeLayout, TreeLayoutCoordinate, TreeLayoutMap, TreeLayoutPath, TreePathId, TreeRenderActivationState, TreeRenderAnchor, TreeRenderCircleHitTarget, TreeRenderHitTarget, TreeRenderLayer, TreeRenderLineHitTarget, TreeRenderModel, TreeRenderPath, TreeRenderPathGeometry, TreeRenderSphere, TreeRenderSphereGeometry, TreeSphereId, TreeSphereName, TreeSvgCustomPalette, TreeSvgDaathLayer, TreeSvgHighlights, TreeSvgOptions, TreeSvgPalette, TreeSvgViewBox, TreeTargetActivationInput, TreeTargetState, generateTreeSvg, getTreeLayout, getTreeRenderModel } from './visual/index.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { OduNumbers, calculateOdu } from './ifa/index.js';
|
|
|
6
6
|
export { MASTER_NUMBERS, NumerologyData, NumerologyData as NumerologyModuleTypes, calculateChallenges, calculateCycles, calculateFibonacciCycle, calculateKaabalisticLifePath, calculatePersonalCycles, calculatePersonalMonths, calculatePersonalPeriods, calculatePersonalYear, calculateStraightAcrossReductionLifePath, getDateEnergies, isMasterNumber, reduceToSingle, reduceToSingleWithSteps } from './numerology/index.js';
|
|
7
7
|
export { AstrologyTreeChartInput, BuildKaabalisticMapDataInput, GematriaTreeInput, HouseNumber, HouseThemeAxis, HouseThemeLookup, HouseThemeProfile, HouseThemeScope, KaabalisticAngleCorrespondenceLookup, KaabalisticCorrespondenceLookup, KaabalisticCorrespondenceResult, KaabalisticCorrespondenceSource, KaabalisticCorrespondenceTarget, KaabalisticCountsEntry, KaabalisticHebrewLetterCorrespondenceLookup, KaabalisticItemConnection, KaabalisticMapData, KaabalisticMarkerDescriptor, KaabalisticMarkerKind, KaabalisticMarkerMapping, KaabalisticMarkerSourceType, KaabalisticNodeCorrespondenceLookup, KaabalisticNumberCorrespondenceLookup, KaabalisticPlanetCorrespondenceLookup, KaabalisticSignCorrespondenceLookup, KaabalisticSignLookup, KaabalisticSummaryTarget, KaabalisticSymbolMetadata, KaabalisticTargetId, KaabalisticTargetType, NumerologyTreeInput, OCCULT_THEME_STOPWORDS, OccultThemeCorrespondence, OccultThemeCorrespondences, TarotMajorArchetypeReference, TarotThemeCorrespondences, TarotThemeLookup, TarotThemeProfile, TokenizeOccultThemeTextOptions, buildKaabalisticMapData, getAngleSymbolMetadata, getAstrologyTreeMarkers, getGematriaTreeMarkers, getHouseThemeProfile, getKaabalisticCorrespondenceTargets, getNodeSymbolMetadata, getNumerologyTreeMarkers, getPlanetSymbolMetadata, getTarotThemeProfile, getZodiacSignSymbolMetadata, listAngleSymbolMetadata, listHouseThemeProfiles, listNodeSymbolMetadata, listPlanetSymbolMetadata, listTarotThemeProfiles, listZodiacSignSymbolMetadata, tokenizeOccultThemeText } from './semantic/index.js';
|
|
8
8
|
export { ARKANNUS, DEFAULT_TAROT_TREE_ID, Deck, DrawTarotSpreadOptions, MajorArcana, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, TarotArchetype, TarotArchetypeLookup, TarotAssetPathType, TarotAstrologyCorrespondence, TarotAstrologyCorrespondenceType, TarotCard, TarotCardKind, TarotCardProfile, TarotCorrespondenceNode, TarotCorrespondenceNodeType, TarotCorrespondenceProfile, TarotCorrespondenceProfileBase, TarotCourtAstrologyCorrespondenceProfile, TarotCourtRank, TarotDeckDescription, TarotDeckId, TarotDeckMetadata, TarotImageLookup, TarotInquirerGender, TarotMajorCorrespondenceProfile, TarotMinorCorrespondenceProfile, TarotPageCorrespondenceProfile, TarotPathCorrespondence, TarotRepresentation, TarotSpreadCardConstraint, TarotSpreadCardType, TarotSpreadContextKey, TarotSpreadDefinition, TarotSpreadDrawResult, TarotSpreadId, TarotSpreadInquirerRule, TarotSpreadMinorRank, TarotSpreadResolvedSelectionCard, TarotSpreadSelectionCard, TarotSpreadSelectionContext, TarotSpreadSlotDefinition, TarotSpreadSlotMetadata, TarotSpreadValidationErrorCode, TarotSpreadValidationInput, TarotSpreadValidationIssue, TarotSpreadValidationResult, TarotTreeId, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection } from './tarot/index.js';
|
|
9
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, TreeLayout, TreeLayoutCoordinate, TreeLayoutMap, TreeLayoutPath, TreePathId, TreeSphereId, TreeSphereName, TreeSvgCustomPalette, TreeSvgDaathLayer, TreeSvgHighlights, TreeSvgOptions, TreeSvgPalette, TreeSvgViewBox, generateTreeSvg, getTreeLayout } from './visual/index.js';
|
|
9
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, TreeLayout, TreeLayoutCoordinate, TreeLayoutMap, TreeLayoutPath, TreePathId, TreeRenderActivationState, TreeRenderAnchor, TreeRenderCircleHitTarget, TreeRenderHitTarget, TreeRenderLayer, TreeRenderLineHitTarget, TreeRenderModel, TreeRenderPath, TreeRenderPathGeometry, TreeRenderSphere, TreeRenderSphereGeometry, TreeSphereId, TreeSphereName, TreeSvgCustomPalette, TreeSvgDaathLayer, TreeSvgHighlights, TreeSvgOptions, TreeSvgPalette, TreeSvgViewBox, TreeTargetActivationInput, TreeTargetState, generateTreeSvg, getTreeLayout, getTreeRenderModel } from './visual/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSW5O2BJI_js = require('./chunk-SW5O2BJI.js');
|
|
4
4
|
var chunk2WCC2KCJ_js = require('./chunk-2WCC2KCJ.js');
|
|
5
5
|
var chunkUG6HZK3Z_js = require('./chunk-UG6HZK3Z.js');
|
|
6
6
|
var chunk6O7MTBZN_js = require('./chunk-6O7MTBZN.js');
|
|
@@ -15,27 +15,31 @@ require('./chunk-FM7WUVZV.js');
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "TREE_PATH_IDS", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkSW5O2BJI_js.TREE_PATH_IDS; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "TREE_SPHERE_IDS", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SPHERE_IDS; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "TREE_SPHERE_NAMES", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SPHERE_NAMES; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "TREE_SVG_DEFAULT_VIEWBOX", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SVG_DEFAULT_VIEWBOX; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "generateTreeSvg", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkSW5O2BJI_js.generateTreeSvg; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "getTreeLayout", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkSW5O2BJI_js.getTreeLayout; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "getTreeRenderModel", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return chunkSW5O2BJI_js.getTreeRenderModel; }
|
|
39
43
|
});
|
|
40
44
|
Object.defineProperty(exports, "calculateOdu", {
|
|
41
45
|
enumerable: true,
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, generateTreeSvg, getTreeLayout } from './chunk-
|
|
1
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, generateTreeSvg, getTreeLayout, getTreeRenderModel } from './chunk-BKNWKD32.mjs';
|
|
2
2
|
export { calculateOdu } from './chunk-URDMOQRN.mjs';
|
|
3
3
|
export { OCCULT_THEME_STOPWORDS, buildKaabalisticMapData, getAngleSymbolMetadata, getAstrologyTreeMarkers, getGematriaTreeMarkers, getHouseThemeProfile, getKaabalisticCorrespondenceTargets, getNodeSymbolMetadata, getNumerologyTreeMarkers, getPlanetSymbolMetadata, getTarotThemeProfile, getZodiacSignSymbolMetadata, listAngleSymbolMetadata, listHouseThemeProfiles, listNodeSymbolMetadata, listPlanetSymbolMetadata, listTarotThemeProfiles, listZodiacSignSymbolMetadata, tokenizeOccultThemeText } from './chunk-UN7QMOMX.mjs';
|
|
4
4
|
export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, CalcFlag, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, EXALTATIONS, HouseSystem, PLANET_AND_NODE_NAMES, Planet, RiseTransitFlag, SIGNS, SLOW_PLANETS, VirtualNodes, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, resolveSwissEphRuntimeAssets, shorterArcMidpoint } from './chunk-PWYOHULD.mjs';
|
package/dist/visual/index.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ interface TreeLayoutCoordinate {
|
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
12
12
|
}
|
|
13
|
+
type TreeTargetState = "active" | "hovered" | "selected" | "inactive";
|
|
13
14
|
type TreeSphereName = "Kether" | "Chokhmah" | "Binah" | "Daath" | "Chesed" | "Geburah" | "Tiphareth" | "Netzach" | "Hod" | "Yesod" | "Malkuth";
|
|
14
15
|
type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;
|
|
15
16
|
type TreePathId = NodeId<KaabalahTypes.PATH>;
|
|
@@ -50,6 +51,118 @@ interface TreeSvgHighlights {
|
|
|
50
51
|
spheres?: Partial<Record<TreeSphereId, string | string[]>>;
|
|
51
52
|
specialSphereMode?: "preserve" | "plain";
|
|
52
53
|
}
|
|
54
|
+
interface TreeTargetActivationInput {
|
|
55
|
+
targetId: TreeSphereId | TreePathId;
|
|
56
|
+
targetType: "sphere" | "path";
|
|
57
|
+
count: number;
|
|
58
|
+
total: number;
|
|
59
|
+
strength?: number;
|
|
60
|
+
state?: TreeTargetState;
|
|
61
|
+
color?: string;
|
|
62
|
+
}
|
|
63
|
+
interface TreeRenderAnchor {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
vertical: "above" | "below";
|
|
67
|
+
}
|
|
68
|
+
interface TreeRenderCircleHitTarget {
|
|
69
|
+
kind: "circle";
|
|
70
|
+
cx: number;
|
|
71
|
+
cy: number;
|
|
72
|
+
r: number;
|
|
73
|
+
}
|
|
74
|
+
interface TreeRenderLineHitTarget {
|
|
75
|
+
kind: "line";
|
|
76
|
+
x1: number;
|
|
77
|
+
y1: number;
|
|
78
|
+
x2: number;
|
|
79
|
+
y2: number;
|
|
80
|
+
strokeWidth: number;
|
|
81
|
+
}
|
|
82
|
+
type TreeRenderHitTarget = TreeRenderCircleHitTarget | TreeRenderLineHitTarget;
|
|
83
|
+
interface TreeRenderActivationState {
|
|
84
|
+
state: TreeTargetState;
|
|
85
|
+
count: number;
|
|
86
|
+
total: number;
|
|
87
|
+
strength: number;
|
|
88
|
+
canonicalColor: string;
|
|
89
|
+
displayColor: string;
|
|
90
|
+
colorOverride?: string;
|
|
91
|
+
mutedColor: string;
|
|
92
|
+
visible: boolean;
|
|
93
|
+
emphasis: number;
|
|
94
|
+
}
|
|
95
|
+
interface TreeRenderSphereGeometry {
|
|
96
|
+
percentages: {
|
|
97
|
+
center: TreeLayoutCoordinate;
|
|
98
|
+
anchor: TreeRenderAnchor;
|
|
99
|
+
};
|
|
100
|
+
viewBoxUnits: {
|
|
101
|
+
center: TreeLayoutCoordinate;
|
|
102
|
+
anchor: TreeRenderAnchor;
|
|
103
|
+
hitTarget: TreeRenderCircleHitTarget;
|
|
104
|
+
};
|
|
105
|
+
radius: {
|
|
106
|
+
viewBoxUnits: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface TreeRenderPathGeometry {
|
|
110
|
+
percentages: {
|
|
111
|
+
from: TreeLayoutCoordinate;
|
|
112
|
+
to: TreeLayoutCoordinate;
|
|
113
|
+
anchor: TreeRenderAnchor;
|
|
114
|
+
};
|
|
115
|
+
viewBoxUnits: {
|
|
116
|
+
from: TreeLayoutCoordinate;
|
|
117
|
+
to: TreeLayoutCoordinate;
|
|
118
|
+
anchor: TreeRenderAnchor;
|
|
119
|
+
hitTarget: TreeRenderLineHitTarget;
|
|
120
|
+
};
|
|
121
|
+
widths: {
|
|
122
|
+
edge: number;
|
|
123
|
+
main: number;
|
|
124
|
+
highlight: number;
|
|
125
|
+
hitTarget: number;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
interface TreeRenderSphere {
|
|
129
|
+
id: TreeSphereId;
|
|
130
|
+
name: TreeSphereName;
|
|
131
|
+
slug: string;
|
|
132
|
+
canonicalColor: string;
|
|
133
|
+
displayFill: string | string[];
|
|
134
|
+
geometry: TreeRenderSphereGeometry;
|
|
135
|
+
material: {
|
|
136
|
+
kind: "standard" | "special";
|
|
137
|
+
specialSphereName?: Extract<TreeSphereName, "Kether" | "Chokhmah" | "Daath" | "Malkuth">;
|
|
138
|
+
preserveOnActivation: boolean;
|
|
139
|
+
};
|
|
140
|
+
activation: TreeRenderActivationState | null;
|
|
141
|
+
}
|
|
142
|
+
interface TreeRenderPath {
|
|
143
|
+
id: TreePathId;
|
|
144
|
+
geometry: TreeRenderPathGeometry;
|
|
145
|
+
canonicalColor: string;
|
|
146
|
+
displayColor: string;
|
|
147
|
+
activation: TreeRenderActivationState | null;
|
|
148
|
+
}
|
|
149
|
+
interface TreeRenderLayer {
|
|
150
|
+
name: "background" | "paths" | "spheres-behind-paths" | "spheres" | "hit-targets";
|
|
151
|
+
order: number;
|
|
152
|
+
description: string;
|
|
153
|
+
}
|
|
154
|
+
interface TreeRenderModel {
|
|
155
|
+
system: SystemKey;
|
|
156
|
+
viewBox: Required<TreeSvgViewBox>;
|
|
157
|
+
scale: number;
|
|
158
|
+
layout: TreeLayout;
|
|
159
|
+
layerOrder: readonly TreeRenderLayer["name"][];
|
|
160
|
+
layers: readonly TreeRenderLayer[];
|
|
161
|
+
spheres: readonly TreeRenderSphere[];
|
|
162
|
+
paths: readonly TreeRenderPath[];
|
|
163
|
+
sphereById: Record<TreeSphereId, TreeRenderSphere>;
|
|
164
|
+
pathById: Record<TreePathId, TreeRenderPath>;
|
|
165
|
+
}
|
|
53
166
|
interface TreeSvgOptions {
|
|
54
167
|
width?: number | string;
|
|
55
168
|
height?: number | string;
|
|
@@ -59,12 +172,14 @@ interface TreeSvgOptions {
|
|
|
59
172
|
system?: SystemKey;
|
|
60
173
|
daathLayer?: TreeSvgDaathLayer;
|
|
61
174
|
highlights?: TreeSvgHighlights;
|
|
175
|
+
activations?: readonly TreeTargetActivationInput[];
|
|
62
176
|
}
|
|
63
177
|
declare const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox>;
|
|
64
178
|
declare const TREE_SPHERE_NAMES: readonly ["Kether", "Chokhmah", "Binah", "Daath", "Chesed", "Geburah", "Tiphareth", "Netzach", "Hod", "Yesod", "Malkuth"];
|
|
65
179
|
declare const TREE_SPHERE_IDS: TreeSphereId[];
|
|
66
180
|
declare const TREE_PATH_IDS: TreePathId[];
|
|
67
181
|
declare function getTreeLayout(system?: SystemKey): TreeLayout;
|
|
182
|
+
declare function getTreeRenderModel(options?: TreeSvgOptions): TreeRenderModel;
|
|
68
183
|
declare function generateTreeSvg(options?: TreeSvgOptions): string;
|
|
69
184
|
|
|
70
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgHighlights, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, generateTreeSvg, getTreeLayout };
|
|
185
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeRenderActivationState, type TreeRenderAnchor, type TreeRenderCircleHitTarget, type TreeRenderHitTarget, type TreeRenderLayer, type TreeRenderLineHitTarget, type TreeRenderModel, type TreeRenderPath, type TreeRenderPathGeometry, type TreeRenderSphere, type TreeRenderSphereGeometry, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgHighlights, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, type TreeTargetActivationInput, type TreeTargetState, generateTreeSvg, getTreeLayout, getTreeRenderModel };
|
package/dist/visual/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface TreeLayoutCoordinate {
|
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
12
12
|
}
|
|
13
|
+
type TreeTargetState = "active" | "hovered" | "selected" | "inactive";
|
|
13
14
|
type TreeSphereName = "Kether" | "Chokhmah" | "Binah" | "Daath" | "Chesed" | "Geburah" | "Tiphareth" | "Netzach" | "Hod" | "Yesod" | "Malkuth";
|
|
14
15
|
type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;
|
|
15
16
|
type TreePathId = NodeId<KaabalahTypes.PATH>;
|
|
@@ -50,6 +51,118 @@ interface TreeSvgHighlights {
|
|
|
50
51
|
spheres?: Partial<Record<TreeSphereId, string | string[]>>;
|
|
51
52
|
specialSphereMode?: "preserve" | "plain";
|
|
52
53
|
}
|
|
54
|
+
interface TreeTargetActivationInput {
|
|
55
|
+
targetId: TreeSphereId | TreePathId;
|
|
56
|
+
targetType: "sphere" | "path";
|
|
57
|
+
count: number;
|
|
58
|
+
total: number;
|
|
59
|
+
strength?: number;
|
|
60
|
+
state?: TreeTargetState;
|
|
61
|
+
color?: string;
|
|
62
|
+
}
|
|
63
|
+
interface TreeRenderAnchor {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
vertical: "above" | "below";
|
|
67
|
+
}
|
|
68
|
+
interface TreeRenderCircleHitTarget {
|
|
69
|
+
kind: "circle";
|
|
70
|
+
cx: number;
|
|
71
|
+
cy: number;
|
|
72
|
+
r: number;
|
|
73
|
+
}
|
|
74
|
+
interface TreeRenderLineHitTarget {
|
|
75
|
+
kind: "line";
|
|
76
|
+
x1: number;
|
|
77
|
+
y1: number;
|
|
78
|
+
x2: number;
|
|
79
|
+
y2: number;
|
|
80
|
+
strokeWidth: number;
|
|
81
|
+
}
|
|
82
|
+
type TreeRenderHitTarget = TreeRenderCircleHitTarget | TreeRenderLineHitTarget;
|
|
83
|
+
interface TreeRenderActivationState {
|
|
84
|
+
state: TreeTargetState;
|
|
85
|
+
count: number;
|
|
86
|
+
total: number;
|
|
87
|
+
strength: number;
|
|
88
|
+
canonicalColor: string;
|
|
89
|
+
displayColor: string;
|
|
90
|
+
colorOverride?: string;
|
|
91
|
+
mutedColor: string;
|
|
92
|
+
visible: boolean;
|
|
93
|
+
emphasis: number;
|
|
94
|
+
}
|
|
95
|
+
interface TreeRenderSphereGeometry {
|
|
96
|
+
percentages: {
|
|
97
|
+
center: TreeLayoutCoordinate;
|
|
98
|
+
anchor: TreeRenderAnchor;
|
|
99
|
+
};
|
|
100
|
+
viewBoxUnits: {
|
|
101
|
+
center: TreeLayoutCoordinate;
|
|
102
|
+
anchor: TreeRenderAnchor;
|
|
103
|
+
hitTarget: TreeRenderCircleHitTarget;
|
|
104
|
+
};
|
|
105
|
+
radius: {
|
|
106
|
+
viewBoxUnits: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface TreeRenderPathGeometry {
|
|
110
|
+
percentages: {
|
|
111
|
+
from: TreeLayoutCoordinate;
|
|
112
|
+
to: TreeLayoutCoordinate;
|
|
113
|
+
anchor: TreeRenderAnchor;
|
|
114
|
+
};
|
|
115
|
+
viewBoxUnits: {
|
|
116
|
+
from: TreeLayoutCoordinate;
|
|
117
|
+
to: TreeLayoutCoordinate;
|
|
118
|
+
anchor: TreeRenderAnchor;
|
|
119
|
+
hitTarget: TreeRenderLineHitTarget;
|
|
120
|
+
};
|
|
121
|
+
widths: {
|
|
122
|
+
edge: number;
|
|
123
|
+
main: number;
|
|
124
|
+
highlight: number;
|
|
125
|
+
hitTarget: number;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
interface TreeRenderSphere {
|
|
129
|
+
id: TreeSphereId;
|
|
130
|
+
name: TreeSphereName;
|
|
131
|
+
slug: string;
|
|
132
|
+
canonicalColor: string;
|
|
133
|
+
displayFill: string | string[];
|
|
134
|
+
geometry: TreeRenderSphereGeometry;
|
|
135
|
+
material: {
|
|
136
|
+
kind: "standard" | "special";
|
|
137
|
+
specialSphereName?: Extract<TreeSphereName, "Kether" | "Chokhmah" | "Daath" | "Malkuth">;
|
|
138
|
+
preserveOnActivation: boolean;
|
|
139
|
+
};
|
|
140
|
+
activation: TreeRenderActivationState | null;
|
|
141
|
+
}
|
|
142
|
+
interface TreeRenderPath {
|
|
143
|
+
id: TreePathId;
|
|
144
|
+
geometry: TreeRenderPathGeometry;
|
|
145
|
+
canonicalColor: string;
|
|
146
|
+
displayColor: string;
|
|
147
|
+
activation: TreeRenderActivationState | null;
|
|
148
|
+
}
|
|
149
|
+
interface TreeRenderLayer {
|
|
150
|
+
name: "background" | "paths" | "spheres-behind-paths" | "spheres" | "hit-targets";
|
|
151
|
+
order: number;
|
|
152
|
+
description: string;
|
|
153
|
+
}
|
|
154
|
+
interface TreeRenderModel {
|
|
155
|
+
system: SystemKey;
|
|
156
|
+
viewBox: Required<TreeSvgViewBox>;
|
|
157
|
+
scale: number;
|
|
158
|
+
layout: TreeLayout;
|
|
159
|
+
layerOrder: readonly TreeRenderLayer["name"][];
|
|
160
|
+
layers: readonly TreeRenderLayer[];
|
|
161
|
+
spheres: readonly TreeRenderSphere[];
|
|
162
|
+
paths: readonly TreeRenderPath[];
|
|
163
|
+
sphereById: Record<TreeSphereId, TreeRenderSphere>;
|
|
164
|
+
pathById: Record<TreePathId, TreeRenderPath>;
|
|
165
|
+
}
|
|
53
166
|
interface TreeSvgOptions {
|
|
54
167
|
width?: number | string;
|
|
55
168
|
height?: number | string;
|
|
@@ -59,12 +172,14 @@ interface TreeSvgOptions {
|
|
|
59
172
|
system?: SystemKey;
|
|
60
173
|
daathLayer?: TreeSvgDaathLayer;
|
|
61
174
|
highlights?: TreeSvgHighlights;
|
|
175
|
+
activations?: readonly TreeTargetActivationInput[];
|
|
62
176
|
}
|
|
63
177
|
declare const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox>;
|
|
64
178
|
declare const TREE_SPHERE_NAMES: readonly ["Kether", "Chokhmah", "Binah", "Daath", "Chesed", "Geburah", "Tiphareth", "Netzach", "Hod", "Yesod", "Malkuth"];
|
|
65
179
|
declare const TREE_SPHERE_IDS: TreeSphereId[];
|
|
66
180
|
declare const TREE_PATH_IDS: TreePathId[];
|
|
67
181
|
declare function getTreeLayout(system?: SystemKey): TreeLayout;
|
|
182
|
+
declare function getTreeRenderModel(options?: TreeSvgOptions): TreeRenderModel;
|
|
68
183
|
declare function generateTreeSvg(options?: TreeSvgOptions): string;
|
|
69
184
|
|
|
70
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgHighlights, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, generateTreeSvg, getTreeLayout };
|
|
185
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeRenderActivationState, type TreeRenderAnchor, type TreeRenderCircleHitTarget, type TreeRenderHitTarget, type TreeRenderLayer, type TreeRenderLineHitTarget, type TreeRenderModel, type TreeRenderPath, type TreeRenderPathGeometry, type TreeRenderSphere, type TreeRenderSphereGeometry, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgHighlights, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, type TreeTargetActivationInput, type TreeTargetState, generateTreeSvg, getTreeLayout, getTreeRenderModel };
|
package/dist/visual/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSW5O2BJI_js = require('../chunk-SW5O2BJI.js');
|
|
4
4
|
require('../chunk-OKZUVGA3.js');
|
|
5
5
|
require('../chunk-S6KNERP7.js');
|
|
6
6
|
require('../chunk-FM7WUVZV.js');
|
|
@@ -9,27 +9,31 @@ require('../chunk-FM7WUVZV.js');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "TREE_PATH_IDS", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkSW5O2BJI_js.TREE_PATH_IDS; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "TREE_SPHERE_IDS", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SPHERE_IDS; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "TREE_SPHERE_NAMES", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SPHERE_NAMES; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "TREE_SVG_DEFAULT_VIEWBOX", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkSW5O2BJI_js.TREE_SVG_DEFAULT_VIEWBOX; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "generateTreeSvg", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkSW5O2BJI_js.generateTreeSvg; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "getTreeLayout", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkSW5O2BJI_js.getTreeLayout; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "getTreeRenderModel", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkSW5O2BJI_js.getTreeRenderModel; }
|
|
33
37
|
});
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
package/dist/visual/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, generateTreeSvg, getTreeLayout } from '../chunk-
|
|
1
|
+
export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, generateTreeSvg, getTreeLayout, getTreeRenderModel } from '../chunk-BKNWKD32.mjs';
|
|
2
2
|
import '../chunk-ZKIJAZ6B.mjs';
|
|
3
3
|
import '../chunk-EFZUZI22.mjs';
|
|
4
4
|
import '../chunk-WY6NIR2V.mjs';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|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W,QAAQ,CAAC,CAAA,GAAA;AAAA,GAC5G;AACA,EAAA,IAAA,CAAK,CAAM,IAAA,CAAA,CAAA;AACb;AAEA,SAAS,uBACP,CAAA,IAAA,EACA,KACA,EAAA,MAAA,EACA,MACA,OACA,EAAA;AACA,EAAA,IAAA;AAAA,IACE,eAAe,KAAM,CAAA,CAAC,CAAS,MAAA,EAAA,KAAA,CAAM,CAAC,CAAQ,KAAA,EAAA,MAAM,CAAW,QAAA,EAAA,UAAA,CAAW,cAAc,IAAM,EAAA,SAAS,CAAC,CAAC,mBAAmB,OAAO,CAAA,GAAA;AAAA,GACrI;AACF;AAEA,SAAS,oBAAoB,IAAqC,EAAA;AAChE,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,IAAI,CAAG,EAAA;AACvB,IAAO,OAAA,CAAC,KAAK,CAAC,CAAA,IAAK,SAAS,IAAK,CAAA,CAAC,KAAK,OAAO,CAAA;AAAA;AAGhD,EAAA,IAAI,IAAM,EAAA;AACR,IAAO,OAAA,CAAC,MAAM,OAAO,CAAA;AAAA;AAGvB,EAAO,OAAA,CAAC,SAAS,OAAO,CAAA;AAC1B;AAEA,SAAS,WAAW,KAAe,EAAA;AACjC,EAAA,OAAO,KACJ,CAAA,OAAA,CAAQ,IAAM,EAAA,OAAO,EACrB,OAAQ,CAAA,IAAA,EAAM,MAAM,CAAA,CACpB,QAAQ,IAAM,EAAA,MAAM,CACpB,CAAA,OAAA,CAAQ,MAAM,QAAQ,CAAA;AAC3B","file":"chunk-EMTVK46M.js","sourcesContent":["import {\n createTree,\n id,\n KaabalahTypes,\n MiscTypes,\n type NodeId,\n type SystemKey,\n} from \"../core\";\n\nexport interface TreeSvgViewBox {\n minX?: number;\n minY?: number;\n width: number;\n height: number;\n}\n\nexport interface TreeLayoutCoordinate {\n x: number;\n y: number;\n}\n\nexport type TreeSphereName =\n | \"Kether\"\n | \"Chokhmah\"\n | \"Binah\"\n | \"Daath\"\n | \"Chesed\"\n | \"Geburah\"\n | \"Tiphareth\"\n | \"Netzach\"\n | \"Hod\"\n | \"Yesod\"\n | \"Malkuth\";\n\nexport type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;\nexport type TreePathId = NodeId<KaabalahTypes.PATH>;\n\nexport interface TreeLayoutPath {\n fromId: TreeSphereId;\n toId: TreeSphereId;\n from: TreeLayoutCoordinate;\n to: TreeLayoutCoordinate;\n}\n\nexport interface TreeLayoutMap {\n spheres: Record<TreeSphereId, TreeLayoutCoordinate>;\n paths: Record<TreePathId, TreeLayoutPath>;\n}\n\nexport interface TreeLayout {\n system: SystemKey;\n viewBox: Required<TreeSvgViewBox>;\n sphereOrder: TreeSphereId[];\n pathOrder: TreePathId[];\n percentages: TreeLayoutMap;\n viewBoxUnits: TreeLayoutMap;\n}\n\nexport interface TreeSvgCustomPalette {\n defaultSphereFill?: string;\n defaultPathColor?: string;\n sphereFills?: Partial<Record<TreeSphereId, string | string[]>>;\n pathColors?: Partial<Record<TreePathId, string>>;\n pathEdgeColor?: string;\n sphereStrokeColor?: string;\n sphereStrokeWidth?: number;\n pathHighlightColor?: string;\n pathHighlightOpacity?: number;\n specialSphereMode?: \"preserve\" | \"plain\";\n}\n\nexport type TreeSvgPalette = \"color\" | \"monochrome\" | TreeSvgCustomPalette;\nexport type TreeSvgDaathLayer = \"front\" | \"back\";\n\nexport interface TreeSvgHighlights {\n paths?: Partial<Record<TreePathId, string>>;\n spheres?: Partial<Record<TreeSphereId, string | string[]>>;\n specialSphereMode?: \"preserve\" | \"plain\";\n}\n\nexport interface TreeSvgOptions {\n width?: number | string;\n height?: number | string;\n viewBox?: TreeSvgViewBox;\n background?: string | \"transparent\";\n palette?: TreeSvgPalette;\n system?: SystemKey;\n daathLayer?: TreeSvgDaathLayer;\n highlights?: TreeSvgHighlights;\n}\n\nexport const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox> = {\n minX: 0,\n minY: 0,\n width: 286,\n height: 561,\n};\n\nexport const TREE_SPHERE_NAMES = [\n \"Kether\",\n \"Chokhmah\",\n \"Binah\",\n \"Daath\",\n \"Chesed\",\n \"Geburah\",\n \"Tiphareth\",\n \"Netzach\",\n \"Hod\",\n \"Yesod\",\n \"Malkuth\",\n] as const satisfies readonly TreeSphereName[];\n\nconst TREE_PATH_NUMBERS = Array.from({ length: 22 }, (_, index) => index + 1);\nconst CANONICAL_X_PERCENTAGES = { left: 13.25, mid: 49.94, right: 86.66 } as const;\nconst CANONICAL_ROW_Y_PERCENTAGES = [\n 6.83,\n 17.68,\n 28.42,\n 39.26,\n 50.06,\n 60.85,\n 71.68,\n 93.2,\n] as const;\n\nconst DEFAULT_SPHERE_RADIUS = 30;\nconst DEFAULT_PATH_EDGE_WIDTH = 26;\nconst DEFAULT_PATH_MAIN_WIDTH = 22;\nconst DEFAULT_PATH_HIGHLIGHT_WIDTH = 8;\n\nconst sphereId = (name: TreeSphereName) =>\n id(KaabalahTypes.SPHERE, name) as TreeSphereId;\nconst pathId = (pathNumber: number) =>\n id(KaabalahTypes.PATH, String(pathNumber)) as TreePathId;\n\nexport const TREE_SPHERE_IDS = TREE_SPHERE_NAMES.map((name) =>\n sphereId(name)\n) as TreeSphereId[];\nexport const TREE_PATH_IDS = TREE_PATH_NUMBERS.map((pathNumber) =>\n pathId(pathNumber)\n) as TreePathId[];\n\nconst CANONICAL_SPHERE_PERCENTAGES = {\n [sphereId(\"Kether\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[0] },\n [sphereId(\"Chokhmah\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[1] },\n [sphereId(\"Binah\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[1] },\n [sphereId(\"Daath\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[2] },\n [sphereId(\"Chesed\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[3] },\n [sphereId(\"Geburah\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[3] },\n [sphereId(\"Tiphareth\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[4] },\n [sphereId(\"Netzach\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[5] },\n [sphereId(\"Hod\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[5] },\n [sphereId(\"Yesod\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[6] },\n [sphereId(\"Malkuth\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[7] },\n} as Record<TreeSphereId, TreeLayoutCoordinate>;\n\ninterface ResolvedPalette {\n mode: \"color\" | \"monochrome\" | \"custom\";\n defaultSphereFill: string;\n defaultPathColor: string;\n sphereFills: Partial<Record<TreeSphereId, string | string[]>>;\n pathColors: Partial<Record<TreePathId, string>>;\n pathEdgeColor: string;\n pathEdgeUseFilter: boolean;\n sphereStrokeColor?: string;\n sphereStrokeWidth?: number;\n pathHighlightColor: string;\n pathHighlightOpacity: number;\n specialSphereMode: \"preserve\" | \"plain\";\n}\n\ninterface ResolvedHighlights {\n pathColors: Partial<Record<TreePathId, string>>;\n sphereFills: Partial<Record<TreeSphereId, string | string[]>>;\n specialSphereMode: \"preserve\" | \"plain\";\n}\n\nexport function getTreeLayout(system: SystemKey = \"kaabalah\"): TreeLayout {\n const tree = createTree({ system });\n const percentages = buildLayoutMap(tree, CANONICAL_SPHERE_PERCENTAGES);\n const viewBoxUnits = buildLayoutMap(\n tree,\n scaleCoordinates(CANONICAL_SPHERE_PERCENTAGES, TREE_SVG_DEFAULT_VIEWBOX)\n );\n\n return {\n system,\n viewBox: { ...TREE_SVG_DEFAULT_VIEWBOX },\n sphereOrder: [...TREE_SPHERE_IDS],\n pathOrder: [...TREE_PATH_IDS],\n percentages,\n viewBoxUnits,\n };\n}\n\nexport function generateTreeSvg(options: TreeSvgOptions = {}): string {\n const system = options.system ?? \"kaabalah\";\n const daathLayer = options.daathLayer ?? \"front\";\n const tree = createTree({ system, parts: [\"colors\"] });\n const viewBox = normalizeViewBox(options.viewBox);\n const palette = resolvePalette(options.palette);\n const highlights = resolveHighlights(options.highlights);\n const spherePositions = scaleCoordinates(CANONICAL_SPHERE_PERCENTAGES, viewBox);\n const layout = buildLayoutMap(tree, spherePositions);\n const scale = Math.min(\n viewBox.width / TREE_SVG_DEFAULT_VIEWBOX.width,\n viewBox.height / TREE_SVG_DEFAULT_VIEWBOX.height\n );\n\n const radius = round(DEFAULT_SPHERE_RADIUS * scale);\n const pathEdgeWidth = round(DEFAULT_PATH_EDGE_WIDTH * scale);\n const pathMainWidth = round(DEFAULT_PATH_MAIN_WIDTH * scale);\n const pathHighlightWidth = round(DEFAULT_PATH_HIGHLIGHT_WIDTH * scale);\n const sphereStrokeWidth = palette.sphereStrokeWidth\n ? round(palette.sphereStrokeWidth * scale)\n : undefined;\n\n const lines: string[] = [];\n const push = (line: string) => lines.push(line);\n const svgAttributes = [\n `xmlns=\"http://www.w3.org/2000/svg\"`,\n options.width !== undefined ? `width=\"${escapeAttr(String(options.width))}\"` : \"\",\n options.height !== undefined ? `height=\"${escapeAttr(String(options.height))}\"` : \"\",\n `viewBox=\"${viewBox.minX} ${viewBox.minY} ${viewBox.width} ${viewBox.height}\"`,\n `preserveAspectRatio=\"xMidYMid meet\"`,\n ].filter(Boolean);\n\n push(`<svg ${svgAttributes.join(\" \")}>`);\n push(`<defs>`);\n push(`<filter id=\"pathDarken\">\n <feComponentTransfer>\n <feFuncR type=\"linear\" slope=\"0.65\"/>\n <feFuncG type=\"linear\" slope=\"0.65\"/>\n <feFuncB type=\"linear\" slope=\"0.65\"/>\n </feComponentTransfer>\n</filter>`);\n\n for (const sphereName of TREE_SPHERE_NAMES) {\n const currentSphereId = sphereId(sphereName);\n const slug = sphereName.toLowerCase();\n const point = spherePositions[currentSphereId];\n if (!point) {\n continue;\n }\n\n push(`<radialGradient id=\"spec-${slug}\" cx=\"30%\" cy=\"25%\" r=\"55%\" fx=\"30%\" fy=\"25%\">\n <stop offset=\"0%\" stop-color=\"white\" stop-opacity=\"0.95\"/>\n <stop offset=\"25%\" stop-color=\"white\" stop-opacity=\"0.45\"/>\n <stop offset=\"50%\" stop-color=\"white\" stop-opacity=\"0.08\"/>\n <stop offset=\"100%\" stop-color=\"white\" stop-opacity=\"0\"/>\n</radialGradient>`);\n\n push(`<radialGradient id=\"shad-${slug}\" cx=\"78%\" cy=\"80%\" r=\"55%\" fx=\"78%\" fy=\"80%\">\n <stop offset=\"0%\" stop-color=\"black\" stop-opacity=\"0.32\"/>\n <stop offset=\"40%\" stop-color=\"black\" stop-opacity=\"0.12\"/>\n <stop offset=\"100%\" stop-color=\"black\" stop-opacity=\"0\"/>\n</radialGradient>`);\n\n push(\n `<clipPath id=\"clip-${slug}\"><circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\"/></clipPath>`\n );\n }\n\n push(`<radialGradient id=\"kether-glow\" cx=\"50%\" cy=\"50%\" r=\"50%\">\n <stop offset=\"0%\" stop-color=\"white\" stop-opacity=\"0.95\"/>\n <stop offset=\"45%\" stop-color=\"white\" stop-opacity=\"0.6\"/>\n <stop offset=\"80%\" stop-color=\"white\" stop-opacity=\"0.15\"/>\n <stop offset=\"100%\" stop-color=\"white\" stop-opacity=\"0\"/>\n</radialGradient>`);\n\n push(`<linearGradient id=\"kether-facet\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stop-color=\"white\" stop-opacity=\"0.9\"/>\n <stop offset=\"50%\" stop-color=\"white\" stop-opacity=\"0.5\"/>\n <stop offset=\"100%\" stop-color=\"white\" stop-opacity=\"0.1\"/>\n</linearGradient>`);\n\n push(`<radialGradient id=\"kether-rim\" cx=\"50%\" cy=\"50%\" r=\"75%\">\n <stop offset=\"60%\" stop-color=\"black\" stop-opacity=\"0\"/>\n <stop offset=\"100%\" stop-color=\"black\" stop-opacity=\"0.18\"/>\n</radialGradient>`);\n push(`</defs>`);\n\n const background = options.background ?? \"white\";\n if (background !== \"transparent\") {\n push(\n `<rect x=\"${viewBox.minX}\" y=\"${viewBox.minY}\" width=\"${viewBox.width}\" height=\"${viewBox.height}\" fill=\"${escapeAttr(background)}\"/>`\n );\n }\n\n if (daathLayer === \"back\") {\n push(`<g id=\"spheres-behind-paths\">`);\n renderSphere(push, {\n highlights,\n tree,\n palette,\n radius,\n sphereStrokeWidth,\n spherePositions,\n sphereName: \"Daath\",\n });\n push(`</g>`);\n }\n\n push(`<g id=\"paths\">`);\n for (const currentPathId of TREE_PATH_IDS) {\n const path = layout.paths[currentPathId];\n const color = resolvePathColor({\n highlights,\n palette,\n tree,\n pathId: currentPathId,\n });\n const edgeColor = resolvePathEdgeColor({\n palette,\n pathColor: color,\n });\n\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(edgeColor)}\" stroke-width=\"${pathEdgeWidth}\" stroke-linecap=\"round\"${palette.pathEdgeUseFilter ? ` filter=\"url(#pathDarken)\"` : \"\"}/>`\n );\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(color)}\" stroke-width=\"${pathMainWidth}\" stroke-linecap=\"round\"/>`\n );\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(palette.pathHighlightColor)}\" stroke-opacity=\"${palette.pathHighlightOpacity}\" stroke-width=\"${pathHighlightWidth}\" stroke-linecap=\"round\"/>`\n );\n }\n push(`</g>`);\n\n const frontSphereNames =\n daathLayer === \"back\"\n ? TREE_SPHERE_NAMES.filter((name): name is Exclude<TreeSphereName, \"Daath\"> => name !== \"Daath\")\n : TREE_SPHERE_NAMES;\n\n push(`<g id=\"spheres\">`);\n for (const sphereName of frontSphereNames) {\n renderSphere(push, {\n highlights,\n tree,\n palette,\n radius,\n sphereStrokeWidth,\n spherePositions,\n sphereName,\n });\n }\n push(`</g>`);\n if (daathLayer === \"back\") {\n const daathPoint = spherePositions[sphereId(\"Daath\")];\n push(\n `<circle id=\"sphere-daath-hit-area\" data-node-id=\"sphere:Daath\" cx=\"${daathPoint.x}\" cy=\"${daathPoint.y}\" r=\"${radius}\" fill=\"transparent\" pointer-events=\"all\"/>`\n );\n }\n push(`</svg>`);\n\n return lines.join(\"\\n\");\n}\n\nfunction renderSphere(\n push: (line: string) => void,\n params: {\n highlights: ResolvedHighlights;\n tree: ReturnType<typeof createTree>;\n palette: ResolvedPalette;\n radius: number;\n sphereStrokeWidth?: number;\n spherePositions: Record<TreeSphereId, TreeLayoutCoordinate>;\n sphereName: TreeSphereName;\n }\n) {\n const currentSphereId = sphereId(params.sphereName);\n const point = params.spherePositions[currentSphereId];\n const slug = params.sphereName.toLowerCase();\n const colorData =\n params.tree.relatedFirst(currentSphereId, MiscTypes.COLOR)?.data?.colorHexCodes ?? [];\n const sphereFill = resolveSphereFill({\n palette: params.palette,\n sphereId: currentSphereId,\n defaultColors: colorData,\n });\n const highlightFill = params.highlights.sphereFills[currentSphereId];\n const activeFill = highlightFill ?? sphereFill;\n const preserveSpecialRenderer =\n params.palette.specialSphereMode === \"preserve\"\n && (\n highlightFill === undefined\n || params.highlights.specialSphereMode === \"preserve\"\n );\n\n push(`<g id=\"sphere-${slug}\" clip-path=\"url(#clip-${slug})\">`);\n if (preserveSpecialRenderer) {\n if (params.sphereName === \"Kether\") {\n renderKether(\n push,\n point,\n params.radius,\n highlightFill ? toPrimaryFill(highlightFill, \"#e0e0e0\") : undefined\n );\n } else if (params.sphereName === \"Chokhmah\") {\n renderIridescent(push, point, params.radius);\n if (highlightFill) {\n renderSphereTintOverlay(push, point, params.radius, highlightFill, 0.62);\n }\n } else if (params.sphereName === \"Daath\") {\n renderYinYang(push, point, params.radius, highlightFill);\n } else if (params.sphereName === \"Malkuth\" && colorData.length >= 4) {\n const slicedColors = resolveMalkuthColors({\n highlightFill,\n paletteFill: sphereFill,\n defaultColors: colorData.slice(0, 4),\n });\n renderSlicedSphere(push, point, params.radius, slicedColors, -135);\n } else {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"${escapeAttr(toPrimaryFill(activeFill, params.palette.defaultSphereFill))}\"/>`\n );\n }\n } else {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"${escapeAttr(toPrimaryFill(activeFill, params.palette.defaultSphereFill))}\"/>`\n );\n }\n\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"url(#spec-${slug})\"/>`\n );\n if (\n !preserveSpecialRenderer ||\n (params.sphereName !== \"Kether\" && params.sphereName !== \"Chokhmah\")\n ) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"url(#shad-${slug})\"/>`\n );\n }\n push(`</g>`);\n if (params.palette.sphereStrokeColor && params.sphereStrokeWidth) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"none\" stroke=\"${escapeAttr(params.palette.sphereStrokeColor)}\" stroke-width=\"${params.sphereStrokeWidth}\"/>`\n );\n }\n}\n\nfunction buildLayoutMap(\n tree: ReturnType<typeof createTree>,\n spherePositions: Record<TreeSphereId, TreeLayoutCoordinate>\n): TreeLayoutMap {\n const paths = {} as Record<TreePathId, TreeLayoutPath>;\n\n for (const currentPathId of TREE_PATH_IDS) {\n const path = tree.getNode(currentPathId);\n const fromId = path?.data?.from as TreeSphereId | undefined;\n const toId = path?.data?.to as TreeSphereId | undefined;\n\n if (!fromId || !toId) {\n throw new Error(`Tree path ${currentPathId} is missing endpoints.`);\n }\n\n const from = spherePositions[fromId];\n const to = spherePositions[toId];\n\n if (!from || !to) {\n throw new Error(\n `Tree path ${currentPathId} references unknown layout spheres: ${fromId}, ${toId}.`\n );\n }\n\n paths[currentPathId] = {\n fromId,\n toId,\n from: { ...from },\n to: { ...to },\n };\n }\n\n return {\n spheres: cloneCoordinateMap(spherePositions),\n paths,\n };\n}\n\nfunction cloneCoordinateMap(\n coordinates: Record<TreeSphereId, TreeLayoutCoordinate>\n): Record<TreeSphereId, TreeLayoutCoordinate> {\n const clone = {} as Record<TreeSphereId, TreeLayoutCoordinate>;\n for (const currentSphereId of TREE_SPHERE_IDS) {\n const point = coordinates[currentSphereId];\n clone[currentSphereId] = { ...point };\n }\n return clone;\n}\n\nfunction scaleCoordinates(\n coordinates: Record<TreeSphereId, TreeLayoutCoordinate>,\n viewBox: Required<TreeSvgViewBox>\n): Record<TreeSphereId, TreeLayoutCoordinate> {\n const scaled = {} as Record<TreeSphereId, TreeLayoutCoordinate>;\n\n for (const currentSphereId of TREE_SPHERE_IDS) {\n const point = coordinates[currentSphereId];\n scaled[currentSphereId] = {\n x: round(viewBox.minX + (point.x / 100) * viewBox.width),\n y: round(viewBox.minY + (point.y / 100) * viewBox.height),\n };\n }\n\n return scaled;\n}\n\nfunction normalizeViewBox(\n viewBox: TreeSvgViewBox | undefined\n): Required<TreeSvgViewBox> {\n return {\n minX: viewBox?.minX ?? TREE_SVG_DEFAULT_VIEWBOX.minX,\n minY: viewBox?.minY ?? TREE_SVG_DEFAULT_VIEWBOX.minY,\n width: viewBox?.width ?? TREE_SVG_DEFAULT_VIEWBOX.width,\n height: viewBox?.height ?? TREE_SVG_DEFAULT_VIEWBOX.height,\n };\n}\n\nfunction resolvePalette(palette: TreeSvgPalette | undefined): ResolvedPalette {\n if (palette === undefined || palette === \"color\") {\n return {\n mode: \"color\",\n defaultSphereFill: \"#888888\",\n defaultPathColor: \"#888888\",\n sphereFills: {},\n pathColors: {},\n pathEdgeColor: \"#888888\",\n pathEdgeUseFilter: true,\n pathHighlightColor: \"white\",\n pathHighlightOpacity: 0.25,\n specialSphereMode: \"preserve\",\n };\n }\n\n if (palette === \"monochrome\") {\n return {\n mode: \"monochrome\",\n defaultSphereFill: \"#e6ddd0\",\n defaultPathColor: \"#e0d7ca\",\n sphereFills: {},\n pathColors: {},\n pathEdgeColor: \"#2f271e\",\n pathEdgeUseFilter: false,\n sphereStrokeColor: \"#2f271e\",\n sphereStrokeWidth: 2.4,\n pathHighlightColor: \"white\",\n pathHighlightOpacity: 0.2,\n specialSphereMode: \"plain\",\n };\n }\n\n return {\n mode: \"custom\",\n defaultSphereFill: palette.defaultSphereFill ?? \"#111111\",\n defaultPathColor: palette.defaultPathColor ?? \"#111111\",\n sphereFills: palette.sphereFills ?? {},\n pathColors: palette.pathColors ?? {},\n pathEdgeColor: palette.pathEdgeColor ?? (palette.defaultPathColor ?? \"#111111\"),\n pathEdgeUseFilter: false,\n sphereStrokeColor: palette.sphereStrokeColor,\n sphereStrokeWidth: palette.sphereStrokeWidth,\n pathHighlightColor: palette.pathHighlightColor ?? \"white\",\n pathHighlightOpacity: palette.pathHighlightOpacity ?? 0.18,\n specialSphereMode: palette.specialSphereMode ?? \"plain\",\n };\n}\n\nfunction resolveHighlights(\n highlights: TreeSvgHighlights | undefined\n): ResolvedHighlights {\n return {\n pathColors: highlights?.paths ?? {},\n sphereFills: highlights?.spheres ?? {},\n specialSphereMode: highlights?.specialSphereMode ?? \"preserve\",\n };\n}\n\nfunction resolvePathColor(params: {\n highlights: ResolvedHighlights;\n palette: ResolvedPalette;\n tree: ReturnType<typeof createTree>;\n pathId: TreePathId;\n}) {\n const highlightOverride = params.highlights.pathColors[params.pathId];\n if (highlightOverride) {\n return highlightOverride;\n }\n\n const override = params.palette.pathColors[params.pathId];\n if (override) {\n return override;\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultPathColor;\n }\n\n const treeColor =\n params.tree.relatedFirst(params.pathId, MiscTypes.COLOR)?.data?.colorHexCodes?.[0];\n\n return treeColor ?? params.palette.defaultPathColor;\n}\n\nfunction resolvePathEdgeColor(params: {\n palette: ResolvedPalette;\n pathColor: string;\n}) {\n if (params.palette.mode === \"color\") {\n return params.pathColor;\n }\n\n return params.palette.pathEdgeColor;\n}\n\nfunction resolveSphereFill(params: {\n palette: ResolvedPalette;\n sphereId: TreeSphereId;\n defaultColors: string[];\n}) {\n const override = params.palette.sphereFills[params.sphereId];\n if (override) {\n return override;\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultSphereFill;\n }\n\n if (params.defaultColors.length > 0) {\n return params.defaultColors;\n }\n\n return params.palette.defaultSphereFill;\n}\n\nfunction toPrimaryFill(fill: string | string[], fallback: string) {\n if (Array.isArray(fill)) {\n return fill[0] ?? fallback;\n }\n\n return fill;\n}\n\nfunction resolveMalkuthColors(params: {\n highlightFill?: string | string[];\n paletteFill: string | string[];\n defaultColors: string[];\n}) {\n if (params.highlightFill) {\n return expandColors(\n params.highlightFill,\n params.defaultColors.length,\n params.defaultColors\n );\n }\n\n if (Array.isArray(params.paletteFill)) {\n return expandColors(\n params.paletteFill,\n params.defaultColors.length,\n params.defaultColors\n );\n }\n\n return params.defaultColors;\n}\n\nfunction expandColors(\n fill: string | string[],\n count: number,\n fallbackColors: string[]\n) {\n if (Array.isArray(fill)) {\n if (fill.length === 0) {\n return fallbackColors.slice(0, count);\n }\n\n return Array.from({ length: count }, (_, index) => {\n return fill[index] ?? fill[fill.length - 1];\n });\n }\n\n return Array.from({ length: count }, () => fill);\n}\n\nfunction round(value: number) {\n return Math.round(value * 100) / 100;\n}\n\nfunction polarToCartesian(\n cx: number,\n cy: number,\n radius: number,\n degrees: number\n) {\n const radians = (Math.PI / 180) * degrees;\n return {\n x: round(cx + radius * Math.cos(radians)),\n y: round(cy + radius * Math.sin(radians)),\n };\n}\n\nfunction arcPath(\n cx: number,\n cy: number,\n radius: number,\n startDegrees: number,\n endDegrees: number\n) {\n const start = polarToCartesian(cx, cy, radius, startDegrees);\n const end = polarToCartesian(cx, cy, radius, endDegrees);\n const largeArc = endDegrees - startDegrees <= 180 ? 0 : 1;\n return `M ${cx} ${cy} L ${start.x} ${start.y} A ${radius} ${radius} 0 ${largeArc} 1 ${end.x} ${end.y} Z`;\n}\n\nfunction renderKether(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n baseFill = \"#e0e0e0\"\n) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\" fill=\"${escapeAttr(baseFill)}\"/>`\n );\n push(`<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\" fill=\"url(#kether-glow)\"/>`);\n\n const spokes = 16;\n const innerRadius = round(radius * 0.18);\n const outerRadius = round(radius * 0.92);\n const innerWidth = round(radius * 0.04);\n const angleStep = 360 / spokes;\n\n push(`<g opacity=\"0.85\">`);\n for (let index = 0; index < spokes; index++) {\n const angle = index * angleStep;\n push(`<g transform=\"rotate(${angle} ${point.x} ${point.y})\">`);\n const x0 = round(point.x - innerWidth);\n const y0 = round(point.y - innerRadius);\n const x1 = point.x;\n const y1 = round(point.y - outerRadius);\n const x2 = round(point.x + innerWidth);\n const y2 = round(point.y - innerRadius);\n push(\n `<polygon points=\"${x0},${y0} ${x1},${y1} ${x2},${y2} ${point.x},${point.y}\" fill=\"url(#kether-facet)\"/>`\n );\n push(`</g>`);\n }\n push(`</g>`);\n push(`<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\" fill=\"url(#kether-rim)\"/>`);\n}\n\nfunction renderSlicedSphere(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n colors: string[],\n startAngle: number\n) {\n const segmentCount = colors.length;\n const step = 360 / segmentCount;\n let currentAngle = startAngle;\n\n for (let index = 0; index < segmentCount; index++) {\n const path = arcPath(point.x, point.y, radius * 0.96, currentAngle, currentAngle + step);\n push(`<path d=\"${path}\" fill=\"${escapeAttr(colors[index])}\" stroke=\"none\"/>`);\n currentAngle += step;\n }\n}\n\nfunction renderIridescent(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number\n) {\n const stops: [number, string][] = [\n [0.0, \"#F0E8EE\"],\n [0.1, \"#ffa3e6\"],\n [0.22, \"#a7e0ff\"],\n [0.34, \"#baff9a\"],\n [0.46, \"#ffe28a\"],\n [0.58, \"#c6a4ff\"],\n [0.7, \"#9ad6ff\"],\n [0.82, \"#ffa3e6\"],\n [1.0, \"#F0E8EE\"],\n ];\n\n const slices = 72;\n const sphereRadius = round(radius * 0.96);\n\n for (let index = 0; index < slices; index++) {\n const t = index / slices;\n const color = interpolateColorStops(stops, t);\n const startDegrees = t * 360 - 90;\n const endDegrees = startDegrees + 360 / slices + 0.5;\n const path = arcPath(point.x, point.y, sphereRadius, startDegrees, endDegrees);\n push(`<path d=\"${path}\" fill=\"${color}\" stroke=\"none\"/>`);\n }\n}\n\nfunction interpolateColorStops(stops: [number, string][], t: number): string {\n let lower = stops[0];\n let upper = stops[stops.length - 1];\n\n for (let index = 0; index < stops.length - 1; index++) {\n if (t >= stops[index][0] && t <= stops[index + 1][0]) {\n lower = stops[index];\n upper = stops[index + 1];\n break;\n }\n }\n\n const range = upper[0] - lower[0] || 1;\n return interpolateColor(lower[1], upper[1], (t - lower[0]) / range);\n}\n\nfunction interpolateColor(start: string, end: string, factor: number) {\n const parse = (hex: string) => {\n const match = hex.match(/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);\n return match\n ? [\n Number.parseInt(match[1], 16),\n Number.parseInt(match[2], 16),\n Number.parseInt(match[3], 16),\n ]\n : [0, 0, 0];\n };\n\n const [r1, g1, b1] = parse(start);\n const [r2, g2, b2] = parse(end);\n const mix = (left: number, right: number) =>\n Math.round(left + (right - left) * factor);\n\n return `#${mix(r1, r2).toString(16).padStart(2, \"0\")}${mix(g1, g2)\n .toString(16)\n .padStart(2, \"0\")}${mix(b1, b2).toString(16).padStart(2, \"0\")}`;\n}\n\nfunction renderYinYang(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n fill?: string | string[]\n) {\n const scale = radius / 50;\n const circleRadius = round(48 * scale);\n const halfRadius = round(24 * scale);\n const dotRadius = round(6 * scale);\n const [lightFill, darkFill] = resolveDualToneFill(fill);\n\n push(`<g transform=\"rotate(180 ${point.x} ${point.y})\">`);\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${circleRadius}\" fill=\"${escapeAttr(lightFill)}\"/>`\n );\n push(\n `<path d=\"M${point.x},${round(point.y - circleRadius)} A${circleRadius},${circleRadius} 0 1,1 ${point.x},${round(point.y + circleRadius)} A${halfRadius},${halfRadius} 0 1,0 ${point.x},${point.y} A${halfRadius},${halfRadius} 0 1,1 ${point.x},${round(point.y - circleRadius)}\" fill=\"${escapeAttr(darkFill)}\"/>`\n );\n push(\n `<circle cx=\"${point.x}\" cy=\"${round(point.y - halfRadius)}\" r=\"${dotRadius}\" fill=\"${escapeAttr(lightFill)}\"/>`\n );\n push(\n `<circle cx=\"${point.x}\" cy=\"${round(point.y + halfRadius)}\" r=\"${dotRadius}\" fill=\"${escapeAttr(darkFill)}\"/>`\n );\n push(`</g>`);\n}\n\nfunction renderSphereTintOverlay(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n fill: string | string[],\n opacity: number\n) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\" fill=\"${escapeAttr(toPrimaryFill(fill, \"#ffffff\"))}\" fill-opacity=\"${opacity}\"/>`\n );\n}\n\nfunction resolveDualToneFill(fill: string | string[] | undefined) {\n if (Array.isArray(fill)) {\n return [fill[0] ?? \"white\", fill[1] ?? \"black\"] as const;\n }\n\n if (fill) {\n return [fill, \"black\"] as const;\n }\n\n return [\"white\", \"black\"] as const;\n}\n\nfunction escapeAttr(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\");\n}\n"]}
|