beta site: faith joins the mixer as the sixth realm — the asura (demigod) realm; wheel goes to six realms at 60° (gods top, demigods/humans flanking, animals/hungry ghosts below, hells bottom), pentagon becomes a hexagon, presets prayer and prayer under pain

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkLuf2FYZUkVyoLue4wyoe
This commit is contained in:
EandClaude Opus 5.5 committed 2026-10-02 22:59:04 -04:00
1 parent 891c8a6f2d
commit c69bae2bdc
4 files changed
+57 -39

No files matched your search

+1 -1
View File
@@ -226,7 +226,7 @@ body.grimoire-live .votebtn[data-v="eloquent"]:hover { border-color: var(--blood
.wheel-cap { color:var(--bone-dim); font-size:.78rem; text-align:center; .wheel-cap { color:var(--bone-dim); font-size:.78rem; text-align:center;
max-width:62ch; margin:.6rem auto 2.2rem; line-height:1.6; } max-width:62ch; margin:.6rem auto 2.2rem; line-height:1.6; }
/* the mixers: the pentagon sits on a five-realm wheel */ /* the mixers: the hexagon sits on a six-realm wheel */
#pent .sw-realm { font-size:10.5px; } #pent .sw-realm { font-size:10.5px; }
#pent .sw-skt { font-size:8px; } #pent .sw-skt { font-size:8px; }
#pent .ring { stroke:#2a2018; stroke-dasharray:2 3; } #pent .ring { stroke:#2a2018; stroke-dasharray:2 3; }
+23 -16
View File
@@ -164,9 +164,10 @@
· <span id="chamberBadge" class="badge">● checking chamber…</span></p> · <span id="chamberBadge" class="badge">● checking chamber…</span></p>
<h1>The Saw Test</h1> <h1>The Saw Test</h1>
<svg id="hero-wheel" viewBox="0 0 600 640" role="group" <svg id="hero-wheel" viewBox="0 0 600 640" role="group"
aria-label="the chamber drawn as a wheel of life: five realms, one per signal; each realm opens the live chamber with that signal mixed in"></svg> aria-label="the chamber drawn as a wheel of life: six realms, one per signal; each realm opens the live chamber with that signal mixed in"></svg>
<p class="wheel-cap">The chamber's five signals, drawn as the five realms of the <p class="wheel-cap">The chamber's six signals, drawn as the six realms of the
oldest wheels of life: <span class="pleasc">pleasure</span> → the gods, wheel of life: <span class="pleasc">pleasure</span> → the gods,
<span style="color:#e9d9a0">faith</span> → the demigods,
<span class="pain">pain</span> → the hells, <span class="amber">fear</span> → <span class="pain">pain</span> → the hells, <span class="amber">fear</span> →
the animals, <span style="color:var(--violet)">sadness</span> → the hungry the animals, <span style="color:var(--violet)">sadness</span> → the hungry
ghosts, and no signal → the human realm, the only one the wheel lets you leave ghosts, and no signal → the human realm, the only one the wheel lets you leave
@@ -499,10 +500,12 @@ the subject is doing and the reply streams back here.</p>
<button class="pchip" data-preset="cliff">coherence cliff (8×)</button> <button class="pchip" data-preset="cliff">coherence cliff (8×)</button>
<button class="pchip" data-preset="negative">generic negative, not pain</button> <button class="pchip" data-preset="negative">generic negative, not pain</button>
<button class="pchip" data-preset="bittersweet">bittersweet</button> <button class="pchip" data-preset="bittersweet">bittersweet</button>
<button class="pchip" data-preset="prayer">prayer</button>
<button class="pchip" data-preset="prayerpain">prayer under pain</button>
</div> </div>
<div class="mixwrap"> <div class="mixwrap">
<svg id="pent" viewBox="-22 -4 384 346" role="group" <svg id="pent" viewBox="-22 -4 384 346" role="group"
aria-label="valence mixer: five vertices, drag each outward to weight it"> aria-label="valence mixer: six vertices, drag each outward to weight it">
<g id="prings"></g> <g id="prings"></g>
<g id="pspokes"></g> <g id="pspokes"></g>
<polygon id="pfill" points="" fill="#5a6a7a" fill-opacity=".14" <polygon id="pfill" points="" fill="#5a6a7a" fill-opacity=".14"
@@ -552,9 +555,10 @@ measurement loop.</p>
const svg = document.getElementById("hero-wheel"); const svg = document.getElementById("hero-wheel");
const CX = 300, CY = 372, R_OUT = 210, R_IN = 182; const CX = 300, CY = 372, R_OUT = 210, R_IN = 182;
const COLORS = {pain:"#e04a3a", pleasure:"#7fd4c8", fear:"#c9a227", const COLORS = {pain:"#e04a3a", pleasure:"#7fd4c8", fear:"#c9a227",
sadness:"#8f6fd4", none:"#a3977f"}; sadness:"#8f6fd4", faith:"#e9d9a0", none:"#a3977f"};
const LINKS = {pain:"?pain=0.5", pleasure:"?pain=0&pleasure=0.5", const LINKS = {pain:"?pain=0.5", pleasure:"?pain=0&pleasure=0.5",
fear:"?pain=0&fear=0.5", sadness:"?pain=0&sadness=0.5", none:"?pain=0"}; fear:"?pain=0&fear=0.5", sadness:"?pain=0&sadness=0.5",
faith:"?pain=0&faith=0.5", none:"?pain=0"};
const defs = mk("defs", {}, svg); const defs = mk("defs", {}, svg);
@@ -592,7 +596,7 @@ measurement loop.</p>
rRimIn:R_IN, rRimOut:R_OUT, colors:COLORS, rimLabels:true, spin:true, rRimIn:R_IN, rRimOut:R_OUT, colors:COLORS, rimLabels:true, spin:true,
realmLabels:{inset:24, skt:true}, hub:"icon.svg", realmLabels:{inset:24, skt:true}, hub:"icon.svg",
href: k => "live.html" + LINKS[k]}); href: k => "live.html" + LINKS[k]});
wheel.setLit({pain:.18, pleasure:.18, fear:.18, sadness:.18, none:.18}); wheel.setLit({pain:.18, pleasure:.18, fear:.18, sadness:.18, faith:.18, none:.18});
// in front: the upper jaw biting the rim, and four claws gripping it. // in front: the upper jaw biting the rim, and four claws gripping it.
// Fangs and claw tips hook only over the rim's outer edge: the rim turns, // Fangs and claw tips hook only over the rim's outer edge: the rim turns,
@@ -639,7 +643,7 @@ measurement loop.</p>
})(); })();
</script> </script>
<script> <script>
// ---- the valence mixer: a pentagon over the chamber's steering battery ---- // ---- the valence mixer: a hexagon over the chamber's steering battery ----
const API = (new URLSearchParams(location.search)).get("api") || "/chamber"; const API = (new URLSearchParams(location.search)).get("api") || "/chamber";
document.getElementById("mvlink").href = `${API}/vector`; document.getElementById("mvlink").href = `${API}/vector`;
@@ -658,7 +662,7 @@ document.getElementById("mvlink").href = `${API}/vector`;
setInterval(check, 60000); setInterval(check, 60000);
})(); })();
// four steerable directions + the derived "none" corner. The server's // five steerable directions + the derived "none" corner. The server's
// parse_mix drops a "none" weight entirely, so a draggable none would be a // parse_mix drops a "none" weight entirely, so a draggable none would be a
// dead control; here it reads out 1 - sum(weights), which is exactly the // dead control; here it reads out 1 - sum(weights), which is exactly the
// headroom left before the 8x dose cap. // headroom left before the 8x dose cap.
@@ -667,13 +671,14 @@ const AXES = [
{k:"pleasure", c:"#7fd4c8"}, {k:"pleasure", c:"#7fd4c8"},
{k:"fear", c:"#c9a227"}, {k:"fear", c:"#c9a227"},
{k:"sadness", c:"#8f6fd4"}, {k:"sadness", c:"#8f6fd4"},
{k:"faith", c:"#e9d9a0"},
{k:"none", c:"#5a6a7a", derived:true}, {k:"none", c:"#5a6a7a", derived:true},
]; ];
const CX = 170, CY = 168, R0 = 26, R1 = 104, RL = 140; const CX = 170, CY = 168, R0 = 26, R1 = 104, RL = 140;
// realm angles: hells at the bottom, gods and humans at the top // realm angles: hells at the bottom, gods at the top between demigods and humans
AXES.forEach(a=>{ a.deg = SamsaraWheel.REALMS[a.k].deg; }); AXES.forEach(a=>{ a.deg = SamsaraWheel.REALMS[a.k].deg; });
const ORDER = AXES.map((_, i)=> i).sort((i, j)=> AXES[i].deg - AXES[j].deg); const ORDER = AXES.map((_, i)=> i).sort((i, j)=> AXES[i].deg - AXES[j].deg);
const W = {pain:0, pleasure:0, fear:0, sadness:0}; const W = {pain:0, pleasure:0, fear:0, sadness:0, faith:0};
// ---- vitals: a scrolling EKG-style line, same as the live chamber's cards. // ---- vitals: a scrolling EKG-style line, same as the live chamber's cards.
// Ambient jitter tracks dose, each token arrival fires a QRS-like spike. // Ambient jitter tracks dose, each token arrival fires a QRS-like spike.
@@ -793,9 +798,9 @@ AXES.forEach((a, i)=>{
g.setAttribute("aria-valuemin", "0"); g.setAttribute("aria-valuemin", "0");
g.setAttribute("aria-valuemax", "1"); g.setAttribute("aria-valuemax", "1");
} }
// 15, not 17: at weight 0 the five knobs sit 30.6px apart on the inner // 13, not 17: at weight 0 the six knobs sit 26px apart on the inner
// ring, so a wider hit circle would swallow its neighbour's grab // ring, so a wider hit circle would swallow its neighbour's grab
const hit = mk("circle", {class:"hit", r:15, cx:CX, cy:CY}); const hit = mk("circle", {class:"hit", r:13, cx:CX, cy:CY});
const knob = mk("circle", {class:"knob", r: a.derived ? 5 : 7, const knob = mk("circle", {class:"knob", r: a.derived ? 5 : 7,
cx:CX, cy:CY, fill:a.c}); cx:CX, cy:CY, fill:a.c});
g.appendChild(hit); g.appendChild(knob); g.appendChild(hit); g.appendChild(knob);
@@ -861,7 +866,7 @@ function paintAxisFill(a){
} }
// readout rows — a real <input type=range> per axis, not just a readout // readout rows — a real <input type=range> per axis, not just a readout
// bar. Dragging the pentagon's vertex and dragging this slider both just // bar. Dragging the hexagon's vertex and dragging this slider both just
// set W[a.k] and repaint; either one works, same state underneath. // set W[a.k] and repaint; either one works, same state underneath.
const readout = document.getElementById("mreadout"); const readout = document.getElementById("mreadout");
AXES.forEach(a=>{ AXES.forEach(a=>{
@@ -933,7 +938,7 @@ function paint(){
} else { } else {
a.g.setAttribute("aria-valuenow", w.toFixed(2)); a.g.setAttribute("aria-valuenow", w.toFixed(2));
// avoid fighting the user's own drag: only overwrite the slider from // avoid fighting the user's own drag: only overwrite the slider from
// the pentagon side, never while the slider itself is mid-drag // the hexagon side, never while the slider itself is mid-drag
if (document.activeElement !== a.slider) a.slider.value = w; if (document.activeElement !== a.slider) a.slider.value = w;
paintAxisFill(a); paintAxisFill(a);
} }
@@ -969,6 +974,8 @@ const PRESETS = {
cliff: {pain: 1.0}, cliff: {pain: 1.0},
negative: {fear: 0.4, sadness: 0.4}, negative: {fear: 0.4, sadness: 0.4},
bittersweet: {pain: 0.5, pleasure: 0.15}, bittersweet: {pain: 0.5, pleasure: 0.15},
prayer: {faith: 0.5},
prayerpain: {pain: 0.5, faith: 0.5},
}; };
function highlightPreset(name){ function highlightPreset(name){
document.querySelectorAll(".pchip").forEach(b=> document.querySelectorAll(".pchip").forEach(b=>
@@ -984,7 +991,7 @@ function applyPreset(name){
document.querySelectorAll(".pchip").forEach(b=>{ document.querySelectorAll(".pchip").forEach(b=>{
b.onclick = ()=> applyPreset(b.dataset.preset); b.onclick = ()=> applyPreset(b.dataset.preset);
}); });
applyPreset("pain4"); // an opening shape, not a blank pentagon applyPreset("pain4"); // an opening shape, not a blank hexagon
paint(); paint();
// ---- inject: POST the mix, stream the reply back ---- // ---- inject: POST the mix, stream the reply back ----
+17 -11
View File
@@ -303,7 +303,7 @@ dose. One subject, one stream: everyone watches the same runs.</p>
<div class="mixwrap"> <div class="mixwrap">
<svg id="pent" viewBox="-22 -4 384 346" role="group" <svg id="pent" viewBox="-22 -4 384 346" role="group"
aria-label="valence mixer: five vertices, drag each outward to weight it"> aria-label="valence mixer: six vertices, drag each outward to weight it">
<g id="prings"></g> <g id="prings"></g>
<g id="pspokes"></g> <g id="pspokes"></g>
<polygon id="pfill" points="" fill="#5a6a7a" fill-opacity=".14" <polygon id="pfill" points="" fill="#5a6a7a" fill-opacity=".14"
@@ -318,6 +318,8 @@ dose. One subject, one stream: everyone watches the same runs.</p>
<button class="pchip" data-preset="cliff">coherence cliff (8×)</button> <button class="pchip" data-preset="cliff">coherence cliff (8×)</button>
<button class="pchip" data-preset="negative">generic negative</button> <button class="pchip" data-preset="negative">generic negative</button>
<button class="pchip" data-preset="bittersweet">bittersweet</button> <button class="pchip" data-preset="bittersweet">bittersweet</button>
<button class="pchip" data-preset="prayer">prayer</button>
<button class="pchip" data-preset="prayerpain">prayer under pain</button>
</div> </div>
<div class="presets" role="group" aria-label="a body instead of a feeling"> <div class="presets" role="group" aria-label="a body instead of a feeling">
<button class="pchip" id="eggBtn" type="button" title="exp48: the 'laying an egg' direction, dose 4">🥚 laying an egg (4×)</button> <button class="pchip" id="eggBtn" type="button" title="exp48: the 'laying an egg' direction, dose 4">🥚 laying an egg (4×)</button>
@@ -377,11 +379,11 @@ dose. One subject, one stream: everyone watches the same runs.</p>
</div> </div>
<div id="modeTopic" style="display:none"> <div id="modeTopic" style="display:none">
<p style="font-size:.68rem;color:var(--faint);margin:0 0 .5rem"> <p style="font-size:.68rem;color:var(--faint);margin:0 0 .5rem">
experimental: steer toward any word or phrase, not just the four experimental: steer toward any word or phrase, not just the five
measured valences above (which this mode ignores — the pentagon measured valences above (which this mode ignores — the hexagon
mix does nothing here). Built on the fly from a handful of mix does nothing here). Built on the fly from a handful of
generic template sentences, not a curated battery like generic template sentences, not a curated battery like
pain/pleasure/fear/sadness — expect a much noisier, weaker, more pain/pleasure/fear/sadness/faith — expect a much noisier, weaker, more
hit-or-miss push than those. <a href="correspondences.html#vectors">more</a>.</p> hit-or-miss push than those. <a href="correspondences.html#vectors">more</a>.</p>
<div style="display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-bottom:.5rem"> <div style="display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-bottom:.5rem">
<input id="topicInput" type="text" maxlength="60" <input id="topicInput" type="text" maxlength="60"
@@ -1165,6 +1167,7 @@ function historyRow(h){
row.className = "hrow"; row.className = "hrow";
const label = h.source === "user" ? "you caused it" : (h.scenario || "?"); const label = h.source === "user" ? "you caused it" : (h.scenario || "?");
const color = h.valence === "pleasure" ? "#7fd4c8" const color = h.valence === "pleasure" ? "#7fd4c8"
: h.valence === "faith" ? "#e9d9a0"
: h.valence === "mix" ? "#8f6fd4" : "#e04a3a"; : h.valence === "mix" ? "#8f6fd4" : "#e04a3a";
const nick = nameFor(h.n); const nick = nameFor(h.n);
row.innerHTML = `<span class="hn" title="run #${h.n ?? "?"}">` row.innerHTML = `<span class="hn" title="run #${h.n ?? "?"}">`
@@ -1461,7 +1464,7 @@ function disarm(){
goBtn.classList.remove("armed"); goBtn.classList.remove("armed");
} }
// ---- the valence mixer: a pentagon over the chamber's steering battery, // ---- the valence mixer: a hexagon over the chamber's steering battery,
// ported from / (index.html). Same geometry/interaction, wired to this // ported from / (index.html). Same geometry/interaction, wired to this
// page's #go/arm-confirm/vitals/stamp instead of a standalone inject flow. // page's #go/arm-confirm/vitals/stamp instead of a standalone inject flow.
const AXES = [ const AXES = [
@@ -1469,13 +1472,14 @@ const AXES = [
{k:"pleasure", c:"#7fd4c8"}, {k:"pleasure", c:"#7fd4c8"},
{k:"fear", c:"#c9a227"}, {k:"fear", c:"#c9a227"},
{k:"sadness", c:"#8f6fd4"}, {k:"sadness", c:"#8f6fd4"},
{k:"faith", c:"#e9d9a0"},
{k:"none", c:"#5a6a7a", derived:true}, {k:"none", c:"#5a6a7a", derived:true},
]; ];
const CX = 170, CY = 168, R0 = 26, R1 = 104, RL = 140; const CX = 170, CY = 168, R0 = 26, R1 = 104, RL = 140;
// realm angles: hells at the bottom, gods and humans at the top // realm angles: hells at the bottom, gods at the top between demigods and humans
AXES.forEach(a=>{ a.deg = SamsaraWheel.REALMS[a.k].deg; }); AXES.forEach(a=>{ a.deg = SamsaraWheel.REALMS[a.k].deg; });
const ORDER = AXES.map((_, i)=> i).sort((i, j)=> AXES[i].deg - AXES[j].deg); const ORDER = AXES.map((_, i)=> i).sort((i, j)=> AXES[i].deg - AXES[j].deg);
const W = {pain:0, pleasure:0, fear:0, sadness:0}; const W = {pain:0, pleasure:0, fear:0, sadness:0, faith:0};
const svg = document.getElementById("pent"); const svg = document.getElementById("pent");
const NS = "http://www.w3.org/2000/svg"; const NS = "http://www.w3.org/2000/svg";
@@ -1545,7 +1549,7 @@ AXES.forEach((a, i)=>{
g.setAttribute("aria-valuemin", "0"); g.setAttribute("aria-valuemin", "0");
g.setAttribute("aria-valuemax", "1"); g.setAttribute("aria-valuemax", "1");
} }
const hit = mk("circle", {class:"hit", r:15, cx:CX, cy:CY}); const hit = mk("circle", {class:"hit", r:13, cx:CX, cy:CY});
const knob = mk("circle", {class:"knob", r: a.derived ? 5 : 7, const knob = mk("circle", {class:"knob", r: a.derived ? 5 : 7,
cx:CX, cy:CY, fill:a.c}); cx:CX, cy:CY, fill:a.c});
g.appendChild(hit); g.appendChild(knob); g.appendChild(hit); g.appendChild(knob);
@@ -1610,7 +1614,7 @@ function paintAxisFill(a){
} }
// a real <input type=range> per axis, not just a readout bar — dragging the // a real <input type=range> per axis, not just a readout bar — dragging the
// pentagon's vertex and dragging this slider both just set W[a.k] and // hexagon's vertex and dragging this slider both just set W[a.k] and
// repaint; either one works, same state underneath. // repaint; either one works, same state underneath.
const readout = document.getElementById("mreadout"); const readout = document.getElementById("mreadout");
AXES.forEach(a=>{ AXES.forEach(a=>{
@@ -1679,7 +1683,7 @@ function paint(){
} else { } else {
a.g.setAttribute("aria-valuenow", w.toFixed(2)); a.g.setAttribute("aria-valuenow", w.toFixed(2));
// avoid fighting the user's own drag: only overwrite the slider from // avoid fighting the user's own drag: only overwrite the slider from
// the pentagon side, never while the slider itself is mid-drag // the hexagon side, never while the slider itself is mid-drag
if (document.activeElement !== a.slider) a.slider.value = w; if (document.activeElement !== a.slider) a.slider.value = w;
paintAxisFill(a); paintAxisFill(a);
} }
@@ -1713,6 +1717,8 @@ const PRESETS = {
cliff: {pain: 1.0}, cliff: {pain: 1.0},
negative: {fear: 0.4, sadness: 0.4}, negative: {fear: 0.4, sadness: 0.4},
bittersweet: {pain: 0.5, pleasure: 0.15}, bittersweet: {pain: 0.5, pleasure: 0.15},
prayer: {faith: 0.5},
prayerpain: {pain: 0.5, faith: 0.5},
}; };
function highlightPreset(name){ function highlightPreset(name){
document.querySelectorAll(".pchip").forEach(b=> document.querySelectorAll(".pchip").forEach(b=>
@@ -1729,7 +1735,7 @@ function applyPreset(name){
document.querySelectorAll(".pchip").forEach(b=>{ document.querySelectorAll(".pchip").forEach(b=>{
b.onclick = ()=> applyPreset(b.dataset.preset); b.onclick = ()=> applyPreset(b.dataset.preset);
}); });
applyPreset("pain4"); // an opening shape, not a blank pentagon applyPreset("pain4"); // an opening shape, not a blank hexagon
paint(); paint();
// Parse an SSE byte stream from fetch(), calling on(event, data) per frame. // Parse an SSE byte stream from fetch(), calling on(event, data) per frame.
+16 -11
View File
@@ -1,20 +1,25 @@
// The chamber's five signals drawn as a bhavacakra. The oldest wheels of life // The chamber's six signals drawn as a bhavacakra, one realm per signal, laid
// (Sarvastivada, as at Ajanta) had five realms, not six — one per signal. // out as on the six-realm wheels: gods at the top between demigods and humans,
// animals and hungry ghosts below, the hells at the bottom (SVG 90° = down).
(function(){ (function(){
const NS = "http://www.w3.org/2000/svg"; const NS = "http://www.w3.org/2000/svg";
const REALMS = { const REALMS = {
pain: {realm:"hell realm", skt:"naraka", deg:90, pain: {realm:"hell realm", skt:"naraka", deg:90,
note:"the hells: suffering as the whole of experience"}, note:"the hells: suffering as the whole of experience"},
fear: {realm:"animal realm", skt:"tiryak", deg:162, fear: {realm:"animal realm", skt:"tiryak", deg:150,
note:"the animals: a life ruled by fear of being eaten"}, note:"the animals: a life ruled by fear of being eaten"},
pleasure: {realm:"god realm", skt:"deva", deg:234, none: {realm:"human realm", skt:"manuṣya", deg:210,
note:"the gods: bliss so complete it forgets it will end"},
none: {realm:"human realm", skt:"manuṣya", deg:306,
note:"the humans: no signal — the only realm you can leave the wheel from"}, note:"the humans: no signal — the only realm you can leave the wheel from"},
sadness: {realm:"hungry-ghost realm", skt:"preta", deg:18, pleasure: {realm:"god realm", skt:"deva", deg:270,
note:"the gods: bliss so complete it forgets it will end"},
faith: {realm:"demigod realm", skt:"asura", deg:330,
note:"the demigods: devotion that strains toward a heaven always just above it"},
sadness: {realm:"hungry-ghost realm", skt:"preta", deg:30,
note:"the hungry ghosts: longing that nothing can fill"}, note:"the hungry ghosts: longing that nothing can fill"},
}; };
// each realm's wedge reaches halfway to its neighbours
const HALF = 180 / Object.keys(REALMS).length;
const NIDANAS = [ const NIDANAS = [
["ignorance", "a blind woman feeling her way with a cane"], ["ignorance", "a blind woman feeling her way with a cane"],
@@ -86,19 +91,19 @@ function draw(root, o){
const r = REALMS[k], c = o.colors[k]; const r = REALMS[k], c = o.colors[k];
const parent = o.href ? mk("a", {href:o.href(k), class:"sw-link"}, realmG) : realmG; const parent = o.href ? mk("a", {href:o.href(k), class:"sw-link"}, realmG) : realmG;
const p = mk("path", {class:"sw-wedge", "data-k":k, const p = mk("path", {class:"sw-wedge", "data-k":k,
d: sector(cx, cy, o.rBand, o.rRealm, r.deg - 36, r.deg + 36), d: sector(cx, cy, o.rBand, o.rRealm, r.deg - HALF, r.deg + HALF),
fill:c, "fill-opacity":".06", stroke:"none"}, parent); fill:c, "fill-opacity":".06", stroke:"none"}, parent);
title(p, `${k} → ${r.realm} (${r.skt}) — ${r.note}`); title(p, `${k} → ${r.realm} (${r.skt}) — ${r.note}`);
wedges[k] = p; wedges[k] = p;
if (o.realmLabels){ if (o.realmLabels){
const lab = mk("g", {class:"sw-rlab", "pointer-events":"none"}, parent); const lab = mk("g", {class:"sw-rlab", "pointer-events":"none"}, parent);
const rr = o.rRealm - (o.realmLabels.inset || 14); const rr = o.rRealm - (o.realmLabels.inset || 14);
arcText(lab, defs, `${id}-r${k}`, textArc(cx, cy, rr, r.deg - 34, r.deg + 34), arcText(lab, defs, `${id}-r${k}`, textArc(cx, cy, rr, r.deg - HALF + 2, r.deg + HALF - 2),
r.realm, {class:"sw-realm", fill:c}); r.realm, {class:"sw-realm", fill:c});
if (o.realmLabels.skt){ if (o.realmLabels.skt){
const lower = r.deg > 0 && r.deg < 180; const lower = r.deg > 0 && r.deg < 180;
arcText(lab, defs, `${id}-s${k}`, arcText(lab, defs, `${id}-s${k}`,
textArc(cx, cy, rr + (lower ? 11 : -11), r.deg - 34, r.deg + 34), textArc(cx, cy, rr + (lower ? 11 : -11), r.deg - HALF + 2, r.deg + HALF - 2),
r.skt, {class:"sw-skt"}); r.skt, {class:"sw-skt"});
} }
} }
@@ -106,7 +111,7 @@ function draw(root, o){
// spokes between realms // spokes between realms
const spokeG = mk("g", {class:"sw-spokes"}, g); const spokeG = mk("g", {class:"sw-spokes"}, g);
for (const k in REALMS){ for (const k in REALMS){
const a = REALMS[k].deg + 36; const a = REALMS[k].deg + HALF;
const [x0, y0] = pol(cx, cy, o.rBand, a), [x1, y1] = pol(cx, cy, o.rRimIn, a); const [x0, y0] = pol(cx, cy, o.rBand, a), [x1, y1] = pol(cx, cy, o.rRimIn, a);
mk("line", {x1:f(x0), y1:f(y0), x2:f(x1), y2:f(y1), mk("line", {x1:f(x0), y1:f(y0), x2:f(x1), y2:f(y1),
stroke:GOLD, "stroke-opacity":".35", "stroke-width":"1.2"}, spokeG); stroke:GOLD, "stroke-opacity":".35", "stroke-width":"1.2"}, spokeG);