Spaces:
Running
Running
File size: 10,217 Bytes
ab64d97 76e67fa ab64d97 0727c42 76e67fa 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 e4f837a 20d431a 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 20d431a 0727c42 20d431a ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 20d431a 0727c42 ab64d97 0727c42 ab64d97 719f263 ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 ab64d97 0727c42 719f263 20d431a 719f263 0727c42 20d431a ab64d97 20d431a ab64d97 |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ready, Xet, Go!</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="hero-band">
<div class="hero-content">
<img src="huggie.png" alt="Huggie" class="hero-logo hero-logo-left">
<div class="hero-text">
<h1 class="hero-title">Ready, Xet, Go!</h1>
<p class="hero-subtitle">At the speed of chunks</p>
</div>
<img src="rockxet.png" alt="RockXet" class="hero-logo hero-logo-right">
</div>
</div>
<div class="container">
<div class="stats-card">
<div class="card">
<h2>Xet Migration Progress</h2>
<div class="progress-container">
<div class="progress-bar" id="progressBar">0%</div>
</div>
</div>
</div>
<div class="container">
<div class="counter-wrapper">
<div class="counter-container" id="counter"></div>
<div class="counter-text" id="counterText" style="opacity: 0; transition: opacity 1s ease-in;">
in <img src="xet.png" alt="Xet" class="xet-logo">
</div>
</div>
</div>
<div class="charts-container">
<div class="chart-card">
<div class="card">
<h2>Repos Migrated to Xet</h2>
<div class="chart-container">
<canvas id="progressChart"></canvas>
</div>
</div>
</div>
<div class="chart-card">
<div class="card">
<h2>LFS vs. Xet Files</h2>
<div class="chart-container">
<canvas id="largeFilesChart"></canvas>
</div>
</div>
</div>
</div>
<script>
const REPO_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/repo-progress.csv';
const FILE_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/file-progress.csv';
const BYTES_CSV_URL = 'https://huggingface.co/datasets/jsulz/ready-xet-go/resolve/main/bytes-progress.csv';
(async () => {
/*
* Data fetching and parsing
*/
const repo_rows = [];
const file_rows = [];
const bytes_rows = [];
const repo_csv = await new Promise((resolve, reject) => {
Papa.parse(REPO_CSV_URL, {
download: true,
header : true,
complete: resolve,
error : reject
});
});
repo_csv.data.forEach(row => {
if (row.date && row.xet_repos && row.hub_repos) {
repo_rows.push({
date: new Date(row.date),
xet_repos: parseInt(row.xet_repos, 10),
hub_repos: parseInt(row.hub_repos, 10)
});
}
});
const file_csv = await new Promise((resolve, reject) => {
Papa.parse(FILE_CSV_URL, {
download: true,
header : true,
complete: resolve,
error : reject
});
});
file_csv.data.forEach(row => {
if (row.date && row.lfs_files && row.xet_files) {
file_rows.push({
date: new Date(row.date),
lfs_files: parseInt(row.lfs_files, 10),
xet_files: parseInt(row.xet_files, 10)
});
}
});
const bytes_csv = await new Promise((resolve, reject) => {
Papa.parse(BYTES_CSV_URL, {
download: true,
header : true,
complete: resolve,
error : reject
});
});
bytes_csv.data.forEach(row => {
if (row.date && row.bytes) {
bytes_rows.push({
date: new Date(row.date),
bytes: parseInt(row.bytes, 10)
});
}
});
/*
* Progress Bar
*/
// Progress Bar Constants
const max_value = 100;
const current_status = Math.round((repo_rows[repo_rows.length - 1].xet_repos / repo_rows[repo_rows.length - 1].hub_repos) * max_value);
// Animate Progress Bar - increments smoothly every 50ms
const progressBar = document.getElementById('progressBar');
let currentProgress = 0;
function animateProgressBar() {
if (currentProgress < current_status) {
currentProgress++;
progressBar.style.width = `${currentProgress}%`;
progressBar.textContent = `${currentProgress}%`;
setTimeout(animateProgressBar, 75);
}
}
animateProgressBar();
/*
* Charts
*/
//
// Line chart for repo migration progress
//
// Set up chart data
const maxCount = Math.max(
...repo_rows.map(row => row.xet_repos),
);
const dataPoints = repo_rows.map(row => ({
date: row.date,
value: row.xet_repos
}));
// Format date for display (MMM D YYYY)
function formatDate(dateStr) {
return new Date(dateStr).toLocaleDateString('en-US', {
year: 'numeric', month: 'short', day: 'numeric'
});
}
// Initialize line chart
const lineChartCtx = document.getElementById('progressChart').getContext('2d');
let lineChart = new Chart(lineChartCtx, {
type: 'line',
data: {
labels: dataPoints.map(point => formatDate(point.date)),
datasets: [{
label: 'Repos Migrated',
data: dataPoints.map(point => point.value),
borderColor: '#7875FF',
backgroundColor: 'rgba(255, 127, 65, 1)',
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
animation: { duration: 2000 },
scales: {
y: {
min: 0,
ticks: { stepSize: 100000 }
},
x: {
ticks: {
maxTicksLimit: 20
}
},
},
plugins: {
tooltip: {
callbacks: {
label: function(context) {
return `Repos Migrated: ${context.parsed.y.toLocaleString()}`;
}
}
}
}
}
});
//
// Donut chart for large files
//
// Set up donut chart data
const lfs_file_count = file_rows[file_rows.length - 1].lfs_files;
const xet_file_count = file_rows[file_rows.length - 1].xet_files;
// Initialize donut chart
const donutChartCtx = document.getElementById('largeFilesChart').getContext('2d');
let donutChart = new Chart(donutChartCtx, {
type: 'doughnut',
data: {
labels: [
'LFS Files',
'Xet Files',
],
datasets: [{
label: 'My First Dataset',
data: [lfs_file_count, xet_file_count],
backgroundColor: [
'oklch(0.577 0.245 27.325 / 75.56%)',
'oklch(0.6361 0.1994 280.07 / 71.37%)',
],
hoverOffset: 4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
animation: { duration: 2000 },
plugins: {
legend: {
position: 'top',
},
}
}
});
/*
* Counter
*/
// 5x7 pixel patterns for each character (1=pixel on, 0=pixel off)
const patterns = {
'1': [
'00100',
'01100',
'00100',
'00100',
'00100',
'00100',
'01110'
],
'2': [
'01110',
'10001',
'00001',
'00010',
'00100',
'01000',
'11111'
],
'3': [
'01110',
'10001',
'00001',
'00110',
'00001',
'10001',
'01110'
],
'4': [
'00010',
'00110',
'01010',
'10010',
'11111',
'00010',
'00010'
],
'5': [
'11111',
'10000',
'10000',
'11110',
'00001',
'10001',
'01110'
],
'6': [
'01110',
'10001',
'10000',
'11110',
'10001',
'10001',
'01110'
],
'7': [
'11111',
'00001',
'00010',
'00100',
'01000',
'01000',
'01000'
],
'8': [
'01110',
'10001',
'10001',
'01110',
'10001',
'10001',
'01110'
],
'9': [
'01110',
'10001',
'10001',
'01111',
'00001',
'10001',
'01110'
],
'0': [
'01110',
'10001',
'10001',
'10001',
'10001',
'10001',
'01110'
],
'.': [
'00000',
'00000',
'00000',
'00000',
'00000',
'00100',
'01110'
],
'P': [
'11110',
'10001',
'10001',
'11110',
'10000',
'10000',
'10000'
],
'B': [
'11110',
'10001',
'10001',
'11110',
'10001',
'10001',
'11110'
]
};
console.log(bytes_rows[bytes_rows.length - 1].bytes)
// Convert bytes to PB and format as string
const bytesInPB = 1024 ** 5;
// Calculate the number of PBs and round to 2 decimal places
const text = (bytes_rows[bytes_rows.length - 1].bytes / bytesInPB).toFixed(2) + 'PB';
console.log(text)
const container = document.getElementById('counter');
const pixelSize = 5; // Match CSS variable
const pixelGap = 1;
let allPixels = [];
// Create characters and their pixels
text.split('').forEach((char, charIndex) => {
const charDiv = document.createElement('div');
charDiv.className = 'character';
const pattern = patterns[char];
if (!pattern) return;
// Generate pixels based on pattern
pattern.forEach((row, rowIndex) => {
row.split('').forEach((cell, colIndex) => {
if (cell === '1') {
const pixel = document.createElement('div');
pixel.className = 'pixel';
// Calculate final position within character grid
const finalX = colIndex * (pixelSize + pixelGap);
const finalY = rowIndex * (pixelSize + pixelGap);
pixel.style.left = `${finalX}px`;
pixel.style.top = `${finalY}px`;
charDiv.appendChild(pixel);
allPixels.push(pixel);
}
});
});
container.appendChild(charDiv);
});
console.log(allPixels)
// Animate pixels falling into their final positions
allPixels.forEach((pixel, index) => {
// Stagger the landing times for a cascading effect
const delay = Math.random() * 50 + (index * 50);
setTimeout(() => {
pixel.classList.add('landed');
}, delay);
});
const maxDelay = Math.max(...allPixels.map((_, index) => Math.random() * 50 + (index * 50)));
setTimeout(() => {
const textDiv = document.getElementById('counterText');
textDiv.style.opacity = '1';
}, maxDelay + 500);
})();
</script>
</body>
</html> |