Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 | 'use client' import * as Tabs from '@radix-ui/react-tabs' import dynamic from 'next/dynamic' import { useEffect, useState } from 'react' // Dynamic import echarts to reduce bundle size const ReactECharts = dynamic(() => import('echarts-for-react'), { ssr: false, loading: () => ( <div style={{ height: '300px', display: 'flex', alignItems: 'center', justifyContent: 'center', }} > Loading chart... </div> ), }) import { css } from '../../../styled-system/css' const chartContainerStyles = css({ bg: 'bg.surface', borderRadius: '0.5rem', p: { base: '0.5rem', md: '1rem' }, border: '1px solid', borderColor: 'border.muted', my: '1.5rem', }) const tabStyles = css({ display: 'flex', flexDirection: 'column', gap: '1rem', }) const tabListStyles = css({ display: 'flex', gap: '0.25rem', borderBottom: '1px solid', borderColor: 'border.muted', pb: '0', overflowX: 'auto', flexWrap: 'nowrap', }) const tabTriggerStyles = css({ px: { base: '0.75rem', md: '1rem' }, py: '0.75rem', fontSize: { base: '0.75rem', md: '0.875rem' }, fontWeight: 500, color: 'text.muted', bg: 'transparent', border: 'none', borderBottom: '2px solid transparent', cursor: 'pointer', whiteSpace: 'nowrap', transition: 'all 0.2s', _hover: { color: 'text.primary', bg: 'accent.subtle', }, '&[data-state="active"]': { color: 'accent.emphasis', borderBottomColor: 'accent.emphasis', }, }) const tabContentStyles = css({ pt: '1.5rem', outline: 'none', }) const summaryCardStyles = css({ display: 'grid', gridTemplateColumns: { base: '1fr', sm: 'repeat(2, 1fr)', md: 'repeat(3, 1fr)', }, gap: '1rem', mb: '1.5rem', }) const statCardStyles = css({ bg: 'bg.surface', borderRadius: '0.5rem', p: '1rem', border: '1px solid', borderColor: 'border.muted', textAlign: 'center', }) const statValueStyles = css({ fontSize: { base: '1.5rem', md: '2rem' }, fontWeight: 'bold', color: 'accent.emphasis', }) const statLabelStyles = css({ fontSize: '0.75rem', color: 'text.muted', mt: '0.25rem', }) // Type definitions for multi-skill trajectory data interface TrajectorySkillData { id: string label: string category: 'fiveComplement' | 'tenComplement' | 'basic' color: string adaptive: { data: number[] sessionsTo50: number | null sessionsTo80: number | null } classic: { data: number[] sessionsTo50: number | null sessionsTo80: number | null } } interface TrajectoryData { generatedAt: string config: { seed: number sessionCount: number sessionDurationMinutes: number } summary: { totalSkills: number adaptiveWins50: number classicWins50: number ties50: number adaptiveWins80: number classicWins80: number ties80: number } sessions: number[] skills: TrajectorySkillData[] comparisonTable: Array<{ skill: string category: string adaptiveTo80: number | null classicTo80: number | null advantage: string | null }> } const skillButtonStyles = css({ px: '0.75rem', py: '0.5rem', fontSize: '0.75rem', fontWeight: 500, color: 'text.muted', bg: 'bg.surface', border: '1px solid', borderColor: 'border.muted', borderRadius: '0.25rem', cursor: 'pointer', transition: 'all 0.2s', whiteSpace: 'nowrap', _hover: { bg: 'accent.subtle', borderColor: 'accent.default', }, '&[data-selected="true"]': { bg: 'accent.muted', color: 'accent.emphasis', borderColor: 'accent.default', }, }) /** * Example Trajectory Chart - Shows mastery progression over sessions * for adaptive vs classic modes */ export function ExampleTrajectoryChart() { // Data from blog post validation results const sessions = [0, 2, 3, 4, 5, 6, 9, 12] const adaptiveMastery = [0, 34, 64, 72, 77, 83, 91, 94] const classicMastery = [0, 9, 21, 39, 54, 61, 83, 91] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', formatter: (params: Array<{ seriesName: string; value: number; axisValue: number }>) => { const session = params[0]?.axisValue let html = `<strong>Session ${session}</strong><br/>` for (const p of params) { const color = p.seriesName === 'Adaptive' ? '#22c55e' : '#6b7280' html += `<span style="color:${color}">${p.seriesName}</span>: ${p.value}%<br/>` } return html }, }, legend: { data: ['Adaptive', 'Classic'], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '15%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: sessions, name: 'Session', nameLocation: 'middle', nameGap: 30, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Mastery %', nameLocation: 'middle', nameGap: 40, min: 0, max: 100, axisLabel: { color: '#9ca3af', formatter: '{value}%' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Adaptive', type: 'line', data: adaptiveMastery, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#22c55e', width: 3 }, itemStyle: { color: '#22c55e' }, markLine: { silent: true, lineStyle: { color: '#374151', type: 'dashed' }, data: [ { yAxis: 50, label: { formatter: '50%', color: '#9ca3af' } }, { yAxis: 80, label: { formatter: '80%', color: '#9ca3af' } }, ], }, }, { name: 'Classic', type: 'line', data: classicMastery, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#6b7280', width: 3 }, itemStyle: { color: '#6b7280' }, }, ], } return ( <div data-component="example-trajectory-chart" className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Mastery Progression: Adaptive vs Classic </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Fast learner deficient in <code>fiveComplements.3=5-2</code>. Adaptive reaches 80% mastery by session 6; classic takes until session 9. </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** * Convergence Speed Chart - Shows sessions to reach 50% and 80% mastery * across different skills for adaptive vs classic modes * @deprecated Use ValidationResultsCharts instead */ export function ConvergenceSpeedChart() { // Summarized data from blog post - focusing on key comparisons const skills = [ 'fiveComp\n3=5-2', 'fiveCompSub\n-3=-5+2', 'tenComp\n9=10-1', 'tenComp\n5=10-5', 'tenCompSub\n-9=+1-10', ] // null represents "never reached 80%" const adaptiveTo80: (number | null)[] = [6, 6, 5, 10, 7] const classicTo80: (number | null)[] = [9, 8, 6, null, 12] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, formatter: ( params: Array<{ seriesName: string value: number | null name: string }> ) => { const skill = params[0]?.name.replace('\n', ' ') let html = `<strong>${skill}</strong><br/>` for (const p of params) { const value = p.value === null ? 'Never (>12 sessions)' : `${p.value} sessions` html += `${p.seriesName}: ${value}<br/>` } return html }, }, legend: { data: [ { name: 'Adaptive', itemStyle: { color: '#22c55e' } }, { name: 'Classic', itemStyle: { color: '#6b7280' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '15%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: skills, axisLabel: { color: '#9ca3af', interval: 0, fontSize: 10, }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Sessions to 80%', nameLocation: 'middle', nameGap: 40, min: 0, max: 14, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Adaptive', type: 'bar', data: adaptiveTo80.map((v) => ({ value: v, itemStyle: { color: '#22c55e' }, })), barWidth: '35%', itemStyle: { color: '#22c55e' }, label: { show: true, position: 'top', formatter: (params: { value: number | null }) => params.value === null ? '—' : params.value, color: '#9ca3af', fontSize: 11, }, }, { name: 'Classic', type: 'bar', data: classicTo80.map((v) => ({ value: v, itemStyle: { color: '#6b7280' }, })), barWidth: '35%', itemStyle: { color: '#6b7280' }, label: { show: true, position: 'top', formatter: (params: { value: number | null }) => params.value === null ? 'Never' : params.value, color: '#9ca3af', fontSize: 11, }, }, ], } return ( <div data-component="convergence-speed-chart" className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Sessions to Reach 80% Mastery (Fast Learner) </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Adaptive mode consistently reaches mastery faster. "Never" indicates the mode did not reach 80% within 12 sessions. </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** * Automaticity Multiplier Chart - Shows the non-linear curve * from P(known) to cost multiplier */ export function AutomaticityMultiplierChart() { // Generate smooth curve data // Formula: multiplier = 4 - 3 * pKnown^2 (non-linear squared mapping) const dataPoints: Array<[number, number]> = [] for (let p = 0; p <= 1; p += 0.02) { const multiplier = 4 - 3 * p * p dataPoints.push([Math.round(p * 100), Number(multiplier.toFixed(2))]) } // Key reference points from the blog post const referencePoints = [ { pKnown: 100, multiplier: 1.0 }, { pKnown: 95, multiplier: 1.3 }, { pKnown: 90, multiplier: 1.6 }, { pKnown: 80, multiplier: 2.1 }, { pKnown: 50, multiplier: 3.3 }, { pKnown: 0, multiplier: 4.0 }, ] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', formatter: (params: Array<{ value: [number, number] }>) => { const [pKnown, multiplier] = params[0]?.value || [0, 0] return `P(known): ${pKnown}%<br/>Multiplier: ${multiplier}×` }, }, grid: { left: '3%', right: '4%', bottom: '10%', top: '10%', containLabel: true, }, xAxis: { type: 'value', name: 'P(known) %', nameLocation: 'middle', nameGap: 30, min: 0, max: 100, axisLabel: { color: '#9ca3af', formatter: '{value}%' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { show: false }, }, yAxis: { type: 'value', name: 'Cost Multiplier', nameLocation: 'middle', nameGap: 40, min: 0, max: 5, axisLabel: { color: '#9ca3af', formatter: '{value}×' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Multiplier Curve', type: 'line', data: dataPoints, smooth: true, symbol: 'none', lineStyle: { color: '#8b5cf6', width: 3, }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(139, 92, 246, 0.3)' }, { offset: 1, color: 'rgba(139, 92, 246, 0.05)' }, ], }, }, }, { name: 'Reference Points', type: 'scatter', data: referencePoints.map((p) => [p.pKnown, p.multiplier]), symbol: 'circle', symbolSize: 10, itemStyle: { color: '#8b5cf6', borderColor: '#fff', borderWidth: 2 }, label: { show: true, position: 'right', formatter: (params: { value: [number, number] }) => `${params.value[1]}×`, color: '#9ca3af', fontSize: 11, }, }, ], } return ( <div data-component="automaticity-multiplier-chart" className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Non-Linear Cost Multiplier Curve </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > The squared mapping provides better differentiation at high mastery levels. A skill at 50% P(known) costs 3.3× more than a fully automated skill. </p> <ReactECharts option={option} style={{ height: '300px' }} /> </div> ) } /** * Combined Validation Results with Tabbed Interface * Shows mastery progression, convergence comparison, and data table */ export function ValidationResultsCharts() { const [trajectoryData, setTrajectoryData] = useState<TrajectoryData | null>(null) useEffect(() => { fetch('/data/ab-mastery-trajectories.json') .then((res) => res.json()) .then((data) => setTrajectoryData(data)) .catch((err) => console.error('Failed to load trajectory data:', err)) }, []) // Use data from JSON if available, otherwise fallback to hardcoded values const summaryStats = trajectoryData?.summary ?? { adaptiveWins50: 4, classicWins50: 0, adaptiveWins80: 6, classicWins80: 0, } return ( <div data-component="validation-results-charts" className={css({ my: '2rem' })}> {/* Summary Cards */} <div className={summaryCardStyles}> <div className={statCardStyles}> <div className={statValueStyles}> {summaryStats.adaptiveWins50}-{summaryStats.classicWins50} </div> <div className={statLabelStyles}>Adaptive wins to 50% mastery</div> </div> <div className={statCardStyles}> <div className={statValueStyles}> {summaryStats.adaptiveWins80}-{summaryStats.classicWins80} </div> <div className={statLabelStyles}>Adaptive wins to 80% mastery</div> </div> <div className={statCardStyles}> <div className={statValueStyles}>25-100%</div> <div className={statLabelStyles}>Faster mastery with adaptive</div> </div> </div> {/* Tabbed Charts */} <Tabs.Root defaultValue="multi-skill" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="multi-skill" className={tabTriggerStyles}> All Skills </Tabs.Trigger> <Tabs.Trigger value="trajectory" className={tabTriggerStyles}> Single Skill </Tabs.Trigger> <Tabs.Trigger value="convergence" className={tabTriggerStyles}> Convergence </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="multi-skill" className={tabContentStyles}> <MultiSkillTrajectoryChart data={trajectoryData} /> </Tabs.Content> <Tabs.Content value="trajectory" className={tabContentStyles}> <InteractiveTrajectoryChart data={trajectoryData} /> </Tabs.Content> <Tabs.Content value="convergence" className={tabContentStyles}> <ConvergenceChart data={trajectoryData} /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <ValidationDataTable data={trajectoryData} /> </Tabs.Content> </Tabs.Root> </div> ) } /** Get skill difficulty tier for line thickness */ function getSkillTier(skillId: string): 'basic' | 'fiveComp' | 'tenComp' | 'cascading' { if (skillId.includes('cascading') || skillId.includes('advanced')) { return 'cascading' } if (skillId.startsWith('tenComplements') || skillId.startsWith('tenComplementsSub')) { return 'tenComp' } if (skillId.startsWith('fiveComplements') || skillId.startsWith('fiveComplementsSub')) { return 'fiveComp' } return 'basic' } /** Get line width based on skill tier */ function getLineWidth(tier: 'basic' | 'fiveComp' | 'tenComp' | 'cascading'): number { switch (tier) { case 'basic': return 1 case 'fiveComp': return 1.5 case 'tenComp': return 2 case 'cascading': return 2.5 } } /** Get pedagogical order for color spectrum (0 = easiest, 1 = hardest) */ function getPedagogicalOrder(skillId: string): number { // Order based on typical learning progression if (skillId.includes('basic')) return 0 if (skillId.includes('fiveComplements.4')) return 0.15 if (skillId.includes('fiveComplements.3')) return 0.2 if (skillId.includes('fiveComplements.2')) return 0.25 if (skillId.includes('fiveComplements.1')) return 0.3 if (skillId.includes('fiveComplementsSub.-4')) return 0.35 if (skillId.includes('fiveComplementsSub.-3')) return 0.4 if (skillId.includes('fiveComplementsSub.-2')) return 0.45 if (skillId.includes('fiveComplementsSub.-1')) return 0.5 if (skillId.includes('tenComplements.9')) return 0.55 if (skillId.includes('tenComplements.8')) return 0.6 if (skillId.includes('tenComplements.7')) return 0.65 if (skillId.includes('tenComplements.6')) return 0.7 if (skillId.includes('tenComplements.5')) return 0.72 if (skillId.includes('tenComplements.4')) return 0.74 if (skillId.includes('tenComplements.3')) return 0.76 if (skillId.includes('tenComplements.2')) return 0.78 if (skillId.includes('tenComplements.1')) return 0.8 if (skillId.includes('tenComplementsSub.-9')) return 0.82 if (skillId.includes('tenComplementsSub.-5')) return 0.88 if (skillId.includes('tenComplementsSub.-1')) return 0.95 if (skillId.includes('cascading')) return 1.0 return 0.5 } /** Interpolate color along a spectrum */ function interpolateColor(t: number, colors: Array<{ r: number; g: number; b: number }>): string { const idx = t * (colors.length - 1) const lower = Math.floor(idx) const upper = Math.min(lower + 1, colors.length - 1) const blend = idx - lower const r = Math.round(colors[lower].r + (colors[upper].r - colors[lower].r) * blend) const g = Math.round(colors[lower].g + (colors[upper].g - colors[lower].g) * blend) const b = Math.round(colors[lower].b + (colors[upper].b - colors[lower].b) * blend) return `rgb(${r}, ${g}, ${b})` } // Color spectrums for each mode const ADAPTIVE_SPECTRUM = [ { r: 187, g: 247, b: 208 }, // light green { r: 74, g: 222, b: 128 }, // green { r: 22, g: 163, b: 74 }, // darker green ] const CLASSIC_SPECTRUM = [ { r: 209, g: 213, b: 219 }, // light gray { r: 156, g: 163, b: 175 }, // gray { r: 75, g: 85, b: 99 }, // dark gray ] /** Average mastery trajectory chart comparing adaptive vs classic */ function MultiSkillTrajectoryChart({ data }: { data: TrajectoryData | null }) { if (!data) { return ( <div className={chartContainerStyles}> <p className={css({ color: 'text.muted', textAlign: 'center', py: '2rem', })} > Loading trajectory data... </p> </div> ) } // Add session 0 to show initial mastery state const sessions = [0, ...data.sessions] const numSkills = data.skills.length // Calculate average mastery across all skills for each session (including session 0) const adaptiveAvg = sessions.map((_, sessionIdx) => { if (sessionIdx === 0) { // Session 0: use initial estimate (30% of first session value) const sum = data.skills.reduce((acc, skill) => acc + skill.adaptive.data[0] * 0.3, 0) return Math.round(sum / numSkills) } const sum = data.skills.reduce((acc, skill) => acc + skill.adaptive.data[sessionIdx - 1], 0) return Math.round(sum / numSkills) }) const classicAvg = sessions.map((_, sessionIdx) => { if (sessionIdx === 0) { // Session 0: use initial estimate (30% of first session value) const sum = data.skills.reduce((acc, skill) => acc + skill.classic.data[0] * 0.3, 0) return Math.round(sum / numSkills) } const sum = data.skills.reduce((acc, skill) => acc + skill.classic.data[sessionIdx - 1], 0) return Math.round(sum / numSkills) }) // Build ghost lines for individual skills const ghostSeries: Array<{ name: string type: 'line' data: number[] smooth: boolean symbol: string symbolSize: number lineStyle: { color: string; width: number; opacity: number } itemStyle: { color: string; opacity: number } emphasis: { disabled: boolean } z: number }> = [] // Sort skills by pedagogical order for consistent layering const sortedSkills = [...data.skills].sort( (a, b) => getPedagogicalOrder(a.id) - getPedagogicalOrder(b.id) ) for (const skill of sortedSkills) { const order = getPedagogicalOrder(skill.id) const tier = getSkillTier(skill.id) const width = getLineWidth(tier) const adaptiveColor = interpolateColor(order, ADAPTIVE_SPECTRUM) const classicColor = interpolateColor(order, CLASSIC_SPECTRUM) // Prepend session 0 data (initial estimate) const adaptiveWithZero = [skill.adaptive.data[0] * 0.3, ...skill.adaptive.data] const classicWithZero = [skill.classic.data[0] * 0.3, ...skill.classic.data] // Adaptive ghost line ghostSeries.push({ name: `${skill.label} (A)`, type: 'line', data: adaptiveWithZero, smooth: true, symbol: 'none', symbolSize: 0, lineStyle: { color: adaptiveColor, width, opacity: 0.4 }, itemStyle: { color: adaptiveColor, opacity: 0.4 }, emphasis: { disabled: true }, z: 1, }) // Classic ghost line ghostSeries.push({ name: `${skill.label} (C)`, type: 'line', data: classicWithZero, smooth: true, symbol: 'none', symbolSize: 0, lineStyle: { color: classicColor, width, opacity: 0.4 }, itemStyle: { color: classicColor, opacity: 0.4 }, emphasis: { disabled: true }, z: 1, }) } const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', formatter: (params: Array<{ seriesName: string; value: number; marker: string }>) => { const session = (params[0] as unknown as { axisValue: number })?.axisValue // Only show averages in tooltip (not ghost lines) const adaptiveParam = params.find((p) => p.seriesName === 'Adaptive (avg)') const classicParam = params.find((p) => p.seriesName === 'Classic (avg)') if (!adaptiveParam || !classicParam) return '' const diff = adaptiveParam.value - classicParam.value const diffStr = diff > 0 ? `<span style="color:#22c55e">+${diff}pp</span>` : diff < 0 ? `<span style="color:#ef4444">${diff}pp</span>` : '0pp' return `<strong>Session ${session}</strong><br/> ${adaptiveParam.marker} Adaptive: ${adaptiveParam.value}%<br/> ${classicParam.marker} Classic: ${classicParam.value}%<br/> Advantage: ${diffStr}` }, }, legend: { data: [ { name: 'Adaptive (avg)', itemStyle: { color: '#22c55e' } }, { name: 'Classic (avg)', itemStyle: { color: '#6b7280' } }, ], bottom: 0, textStyle: { color: '#9ca3af', fontSize: 12 }, }, grid: { left: '3%', right: '4%', bottom: '12%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: sessions, name: 'Session', nameLocation: 'middle', nameGap: 30, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Mastery %', nameLocation: 'middle', nameGap: 45, min: 0, max: 100, axisLabel: { color: '#9ca3af', formatter: '{value}%' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ // Ghost lines first (lower z-index) ...ghostSeries, // Average lines on top (higher z-index, full opacity, thicker) { name: 'Adaptive (avg)', type: 'line', data: adaptiveAvg, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#22c55e', width: 4 }, itemStyle: { color: '#22c55e' }, z: 10, markLine: { silent: true, lineStyle: { color: '#374151', type: 'dashed' }, data: [ { yAxis: 50, label: { formatter: '50%', color: '#9ca3af' } }, { yAxis: 80, label: { formatter: '80%', color: '#9ca3af' } }, ], }, }, { name: 'Classic (avg)', type: 'line', data: classicAvg, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#6b7280', width: 4 }, itemStyle: { color: '#6b7280' }, z: 10, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Mastery Progression: Adaptive vs Classic </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Bold lines show average across {numSkills} skills. Ghost lines show individual skills (greens = adaptive, grays = classic). Thicker lines = harder skills (ten-complements). Darker shades = later in pedagogical sequence. </p> <ReactECharts option={option} style={{ height: '400px' }} /> </div> ) } /** Category types for average toggles */ type SkillCategory = 'basic' | 'fiveComp' | 'tenComp' | 'cascading' /** Get category from skill ID */ function getSkillCategory(skillId: string): SkillCategory { if (skillId.includes('cascading') || skillId.includes('advanced')) { return 'cascading' } if (skillId.startsWith('tenComplements') || skillId.startsWith('tenComplementsSub')) { return 'tenComp' } if (skillId.startsWith('fiveComplements') || skillId.startsWith('fiveComplementsSub')) { return 'fiveComp' } return 'basic' } /** Category display names */ const CATEGORY_LABELS: Record<SkillCategory, string> = { basic: 'Basic', fiveComp: 'Friends of 5', tenComp: 'Friends of 10', cascading: 'Regrouping', } /** Category colors */ const CATEGORY_COLORS: Record<SkillCategory, { adaptive: string; classic: string }> = { basic: { adaptive: '#86efac', classic: '#d1d5db' }, fiveComp: { adaptive: '#4ade80', classic: '#9ca3af' }, tenComp: { adaptive: '#22c55e', classic: '#6b7280' }, cascading: { adaptive: '#16a34a', classic: '#4b5563' }, } const categoryToggleStyles = css({ px: '0.5rem', py: '0.25rem', fontSize: '0.7rem', fontWeight: 500, color: 'text.muted', bg: 'bg.surface', border: '1px solid', borderColor: 'border.muted', borderRadius: '0.25rem', cursor: 'pointer', transition: 'all 0.2s', _hover: { bg: 'accent.subtle', borderColor: 'accent.default', }, '&[data-active="true"]': { bg: 'accent.muted', color: 'accent.emphasis', borderColor: 'accent.default', }, }) /** Interactive single-skill trajectory chart with skill selector and category averages */ function InteractiveTrajectoryChart({ data }: { data: TrajectoryData | null }) { const [selectedSkillIndex, setSelectedSkillIndex] = useState(0) const [showCategoryAverages, setShowCategoryAverages] = useState<Set<SkillCategory>>(new Set()) if (!data) { return ( <div className={chartContainerStyles}> <p className={css({ color: 'text.muted', textAlign: 'center', py: '2rem', })} > Loading trajectory data... </p> </div> ) } const selectedSkill = data.skills[selectedSkillIndex] // Add session 0 to show initial mastery state const sessions = [0, ...data.sessions] // Get line width based on selected skill's tier const selectedTier = getSkillTier(selectedSkill.id) const selectedLineWidth = getLineWidth(selectedTier) // Prepend initial mastery (assume low starting point for weak skills) const adaptiveData = [selectedSkill.adaptive.data[0] * 0.3, ...selectedSkill.adaptive.data] const classicData = [selectedSkill.classic.data[0] * 0.3, ...selectedSkill.classic.data] // Calculate category averages const categoryAverages: Record<SkillCategory, { adaptive: number[]; classic: number[] }> = { basic: { adaptive: [], classic: [] }, fiveComp: { adaptive: [], classic: [] }, tenComp: { adaptive: [], classic: [] }, cascading: { adaptive: [], classic: [] }, } // Group skills by category const skillsByCategory: Record<SkillCategory, TrajectorySkillData[]> = { basic: [], fiveComp: [], tenComp: [], cascading: [], } for (const skill of data.skills) { const cat = getSkillCategory(skill.id) skillsByCategory[cat].push(skill) } // Calculate averages for each category for (const cat of ['basic', 'fiveComp', 'tenComp', 'cascading'] as SkillCategory[]) { const skills = skillsByCategory[cat] if (skills.length === 0) continue for (let i = 0; i < sessions.length; i++) { if (i === 0) { // Session 0: use initial estimate const adaptiveSum = skills.reduce((acc, s) => acc + s.adaptive.data[0] * 0.3, 0) const classicSum = skills.reduce((acc, s) => acc + s.classic.data[0] * 0.3, 0) categoryAverages[cat].adaptive.push(Math.round(adaptiveSum / skills.length)) categoryAverages[cat].classic.push(Math.round(classicSum / skills.length)) } else { const adaptiveSum = skills.reduce((acc, s) => acc + s.adaptive.data[i - 1], 0) const classicSum = skills.reduce((acc, s) => acc + s.classic.data[i - 1], 0) categoryAverages[cat].adaptive.push(Math.round(adaptiveSum / skills.length)) categoryAverages[cat].classic.push(Math.round(classicSum / skills.length)) } } } // Build series const series: Array<{ name: string type: 'line' data: number[] smooth: boolean symbol: string symbolSize: number lineStyle: { color: string width: number type?: string opacity?: number } itemStyle: { color: string; opacity?: number } z?: number markLine?: unknown }> = [] // Add category averages first (as ghost lines behind main skill) for (const cat of ['basic', 'fiveComp', 'tenComp', 'cascading'] as SkillCategory[]) { if (!showCategoryAverages.has(cat)) continue if (skillsByCategory[cat].length === 0) continue const catLineWidth = getLineWidth(cat) const colors = CATEGORY_COLORS[cat] series.push({ name: `${CATEGORY_LABELS[cat]} Avg (A)`, type: 'line', data: categoryAverages[cat].adaptive, smooth: true, symbol: 'none', symbolSize: 0, lineStyle: { color: colors.adaptive, width: catLineWidth, opacity: 0.5 }, itemStyle: { color: colors.adaptive, opacity: 0.5 }, z: 1, }) series.push({ name: `${CATEGORY_LABELS[cat]} Avg (C)`, type: 'line', data: categoryAverages[cat].classic, smooth: true, symbol: 'none', symbolSize: 0, lineStyle: { color: colors.classic, width: catLineWidth, type: 'dashed', opacity: 0.5, }, itemStyle: { color: colors.classic, opacity: 0.5 }, z: 1, }) } // Add main skill lines on top series.push({ name: 'Adaptive', type: 'line', data: adaptiveData, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#22c55e', width: Math.max(selectedLineWidth * 1.5, 3), }, itemStyle: { color: '#22c55e' }, z: 10, markLine: { silent: true, lineStyle: { color: '#374151', type: 'dashed' }, data: [ { yAxis: 50, label: { formatter: '50%', color: '#9ca3af' } }, { yAxis: 80, label: { formatter: '80%', color: '#9ca3af' } }, ], }, }) series.push({ name: 'Classic', type: 'line', data: classicData, smooth: true, symbol: 'circle', symbolSize: 8, lineStyle: { color: '#6b7280', width: Math.max(selectedLineWidth * 1.5, 3), }, itemStyle: { color: '#6b7280' }, z: 10, }) // Build legend data const legendData: Array<{ name: string; itemStyle: { color: string } }> = [ { name: 'Adaptive', itemStyle: { color: '#22c55e' } }, { name: 'Classic', itemStyle: { color: '#6b7280' } }, ] for (const cat of ['basic', 'fiveComp', 'tenComp', 'cascading'] as SkillCategory[]) { if (showCategoryAverages.has(cat) && skillsByCategory[cat].length > 0) { legendData.push({ name: `${CATEGORY_LABELS[cat]} Avg (A)`, itemStyle: { color: CATEGORY_COLORS[cat].adaptive }, }) } } const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', formatter: (params: Array<{ seriesName: string; value: number; axisValue: number }>) => { const session = params[0]?.axisValue let html = `<strong>Session ${session}</strong><br/>` for (const p of params) { if (p.seriesName.includes('(C)')) continue // Skip classic avg in tooltip to reduce clutter const color = p.seriesName.includes('Adaptive') || p.seriesName.includes('(A)') ? '#22c55e' : '#6b7280' const label = p.seriesName.replace(' (A)', '') html += `<span style="color:${color}">${label}</span>: ${p.value}%<br/>` } return html }, }, legend: { data: legendData, bottom: 0, textStyle: { color: '#9ca3af', fontSize: 11 }, }, grid: { left: '3%', right: '4%', bottom: '15%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: sessions, name: 'Session', nameLocation: 'middle', nameGap: 30, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Mastery %', nameLocation: 'middle', nameGap: 40, min: 0, max: 100, axisLabel: { color: '#9ca3af', formatter: '{value}%' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series, } // Calculate advantage for selected skill const adaptiveTo80 = selectedSkill.adaptive.sessionsTo80 const classicTo80 = selectedSkill.classic.sessionsTo80 let advantageText = '' if (adaptiveTo80 !== null && classicTo80 !== null) { const diff = classicTo80 - adaptiveTo80 advantageText = diff > 0 ? `Adaptive ${diff} sessions faster` : 'Same speed' } else if (adaptiveTo80 !== null && classicTo80 === null) { advantageText = 'Classic never reached 80%' } // Toggle category average const toggleCategory = (cat: SkillCategory) => { const newSet = new Set(showCategoryAverages) if (newSet.has(cat)) { newSet.delete(cat) } else { newSet.add(cat) } setShowCategoryAverages(newSet) } // Get available categories (those with skills in the data) const availableCategories = ( ['basic', 'fiveComp', 'tenComp', 'cascading'] as SkillCategory[] ).filter((cat) => skillsByCategory[cat].length > 0) return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Mastery Progression: {selectedSkill.label} </h4> {/* Skill selector */} <div className={css({ display: 'flex', gap: '0.5rem', flexWrap: 'wrap', mb: '0.75rem', })} > {data.skills.map((skill, index) => { const tier = getSkillTier(skill.id) const width = getLineWidth(tier) return ( <button type="button" key={skill.id} className={skillButtonStyles} data-selected={index === selectedSkillIndex} onClick={() => setSelectedSkillIndex(index)} style={{ borderColor: skill.color, borderWidth: `${width}px`, }} > {skill.label} </button> ) })} </div> {/* Category average toggles */} {availableCategories.length > 0 && ( <div className={css({ display: 'flex', gap: '0.5rem', flexWrap: 'wrap', mb: '0.75rem', alignItems: 'center', })} > <span className={css({ fontSize: '0.75rem', color: 'text.muted' })}>Show averages:</span> {availableCategories.map((cat) => ( <button type="button" key={cat} className={categoryToggleStyles} data-active={showCategoryAverages.has(cat)} onClick={() => toggleCategory(cat)} style={{ borderWidth: `${getLineWidth(cat)}px`, borderColor: showCategoryAverages.has(cat) ? CATEGORY_COLORS[cat].adaptive : undefined, }} > {CATEGORY_LABELS[cat]} </button> ))} </div> )} <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > <strong>Adaptive:</strong> 80% by session {adaptiveTo80 ?? 'never'} |{' '} <strong>Classic:</strong> 80% by session {classicTo80 ?? 'never'} {advantageText && ( <span className={css({ color: 'green.400', ml: '0.5rem' })}>({advantageText})</span> )} </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** Internal: Convergence bar chart for tabs - updated to use data prop */ function ConvergenceChart({ data }: { data: TrajectoryData | null }) { // Build data from trajectoryData if available, otherwise use fallback const skills = data?.skills.map((s) => s.label.replace(': ', '\n')) ?? [ 'fiveComp\n3=5-2', 'fiveCompSub\n-3=-5+2', 'tenComp\n9=10-1', 'tenComp\n5=10-5', 'tenCompSub\n-9=+1-10', ] const adaptiveTo80 = data?.skills.map((s) => s.adaptive.sessionsTo80) ?? [6, 6, 5, 10, 7] const classicTo80 = data?.skills.map((s) => s.classic.sessionsTo80) ?? [9, 8, 6, null, 12] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, formatter: ( params: Array<{ seriesName: string value: number | null name: string }> ) => { const skill = params[0]?.name.replace('\n', ' ') let html = `<strong>${skill}</strong><br/>` for (const p of params) { const value = p.value === null ? 'Never (>12 sessions)' : `${p.value} sessions` html += `${p.seriesName}: ${value}<br/>` } return html }, }, legend: { data: [ { name: 'Adaptive', itemStyle: { color: '#22c55e' } }, { name: 'Classic', itemStyle: { color: '#6b7280' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '15%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: skills, axisLabel: { color: '#9ca3af', interval: 0, fontSize: 10 }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Sessions to 80%', nameLocation: 'middle', nameGap: 40, min: 0, max: 14, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Adaptive', type: 'bar', data: adaptiveTo80.map((v) => ({ value: v, itemStyle: { color: '#22c55e' }, })), barWidth: '35%', itemStyle: { color: '#22c55e' }, label: { show: true, position: 'top', formatter: (params: { value: number | null }) => params.value === null ? '—' : params.value, color: '#9ca3af', fontSize: 11, }, }, { name: 'Classic', type: 'bar', data: classicTo80.map((v) => ({ value: v, itemStyle: { color: '#6b7280' }, label: v === null ? { show: true, position: 'inside', formatter: 'Never', color: '#ef4444', } : undefined, })), barWidth: '35%', itemStyle: { color: '#6b7280' }, label: { show: true, position: 'top', formatter: (params: { value: number | null }) => params.value === null ? 'Never' : params.value, color: '#9ca3af', fontSize: 11, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Sessions to Reach 80% Mastery by Skill </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Adaptive mode consistently reaches mastery faster across all tested skills. "—" or "Never" indicates the mode did not reach 80% within 12 sessions. </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** Internal: Data table for validation results tabs - updated to use data prop */ function ValidationDataTable({ data }: { data: TrajectoryData | null }) { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'left', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', }, '& tr:hover td': { bg: 'accent.subtle', }, }) // Use comparison table from data if available const comparisonData = data?.comparisonTable ?? [ { skill: 'fiveComp 3=5-2', adaptiveTo80: 6, classicTo80: 9, advantage: 'Adaptive +3 sessions', }, ] return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > A/B Comparison Summary </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Sessions to reach 80% mastery for each skill, comparing adaptive vs classic modes. </p> <div className={css({ overflowX: 'auto' })}> <table className={tableStyles}> <thead> <tr> <th>Skill</th> <th>Adaptive → 80%</th> <th>Classic → 80%</th> <th>Advantage</th> </tr> </thead> <tbody> {comparisonData.map((row) => ( <tr key={row.skill}> <td className={css({ fontFamily: 'monospace', fontSize: '0.75rem', })} > {row.skill} </td> <td className={css({ color: 'green.400', fontWeight: 600 })}> {row.adaptiveTo80 ?? 'never'} </td> <td className={css({ color: 'text.muted' })}>{row.classicTo80 ?? 'never'}</td> <td className={css({ color: row.advantage?.includes('Adaptive') ? 'green.400' : 'text.muted', fontWeight: 500, })} > {row.advantage ?? '—'} </td> </tr> ))} </tbody> </table> </div> </div> ) } /** * 3-Way Comparison Charts with Tabbed Interface * Compares Classic, Adaptive (fluency), and Adaptive (full BKT) */ export function ThreeWayComparisonCharts() { return ( <div data-component="three-way-comparison-charts" className={css({ my: '2rem' })}> {/* Summary insight */} <div className={summaryCardStyles}> <div className={statCardStyles}> <div className={statValueStyles}>Same</div> <div className={statLabelStyles}>Learning rate: fluency vs BKT</div> </div> <div className={statCardStyles}> <div className={statValueStyles}>Simpler</div> <div className={statLabelStyles}>Using BKT for both concerns</div> </div> <div className={statCardStyles}> <div className={statValueStyles}>Targeting</div> <div className={statLabelStyles}>Where the benefit comes from</div> </div> </div> {/* Tabbed Charts */} <Tabs.Root defaultValue="comparison" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="comparison" className={tabTriggerStyles}> Mode Comparison </Tabs.Trigger> <Tabs.Trigger value="fatigue" className={tabTriggerStyles}> Cognitive Fatigue </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="comparison" className={tabContentStyles}> <ThreeWayComparisonChart /> </Tabs.Content> <Tabs.Content value="fatigue" className={tabContentStyles}> <FatigueComparisonChart /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <ThreeWayDataTable /> </Tabs.Content> </Tabs.Root> </div> ) } /** Internal: 3-way comparison bar chart */ function ThreeWayComparisonChart() { const skills = ['fiveComp\n3=5-2', 'fiveCompSub\n-3=-5+2'] // Sessions to reach thresholds const classicTo50 = [5, 4] const classicTo80 = [9, 8] const adaptiveFluencyTo50 = [3, 3] const adaptiveFluencyTo80 = [6, 6] const adaptiveBktTo50 = [3, 3] const adaptiveBktTo80 = [6, 6] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, }, legend: { data: [ { name: 'Classic', itemStyle: { color: '#6b7280' } }, { name: 'Adaptive (fluency)', itemStyle: { color: '#22c55e' } }, { name: 'Adaptive (BKT)', itemStyle: { color: '#3b82f6' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '18%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: skills, axisLabel: { color: '#9ca3af', interval: 0, fontSize: 11 }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Sessions to 80%', nameLocation: 'middle', nameGap: 40, min: 0, max: 12, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Classic', type: 'bar', data: classicTo80.map((v) => ({ value: v, itemStyle: { color: '#6b7280' }, })), label: { show: true, position: 'top', color: '#9ca3af', fontSize: 11 }, }, { name: 'Adaptive (fluency)', type: 'bar', data: adaptiveFluencyTo80.map((v) => ({ value: v, itemStyle: { color: '#22c55e' }, })), label: { show: true, position: 'top', color: '#9ca3af', fontSize: 11 }, }, { name: 'Adaptive (BKT)', type: 'bar', data: adaptiveBktTo80.map((v) => ({ value: v, itemStyle: { color: '#3b82f6' }, })), label: { show: true, position: 'top', color: '#9ca3af', fontSize: 11 }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Sessions to 80% Mastery: 3-Way Comparison </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Both adaptive modes perform identically—the benefit comes from BKT <em>targeting</em>, not from BKT-based cost calculation. </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** Internal: Fatigue comparison chart */ function FatigueComparisonChart() { const skills = ['fiveComp 3=5-2', 'fiveCompSub -3=-5+2'] const classicFatigue = [120.3, 131.9] const adaptiveFluencyFatigue = [122.8, 133.6] const adaptiveBktFatigue = [122.8, 133.0] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, formatter: (params: Array<{ seriesName: string; value: number; name: string }>) => { let html = `<strong>${params[0]?.name}</strong><br/>` for (const p of params) { html += `${p.seriesName}: ${p.value.toFixed(1)}<br/>` } return html }, }, legend: { data: [ { name: 'Classic', itemStyle: { color: '#6b7280' } }, { name: 'Adaptive (fluency)', itemStyle: { color: '#22c55e' } }, { name: 'Adaptive (BKT)', itemStyle: { color: '#3b82f6' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '18%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: skills, axisLabel: { color: '#9ca3af', interval: 0, fontSize: 11 }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Fatigue/Session', nameLocation: 'middle', nameGap: 50, min: 100, max: 150, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Classic', type: 'bar', data: classicFatigue.map((v) => ({ value: v, itemStyle: { color: '#6b7280' }, })), label: { show: true, position: 'top', formatter: (p: { value: number }) => p.value.toFixed(1), color: '#9ca3af', fontSize: 10, }, }, { name: 'Adaptive (fluency)', type: 'bar', data: adaptiveFluencyFatigue.map((v) => ({ value: v, itemStyle: { color: '#22c55e' }, })), label: { show: true, position: 'top', formatter: (p: { value: number }) => p.value.toFixed(1), color: '#9ca3af', fontSize: 10, }, }, { name: 'Adaptive (BKT)', type: 'bar', data: adaptiveBktFatigue.map((v) => ({ value: v, itemStyle: { color: '#3b82f6' }, })), label: { show: true, position: 'top', formatter: (p: { value: number }) => p.value.toFixed(1), color: '#9ca3af', fontSize: 10, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Cognitive Fatigue Per Session </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > All modes have similar cognitive load. Adaptive modes are slightly higher because they include more challenging (weak skill) problems. </p> <ReactECharts option={option} style={{ height: '350px' }} /> </div> ) } /** Internal: 3-way comparison data table */ function ThreeWayDataTable() { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.5rem', py: '0.5rem', textAlign: 'center', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', fontSize: '0.75rem', }, '& td': { px: '0.5rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', textAlign: 'center', }, '& tr:hover td': { bg: 'accent.subtle', }, }) const data = [ { skill: 'fiveComplements.3=5-2', classicTo50: 5, classicTo80: 9, classicFatigue: 120.3, fluencyTo50: 3, fluencyTo80: 6, fluencyFatigue: 122.8, bktTo50: 3, bktTo80: 6, bktFatigue: 122.8, }, { skill: 'fiveCompSub.-3=-5+2', classicTo50: 4, classicTo80: 8, classicFatigue: 131.9, fluencyTo50: 3, fluencyTo80: 6, fluencyFatigue: 133.6, bktTo50: 3, bktTo80: 6, bktFatigue: 133.0, }, ] return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > 3-Way Comparison Data </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Sessions to reach mastery thresholds and cognitive fatigue per session. </p> <div className={css({ overflowX: 'auto' })}> <table className={tableStyles}> <thead> <tr> <th rowSpan={2}>Skill</th> <th colSpan={3} className={css({ bg: 'gray.700' })}> Classic </th> <th colSpan={3} className={css({ bg: 'green.900' })}> Adaptive (fluency) </th> <th colSpan={3} className={css({ bg: 'blue.900' })}> Adaptive (BKT) </th> </tr> <tr> <th>→50%</th> <th>→80%</th> <th>Fatigue</th> <th>→50%</th> <th>→80%</th> <th>Fatigue</th> <th>→50%</th> <th>→80%</th> <th>Fatigue</th> </tr> </thead> <tbody> {data.map((row) => ( <tr key={row.skill}> <td className={css({ textAlign: 'left', fontFamily: 'monospace', fontSize: '0.7rem', })} > {row.skill} </td> <td>{row.classicTo50}</td> <td>{row.classicTo80}</td> <td>{row.classicFatigue}</td> <td className={css({ color: 'green.400' })}>{row.fluencyTo50}</td> <td className={css({ color: 'green.400' })}>{row.fluencyTo80}</td> <td>{row.fluencyFatigue}</td> <td className={css({ color: 'blue.400' })}>{row.bktTo50}</td> <td className={css({ color: 'blue.400' })}>{row.bktTo80}</td> <td>{row.bktFatigue}</td> </tr> ))} </tbody> </table> </div> </div> ) } /** * Evidence Quality Charts with Tabbed Interface * Shows Help Level weights and Response Time weights */ export function EvidenceQualityCharts() { return ( <div data-component="evidence-quality-charts" className={css({ my: '2rem' })}> <Tabs.Root defaultValue="help" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="help" className={tabTriggerStyles}> Help Level Weights </Tabs.Trigger> <Tabs.Trigger value="response" className={tabTriggerStyles}> Response Time Weights </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="help" className={tabContentStyles}> <HelpLevelChart /> </Tabs.Content> <Tabs.Content value="response" className={tabContentStyles}> <ResponseTimeChart /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <EvidenceQualityTable /> </Tabs.Content> </Tabs.Root> </div> ) } function HelpLevelChart() { const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, }, grid: { left: '12%', right: '4%', bottom: '10%', top: '15%', containLabel: false, }, xAxis: { type: 'category', data: ['No help', 'Minor hint', 'Significant help', 'Full solution'], axisLabel: { color: '#9ca3af', fontSize: 11 }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Evidence Weight', nameLocation: 'middle', nameGap: 50, min: 0, max: 1.2, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { type: 'bar', data: [ { value: 1.0, itemStyle: { color: '#22c55e' } }, { value: 0.8, itemStyle: { color: '#84cc16' } }, { value: 0.5, itemStyle: { color: '#eab308' } }, { value: 0.5, itemStyle: { color: '#f97316' } }, ], barWidth: '50%', label: { show: true, position: 'top', formatter: (p: { value: number }) => `${p.value}×`, color: '#9ca3af', }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Evidence Weight by Help Level </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Using hints or scaffolding reduces evidence strength. A correct answer with full solution shown provides only 50% of the evidence weight. </p> <ReactECharts option={option} style={{ height: '280px' }} /> </div> ) } function ResponseTimeChart() { const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, }, legend: { data: [ { name: 'Correct', itemStyle: { color: '#22c55e' } }, { name: 'Incorrect', itemStyle: { color: '#ef4444' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '12%', right: '4%', bottom: '15%', top: '10%', containLabel: false, }, xAxis: { type: 'category', data: ['Very fast', 'Normal', 'Slow'], axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Evidence Weight', nameLocation: 'middle', nameGap: 50, min: 0, max: 1.4, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Correct', type: 'bar', data: [1.2, 1.0, 0.8], itemStyle: { color: '#22c55e' }, label: { show: true, position: 'top', formatter: (p: { value: number }) => `${p.value}×`, color: '#9ca3af', fontSize: 11, }, }, { name: 'Incorrect', type: 'bar', data: [0.5, 1.0, 1.2], itemStyle: { color: '#ef4444' }, label: { show: true, position: 'top', formatter: (p: { value: number }) => `${p.value}×`, color: '#9ca3af', fontSize: 11, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Evidence Weight by Response Time </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Fast correct answers suggest automaticity (1.2×). Slow incorrect answers suggest genuine confusion (1.2×). Very fast incorrect answers are likely careless slips (0.5×). </p> <ReactECharts option={option} style={{ height: '300px' }} /> </div> ) } function EvidenceQualityTable() { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'left', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', }, '& tr:hover td': { bg: 'accent.subtle' }, }) return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '1rem', color: 'text.primary', })} > Evidence Quality Data </h4> <div className={css({ display: 'flex', flexDirection: 'column', gap: '1.5rem', })} > <div> <h5 className={css({ fontSize: '0.875rem', fontWeight: 600, mb: '0.5rem', color: 'text.secondary', })} > Help Level Weights </h5> <table className={tableStyles}> <thead> <tr> <th>Help Level</th> <th>Weight</th> <th>Interpretation</th> </tr> </thead> <tbody> <tr> <td>0 (none)</td> <td>1.0</td> <td>Full evidence</td> </tr> <tr> <td>1 (minor hint)</td> <td>0.8</td> <td>Slight reduction</td> </tr> <tr> <td>2 (significant help)</td> <td>0.5</td> <td>Halved evidence</td> </tr> <tr> <td>3 (full solution)</td> <td>0.5</td> <td>Halved evidence</td> </tr> </tbody> </table> </div> <div> <h5 className={css({ fontSize: '0.875rem', fontWeight: 600, mb: '0.5rem', color: 'text.secondary', })} > Response Time Weights </h5> <table className={tableStyles}> <thead> <tr> <th>Condition</th> <th>Weight</th> <th>Interpretation</th> </tr> </thead> <tbody> <tr> <td>Very fast correct</td> <td>1.2</td> <td>Strong automaticity signal</td> </tr> <tr> <td>Normal correct</td> <td>1.0</td> <td>Standard evidence</td> </tr> <tr> <td>Slow correct</td> <td>0.8</td> <td>Might have struggled</td> </tr> <tr> <td>Very fast incorrect</td> <td>0.5</td> <td>Careless slip</td> </tr> <tr> <td>Slow incorrect</td> <td>1.2</td> <td>Genuine confusion</td> </tr> </tbody> </table> </div> </div> </div> ) } /** * Automaticity Multiplier Charts with Tabbed Interface * Shows the non-linear curve and data table */ export function AutomaticityMultiplierCharts() { return ( <div data-component="automaticity-multiplier-charts" className={css({ my: '2rem' })}> <Tabs.Root defaultValue="curve" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="curve" className={tabTriggerStyles}> Multiplier Curve </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="curve" className={tabContentStyles}> <MultiplierCurveChart /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <MultiplierDataTable /> </Tabs.Content> </Tabs.Root> </div> ) } function MultiplierCurveChart() { const dataPoints: Array<[number, number]> = [] for (let p = 0; p <= 1; p += 0.02) { const multiplier = 4 - 3 * p * p dataPoints.push([Math.round(p * 100), Number(multiplier.toFixed(2))]) } const referencePoints = [ { pKnown: 100, multiplier: 1.0 }, { pKnown: 95, multiplier: 1.3 }, { pKnown: 90, multiplier: 1.6 }, { pKnown: 80, multiplier: 2.1 }, { pKnown: 50, multiplier: 3.3 }, { pKnown: 0, multiplier: 4.0 }, ] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', formatter: (params: Array<{ value: [number, number] }>) => { const [pKnown, multiplier] = params[0]?.value || [0, 0] return `P(known): ${pKnown}%<br/>Multiplier: ${multiplier}×` }, }, grid: { left: '3%', right: '4%', bottom: '10%', top: '10%', containLabel: true, }, xAxis: { type: 'value', name: 'P(known) %', nameLocation: 'middle', nameGap: 30, min: 0, max: 100, axisLabel: { color: '#9ca3af', formatter: '{value}%' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { show: false }, }, yAxis: { type: 'value', name: 'Cost Multiplier', nameLocation: 'middle', nameGap: 40, min: 0, max: 5, axisLabel: { color: '#9ca3af', formatter: '{value}×' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Multiplier Curve', type: 'line', data: dataPoints, smooth: true, symbol: 'none', lineStyle: { color: '#8b5cf6', width: 3 }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(139, 92, 246, 0.3)' }, { offset: 1, color: 'rgba(139, 92, 246, 0.05)' }, ], }, }, }, { name: 'Reference Points', type: 'scatter', data: referencePoints.map((p) => [p.pKnown, p.multiplier]), symbol: 'circle', symbolSize: 10, itemStyle: { color: '#8b5cf6', borderColor: '#fff', borderWidth: 2 }, label: { show: true, position: 'right', formatter: (params: { value: [number, number] }) => `${params.value[1]}×`, color: '#9ca3af', fontSize: 11, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Non-Linear Cost Multiplier Curve </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > The squared mapping provides better differentiation at high mastery levels. A skill at 50% P(known) costs 3.3× more than a fully automated skill. </p> <ReactECharts option={option} style={{ height: '300px' }} /> </div> ) } function MultiplierDataTable() { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'left', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', }, '& tr:hover td': { bg: 'accent.subtle' }, }) const data = [ { pKnown: '100%', multiplier: '1.0×', meaning: 'Fully automated' }, { pKnown: '95%', multiplier: '1.3×', meaning: 'Nearly automated' }, { pKnown: '90%', multiplier: '1.6×', meaning: 'Solid' }, { pKnown: '80%', multiplier: '2.1×', meaning: 'Good but not automatic' }, { pKnown: '50%', multiplier: '3.3×', meaning: 'Halfway there' }, { pKnown: '0%', multiplier: '4.0×', meaning: 'Just starting' }, ] return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Automaticity Multiplier Data </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Reference points showing how P(known) maps to cost multiplier. </p> <table className={tableStyles}> <thead> <tr> <th>P(known)</th> <th>Multiplier</th> <th>Meaning</th> </tr> </thead> <tbody> {data.map((row) => ( <tr key={row.pKnown}> <td>{row.pKnown}</td> <td className={css({ color: 'purple.400', fontWeight: 500 })}>{row.multiplier}</td> <td>{row.meaning}</td> </tr> ))} </tbody> </table> </div> ) } /** * Staleness Indicators Chart with Tabbed Interface */ export function StalenessIndicatorsCharts() { return ( <div data-component="staleness-indicators-charts" className={css({ my: '2rem' })}> <Tabs.Root defaultValue="visual" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="visual" className={tabTriggerStyles}> Visual Timeline </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="visual" className={tabContentStyles}> <StalenessVisual /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <StalenessDataTable /> </Tabs.Content> </Tabs.Root> </div> ) } function StalenessVisual() { const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, }, grid: { left: '3%', right: '4%', bottom: '10%', top: '15%', containLabel: true, }, xAxis: { type: 'category', data: ['< 7 days', '7-14 days', '14-30 days', '> 30 days'], axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'Concern Level', nameLocation: 'middle', nameGap: 40, min: 0, max: 4, axisLabel: { color: '#9ca3af', formatter: (v: number) => ['', 'Low', 'Medium', 'High', 'Critical'][v] || '', }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { type: 'bar', data: [ { value: 0, itemStyle: { color: '#22c55e' } }, { value: 1, itemStyle: { color: '#84cc16' } }, { value: 2, itemStyle: { color: '#eab308' } }, { value: 3, itemStyle: { color: '#ef4444' } }, ], barWidth: '50%', label: { show: true, position: 'top', formatter: (p: { dataIndex: number }) => ['(none)', 'Not practiced\nrecently', 'Getting\nrusty', 'Very stale'][p.dataIndex], color: '#9ca3af', fontSize: 10, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Staleness Warning Levels </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Skills are flagged based on days since last practice. Staleness is shown as a separate indicator, not by decaying P(known). </p> <ReactECharts option={option} style={{ height: '300px' }} /> </div> ) } function StalenessDataTable() { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'left', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', }, '& tr:hover td': { bg: 'accent.subtle' }, }) return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Staleness Indicator Data </h4> <table className={tableStyles}> <thead> <tr> <th>Days Since Practice</th> <th>Warning</th> </tr> </thead> <tbody> <tr> <td>< 7</td> <td className={css({ color: 'green.400' })}>(none)</td> </tr> <tr> <td>7-14</td> <td className={css({ color: 'yellow.400' })}>"Not practiced recently"</td> </tr> <tr> <td>14-30</td> <td className={css({ color: 'orange.400' })}>"Getting rusty"</td> </tr> <tr> <td>> 30</td> <td className={css({ color: 'red.400' })}>"Very stale — may need review"</td> </tr> </tbody> </table> </div> ) } /** * Classification Chart with Tabbed Interface */ export function ClassificationCharts() { return ( <div data-component="classification-charts" className={css({ my: '2rem' })}> <Tabs.Root defaultValue="visual" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="visual" className={tabTriggerStyles}> Classification Zones </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="visual" className={tabContentStyles}> <ClassificationVisual /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <ClassificationDataTable /> </Tabs.Content> </Tabs.Root> </div> ) } function ClassificationVisual() { // Horizontal stacked bar showing P(known) zones from 0-100% const option = { backgroundColor: 'transparent', tooltip: { trigger: 'item', formatter: (p: { name: string; value: number; seriesName: string }) => { const descriptions: Record<string, string> = { Struggling: 'P(known) < 50%: Student has not yet internalized this pattern', Learning: 'P(known) 50-80%: Making progress but not yet automatic', Automated: 'P(known) ≥ 80%: Pattern is reliably automatic', } return `<strong>${p.seriesName}</strong><br/>${descriptions[p.seriesName] || ''}` }, }, grid: { left: '3%', right: '3%', bottom: '10%', top: '10%', containLabel: false, }, xAxis: { type: 'value', min: 0, max: 100, show: false, }, yAxis: { type: 'category', data: ['Classification'], show: false, }, series: [ { name: 'Struggling', type: 'bar', stack: 'total', data: [50], itemStyle: { color: '#ef4444' }, label: { show: true, position: 'inside', formatter: 'Struggling\n<50%', color: '#fff', fontWeight: 'bold', fontSize: 11, }, barWidth: 40, }, { name: 'Learning', type: 'bar', stack: 'total', data: [30], itemStyle: { color: '#eab308' }, label: { show: true, position: 'inside', formatter: 'Learning\n50-80%', color: '#000', fontWeight: 'bold', fontSize: 11, }, }, { name: 'Automated', type: 'bar', stack: 'total', data: [20], itemStyle: { color: '#22c55e' }, label: { show: true, position: 'inside', formatter: 'Automated\n≥80%', color: '#fff', fontWeight: 'bold', fontSize: 11, }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > P(known) Classification Zones </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Skills are classified into zones based on their P(known) value when confidence meets threshold. Low-confidence estimates default to "Learning" regardless of P(known). </p> <ReactECharts option={option} style={{ height: '100px' }} /> <p className={css({ fontSize: '0.75rem', color: 'text.muted', mt: '0.5rem', fontStyle: 'italic', })} > Note: Classification requires confidence ≥ threshold (default 50%). Skills with insufficient data are always classified as "Learning" until more evidence accumulates. </p> </div> ) } function ClassificationDataTable() { const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'left', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', }, '& tr:hover td': { bg: 'accent.subtle' }, }) return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Classification Criteria </h4> <table className={tableStyles}> <thead> <tr> <th>Classification</th> <th>Criteria</th> </tr> </thead> <tbody> <tr> <td className={css({ color: 'green.400', fontWeight: 600 })}>Automated</td> <td>P(known) ≥ 80% AND confidence ≥ threshold</td> </tr> <tr> <td className={css({ color: 'red.400', fontWeight: 600 })}>Struggling</td> <td>P(known) < 50% AND confidence ≥ threshold</td> </tr> <tr> <td className={css({ color: 'yellow.400', fontWeight: 600 })}>Learning</td> <td>Everything else (including low-confidence estimates)</td> </tr> </tbody> </table> </div> ) } /** * Blame Attribution Comparison Charts * Compares heuristic vs true Bayesian blame attribution across multiple seeds */ export function BlameAttributionCharts() { return ( <div data-component="blame-attribution-charts" className={css({ my: '2rem' })}> {/* Summary insight */} <div className={summaryCardStyles}> <div className={statCardStyles}> <div className={statValueStyles}>p > 0.05</div> <div className={statLabelStyles}>No significant difference</div> </div> <div className={statCardStyles}> <div className={statValueStyles}>3/5</div> <div className={statLabelStyles}>Heuristic wins</div> </div> <div className={statCardStyles}> <div className={statValueStyles}>t = -0.41</div> <div className={statLabelStyles}>t-statistic (5 seeds)</div> </div> </div> {/* Tabbed Charts */} <Tabs.Root defaultValue="comparison" className={tabStyles}> <Tabs.List className={tabListStyles}> <Tabs.Trigger value="comparison" className={tabTriggerStyles}> Seed Comparison </Tabs.Trigger> <Tabs.Trigger value="table" className={tabTriggerStyles}> Data Table </Tabs.Trigger> </Tabs.List> <Tabs.Content value="comparison" className={tabContentStyles}> <BlameComparisonChart /> </Tabs.Content> <Tabs.Content value="table" className={tabContentStyles}> <BlameDataTable /> </Tabs.Content> </Tabs.Root> </div> ) } /** Internal: Bar chart comparing heuristic vs bayesian across seeds */ function BlameComparisonChart() { const seeds = ['Seed 1', 'Seed 2', 'Seed 3', 'Seed 4', 'Seed 5'] const heuristicCorr = [0.245, 0.751, 0.636, 0.166, 0.172] const bayesianCorr = [0.401, 0.627, 0.254, 0.345, 0.154] const option = { backgroundColor: 'transparent', tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, formatter: (params: Array<{ seriesName: string; value: number; name: string }>) => { let html = `<strong>${params[0]?.name}</strong><br/>` for (const p of params) { html += `${p.seriesName}: ${p.value.toFixed(3)}<br/>` } const heur = params.find((p) => p.seriesName === 'Heuristic')?.value ?? 0 const baye = params.find((p) => p.seriesName === 'Bayesian')?.value ?? 0 const winner = heur > baye ? 'Heuristic' : baye > heur ? 'Bayesian' : 'Tie' html += `<em>Winner: ${winner}</em>` return html }, }, legend: { data: [ { name: 'Heuristic', itemStyle: { color: '#22c55e' } }, { name: 'Bayesian', itemStyle: { color: '#3b82f6' } }, ], bottom: 0, textStyle: { color: '#9ca3af' }, }, grid: { left: '3%', right: '4%', bottom: '15%', top: '10%', containLabel: true, }, xAxis: { type: 'category', data: seeds, axisLabel: { color: '#9ca3af', interval: 0, fontSize: 11 }, axisLine: { lineStyle: { color: '#374151' } }, }, yAxis: { type: 'value', name: 'BKT-Truth Correlation', nameLocation: 'middle', nameGap: 50, min: 0, max: 1, axisLabel: { color: '#9ca3af' }, axisLine: { lineStyle: { color: '#374151' } }, splitLine: { lineStyle: { color: '#374151', type: 'dashed' } }, }, series: [ { name: 'Heuristic', type: 'bar', data: heuristicCorr.map((v) => ({ value: v, itemStyle: { color: '#22c55e' }, })), label: { show: true, position: 'top', color: '#9ca3af', fontSize: 10, formatter: '{c}', }, }, { name: 'Bayesian', type: 'bar', data: bayesianCorr.map((v) => ({ value: v, itemStyle: { color: '#3b82f6' }, })), label: { show: true, position: 'top', color: '#9ca3af', fontSize: 10, formatter: '{c}', }, }, ], } return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > BKT-Truth Correlation: Heuristic vs Bayesian Blame Attribution </h4> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mb: '1rem', })} > Fast learner profiles across 5 random seeds. Higher correlation = BKT estimates track true mastery more accurately. </p> <ReactECharts option={option} style={{ height: '320px' }} /> </div> ) } /** Internal: Data table for blame attribution validation */ function BlameDataTable() { const data = [ { seed: 42424, heuristic: 0.245, bayesian: 0.401, diff: 0.156, winner: 'Bayesian', }, { seed: 12345, heuristic: 0.751, bayesian: 0.627, diff: -0.124, winner: 'Heuristic', }, { seed: 99999, heuristic: 0.636, bayesian: 0.254, diff: -0.382, winner: 'Heuristic', }, { seed: 77777, heuristic: 0.166, bayesian: 0.345, diff: 0.178, winner: 'Bayesian', }, { seed: 55555, heuristic: 0.172, bayesian: 0.154, diff: -0.018, winner: 'Heuristic', }, ] const tableStyles = css({ width: '100%', borderCollapse: 'collapse', fontSize: '0.875rem', '& th': { bg: 'accent.muted', px: '0.75rem', py: '0.5rem', textAlign: 'center', fontWeight: 600, borderBottom: '2px solid', borderColor: 'accent.default', color: 'accent.emphasis', }, '& td': { px: '0.75rem', py: '0.5rem', borderBottom: '1px solid', borderColor: 'border.muted', color: 'text.secondary', textAlign: 'center', }, '& tr:hover td': { bg: 'accent.subtle' }, }) return ( <div className={chartContainerStyles}> <h4 className={css({ fontSize: '1rem', fontWeight: 600, mb: '0.5rem', color: 'text.primary', })} > Multi-Seed Validation Results </h4> <table className={tableStyles}> <thead> <tr> <th>Seed</th> <th>Heuristic r</th> <th>Bayesian r</th> <th>Difference</th> <th>Winner</th> </tr> </thead> <tbody> {data.map((row) => ( <tr key={row.seed}> <td>{row.seed}</td> <td>{row.heuristic.toFixed(3)}</td> <td>{row.bayesian.toFixed(3)}</td> <td className={css({ color: row.diff > 0 ? 'blue.400' : row.diff < 0 ? 'green.400' : 'text.muted', })} > {row.diff > 0 ? '+' : ''} {row.diff.toFixed(3)} </td> <td className={css({ color: row.winner === 'Heuristic' ? 'green.400' : 'blue.400', fontWeight: 600, })} > {row.winner} </td> </tr> ))} </tbody> <tfoot> <tr className={css({ fontWeight: 600, borderTop: '2px solid', borderColor: 'gray.600', })} > <td>Mean</td> <td>0.394</td> <td>0.356</td> <td>-0.038</td> <td className={css({ color: 'green.400' })}>Heuristic</td> </tr> </tfoot> </table> <p className={css({ fontSize: '0.875rem', color: 'text.muted', mt: '1rem', })} > t = -0.41, p > 0.05 (df=4). The difference is not statistically significant. </p> </div> ) } |