{"id":16269,"date":"2025-12-08T09:40:24","date_gmt":"2025-12-08T00:40:24","guid":{"rendered":"https:\/\/f1-lap-time.com\/?page_id=16269"},"modified":"2026-03-06T19:44:54","modified_gmt":"2026-03-06T10:44:54","slug":"%e3%80%90%e3%82%a2%e3%83%96%e3%83%80%e3%83%93gp%e3%80%91%e3%83%a9%e3%83%83%e3%83%97%e3%82%bf%e3%82%a4%e3%83%a0%e3%81%a8%e3%82%ae%e3%83%a3%e3%83%83%e3%83%97","status":"publish","type":"page","link":"https:\/\/f1-lap-time.com\/?page_id=16269","title":{"rendered":"\u3010\u30a2\u30d6\u30c0\u30d3GP\u3011\u30e9\u30c3\u30d7\u30bf\u30a4\u30e0\u3068\u30ae\u30e3\u30c3\u30d7"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"ja\">\n<head>\n\n<title>Race\u00a0Lap\u00a0Time\u00a0Interactive\u00a0Graph<\/title>\n<script src=\"https:\/\/cdn.plot.ly\/plotly-2.26.0.min.js\"><\/script>\n<style>\n body{margin:20px;background:#fff;color:#000;}\n .driver-toggle{display:inline-block;padding:4px 8px;margin:2px 4px;border:1px solid #ccc;border-radius:4px;cursor:pointer;user-select:none;font-weight:bold;color:#000;}\n .driver-toggle.active{border:1px solid #000;}\n #selectAll,#clearAll{margin-left:10px;padding:6px 12px;cursor:pointer;font-size:1.1em;}\n \/* \u2014\u2014 \u30dc\u30bf\u30f3\u307e\u308f\u308a\u3092 Times New Roman \u306b \u2014\u2014 *\/\n #controls,\n #controls strong,\n .driver-toggle,\n #selectAll,\n #clearAll{font-family:\"Times New Roman\",serif;}\n<\/style>\n<\/head>\n<body>\n<h2>Lap\u00a0Times<\/h2>\n<div id=\"controls\">\n  <strong>Drivers:<\/strong>\n  <span id=\"driverButtons\"><\/span>\n  <button id=\"selectAll\">Select\u00a0All<\/button>\n  <button id=\"clearAll\">Clear\u00a0All<\/button>\n<\/div>\n<div id=\"lapChart\" style=\"width:100%;max-width:1200px;height:520px;\"><\/div>\n\n<h2>Gap\u00a0to\u00a0Leader<\/h2>\n<div id=\"gapChart\" style=\"width:100%;max-width:1200px;height:650px;\"><\/div>\n\n<script>\nconst DATA_FILE=\"abu_dhabi_2025_lap_times.tsv\";\nconst DRIVERS=[\"VER\",\"TSU\",\"NOR\",\"PIA\",\"LEC\",\"HAM\",\"RUS\",\"ANT\",\"ALO\",\"STR\",\"GAS\",\"COL\",\"OCO\",\"BEA\",\"HAD\",\"LAW\",\"ALB\",\"SAI\",\"HUL\",\"BOR\"];\nconst NAME_MAP={\"Max VERSTAPPEN\":\"VER\",\"Yuki TSUNODA\":\"TSU\",\"Lando NORRIS\":\"NOR\",\"Oscar PIASTRI\":\"PIA\",\"Charles LECLERC\":\"LEC\",\"Lewis HAMILTON\":\"HAM\",\"George RUSSELL\":\"RUS\",\"Kimi ANTONELLI\":\"ANT\",\"Fernando ALONSO\":\"ALO\",\"Lance STROLL\":\"STR\",\"Pierre GASLY\":\"GAS\",\"Franco COLAPINTO\":\"COL\",\"Esteban OCON\":\"OCO\",\"Oliver BEARMAN\":\"BEA\",\"Isack HADJAR\":\"HAD\",\"Liam LAWSON\":\"LAW\",\"Alexander ALBON\":\"ALB\",\"Carlos SAINZ\":\"SAI\",\"Nico HULKENBERG\":\"HUL\",\"Gabriel BORTOLETO\":\"BOR\"};\nconst DRIVER_COLORS={VER:\"rgb(0,32,96)\",TSU:\"rgb(102,255,0)\",NOR:\"rgb(255,128,0)\",PIA:\"rgb(255,192,128)\",LEC:\"rgb(255,0,0)\",HAM:\"rgb(255,192,192)\",RUS:\"rgb(166,166,166)\",ANT:\"rgb(0,176,80)\",ALO:\"rgb(0,176,240)\",STR:\"rgb(0,112,112)\",GAS:\"rgb(0,128,255)\",COL:\"rgb(255,0,255)\",OCO:\"rgb(0,0,0)\",BEA:\"rgb(128,128,128)\",HAD:\"rgb(112,48,160)\",LAW:\"rgb(180,198,231)\",ALB:\"rgb(192,176,224)\",SAI:\"rgb(0,112,192)\",HUL:\"rgb(255,193,37)\",BOR:\"rgb(192,0,0)\"};\nconst WHITE_TEXT=new Set([\"VER\",\"OCO\",\"HAD\",\"STR\",\"GAS\",\"BEA\",\"SAI\",\"BOR\"]);\nconst timeStrToSec=s=>{if(!s)return null;const[m,rest]=s.split(\":\");return parseInt(m,10)*60+parseFloat(rest)};\nconst secToTime=s=>{const m=Math.floor(s\/60);return m+\":\"+(\"0\"+(s-m*60).toFixed(3)).slice(-6)};\n\n\/\/ \u2605 \u9078\u629e\u9806\u3092\u51e1\u4f8b\u30bd\u30fc\u30c8\u306b\u4f1d\u3048\u308b\u305f\u3081\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\nlet legendCounter=0;\n\nfetch(DATA_FILE).then(r=>r.text()).then(tsv=>{\n  const rows=tsv.trim().split(\/\\r?\\n\/).map(l=>l.split(\"\\t\"));\n  const headers=rows[0];\n  const lapCnt=rows.length-1;\n  const laps=[],times={},cum={};\n  DRIVERS.forEach(d=>{times[d]=[];cum[d]=[]});\n  for(let i=1;i<rows.length;i++){\n    const cells=rows[i],lap=parseInt(cells[0],10);laps.push(lap);\n    const row={};for(let j=1;j<cells.length;j++)row[headers[j]]=cells[j];\n    DRIVERS.forEach(d=>{\n      const full=Object.keys(NAME_MAP).find(k=>NAME_MAP[k]===d);\n      const t=timeStrToSec(row[full]);\n      times[d].push(t);\n      cum[d].push((i>1?cum[d][i-2]:0)+(t??0));\n    });\n  }\n  let fastest=Infinity;DRIVERS.forEach(d=>times[d].forEach(v=>{if(v&&v<fastest)fastest=v}));\n  const yMin=Math.floor(fastest),yMax=yMin+8,tickVals=Array.from({length:yMax-yMin+1},(_,k)=>yMin+k);\n\n  const within={};DRIVERS.forEach(d=>within[d]=Array(lapCnt).fill(false));\n  for(let i=0;i<lapCnt;i++){\n    const running=DRIVERS.filter(d=>times[d][i]!=null).sort((a,b)=>cum[a][i]-cum[b][i]);\n    for(let j=1;j<running.length;j++)if(cum[running[j]][i]-cum[running[j-1]][i]<=2)within[running[j]][i]=true;\n  }\n\n  const tracesLap=[],tracesGap=[];\n  DRIVERS.forEach(d=>{\n    \/\/ \u2605 \u521d\u671f\u72b6\u614b\u3067 trace \u306f\u4e0d\u53ef\u8996 & showlegend false\n    tracesLap.push({\n      name:d,\n      x:laps,y:times[d],\n      mode:\"lines\",\n      line:{color:DRIVER_COLORS[d],width:2},\n      visible:false,\n      showlegend:false\n    });\n    tracesLap.push({\n      x:laps,y:times[d],\n      mode:\"markers\",\n      marker:{\n        size:6,\n        color:within[d].map(f=>f?\"#ffffff\":DRIVER_COLORS[d]),\n        symbol:\"circle\",\n        line:{color:DRIVER_COLORS[d],width:2}\n      },\n      hoverinfo:\"skip\",\n      showlegend:false,\n      visible:false\n    });\n    tracesGap.push({\n      name:d,\n      x:laps,y:cum[d].map((v,i)=>{\n        if(times[d][i]==null)return null;\n        const live=DRIVERS.filter(x=>times[x][i]!=null);\n        const leader=live.reduce((m,x)=>cum[x][i]<cum[m][i]?x:m,live[0]);\n        return v-cum[leader][i];\n      }),\n      mode:\"lines\",\n      connectgaps:false,\n      line:{color:DRIVER_COLORS[d],width:2},\n      visible:false,\n      showlegend:false\n    });\n  });\n\n  const fontAll={family:\"Times New Roman, Times, serif\"};\n  const legendCfg={itemclick:false,itemdoubleclick:false};\n  Plotly.newPlot(\"lapChart\",tracesLap,{\n    font:fontAll,\n    legend:legendCfg,\n    xaxis:{title:{text:\"Lap\",font:fontAll},tickfont:fontAll},\n    yaxis:{title:{text:\"Time (m:s)\",font:fontAll},tickfont:fontAll,range:[yMax,yMin],autorange:false,tickvals:tickVals,ticktext:tickVals.map(secToTime)},\n    margin:{t:40}}, {responsive:true});\n\n  Plotly.newPlot(\"gapChart\",tracesGap,{\n    font:fontAll,\n    legend:legendCfg,\n    xaxis:{title:{text:\"Lap\",font:fontAll},tickfont:fontAll},\n    yaxis:{title:{text:\"Gap (s)\",font:fontAll},tickfont:fontAll},\n    margin:{t:40}}, {responsive:true});\n\n  const box=document.getElementById(\"driverButtons\");\n\n  \/\/ \u2605 \u3053\u3053\u304c\u51e1\u4f8b\u5236\u5fa1\u306e\u30b3\u30a2\n  function showDriver(idx){\n    const lineIdx=2*idx,markerIdx=lineIdx+1;\n    legendCounter+=1;\n    Plotly.restyle(\"lapChart\",\n      {visible:true,showlegend:true,legendrank:legendCounter},[lineIdx]);\n    Plotly.restyle(\"lapChart\",{visible:true},[markerIdx]);\n    Plotly.restyle(\"gapChart\",\n      {visible:true,showlegend:true,legendrank:legendCounter},[idx]);\n  }\n  function hideDriver(idx){\n    const lineIdx=2*idx,markerIdx=lineIdx+1;\n    Plotly.restyle(\"lapChart\",\n      {visible:false,showlegend:false,legendrank:null},[lineIdx]);\n    Plotly.restyle(\"lapChart\",{visible:false},[markerIdx]);\n    Plotly.restyle(\"gapChart\",\n      {visible:false,showlegend:false,legendrank:null},[idx]);\n  }\n\n  const toggle=(d,btn)=>{\n    const idx=DRIVERS.indexOf(d);\n    if(btn.classList.toggle(\"active\")){\n      showDriver(idx);\n    }else{\n      hideDriver(idx);\n    }\n  };\n\n  DRIVERS.forEach(d=>{\n    const b=document.createElement(\"span\");\n    b.textContent=d;\n    b.className=\"driver-toggle\";\n    b.style.backgroundColor=DRIVER_COLORS[d];\n    if(WHITE_TEXT.has(d))b.style.color=\"#fff\";\n    b.onclick=()=>toggle(d,b);\n    box.appendChild(b);\n  });\n\n  \/\/ \u2605 Select\u00a0All\u00a0= \u3059\u3079\u3066\u8868\u793a\uff0b\u51e1\u4f8b\u9806\u3092\u521d\u671f\u5316\n  document.getElementById(\"selectAll\").onclick=()=>{\n    legendCounter=0;  \/\/ 0 \u304b\u3089\u632f\u308a\u76f4\u3057\n    document.querySelectorAll('.driver-toggle').forEach((btn,idx)=>{\n      if(!btn.classList.contains('active'))btn.classList.add('active');\n      legendCounter+=1;\n      const lineIdx=2*idx,markerIdx=lineIdx+1;\n      Plotly.restyle(\"lapChart\",\n        {visible:true,showlegend:true,legendrank:legendCounter},[lineIdx]);\n      Plotly.restyle(\"lapChart\",{visible:true},[markerIdx]);\n      Plotly.restyle(\"gapChart\",\n        {visible:true,showlegend:true,legendrank:legendCounter},[idx]);\n    });\n  };\n\n  \/\/ \u2605 Clear\u00a0All\u00a0= \u3059\u3079\u3066\u975e\u8868\u793a\uff0b\u30ab\u30a6\u30f3\u30bf\u30ea\u30bb\u30c3\u30c8\n  document.getElementById(\"clearAll\").onclick=()=>{\n    legendCounter=0;\n    document.querySelectorAll('.driver-toggle.active').forEach(btn=>{\n      const idx=DRIVERS.indexOf(btn.textContent);\n      btn.classList.remove('active');\n      hideDriver(idx);\n    });\n  };\n}).catch(e=>{\n  console.error(e);\n  alert(\"TSV \u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\");\n});\n<\/script>\n<\/body>\n<\/html>\n\n\n\n<p class=\"has-medium-font-size\"><strong>\u6ce8\u610f\u70b9\uff1a<\/strong><\/p>\n\n\n\n<p>\u30e9\u30c3\u30d7\u30bf\u30a4\u30e0\u30b0\u30e9\u30d5\u306b\u304a\u3044\u3066\u3001\u30c0\u30fc\u30c6\u30a3\u30a8\u30a2\u306e\u30e9\u30c3\u30d7\uff08\u524d\u65b92\u79d2\u4ee5\u5185\u306b\u4ed6\u8eca\u304c\u3044\u308b\uff09\u306f\u5404\u30c7\u30fc\u30bf\u70b9\u3092\u767d\u629c\u304d\u3001\u30af\u30ea\u30a2\u30a8\u30a2\u306e\u30e9\u30c3\u30d7\u306f\u5857\u308a\u3064\u3076\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/press.pirelli.com\/norris-chooses-a-different-tyre-strategy-to-seal-his-first-title\/\" target=\"_blank\" rel=\"noopener\" title=\"\">\u5404\u30c9\u30e9\u30a4\u30d0\u30fc\u306e\u4f7f\u7528\u30bf\u30a4\u30e4\u306f\u30d4\u30ec\u30ea\u516c\u5f0f\u3088\u308a<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Race\u00a0Lap\u00a0Time\u00a0Interactive\u00a0Graph Lap\u00a0Times Drivers: Select\u00a0All Clear\u00a0All Gap\u00a0to\u00a0Leader \u6ce8\u610f\u70b9\uff1a \u30e9\u30c3\u30d7\u30bf\u30a4\u30e0\u30b0\u30e9\u30d5\u306b\u304a\u3044\u3066\u3001\u30c0\u30fc\u30c6\u30a3\u30a8 [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":16273,"parent":13702,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-16269","page","type-page","status-publish","has-post-thumbnail","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/pages\/16269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16269"}],"version-history":[{"count":1,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/pages\/16269\/revisions"}],"predecessor-version":[{"id":16272,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/pages\/16269\/revisions\/16272"}],"up":[{"embeddable":true,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/pages\/13702"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=\/wp\/v2\/media\/16273"}],"wp:attachment":[{"href":"https:\/\/f1-lap-time.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}