Spaces:
Running

Leaderboard / data /analysis /elo_no_timeouts.html
schaeferbasti's picture
Leaderboard v0.12.3: add LGBMGain (from Preview v0.12.13; results: SelectArena_Results@49f46580)
2517b84
Raw History Blame Contribute Delete
42.6 kB
<!doctype html>
<html lang='en'><head><meta charset='utf-8'><meta name='viewport' content='width=device-width,initial-scale=1'><title>SelectArena: Elo on the 32 datasets where no method timed out</title><style>
:root { --fg:#1f2328; --muted:#59636e; --bg:#ffffff; --line:#d1d9e0; --soft:#f6f8fa; --accent:#0072B2; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --fg:#e6edf3; --muted:#9198a1; --bg:#0d1117; --line:#3d444d; --soft:#151b23; --accent:#4aa3df; }
}
:root[data-theme="dark"] { --fg:#e6edf3; --muted:#9198a1; --bg:#0d1117; --line:#3d444d; --soft:#151b23; --accent:#4aa3df; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--fg);
font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
.toolbar { display:flex; gap:6px; justify-content:flex-end; align-items:center; padding:4px 2px 8px; }
.toolbar .hint { margin-right:auto; color:var(--muted); font-size:12px; }
.toolbar button { font:inherit; font-size:12px; color:var(--fg); background:var(--soft);
border:1px solid var(--line); border-radius:6px; padding:3px 10px; cursor:pointer; }
.toolbar button:hover { border-color:var(--accent); }
#sa-tip { position:fixed; z-index:10; pointer-events:none; display:none; max-width:280px;
padding:6px 9px; border-radius:6px; border:1px solid var(--line); background:var(--bg); color:var(--fg);
font-size:12px; line-height:1.45; white-space:pre-line; box-shadow:0 2px 8px rgba(0,0,0,0.15); }
#sa-tip b { font-weight:600; }
</style></head><body><div class='toolbar'><span class='hint'>Hover or tap a method for its values.</span><button onclick="saSvg('selectarena_elo_without_timeouts')">SVG</button><button onclick="saPng('selectarena_elo_without_timeouts')">PNG</button><button onclick="saPdf('selectarena_elo_without_timeouts')">PDF</button><button onclick="saCsv('selectarena_elo_without_timeouts.csv')">CSV</button></div><svg id='sa-figure' viewBox='0 0 1596 432' role='img' aria-label='Elo of each method: with random fallback (71 datasets) and no time-outs (32 datasets)' style='max-width:1835px;margin:0 auto'><style>
svg { display:block; width:100%; height:auto; }
.sa-text { fill:var(--fg); }
.sa-muted { fill:var(--muted); }
.sa-grid { stroke:var(--line); }
.sa-ink { stroke:var(--fg); }
.sa-hit { fill:transparent; cursor:default; }
.sa-hit:hover, .sa-hit.sa-on { fill:var(--fg); fill-opacity:0.06; }
.sa-dim { fill:var(--muted); }
.sa-frame-line { stroke:var(--fg); stroke-opacity:0.3; fill:none; }
.sa-point { stroke:var(--fg); }
.sa-legend { fill:var(--bg); stroke:var(--line); }
.sa-heat { image-rendering:pixelated; image-rendering:crisp-edges; }
.sa-halo { paint-order:stroke; stroke:var(--bg); stroke-width:3px; stroke-opacity:0.7; }
.sa-hollow { fill:var(--bg); stroke:var(--fg); } .sa-ci-none { stroke:var(--muted); }</style><line class='sa-grid' x1='62' x2='1580' y1='328.0' y2='328.0'/><text class='sa-muted' x='56' y='332.0' text-anchor='end' font-size='11'>900</text><line class='sa-grid' x1='62' x2='1580' y1='280.0' y2='280.0'/><text class='sa-muted' x='56' y='284.0' text-anchor='end' font-size='11'>1000</text><line class='sa-grid' x1='62' x2='1580' y1='232.0' y2='232.0'/><text class='sa-muted' x='56' y='236.0' text-anchor='end' font-size='11'>1100</text><line class='sa-grid' x1='62' x2='1580' y1='184.0' y2='184.0'/><text class='sa-muted' x='56' y='188.0' text-anchor='end' font-size='11'>1200</text><line class='sa-grid' x1='62' x2='1580' y1='136.0' y2='136.0'/><text class='sa-muted' x='56' y='140.0' text-anchor='end' font-size='11'>1300</text><line class='sa-grid' x1='62' x2='1580' y1='88.0' y2='88.0'/><text class='sa-muted' x='56' y='92.0' text-anchor='end' font-size='11'>1400</text><line class='sa-grid' x1='62' x2='1580' y1='40.0' y2='40.0'/><text class='sa-muted' x='56' y='44.0' text-anchor='end' font-size='11'>1500</text><text class='sa-text' transform='translate(16 190) rotate(-90)' text-anchor='middle' font-size='12'>Elo</text><rect x='66.0' y='284.9' width='28' height='55.1' fill='#F2CFB2'/><line class='sa-ink' x1='80.0' x2='80.0' y1='252.7' y2='323.2' stroke-width='1.2'/><line class='sa-ink' x1='76.0' x2='84.0' y1='323.2' y2='323.2' stroke-width='1.2'/><line class='sa-ink' x1='76.0' x2='84.0' y1='252.7' y2='252.7' stroke-width='1.2'/><text x='80.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>23</text><rect x='96.0' y='291.6' width='28' height='48.4' fill='#0072B2'/><line class='sa-ink' x1='110.0' x2='110.0' y1='269.3' y2='319.0' stroke-width='1.2'/><line class='sa-ink' x1='106.0' x2='114.0' y1='319.0' y2='319.0' stroke-width='1.2'/><line class='sa-ink' x1='106.0' x2='114.0' y1='269.3' y2='269.3' stroke-width='1.2'/><text x='110.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>23</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(101.0 354.0) rotate(-35)'>LaplacianScore</text><rect class='sa-hit' x='62.0' y='40' width='66' height='300' data-tip='LaplacianScore&#10;no time-outs (32 datasets): Elo 990 (910 to 1057), rank 23&#10;with random fallback (71 datasets): Elo 976 (919 to 1022), rank 23'/><rect x='132.0' y='280.0' width='28' height='60.0' fill='#F2CFB2'/><line class='sa-ink' x1='146.0' x2='146.0' y1='254.8' y2='312.2' stroke-width='1.2'/><line class='sa-ink' x1='142.0' x2='150.0' y1='312.2' y2='312.2' stroke-width='1.2'/><line class='sa-ink' x1='142.0' x2='150.0' y1='254.8' y2='254.8' stroke-width='1.2'/><text x='146.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>22</text><rect x='162.0' y='280.0' width='28' height='60.0' fill='#0072B2'/><line class='sa-ink' x1='176.0' x2='176.0' y1='262.8' y2='298.7' stroke-width='1.2'/><line class='sa-ink' x1='172.0' x2='180.0' y1='298.7' y2='298.7' stroke-width='1.2'/><line class='sa-ink' x1='172.0' x2='180.0' y1='262.8' y2='262.8' stroke-width='1.2'/><text x='176.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>22</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(167.0 354.0) rotate(-35)'>Random</text><rect class='sa-hit' x='128.0' y='40' width='66' height='300' data-tip='Random&#10;no time-outs (32 datasets): Elo 1000 (933 to 1052), rank 22&#10;with random fallback (71 datasets): Elo 1000 (961 to 1036), rank 22'/><rect x='198.0' y='186.5' width='28' height='153.5' fill='#F2CFB2'/><line class='sa-ink' x1='212.0' x2='212.0' y1='167.4' y2='205.4' stroke-width='1.2'/><line class='sa-ink' x1='208.0' x2='216.0' y1='205.4' y2='205.4' stroke-width='1.2'/><line class='sa-ink' x1='208.0' x2='216.0' y1='167.4' y2='167.4' stroke-width='1.2'/><text x='212.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>21</text><rect x='228.0' y='208.2' width='28' height='131.8' fill='#0072B2'/><line class='sa-ink' x1='242.0' x2='242.0' y1='193.2' y2='223.9' stroke-width='1.2'/><line class='sa-ink' x1='238.0' x2='246.0' y1='223.9' y2='223.9' stroke-width='1.2'/><line class='sa-ink' x1='238.0' x2='246.0' y1='193.2' y2='193.2' stroke-width='1.2'/><text x='242.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>21</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(233.0 354.0) rotate(-35)'>LOCO</text><rect class='sa-hit' x='194.0' y='40' width='66' height='300' data-tip='LOCO&#10;no time-outs (32 datasets): Elo 1195 (1155 to 1234), rank 21&#10;with random fallback (71 datasets): Elo 1150 (1117 to 1181), rank 21'/><rect x='264.0' y='139.3' width='28' height='200.7' fill='#F2CFB2'/><line class='sa-ink' x1='278.0' x2='278.0' y1='119.9' y2='158.1' stroke-width='1.2'/><line class='sa-ink' x1='274.0' x2='282.0' y1='158.1' y2='158.1' stroke-width='1.2'/><line class='sa-ink' x1='274.0' x2='282.0' y1='119.9' y2='119.9' stroke-width='1.2'/><text x='278.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>5</text><rect x='294.0' y='196.2' width='28' height='143.8' fill='#0072B2'/><line class='sa-ink' x1='308.0' x2='308.0' y1='177.7' y2='216.2' stroke-width='1.2'/><line class='sa-ink' x1='304.0' x2='312.0' y1='216.2' y2='216.2' stroke-width='1.2'/><line class='sa-ink' x1='304.0' x2='312.0' y1='177.7' y2='177.7' stroke-width='1.2'/><text x='308.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>20</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(299.0 354.0) rotate(-35)'>SBE</text><rect class='sa-hit' x='260.0' y='40' width='66' height='300' data-tip='SBE&#10;no time-outs (32 datasets): Elo 1293 (1254 to 1334), rank 5&#10;with random fallback (71 datasets): Elo 1174 (1133 to 1213), rank 20'/><rect x='330.0' y='184.0' width='28' height='156.0' fill='#F2CFB2'/><line class='sa-ink' x1='344.0' x2='344.0' y1='161.9' y2='208.0' stroke-width='1.2'/><line class='sa-ink' x1='340.0' x2='348.0' y1='208.0' y2='208.0' stroke-width='1.2'/><line class='sa-ink' x1='340.0' x2='348.0' y1='161.9' y2='161.9' stroke-width='1.2'/><text x='344.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>19</text><rect x='360.0' y='194.4' width='28' height='145.6' fill='#0072B2'/><line class='sa-ink' x1='374.0' x2='374.0' y1='180.3' y2='210.4' stroke-width='1.2'/><line class='sa-ink' x1='370.0' x2='378.0' y1='210.4' y2='210.4' stroke-width='1.2'/><line class='sa-ink' x1='370.0' x2='378.0' y1='180.3' y2='180.3' stroke-width='1.2'/><text x='374.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>19</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(365.0 354.0) rotate(-35)'>SFS</text><rect class='sa-hit' x='326.0' y='40' width='66' height='300' data-tip='SFS&#10;no time-outs (32 datasets): Elo 1200 (1150 to 1246), rank 19&#10;with random fallback (71 datasets): Elo 1178 (1145 to 1208), rank 19'/><rect x='396.0' y='186.1' width='28' height='153.9' fill='#F2CFB2'/><line class='sa-ink' x1='410.0' x2='410.0' y1='167.1' y2='204.8' stroke-width='1.2'/><line class='sa-ink' x1='406.0' x2='414.0' y1='204.8' y2='204.8' stroke-width='1.2'/><line class='sa-ink' x1='406.0' x2='414.0' y1='167.1' y2='167.1' stroke-width='1.2'/><text x='410.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>20</text><rect x='426.0' y='192.0' width='28' height='148.0' fill='#0072B2'/><line class='sa-ink' x1='440.0' x2='440.0' y1='177.9' y2='206.1' stroke-width='1.2'/><line class='sa-ink' x1='436.0' x2='444.0' y1='206.1' y2='206.1' stroke-width='1.2'/><line class='sa-ink' x1='436.0' x2='444.0' y1='177.9' y2='177.9' stroke-width='1.2'/><text x='440.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>18</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(431.0 354.0) rotate(-35)'>GainRatio</text><rect class='sa-hit' x='392.0' y='40' width='66' height='300' data-tip='GainRatio&#10;no time-outs (32 datasets): Elo 1196 (1157 to 1235), rank 20&#10;with random fallback (71 datasets): Elo 1183 (1154 to 1213), rank 18'/><rect x='462.0' y='173.3' width='28' height='166.7' fill='#F2CFB2'/><line class='sa-ink' x1='476.0' x2='476.0' y1='157.7' y2='190.3' stroke-width='1.2'/><line class='sa-ink' x1='472.0' x2='480.0' y1='190.3' y2='190.3' stroke-width='1.2'/><line class='sa-ink' x1='472.0' x2='480.0' y1='157.7' y2='157.7' stroke-width='1.2'/><text x='476.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>16</text><rect x='492.0' y='185.2' width='28' height='154.8' fill='#0072B2'/><line class='sa-ink' x1='506.0' x2='506.0' y1='171.5' y2='199.0' stroke-width='1.2'/><line class='sa-ink' x1='502.0' x2='510.0' y1='199.0' y2='199.0' stroke-width='1.2'/><line class='sa-ink' x1='502.0' x2='510.0' y1='171.5' y2='171.5' stroke-width='1.2'/><text x='506.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>17</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(497.0 354.0) rotate(-35)'>mRMR</text><rect class='sa-hit' x='458.0' y='40' width='66' height='300' data-tip='mRMR&#10;no time-outs (32 datasets): Elo 1222 (1187 to 1255), rank 16&#10;with random fallback (71 datasets): Elo 1198 (1169 to 1226), rank 17'/><rect x='528.0' y='183.0' width='28' height='157.0' fill='#F2CFB2'/><line class='sa-ink' x1='542.0' x2='542.0' y1='162.6' y2='204.3' stroke-width='1.2'/><line class='sa-ink' x1='538.0' x2='546.0' y1='204.3' y2='204.3' stroke-width='1.2'/><line class='sa-ink' x1='538.0' x2='546.0' y1='162.6' y2='162.6' stroke-width='1.2'/><text x='542.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>18</text><rect x='558.0' y='184.9' width='28' height='155.1' fill='#0072B2'/><line class='sa-ink' x1='572.0' x2='572.0' y1='169.8' y2='199.7' stroke-width='1.2'/><line class='sa-ink' x1='568.0' x2='576.0' y1='199.7' y2='199.7' stroke-width='1.2'/><line class='sa-ink' x1='568.0' x2='576.0' y1='169.8' y2='169.8' stroke-width='1.2'/><text x='572.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>16</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(563.0 354.0) rotate(-35)'>(R)ReliefF</text><rect class='sa-hit' x='524.0' y='40' width='66' height='300' data-tip='(R)ReliefF&#10;no time-outs (32 datasets): Elo 1202 (1158 to 1244), rank 18&#10;with random fallback (71 datasets): Elo 1198 (1167 to 1230), rank 16'/><rect x='594.0' y='171.3' width='28' height='168.7' fill='#F2CFB2'/><line class='sa-ink' x1='608.0' x2='608.0' y1='150.3' y2='193.6' stroke-width='1.2'/><line class='sa-ink' x1='604.0' x2='612.0' y1='193.6' y2='193.6' stroke-width='1.2'/><line class='sa-ink' x1='604.0' x2='612.0' y1='150.3' y2='150.3' stroke-width='1.2'/><text x='608.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>15</text><rect x='624.0' y='174.4' width='28' height='165.6' fill='#0072B2'/><line class='sa-ink' x1='638.0' x2='638.0' y1='160.7' y2='187.5' stroke-width='1.2'/><line class='sa-ink' x1='634.0' x2='642.0' y1='187.5' y2='187.5' stroke-width='1.2'/><line class='sa-ink' x1='634.0' x2='642.0' y1='160.7' y2='160.7' stroke-width='1.2'/><text x='638.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>15</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(629.0 354.0) rotate(-35)'>MarkovBlanket</text><rect class='sa-hit' x='590.0' y='40' width='66' height='300' data-tip='MarkovBlanket&#10;no time-outs (32 datasets): Elo 1226 (1180 to 1270), rank 15&#10;with random fallback (71 datasets): Elo 1220 (1193 to 1248), rank 15'/><rect x='660.0' y='163.1' width='28' height='176.9' fill='#F2CFB2'/><line class='sa-ink' x1='674.0' x2='674.0' y1='145.8' y2='180.5' stroke-width='1.2'/><line class='sa-ink' x1='670.0' x2='678.0' y1='180.5' y2='180.5' stroke-width='1.2'/><line class='sa-ink' x1='670.0' x2='678.0' y1='145.8' y2='145.8' stroke-width='1.2'/><text x='674.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>12</text><rect x='690.0' y='169.5' width='28' height='170.5' fill='#0072B2'/><line class='sa-ink' x1='704.0' x2='704.0' y1='156.4' y2='182.7' stroke-width='1.2'/><line class='sa-ink' x1='700.0' x2='708.0' y1='182.7' y2='182.7' stroke-width='1.2'/><line class='sa-ink' x1='700.0' x2='708.0' y1='156.4' y2='156.4' stroke-width='1.2'/><text x='704.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>14</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(695.0 354.0) rotate(-35)'>F-Test</text><rect class='sa-hit' x='656.0' y='40' width='66' height='300' data-tip='F-Test&#10;no time-outs (32 datasets): Elo 1244 (1207 to 1280), rank 12&#10;with random fallback (71 datasets): Elo 1230 (1203 to 1257), rank 14'/><rect x='726.0' y='177.8' width='28' height='162.2' fill='#F2CFB2'/><line class='sa-ink' x1='740.0' x2='740.0' y1='158.6' y2='197.5' stroke-width='1.2'/><line class='sa-ink' x1='736.0' x2='744.0' y1='197.5' y2='197.5' stroke-width='1.2'/><line class='sa-ink' x1='736.0' x2='744.0' y1='158.6' y2='158.6' stroke-width='1.2'/><text x='740.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>17</text><rect x='756.0' y='168.6' width='28' height='171.4' fill='#0072B2'/><line class='sa-ink' x1='770.0' x2='770.0' y1='154.6' y2='184.2' stroke-width='1.2'/><line class='sa-ink' x1='766.0' x2='774.0' y1='184.2' y2='184.2' stroke-width='1.2'/><line class='sa-ink' x1='766.0' x2='774.0' y1='154.6' y2='154.6' stroke-width='1.2'/><text x='770.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>13</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(761.0 354.0) rotate(-35)'>Lasso</text><rect class='sa-hit' x='722.0' y='40' width='66' height='300' data-tip='Lasso&#10;no time-outs (32 datasets): Elo 1213 (1172 to 1253), rank 17&#10;with random fallback (71 datasets): Elo 1232 (1200 to 1261), rank 13'/><rect x='792.0' y='166.6' width='28' height='173.4' fill='#F2CFB2'/><line class='sa-ink' x1='806.0' x2='806.0' y1='145.8' y2='190.7' stroke-width='1.2'/><line class='sa-ink' x1='802.0' x2='810.0' y1='190.7' y2='190.7' stroke-width='1.2'/><line class='sa-ink' x1='802.0' x2='810.0' y1='145.8' y2='145.8' stroke-width='1.2'/><text x='806.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>13</text><rect x='822.0' y='167.1' width='28' height='172.9' fill='#0072B2'/><line class='sa-ink' x1='836.0' x2='836.0' y1='151.8' y2='181.8' stroke-width='1.2'/><line class='sa-ink' x1='832.0' x2='840.0' y1='181.8' y2='181.8' stroke-width='1.2'/><line class='sa-ink' x1='832.0' x2='840.0' y1='151.8' y2='151.8' stroke-width='1.2'/><text x='836.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>12</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(827.0 354.0) rotate(-35)'>CPI</text><rect class='sa-hit' x='788.0' y='40' width='66' height='300' data-tip='CPI&#10;no time-outs (32 datasets): Elo 1236 (1186 to 1280), rank 13&#10;with random fallback (71 datasets): Elo 1235 (1205 to 1267), rank 12'/><rect x='858.0' y='153.6' width='28' height='186.4' fill='#F2CFB2'/><line class='sa-ink' x1='872.0' x2='872.0' y1='136.4' y2='171.7' stroke-width='1.2'/><line class='sa-ink' x1='868.0' x2='876.0' y1='171.7' y2='171.7' stroke-width='1.2'/><line class='sa-ink' x1='868.0' x2='876.0' y1='136.4' y2='136.4' stroke-width='1.2'/><text x='872.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>10</text><rect x='888.0' y='161.8' width='28' height='178.2' fill='#0072B2'/><line class='sa-ink' x1='902.0' x2='902.0' y1='149.9' y2='173.3' stroke-width='1.2'/><line class='sa-ink' x1='898.0' x2='906.0' y1='173.3' y2='173.3' stroke-width='1.2'/><line class='sa-ink' x1='898.0' x2='906.0' y1='149.9' y2='149.9' stroke-width='1.2'/><text x='902.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>11</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(893.0 354.0) rotate(-35)'>MI</text><rect class='sa-hit' x='854.0' y='40' width='66' height='300' data-tip='MI&#10;no time-outs (32 datasets): Elo 1263 (1226 to 1299), rank 10&#10;with random fallback (71 datasets): Elo 1246 (1222 to 1271), rank 11'/><rect x='924.0' y='149.4' width='28' height='190.6' fill='#F2CFB2'/><line class='sa-ink' x1='938.0' x2='938.0' y1='130.8' y2='167.3' stroke-width='1.2'/><line class='sa-ink' x1='934.0' x2='942.0' y1='167.3' y2='167.3' stroke-width='1.2'/><line class='sa-ink' x1='934.0' x2='942.0' y1='130.8' y2='130.8' stroke-width='1.2'/><text x='938.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>9</text><rect x='954.0' y='160.9' width='28' height='179.1' fill='#0072B2'/><line class='sa-ink' x1='968.0' x2='968.0' y1='148.1' y2='173.2' stroke-width='1.2'/><line class='sa-ink' x1='964.0' x2='972.0' y1='173.2' y2='173.2' stroke-width='1.2'/><line class='sa-ink' x1='964.0' x2='972.0' y1='148.1' y2='148.1' stroke-width='1.2'/><text x='968.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>10</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(959.0 354.0) rotate(-35)'>PACE-SIS</text><rect class='sa-hit' x='920.0' y='40' width='66' height='300' data-tip='PACE-SIS&#10;no time-outs (32 datasets): Elo 1272 (1235 to 1311), rank 9&#10;with random fallback (71 datasets): Elo 1248 (1223 to 1275), rank 10'/><rect x='990.0' y='170.7' width='28' height='169.3' fill='#F2CFB2'/><line class='sa-ink' x1='1004.0' x2='1004.0' y1='150.2' y2='192.4' stroke-width='1.2'/><line class='sa-ink' x1='1000.0' x2='1008.0' y1='192.4' y2='192.4' stroke-width='1.2'/><line class='sa-ink' x1='1000.0' x2='1008.0' y1='150.2' y2='150.2' stroke-width='1.2'/><text x='1004.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>14</text><rect x='1020.0' y='156.1' width='28' height='183.9' fill='#0072B2'/><line class='sa-ink' x1='1034.0' x2='1034.0' y1='141.6' y2='172.1' stroke-width='1.2'/><line class='sa-ink' x1='1030.0' x2='1038.0' y1='172.1' y2='172.1' stroke-width='1.2'/><line class='sa-ink' x1='1030.0' x2='1038.0' y1='141.6' y2='141.6' stroke-width='1.2'/><text x='1034.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>9</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1025.0 354.0) rotate(-35)'>ElasticNet</text><rect class='sa-hit' x='986.0' y='40' width='66' height='300' data-tip='ElasticNet&#10;no time-outs (32 datasets): Elo 1228 (1183 to 1270), rank 14&#10;with random fallback (71 datasets): Elo 1258 (1225 to 1288), rank 9'/><rect x='1056.0' y='148.0' width='28' height='192.0' fill='#F2CFB2'/><line class='sa-ink' x1='1070.0' x2='1070.0' y1='122.9' y2='171.1' stroke-width='1.2'/><line class='sa-ink' x1='1066.0' x2='1074.0' y1='171.1' y2='171.1' stroke-width='1.2'/><line class='sa-ink' x1='1066.0' x2='1074.0' y1='122.9' y2='122.9' stroke-width='1.2'/><text x='1070.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>8</text><rect x='1086.0' y='156.0' width='28' height='184.0' fill='#0072B2'/><line class='sa-ink' x1='1100.0' x2='1100.0' y1='138.8' y2='172.7' stroke-width='1.2'/><line class='sa-ink' x1='1096.0' x2='1104.0' y1='172.7' y2='172.7' stroke-width='1.2'/><line class='sa-ink' x1='1096.0' x2='1104.0' y1='138.8' y2='138.8' stroke-width='1.2'/><text x='1100.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>8</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1091.0 354.0) rotate(-35)'>SHAP</text><rect class='sa-hit' x='1052.0' y='40' width='66' height='300' data-tip='SHAP&#10;no time-outs (32 datasets): Elo 1275 (1227 to 1327), rank 8&#10;with random fallback (71 datasets): Elo 1258 (1224 to 1294), rank 8'/><rect x='1122.0' y='160.0' width='28' height='180.0' fill='#F2CFB2'/><line class='sa-ink' x1='1136.0' x2='1136.0' y1='137.8' y2='181.0' stroke-width='1.2'/><line class='sa-ink' x1='1132.0' x2='1140.0' y1='181.0' y2='181.0' stroke-width='1.2'/><line class='sa-ink' x1='1132.0' x2='1140.0' y1='137.8' y2='137.8' stroke-width='1.2'/><text x='1136.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>11</text><rect x='1152.0' y='152.7' width='28' height='187.3' fill='#0072B2'/><line class='sa-ink' x1='1166.0' x2='1166.0' y1='137.7' y2='166.6' stroke-width='1.2'/><line class='sa-ink' x1='1162.0' x2='1170.0' y1='166.6' y2='166.6' stroke-width='1.2'/><line class='sa-ink' x1='1162.0' x2='1170.0' y1='137.7' y2='137.7' stroke-width='1.2'/><text x='1166.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>7</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1157.0 354.0) rotate(-35)'>CART</text><rect class='sa-hit' x='1118.0' y='40' width='66' height='300' data-tip='CART&#10;no time-outs (32 datasets): Elo 1250 (1206 to 1296), rank 11&#10;with random fallback (71 datasets): Elo 1265 (1236 to 1296), rank 7'/><rect x='1188.0' y='137.7' width='28' height='202.3' fill='#F2CFB2'/><line class='sa-ink' x1='1202.0' x2='1202.0' y1='119.2' y2='154.5' stroke-width='1.2'/><line class='sa-ink' x1='1198.0' x2='1206.0' y1='154.5' y2='154.5' stroke-width='1.2'/><line class='sa-ink' x1='1198.0' x2='1206.0' y1='119.2' y2='119.2' stroke-width='1.2'/><text x='1202.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>4</text><rect x='1218.0' y='149.2' width='28' height='190.8' fill='#0072B2'/><line class='sa-ink' x1='1232.0' x2='1232.0' y1='137.4' y2='161.2' stroke-width='1.2'/><line class='sa-ink' x1='1228.0' x2='1236.0' y1='161.2' y2='161.2' stroke-width='1.2'/><line class='sa-ink' x1='1228.0' x2='1236.0' y1='137.4' y2='137.4' stroke-width='1.2'/><text x='1232.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>6</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1223.0 354.0) rotate(-35)'>PACE-DC</text><rect class='sa-hit' x='1184.0' y='40' width='66' height='300' data-tip='PACE-DC&#10;no time-outs (32 datasets): Elo 1296 (1261 to 1335), rank 4&#10;with random fallback (71 datasets): Elo 1272 (1248 to 1297), rank 6'/><rect x='1254.0' y='133.3' width='28' height='206.7' fill='#F2CFB2'/><line class='sa-ink' x1='1268.0' x2='1268.0' y1='115.7' y2='149.9' stroke-width='1.2'/><line class='sa-ink' x1='1264.0' x2='1272.0' y1='149.9' y2='149.9' stroke-width='1.2'/><line class='sa-ink' x1='1264.0' x2='1272.0' y1='115.7' y2='115.7' stroke-width='1.2'/><text x='1268.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>3</text><rect x='1284.0' y='141.2' width='28' height='198.8' fill='#0072B2'/><line class='sa-ink' x1='1298.0' x2='1298.0' y1='130.2' y2='152.3' stroke-width='1.2'/><line class='sa-ink' x1='1294.0' x2='1302.0' y1='152.3' y2='152.3' stroke-width='1.2'/><line class='sa-ink' x1='1294.0' x2='1302.0' y1='130.2' y2='130.2' stroke-width='1.2'/><text x='1298.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>5</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1289.0 354.0) rotate(-35)'>PACE-HSIC</text><rect class='sa-hit' x='1250.0' y='40' width='66' height='300' data-tip='PACE-HSIC&#10;no time-outs (32 datasets): Elo 1306 (1271 to 1342), rank 3&#10;with random fallback (71 datasets): Elo 1289 (1266 to 1312), rank 5'/><rect x='1320.0' y='140.4' width='28' height='199.6' fill='#F2CFB2'/><line class='sa-ink' x1='1334.0' x2='1334.0' y1='122.1' y2='157.6' stroke-width='1.2'/><line class='sa-ink' x1='1330.0' x2='1338.0' y1='157.6' y2='157.6' stroke-width='1.2'/><line class='sa-ink' x1='1330.0' x2='1338.0' y1='122.1' y2='122.1' stroke-width='1.2'/><text x='1334.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>6</text><rect x='1350.0' y='136.9' width='28' height='203.1' fill='#0072B2'/><line class='sa-ink' x1='1364.0' x2='1364.0' y1='122.1' y2='151.5' stroke-width='1.2'/><line class='sa-ink' x1='1360.0' x2='1368.0' y1='151.5' y2='151.5' stroke-width='1.2'/><line class='sa-ink' x1='1360.0' x2='1368.0' y1='122.1' y2='122.1' stroke-width='1.2'/><text x='1364.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>4</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1355.0 354.0) rotate(-35)'>LassoNet</text><rect class='sa-hit' x='1316.0' y='40' width='66' height='300' data-tip='LassoNet&#10;no time-outs (32 datasets): Elo 1291 (1255 to 1329), rank 6&#10;with random fallback (71 datasets): Elo 1298 (1268 to 1329), rank 4'/><rect x='1386.0' y='147.2' width='28' height='192.8' fill='#F2CFB2'/><line class='sa-ink' x1='1400.0' x2='1400.0' y1='124.5' y2='167.3' stroke-width='1.2'/><line class='sa-ink' x1='1396.0' x2='1404.0' y1='167.3' y2='167.3' stroke-width='1.2'/><line class='sa-ink' x1='1396.0' x2='1404.0' y1='124.5' y2='124.5' stroke-width='1.2'/><text x='1400.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>7</text><rect x='1416.0' y='131.6' width='28' height='208.4' fill='#0072B2'/><line class='sa-ink' x1='1430.0' x2='1430.0' y1='117.2' y2='146.0' stroke-width='1.2'/><line class='sa-ink' x1='1426.0' x2='1434.0' y1='146.0' y2='146.0' stroke-width='1.2'/><line class='sa-ink' x1='1426.0' x2='1434.0' y1='117.2' y2='117.2' stroke-width='1.2'/><text x='1430.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>3</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1421.0 354.0) rotate(-35)'>RFImportance</text><rect class='sa-hit' x='1382.0' y='40' width='66' height='300' data-tip='RFImportance&#10;no time-outs (32 datasets): Elo 1277 (1235 to 1324), rank 7&#10;with random fallback (71 datasets): Elo 1309 (1279 to 1339), rank 3'/><rect x='1452.0' y='102.7' width='28' height='237.3' fill='#F2CFB2'/><line class='sa-ink' x1='1466.0' x2='1466.0' y1='85.6' y2='118.1' stroke-width='1.2'/><line class='sa-ink' x1='1462.0' x2='1470.0' y1='118.1' y2='118.1' stroke-width='1.2'/><line class='sa-ink' x1='1462.0' x2='1470.0' y1='85.6' y2='85.6' stroke-width='1.2'/><text x='1466.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>1</text><rect x='1482.0' y='118.9' width='28' height='221.1' fill='#0072B2'/><line class='sa-ink' x1='1496.0' x2='1496.0' y1='106.3' y2='131.7' stroke-width='1.2'/><line class='sa-ink' x1='1492.0' x2='1500.0' y1='131.7' y2='131.7' stroke-width='1.2'/><line class='sa-ink' x1='1492.0' x2='1500.0' y1='106.3' y2='106.3' stroke-width='1.2'/><text x='1496.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>2</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1487.0 354.0) rotate(-35)'>CD-PFN</text><rect class='sa-hit' x='1448.0' y='40' width='66' height='300' data-tip='CD-PFN&#10;no time-outs (32 datasets): Elo 1369 (1337 to 1405), rank 1&#10;with random fallback (71 datasets): Elo 1336 (1309 to 1362), rank 2'/><rect x='1518.0' y='119.0' width='28' height='221.0' fill='#F2CFB2'/><line class='sa-ink' x1='1532.0' x2='1532.0' y1='98.4' y2='138.4' stroke-width='1.2'/><line class='sa-ink' x1='1528.0' x2='1536.0' y1='138.4' y2='138.4' stroke-width='1.2'/><line class='sa-ink' x1='1528.0' x2='1536.0' y1='98.4' y2='98.4' stroke-width='1.2'/><text x='1532.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#1f2328'>2</text><rect x='1548.0' y='98.2' width='28' height='241.8' fill='#0072B2'/><line class='sa-ink' x1='1562.0' x2='1562.0' y1='83.2' y2='112.9' stroke-width='1.2'/><line class='sa-ink' x1='1558.0' x2='1566.0' y1='112.9' y2='112.9' stroke-width='1.2'/><line class='sa-ink' x1='1558.0' x2='1566.0' y1='83.2' y2='83.2' stroke-width='1.2'/><text x='1562.0' y='332.0' text-anchor='middle' font-size='11' font-weight='700' fill='#ffffff'>1</text><text class='sa-text' text-anchor='end' font-size='12' transform='translate(1553.0 354.0) rotate(-35)'>LGBMGain</text><rect class='sa-hit' x='1514.0' y='40' width='66' height='300' data-tip='LGBMGain&#10;no time-outs (32 datasets): Elo 1336 (1295 to 1378), rank 2&#10;with random fallback (71 datasets): Elo 1379 (1348 to 1410), rank 1'/><line class='sa-ink' x1='62' x2='1580' y1='340.0' y2='340.0' stroke-opacity='0.5'/><rect x='596.0' y='10' width='14' height='14' fill='#0072B2'/><text class='sa-text' x='616.0' y='22' font-size='12'>with random fallback (71 datasets)</text><rect x='871.2' y='10' width='14' height='14' fill='#F2CFB2'/><text class='sa-text' x='891.2' y='22' font-size='12'>no time-outs (32 datasets)</text></svg><script type='text/plain' id='sa-csv'>results,method,elo,elo_ci_low,elo_ci_high
with random fallback (71 datasets),LGBMGain,1378.8,1348.2,1409.9
with random fallback (71 datasets),CD-PFN,1335.7,1308.9,1361.9
with random fallback (71 datasets),RFImportance,1309.1,1279.2,1339.2
with random fallback (71 datasets),LassoNet,1298.1,1267.7,1329.0
with random fallback (71 datasets),PACE-HSIC,1289.1,1266.0,1312.1
with random fallback (71 datasets),PACE-DC,1272.4,1247.6,1297.0
with random fallback (71 datasets),CART,1265.2,1236.2,1296.4
with random fallback (71 datasets),SHAP,1258.3,1223.6,1294.1
with random fallback (71 datasets),ElasticNet,1258.1,1224.7,1288.3
with random fallback (71 datasets),PACE-SIS,1248.1,1222.6,1274.8
with random fallback (71 datasets),MI,1246.3,1222.2,1271.0
with random fallback (71 datasets),CPI,1235.3,1204.6,1267.1
with random fallback (71 datasets),Lasso,1232.1,1199.6,1261.2
with random fallback (71 datasets),F-Test,1230.2,1202.8,1257.4
with random fallback (71 datasets),MarkovBlanket,1220.1,1192.8,1248.5
with random fallback (71 datasets),(R)ReliefF,1198.2,1167.3,1229.6
with random fallback (71 datasets),mRMR,1197.6,1168.8,1226.1
with random fallback (71 datasets),GainRatio,1183.3,1153.9,1212.8
with random fallback (71 datasets),SFS,1178.3,1145.1,1207.7
with random fallback (71 datasets),SBE,1174.5,1132.9,1213.2
with random fallback (71 datasets),LOCO,1149.5,1116.9,1180.9
with random fallback (71 datasets),Random,1000.0,961.1,1035.8
with random fallback (71 datasets),LaplacianScore,975.8,918.8,1022.2
no time-outs (32 datasets),CD-PFN,1369.4,1337.2,1405.1
no time-outs (32 datasets),LGBMGain,1335.5,1295.0,1378.3
no time-outs (32 datasets),PACE-HSIC,1305.7,1271.0,1342.3
no time-outs (32 datasets),PACE-DC,1296.5,1261.4,1334.9
no time-outs (32 datasets),SBE,1293.2,1253.9,1333.5
no time-outs (32 datasets),LassoNet,1290.9,1255.1,1328.9
no time-outs (32 datasets),RFImportance,1276.7,1234.7,1323.9
no time-outs (32 datasets),SHAP,1274.9,1226.9,1327.3
no time-outs (32 datasets),PACE-SIS,1272.0,1234.8,1310.8
no time-outs (32 datasets),MI,1263.4,1225.6,1299.2
no time-outs (32 datasets),CART,1250.0,1206.3,1296.2
no time-outs (32 datasets),F-Test,1243.6,1207.2,1279.6
no time-outs (32 datasets),CPI,1236.3,1186.0,1279.6
no time-outs (32 datasets),ElasticNet,1227.8,1182.6,1270.5
no time-outs (32 datasets),MarkovBlanket,1226.4,1180.0,1270.2
no time-outs (32 datasets),mRMR,1222.3,1186.9,1254.8
no time-outs (32 datasets),Lasso,1212.9,1171.9,1252.9
no time-outs (32 datasets),(R)ReliefF,1202.0,1157.7,1244.5
no time-outs (32 datasets),SFS,1200.1,1149.9,1246.1
no time-outs (32 datasets),GainRatio,1195.6,1156.6,1235.2
no time-outs (32 datasets),LOCO,1194.8,1155.4,1234.5
no time-outs (32 datasets),Random,1000.0,933.0,1052.5
no time-outs (32 datasets),LaplacianScore,989.8,909.9,1056.8
</script><script>
// Theme: the Space sets data-theme on this page when its theme button was used (same origin), or
// sends {saTheme: 'light' | 'dark' | null}; without either, the page follows the system setting.
(function () {
function apply(theme) {
if (theme === 'light' || theme === 'dark') document.documentElement.setAttribute('data-theme', theme);
else document.documentElement.removeAttribute('data-theme');
}
try { apply(window.parent.document.documentElement.getAttribute('data-theme')); } catch (e) {}
window.addEventListener('message', function (event) {
if (event.data && 'saTheme' in event.data) apply(event.data.saTheme);
});
})();
function saDownload(name, blob) {
var a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = name;
document.body.appendChild(a);
a.click();
setTimeout(function () { URL.revokeObjectURL(a.href); a.remove(); }, 500);
}
function saCsv(name) {
saDownload(name, new Blob([document.getElementById('sa-csv').textContent], {type: 'text/csv'}));
}
// Report the page height to an embedding page (the Space resizes its iframe to it).
(function () {
function post() {
try {
var height = Math.ceil(document.body.getBoundingClientRect().height) + 4;
if (window.parent !== window) window.parent.postMessage({saFrameHeight: height}, '*');
} catch (e) {}
}
window.addEventListener('load', post);
window.addEventListener('resize', post);
if (window.ResizeObserver) new ResizeObserver(post).observe(document.body);
})();
// Instant tooltip: a native SVG <title> only shows after a browser delay of 1-3 s.
(function () {
var tip = document.createElement('div');
tip.id = 'sa-tip';
document.body.appendChild(tip);
var current = null;
function show(hit, x, y) {
if (current !== hit) {
if (current) current.classList.remove('sa-on');
current = hit;
hit.classList.add('sa-on');
var lines = hit.getAttribute('data-tip').split('\n');
tip.textContent = '';
var head = document.createElement('b');
head.textContent = lines[0];
tip.appendChild(head);
tip.appendChild(document.createTextNode('\n' + lines.slice(1).join('\n')));
tip.style.display = 'block';
}
var w = tip.offsetWidth, h = tip.offsetHeight;
var left = x + 14, top = y + 14;
if (left + w > window.innerWidth - 4) left = Math.max(4, x - w - 14);
if (top + h > window.innerHeight - 4) top = Math.max(4, y - h - 14);
tip.style.left = left + 'px';
tip.style.top = top + 'px';
}
function hide() {
if (current) current.classList.remove('sa-on');
current = null;
tip.style.display = 'none';
}
document.addEventListener('pointermove', function (e) {
var hit = e.target.closest ? e.target.closest('.sa-hit') : null;
if (hit) show(hit, e.clientX, e.clientY); else if (e.pointerType === 'mouse') hide();
});
document.addEventListener('pointerdown', function (e) { // touch: tap a bar to show, elsewhere to hide
var hit = e.target.closest ? e.target.closest('.sa-hit') : null;
if (hit) show(hit, e.clientX, e.clientY); else hide();
});
document.addEventListener('mouseleave', hide);
})();
// Downloads always use the light colours (the paper look), whatever the page's theme.
var SA_LIGHT = {'--fg': '#1f2328', '--muted': '#59636e', '--line': '#d1d9e0', '--bg': '#ffffff',
'--soft': '#f6f8fa', '--accent': '#0072B2'};
function saSvgString() {
var svg = document.getElementById('sa-figure').cloneNode(true);
var style = svg.querySelector('style');
var css = style.textContent;
Object.keys(SA_LIGHT).forEach(function (v) { css = css.split('var(' + v + ')').join(SA_LIGHT[v]); });
style.textContent = css;
svg.querySelectorAll('.sa-hit').forEach(function (hit) { hit.remove(); });
svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
return new XMLSerializer().serializeToString(svg);
}
function saSvg(name) {
saDownload(name + '.svg', new Blob([saSvgString()], {type: 'image/svg+xml'}));
}
function saPng(name) {
var svg = document.getElementById('sa-figure');
var box = svg.viewBox.baseVal, scale = 3;
var img = new Image();
img.onload = function () {
var canvas = document.createElement('canvas');
canvas.width = box.width * scale; canvas.height = box.height * scale;
var ctx = canvas.getContext('2d');
ctx.fillStyle = SA_LIGHT['--bg'];
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
canvas.toBlob(function (blob) { saDownload(name + '.png', blob); });
};
img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(saSvgString());
}
// PDF. In the leaderboard, the page sends the figure's SVG to it (message {saPdf}), which makes a
// vector PDF (the Space's assets/downloads.js) and answers {saPdfAck}. Without an answer (the page
// alone or elsewhere), the PDF holds the figure rendered at 4x as a JPEG: one page of the figure's
// size (1 px = 0.75 pt), built by hand as the pages are self-contained, without any library.
function saPdfBlob(canvas, widthPt, heightPt) {
var jpeg = atob(canvas.toDataURL('image/jpeg', 0.95).split(',')[1]);
var w = widthPt.toFixed(2), h = heightPt.toFixed(2);
var content = 'q ' + w + ' 0 0 ' + h + ' 0 0 cm /Im0 Do Q';
var objects = [
'<< /Type /Catalog /Pages 2 0 R >>',
'<< /Type /Pages /Kids [3 0 R] /Count 1 >>',
'<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ' + w + ' ' + h + '] /Resources << /XObject << /Im0 5 0 R >> >> /Contents 4 0 R >>',
'<< /Length ' + content.length + ' >>\nstream\n' + content + '\nendstream',
'<< /Type /XObject /Subtype /Image /Width ' + canvas.width + ' /Height ' + canvas.height +
' /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ' + jpeg.length + ' >>\nstream\n' + jpeg + '\nendstream'
];
var pdf = '%PDF-1.4\n', offsets = [];
objects.forEach(function (body, i) { offsets.push(pdf.length); pdf += (i + 1) + ' 0 obj\n' + body + '\nendobj\n'; });
var xref = pdf.length;
pdf += 'xref\n0 ' + (objects.length + 1) + '\n0000000000 65535 f \n';
offsets.forEach(function (o) { pdf += ('0000000000' + o).slice(-10) + ' 00000 n \n'; });
pdf += 'trailer\n<< /Size ' + (objects.length + 1) + ' /Root 1 0 R >>\nstartxref\n' + xref + '\n%%EOF';
var bytes = new Uint8Array(pdf.length);
for (var i = 0; i < pdf.length; i++) bytes[i] = pdf.charCodeAt(i) & 0xff;
return new Blob([bytes], {type: 'application/pdf'});
}
var saPdfPending = {};
window.addEventListener('message', function (event) {
var name = event.data && event.data.saPdfAck;
if (typeof name === 'string' && saPdfPending[name]) { clearTimeout(saPdfPending[name]); delete saPdfPending[name]; }
});
function saPdf(name) {
var svg = document.getElementById('sa-figure');
var box = svg.viewBox.baseVal;
if (window.parent !== window && !saPdfPending[name + '.pdf']) {
saPdfPending[name + '.pdf'] = setTimeout(function () {
delete saPdfPending[name + '.pdf'];
saRasterPdf(name);
}, 1500);
window.parent.postMessage({saPdf: {svg: saSvgString(), width: box.width, height: box.height, name: name + '.pdf'}}, '*');
return;
}
if (window.parent === window) saRasterPdf(name);
}
function saRasterPdf(name) {
var svg = document.getElementById('sa-figure');
var box = svg.viewBox.baseVal, scale = 4;
var img = new Image();
img.onload = function () {
var canvas = document.createElement('canvas');
canvas.width = box.width * scale; canvas.height = box.height * scale;
var ctx = canvas.getContext('2d');
ctx.fillStyle = SA_LIGHT['--bg'];
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
saDownload(name + '.pdf', saPdfBlob(canvas, box.width * 0.75, box.height * 0.75));
};
img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(saSvgString());
}
</script></body></html>