File size: 72,298 Bytes
0baaab6 |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EconAI - Scenario Generation Platform</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.sidebar-item.active {
background-color: #f0f9ff;
border-left: 4px solid #0ea5e9;
}
.sidebar-item.active .sidebar-icon {
color: #0ea5e9;
}
.sidebar-item:hover:not(.active) {
background-color: #f8fafc;
}
.chart-container {
height: 300px;
background-color: #f8fafc;
border-radius: 0.5rem;
position: relative;
}
.scenario-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.fade-in {
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.progress-bar {
height: 6px;
border-radius: 3px;
background-color: #e0f2fe;
overflow: hidden;
}
.progress-bar-fill {
height: 100%;
background-color: #0ea5e9;
transition: width 0.3s ease;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #cbd5e1;
transition: .4s;
border-radius: 24px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background-color: #0ea5e9;
}
input:checked + .toggle-slider:before {
transform: translateX(26px);
}
</style>
</head>
<body class="bg-gray-50 font-sans flex h-screen overflow-hidden">
<!-- Sidebar Navigation -->
<div class="w-64 bg-white border-r border-gray-200 flex flex-col">
<div class="p-4 border-b border-gray-200">
<div class="flex items-center space-x-2">
<i class="fas fa-chart-line text-2xl text-blue-500"></i>
<span class="text-xl font-bold text-gray-800">EconAI</span>
</div>
</div>
<nav class="flex-1 overflow-y-auto">
<div class="p-2">
<div class="sidebar-item active px-4 py-3 rounded-lg mb-1 cursor-pointer flex items-center">
<i class="sidebar-icon fas fa-cogs text-gray-500 mr-3"></i>
<span class="text-gray-700 font-medium">Generator</span>
</div>
<div class="sidebar-item px-4 py-3 rounded-lg mb-1 cursor-pointer flex items-center">
<i class="sidebar-icon fas fa-search text-gray-500 mr-3"></i>
<span class="text-gray-700 font-medium">Inspector</span>
</div>
<div class="sidebar-item px-4 py-3 rounded-lg mb-1 cursor-pointer flex items-center">
<i class="sidebar-icon fas fa-pen-fancy text-gray-500 mr-3"></i>
<span class="text-gray-700 font-medium">Composer</span>
</div>
<div class="sidebar-item px-4 py-3 rounded-lg mb-1 cursor-pointer flex items-center">
<i class="sidebar-icon fas fa-folder text-gray-500 mr-3"></i>
<span class="text-gray-700 font-medium">Scenario Library</span>
</div>
<div class="sidebar-item px-4 py-3 rounded-lg cursor-pointer flex items-center">
<i class="sidebar-icon fas fa-cog text-gray-500 mr-3"></i>
<span class="text-gray-700 font-medium">Settings</span>
</div>
</div>
</nav>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-user text-blue-500"></i>
</div>
<div>
<div class="text-sm font-medium text-gray-700">John Doe</div>
<div class="text-xs text-gray-500">Analyst</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Top Bar -->
<div class="bg-white border-b border-gray-200 p-4 flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Synthetic Scenario Generator</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<button class="bg-blue-500 text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-600 transition flex items-center">
<i class="fas fa-plus mr-2"></i> New Scenario
</button>
</div>
</div>
<!-- Main Panel Content -->
<div class="flex-1 overflow-y-auto p-6">
<!-- Generator Section -->
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Generation Settings -->
<div class="md:col-span-2">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Generation Parameters</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Generation Method</label>
<select class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>Brownian Motion</option>
<option>GARCH</option>
<option>Copula + Marginals</option>
<option>Custom (Upload Parameters)</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Scenarios</label>
<input type="number" value="100" min="1" max="1000" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Time Horizon</label>
<div class="flex space-x-2">
<input type="number" value="12" class="w-20 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<select class="flex-1 border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>Months</option>
<option>Days</option>
<option>Years</option>
</select>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Number of Assets</label>
<input type="number" value="5" min="1" max="20" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div class="flex items-center justify-between mb-6">
<div class="flex items-center">
<label class="block text-sm font-medium text-gray-700 mr-3">Advanced Settings</label>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
<button id="generateBtn" class="bg-blue-500 text-white px-6 py-2 rounded-lg font-medium hover:bg-blue-600 transition flex items-center">
<i class="fas fa-bolt mr-2"></i> Generate Scenarios
</button>
</div>
<!-- Advanced Settings (Hidden by default) -->
<div id="advancedSettings" class="hidden bg-gray-50 p-4 rounded-lg mb-6">
<h3 class="text-md font-medium text-gray-700 mb-3">Advanced Parameters</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Volatility</label>
<input type="range" min="0" max="1" step="0.01" value="0.2" class="w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Drift</label>
<input type="range" min="-0.1" max="0.1" step="0.01" value="0.02" class="w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Correlation Strength</label>
<input type="range" min="0" max="1" step="0.1" value="0.5" class="w-full">
</div>
</div>
</div>
<!-- Generation Progress -->
<div id="generationProgress" class="hidden">
<div class="flex items-center justify-between mb-2">
<span class="text-sm font-medium text-gray-700">Generating scenarios...</span>
<span class="text-sm text-gray-500" id="progressPercent">0%</span>
</div>
<div class="progress-bar">
<div class="progress-bar-fill" id="progressFill" style="width: 0%"></div>
</div>
</div>
</div>
<!-- Asset Selection -->
<div>
<h2 class="text-xl font-semibold text-gray-800 mb-4">Selected Assets</h2>
<div class="bg-gray-50 p-4 rounded-lg h-full">
<div class="space-y-3">
<div class="flex items-center justify-between p-2 bg-white rounded-lg border border-gray-200">
<div class="flex items-center">
<i class="fas fa-dollar-sign text-blue-500 mr-3"></i>
<span>USD/EUR</span>
</div>
<i class="fas fa-times text-gray-400 hover:text-red-500 cursor-pointer"></i>
</div>
<div class="flex items-center justify-between p-2 bg-white rounded-lg border border-gray-200">
<div class="flex items-center">
<i class="fas fa-chart-bar text-green-500 mr-3"></i>
<span>S&P 500</span>
</div>
<i class="fas fa-times text-gray-400 hover:text-red-500 cursor-pointer"></i>
</div>
<div class="flex items-center justify-between p-2 bg-white rounded-lg border border-gray-200">
<div class="flex items-center">
<i class="fas fa-oil-can text-yellow-500 mr-3"></i>
<span>Crude Oil</span>
</div>
<i class="fas fa-times text-gray-400 hover:text-red-500 cursor-pointer"></i>
</div>
<div class="flex items-center justify-between p-2 bg-white rounded-lg border border-gray-200">
<div class="flex items-center">
<i class="fas fa-home text-purple-500 mr-3"></i>
<span>Housing Index</span>
</div>
<i class="fas fa-times text-gray-400 hover:text-red-500 cursor-pointer"></i>
</div>
<div class="flex items-center justify-between p-2 bg-white rounded-lg border border-gray-200">
<div class="flex items-center">
<i class="fas fa-percentage text-red-500 mr-3"></i>
<span>Inflation Rate</span>
</div>
<i class="fas fa-times text-gray-400 hover:text-red-500 cursor-pointer"></i>
</div>
</div>
<button class="mt-4 text-blue-500 hover:text-blue-700 text-sm font-medium flex items-center">
<i class="fas fa-plus-circle mr-1"></i> Add Asset
</button>
</div>
</div>
</div>
</div>
<!-- Results Preview -->
<div id="resultsPreview" class="hidden fade-in">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold text-gray-800">Generated Scenarios Preview</h2>
<div class="flex space-x-3">
<button class="border border-gray-300 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center">
<i class="fas fa-download mr-1"></i> Export All
</button>
<button class="border border-gray-300 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center">
<i class="fas fa-filter mr-1"></i> Filter
</button>
</div>
</div>
<div class="chart-container mb-6">
<canvas id="previewChart"></canvas>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="flex justify-between items-start mb-3">
<h3 class="font-medium">Scenario #42</h3>
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">Validated</span>
</div>
<div class="h-24 mb-2">
<canvas id="miniChart1"></canvas>
</div>
<div class="text-sm text-gray-600">
<div class="flex items-center mb-1">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span>4.2/5</span>
</div>
<div class="text-xs text-gray-500 truncate">Moderate growth with stable inflation</div>
</div>
</div>
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="flex justify-between items-start mb-3">
<h3 class="font-medium">Scenario #17</h3>
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">Validated</span>
</div>
<div class="h-24 mb-2">
<canvas id="miniChart2"></canvas>
</div>
<div class="text-sm text-gray-600">
<div class="flex items-center mb-1">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span>3.8/5</span>
</div>
<div class="text-xs text-gray-500 truncate">Tech rally with rate hikes</div>
</div>
</div>
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="flex justify-between items-start mb-3">
<h3 class="font-medium">Scenario #89</h3>
<span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full">Review</span>
</div>
<div class="h-24 mb-2">
<canvas id="miniChart3"></canvas>
</div>
<div class="text-sm text-gray-600">
<div class="flex items-center mb-1">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span>2.5/5</span>
</div>
<div class="text-xs text-gray-500 truncate">Extreme volatility in commodities</div>
</div>
</div>
</div>
</div>
</div>
<!-- Inspector Section (Hidden by default) -->
<div id="inspectorSection" class="hidden bg-white rounded-xl shadow-md p-6 mb-6">
<div class="flex items-center mb-6">
<i class="fas fa-robot text-blue-500 text-2xl mr-3"></i>
<h2 class="text-xl font-semibold text-gray-800">LLM Inspector – Scenario Vetting</h2>
</div>
<div class="bg-blue-50 p-4 rounded-lg mb-6">
<p class="text-blue-800">
These scenarios are semantically evaluated and filtered for economic realism by our LLM Inspector.
The system identifies implausible correlations, unrealistic trajectories, and inconsistent narratives.
</p>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<div>
<h3 class="text-lg font-medium text-gray-700 mb-3">Raw Scenarios (Pre-Vetting)</h3>
<div class="chart-container">
<canvas id="rawScenariosChart"></canvas>
</div>
</div>
<div>
<h3 class="text-lg font-medium text-gray-700 mb-3">Filtered Scenarios (Post-Vetting)</h3>
<div class="chart-container">
<canvas id="filteredScenariosChart"></canvas>
</div>
</div>
</div>
<h3 class="text-lg font-medium text-gray-700 mb-3">Scenario Evaluation</h3>
<div class="overflow-x-auto">
<table class="min-w-full bg-white rounded-lg overflow-hidden">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Scenario ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Summary</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Inspector Score</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tags</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-42</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Soft landing with tech outperformance</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex">
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full mr-1">plausible</span>
<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">tech</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-download"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-17</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Inflation shock with Fed overreaction</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex">
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-gray-300"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full mr-1">plausible</span>
<span class="px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full">inflation</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-download"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-89</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Commodity boom with dollar collapse</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex">
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-yellow-400"></i>
<i class="fas fa-star text-gray-300"></i>
<i class="fas fa-star text-gray-300"></i>
<i class="fas fa-star text-gray-300"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full mr-1">questionable</span>
<span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs rounded-full">commodities</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3">
<i class="fas fa-eye"></i>
</button>
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-download"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Composer Section (Hidden by default) -->
<div id="composerSection" class="hidden bg-white rounded-xl shadow-md p-6 mb-6">
<div class="flex items-center mb-6">
<i class="fas fa-pen-fancy text-blue-500 text-2xl mr-3"></i>
<h2 class="text-xl font-semibold text-gray-800">Text-to-Scenario Composer</h2>
</div>
<div class="bg-blue-50 p-6 rounded-lg mb-6 text-center">
<textarea class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" rows="3" placeholder="Describe your desired scenario... Example: 'Tech stocks rally 20% while interest rates stay low, under a soft-landing macro environment.'"></textarea>
<div class="flex flex-wrap justify-center mt-4 space-x-4">
<div class="mb-3">
<label class="block text-sm font-medium text-gray-700 mb-1">Severity Level</label>
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>Mild</option>
<option selected>Moderate</option>
<option>Extreme</option>
</select>
</div>
<div class="mb-3">
<label class="block text-sm font-medium text-gray-700 mb-1">Time Horizon</label>
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>Short-term (1-3 months)</option>
<option selected>Medium-term (6-12 months)</option>
<option>Long-term (1-3 years)</option>
</select>
</div>
<div class="mb-3">
<label class="block text-sm font-medium text-gray-700 mb-1">Asset Focus</label>
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>All Assets</option>
<option selected>Equities</option>
<option>Fixed Income</option>
<option>Commodities</option>
<option>Currencies</option>
</select>
</div>
</div>
<button class="bg-blue-500 text-white px-6 py-2 rounded-lg font-medium hover:bg-blue-600 transition mt-4">
<i class="fas fa-magic mr-2"></i> Generate Matching Scenarios
</button>
</div>
<h3 class="text-lg font-medium text-gray-700 mb-4">Matching Scenarios</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="h-32 mb-3">
<canvas id="composerChart1"></canvas>
</div>
<div class="text-sm text-gray-600 mb-2">
"Tech sector outperforms while broader market stagnates under moderate rate environment."
</div>
<div class="flex justify-between items-center">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span class="text-xs">87% match</span>
</div>
<div>
<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">tech</span>
</div>
</div>
</div>
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="h-32 mb-3">
<canvas id="composerChart2"></canvas>
</div>
<div class="text-sm text-gray-600 mb-2">
"Growth stocks rally as Fed pauses hikes, while value lags due to yield curve flattening."
</div>
<div class="flex justify-between items-center">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span class="text-xs">79% match</span>
</div>
<div>
<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">growth</span>
</div>
</div>
</div>
<div class="scenario-card bg-white border border-gray-200 rounded-lg p-4 transition cursor-pointer">
<div class="h-32 mb-3">
<canvas id="composerChart3"></canvas>
</div>
<div class="text-sm text-gray-600 mb-2">
"Sector rotation into tech as earnings surprise to upside despite macro headwinds."
</div>
<div class="flex justify-between items-center">
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<span class="text-xs">72% match</span>
</div>
<div>
<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">earnings</span>
</div>
</div>
</div>
</div>
</div>
<!-- Scenario Library Section (Hidden by default) -->
<div id="librarySection" class="hidden bg-white rounded-xl shadow-md p-6">
<div class="flex items-center mb-6">
<i class="fas fa-folder text-blue-500 text-2xl mr-3"></i>
<h2 class="text-xl font-semibold text-gray-800">Scenario Library</h2>
</div>
<div class="flex flex-wrap justify-between mb-6">
<div class="flex flex-wrap space-x-3 mb-3">
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>All Tags</option>
<option>Plausible</option>
<option>Inflation</option>
<option>Tech</option>
<option>Recession</option>
</select>
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>All Risk Levels</option>
<option>Low</option>
<option>Medium</option>
<option>High</option>
</select>
<select class="border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option>All Methods</option>
<option>Brownian Motion</option>
<option>GARCH</option>
<option>Copula</option>
<option>Custom</option>
</select>
</div>
<div class="relative mb-3">
<i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
<input type="text" placeholder="Search scenarios..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full bg-white rounded-lg overflow-hidden">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Scenario ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">LLM Summary</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date Created</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tags</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-42</td>
<td class="px-6 py-4 text-sm text-gray-500">Soft landing with tech outperformance</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Jun 15, 2023</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full mr-1">plausible</span>
<span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">tech</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3" title="View">
<i class="fas fa-file-alt"></i>
</button>
<button class="text-blue-500 hover:text-blue-700 mr-3" title="Export CSV">
<i class="fas fa-download"></i>
</button>
<button class="text-blue-500 hover:text-blue-700" title="Share">
<i class="fas fa-share-alt"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-17</td>
<td class="px-6 py-4 text-sm text-gray-500">Inflation shock with Fed overreaction</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">May 28, 2023</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full mr-1">plausible</span>
<span class="px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full">inflation</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3" title="View">
<i class="fas fa-file-alt"></i>
</button>
<button class="text-blue-500 hover:text-blue-700 mr-3" title="Export CSV">
<i class="fas fa-download"></i>
</button>
<button class="text-blue-500 hover:text-blue-700" title="Share">
<i class="fas fa-share-alt"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SC-2023-89</td>
<td class="px-6 py-4 text-sm text-gray-500">Commodity boom with dollar collapse</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Apr 10, 2023</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full mr-1">questionable</span>
<span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs rounded-full">commodities</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-500 hover:text-blue-700 mr-3" title="View">
<i class="fas fa-file-alt"></i>
</button>
<button class="text-blue-500 hover:text-blue-700 mr-3" title="Export CSV">
<i class="fas fa-download"></i>
</button>
<button class="text-blue-500 hover:text-blue-700" title="Share">
<i class="fas fa-share-alt"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Scenario Detail Modal (Hidden by default) -->
<div id="scenarioModal" class="hidden fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center p-4 z-50">
<div class="bg-white rounded-xl shadow-xl w-full max-w-4xl max-h-screen overflow-y-auto">
<div class="p-6">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="text-xl font-semibold text-gray-800">Scenario SC-2023-42</h3>
<p class="text-sm text-gray-500">Generated on Jun 15, 2023</p>
</div>
<button id="closeModal" class="text-gray-400 hover:text-gray-500">
<i class="fas fa-times"></i>
</button>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<div>
<h4 class="text-lg font-medium text-gray-700 mb-3">Scenario Overview</h4>
<div class="bg-blue-50 p-4 rounded-lg mb-4">
<p class="text-blue-800">
"This scenario depicts a soft landing environment where the tech sector outperforms the broader market.
The Fed maintains a moderate stance while inflation gradually declines to target levels.
The S&P 500 gains 15% over 12 months with tech up 25%."
</p>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">LLM Score</label>
<div class="flex items-center">
<i class="fas fa-star text-yellow-400 mr-1"></i>
<i class="fas fa-star text-yellow-400 mr-1"></i>
<i class="fas fa-star text-yellow-400 mr-1"></i>
<i class="fas fa-star text-yellow-400 mr-1"></i>
<i class="fas fa-star text-yellow-400"></i>
<span class="ml-2 text-sm text-gray-600">5.0</span>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Risk Level</label>
<span class="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full">Low</span>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Generation Method</label>
<span class="text-sm text-gray-600">GAN</span>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Time Horizon</label>
<span class="text-sm text-gray-600">12 months</span>
</div>
</div>
</div>
<div>
<h4 class="text-lg font-medium text-gray-700 mb-3">Asset Performance</h4>
<div class="bg-white border border-gray-200 rounded-lg overflow-hidden">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Asset</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Start</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">End</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Change</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-900">S&P 500</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">4,200</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">4,830</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-green-500">+15.0%</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-900">NASDAQ</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">13,200</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">16,500</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-green-500">+25.0%</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-900">10Y Yield</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">3.75%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">3.25%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-red-500">-50bps</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-900">USD/EUR</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.92</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.95</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-red-500">+3.3%</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<h4 class="text-lg font-medium text-gray-700 mb-3">Scenario Timeline</h4>
<div class="chart-container mb-6">
<canvas id="modalChart"></canvas>
</div>
<h4 class="text-lg font-medium text-gray-700 mb-3">LLM Validation Notes</h4>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-start mb-3">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center">
<i class="fas fa-robot text-purple-500"></i>
</div>
</div>
<div class="ml-3">
<div class="text-sm font-medium text-gray-800">LLM Validator</div>
<div class="mt-1 text-sm text-gray-600">
"This scenario presents a coherent narrative of a soft landing environment. The tech outperformance
is consistent with historical patterns during periods of moderating inflation and stable rates.
The correlation structure between assets is economically plausible."
</div>
</div>
</div>
<div class="flex items-start">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center">
<i class="fas fa-robot text-purple-500"></i>
</div>
</div>
<div class="ml-3">
<div class="text-sm font-medium text-gray-800">LLM Validator</div>
<div class="mt-1 text-sm text-gray-600">
"The magnitude of tech outperformance (25%) relative to the broad market (15%) is at the upper end
of historical ranges but remains plausible given current sector valuations and growth expectations."
</div>
</div>
</div>
</div>
<div class="mt-6 flex justify-end space-x-3">
<button class="border border-gray-300 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50">
<i class="fas fa-download mr-1"></i> Export CSV
</button>
<button class="bg-blue-500 text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-600">
<i class="fas fa-share-alt mr-1"></i> Share Scenario
</button>
</div>
</div>
</div>
</div>
<script>
// Generate random walk data
function generateRandomWalk(steps, startValue, volatility) {
const data = [startValue];
for (let i = 1; i < steps; i++) {
const change = (Math.random() - 0.5) * volatility;
data.push(data[i-1] + change);
}
return data;
}
// Generate correlated data
function generateCorrelatedData(baseData, correlation) {
return baseData.map((value, i) => {
const noise = (Math.random() - 0.5) * 2 * (1 - Math.abs(correlation));
return value * correlation + noise * 5;
});
}
// Generate time labels
function generateTimeLabels(count) {
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const labels = [];
for (let i = 0; i < count; i++) {
labels.push(`${months[i % 12]} ${2023 + Math.floor(i/12)}`);
}
return labels;
}
// Common chart options
function getChartOptions(title) {
return {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: !!title,
text: title,
font: {
size: 14
}
},
tooltip: {
mode: 'index',
intersect: false,
backgroundColor: 'rgba(0, 0, 0, 0.7)',
titleFont: {
size: 12,
weight: 'bold'
},
bodyFont: {
size: 12
},
callbacks: {
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += context.parsed.y.toFixed(2);
if (context.dataset.label.includes('%')) {
label += '%';
} else if (context.dataset.label.includes('$')) {
label = '$' + label;
}
}
return label;
}
}
},
legend: {
position: 'bottom',
labels: {
boxWidth: 12,
padding: 20
}
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
type: 'linear',
display: true,
position: 'left',
grid: {
drawOnChartArea: false
}
}
},
interaction: {
mode: 'nearest',
axis: 'x',
intersect: false
}
};
}
// Render preview chart
function renderPreviewChart() {
const timeLabels = generateTimeLabels(12);
const baseData = generateRandomWalk(12, 100, 5);
const datasets = [];
for (let i = 0; i < 5; i++) {
datasets.push({
label: `Scenario ${i+1}`,
data: generateCorrelatedData(baseData, 0.7 + i*0.05),
borderColor: `hsl(${i * 60}, 70%, 50%)`,
backgroundColor: `hsla(${i * 60}, 70%, 50%, 0.1)`,
borderWidth: 1,
tension: 0.3
});
}
new Chart(document.getElementById('previewChart'), {
type: 'line',
data: {
labels: timeLabels,
datasets: datasets
},
options: getChartOptions('Sample Scenario Paths')
});
}
// Render mini charts
function renderMiniCharts() {
const timeLabels = generateTimeLabels(12);
// Mini Chart 1
new Chart(document.getElementById('miniChart1'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'S&P 500',
data: generateRandomWalk(12, 4200, 50),
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
// Mini Chart 2
new Chart(document.getElementById('miniChart2'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'Tech Index',
data: generateRandomWalk(12, 13200, 100),
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
// Mini Chart 3
new Chart(document.getElementById('miniChart3'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'Oil Price',
data: generateRandomWalk(12, 80, 3),
borderColor: '#f59e0b',
backgroundColor: 'rgba(245, 158, 11, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
}
// Render inspector charts
function renderInspectorCharts() {
const timeLabels = generateTimeLabels(12);
// Raw scenarios chart
const rawDatasets = [];
for (let i = 0; i < 20; i++) {
rawDatasets.push({
label: `Scenario ${i+1}`,
data: generateRandomWalk(12, 100, 10),
borderColor: 'rgba(100, 100, 100, 0.3)',
backgroundColor: 'rgba(100, 100, 100, 0.05)',
borderWidth: 1,
tension: 0.1
});
}
new Chart(document.getElementById('rawScenariosChart'), {
type: 'line',
data: {
labels: timeLabels,
datasets: rawDatasets
},
options: getChartOptions('Raw Scenarios (Pre-Vetting)')
});
// Filtered scenarios chart
const baseData = generateRandomWalk(12, 100, 5);
const filteredDatasets = [
{
label: 'Scenario #42 (Validated)',
data: generateCorrelatedData(baseData, 0.9),
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 2,
tension: 0.3
},
{
label: 'Scenario #17 (Validated)',
data: generateCorrelatedData(baseData, 0.8),
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
tension: 0.3
},
{
label: 'Scenario #89 (Review)',
data: generateCorrelatedData(baseData, 0.5),
borderColor: '#f59e0b',
backgroundColor: 'rgba(245, 158, 11, 0.1)',
borderWidth: 2,
tension: 0.3
}
];
new Chart(document.getElementById('filteredScenariosChart'), {
type: 'line',
data: {
labels: timeLabels,
datasets: filteredDatasets
},
options: getChartOptions('Filtered Scenarios (Post-Vetting)')
});
}
// Render composer charts
function renderComposerCharts() {
const timeLabels = generateTimeLabels(12);
const baseData = generateRandomWalk(12, 100, 4);
// Composer Chart 1
new Chart(document.getElementById('composerChart1'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'Tech Index',
data: generateCorrelatedData(baseData, 0.9).map(v => v * 1.2),
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
// Composer Chart 2
new Chart(document.getElementById('composerChart2'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'Growth Index',
data: generateCorrelatedData(baseData, 0.85),
borderColor: '#8b5cf6',
backgroundColor: 'rgba(139, 92, 246, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
// Composer Chart 3
new Chart(document.getElementById('composerChart3'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [{
label: 'Earnings Growth',
data: generateCorrelatedData(baseData, 0.8).map(v => v * 0.8),
borderColor: '#ec4899',
backgroundColor: 'rgba(236, 72, 153, 0.1)',
borderWidth: 1,
tension: 0.3
}]
},
options: getChartOptions()
});
}
// Render modal chart
function renderModalChart() {
const timeLabels = generateTimeLabels(12);
const baseData = generateRandomWalk(12, 100, 3);
new Chart(document.getElementById('modalChart'), {
type: 'line',
data: {
labels: timeLabels,
datasets: [
{
label: 'S&P 500 (Normalized)',
data: baseData,
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 2,
tension: 0.3
},
{
label: 'Tech Index (Normalized)',
data: generateCorrelatedData(baseData, 0.9).map(v => v * 1.2),
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
tension: 0.3
},
{
label: '10Y Yield (%)',
data: generateCorrelatedData(baseData, -0.7).map(v => v * -0.05 + 4),
borderColor: '#8b5cf6',
backgroundColor: 'rgba(139, 92, 246, 0.1)',
borderWidth: 2,
tension: 0.3,
yAxisID: 'y1'
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Scenario Timeline',
font: {
size: 16
}
},
tooltip: {
mode: 'index',
intersect: false
},
legend: {
position: 'bottom'
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
type: 'linear',
display: true,
position: 'left',
title: {
display: true,
text: 'Index Value'
}
},
y1: {
type: 'linear',
display: true,
position: 'right',
title: {
display: true,
text: 'Yield (%)'
},
grid: {
drawOnChartArea: false
}
}
}
}
});
}
// Toggle advanced settings
document.querySelector('.toggle-switch input').addEventListener('change', function() {
document.getElementById('advancedSettings').classList.toggle('hidden');
});
// Generate button handler
document.getElementById('generateBtn').addEventListener('click', function() {
// Show loading state
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
this.disabled = true;
// Show progress bar
document.getElementById('generationProgress').classList.remove('hidden');
// Simulate generation progress
let progress = 0;
const progressInterval = setInterval(() => {
progress += Math.random() * 10;
if (progress >= 100) {
progress = 100;
clearInterval(progressInterval);
// Show results
document.getElementById('resultsPreview').classList.remove('hidden');
// Render charts
renderPreviewChart();
renderMiniCharts();
// Reset button
this.innerHTML = '<i class="fas fa-bolt mr-2"></i> Generate Scenarios';
this.disabled = false;
// Hide progress bar
document.getElementById('generationProgress').classList.add('hidden');
}
document.getElementById('progressFill').style.width = `${progress}%`;
document.getElementById('progressPercent').textContent = `${Math.round(progress)}%`;
}, 200);
});
// Sidebar navigation
document.querySelectorAll('.sidebar-item').forEach(item => {
item.addEventListener('click', function() {
document.querySelectorAll('.sidebar-item').forEach(i => i.classList.remove('active'));
this.classList.add('active');
// Hide all sections
document.getElementById('resultsPreview').classList.add('hidden');
document.getElementById('inspectorSection').classList.add('hidden');
document.getElementById('composerSection').classList.add('hidden');
document.getElementById('librarySection').classList.add('hidden');
// Show selected section
const text = this.querySelector('span').textContent;
if (text === 'Generator') {
document.getElementById('resultsPreview').classList.remove('hidden');
} else if (text === 'Inspector') {
document.getElementById('inspectorSection').classList.remove('hidden');
renderInspectorCharts();
} else if (text === 'Composer') {
document.getElementById('composerSection').classList.remove('hidden');
renderComposerCharts();
} else if (text === 'Scenario Library') {
document.getElementById('librarySection').classList.remove('hidden');
}
});
});
// Scenario card click handler
document.querySelectorAll('.scenario-card').forEach(card => {
card.addEventListener('click', function() {
document.getElementById('scenarioModal').classList.remove('hidden');
renderModalChart();
});
});
// Close modal handler
document.getElementById('closeModal').addEventListener('click', function() {
document.getElementById('scenarioModal').classList.add('hidden');
});
// Initialize
document.addEventListener('DOMContentLoaded', function() {
// Render initial charts when the page loads
renderPreviewChart();
renderMiniCharts();
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=amphora/econai" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |