// Behavior finder — pills for prompt categories with a tiny inline curve.
const { useMemo: useMemoBF } = React;
function BehaviorFinder({ activeBehavior, onSelect, perBehaviorPeak }) {
return (
Behavior finder
Where does this live in the brain?
{AtlasData.BEHAVIORS.map(b => {
const active = activeBehavior === b.id;
const peak = perBehaviorPeak[b.id];
return (
);
})}
{activeBehavior
? <>Overlay active — heatmap weighted toward {AtlasData.BEHAVIORS.find(x => x.id === activeBehavior)?.label}.>
: <>{(AtlasData.BEHAVIORS || []).length} categories from the probe set · per-behavior cell-level fits coming in v0.4.>}
{activeBehavior && (
)}
);
}
function MiniCurve({ behaviorId, active }) {
const pts = useMemoBF(() => {
const m = AtlasData.BEHAVIOR_MATRICES[behaviorId];
if (!m) return [];
return m.map(row => {
const valid = row.filter(v => Number.isFinite(v));
if (!valid.length) return 0;
return valid.reduce((a, b) => a + b, 0) / valid.length;
});
}, [behaviorId]);
if (!pts.length) return null;
const max = Math.max(...pts, 0.01);
const W = 120, H = 22;
const path = pts.map((v, i) => {
const x = (i / Math.max(1, pts.length - 1)) * W;
const y = H - (v / max) * (H - 2) - 1;
return (i === 0 ? 'M' : 'L') + x.toFixed(1) + ' ' + y.toFixed(1);
}).join(' ');
const fillPath = path + ` L${W} ${H} L0 ${H} Z`;
return (