jaxgmg-sus-vis-data / llc0.html
davidquarel's picture
Upload folder using huggingface_hub
cc7dd65 verified
<!DOCTYPE html>
<html>
<head>
<title>Enhanced Action Probability Viewer with LLC</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background: #f0f0f0;
}
.container {
display: flex;
gap: 20px;
max-width: 1400px;
margin: 0 auto;
height: calc(100vh - 140px); /* Full height minus controls space */
}
.image-panel {
flex: 1;
background: white;
border-radius: 8px;
padding: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
display: flex;
align-items: center;
justify-content: center;
}
.plot-panel {
flex: 1;
background: white;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#imageContainer {
text-align: center;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
#actionImage {
border: 2px solid #333;
image-rendering: pixelated;
width: 100%;
max-width: min(100%, 80vh); /* Scale with viewport height */
height: auto;
aspect-ratio: 1;
background: #fff;
}
#llcPlot {
width: 100%;
height: calc(100% - 200px); /* Adjust for stats and frame info */
border: 1px solid #ddd;
background: #fff;
}
.controls {
margin: 20px 0;
text-align: center;
}
#frameSlider {
width: 90%;
margin: 10px 0;
}
.buttons {
margin: 15px 0;
text-align: center;
}
.controls-row {
display: flex;
justify-content: center;
align-items: center;
gap: 15px;
flex-wrap: wrap;
margin: 20px 0;
}
/* Loading screen styles */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 1000;
color: white;
font-family: Arial, sans-serif;
}
.loading-content {
text-align: center;
max-width: 500px;
padding: 40px;
}
.loading-title {
font-size: 24px;
margin-bottom: 20px;
font-weight: bold;
}
.progress-container {
width: 400px;
height: 20px;
background: #333;
border-radius: 10px;
overflow: hidden;
margin: 20px 0;
position: relative;
}
.progress-bar {
height: 100%;
background: linear-gradient(45deg, #007bff, #0056b3);
width: 0%;
transition: width 0.3s ease;
border-radius: 10px;
}
.progress-text {
margin-top: 15px;
font-size: 16px;
opacity: 0.9;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 4px solid #333;
border-top: 4px solid #007bff;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.main-content {
display: none;
}
.main-content.loaded {
display: block;
}
button {
margin: 0 8px;
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 5px;
cursor: pointer;
background: #007bff;
color: white;
}
button:hover {
background: #0056b3;
}
#frameInfo {
font-size: 18px;
font-weight: bold;
margin: 15px 0;
text-align: center;
color: #333;
}
.stats {
display: flex;
justify-content: space-around;
margin: 20px 0;
padding: 15px;
background: #f8f9fa;
border-radius: 5px;
}
.stat {
text-align: center;
}
.stat-value {
font-size: 20px;
font-weight: bold;
color: #007bff;
}
.stat-label {
font-size: 12px;
color: #666;
margin-top: 5px;
}
</style>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
</head>
<body>
<!-- Loading Screen -->
<div id="loadingOverlay" class="loading-overlay">
<div class="loading-content">
<div class="loading-title">Loading Action Probability Images</div>
<div class="loading-spinner"></div>
<div class="progress-container">
<div id="progressBar" class="progress-bar"></div>
</div>
<div id="progressText" class="progress-text">Preparing to download images...</div>
</div>
</div>
<!-- Main Content -->
<div id="mainContent" class="main-content">
<div class="container">
<div class="image-panel">
<div id="imageContainer">
<img id="actionImage" src="" alt="Action Probabilities">
</div>
</div>
<div class="plot-panel">
<div id="frameInfo">Frame: 0 / 780</div>
<div id="llcPlot"></div>
<div class="stats">
<div class="stat">
<div class="stat-value" id="currentLLC">0.000000</div>
<div class="stat-label">Current LLC</div>
</div>
<div class="stat">
<div class="stat-value" id="minLLC">0.000000</div>
<div class="stat-label">Min LLC</div>
</div>
<div class="stat">
<div class="stat-value" id="maxLLC">0.000000</div>
<div class="stat-label">Max LLC</div>
</div>
</div>
</div>
</div>
<div class="controls">
<input type="range" id="frameSlider" min="0" max="780" value="0">
</div>
<div class="controls-row">
<button onclick="prevFrame()">◀ Previous</button>
<button id="playBtn" onclick="togglePlay()">▶ Play</button>
<button onclick="nextFrame()">Next ▶</button>
<button id="repeatBtn" onclick="toggleRepeat()">🔄 Repeat</button>
<input type="range" id="fpsSlider" min="0" max="100" value="25" style="width: 150px;">
<span id="speedInfo" style="font-weight: bold;">5 FPS</span>
</div>
</div> <!-- End main content -->
<script>
// Data
const zipFilePath = "llc0_images.zip";
const totalImages = 781;
const allCheckpoints = [0, 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];
const allLlcValues = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -1.78009272, -0.7316768200000001, 0.31673908, 0.844091175, 1.37144327, 1.66702271, 2.075095973333333, 2.483169236666667, 2.8912425, 2.95182069, 3.01239888, 3.07297707, 3.18232179, 3.29166651, 3.3520658833333337, 3.4124652566666667, 3.47286463, 3.4440557166666665, 3.4152468033333334, 3.38643789, 3.0263463633333334, 2.6662548366666665, 2.30616331, 2.95853615, 3.61090899, 3.40320667, 3.19550435, 2.98780203, 2.73603201, 2.48426199, 2.23249197, 2.70964702, 3.18680207, 3.66395712, 3.69358063, 3.72320414, 3.37104003, 3.0188759199999997, 2.66671181, 3.002802533333333, 3.3388932566666667, 3.67498398, 3.53052219, 3.3860604, 3.24159861, 3.0286312100000004, 2.81566381, 2.93085972, 3.04605563, 3.16125154, 3.54754925, 3.7051141249999997, 3.862679, 3.3855239533333332, 2.908368906666667, 2.43121386, 2.29018927, 2.14916468, 2.623120946666667, 3.0970772133333333, 3.57103348, 3.5793781300000003, 3.58772278, 3.59606743, 3.4354726466666667, 3.2748778633333333, 3.11428308, 3.318220375, 3.52215767, 3.641943136666667, 3.7617286033333333, 3.88151407, 3.843386966666667, 3.805259863333333, 3.76713276, 3.80976995, 3.85240714, 3.89504433, 3.802478315, 3.7099123, 3.61643235, 3.5229524, 3.42947245, 3.5499731733333335, 3.6704738966666666, 3.79097462, 3.8251082133333334, 3.8592418066666667, 3.8933754, 3.813922405, 3.73446941, 3.6503076533333334, 3.5661458966666664, 3.48198414, 3.65571181, 3.82943948, 4.00316715, 3.737429776666667, 3.4716924033333334, 3.20595503, 3.161728385, 3.11750174, 3.2781163866666665, 3.438731033333333, 3.59934568, 3.6650101333333334, 3.7306745866666664, 3.79633904, 3.8783947666666667, 3.960450493333333, 4.04250622, 4.030555489999999, 4.01860476, 4.033466183333333, 4.048327606666667, 4.06318903, 4.0525595333333335, 4.041930036666667, 4.03130054, 4.036506013333334, 4.041711486666666, 4.04691696, 4.04033065, 4.03374434, 4.067540173333334, 4.101336006666666, 4.13513184, 4.055341086666666, 3.975550333333333, 3.89575958, 3.8066903733333333, 3.7176211666666665, 3.62855196, 3.69501114, 3.76147032, 3.8190881433333335, 3.8767059666666666, 3.93432379, 3.89403105, 3.85373831, 3.81344557, 3.71605158, 3.61865759, 3.5212636, 3.62035632, 3.71944904, 3.7474632233333334, 3.775477406666667, 3.80349159, 3.66491079, 3.52632999, 3.69787216, 3.8291811933333335, 3.960490226666667, 4.09179926, 4.147708415, 4.20361757, 4.150946933333333, 4.098276296666667, 4.04560566, 3.98216645, 3.91872724, 3.85528803, 3.9661328, 4.07697757, 4.18782234, 4.18092807, 4.1740338, 4.16713953, 4.188338916666667, 4.209538303333333, 4.23073769, 4.198829336666667, 4.166920983333333, 4.13501263, 4.100183646666667, 4.065354663333333, 4.03052568, 3.95709276, 3.88365984, 4.000882306666667, 4.118104773333333, 4.23532724, 3.9949019733333335, 3.7544767066666664, 3.51405144, 3.5523772266666667, 3.590703013333333, 3.6290288, 3.9230585099999997, 4.21708822, 4.091183343333333, 3.9652784666666667, 3.83937359, 3.85640065, 3.87342771, 3.89045477, 3.7811001133333333, 3.6717454566666667, 3.5623908, 3.6290884, 3.695786, 3.7847558666666665, 3.8737257333333335, 3.9626956, 4.107435546666666, 4.2521754933333336, 4.39691544, 4.35092052, 4.3049256, 4.25893068, 4.2816698550000005, 4.30440903, 4.3352047633333335, 4.366000496666667, 4.39679623, 4.144529503333333, 3.8922627766666666, 3.63999605, 3.7527481700000003, 3.86550029, 3.97825241, 4.187852145, 4.39745188, 4.39055761, 4.38366334, 4.37676907, 4.142185053333334, 3.9076010366666667, 3.67301702, 3.5328269, 3.594070675, 3.65531445, 3.92392278, 4.19253111, 4.089732966666666, 3.9869348233333333, 3.88413668, 3.9469401066666667, 4.009743533333333, 4.07254696, 4.147171973333333, 4.221796986666667, 4.296422, 4.327028985, 4.35763597, 4.14206584, 3.9264957099999998, 3.71092558, 3.7146210666666666, 3.7183165533333336, 3.72201204, 3.90879313, 4.09557422, 4.28235531, 4.02178367, 3.76121203, 3.50064039, 3.75763575, 4.01463111, 4.27162647, 4.052519796666667, 3.8334131233333335, 3.61430645, 3.62632672, 3.63834699, 3.65036726, 3.70365381, 3.75694036, 3.9295951500000004, 4.10224994, 4.27490473, 4.239320756666666, 4.2037367833333334, 4.16815281, 4.251599313333333, 4.335045816666667, 4.41849232, 4.322469235, 4.22644615, 4.234611986666667, 4.242777823333333, 4.25094366, 4.25227483, 4.2536059999999996, 4.25493717, 4.25217549, 4.24941381, 4.24665213, 3.94368172, 3.64071131, 3.7095546733333333, 3.7783980366666667, 3.8472414, 4.095415273333334, 4.343589146666667, 4.59176302, 4.313866296666667, 4.035969573333333, 3.75807285, 3.77038121, 3.78268957, 3.9997100833333334, 4.216730596666666, 4.43375111, 4.476726056666667, 4.519701003333333, 4.56267595, 4.453241823333333, 4.3438076966666666, 4.23437357, 4.248559475, 4.26274538, 4.402577876666666, 4.542410373333333, 4.68224287, 4.643857479999999, 4.60547209, 4.5670867, 4.506568116666666, 4.446049533333333, 4.38553095, 4.42430377, 4.46307659, 4.57048416, 4.67789173, 4.7852993, 4.781544206666667, 4.777789113333333, 4.77403402, 4.82559204, 4.661917685000001, 4.49824333, 4.466861485, 4.43547964, 4.417260486666667, 4.399041333333333, 4.38082218, 4.543522993333333, 4.706223806666666, 4.86892462, 4.904806616666666, 4.940688613333333, 4.97657061, 4.9871405, 4.99771039, 5.00828028, 5.012790363333333, 5.017300446666667, 5.02181053, 4.880865413333333, 4.739920296666667, 4.59897518, 4.567344983333333, 4.5357147866666665, 4.50408459, 4.8203468350000005, 5.13660908, 5.178630353333333, 5.220651626666667, 5.2626729, 5.2545468, 5.2464207, 5.2382946, 5.270759263333333, 5.303223926666667, 5.33568859, 5.329817535, 5.32394648, 5.3661863033333335, 5.408426126666667, 5.45066595, 5.47470649, 5.4987470300000005, 5.52278757, 5.522946516666667, 5.523105463333334, 5.52326441, 5.4564178000000005, 5.38957119, 5.4299235333333336, 5.470275876666666, 5.51062822, 5.54680824, 5.5829882600000005, 5.61916828, 5.617916583333334, 5.616664886666666, 5.61541319, 5.767703055, 5.91999292, 5.993505316666667, 6.067017713333334, 6.14053011, 6.242394446666667, 6.344258783333333, 6.44612312, 6.4529577866666665, 6.459792453333334, 6.46662712, 6.54423237, 6.62183762, 6.655573846666667, 6.689310073333333, 6.7230463, 6.829162436666667, 6.935278573333333, 7.04139471, 7.100522516666667, 7.159650323333333, 7.21877813, 7.2915256, 7.36427307, 7.46611754, 7.5679620100000005, 7.66980648, 7.539312043333333, 7.408817606666667, 7.27832317, 7.811427115, 8.34453106, 8.46427727, 8.359670640000001, 8.25506401, 8.174180666666667, 8.093297323333333, 8.01241398, 7.321635883333333, 6.630857786666667, 5.94007969, 7.38656521, 8.83305073, 10.27953625, 8.037984375, 5.7964325, 7.390300436666666, 8.984168373333333, 10.57803631, 8.898893993333333, 7.219751676666666, 5.54060936, 7.58588314, 9.631156919999999, 11.6764307, 10.516017434999998, 9.35560417, 10.443587619999999, 11.53157107, 12.61955452, 12.369870823333333, 12.120187126666666, 11.87050343, 12.398322426666667, 12.926141423333332, 13.45396042, 13.182222845, 12.91048527, 13.434092206666667, 13.957699143333333, 14.48130608, 14.527837436666667, 14.574368793333333, 14.62090015, 15.1951313, 15.76936245, 16.3435936, 16.303062439999998, 16.26253128, 16.37782669, 16.4931221, 16.60841751, 17.11819585, 17.62797419, 18.13775253, 18.314838406666667, 18.491924283333333, 18.66901016, 19.010305405, 19.35160065, 19.456803006666668, 19.562005363333334, 19.66720772, 19.635080973333334, 19.602954226666665, 19.57082748, 19.807815549999997, 20.04480362, 20.28179169, 20.637363434999997, 20.99293518, 21.047056196666666, 21.101177213333333, 21.15529823, 21.04657936, 20.937860490000002, 20.82914162, 20.820458733333336, 20.811775846666666, 20.80309296, 20.85691643, 20.9107399, 20.617842356666667, 20.32494481333333, 20.03204727, 20.02334531, 20.01464335, 20.00594139, 20.315189996666668, 20.62443860333333, 20.93368721, 18.59653091, 16.67791557, 17.34560712, 18.01329867, 18.68099022, 19.33479309, 19.98859596, 20.64239883, 20.20043055, 19.758462270000003, 19.31649399, 19.56401253, 19.81153107, 20.05904961, 20.006676993333333, 19.954304376666666, 19.90193176, 19.7339859, 19.56604004, 19.39809418, 19.466301603333335, 19.534509026666665, 19.60271645, 19.466698649999998, 19.33068085, 19.155085246666665, 18.979489643333334, 18.80389404, 18.565515516666665, 18.327136993333333, 18.08875847, 18.244107566666667, 18.399456663333332, 18.55480576, 18.47287941, 18.39095306, 18.118122733333333, 17.84529240666667, 17.57246208, 17.24058342, 16.908704760000003, 16.5768261, 17.117281600000002, 17.6577371, 18.1981926, 18.235832215, 18.27347183, 17.093578336666667, 15.913684843333334, 14.73379135, 15.749792096666667, 16.765792843333333, 17.78179359, 17.61583455, 17.449875510000002, 17.28391647, 17.51554012, 17.74716377, 16.732394533333334, 15.717625296666666, 14.70285606, 15.708664573333333, 16.714473086666665, 17.7202816, 17.561296463333335, 17.402311326666666, 17.24332619, 17.398386955, 17.55344772, 17.23837788666667, 16.923308053333333, 16.60823822, 16.64992141666667, 16.691604613333332, 16.73328781, 16.746699013333334, 16.760110216666668, 16.77352142, 16.72258949, 16.67165756, 16.597171783333334, 16.522686006666667, 16.44820023, 16.519129436666667, 16.590058643333336, 16.66098785, 16.53744761, 16.41390737, 16.29036713, 15.827209, 15.36405087, 15.68583616, 16.00762145, 16.32940674, 16.285558066666667, 16.241709393333334, 16.19786072, 15.389681183333334, 14.581501646666668, 13.77332211, 13.879855476666666, 13.986388843333334, 14.09292221, 14.340579349999999, 14.58823649, 14.83589363, 13.8578612, 12.87982877, 11.90179634, 13.135075886666668, 14.368355433333333, 15.60163498, 15.179097655, 14.75656033, 14.149904253333332, 13.543248176666667, 12.9365921, 13.81697273, 14.697353360000001, 15.57773399, 15.58256149, 15.20898914, 14.83541679, 14.300614355, 13.76581192, 13.877173106666667, 13.988534293333334, 14.09989548, 14.366209033333334, 14.632522586666667, 14.89883614, 15.039423626666666, 15.180011113333334, 15.3205986, 15.261620045, 15.20264149, 15.216588976666666, 15.230536463333333, 15.24448395, 15.168209713333333, 15.091935476666666, 15.01566124, 14.955401103333333, 14.895140966666666, 14.83488083, 14.858365059999999, 14.88184929, 14.90533352, 14.92881775, 14.95230198, 14.940321606666666, 14.928341233333333, 14.91636086, 14.801561993333333, 14.686763126666666, 14.57196426, 13.859402844, 13.146841428, 12.434280012, 11.721718596, 11.00915718, 12.10216713, 13.19517708, 14.28818703, 14.34059938, 14.39301173, 14.44542408, 14.227062700000001, 14.00870132, 13.942520140000001, 13.87633896, 13.81015778, 13.91635323, 14.02254868, 14.12874413, 14.08153725, 14.03433037, 13.98712349, 13.822108270000001, 13.65709305, 13.592282933333333, 13.527472816666666, 13.4626627, 13.333221436666665, 13.203780173333334, 13.07433891, 12.890021323333333, 12.705703736666667, 12.52138615, 12.58879916, 12.65621217, 12.72362518, 12.427250860000001, 12.13087654, 11.83450222, 11.021614073333334, 10.208725926666666, 9.39583778, 10.590076443333334, 11.784315106666666, 12.97855377];
const validCheckpoints = [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];
const validLlcValues = [-1.78009272, -0.7316768200000001, 0.31673908, 0.844091175, 1.37144327, 1.66702271, 2.075095973333333, 2.483169236666667, 2.8912425, 2.95182069, 3.01239888, 3.07297707, 3.18232179, 3.29166651, 3.3520658833333337, 3.4124652566666667, 3.47286463, 3.4440557166666665, 3.4152468033333334, 3.38643789, 3.0263463633333334, 2.6662548366666665, 2.30616331, 2.95853615, 3.61090899, 3.40320667, 3.19550435, 2.98780203, 2.73603201, 2.48426199, 2.23249197, 2.70964702, 3.18680207, 3.66395712, 3.69358063, 3.72320414, 3.37104003, 3.0188759199999997, 2.66671181, 3.002802533333333, 3.3388932566666667, 3.67498398, 3.53052219, 3.3860604, 3.24159861, 3.0286312100000004, 2.81566381, 2.93085972, 3.04605563, 3.16125154, 3.54754925, 3.7051141249999997, 3.862679, 3.3855239533333332, 2.908368906666667, 2.43121386, 2.29018927, 2.14916468, 2.623120946666667, 3.0970772133333333, 3.57103348, 3.5793781300000003, 3.58772278, 3.59606743, 3.4354726466666667, 3.2748778633333333, 3.11428308, 3.318220375, 3.52215767, 3.641943136666667, 3.7617286033333333, 3.88151407, 3.843386966666667, 3.805259863333333, 3.76713276, 3.80976995, 3.85240714, 3.89504433, 3.802478315, 3.7099123, 3.61643235, 3.5229524, 3.42947245, 3.5499731733333335, 3.6704738966666666, 3.79097462, 3.8251082133333334, 3.8592418066666667, 3.8933754, 3.813922405, 3.73446941, 3.6503076533333334, 3.5661458966666664, 3.48198414, 3.65571181, 3.82943948, 4.00316715, 3.737429776666667, 3.4716924033333334, 3.20595503, 3.161728385, 3.11750174, 3.2781163866666665, 3.438731033333333, 3.59934568, 3.6650101333333334, 3.7306745866666664, 3.79633904, 3.8783947666666667, 3.960450493333333, 4.04250622, 4.030555489999999, 4.01860476, 4.033466183333333, 4.048327606666667, 4.06318903, 4.0525595333333335, 4.041930036666667, 4.03130054, 4.036506013333334, 4.041711486666666, 4.04691696, 4.04033065, 4.03374434, 4.067540173333334, 4.101336006666666, 4.13513184, 4.055341086666666, 3.975550333333333, 3.89575958, 3.8066903733333333, 3.7176211666666665, 3.62855196, 3.69501114, 3.76147032, 3.8190881433333335, 3.8767059666666666, 3.93432379, 3.89403105, 3.85373831, 3.81344557, 3.71605158, 3.61865759, 3.5212636, 3.62035632, 3.71944904, 3.7474632233333334, 3.775477406666667, 3.80349159, 3.66491079, 3.52632999, 3.69787216, 3.8291811933333335, 3.960490226666667, 4.09179926, 4.147708415, 4.20361757, 4.150946933333333, 4.098276296666667, 4.04560566, 3.98216645, 3.91872724, 3.85528803, 3.9661328, 4.07697757, 4.18782234, 4.18092807, 4.1740338, 4.16713953, 4.188338916666667, 4.209538303333333, 4.23073769, 4.198829336666667, 4.166920983333333, 4.13501263, 4.100183646666667, 4.065354663333333, 4.03052568, 3.95709276, 3.88365984, 4.000882306666667, 4.118104773333333, 4.23532724, 3.9949019733333335, 3.7544767066666664, 3.51405144, 3.5523772266666667, 3.590703013333333, 3.6290288, 3.9230585099999997, 4.21708822, 4.091183343333333, 3.9652784666666667, 3.83937359, 3.85640065, 3.87342771, 3.89045477, 3.7811001133333333, 3.6717454566666667, 3.5623908, 3.6290884, 3.695786, 3.7847558666666665, 3.8737257333333335, 3.9626956, 4.107435546666666, 4.2521754933333336, 4.39691544, 4.35092052, 4.3049256, 4.25893068, 4.2816698550000005, 4.30440903, 4.3352047633333335, 4.366000496666667, 4.39679623, 4.144529503333333, 3.8922627766666666, 3.63999605, 3.7527481700000003, 3.86550029, 3.97825241, 4.187852145, 4.39745188, 4.39055761, 4.38366334, 4.37676907, 4.142185053333334, 3.9076010366666667, 3.67301702, 3.5328269, 3.594070675, 3.65531445, 3.92392278, 4.19253111, 4.089732966666666, 3.9869348233333333, 3.88413668, 3.9469401066666667, 4.009743533333333, 4.07254696, 4.147171973333333, 4.221796986666667, 4.296422, 4.327028985, 4.35763597, 4.14206584, 3.9264957099999998, 3.71092558, 3.7146210666666666, 3.7183165533333336, 3.72201204, 3.90879313, 4.09557422, 4.28235531, 4.02178367, 3.76121203, 3.50064039, 3.75763575, 4.01463111, 4.27162647, 4.052519796666667, 3.8334131233333335, 3.61430645, 3.62632672, 3.63834699, 3.65036726, 3.70365381, 3.75694036, 3.9295951500000004, 4.10224994, 4.27490473, 4.239320756666666, 4.2037367833333334, 4.16815281, 4.251599313333333, 4.335045816666667, 4.41849232, 4.322469235, 4.22644615, 4.234611986666667, 4.242777823333333, 4.25094366, 4.25227483, 4.2536059999999996, 4.25493717, 4.25217549, 4.24941381, 4.24665213, 3.94368172, 3.64071131, 3.7095546733333333, 3.7783980366666667, 3.8472414, 4.095415273333334, 4.343589146666667, 4.59176302, 4.313866296666667, 4.035969573333333, 3.75807285, 3.77038121, 3.78268957, 3.9997100833333334, 4.216730596666666, 4.43375111, 4.476726056666667, 4.519701003333333, 4.56267595, 4.453241823333333, 4.3438076966666666, 4.23437357, 4.248559475, 4.26274538, 4.402577876666666, 4.542410373333333, 4.68224287, 4.643857479999999, 4.60547209, 4.5670867, 4.506568116666666, 4.446049533333333, 4.38553095, 4.42430377, 4.46307659, 4.57048416, 4.67789173, 4.7852993, 4.781544206666667, 4.777789113333333, 4.77403402, 4.82559204, 4.661917685000001, 4.49824333, 4.466861485, 4.43547964, 4.417260486666667, 4.399041333333333, 4.38082218, 4.543522993333333, 4.706223806666666, 4.86892462, 4.904806616666666, 4.940688613333333, 4.97657061, 4.9871405, 4.99771039, 5.00828028, 5.012790363333333, 5.017300446666667, 5.02181053, 4.880865413333333, 4.739920296666667, 4.59897518, 4.567344983333333, 4.5357147866666665, 4.50408459, 4.8203468350000005, 5.13660908, 5.178630353333333, 5.220651626666667, 5.2626729, 5.2545468, 5.2464207, 5.2382946, 5.270759263333333, 5.303223926666667, 5.33568859, 5.329817535, 5.32394648, 5.3661863033333335, 5.408426126666667, 5.45066595, 5.47470649, 5.4987470300000005, 5.52278757, 5.522946516666667, 5.523105463333334, 5.52326441, 5.4564178000000005, 5.38957119, 5.4299235333333336, 5.470275876666666, 5.51062822, 5.54680824, 5.5829882600000005, 5.61916828, 5.617916583333334, 5.616664886666666, 5.61541319, 5.767703055, 5.91999292, 5.993505316666667, 6.067017713333334, 6.14053011, 6.242394446666667, 6.344258783333333, 6.44612312, 6.4529577866666665, 6.459792453333334, 6.46662712, 6.54423237, 6.62183762, 6.655573846666667, 6.689310073333333, 6.7230463, 6.829162436666667, 6.935278573333333, 7.04139471, 7.100522516666667, 7.159650323333333, 7.21877813, 7.2915256, 7.36427307, 7.46611754, 7.5679620100000005, 7.66980648, 7.539312043333333, 7.408817606666667, 7.27832317, 7.811427115, 8.34453106, 8.46427727, 8.359670640000001, 8.25506401, 8.174180666666667, 8.093297323333333, 8.01241398, 7.321635883333333, 6.630857786666667, 5.94007969, 7.38656521, 8.83305073, 10.27953625, 8.037984375, 5.7964325, 7.390300436666666, 8.984168373333333, 10.57803631, 8.898893993333333, 7.219751676666666, 5.54060936, 7.58588314, 9.631156919999999, 11.6764307, 10.516017434999998, 9.35560417, 10.443587619999999, 11.53157107, 12.61955452, 12.369870823333333, 12.120187126666666, 11.87050343, 12.398322426666667, 12.926141423333332, 13.45396042, 13.182222845, 12.91048527, 13.434092206666667, 13.957699143333333, 14.48130608, 14.527837436666667, 14.574368793333333, 14.62090015, 15.1951313, 15.76936245, 16.3435936, 16.303062439999998, 16.26253128, 16.37782669, 16.4931221, 16.60841751, 17.11819585, 17.62797419, 18.13775253, 18.314838406666667, 18.491924283333333, 18.66901016, 19.010305405, 19.35160065, 19.456803006666668, 19.562005363333334, 19.66720772, 19.635080973333334, 19.602954226666665, 19.57082748, 19.807815549999997, 20.04480362, 20.28179169, 20.637363434999997, 20.99293518, 21.047056196666666, 21.101177213333333, 21.15529823, 21.04657936, 20.937860490000002, 20.82914162, 20.820458733333336, 20.811775846666666, 20.80309296, 20.85691643, 20.9107399, 20.617842356666667, 20.32494481333333, 20.03204727, 20.02334531, 20.01464335, 20.00594139, 20.315189996666668, 20.62443860333333, 20.93368721, 18.59653091, 16.67791557, 17.34560712, 18.01329867, 18.68099022, 19.33479309, 19.98859596, 20.64239883, 20.20043055, 19.758462270000003, 19.31649399, 19.56401253, 19.81153107, 20.05904961, 20.006676993333333, 19.954304376666666, 19.90193176, 19.7339859, 19.56604004, 19.39809418, 19.466301603333335, 19.534509026666665, 19.60271645, 19.466698649999998, 19.33068085, 19.155085246666665, 18.979489643333334, 18.80389404, 18.565515516666665, 18.327136993333333, 18.08875847, 18.244107566666667, 18.399456663333332, 18.55480576, 18.47287941, 18.39095306, 18.118122733333333, 17.84529240666667, 17.57246208, 17.24058342, 16.908704760000003, 16.5768261, 17.117281600000002, 17.6577371, 18.1981926, 18.235832215, 18.27347183, 17.093578336666667, 15.913684843333334, 14.73379135, 15.749792096666667, 16.765792843333333, 17.78179359, 17.61583455, 17.449875510000002, 17.28391647, 17.51554012, 17.74716377, 16.732394533333334, 15.717625296666666, 14.70285606, 15.708664573333333, 16.714473086666665, 17.7202816, 17.561296463333335, 17.402311326666666, 17.24332619, 17.398386955, 17.55344772, 17.23837788666667, 16.923308053333333, 16.60823822, 16.64992141666667, 16.691604613333332, 16.73328781, 16.746699013333334, 16.760110216666668, 16.77352142, 16.72258949, 16.67165756, 16.597171783333334, 16.522686006666667, 16.44820023, 16.519129436666667, 16.590058643333336, 16.66098785, 16.53744761, 16.41390737, 16.29036713, 15.827209, 15.36405087, 15.68583616, 16.00762145, 16.32940674, 16.285558066666667, 16.241709393333334, 16.19786072, 15.389681183333334, 14.581501646666668, 13.77332211, 13.879855476666666, 13.986388843333334, 14.09292221, 14.340579349999999, 14.58823649, 14.83589363, 13.8578612, 12.87982877, 11.90179634, 13.135075886666668, 14.368355433333333, 15.60163498, 15.179097655, 14.75656033, 14.149904253333332, 13.543248176666667, 12.9365921, 13.81697273, 14.697353360000001, 15.57773399, 15.58256149, 15.20898914, 14.83541679, 14.300614355, 13.76581192, 13.877173106666667, 13.988534293333334, 14.09989548, 14.366209033333334, 14.632522586666667, 14.89883614, 15.039423626666666, 15.180011113333334, 15.3205986, 15.261620045, 15.20264149, 15.216588976666666, 15.230536463333333, 15.24448395, 15.168209713333333, 15.091935476666666, 15.01566124, 14.955401103333333, 14.895140966666666, 14.83488083, 14.858365059999999, 14.88184929, 14.90533352, 14.92881775, 14.95230198, 14.940321606666666, 14.928341233333333, 14.91636086, 14.801561993333333, 14.686763126666666, 14.57196426, 13.859402844, 13.146841428, 12.434280012, 11.721718596, 11.00915718, 12.10216713, 13.19517708, 14.28818703, 14.34059938, 14.39301173, 14.44542408, 14.227062700000001, 14.00870132, 13.942520140000001, 13.87633896, 13.81015778, 13.91635323, 14.02254868, 14.12874413, 14.08153725, 14.03433037, 13.98712349, 13.822108270000001, 13.65709305, 13.592282933333333, 13.527472816666666, 13.4626627, 13.333221436666665, 13.203780173333334, 13.07433891, 12.890021323333333, 12.705703736666667, 12.52138615, 12.58879916, 12.65621217, 12.72362518, 12.427250860000001, 12.13087654, 11.83450222, 11.021614073333334, 10.208725926666666, 9.39583778, 10.590076443333334, 11.784315106666666, 12.97855377];
const origCheckpoints = [70, 72, 74, 75, 78, 81, 83, 86, 89, 92, 94, 97, 100, 103, 105, 108, 111, 114, 116, 119, 120, 122, 125, 127, 130, 133, 136, 138, 141, 144, 147, 149, 152, 155, 158, 160, 163, 166, 169, 171, 174, 177, 180, 182, 185, 188, 191, 193, 196, 199, 202, 204, 207, 210, 213, 215, 218, 220, 221, 224, 226, 229, 232, 235, 238, 241, 244, 247, 249, 252, 255, 258, 260, 263, 266, 269, 271, 274, 277, 280, 282, 285, 288, 291, 293, 296, 299, 300, 302, 304, 307, 310, 313, 315, 318, 321, 324, 327, 330, 333, 336, 338, 341, 344, 347, 349, 352, 355, 358, 360, 363, 366, 369, 371, 374, 377, 380, 382, 385, 388, 391, 393, 396, 399, 400, 402, 404, 407, 410, 413, 416, 419, 422, 425, 427, 430, 433, 436, 438, 441, 444, 447, 449, 452, 455, 458, 460, 463, 466, 469, 471, 474, 477, 480, 482, 485, 488, 490, 491, 493, 496, 499, 502, 504, 507, 510, 513, 515, 518, 521, 524, 526, 529, 532, 535, 537, 540, 543, 546, 548, 551, 554, 557, 559, 562, 565, 568, 570, 573, 576, 579, 580, 581, 584, 587, 590, 593, 596, 599, 602, 604, 607, 610, 613, 615, 618, 621, 624, 626, 629, 632, 635, 637, 640, 643, 646, 648, 651, 654, 657, 659, 662, 665, 668, 670, 673, 676, 679, 682, 685, 688, 691, 693, 696, 699, 700, 702, 704, 707, 710, 713, 715, 718, 721, 724, 729, 732, 735, 740, 743, 746, 748, 751, 754, 757, 759, 762, 765, 768, 771, 774, 777, 780];
const origLlcValues = [-1.78009272, 0.31673908, 1.37144327, 1.66702271, 2.8912425, 3.07297707, 3.29166651, 3.47286463, 3.38643789, 2.30616331, 3.61090899, 2.98780203, 2.23249197, 3.66395712, 3.72320414, 2.66671181, 3.67498398, 3.24159861, 2.81566381, 3.16125154, 3.54754925, 3.862679, 2.43121386, 2.14916468, 3.57103348, 3.59606743, 3.11428308, 3.52215767, 3.88151407, 3.76713276, 3.89504433, 3.7099123, 3.42947245, 3.79097462, 3.8933754, 3.73446941, 3.48198414, 4.00316715, 3.20595503, 3.11750174, 3.59934568, 3.79633904, 4.04250622, 4.01860476, 4.06318903, 4.03130054, 4.04691696, 4.03374434, 4.13513184, 3.89575958, 3.62855196, 3.76147032, 3.93432379, 3.81344557, 3.5212636, 3.71944904, 3.80349159, 3.52632999, 3.69787216, 4.09179926, 4.20361757, 4.04560566, 3.85528803, 4.18782234, 4.16713953, 4.23073769, 4.13501263, 4.03052568, 3.88365984, 4.23532724, 3.51405144, 3.6290288, 4.21708822, 3.83937359, 3.89045477, 3.5623908, 3.695786, 3.9626956, 4.39691544, 4.25893068, 4.30440903, 4.39679623, 3.63999605, 3.97825241, 4.39745188, 4.37676907, 3.67301702, 3.5328269, 3.65531445, 4.19253111, 3.88413668, 4.07254696, 4.296422, 4.35763597, 3.71092558, 3.72201204, 4.28235531, 3.50064039, 4.27162647, 3.61430645, 3.65036726, 3.75694036, 4.27490473, 4.16815281, 4.41849232, 4.22644615, 4.25094366, 4.25493717, 4.24665213, 3.64071131, 3.8472414, 4.59176302, 3.75807285, 3.78268957, 4.43375111, 4.56267595, 4.23437357, 4.26274538, 4.68224287, 4.5670867, 4.38553095, 4.46307659, 4.7852993, 4.77403402, 4.82559204, 4.49824333, 4.43547964, 4.38082218, 4.86892462, 4.97657061, 5.00828028, 5.02181053, 4.59897518, 4.50408459, 5.13660908, 5.2626729, 5.2382946, 5.33568859, 5.32394648, 5.45066595, 5.52278757, 5.52326441, 5.38957119, 5.51062822, 5.61916828, 5.61541319, 5.91999292, 6.14053011, 6.44612312, 6.46662712, 6.62183762, 6.7230463, 7.04139471, 7.21877813, 7.36427307, 7.66980648, 7.27832317, 8.34453106, 8.46427727, 8.25506401, 8.01241398, 5.94007969, 10.27953625, 5.7964325, 10.57803631, 5.54060936, 11.6764307, 9.35560417, 12.61955452, 11.87050343, 13.45396042, 12.91048527, 14.48130608, 14.62090015, 16.3435936, 16.26253128, 16.60841751, 18.13775253, 18.66901016, 19.35160065, 19.66720772, 19.57082748, 20.28179169, 20.99293518, 21.15529823, 20.82914162, 20.80309296, 20.9107399, 20.03204727, 20.00594139, 20.93368721, 18.59653091, 16.67791557, 18.68099022, 20.64239883, 19.31649399, 20.05904961, 19.90193176, 19.39809418, 19.60271645, 19.33068085, 18.80389404, 18.08875847, 18.55480576, 18.39095306, 17.57246208, 16.5768261, 18.1981926, 18.27347183, 14.73379135, 17.78179359, 17.28391647, 17.74716377, 14.70285606, 17.7202816, 17.24332619, 17.55344772, 16.60823822, 16.73328781, 16.77352142, 16.67165756, 16.44820023, 16.66098785, 16.29036713, 15.36405087, 16.32940674, 16.19786072, 13.77332211, 14.09292221, 14.83589363, 11.90179634, 15.60163498, 14.75656033, 12.9365921, 15.57773399, 15.58256149, 14.83541679, 13.76581192, 14.09989548, 14.89883614, 15.3205986, 15.20264149, 15.24448395, 15.01566124, 14.83488083, 14.95230198, 14.91636086, 14.57196426, 11.00915718, 14.28818703, 14.44542408, 14.00870132, 13.81015778, 14.12874413, 13.98712349, 13.65709305, 13.4626627, 13.07433891, 12.52138615, 12.72362518, 11.83450222, 9.39583778, 12.97855377];
const validRange = [70, 780];
// Image storage from ZIP extraction
let imageDataUrls = []; // Will store data URLs for each image
let imagesExtracted = false;
// State
let currentFrame = 0;
let isPlaying = false;
let playInterval = null;
let fps = 5; // frames per second
let playSpeed = 1000/fps; // milliseconds between frames
let repeatMode = true; // repeat by default
// DOM elements
const img = document.getElementById('actionImage');
const slider = document.getElementById('frameSlider');
const frameInfo = document.getElementById('frameInfo');
const playBtn = document.getElementById('playBtn');
const currentLLCEl = document.getElementById('currentLLC');
const minLLCEl = document.getElementById('minLLC');
const maxLLCEl = document.getElementById('maxLLC');
const speedInfo = document.getElementById('speedInfo');
const repeatBtn = document.getElementById('repeatBtn');
const fpsSlider = document.getElementById('fpsSlider');
// Loading elements
const loadingOverlay = document.getElementById('loadingOverlay');
const mainContent = document.getElementById('mainContent');
const progressBar = document.getElementById('progressBar');
const progressText = document.getElementById('progressText');
// Function to format number with SI prefixes
function formatWithSI(value) {
const prefixes = [
{ value: 1e-12, symbol: 'p' },
{ value: 1e-9, symbol: 'n' },
{ value: 1e-6, symbol: 'µ' },
{ value: 1e-3, symbol: 'm' },
{ value: 1, symbol: '' },
{ value: 1e3, symbol: 'k' },
{ value: 1e6, symbol: 'M' },
{ value: 1e9, symbol: 'G' }
];
const absValue = Math.abs(value);
let selectedPrefix = prefixes[4]; // Default to no prefix
// Find appropriate prefix
for (let i = 0; i < prefixes.length - 1; i++) {
if (absValue >= prefixes[i].value && absValue < prefixes[i + 1].value) {
selectedPrefix = prefixes[i];
break;
}
}
// Handle largest values
if (absValue >= prefixes[prefixes.length - 1].value) {
selectedPrefix = prefixes[prefixes.length - 1];
}
const scaledValue = value / selectedPrefix.value;
const rounded = Math.round(scaledValue * 1000) / 1000; // 3 decimal places
return rounded.toFixed(3) + selectedPrefix.symbol;
}
// Calculate LLC stats (only for valid range)
const minLLC = Math.min(...validLlcValues);
const maxLLC = Math.max(...validLlcValues);
minLLCEl.textContent = formatWithSI(minLLC);
maxLLCEl.textContent = formatWithSI(maxLLC);
// Initialize plot
function initPlot() {
const trace1 = {
x: validCheckpoints,
y: validLlcValues,
type: 'scatter',
mode: 'lines',
name: 'Interpolated LLC',
line: { color: '#1f77b4', width: 2 },
hovertemplate: 'Checkpoint: %{x}<br>LLC: %{y:.3g}<extra></extra>'
};
const trace2 = {
x: origCheckpoints,
y: origLlcValues,
type: 'scatter',
mode: 'markers',
name: 'Actual Data Points',
marker: {
color: '#ff7f0e',
size: 6,
symbol: 'circle'
},
hovertemplate: 'Checkpoint: %{x}<br>LLC: %{y:.3g}<br>(Actual)<extra></extra>'
};
const trace3 = {
x: [validRange[0]],
y: [validLlcValues[0]],
type: 'scatter',
mode: 'markers',
name: 'Current Position',
marker: {
color: '#d62728',
size: 10,
symbol: 'circle'
},
hovertemplate: 'Current: %{x}<br>LLC: %{y:.3g}<extra></extra>',
visible: false // Initially hidden
};
const layout = {
title: `Local Learning Coefficient vs Checkpoint (Range: ${validRange[0]}-${validRange[1]})`,
xaxis: {
title: 'Checkpoint',
range: [validRange[0] - 10, validRange[1] + 10] // Slight padding
},
yaxis: { title: 'Local Learning Coefficient' },
hovermode: 'closest',
showlegend: false,
margin: { l: 60, r: 20, t: 60, b: 60 }
};
Plotly.newPlot('llcPlot', [trace1, trace2, trace3], layout, {responsive: true});
}
function updatePlot() {
const currentLLC = allLlcValues[currentFrame];
if (currentLLC !== null && currentFrame >= validRange[0] && currentFrame <= validRange[1]) {
// Show the current position marker
Plotly.restyle('llcPlot', {
'x': [[currentFrame]],
'y': [[currentLLC]],
'visible': [true]
}, [2]);
// Update current LLC display
currentLLCEl.textContent = formatWithSI(currentLLC);
} else {
// Hide the current position marker and show "No data"
Plotly.restyle('llcPlot', {
'visible': [false]
}, [2]);
currentLLCEl.textContent = "No Data";
}
}
function updateImage() {
if (imagesExtracted && currentFrame < imageDataUrls.length && imageDataUrls[currentFrame]) {
img.src = imageDataUrls[currentFrame];
}
slider.value = currentFrame;
const llcStatus = allLlcValues[currentFrame] !== null ? `Checkpoint ${currentFrame}` : `Checkpoint ${currentFrame} (No LLC data)`;
frameInfo.textContent = `Frame: ${currentFrame} / ${allCheckpoints.length-1} (${llcStatus})`;
updatePlot();
}
function setFrame(frame) {
currentFrame = Math.max(0, Math.min(allCheckpoints.length-1, frame));
updateImage();
}
function nextFrame() {
setFrame(currentFrame + 1);
}
function prevFrame() {
setFrame(currentFrame - 1);
}
function togglePlay() {
if (isPlaying) {
clearInterval(playInterval);
playBtn.textContent = '▶ Play';
isPlaying = false;
} else {
playInterval = setInterval(() => {
if (currentFrame >= allCheckpoints.length - 1) {
if (repeatMode) {
setFrame(0); // Loop back to start
} else {
// Stop at end
clearInterval(playInterval);
playBtn.textContent = '▶ Play';
isPlaying = false;
}
} else {
nextFrame();
}
}, playSpeed);
playBtn.textContent = '⏸ Pause';
isPlaying = true;
}
}
// Convert slider position (0-100) to FPS (1-60) on log scale
function sliderToFPS(sliderValue) {
// Map 0-100 to roughly logarithmic 1-60 FPS
// Using exponential mapping: fps = 1 + (60-1) * ((e^(x/25) - 1) / (e^4 - 1))
const normalizedValue = sliderValue / 100; // 0 to 1
const expValue = Math.exp(normalizedValue * 4); // 1 to e^4
const fps = 1 + (60 - 1) * ((expValue - 1) / (Math.exp(4) - 1));
return Math.round(fps);
}
// Convert FPS back to slider position for initialization
function fpsToSlider(targetFPS) {
// Inverse of the above function
const normalizedFPS = (targetFPS - 1) / (60 - 1);
const expPart = normalizedFPS * (Math.exp(4) - 1) + 1;
const logValue = Math.log(expPart) / 4;
return Math.round(logValue * 100);
}
function updateFPSFromSlider() {
fps = sliderToFPS(parseInt(fpsSlider.value));
playSpeed = 1000 / fps;
updateSpeedDisplay();
if (isPlaying) {
togglePlay();
togglePlay();
}
}
function updateSpeedDisplay() {
speedInfo.textContent = `${fps} FPS`;
}
function toggleRepeat() {
repeatMode = !repeatMode;
if (repeatMode) {
repeatBtn.textContent = '🔄 Repeat';
repeatBtn.style.backgroundColor = '#007bff';
} else {
repeatBtn.textContent = '⏹ Stop at End';
repeatBtn.style.backgroundColor = '#dc3545';
}
}
function updateRepeatDisplay() {
if (repeatMode) {
repeatBtn.textContent = '🔄 Repeat';
repeatBtn.style.backgroundColor = '#007bff';
} else {
repeatBtn.textContent = '⏹ Stop at End';
repeatBtn.style.backgroundColor = '#dc3545';
}
}
// Event listeners
slider.addEventListener('input', function() {
setFrame(parseInt(this.value));
});
fpsSlider.addEventListener('input', updateFPSFromSlider);
// Keyboard controls
document.addEventListener('keydown', function(e) {
switch(e.key) {
case 'ArrowRight':
nextFrame();
break;
case 'ArrowLeft':
prevFrame();
break;
case ' ':
e.preventDefault();
togglePlay();
break;
}
});
// ZIP download and extraction functions
async function downloadAndExtractImages() {
try {
console.log(`Downloading ZIP file: ${zipFilePath}`);
progressText.textContent = 'Downloading image archive...';
progressBar.style.width = '10%';
// Download ZIP file with progress tracking
const response = await fetch(zipFilePath);
if (!response.ok) {
throw new Error(`Failed to download ZIP: ${response.status} ${response.statusText}`);
}
const totalSize = parseInt(response.headers.get('content-length') || '0');
let downloadedSize = 0;
const reader = response.body.getReader();
const chunks = [];
while (true) {
const { done, value } = await reader.read();
if (done) break;
chunks.push(value);
downloadedSize += value.length;
if (totalSize > 0) {
const downloadProgress = Math.min(50, (downloadedSize / totalSize) * 50);
progressBar.style.width = `${downloadProgress}%`;
progressText.textContent = `Downloading: ${Math.round((downloadedSize / totalSize) * 100)}%`;
}
}
progressText.textContent = 'Download complete, extracting images...';
progressBar.style.width = '60%';
// Combine chunks into single array buffer
const zipArrayBuffer = new Uint8Array(chunks.reduce((acc, chunk) => acc + chunk.length, 0));
let offset = 0;
for (const chunk of chunks) {
zipArrayBuffer.set(chunk, offset);
offset += chunk.length;
}
// Extract images from ZIP
const zip = await JSZip.loadAsync(zipArrayBuffer.buffer);
const imageFiles = Object.keys(zip.files).filter(name => name.endsWith('.png')).sort();
console.log(`Extracting ${imageFiles.length} images from ZIP...`);
imageDataUrls = new Array(totalImages);
for (let i = 0; i < imageFiles.length; i++) {
const file = zip.files[imageFiles[i]];
const blob = await file.async('blob');
const dataUrl = await new Promise(resolve => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.readAsDataURL(blob);
});
imageDataUrls[i] = dataUrl;
// Update progress
const extractProgress = 60 + (i / imageFiles.length) * 35;
progressBar.style.width = `${extractProgress}%`;
progressText.textContent = `Extracted ${i + 1} / ${imageFiles.length} images`;
// Yield control occasionally to keep UI responsive
if (i % 50 === 0) {
await new Promise(resolve => setTimeout(resolve, 10));
}
}
imagesExtracted = true;
console.log(`Successfully extracted ${imageFiles.length} images`);
onAllImagesLoaded();
} catch (error) {
console.error('Failed to download/extract images:', error);
let errorMsg = error.message;
// Provide helpful message for common local file access issues
if (error.message.includes('Failed to fetch') && window.location.protocol === 'file:') {
errorMsg = 'Cannot load images when opening HTML file directly. Please serve via HTTP (e.g., python -m http.server) or deploy to GitHub Pages.';
}
progressText.textContent = `Error: ${errorMsg}`;
progressBar.style.backgroundColor = '#dc3545';
throw error;
}
}
function onAllImagesLoaded() {
progressText.textContent = `All ${totalImages} images ready! Starting viewer...`;
progressBar.style.width = '100%';
// Small delay to show completion
setTimeout(() => {
loadingOverlay.style.display = 'none';
mainContent.classList.add('loaded');
// Initialize the app
initPlot();
updateImage();
// Set initial FPS slider position for 5 FPS
fpsSlider.value = fpsToSlider(5);
updateSpeedDisplay();
updateRepeatDisplay();
console.log('LLC Viewer ready!');
}, 500);
}
// Start ZIP download and extraction when page loads
window.onload = function() {
downloadAndExtractImages();
};
</script>
</body>
</html>