maxidl commited on
Commit
a1fc6bd
·
verified ·
1 Parent(s): 886012a

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +50 -20
index.html CHANGED
@@ -403,9 +403,18 @@
403
 
404
  async function loadModels() {
405
  ALL_MODELS = await query(`
406
- SELECT DISTINCT model, model_display_name, is_checkpoint
407
- FROM scores
408
- ORDER BY is_checkpoint DESC, model_display_name
 
 
 
 
 
 
 
 
 
409
  `);
410
 
411
  // Assign colors: config overrides first, then fallback palette
@@ -591,17 +600,19 @@
591
  const tip = name.dataset.missingTip;
592
  if (!tip) return;
593
  const tooltip = document.getElementById('custom-tooltip');
594
- tooltip.textContent = tip;
595
- tooltip.classList.remove('scrollable');
596
  tooltip.style.display = 'block';
 
597
  const rect = name.getBoundingClientRect();
598
  tooltip.style.left = (rect.left) + 'px';
599
  tooltip.style.top = (rect.bottom + 4) + 'px';
600
  });
601
  name.addEventListener('mouseleave', () => {
602
  const tooltip = document.getElementById('custom-tooltip');
603
- if (!tooltip.classList.contains('scrollable')) {
604
  tooltip.style.display = 'none';
 
605
  }
606
  });
607
 
@@ -889,32 +900,45 @@
889
  const rootKeys = Object.keys(subtaskTree).filter(k => !allChildren.has(k));
890
  const html = this.renderSubtaskTree(subtaskTree, rootKeys);
891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
892
  this._titleClick = (e) => {
893
  // Toggle: if already visible for this panel, hide it
894
  if (tooltip.style.display === 'block' && tooltip._panelId === this.id) {
895
  tooltip.style.display = 'none';
896
  tooltip.classList.remove('scrollable');
897
  tooltip._panelId = null;
 
898
  return;
899
  }
900
  tooltip.innerHTML = html;
901
  tooltip.classList.add('scrollable');
902
  tooltip.style.display = 'block';
903
  tooltip._panelId = this.id;
904
- // Position: top-left of tooltip below bottom-left of title text
905
- const titleEl = this.el.chart.querySelector('.gtitle');
906
- const chartRect = this.el.chart.getBoundingClientRect();
907
- const tw = tooltip.offsetWidth;
908
- if (titleEl) {
909
- const titleRect = titleEl.getBoundingClientRect();
910
- const titleCenter = (titleRect.left + titleRect.right) / 2;
911
- tooltip.style.left = (titleCenter - tw / 2) + 'px';
912
- tooltip.style.top = (titleRect.bottom + 4) + 'px';
913
- } else {
914
- tooltip.style.left = (chartRect.left + chartRect.width / 2 - tw / 2) + 'px';
915
- tooltip.style.top = (chartRect.top + 40) + 'px';
916
  }
917
- tooltip.style.maxHeight = chartRect.height + 'px';
918
  };
919
 
920
  this._titleOutsideClick = (e) => {
@@ -923,6 +947,7 @@
923
  tooltip.style.display = 'none';
924
  tooltip.classList.remove('scrollable');
925
  tooltip._panelId = null;
 
926
  };
927
 
928
  hoverZone.addEventListener('click', this._titleClick);
@@ -977,6 +1002,10 @@
977
  hz.style.display = 'none';
978
  this._titleClick = null;
979
  }
 
 
 
 
