nthakur commited on
Commit
b2dce15
·
1 Parent(s): dc4ca26

Increase plot and legend spacing in HF Space.

Browse files

Add vertical room and larger bottom margins so long legends do not get cropped by subsequent plots.

Made-with: Cursor

Files changed (2) hide show
  1. main.js +6 -6
  2. style.css +1 -1
main.js CHANGED
@@ -254,11 +254,11 @@ function renderPlots() {
254
 
255
  Plotly.newPlot(metric.plotId, traces, {
256
  title: { text: metric.title, x: 0.01, xanchor: 'left', font: { size: 16 } },
257
- height: 430,
258
- margin: { t: 46, r: 12, b: 130, l: 56 },
259
  xaxis: { title: { text: 'Model Parameters (Billions)', standoff: 26 }, type: 'log', automargin: true, showgrid: true },
260
  yaxis: { title: metric.yLabel, range: [metric.yMin, metric.yMax], tickformat: '.2f', automargin: true, showgrid: true },
261
- legend: { orientation: 'h', y: -0.36, x: 0.5, xanchor: 'center' },
262
  hovermode: 'closest'
263
  }, { responsive: true, displaylogo: false });
264
  });
@@ -304,8 +304,8 @@ function renderPlots() {
304
 
305
  Plotly.newPlot(metric.plotId, traces, {
306
  title: { text: metric.title, x: 0.01, xanchor: 'left', font: { size: 16 } },
307
- height: 430,
308
- margin: { t: 46, r: 12, b: 160, l: 56 },
309
  xaxis: {
310
  title: { text: 'Model Release Date', standoff: 34 },
311
  type: 'date',
@@ -320,7 +320,7 @@ function renderPlots() {
320
  yaxis: { title: metric.yLabel, range: [metric.yMin, metric.yMax], tickformat: '.2f', automargin: true, showgrid: true },
321
  legend: {
322
  orientation: 'h',
323
- y: -0.44,
324
  x: 0.5,
325
  xanchor: 'center',
326
  entrywidthmode: 'pixels',
 
254
 
255
  Plotly.newPlot(metric.plotId, traces, {
256
  title: { text: metric.title, x: 0.01, xanchor: 'left', font: { size: 16 } },
257
+ height: 460,
258
+ margin: { t: 46, r: 12, b: 165, l: 56 },
259
  xaxis: { title: { text: 'Model Parameters (Billions)', standoff: 26 }, type: 'log', automargin: true, showgrid: true },
260
  yaxis: { title: metric.yLabel, range: [metric.yMin, metric.yMax], tickformat: '.2f', automargin: true, showgrid: true },
261
+ legend: { orientation: 'h', y: -0.44, x: 0.5, xanchor: 'center' },
262
  hovermode: 'closest'
263
  }, { responsive: true, displaylogo: false });
264
  });
 
304
 
305
  Plotly.newPlot(metric.plotId, traces, {
306
  title: { text: metric.title, x: 0.01, xanchor: 'left', font: { size: 16 } },
307
+ height: 460,
308
+ margin: { t: 46, r: 12, b: 195, l: 56 },
309
  xaxis: {
310
  title: { text: 'Model Release Date', standoff: 34 },
311
  type: 'date',
 
320
  yaxis: { title: metric.yLabel, range: [metric.yMin, metric.yMax], tickformat: '.2f', automargin: true, showgrid: true },
321
  legend: {
322
  orientation: 'h',
323
+ y: -0.52,
324
  x: 0.5,
325
  xanchor: 'center',
326
  entrywidthmode: 'pixels',
style.css CHANGED
@@ -133,7 +133,7 @@ tbody tr:hover { background: #f8fbff; }
133
  }
134
  .plots h3 { margin: 0 0 6px; }
135
  .plot-sub { margin: 0 0 12px; color: #475569; }
136
- .plot-box { width: 100%; height: 390px; margin-bottom: 12px; }
137
  .plot-box:last-child { margin-bottom: 0; }
138
  .citation-head {
139
  display: flex;
 
133
  }
134
  .plots h3 { margin: 0 0 6px; }
135
  .plot-sub { margin: 0 0 12px; color: #475569; }
136
+ .plot-box { width: 100%; height: 460px; margin-bottom: 34px; }
137
  .plot-box:last-child { margin-bottom: 0; }
138
  .citation-head {
139
  display: flex;