prithivMLmods commited on
Commit
91b6b3e
·
verified ·
1 Parent(s): eac8670

update app

Browse files
Files changed (1) hide show
  1. index.html +34 -28
index.html CHANGED
@@ -1363,41 +1363,47 @@
1363
  }
1364
  }
1365
 
 
 
 
 
 
 
 
 
 
 
1366
  // Header
1367
  if (avatarBase64) {
1368
- doc.addImage(avatarBase64, 'JPEG', 14, 12, 16, 16);
1369
  doc.setFontSize(22);
1370
- doc.text(`HuggingFace Activity Report: ${fullname}`, 34, 24);
 
 
1371
  } else {
1372
  doc.setFontSize(22);
1373
- doc.text(`HuggingFace Activity Report: ${fullname}`, 14, 24);
 
 
1374
  }
1375
 
1376
- doc.setFontSize(12);
1377
- doc.text(`Username: @${u}`, 14, 34);
1378
- doc.text(`Followers: ${p?.numFollowers ?? 0} | Organizations: ${Array.isArray(p?.orgs) ? p.orgs.length : 0}`, 14, 42);
1379
-
1380
- const totalModels = state.models.length;
1381
- const totalDatasets = state.datasets.length;
1382
- const totalSpaces = state.spaces.length;
1383
-
1384
- const totalModelDl = state.models.reduce((s, m) => s + getLifetimeDownloads(m), 0);
1385
- const totalDatasetDl = state.datasets.reduce((s, d) => s + getLifetimeDownloads(d), 0);
1386
- const totalLikes = [...state.models, ...state.datasets, ...state.spaces].reduce((s, i) => s + getItemLikes(i), 0);
1387
-
1388
- doc.text(`Total Models: ${totalModels} (Downloads: ${formatNumFull(totalModelDl)})`, 14, 46);
1389
- doc.text(`Total Datasets: ${totalDatasets} (Downloads: ${formatNumFull(totalDatasetDl)})`, 14, 54);
1390
- doc.text(`Total Spaces: ${totalSpaces}`, 14, 62);
1391
- doc.text(`Total Likes Received: ${formatNumFull(totalLikes)}`, 14, 70);
1392
-
1393
- let startY = 80;
1394
-
1395
- const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
1396
- doc.text(`Downloads Last 30 Days: ${formatNumFull(totalDlMonthly)}`, 14, 78);
1397
-
1398
- const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
1399
- doc.text(`Total Private Repositories: ${totalPrivate}`, 14, 86);
1400
- startY = 96;
1401
 
1402
  const pipelineCounts = {};
1403
  state.models.forEach(m => {
 
1363
  }
1364
  }
1365
 
1366
+ const totalModels = state.models.length;
1367
+ const totalDatasets = state.datasets.length;
1368
+ const totalSpaces = state.spaces.length;
1369
+
1370
+ const totalModelDl = state.models.reduce((s, m) => s + getLifetimeDownloads(m), 0);
1371
+ const totalDatasetDl = state.datasets.reduce((s, d) => s + getLifetimeDownloads(d), 0);
1372
+ const totalLikes = [...state.models, ...state.datasets, ...state.spaces].reduce((s, i) => s + getItemLikes(i), 0);
1373
+ const totalDlMonthly = state.models.reduce((s, m) => s + getMonthlyDownloads(m), 0) + state.datasets.reduce((s, d) => s + getMonthlyDownloads(d), 0);
1374
+ const totalPrivate = [...state.models, ...state.datasets, ...state.spaces].filter(i => i.private).length;
1375
+
1376
  // Header
1377
  if (avatarBase64) {
1378
+ doc.addImage(avatarBase64, 'JPEG', 14, 12, 18, 18);
1379
  doc.setFontSize(22);
1380
+ doc.text(`HuggingFace Activity Report`, 36, 20);
1381
+ doc.setFontSize(14);
1382
+ doc.text(fullname, 36, 28);
1383
  } else {
1384
  doc.setFontSize(22);
1385
+ doc.text(`HuggingFace Activity Report`, 14, 20);
1386
+ doc.setFontSize(14);
1387
+ doc.text(fullname, 14, 28);
1388
  }
1389
 
1390
+ let startY = 36;
1391
+
1392
+ doc.autoTable({
1393
+ startY: startY,
1394
+ head: [['Profile Summary', 'Value', 'Statistics', 'Value']],
1395
+ body: [
1396
+ ['Username', `@${u}`, 'Total Likes', formatNumFull(totalLikes)],
1397
+ ['Followers', formatNumFull(p?.numFollowers ?? 0), 'Total Downloads', formatNumFull(totalModelDl + totalDatasetDl)],
1398
+ ['Organizations', Array.isArray(p?.orgs) ? p.orgs.length.toString() : '0', 'Downloads (Last 30 Days)', formatNumFull(totalDlMonthly)],
1399
+ ['Total Models', totalModels.toString(), 'Total Datasets', totalDatasets.toString()],
1400
+ ['Total Spaces', totalSpaces.toString(), 'Private Repositories', totalPrivate.toString()]
1401
+ ],
1402
+ theme: 'grid',
1403
+ headStyles: { fillColor: [51, 51, 51] },
1404
+ styles: { fontSize: 11, cellPadding: 4 }
1405
+ });
1406
+ startY = doc.lastAutoTable.finalY + 10;
 
 
 
 
 
 
 
 
1407
 
1408
  const pipelineCounts = {};
1409
  state.models.forEach(m => {