// Tese.jsx — Gráfico SVG animado: Tentativas × Transformação const { useRef: useTRef, useEffect: useTEff, useState: useTState } = React; function TeseChart() { const [animated, setAnimated] = useTState(false); const chartRef = useTRef(); useTEff(() => { const el = chartRef.current; if (!el) return; const obs = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setAnimated(true); obs.disconnect(); } }, { threshold: 0.3 }); obs.observe(el); return () => obs.disconnect(); }, []); const W = 500, H = 280, PL = 44, PR = 16, PT = 16, PB = 44; const cW = W - PL - PR, cH = H - PT - PB; const weeks = 25; // 0..24 // Tentativas sem método — flat low with dips const attemptsData = Array.from({ length: weeks }, (_, i) => { const base = 0.22; const noise = Math.sin(i * 1.2) * 0.07 + Math.sin(i * 0.5) * 0.05; const dip = i > 6 && i < 10 ? -0.08 : 0; return Math.max(0.05, base + noise + dip); }); // Transformação Conectadas — smooth growth curve const transformData = Array.from({ length: weeks }, (_, i) => { return Math.min(0.98, 0.06 + (i / (weeks - 1)) ** 1.6 * 0.92); }); function dataToPath(data, cx, cy) { return data.map((v, i) => { const x = PL + (i / (data.length - 1)) * cW; const y = PT + cy - v * cy; return `${i === 0 ? 'M' : 'L'} ${x.toFixed(1)} ${y.toFixed(1)}`; }).join(' '); } function dataToAreaPath(data, cx, cy) { const line = dataToPath(data, cx, cy); const lastX = (PL + cW).toFixed(1); const lastY = (PT + cy).toFixed(1); const firstX = PL.toFixed(1); return `${line} L ${lastX} ${lastY} L ${firstX} ${lastY} Z`; } const attemptPath = dataToPath(attemptsData, cW, cH); const transformPath = dataToPath(transformData, cW, cH); const gapAreaPath = dataToAreaPath(transformData, cW, cH); const ticksY = [0, 25, 50, 75, 100]; const ticksX = [0, 6, 12, 18, 24]; return (
A tese
{p.body}