980
  if (this._titleOutsideClick) {
981
  document.removeEventListener('mousedown', this._titleOutsideClick);
982
  this._titleOutsideClick = null;
@@ -1087,7 +1116,8 @@
1087
  const annotations = names.map((name, i) => ({
1088
  x: 0,
1089
  y: name,
1090
- text: 'tokens trained: ' + tokens[i],
 
1091
  xanchor: 'left',
1092
  yanchor: 'middle',
1093
  showarrow: false,
 
403
 
404
  async function loadModels() {
405
  ALL_MODELS = await query(`
406
+ WITH raw AS (
407
+ SELECT DISTINCT model, model_display_name, is_checkpoint
408
+ FROM scores
409
+ ),
410
+ ckpt_models AS (
411
+ SELECT model FROM raw WHERE is_checkpoint = true
412
+ )
413
+ SELECT r.model, r.model_display_name, r.is_checkpoint
414
+ FROM raw r
415
+ WHERE r.is_checkpoint = true
416
+ OR r.model NOT IN (SELECT model FROM ckpt_models)
417
+ ORDER BY r.is_checkpoint DESC, r.model_display_name
418
  `);
419
 
420
  // Assign colors: config overrides first, then fallback palette
 
600
  const tip = name.dataset.missingTip;
601
  if (!tip) return;
602
  const tooltip = document.getElementById('custom-tooltip');
603
+ if (tooltip.classList.contains('scrollable')) return;
604
+ tooltip.innerHTML = tip;
605
  tooltip.style.display = 'block';
606
+ tooltip._modelTip = true;
607
  const rect = name.getBoundingClientRect();
608
  tooltip.style.left = (rect.left) + 'px';
609
  tooltip.style.top = (rect.bottom + 4) + 'px';
610
  });
611
  name.addEventListener('mouseleave', () => {
612
  const tooltip = document.getElementById('custom-tooltip');
613
+ if (tooltip._modelTip) {
614
  tooltip.style.display = 'none';
615
+ tooltip._modelTip = false;
616
  }
617
  });
618
 
 
900
  const rootKeys = Object.keys(subtaskTree).filter(k => !allChildren.has(k));
901
  const html = this.renderSubtaskTree(subtaskTree, rootKeys);
902
 
903
+ const positionTooltip = () => {
904
+ const titleEl = this.el.chart.querySelector('.gtitle');
905
+ const chartRect = this.el.chart.getBoundingClientRect();
906
+ const tw = tooltip.offsetWidth;
907
+ let tipTop;
908
+ if (titleEl) {
909
+ const titleRect = titleEl.getBoundingClientRect();
910
+ const titleCenter = (titleRect.left + titleRect.right) / 2;
911
+ tooltip.style.left = (titleCenter - tw / 2) + 'px';
912
+ tipTop = titleRect.bottom + 4;
913
+ } else {
914
+ tooltip.style.left = (chartRect.left + chartRect.width / 2 - tw / 2) + 'px';
915
+ tipTop = chartRect.top + 40;
916
+ }
917
+ tooltip.style.top = tipTop + 'px';
918
+ tooltip.style.maxHeight = Math.max(0, chartRect.bottom - tipTop) + 'px';
919
+ };
920
+
921
  this._titleClick = (e) => {
922
  // Toggle: if already visible for this panel, hide it
923
  if (tooltip.style.display === 'block' && tooltip._panelId === this.id) {
924
  tooltip.style.display = 'none';
925
  tooltip.classList.remove('scrollable');
926
  tooltip._panelId = null;
927
+ window.removeEventListener('scroll', this._titleScroll, true);
928
  return;
929
  }
930
  tooltip.innerHTML = html;
931
  tooltip.classList.add('scrollable');
932
  tooltip.style.display = 'block';
933
  tooltip._panelId = this.id;
934
+ positionTooltip();
935
+ window.addEventListener('scroll', this._titleScroll, true);
936
+ };
937
+
938
+ this._titleScroll = () => {
939
+ if (tooltip.style.display === 'block' && tooltip._panelId === this.id) {
940
+ positionTooltip();
 
 
 
 
 
941
  }
 
942
  };
943
 
944
  this._titleOutsideClick = (e) => {
 
947
  tooltip.style.display = 'none';
948
  tooltip.classList.remove('scrollable');
949
  tooltip._panelId = null;
950
+ window.removeEventListener('scroll', this._titleScroll, true);
951
  };
952
 
953
  hoverZone.addEventListener('click', this._titleClick);
 
1002
  hz.style.display = 'none';
1003
  this._titleClick = null;
1004
  }
1005
+ if (this._titleScroll) {
1006
+ window.removeEventListener('scroll', this._titleScroll, true);
1007
+ this._titleScroll = null;
1008
+ }
1009
  if (this._titleOutsideClick) {
1010
  document.removeEventListener('mousedown', this._titleOutsideClick);
1011
  this._titleOutsideClick = null;
 
1116
  const annotations = names.map((name, i) => ({
1117
  x: 0,
1118
  y: name,
1119
+ text: tokens[i],
1120
+ hovertext: 'Tokens Trained',
1121
  xanchor: 'left',
1122
  yanchor: 'middle',
1123
  showarrow: false,