maxidl commited on
Commit
991a3e5
·
verified ·
1 Parent(s): 1257f25

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +11 -8
index.html CHANGED
@@ -1404,16 +1404,24 @@
1404
  const startW = this.el.panel.offsetWidth;
1405
  this.el.widthHandle.classList.add('active');
1406
 
 
 
 
 
 
 
1407
  const onMove = (ev) => {
1408
  const newW = Math.max(300, startW + ev.clientX - startX);
1409
  this.el.panel.style.width = newW + 'px';
1410
- window.dispatchEvent(new Event('resize'));
1411
  };
1412
 
1413
  const onUp = () => {
1414
  this.el.widthHandle.classList.remove('active');
1415
  document.removeEventListener('mousemove', onMove);
1416
  document.removeEventListener('mouseup', onUp);
 
 
 
1417
  };
1418
 
1419
  document.addEventListener('mousemove', onMove);
@@ -1828,13 +1836,8 @@
1828
  elInitLoading.style.display = 'none';
1829
  elAddPanelRow.style.display = '';
1830
 
1831
- // Create 2x2 default panels
1832
- await Promise.all([
1833
- addPanel({ suite: 'eng_base_full', metric: 'bits_per_byte' }),
1834
- addPanel({ suite: 'deu_base_full', metric: 'bits_per_byte' }),
1835
- addPanel({ suite: 'eng_base_full', metric: 'acc_norm' }),
1836
- addPanel({ suite: 'deu_base_full', metric: 'acc_norm' }),
1837
- ]);
1838
  } catch (err) {
1839
  elInitLoading.innerHTML = `<span style="color:#e63946">
1840
  Error: ${err.message}<br>
 
1404
  const startW = this.el.panel.offsetWidth;
1405
  this.el.widthHandle.classList.add('active');
1406
 
1407
+ const chart = this.el.chart;
1408
+ // Freeze chart height so Plotly's responsive ResizeObserver
1409
+ // cannot collapse it while the panel width is being dragged.
1410
+ const lockedH = chart.offsetHeight;
1411
+ chart.style.minHeight = lockedH + 'px';
1412
+
1413
  const onMove = (ev) => {
1414
  const newW = Math.max(300, startW + ev.clientX - startX);
1415
  this.el.panel.style.width = newW + 'px';
 
1416
  };
1417
 
1418
  const onUp = () => {
1419
  this.el.widthHandle.classList.remove('active');
1420
  document.removeEventListener('mousemove', onMove);
1421
  document.removeEventListener('mouseup', onUp);
1422
+ chart.style.minHeight = '';
1423
+ Plotly.purge(chart);
1424
+ this.renderChart();
1425
  };
1426
 
1427
  document.addEventListener('mousemove', onMove);
 
1836
  elInitLoading.style.display = 'none';
1837
  elAddPanelRow.style.display = '';
1838
 
1839
+ // Create default panel
1840
+ await addPanel({ suite: 'eng_base_main', metric: 'acc_norm' });
 
 
 
 
 
1841
  } catch (err) {
1842
  elInitLoading.innerHTML = `<span style="color:#e63946">
1843
  Error: ${err.message}<br>