// MiniMap — small mandala echo with labeled sectors and current position pin. // Each sector wedge is labeled with its short name on hover and inline when // focused, so the user can always read "this is X technique". window.MiniMap = function MiniMap({ focusSector, focusRing, scores, tone = 'serif-dark' }) { const sectors = window.TAXONOMY.sectors; const rings = window.TAXONOMY.rings; const size = 220; const cx = size / 2, cy = size / 2; const rOuter = size * 0.36; const rLabel = size * 0.46; const theme = window.MANDALA_TONES[tone] || window.MANDALA_TONES['serif-dark']; const max = Math.max(1, ...Object.values(scores || {})); const SPAN = 360 / sectors.length; const wedge = (angle, span = SPAN) => { const a0 = ((angle - span / 2) - 90) * Math.PI / 180; const a1 = ((angle + span / 2) - 90) * Math.PI / 180; const x0 = cx + rOuter * Math.cos(a0), y0 = cy + rOuter * Math.sin(a0); const x1 = cx + rOuter * Math.cos(a1), y1 = cy + rOuter * Math.sin(a1); return `M ${cx} ${cy} L ${x0} ${y0} A ${rOuter} ${rOuter} 0 0 1 ${x1} ${y1} Z`; }; let pin = null; if (focusSector) { const s = sectors.find(s => s.id === focusSector); const ringIdx = focusRing != null ? focusRing : 0; const radius = rOuter * rings[ringIdx].rNorm * 0.85; const a = (s.angle - 90) * Math.PI / 180; pin = { x: cx + radius * Math.cos(a), y: cy + radius * Math.sin(a) }; } // Short labels (compact for the mini-map) const SHORT = { anova: 'CONTRASTS', regression: 'REG/SEM', fsqca: 'fsQCA', plssem: 'PLS-SEM', cluster: 'CLUSTER', trees: 'TREES', xai: 'XAI/EBM', deep: 'NEURAL NETWORK', }; return (