diff --git a/.idea/claudeCodeEditorTabs.xml b/.idea/claudeCodeEditorTabs.xml deleted file mode 100644 index 057cca1..0000000 --- a/.idea/claudeCodeEditorTabs.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 5639e0a..bb761f3 100644 --- a/README.md +++ b/README.md @@ -32,14 +32,19 @@ To view it locally: make site # serves at http://localhost:8080 ``` -**Dashboard features:** - -- **Scalability charts** — when a single dataset is selected, Performance charts switch to line charts (X = graph size in triples) showing how each engine scales -- **W3C Conformance** — live pass/fail results fetched from [corese-stack.github.io/corese-w3c](https://corese-stack.github.io/corese-w3c/data/w3c-report.json) (All mode only) -- **Shareable URLs** — state (dataset, engine filter, reference engine) is encoded in the URL (`?ds=dbpedia&engines=corese.4.6.5,jena.6.2.0&ref=corese.4.6.5`) -- **Export CSV** — exports the currently filtered results directly from the browser (Full results section) -- **Engine filter** — click engine cards to filter charts; click × on pills to remove from comparison -- **SPARQL section** — per-engine latency cards, median per query, color-coded comparison table +**Dashboard features (v2):** + +- **Per-dataset pages** — Bowlogna, BSBM, LUBM, DBpedia each have two sub-sections: *Ingestion & Memory* and *SPARQL Queries* +- **Ingestion charts** — heap memory over time (bi-axis), average throughput (t/s), average CPU usage (%) — all side by side +- **SPARQL query chart** — grouped bar chart per query, with hatched bars for timeouts (> 60 s); log scale toggle on BSBM +- **Result tables** — sortable; filter by All / Best per File (ingestion) or All / Best per Query / PASS / Failures (queries) +- **Engine bar** — toggle engines on/off, drag-and-drop to reorder; order reflects in all charts +- **DBpedia Scale** — bilogarithmic scatter plot (triples × loading time) + memory efficiency chart +- **W3C Conformance** — live SPARQL 1.1 test results from [corese-stack.github.io/corese-w3c](https://corese-stack.github.io/corese-w3c/data/w3c-report.json) +- **Environment & Protocol** — machine specs, JVM flags, measurement protocol details +- **Export** — JSON (raw data), Query CSV, Markdown report, PDF +- **Per-chart actions** — PNG download (↓) and fullscreen expand (⛶) on every chart +- **Theme toggle** — dark / light mode, persisted in `localStorage` --- @@ -89,12 +94,7 @@ python python-utils/workflow.py \ #### 3. Read the result -Open `site/index.html`. The `corese.local` card shows: - -- `+X% improvement` (green) -- `−X% regression` (red) - -relative to `corese.4.6.5` as the fixed reference (100/100). +Open `site/index.html`. Navigate to the dataset page (Bowlogna, BSBM, LUBM, or DBpedia) to compare ingestion time, throughput, memory and CPU usage between `corese.local` and the reference engines. The SPARQL Queries sub-section shows per-query median latency and PASS/TIMEOUT/ERROR status. --- @@ -140,12 +140,12 @@ For datasets that have associated queries (Bowlogna, BSBM): python python-utils/workflow.py --engines corese.local,corese.4.6.5 --dataset bowlogna ``` -The **SPARQL Queries** section appears in the dashboard with: +The **SPARQL Queries** sub-section appears in the dashboard with: -- Per-engine latency cards: avg, p50, p95, p99 -- Median time per query and per engine -- Color-coded comparison table (green = best, orange = ×5–19, red = ×20+) -- `—` indicates timeout or error +- Grouped bar chart — median time per query per engine, hatched bars for timeouts +- Result table — sortable by query, engine, status, median ms, TTFR, row count +- Filters — All results / Best per Query / PASS only / Failures +- Click a status badge to inspect raw repetition times and result hash --- diff --git a/site/app.js b/site/app.js deleted file mode 100644 index 80169f7..0000000 --- a/site/app.js +++ /dev/null @@ -1,2481 +0,0 @@ -'use strict'; - -// ── Palette ─────────────────────────────────────────────────────────────────── -// -// Two levels: -// 1. ENGINE_FAMILIES → color by family (prefix before the first ".") -// e.g. all "corese.*" versions share the same blue -// 2. ENGINE_OVERRIDES → specific color for an exact engine name -// e.g. "corese.local" gets a lighter blue -// -// To add an engine: add an entry in ENGINE_FAMILIES or ENGINE_OVERRIDES. -// No match → color auto-assigned from AUTO_COLORS. - -const ENGINE_FAMILIES = { - // family hex bg (same hex + 0.75 opacity) - corese: { hex: '#4472C4', bg: 'rgba(68,114,196,0.75)' }, - jena: { hex: '#ED7D31', bg: 'rgba(237,125,49,0.75)' }, - rdf4j: { hex: '#70AD47', bg: 'rgba(112,173,71,0.75)' }, - oxigraph:{ hex: '#E05C5C', bg: 'rgba(224,92,92,0.75)' }, - blazegraph:{ hex: '#9B59B6', bg: 'rgba(155,89,182,0.75)'}, -}; - -const ENGINE_OVERRIDES = { - // Corese dev versions — light blue, same family as stable Corese - 'corese.local': { hex: '#5B9BD5', bg: 'rgba(91,155,213,0.75)' }, - 'corese.next': { hex: '#5B9BD5', bg: 'rgba(91,155,213,0.75)' }, -}; - -// Fallback colors auto-assigned (priority order) for unknown engines -const AUTO_COLORS = [ - { hex: '#E74C3C', bg: 'rgba(231,76,60,0.75)' }, - { hex: '#9B59B6', bg: 'rgba(155,89,182,0.75)' }, - { hex: '#1ABC9C', bg: 'rgba(26,188,156,0.75)' }, - { hex: '#F39C12', bg: 'rgba(243,156,18,0.75)' }, - { hex: '#2ECC71', bg: 'rgba(46,204,113,0.75)' }, - { hex: '#E91E63', bg: 'rgba(233,30,99,0.75)' }, - { hex: '#00BCD4', bg: 'rgba(0,188,212,0.75)' }, - { hex: '#FF5722', bg: 'rgba(255,87,34,0.75)' }, -]; - -// Known engine versions (order preserved in pills, filtered to what's in data) -const KNOWN_ENGINE_ORDER = [ - 'corese.next', 'corese.local', 'corese.4.6.5', 'corese.4.6.4', 'corese.4.6.3', - 'jena.6.2.0', 'jena.6.1.0', 'jena.6.0.0', - 'rdf4j.5.3.2', 'rdf4j.5.3.1', 'rdf4j.5.3.0', -]; - -// Dynamic resolution: builds engine → color map from data -let ENGINE_COLOR_MAP = {}; - -function buildColorMap(engines) { - let autoIdx = 0; - for (const engine of engines) { - if (ENGINE_COLOR_MAP[engine]) continue; // already assigned - - if (ENGINE_OVERRIDES[engine]) { - ENGINE_COLOR_MAP[engine] = ENGINE_OVERRIDES[engine]; - } else { - const family = engine.split('.')[0].toLowerCase(); - if (ENGINE_FAMILIES[family]) { - ENGINE_COLOR_MAP[engine] = ENGINE_FAMILIES[family]; - } else { - ENGINE_COLOR_MAP[engine] = AUTO_COLORS[autoIdx % AUTO_COLORS.length]; - autoIdx++; - } - } - } -} - -function pal(engineName) { - return ENGINE_COLOR_MAP[engineName] - ?? { hex: '#8b949e', bg: 'rgba(139,148,158,0.7)' }; -} - -function badgeCls(engineName) { - // Cherche la famille connue, sinon 'unknown' - const family = engineName.split('.')[0].toLowerCase(); - return ENGINE_FAMILIES[family] ? `badge-${family}` : 'badge-unknown'; -} - -// ── Data loading ────────────────────────────────────────────────────────────── -async function loadData() { - try { - const res = await fetch('data/benchmark-report.json'); - if (!res.ok) throw new Error(res.statusText); - return await res.json(); - } catch (_) { - if (typeof window.__BENCHMARK_DATA__ !== 'undefined') return window.__BENCHMARK_DATA__; - throw new Error('No data. Run the benchmark first.'); - } -} - -// ── Utilitaires ─────────────────────────────────────────────────────────────── -const fmt = (n, d = 0) => - n == null ? '—' : Number(n).toLocaleString('fr-FR', { maximumFractionDigits: d }); - -function shortFile(f) { return f.replace('_en.nt', '').replace(/_/g, ' '); } - -function formatDate(iso) { - return new Date(iso).toLocaleString('fr-FR', { - day: '2-digit', month: '2-digit', year: 'numeric', - hour: '2-digit', minute: '2-digit', - }); -} - -// ── Theme ───────────────────────────────────────────────────────────────────── -const THEMES = ['auto', 'light', 'dark']; -let themeIdx = THEMES.indexOf(localStorage.getItem('theme') ?? 'auto'); - -function applyTheme() { - const theme = THEMES[themeIdx]; - const icons = { auto: 'icon-auto', light: 'icon-sun', dark: 'icon-moon' }; - - if (theme === 'auto') document.documentElement.removeAttribute('data-theme'); - else document.documentElement.setAttribute('data-theme', theme); - - ['icon-auto', 'icon-sun', 'icon-moon'].forEach(id => { - const el = document.getElementById(id); - if (el) el.style.display = id === icons[theme] ? '' : 'none'; - }); - localStorage.setItem('theme', theme); -} - -document.getElementById('theme-toggle')?.addEventListener('click', () => { - themeIdx = (themeIdx + 1) % THEMES.length; - applyTheme(); -}); - -applyTheme(); - -// ── Dataset metadata ────────────────────────────────────────────────────────── -// -// Maps dataset label → { label, description, url } -// Add a new entry here when a new dataset is supported. -const DATASET_META = { - dbpedia: { - label: 'DBpedia', - description: 'Real-world RDF dump — 5 N-Triples files from DBpedia 3.5.1', - url: 'https://downloads.dbpedia.org/3.5.1/en/', - fileBaseUrl: 'https://downloads.dbpedia.org/3.5.1/en/', - hasSparql: false, - }, - bowlogna: { - label: 'Bowlogna', - description: 'Synthetic university dataset with SPARQL queries (HOBBIT benchmark)', - url: 'https://files.dice-research.org/projects/HOBBIT/benchmarks-data/datasets-dumps/bowlogna-dump.zip', - fileBaseUrl: null, - hasSparql: true, - }, - bsbm: { - label: 'BSBM', - description: 'Berlin SPARQL Benchmark — synthetic e-commerce dataset', - url: 'https://sourceforge.net/projects/bsbmtools/', - fileBaseUrl: null, - hasSparql: true, - }, - lubm: { - label: 'LUBM', - description: 'Lehigh University Benchmark — university domain with RDFS reasoning', - url: 'https://swat.cse.lehigh.edu/projects/lubm/', - fileBaseUrl: null, - hasSparql: true, - }, -}; - -function renderDatasetCards(runs, queries) { - const datasets = [...new Set(runs.map(r => r.dataset))]; - const grid = document.getElementById('dataset-grid'); - if (!grid) return; - const meta = document.getElementById('datasets-meta'); - if (meta) meta.textContent = `${datasets.length} dataset${datasets.length > 1 ? 's' : ''}`; - - grid.innerHTML = datasets.map(ds => { - const meta = DATASET_META[ds.toLowerCase()] ?? { label: ds, description: '', url: null }; - const dsRuns = runs.filter(r => r.dataset === ds); - const files = [...new Set(dsRuns.map(r => r.file))]; - const engines = [...new Set(dsRuns.map(r => r.engine))]; - const totalTrip = dsRuns.reduce((s, r) => s + r.triples, 0) / engines.length; - - const linkHtml = meta.url - ? ` - - Source - ` - : ''; - - // File tags - const fileTags = files.map(f => - `${shortFile(f)}` - ).join(''); - - // SPARQL queries collapsible (only if queries embedded in JSON et dataset hasSparql) - let queriesHtml = ''; - if (queries && queries.length > 0 && (DATASET_META[ds.toLowerCase()]?.hasSparql ?? false)) { - const queryItems = queries.map((q, i) => ` -
- Q${i + 1} -
${q.trim().replace(/
-        
`).join(''); - queriesHtml = ` -
- - - ${queries.length} SPARQL queries - -
${queryItems}
-
`; - } - - return ` -
-
- ${meta.label} - ${linkHtml} -
- ${meta.description ? `

${meta.description}

` : ''} -
-
-
Files
-
${files.length}
-
-
-
Total triples
-
${fmt(totalTrip, 0)}
-
-
-
Format
-
N-Triples (.nt)
-
-
-
${fileTags}
- ${queriesHtml} -
`; - }).join(''); -} - - -// ── Table sort state ───────────────────────────────────────────────────────── -let sortField = null; -let sortAsc = true; - -function initTableSort() { - document.querySelectorAll('th[data-sort]').forEach(th => { - th.style.cursor = 'pointer'; - th.addEventListener('click', () => { - const field = th.dataset.sort; - if (sortField === field) { - sortAsc = !sortAsc; - } else { - sortField = field; - sortAsc = true; - } - // Update indicators - document.querySelectorAll('th[data-sort]').forEach(h => { - h.classList.remove('sort-asc', 'sort-desc'); - }); - th.classList.add(sortAsc ? 'sort-asc' : 'sort-desc'); - updateTable(); - }); - }); -} - -// ── Engine filter state ─────────────────────────────────────────────────────── -// activeEngines: Set of selected engine names. Empty = all engines shown. -let activeEngines = new Set(); -let hiddenEngines = new Set(); // engines removed from comparator bar via × -let allCharts = {}; -let activeDatasets = new Set(); -let userRefEngine = localStorage.getItem('refEngine') ?? null; -let metadataQueries = null; - -// ── Header ──────────────────────────────────────────────────────────────────── - -function renderHeader(meta, runs) { - const datasets = [...new Set(runs.map(r => r.dataset))]; - const engines = [...new Set(runs.map(r => r.engine))]; - - - const enginePills = document.getElementById('engine-pills'); - if (enginePills) { - const sorted = [ - ...KNOWN_ENGINE_ORDER.filter(e => engines.includes(e)), - ...engines.filter(e => !KNOWN_ENGINE_ORDER.includes(e)), - ]; - enginePills.innerHTML = sorted.map(engine => { - const dot = engine.indexOf('.'); - const family = dot >= 0 ? engine.slice(0, dot) : engine; - const version = dot >= 0 ? engine.slice(dot + 1) : engine; - const p = pal(engine); - return `
- ${family} - ${version} - -
`; - }).join(''); - // Attach drag handlers to newly created pills - enginePills.querySelectorAll('.engine-pill[data-engine]').forEach(attachPillDragHandlers); - } -} - -function renderSidebarMeta(meta, engines, runs, queryRuns) { - // Badges - const datasets = [...new Set(runs.map(r => r.dataset))]; - const el = id => document.getElementById(id); - if (el('sidebar-badge-datasets')) el('sidebar-badge-datasets').textContent = datasets.length; - if (el('sidebar-badge-engines')) el('sidebar-badge-engines').textContent = engines.length; - if (el('sidebar-badge-results')) el('sidebar-badge-results').textContent = runs.length; - if (queryRuns && queryRuns.length > 0) { - const queryIds = [...new Set(queryRuns.map(r => r.queryId))]; - if (el('sidebar-badge-sparql')) el('sidebar-badge-sparql').textContent = queryIds.length + ' q'; - const sparqlNav = document.getElementById('sidebar-sparql-nav'); - if (sparqlNav) sparqlNav.style.display = ''; - } - // Footer meta - const box = document.getElementById('sidebar-meta'); - if (box) { - const rows = [ - ['Date', formatDate(meta.generatedAt)], - ['Java', `${meta.java ?? '—'}`], - ['OS', meta.os ?? '—'], - ['Protocol', meta.protocol ? `${meta.protocol.repetitions} reps + warmup` : '—'], - ]; - box.innerHTML = ` - Run context -
- ${rows.map(([k, v]) => `
${k}
${v}
`).join('')} -
- `; - } -} - -// ── Run info bar ────────────────────────────────────────────────────────────── -function renderRunInfo(meta) { - document.getElementById('info-date').textContent = formatDate(meta.generatedAt); - document.getElementById('info-java').textContent = meta.java ?? '—'; - document.getElementById('info-os').textContent = meta.os ?? '—'; - document.getElementById('info-protocol').textContent = - `${meta.protocol.repetitions} repetitions + warmup`; -} - -// ── KPIs ────────────────────────────────────────────────────────────────────── -let _overviewBarChart = null; -let _overviewRadarChart = null; - -function renderKPI(runs) { - if (!runs || runs.length === 0) return; - const engines = [...new Set(runs.map(r => r.engine))]; - const datasets = [...new Set(runs.map(r => r.dataset))]; - const files = [...new Set(runs.map(r => r.file))]; - - // Per-engine avg for the winner cards - const byEngine = {}; - engines.forEach(e => { - const er = runs.filter(r => r.engine === e); - byEngine[e] = { - avgThru: er.reduce((s,r) => s + r.throughputTriplesPerSec, 0) / er.length, - avgMem: er.reduce((s,r) => s + r.memoryDeltaMb, 0) / er.length, - avgTime: er.reduce((s,r) => s + r.loadingTimeMs, 0) / er.length, - }; - }); - - const bestThruEngine = engines.reduce((a,b) => byEngine[a].avgThru > byEngine[b].avgThru ? a : b); - const bestMemEngine = engines.reduce((a,b) => byEngine[a].avgMem < byEngine[b].avgMem ? a : b); - const bestTimeEngine = engines.reduce((a,b) => byEngine[a].avgTime < byEngine[b].avgTime ? a : b); - - function winnerCard(label, engine, value, sub) { - const p = pal(engine); - return `
-
${label}
-
- - ${engine} -
-
${value}
-
${sub}
-
`; - } - - const contextCard = `
-
${engines.length}engines
-
${datasets.length}datasets
-
${files.length}files
-
`; - - document.getElementById('metrics-grid').innerHTML = - winnerCard('Best throughput', bestThruEngine, - fmt(byEngine[bestThruEngine].avgThru, 0) + ' t/s', 'avg triples/s across all files') + - winnerCard('Best memory', bestMemEngine, - fmt(byEngine[bestMemEngine].avgMem, 1) + ' MB', 'avg memory Δ across all files') + - winnerCard('Best load time', bestTimeEngine, - fmt(byEngine[bestTimeEngine].avgTime, 0) + ' ms', 'avg loading time across all files') + - contextCard; - - const meta = document.getElementById('overview-meta'); - if (meta) meta.textContent = `${engines.length} engines · ${datasets.length} datasets · ${files.length} files`; - - _renderOverviewCharts(engines, byEngine); -} - -function _renderOverviewCharts(engines, byEngine) { - const isDark = document.documentElement.getAttribute('data-theme') !== 'light'; - const gridCol = isDark ? 'rgba(255,255,255,0.06)' : 'rgba(0,0,0,0.06)'; - const textCol = isDark ? '#8b949e' : '#57606a'; - - // ── Bar: avg loading time ───────────────────────────────────────────── - const barCtx = document.getElementById('chart-overview-bar')?.getContext('2d'); - if (barCtx) { - if (_overviewBarChart) _overviewBarChart.destroy(); - _overviewBarChart = new Chart(barCtx, { - type: 'bar', - data: { - labels: engines, - datasets: [{ - label: 'Avg load time', - data: engines.map(e => Math.round(byEngine[e].avgTime)), - backgroundColor: engines.map(e => pal(e).bg), - borderColor: engines.map(e => pal(e).hex), - borderWidth: 1, - borderRadius: 4, - }], - }, - options: { - responsive: true, - maintainAspectRatio: false, - plugins: { - legend: { display: false }, - tooltip: { callbacks: { label: ctx => ` ${ctx.raw.toLocaleString()} ms` } }, - }, - scales: { - x: { grid: { display: false }, ticks: { color: textCol, font: { size: 10 } } }, - y: { beginAtZero: true, grid: { color: gridCol }, ticks: { color: textCol, font: { size: 10 }, callback: v => v.toLocaleString() } }, - }, - }, - }); - } - - // ── Radar: normalized scores ────────────────────────────────────────── - const radarCtx = document.getElementById('chart-overview-radar')?.getContext('2d'); - if (radarCtx) { - if (_overviewRadarChart) _overviewRadarChart.destroy(); - - const maxThru = Math.max(...engines.map(e => byEngine[e].avgThru)); - const maxTime = Math.max(...engines.map(e => byEngine[e].avgTime)); - const maxMem = Math.max(...engines.map(e => byEngine[e].avgMem)); - - const radarDatasets = engines.map(e => { - const p = pal(e); - // Throughput: higher = better → normalize directly - // Load time: lower = better → invert - // Memory: lower = better → invert - const scoreThru = maxThru > 0 ? Math.round(byEngine[e].avgThru / maxThru * 100) : 0; - const scoreTime = maxTime > 0 ? Math.round((1 - (byEngine[e].avgTime - Math.min(...engines.map(x=>byEngine[x].avgTime))) / maxTime) * 100) : 100; - const scoreMem = maxMem > 0 ? Math.round((1 - (byEngine[e].avgMem - Math.min(...engines.map(x=>byEngine[x].avgMem))) / maxMem) * 100) : 100; - return { - label: e, - data: [scoreThru, scoreTime, scoreMem], - borderColor: p.hex, - backgroundColor: p.hex + '22', - pointBackgroundColor: p.hex, - borderWidth: 1.8, - pointRadius: 3, - }; - }); - - _overviewRadarChart = new Chart(radarCtx, { - type: 'radar', - data: { - labels: ['Throughput', 'Load speed', 'Memory efficiency'], - datasets: radarDatasets, - }, - options: { - responsive: true, - maintainAspectRatio: false, - plugins: { - legend: { position: 'bottom', labels: { boxWidth: 10, padding: 10, font: { size: 10 }, color: textCol } }, - }, - scales: { - r: { - min: 0, max: 100, - ticks: { display: false, stepSize: 25 }, - grid: { color: gridCol }, - angleLines: { color: gridCol }, - pointLabels: { font: { size: 11 }, color: textCol }, - }, - }, - }, - }); - } -} - -// ── Engine cards ────────────────────────────────────────────────────────────── -// Detects if an engine is a Corese development version -const isDevCorese = e => e === 'corese.local' || e === 'corese.next' || e.startsWith('corese.commit.'); -const isStableCorese = e => e.startsWith('corese.') && !isDevCorese(e); - -function renderEngineCards(runs) { - const engines = [...new Set(runs.map(r => r.engine))]; - - // Average throughput per engine - const avgThruMap = {}; - engines.forEach(engine => { - const eruns = runs.filter(r => r.engine === engine); - avgThruMap[engine] = eruns.reduce((s, r) => s + r.throughputTriplesPerSec, 0) / eruns.length; - }); - - // Reference: stable Corese version if present, otherwise the best engine - const stableCorese = engines.find(isStableCorese); - const maxAvgThru = Math.max(...Object.values(avgThruMap)); - const refEngine = userRefEngine && engines.includes(userRefEngine) - ? userRefEngine - : (stableCorese ?? engines.find(e => avgThruMap[e] === maxAvgThru)); - const refThru = avgThruMap[refEngine]; - - document.getElementById('engine-grid').innerHTML = engines.map(engine => { - const eruns = runs.filter(r => r.engine === engine); - const avgTime = eruns.reduce((s, r) => s + r.loadingTimeMs, 0) / eruns.length; - const avgMem = eruns.reduce((s, r) => s + r.memoryDeltaMb, 0) / eruns.length; - const avgThru = avgThruMap[engine]; - const score = Math.round(avgThru / refThru * 100); - const p = pal(engine); - - // Libellé "vitesse relative" selon le contexte - let relativeLabel, tooltip, scoreDisplay; - if (engine === refEngine) { - relativeLabel = '🏆 reference'; - tooltip = 'Stable Corese reference version'; - scoreDisplay = '100 / 100'; - } else if (stableCorese && isDevCorese(engine)) { - const delta = score - 100; - if (delta >= 0) { - relativeLabel = `📈 +${delta}% improvement`; - tooltip = `${delta}% faster than ${refEngine}`; - } else { - relativeLabel = `📉 ${delta}% regression`; - tooltip = `${Math.abs(delta)}% slower than ${refEngine}`; - } - scoreDisplay = `${score} / 100`; - } else { - const ratio = avgThru > 0 ? (refThru / avgThru).toFixed(1) : null; - relativeLabel = ratio === null ? '' : ratio > 1 ? `${ratio}× slower` : `${(1/ratio).toFixed(1)}× faster`; - tooltip = `Compared to ${refEngine}`; - scoreDisplay = `${score} / 100`; - } - - const meterW = Math.min(score, 100); // bar capped at 100% visually - - return ` -
-
- - - ${engine} - - - ${scoreDisplay} - - -
-
-
-
Avg. time
-
${fmt(avgTime, 0)} ms
-
-
-
Avg. throughput
-
${fmt(avgThru, 0)} t/s
-
-
-
Avg. memory
-
${fmt(avgMem, 1)} MB
-
-
-
Relative speed
-
${relativeLabel}
-
-
-
-
-
-
- `; - }).join(''); -} - -function syncEnginePills() { - document.querySelectorAll('.engine-pills-wrap .engine-pill[data-engine]').forEach(el => { - const e = el.dataset.engine; - el.classList.remove('ep-active', 'ep-dimmed'); - if (activeEngines.size > 0) { - if (activeEngines.has(e)) el.classList.add('ep-active'); - else el.classList.add('ep-dimmed'); - } - }); - // also sync engine cards in engine-grid - document.querySelectorAll('#engine-grid .suite-item[data-engine]').forEach(el => { - el.classList.toggle('active', activeEngines.has(el.dataset.engine)); - }); - const btn = document.getElementById('clear-engines-btn'); - if (btn) btn.style.display = activeEngines.size > 0 ? '' : 'none'; -} - -function getDatasetFilteredRuns() { - // Runs filtered only by dataset (not by engine) — used to keep all engine cards visible - return allRuns.filter(r => - !hiddenEngines.has(r.engine) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) - ); -} - -function toggleEngine(engine) { - if (activeEngines.has(engine)) { - activeEngines.delete(engine); - } else { - activeEngines.add(engine); - } - const filtered = getFilteredRuns(allRuns); - renderKPI(filtered); - renderEngineCards(getDatasetFilteredRuns()); // toujours toutes les cartes - syncEnginePills(); - updateCharts(); - updateTable(); - // Sync SPARQL section - document.querySelectorAll('.query-engine-card[data-engine]').forEach(el => { - const e = el.dataset.engine; - el.style.display = (activeEngines.size === 0 || activeEngines.has(e)) ? '' : 'none'; - }); - updateQueryChart(); - updateQueryTable(); - pushStateToUrl(); -} - -function clearEngineFilter() { - activeEngines.clear(); - const btn = document.getElementById('clear-engines-btn'); - if (btn) btn.style.display = 'none'; - renderEngineCards(getDatasetFilteredRuns()); - syncEnginePills(); - updateCharts(); - updateTable(); - pushStateToUrl(); -} - -function getFilteredRuns(runs) { - return runs.filter(r => - !hiddenEngines.has(r.engine) && - (activeEngines.size === 0 || activeEngines.has(r.engine)) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) - ); -} - -function hidePillEngine(engine) { - hiddenEngines.add(engine); - activeEngines.delete(engine); - // Remove pill from the comparator bar - document.querySelectorAll(`.engine-pills-wrap .engine-pill[data-engine="${engine}"]`).forEach(el => el.remove()); - const filtered = getFilteredRuns(allRuns); - renderKPI(filtered); - renderEngineCards(getDatasetFilteredRuns()); - syncEnginePills(); - updateCharts(); - updateTable(); - document.querySelectorAll('.query-engine-card[data-engine]').forEach(el => { - el.style.display = hiddenEngines.has(el.dataset.engine) ? 'none' : ''; - }); - updateQueryChart(); - updateQueryTable(); - updatePillsScrollBtns(); - pushStateToUrl(); -} - -function clearDatasetFilter() { - activeDatasets.clear(); - syncDatasetPills(); - updateCharts(); - updateTable(); - renderKPI(getFilteredRuns(allRuns)); - renderEngineCards(getDatasetFilteredRuns()); - const btn = document.getElementById('clear-engines-btn'); - if (btn) btn.style.display = activeEngines.size > 0 ? '' : 'none'; - updateQuerySectionVisibility(); - pushStateToUrl(); -} - -function updateQuerySectionVisibility() { - const sparqlSection = document.getElementById('section-sparql'); - const sparqlNav = document.getElementById('sidebar-sparql-nav'); - const hasSparql = activeDatasets.size > 0 && - [...activeDatasets].some(ds => DATASET_META[ds.toLowerCase()]?.hasSparql ?? false); - if (sparqlSection) sparqlSection.style.display = hasSparql ? '' : 'none'; - if (sparqlNav) sparqlNav.style.display = hasSparql ? '' : 'none'; -} - -function renderDatasetPills(runs) { - const wrap = document.getElementById('dataset-pills'); - if (!wrap) return; - const datasets = [...new Set(runs.map(r => r.dataset))]; - wrap.innerHTML = - `` + - datasets.map(ds => { - const meta = DATASET_META[ds.toLowerCase()] ?? { label: ds }; - const label = meta.label ?? ds; - return ``; - }).join(''); -} - -function syncDatasetPills() { - document.querySelectorAll('.dataset-pill[data-ds]').forEach(el => { - const ds = el.dataset.ds; - el.classList.toggle('active', ds === '' ? activeDatasets.size === 0 : activeDatasets.has(ds)); - }); - // Dataset cards: show only selected one (or all in All mode) - document.querySelectorAll('.dataset-card[data-ds]').forEach(el => { - const ds = el.dataset.ds; - el.classList.toggle('active', activeDatasets.has(ds)); - el.style.display = (activeDatasets.size === 0 || activeDatasets.has(ds)) ? '' : 'none'; - }); - _syncDatasetSections(); -} - -function _syncDatasetSections() { - const isAll = activeDatasets.size === 0; - - // All mode: show Overview + Datasets + W3C, hide detail sections - // Dataset selected: hide Overview + W3C, show detail sections - const overviewSection = document.getElementById('section-kpi'); - if (overviewSection) overviewSection.style.display = isAll ? '' : 'none'; - - const w3cSection = document.getElementById('section-w3c'); - if (w3cSection && w3cSection.innerHTML.trim()) w3cSection.style.display = isAll ? '' : 'none'; - - const w3cNav = document.getElementById('sidebar-w3c-nav'); - if (w3cNav) w3cNav.style.display = isAll ? '' : 'none'; - - // Bowlogna/BSBM are SPARQL-focused or single-file: hide Performance charts + Full results - const isBowlogna = activeDatasets.has('bowlogna'); - const isBsbm = activeDatasets.has('bsbm'); - const isLubm = activeDatasets.has('lubm'); - const hideCharts = isAll || isBowlogna || isBsbm || isLubm; - const hideResults = isAll || isBowlogna || isBsbm || isLubm; - - const enginesEl = document.getElementById('section-engines'); - if (enginesEl) enginesEl.style.display = isAll ? 'none' : ''; - const chartsEl = document.getElementById('section-charts'); - if (chartsEl) chartsEl.style.display = hideCharts ? 'none' : ''; - const resultsEl = document.getElementById('section-results'); - if (resultsEl) resultsEl.style.display = hideResults ? 'none' : ''; - - // Sidebar: Overview nav visible in All, hidden in dataset mode - document.querySelectorAll('.sidebar-nav-item[data-target="section-kpi"]').forEach(el => { - el.closest('li').style.display = isAll ? '' : 'none'; - }); - document.querySelectorAll('.sidebar-nav-item[data-target="section-engines"]').forEach(el => { - el.closest('li').style.display = isAll ? 'none' : ''; - }); - document.querySelectorAll('.sidebar-nav-item[data-target="section-charts"]').forEach(el => { - el.closest('li').style.display = hideCharts ? 'none' : ''; - }); - document.querySelectorAll('.sidebar-nav-item[data-target="section-results"]').forEach(el => { - el.closest('li').style.display = hideResults ? 'none' : ''; - }); - // Results group heading in sidebar - const resultsGroup = document.querySelector('.sidebar-group:last-of-type'); - if (resultsGroup) resultsGroup.style.display = isAll ? 'none' : ''; -} - -function toggleDataset(ds) { - if (activeDatasets.has(ds)) { - activeDatasets.clear(); // re-clic → tout afficher - } else { - activeDatasets.clear(); - activeDatasets.add(ds); // sélection exclusive - } - syncDatasetPills(); - Object.values(allCharts).forEach(c => c.destroy()); - allCharts = {}; - updateTable(); - renderKPI(getFilteredRuns(allRuns)); - renderEngineCards(getDatasetFilteredRuns()); - _refreshQuerySection(); - pushStateToUrl(); - if (activeDatasets.size > 0) { - requestAnimationFrame(() => requestAnimationFrame(() => { - initCharts(); - _updateChartsMeta(); - })); - } -} - -function _updateChartsMeta() { - const el = document.getElementById('charts-mode-meta'); - if (!el) return; - el.textContent = isScalabilityMode() - ? 'scalability view — X axis = graph size' - : ''; -} - -function _refreshQuerySection() { - // Always update visibility (hides SPARQL nav for datasets without SPARQL) - updateQuerySectionVisibility(); - if (!_allQueryRunsGlobal || _allQueryRunsGlobal.length === 0) return; - const hasSparql = activeDatasets.size > 0 && - [...activeDatasets].some(ds => DATASET_META[ds.toLowerCase()]?.hasSparql ?? false); - const filteredQueryRuns = hasSparql - ? _allQueryRunsGlobal.filter(r => activeDatasets.has(r.dataset)) - : []; - const sparqlSection = document.getElementById('section-sparql'); - if (sparqlSection) sparqlSection.innerHTML = ''; - if (filteredQueryRuns.length > 0) { - renderQuerySection(filteredQueryRuns); - // Re-apply hidden engines (renderQuerySection re-renders from scratch) - document.querySelectorAll('.query-engine-card[data-engine]').forEach(el => { - el.style.display = hiddenEngines.has(el.dataset.engine) ? 'none' : ''; - }); - updateQueryChart(); - updateQueryTable(); - } -} - -function setRefEngine(engine) { - userRefEngine = userRefEngine === engine ? null : engine; - if (userRefEngine) localStorage.setItem('refEngine', userRefEngine); - else localStorage.removeItem('refEngine'); - renderEngineCards(getDatasetFilteredRuns()); - document.querySelectorAll('.suite-item[data-engine]').forEach(el => { - el.classList.toggle('active', activeEngines.has(el.dataset.engine)); - }); - pushStateToUrl(); -} - -// ── Engine card drag & drop ─────────────────────────────────────────────────── -let dragSrc = null; -let pillDragSrc = null; - -// ── Pill drag-to-reorder ────────────────────────────────────────────────────── -function pillDragStart(e) { - pillDragSrc = e.currentTarget; - e.dataTransfer.effectAllowed = 'move'; - e.dataTransfer.setData('text/plain', pillDragSrc.dataset.engine); - pillDragSrc.classList.add('pill-dragging'); -} - -function pillDragOver(e) { - e.preventDefault(); - e.dataTransfer.dropEffect = 'move'; - const target = e.currentTarget; - if (target !== pillDragSrc) target.classList.add('pill-drag-over'); -} - -function pillDragLeave(e) { - e.currentTarget.classList.remove('pill-drag-over'); -} - -function pillDrop(e) { - e.preventDefault(); - const target = e.currentTarget; - target.classList.remove('pill-drag-over'); - if (!pillDragSrc || pillDragSrc === target) return; - const wrap = document.getElementById('engine-pills'); - if (!wrap || !wrap.contains(pillDragSrc) || !wrap.contains(target)) return; - - const pills = [...wrap.querySelectorAll('.engine-pill[data-engine]')]; - const srcIdx = pills.indexOf(pillDragSrc); - const tgtIdx = pills.indexOf(target); - - if (srcIdx < tgtIdx) wrap.insertBefore(pillDragSrc, target.nextSibling); - else wrap.insertBefore(pillDragSrc, target); - - // Sync engine cards order to match pills - const newOrder = [...wrap.querySelectorAll('.engine-pill[data-engine]')].map(el => el.dataset.engine); - syncCardsToOrder(newOrder); -} - -function pillDragEnd(e) { - e.currentTarget.classList.remove('pill-dragging'); - document.querySelectorAll('.engine-pill').forEach(el => el.classList.remove('pill-drag-over')); - pillDragSrc = null; - updatePillsScrollBtns(); -} - -function syncCardsToOrder(order) { - const grid = document.getElementById('engine-grid'); - if (!grid) return; - order.forEach(engine => { - const card = grid.querySelector(`.suite-item[data-engine="${engine}"]`); - if (card) grid.appendChild(card); - }); -} - -function syncPillsToOrder(order) { - const wrap = document.getElementById('engine-pills'); - if (!wrap) return; - order.forEach(engine => { - const pill = wrap.querySelector(`.engine-pill[data-engine="${engine}"]`); - if (pill) wrap.appendChild(pill); - }); -} - -function attachPillDragHandlers(pill) { - pill.addEventListener('dragstart', pillDragStart); - pill.addEventListener('dragover', pillDragOver); - pill.addEventListener('drop', pillDrop); - pill.addEventListener('dragend', pillDragEnd); - pill.addEventListener('dragleave', pillDragLeave); -} - -function dragStart(e) { - dragSrc = e.currentTarget; - e.dataTransfer.effectAllowed = 'move'; - e.dataTransfer.setData('text/plain', dragSrc.dataset.engine); - dragSrc.classList.add('dragging'); -} - -function dragOver(e) { - e.preventDefault(); - e.dataTransfer.dropEffect = 'move'; - const target = e.currentTarget; - if (target !== dragSrc) target.classList.add('drag-over'); -} - -function dragLeave(e) { - e.currentTarget.classList.remove('drag-over'); -} - -function dragDrop(e) { - e.preventDefault(); - const target = e.currentTarget; - target.classList.remove('drag-over'); - if (!dragSrc || dragSrc === target) return; - - // Guard: source and target must be in the same grid - const grid = document.getElementById('engine-grid'); - if (!grid.contains(dragSrc) || !grid.contains(target)) return; - - const items = [...grid.querySelectorAll('.suite-item[data-engine]')]; - const srcIdx = items.indexOf(dragSrc); - const tgtIdx = items.indexOf(target); - - if (srcIdx < tgtIdx) grid.insertBefore(dragSrc, target.nextSibling); - else grid.insertBefore(dragSrc, target); - - const order = [...grid.querySelectorAll('.suite-item[data-engine]')].map(el => el.dataset.engine); - localStorage.setItem('engineOrder', JSON.stringify(order)); - syncPillsToOrder(order); - updateCharts(); -} - -function dragQueryDrop(e) { - e.preventDefault(); - const target = e.currentTarget; - target.classList.remove('drag-over'); - if (!dragSrc || dragSrc === target) return; - - // Guard: source and target must be in the same grid - const grid = document.getElementById('query-cards-grid'); - if (!grid || !grid.contains(dragSrc) || !grid.contains(target)) return; - - const items = [...grid.querySelectorAll('.query-engine-card[data-engine]')]; - const srcIdx = items.indexOf(dragSrc); - const tgtIdx = items.indexOf(target); - - if (srcIdx < tgtIdx) grid.insertBefore(dragSrc, target.nextSibling); - else grid.insertBefore(dragSrc, target); - updateQueryChart(); -} - -function dragEnd(e) { - e.currentTarget.classList.remove('dragging'); - document.querySelectorAll('.suite-item').forEach(el => el.classList.remove('drag-over')); -} - -function applyStoredEngineOrder() { - const stored = localStorage.getItem('engineOrder'); - if (!stored) return; - try { - const order = JSON.parse(stored); - const grid = document.getElementById('engine-grid'); - - // 1. Move engines that are in the stored order (skip unknowns) - order.forEach(engine => { - const el = grid.querySelector(`.suite-item[data-engine="${engine}"]`); - if (el) grid.appendChild(el); - }); - - // 2. Append engines NOT in stored order at the end (new engines from a different run) - grid.querySelectorAll('.suite-item[data-engine]').forEach(el => { - if (!order.includes(el.dataset.engine)) grid.appendChild(el); - }); - } catch (_) {} -} - -// ── Charts ──────────────────────────────────────────────────────────────────── -let allRuns = []; -let currentData = null; - -const CHART_OPT = (yLabel) => ({ - responsive: true, - maintainAspectRatio: false, - plugins: { - legend: { position: 'bottom', labels: { boxWidth: 10, padding: 12, font: { size: 11, family: "'Inter'" } } }, - tooltip: { mode: 'index', intersect: false }, - }, - scales: { - x: { grid: { display: false }, ticks: { font: { size: 10 }, maxRotation: 20 } }, - y: { - grid: { color: 'rgba(255,255,255,0.05)' }, - ticks: { font: { size: 10 } }, - beginAtZero: true, - title: { display: true, text: yLabel, font: { size: 10 }, color: '#8b949e' }, - }, - }, -}); - -// ── Scalability mode (single dataset → line charts by triple count) ─────────── -// Active when exactly one non-bowlogna dataset is selected. -function isScalabilityMode() { - return activeDatasets.size === 1 && !activeDatasets.has('bowlogna'); -} - -function fmtTriples(n) { - if (n >= 1_000_000) return (n / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'M'; - if (n >= 1_000) return Math.round(n / 1_000) + 'K'; - return String(n); -} - -// Returns files sorted by ascending average triple count across engines -function getScalabilityFiles() { - const dsRuns = allRuns.filter(r => activeDatasets.has(r.dataset)); - const files = [...new Set(dsRuns.map(r => r.file))]; - files.sort((a, b) => { - const avg = f => { - const rs = dsRuns.filter(r => r.file === f); - return rs.length ? rs.reduce((s, r) => s + r.triples, 0) / rs.length : 0; - }; - return avg(a) - avg(b); - }); - return files; -} - -// X-axis labels: triple count formatted (e.g. "4M", "800K") -function getScalabilityLabels(files) { - const dsRuns = allRuns.filter(r => activeDatasets.has(r.dataset)); - return files.map(f => { - const rs = dsRuns.filter(r => r.file === f); - const avg = rs.length ? rs.reduce((s, r) => s + r.triples, 0) / rs.length : 0; - return fmtTriples(Math.round(avg)); - }); -} - -const LINE_CHART_OPT = (yLabel, fileNames = []) => ({ - responsive: true, - maintainAspectRatio: false, - spanGaps: true, - plugins: { - legend: { position: 'bottom', labels: { boxWidth: 10, padding: 12, font: { size: 11, family: "'Inter'" } } }, - tooltip: { - mode: 'index', - intersect: false, - callbacks: { - title: (items) => { - const idx = items[0]?.dataIndex ?? 0; - const fname = fileNames[idx] ? shortFile(fileNames[idx]) : ''; - return fname ? `${items[0].label} — ${fname}` : items[0].label; - }, - }, - }, - }, - scales: { - x: { - grid: { display: false }, - ticks: { font: { size: 10 }, maxRotation: 20 }, - title: { display: true, text: 'Graph size (triples)', font: { size: 10 }, color: '#8b949e' }, - }, - y: { - grid: { color: 'rgba(255,255,255,0.05)' }, - ticks: { font: { size: 10 } }, - beginAtZero: true, - title: { display: true, text: yLabel, font: { size: 10 }, color: '#8b949e' }, - }, - }, -}); - -function buildLineDatasets(field) { - const dsRuns = allRuns.filter(r => activeDatasets.has(r.dataset)); - const allEngs = getEngineOrder(); - const engines = allEngs.filter(e => - !hiddenEngines.has(e) && (activeEngines.size === 0 || activeEngines.has(e)) - ); - const files = getScalabilityFiles(); - return engines.map(engine => { - const p = pal(engine); - return { - label: engine, - data: files.map(f => { - const r = dsRuns.find(x => x.engine === engine && x.file === f); - return r ? +r[field].toFixed(1) : null; - }), - borderColor: p.hex, - backgroundColor: p.bg, - borderWidth: 2, - tension: 0.3, - pointRadius: 4, - pointHoverRadius: 6, - fill: false, - }; - }); -} - -function buildDatasets(field) { - const dsRuns = activeDatasets.size === 0 ? allRuns : allRuns.filter(r => activeDatasets.has(r.dataset)); - const allEngs = getEngineOrder(); - // Respect activeEngines filter (empty = all) - const engines = allEngs.filter(e => - !hiddenEngines.has(e) && (activeEngines.size === 0 || activeEngines.has(e)) - ); - const files = [...new Set(dsRuns.map(r => r.file))]; - return engines.map(engine => { - const p = pal(engine); - return { - label: engine, - data: files.map(f => { - const r = dsRuns.find(x => x.engine === engine && x.file === f); - return r ? +r[field].toFixed(1) : null; - }), - backgroundColor: p.bg, - borderColor: p.hex, - borderWidth: 1, - borderRadius: 3, - }; - }); -} - -function getEngineOrder() { - const cardEls = document.querySelectorAll('#engine-grid .suite-item[data-engine]'); - return cardEls.length > 0 - ? [...cardEls].map(el => el.dataset.engine) - : [...new Set(allRuns.map(r => r.engine))]; -} - -function buildCombinedDatasets() { - const dsRuns = activeDatasets.size === 0 ? allRuns : allRuns.filter(r => activeDatasets.has(r.dataset)); - const allEngines = getEngineOrder(); - const engines = activeEngines.size === 0 ? allEngines : allEngines.filter(e => activeEngines.has(e)); - const files = [...new Set(dsRuns.map(r => r.file))]; - const datasets = []; - engines.forEach(engine => { - const p = pal(engine); - // Barres : Loading time (axe gauche) - datasets.push({ - label: `${engine}`, - type: 'bar', - yAxisID: 'yLeft', - data: files.map(f => { const r = dsRuns.find(x => x.engine === engine && x.file === f); return r ? +r.loadingTimeMs.toFixed(0) : null; }), - backgroundColor: p.bg, - borderColor: p.hex, - borderWidth: 1, - borderRadius: 3, - }); - // Lignes : Memory (axe droit) - datasets.push({ - label: `${engine} (MB)`, - type: 'line', - yAxisID: 'yRight', - data: files.map(f => { const r = dsRuns.find(x => x.engine === engine && x.file === f); return r ? +r.memoryDeltaMb.toFixed(1) : null; }), - borderColor: p.hex, - backgroundColor: 'transparent', - borderWidth: 2, - borderDash: [5, 3], - pointRadius: 3, - tension: 0.3, - }); - }); - return datasets; -} - -function initCharts() { - const defs = [ - { id: 'chart-loading', field: 'loadingTimeMs', unit: 'ms' }, - { id: 'chart-memory', field: 'memoryDeltaMb', unit: 'MB' }, - { id: 'chart-cpu', field: 'cpuPercent', unit: '%' }, - ]; - - if (isScalabilityMode()) { - // Single dataset → line charts (X = triple count, ascending) - const files = getScalabilityFiles(); - const labels = getScalabilityLabels(files); - for (const { id, field, unit } of defs) { - allCharts[id] = new Chart(document.getElementById(id).getContext('2d'), { - type: 'line', - data: { labels, datasets: buildLineDatasets(field) }, - options: LINE_CHART_OPT(unit, files), - }); - allCharts[id]._field = field; - } - } else { - // All / multi-dataset → bar charts - const dsRuns = activeDatasets.size === 0 ? allRuns : allRuns.filter(r => activeDatasets.has(r.dataset)); - const files = [...new Set(dsRuns.map(r => r.file))]; - const labels = files.map(shortFile); - for (const { id, field, unit } of defs) { - allCharts[id] = new Chart(document.getElementById(id).getContext('2d'), { - type: 'bar', - data: { labels, datasets: buildDatasets(field) }, - options: CHART_OPT(unit), - }); - allCharts[id]._field = field; - } - } -} - -function updateCharts() { - if (activeDatasets.size === 0) return; - if (Object.keys(allCharts).length === 0) return; // charts not yet created - - if (isScalabilityMode()) { - // Line mode: update labels + datasets in-place - const files = getScalabilityFiles(); - const labels = getScalabilityLabels(files); - for (const chart of Object.values(allCharts)) { - const field = chart._field; - if (!field) continue; - chart.data.labels = labels; - const newDs = buildLineDatasets(field); - chart.data.datasets.splice(0, chart.data.datasets.length, ...newDs); - chart.update('none'); - } - } else { - // Bar mode: update datasets in-place - const dsRuns = allRuns.filter(r => activeDatasets.has(r.dataset)); - const allEngs = getEngineOrder(); - const engines = allEngs.filter(e => - !hiddenEngines.has(e) && (activeEngines.size === 0 || activeEngines.has(e)) - ); - const files = [...new Set(dsRuns.map(r => r.file))]; - - for (const chart of Object.values(allCharts)) { - const field = chart._field; - if (!field) continue; - const newDs = engines.map(engine => { - const p = pal(engine); - return { - label: engine, - data: files.map(f => { - const r = dsRuns.find(x => x.engine === engine && x.file === f); - return r ? +r[field].toFixed(1) : null; - }), - backgroundColor: p.bg, - borderColor: p.hex, - borderWidth: 1, - borderRadius: 3, - }; - }); - chart.data.datasets.splice(0, chart.data.datasets.length, ...newDs); - chart.update('none'); - } - } - - const filtered = getFilteredRuns(allRuns); - if (filtered.length > 0) renderKPI(filtered); -} - -// ── Tableau ──────────────────────────────────────────────────────────────────── -function renderTable(runs) { - updateTable(runs); -} - -function updateTable(runsArg) { - let runs = getFilteredRuns(runsArg ?? allRuns); - - if (sortField) { - runs = [...runs].sort((a, b) => { - const av = a[sortField], bv = b[sortField]; - if (typeof av === 'string') return sortAsc ? av.localeCompare(bv) : bv.localeCompare(av); - return sortAsc ? av - bv : bv - av; - }); - } - - const tbody = document.getElementById('results-body'); - const thead = tbody.closest('table').querySelector('thead tr'); - tbody.innerHTML = ''; - - // 2-engine diff mode: when exactly 2 engines are selected - const diffMode = activeEngines.size === 2; - const [engA, engB] = diffMode ? [...activeEngines] : [null, null]; - - // Update thead diff column - const existingDiff = thead.querySelector('th.diff-col'); - if (existingDiff) existingDiff.remove(); - if (diffMode) { - const th = document.createElement('th'); - th.className = 'text-right diff-col'; - th.title = `${engA} vs ${engB}`; - th.textContent = 'Δ throughput'; - thead.insertBefore(th, thead.lastElementChild); - } - - // Group by file for diff calculation - const files = [...new Set(runs.map(r => r.file))]; - const grouped = {}; - if (diffMode) { - files.forEach(f => { - grouped[f] = {}; - runs.filter(r => r.file === f).forEach(r => { grouped[f][r.engine] = r; }); - }); - } - - for (const r of runs) { - const tr = document.createElement('tr'); - let diffCell = ''; - if (diffMode) { - const peer = grouped[r.file]?.[r.engine === engA ? engB : engA]; - if (peer) { - const peerThru = peer.throughputTriplesPerSec; - const delta = peerThru > 0 - ? ((r.throughputTriplesPerSec - peerThru) / peerThru * 100).toFixed(1) - : null; - const cls = delta == null ? '' : delta > 0 ? 'diff-better' : delta < 0 ? 'diff-worse' : ''; - diffCell = delta == null - ? `—` - : `${delta > 0 ? '+' : ''}${delta}%`; - } else { - diffCell = `—`; - } - } - tr.innerHTML = ` - ${r.engine} - ${shortFile(r.file)} - ${fmt(r.triples)} - ${fmt(r.loadingTimeMs)} - ${fmt(r.throughputTriplesPerSec, 0)} - ${fmt(r.memoryDeltaMb, 1)} - ${fmt(r.cpuPercent, 1)} - ${diffMode ? diffCell : ''} - ${r.repetitionsMs.join(' · ')} - `; - tbody.appendChild(tr); - } -} - -// ── Query benchmark section ─────────────────────────────────────────────────── -let activeQueryEngines = new Set(); -let queryChart = null; -let allQueryRuns = []; // filtered to active dataset (used by charts/table) -let _allQueryRunsGlobal = []; // full set from JSON (never overwritten) -let queryChartDatasetsBase = {}; // datasets originaux, jamais modifiés -let queryTtfrDatasetsBase = {}; -let activeQueryTypeFilter = 'all'; // 'all' | 'GRAPH_PATTERN' | 'TEMPORAL' | 'GROUP_BY' | 'SUBQUERY' - -function toggleQueryEngine(engine) { - if (activeQueryEngines.has(engine)) { - activeQueryEngines.delete(engine); - } else { - activeQueryEngines.add(engine); - } - document.querySelectorAll('.query-engine-card[data-engine]').forEach(el => { - el.classList.toggle('active', activeQueryEngines.has(el.dataset.engine)); - }); - const btn = document.getElementById('clear-query-engines-btn'); - if (btn) btn.style.display = activeQueryEngines.size > 0 ? '' : 'none'; - updateQueryChart(); - updateQueryTable(); -} - -function setQueryTypeFilter(type) { - activeQueryTypeFilter = type; - document.querySelectorAll('.query-type-pill').forEach(btn => { - btn.classList.toggle('active', btn.dataset.type === type); - }); - updateQueryChart(); - updateQueryTable(); -} - -function _syncQueryTypePills() { - const present = new Set(allQueryRuns.map(r => r.queryCategory ?? 'GRAPH_PATTERN')); - // Hide the entire filter bar if all queries have the same category (no useful filtering) - const filterBar = document.getElementById('query-type-filter-bar'); - if (filterBar) filterBar.style.display = present.size <= 1 ? 'none' : ''; - document.querySelectorAll('.query-type-pill[data-type]').forEach(btn => { - const t = btn.dataset.type; - btn.style.display = (t === 'all' || present.has(t)) ? '' : 'none'; - }); -} - -function clearQueryEngineFilter() { - activeQueryEngines.clear(); - document.querySelectorAll('.query-engine-card[data-engine]').forEach(el => el.classList.remove('active')); - const btn = document.getElementById('clear-query-engines-btn'); - if (btn) btn.style.display = 'none'; - updateQueryChart(); - updateQueryTable(); -} - -function _classifySparql(sparql) { - if (!sparql) return 'GRAPH_PATTERN'; - // Strip comments and string literals, then uppercase - const cleaned = sparql.replace(/#[^\n]*/g, '').replace(/"[^"]*"|'[^']*'/g, '""').toUpperCase(); - if (/\{[^{}]*\bSELECT\b/.test(cleaned)) return 'SUBQUERY'; - if (/\bGROUP\s+BY\b/.test(cleaned)) return 'GROUP_BY'; - if (/\bNOW\s*\(|\bXSD:DATETIME\b|\bXSD:DATE\b|\b(DAY|MONTH|YEAR|HOURS|MINUTES|SECONDS)\s*\(/.test(cleaned)) return 'TEMPORAL'; - return 'GRAPH_PATTERN'; -} - -function _visibleQueryIds() { - return [...new Set(allQueryRuns - .filter(r => activeQueryTypeFilter === 'all' || (r.queryCategory ?? 'GRAPH_PATTERN') === activeQueryTypeFilter) - .map(r => r.queryId) - )].sort((a, b) => parseInt(a.split('_')[1]) - parseInt(b.split('_')[1])); -} - -function _visibleQueryEngines() { - const cardOrder = [...document.querySelectorAll('.query-engine-card[data-engine]')] - .map(el => el.dataset.engine); - return cardOrder.filter(e => - !hiddenEngines.has(e) && - (activeQueryEngines.size === 0 || activeQueryEngines.has(e)) && - (activeEngines.size === 0 || activeEngines.has(e)) - ); -} - -function updateQueryChart() { - const qids = _visibleQueryIds(); - const engines = _visibleQueryEngines(); - - if (queryChart) { - const isTtfr = _activeQueryChartMode === 'ttfr'; - const base = isTtfr ? queryTtfrDatasetsBase : queryChartDatasetsBase; - queryChart.data.labels = qids; - queryChart.data.datasets = engines - .filter(e => base[e]) - .map(e => { - const p = pal(e); - return { ...base[e], - data: qids.map(qid => { - const r = allQueryRuns.find(r => r.engine === e && r.queryId === qid); - if (isTtfr) return r && r.medianTtfrMs != null && r.medianTtfrMs >= 0 ? r.medianTtfrMs : null; - return r && r.medianMs >= 0 ? r.medianMs : null; - }), - backgroundColor: p.bg, borderColor: p.hex, - }; - }); - queryChart.update(); - } -} - -function updateQueryTable() { - const tbody = document.getElementById('query-results-body'); - if (!tbody || !allQueryRuns.length) return; - const table = tbody.closest('table'); - if (!table) return; - - const allEngines = [...new Set(allQueryRuns.map(r => r.engine))]; - const visibleEngines = allEngines.filter(e => - !hiddenEngines.has(e) && - (activeQueryEngines.size === 0 || activeQueryEngines.has(e)) && - (activeEngines.size === 0 || activeEngines.has(e)) - ); - - const queryIds = _visibleQueryIds(); - - // Masquer les colonnes non visibles dans le thead - table.querySelectorAll('thead th[data-engine]').forEach(th => { - th.style.display = visibleEngines.includes(th.dataset.engine) ? '' : 'none'; - }); - - // Reconstruire le tbody avec best recalculé parmi les moteurs visibles uniquement - tbody.innerHTML = queryIds.map(qid => { - // Valeurs pour tous les moteurs (pour mapping colonne) - const rowData = allEngines.map(engine => { - const r = allQueryRuns.find(r => r.engine === engine && r.queryId === qid); - return r && r.medianMs >= 0 ? r.medianMs : null; - }); - - // Best parmi moteurs VISIBLES seulement - const visibleData = visibleEngines.map(e => rowData[allEngines.indexOf(e)]); - const validVisible = visibleData.filter(v => v !== null); - const minMs = validVisible.length ? Math.min(...validVisible) : null; - const winner = minMs !== null ? visibleEngines[visibleData.indexOf(minMs)] : null; - - const cells = allEngines.map((engine, i) => { - if (!visibleEngines.includes(engine)) return ``; - const ms = rowData[i]; - if (ms === null) return `—`; - return `${fmt(ms)} ms`; - }).join(''); - - const bestCell = winner - ? `${winner}` - : `—`; - - return `${qid}${cells}${bestCell}`; - }).join(''); -} - -function renderQuerySection(queryRuns) { - if (!queryRuns || queryRuns.length === 0) return; - allQueryRuns = queryRuns; - - const engines = [...new Set(queryRuns.map(r => r.engine))]; - const queryIds = [...new Set(queryRuns.map(r => r.queryId))].sort( - (a, b) => parseInt(a.split('_')[1]) - parseInt(b.split('_')[1]) - ); - - // Summary cards per engine — draggable + clickable - const cards = engines.map(engine => { - const eruns = queryRuns.filter(r => r.engine === engine && r.medianMs >= 0); - const avgMs = eruns.length ? eruns.reduce((s, r) => s + r.medianMs, 0) / eruns.length : 0; - const sorted = eruns.map(r => r.medianMs).sort((a,b)=>a-b); - const p50 = sorted.length ? sorted[Math.floor(sorted.length * 0.50)] : 0; - const p95 = sorted.length ? sorted[Math.floor(sorted.length * 0.95)] : 0; - const p99 = sorted.length ? sorted[Math.floor(sorted.length * 0.99)] : 0; - const p = pal(engine); - return ` -
-
- - ${engine} -
-
-
Avg.
${fmt(avgMs,0)} ms
-
p50
${fmt(p50,0)} ms
-
p95
${fmt(p95,0)} ms
-
p99
${fmt(p99,0)} ms
-
Queries
${eruns.length}
-
-
`; - }).join(''); - - // Bar chart data - const datasets = engines.map(engine => { - const p = pal(engine); - return { - label: engine, - data: queryIds.map(qid => { - const r = queryRuns.find(r => r.engine === engine && r.queryId === qid); - return r && r.medianMs >= 0 ? r.medianMs : null; - }), - backgroundColor: p.bg, - borderColor: p.hex, - borderWidth: 1, - }; - }); - - const section = document.createElement('section'); - section.className = 'query-section'; - section.innerHTML = ` -
- -

SPARQL Queries

- ${queryIds.length} queries · ${engines.length} engines · ms, lower is better -
- - -
-
-
-

Median execution time per query — 3 repetitions  ·  — = timeout or error

- -
-
${cards}
-
- Query type: - - - - - -
-
-
- Time per query - ms — lower is better -
- - -
-
- -
- -
-
- - - - ${engines.map(e => ``).join('')} - - - - ${queryIds.map(qid => { - // Valid values for this query - const rowData = engines.map(engine => { - const r = queryRuns.find(r => r.engine === engine && r.queryId === qid); - return r && r.medianMs >= 0 ? r.medianMs : null; - }); - const validTimes = rowData.filter(v => v !== null); - const minMs = validTimes.length ? Math.min(...validTimes) : null; - const maxMs = validTimes.length ? Math.max(...validTimes) : null; - const winner = minMs !== null ? engines[rowData.indexOf(minMs)] : null; - const allFailed = validTimes.length === 0; - - const cells = engines.map(engine => { - const r = queryRuns.find(item => item.engine === engine && item.queryId === qid); - if (!r || r.medianMs < 0) { - const title = r && r.status ? `Status: ${r.status}` : 'No result'; - return ``; - } - const rowInfo = r.rowCount != null && r.rowCount >= 0 ? ` · ${r.rowCount} rows` : ''; - const hashInfo = r.resultHash ? ` [${r.resultHash.substring(0, 8)}]` : ''; - const title = `${r.status || 'PASS'}${rowInfo}${hashInfo}`; - const mismatchBadge = r.status === 'MISMATCH' ? ' ⚠️' : ''; - return ``; - }).join(''); - - const bestCell = winner - ? `` - : ``; - - return `${''}${cells}${bestCell}`; - }).join('')} - -
Requête ${e}Best
—${fmt(r.medianMs)} ms${mismatchBadge}${winner}—
' + qid + '
-
-
-
- `; - const sparqlSection = document.getElementById('section-sparql'); - if (sparqlSection) { - // Show only if a specific dataset is selected (not in All mode) - sparqlSection.style.display = activeDatasets.size > 0 ? '' : 'none'; - sparqlSection.appendChild(section); - } else { - (document.querySelector('.app-content') || document.querySelector('.app-wrapper')).appendChild(section); - } - - // Stocker les datasets originaux pour pouvoir restaurer après filtre - queryChartDatasetsBase = {}; - datasets.forEach(ds => { queryChartDatasetsBase[ds.label] = ds; }); - - // Reset query type filter on re-render - activeQueryTypeFilter = 'all'; - // Sync pills visibility after DOM is ready - requestAnimationFrame(() => _syncQueryTypePills()); - - const chartOpts = { - responsive: true, - plugins: { - legend: { position: 'bottom', labels: { boxWidth: 10, padding: 12, font: { size: 11, family: "'Inter'" } } }, - tooltip: { callbacks: { label: ctx => ` ${ctx.dataset.label}: ${fmt(ctx.raw, 0)} ms` } }, - }, - scales: { - x: { grid: { display: false }, ticks: { font: { size: 10 } } }, - y: { beginAtZero: true, ticks: { callback: v => fmt(v, 0) + ' ms' } }, - }, - }; - - // Render main execution time chart - queryChart = new Chart(document.getElementById('chart-queries'), { - type: 'bar', - data: { labels: queryIds, datasets }, - options: chartOpts, - }); - - // Store TTFR datasets for toggle - queryTtfrDatasetsBase = {}; - engines.forEach(engine => { - const p = pal(engine); - queryTtfrDatasetsBase[engine] = { - label: engine, - data: queryIds.map(qid => { - const r = queryRuns.find(r => r.engine === engine && r.queryId === qid); - return r && r.medianTtfrMs != null && r.medianTtfrMs >= 0 ? r.medianTtfrMs : null; - }), - backgroundColor: p.bg, - borderColor: p.hex, - borderWidth: 1, - }; - }); - - const hasTtfr = queryRuns.some(r => r.medianTtfrMs != null && r.medianTtfrMs >= 0); - const toggle = document.getElementById('query-chart-toggle'); - if (toggle) toggle.style.display = hasTtfr ? 'flex' : 'none'; - _activeQueryChartMode = 'exec'; - -} - -let _activeQueryChartMode = 'exec'; - -function setQueryChartMode(mode) { - _activeQueryChartMode = mode; - document.getElementById('toggle-exec')?.classList.toggle('active', mode === 'exec'); - document.getElementById('toggle-ttfr')?.classList.toggle('active', mode === 'ttfr'); - const title = document.getElementById('query-chart-title'); - if (title) title.textContent = mode === 'ttfr' ? 'Time to First Result (TTFR)' : 'Time per query'; - updateQueryChart(); -} - - -// ── Chart zoom modal ────────────────────────────────────────────────────────── -let _zoomChart = null; - -function openChartZoom(chartId) { - const src = allCharts[chartId]; - if (!src) return; - - const dialog = document.getElementById('chart-zoom-modal'); - const titleEl = document.getElementById('chart-zoom-title'); - const pngBtn = document.getElementById('chart-zoom-png'); - const canvas = document.getElementById('chart-zoom-canvas'); - - // Titre = titre du chart-surface correspondant - const surface = document.getElementById(chartId)?.closest('.chart-surface'); - titleEl.textContent = surface?.querySelector('.chart-title')?.textContent ?? chartId; - - // Détruire le chart zoom précédent - if (_zoomChart) { _zoomChart.destroy(); _zoomChart = null; } - - // Cloner data + options du chart source - _zoomChart = new Chart(canvas.getContext('2d'), { - type: src.config.type, - data: JSON.parse(JSON.stringify(src.data)), - options: { - ...src.config.options, - responsive: true, - maintainAspectRatio: false, - plugins: { - ...src.config.options?.plugins, - legend: { position: 'bottom', labels: { boxWidth: 12, padding: 16, font: { size: 13, family: "'Inter'" } } }, - }, - }, - }); - - pngBtn.onclick = () => { - const a = document.createElement('a'); - a.download = `corese-benchmark-${chartId}.png`; - a.href = canvas.toDataURL('image/png'); - a.click(); - }; - - dialog.showModal(); -} - -function closeChartZoom() { - const dialog = document.getElementById('chart-zoom-modal'); - dialog.close(); - if (_zoomChart) { _zoomChart.destroy(); _zoomChart = null; } -} - -// ── PNG export ──────────────────────────────────────────────────────────────── -function downloadChart(canvasId, name) { - const canvas = document.getElementById(canvasId); - if (!canvas) return; - const a = document.createElement('a'); - a.download = `corese-benchmark-${name}.png`; - a.href = canvas.toDataURL('image/png'); - a.click(); -} - -// ── Pills scroll arrows ─────────────────────────────────────────────────────── -function scrollPills(dir) { - const wrap = document.getElementById('engine-pills'); - if (!wrap) return; - wrap.scrollBy({ left: dir * 180, behavior: 'smooth' }); -} - -function updatePillsScrollBtns() { - const wrap = document.getElementById('engine-pills'); - const btnL = document.getElementById('pills-scroll-left'); - const btnR = document.getElementById('pills-scroll-right'); - if (!wrap || !btnL || !btnR) return; - const canScrollL = wrap.scrollLeft > 4; - const canScrollR = wrap.scrollLeft < wrap.scrollWidth - wrap.clientWidth - 4; - btnL.style.opacity = canScrollL ? '1' : '0.25'; - btnL.style.pointerEvents = canScrollL ? '' : 'none'; - btnR.style.opacity = canScrollR ? '1' : '0.25'; - btnR.style.pointerEvents = canScrollR ? '' : 'none'; - // hide both if no overflow - const hasOverflow = wrap.scrollWidth > wrap.clientWidth + 4; - btnL.style.display = hasOverflow ? '' : 'none'; - btnR.style.display = hasOverflow ? '' : 'none'; -} - -// ── Sidebar scroll-spy ──────────────────────────────────────────────────────── -function initSidebar() { - // Click → smooth scroll - document.querySelectorAll('.sidebar-nav-item[data-target]').forEach(item => { - item.addEventListener('click', e => { - e.preventDefault(); - const target = document.getElementById(item.dataset.target); - if (target) target.scrollIntoView({ behavior: 'smooth', block: 'start' }); - }); - }); - - // Search filter - document.getElementById('sidebar-search-input')?.addEventListener('input', e => { - const q = e.target.value.toLowerCase(); - document.querySelectorAll('.sidebar-nav-item').forEach(item => { - const text = item.textContent.toLowerCase(); - item.closest('li').style.display = text.includes(q) ? '' : 'none'; - }); - }); - - // Scroll-spy via IntersectionObserver - const sections = document.querySelectorAll('.page-section[id]'); - const navItems = document.querySelectorAll('.sidebar-nav-item[data-target]'); - const observer = new IntersectionObserver(entries => { - entries.forEach(entry => { - if (entry.isIntersecting) { - navItems.forEach(item => item.classList.remove('active')); - const active = document.querySelector(`.sidebar-nav-item[data-target="${entry.target.id}"]`); - if (active) active.classList.add('active'); - } - }); - }, { rootMargin: '-20% 0px -70% 0px', threshold: 0 }); - sections.forEach(s => observer.observe(s)); -} - -// ── Add engine modal ────────────────────────────────────────────────────────── -// Famille → préfixe avant le premier "." -function _engineFamily(e) { const d = e.indexOf('.'); return d >= 0 ? e.slice(0, d) : e; } - -function _populateVersionSelect(family, subset) { - const engines = subset ?? [...new Set(allRuns.map(r => r.engine))]; - const versions = engines - .filter(e => _engineFamily(e) === family) - .map(e => { const d = e.indexOf('.'); return d >= 0 ? e.slice(d + 1) : e; }); - const sel = document.getElementById('modal-select-version'); - if (!sel) return; - sel.innerHTML = versions.map(v => ``).join(''); -} - -function openAddEngineModal() { - const overlay = document.getElementById('modal-add-engine'); - if (!overlay) return; - - // Familles disponibles dans les données (uniquement moteurs cachés) - const allEngines = [...new Set(allRuns.map(r => r.engine))]; - const available = hiddenEngines.size > 0 - ? allEngines.filter(e => hiddenEngines.has(e)) - : allEngines; - const families = [...new Set(available.map(_engineFamily))]; - - const triplesel = document.getElementById('modal-select-triplestore'); - if (triplesel) { - const labels = { corese: 'Corese', jena: 'Apache Jena', rdf4j: 'Eclipse RDF4J' }; - triplesel.innerHTML = families.map(f => - `` - ).join(''); - _populateVersionSelect(triplesel.value, available); - triplesel.onchange = () => _populateVersionSelect(triplesel.value, available); - } - - overlay.classList.add('active'); - overlay.addEventListener('click', e => { if (e.target === overlay) closeAddEngineModal(); }, { once: true }); -} - -function closeAddEngineModal() { - document.getElementById('modal-add-engine')?.classList.remove('active'); -} - -// ── W3C Conformance ─────────────────────────────────────────────────────────── -function w3cShowTab(tab) { - document.getElementById('w3c-tab-failed').style.display = tab === 'failed' ? '' : 'none'; - const ct = document.getElementById('w3c-tab-cannot'); - if (ct) ct.style.display = tab === 'cannot' ? '' : 'none'; - ['failed','cannot'].forEach(t => document.getElementById('w3c-pill-' + t)?.classList.toggle('active', t === tab)); -} - -async function loadW3CData() { - try { - const res = await fetch('https://corese-stack.github.io/corese-w3c/data/w3c-report.json'); - if (!res.ok) throw new Error(res.statusText); - return await res.json(); - } catch (e) { - console.warn('W3C data unavailable:', e); - return null; - } -} - -function renderW3CSection(data) { - const section = document.getElementById('section-w3c'); - if (!section) return; - - if (!data) { - section.innerHTML = `

W3C Conformance

-

Data unavailable — check your connection.

`; - section.style.display = ''; - return; - } - - const { metadata, summary, suites } = data; - const engineVersion = metadata?.coreseVersion ?? metadata?.version ?? '—'; - const runDate = metadata?.date ?? metadata?.generatedAt ?? null; - - // ── Summary cards ── - const pct = summary.passRate?.toFixed(2) ?? '—'; - const exePct = summary.executedPassRate?.toFixed(2) ?? null; - - const summaryCards = [ - { label: 'Pass rate', value: `${pct}%`, sub: exePct ? `${exePct}% executed` : '', cls: 'w3c-card-pass' }, - { label: 'Passed', value: fmt(summary.passed), sub: `/ ${fmt(summary.total)} tests`, cls: '' }, - { label: 'Failed', value: fmt(summary.failed), sub: 'tests failed', cls: summary.failed > 0 ? 'w3c-card-fail' : '' }, - { label: 'Inapplicable', value: fmt(summary.inapplicable ?? summary.skipped ?? 0), sub: 'inapplicable / skipped', cls: '' }, - { label: 'Cannot tell', value: fmt(summary.cantTell ?? 0), sub: 'uncertain', cls: '' }, - ].map(c => ` -
-
${c.label}
-
${c.value}
- ${c.sub ? `
${c.sub}
` : ''} -
`).join(''); - - // ── Pass rate bar ── - const barPct = Math.min(parseFloat(pct), 100); - const barColor = barPct >= 99 ? '#3fb950' : barPct >= 95 ? '#d29922' : '#f85149'; - const passBar = ` -
-
-
-
- ${pct}% -
`; - - // ── Suite table ── - const suiteRows = suites.map(s => { - const suitePct = s.total > 0 ? (s.passed / s.total * 100).toFixed(1) : '—'; - const failCls = s.failed > 0 ? 'w3c-fail-cell' : ''; - return ` - ${s.name ?? s.id} - ${s.specification ?? s.component ?? '—'} - ${fmt(s.total)} - ${fmt(s.passed)} - ${fmt(s.failed)} - ${s.inapplicable ?? 0} - ${suitePct}% - `; - }).join(''); - - // ── Failed + Cannot tell detail ── - const cantTellTests = suites.flatMap(s => - (s.tests ?? []) - .filter(t => ['CANT_TELL', 'CANNOT_TELL', 'cantTell'].includes(t.outcome ?? '')) - .map(t => ({ suite: s.name ?? s.id, ...t })) - ); - const cantTellNames = new Set(cantTellTests.map(t => t.name ?? t.testUri)); - const failedTests = suites.flatMap(s => - (s.tests ?? []) - .filter(t => (t.status ?? t.outcome) === 'FAILED' && !cantTellNames.has(t.name ?? t.testUri)) - .map(t => ({ suite: s.name ?? s.id, ...t })) - ); - const nCantTell = cantTellTests.length || (summary.cantTell ?? 0); - const totalNonPassing = failedTests.length + nCantTell; - - const failedHtml = totalNonPassing === 0 ? '' : ` -
- - ${failedTests.length} failed - ${nCantTell > 0 ? `· ${nCantTell} cannot tell` : ''} - -
- - ${nCantTell > 0 ? `` : ''} -
-
-
- - - - ${failedTests.map(t => ` - - - - - `).join('')} - -
SuiteTestDescriptionError
${t.suite}${t.name ?? t.testUri ?? '—'}${t.description ?? '—'}${t.errorMessage ?? '—'}
-
-
- ${nCantTell > 0 ? ` -
-
- - - - ${cantTellTests.length > 0 ? cantTellTests.map(t => ` - - - - `).join('') : ``} - -
SuiteTestInfo
${t.suite}${t.name ?? t.testUri ?? '—'}${t.errorMessage ?? t.info ?? t.description ?? '—'}
Détail non disponible dans le rapport JSON.
-
-
` : ''} -
`; - - section.innerHTML = ` -
-

W3C Conformance

- - Corese only  ·  v${engineVersion}${runDate ? ' · ' + formatDate(runDate) : ''} -  ·  - corese-w3c ↗ - -
- ${passBar} -
${summaryCards}
-
-
- Results by suite - ${suites.length} suites -
-
- - - - - - - - - - ${suiteRows} -
SuiteSpecificationTotalPassedFailedN/APass %
-
-
- ${failedHtml} - `; - - section.style.display = ''; - const nav = document.getElementById('sidebar-w3c-nav'); - if (nav) { - nav.style.display = ''; - const badge = document.getElementById('sidebar-badge-w3c'); - if (badge) badge.textContent = `${pct}%`; - } -} - -// ── Main ───────────────────────────────────────────────────────────────────── -async function main() { - let data; - try { - data = await loadData(); - } catch (err) { - const el = document.getElementById('empty-state'); - if (el) el.style.display = ''; - return; - } - - allRuns = data.runs; - currentData = data; - metadataQueries = data.metadata.queries ?? null; - - // Back-fill queryCategory for JSON generated before this feature. - // Only classify from metadata.queries if there is exactly ONE dataset - // with queryRuns AND the number of embedded queries matches the unique query count. - // Otherwise the index mapping is unreliable (mixed-dataset JSON). - if (data.queryRuns) { - const datasets = [...new Set(data.queryRuns.map(r => r.dataset))]; - const uniqueQids = [...new Set(data.queryRuns.map(r => r.queryId))]; - const canBackfill = metadataQueries && - datasets.length === 1 && - metadataQueries.length === uniqueQids.length; - - data.queryRuns.forEach(r => { - if (!r.queryCategory) { - if (canBackfill) { - const idx = parseInt((r.queryId ?? '').split('_')[1]) - 1; - const sparql = idx >= 0 ? (metadataQueries[idx] ?? '') : ''; - r.queryCategory = _classifySparql(sparql); - } else { - r.queryCategory = 'GRAPH_PATTERN'; // unknown — hide type filter - } - } - }); - } - - // Build color map from engines present in the data - const engines = [...new Set(allRuns.map(r => r.engine))]; - buildColorMap(engines); - - // Restore state from URL before rendering (shareable links) - applyUrlState(); - - // Show last run date in header - const runDateEl = document.getElementById('header-run-date'); - if (runDateEl && data.metadata?.generatedAt) { - runDateEl.textContent = 'Last run: ' + formatDate(data.metadata.generatedAt); - runDateEl.style.display = ''; - } - - renderHeader(data.metadata, allRuns); - // Pills scroll arrows — listen once after pills are rendered - const pillsWrap = document.getElementById('engine-pills'); - if (pillsWrap) { - pillsWrap.addEventListener('scroll', updatePillsScrollBtns, { passive: true }); - new ResizeObserver(updatePillsScrollBtns).observe(pillsWrap); - } - updatePillsScrollBtns(); - renderDatasetPills(allRuns); - _syncDatasetSections(); - updateQuerySectionVisibility(); - renderKPI(allRuns); - renderDatasetCards(allRuns, metadataQueries); - renderEngineCards(allRuns); - renderSidebarMeta(data.metadata, engines, allRuns, data.queryRuns); - initSidebar(); - applyStoredEngineOrder(); - initCharts(); - initTableSort(); - renderTable(allRuns); - const meta = document.getElementById('full-results-meta'); - if (meta) meta.textContent = `${allRuns.length} rows · ${[...new Set(allRuns.map(r=>r.engine))].length} engines`; - - // Query section (optional — only if queryRuns present in JSON) - if (data.queryRuns && data.queryRuns.length > 0) { - _allQueryRunsGlobal = data.queryRuns; - renderQuerySection(data.queryRuns); - } - - // W3C Conformance — async, non-blocking - loadW3CData().then(renderW3CSection); - - document.getElementById('btn-open-add-engine')?.addEventListener('click', openAddEngineModal); - document.getElementById('btn-modal-cancel')?.addEventListener('click', closeAddEngineModal); - document.getElementById('btn-modal-submit')?.addEventListener('click', () => { - const family = document.getElementById('modal-select-triplestore')?.value; - const version = document.getElementById('modal-select-version')?.value; - if (!family || !version) return; - const engineId = `${family}.${version}`; - if (hiddenEngines.has(engineId)) { - hiddenEngines.delete(engineId); - // Re-add pill to comparator bar - const wrap = document.getElementById('engine-pills'); - if (wrap && !wrap.querySelector(`[data-engine="${engineId}"]`)) { - const dot = engineId.indexOf('.'); - const fam = dot >= 0 ? engineId.slice(0, dot) : engineId; - const ver = dot >= 0 ? engineId.slice(dot + 1) : engineId; - const pill = document.createElement('div'); - pill.className = `engine-pill family-${fam}`; - pill.dataset.engine = engineId; - pill.title = engineId; - pill.draggable = true; - pill.style.cursor = 'grab'; - pill.onclick = () => toggleEngine(engineId); - pill.addEventListener('dragstart', pillDragStart); - pill.addEventListener('dragover', pillDragOver); - pill.addEventListener('drop', pillDrop); - pill.addEventListener('dragend', pillDragEnd); - pill.addEventListener('dragleave', pillDragLeave); - pill.innerHTML = `${fam}${ver} - `; - wrap.appendChild(pill); - } - syncEnginePills(); - const filtered = getFilteredRuns(allRuns); - renderKPI(filtered); - renderEngineCards(getDatasetFilteredRuns()); - updateCharts(); - updateTable(); - } - closeAddEngineModal(); - }); - -} - -// ── Copy URL ────────────────────────────────────────────────────────────────── -// ── URL shareable state ─────────────────────────────────────────────────────── -// Encodes: ?ds=dbpedia&engines=corese.4.6.5,jena.6.2.0&ref=corese.4.6.5 -// Called after any state change that should be reflected in the URL. - -function pushStateToUrl() { - const params = new URLSearchParams(); - if (activeDatasets.size > 0) { - params.set('ds', [...activeDatasets].join(',')); - } - const visibleEngines = getEngineOrder().filter(e => !hiddenEngines.has(e)); - const allEngines = [...new Set(allRuns.map(r => r.engine))]; - // Only encode if different from "all engines" - if (hiddenEngines.size > 0) { - params.set('engines', visibleEngines.join(',')); - } - if (activeEngines.size > 0) { - params.set('filter', [...activeEngines].join(',')); - } - if (userRefEngine) { - params.set('ref', userRefEngine); - } - const qs = params.toString(); - const newUrl = qs ? `${location.pathname}?${qs}` : location.pathname; - history.replaceState(null, '', newUrl); -} - -function applyUrlState() { - const params = new URLSearchParams(location.search); - - // Dataset - const ds = params.get('ds'); - if (ds) { - activeDatasets.clear(); - ds.split(',').forEach(d => d && activeDatasets.add(d)); - } - - // Hidden engines (engines= lists visible ones; those absent are hidden) - const enginesParam = params.get('engines'); - if (enginesParam) { - const visible = new Set(enginesParam.split(',').filter(Boolean)); - const all = [...new Set(allRuns.map(r => r.engine))]; - hiddenEngines.clear(); - all.forEach(e => { if (!visible.has(e)) hiddenEngines.add(e); }); - } - - // Engine filter (active selection) - const filter = params.get('filter'); - if (filter) { - activeEngines.clear(); - filter.split(',').forEach(e => e && activeEngines.add(e)); - } - - // Reference engine - const ref = params.get('ref'); - if (ref) userRefEngine = ref; -} - -// ── Export Markdown comparison report ───────────────────────────────────────── - -function exportQueryMarkdown() { - const runs = (allQueryRuns ?? []).filter(r => - !hiddenEngines.has(r.engine) && - (activeQueryEngines.size === 0 || activeQueryEngines.has(r.engine)) && - (activeEngines.size === 0 || activeEngines.has(r.engine)) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) && - (activeQueryTypeFilter === 'all' || (r.queryCategory ?? 'GRAPH_PATTERN') === activeQueryTypeFilter) - ); - if (runs.length === 0) return; - - const engines = [...new Set(runs.map(r => r.engine))]; - const qids = [...new Set(runs.map(r => r.queryId))].sort( - (a, b) => parseInt(a.split('_')[1]) - parseInt(b.split('_')[1]) - ); - const meta = currentData?.metadata ?? {}; - const dataset = runs[0]?.dataset ?? ''; - const now = new Date().toISOString().slice(0, 10); - - const lines = []; - lines.push(`# SPARQL Benchmark Comparison`); - lines.push(``); - lines.push(`**Dataset:** ${dataset} `); - lines.push(`**Generated:** ${meta.generatedAt ?? now} `); - lines.push(`**Java:** ${meta.java ?? '—'} `); - lines.push(`**OS:** ${meta.os ?? '—'} `); - lines.push(`**Protocol:** warmup + ${meta.protocol?.queryRepetitions ?? 3} repetitions, median `); - if (activeQueryTypeFilter !== 'all') lines.push(`**Query type filter:** ${activeQueryTypeFilter} `); - lines.push(``); - - const sep = `|---|${engines.map(() => '---:').join('|')}|---|`; - - // Execution time table - lines.push(`## Median Execution Time (ms)`); - lines.push(``); - lines.push(`| Query | ${engines.join(' | ')} | Best |`); - lines.push(sep); - qids.forEach(qid => { - const vals = engines.map(e => { const r = runs.find(r => r.engine === e && r.queryId === qid); return r && r.medianMs >= 0 ? r.medianMs : null; }); - const minMs = Math.min(...vals.filter(v => v !== null)); - const winner = isFinite(minMs) ? engines[vals.indexOf(minMs)] : null; - lines.push(`| ${qid} | ${vals.map(v => v === null ? '—' : `${v.toLocaleString()} ms`).join(' | ')} | ${winner ?? '—'} |`); - }); - lines.push(``); - - // TTFR table (only if data present) - const hasTtfr = runs.some(r => r.medianTtfrMs != null && r.medianTtfrMs >= 0); - if (hasTtfr) { - lines.push(`## Time to First Result (TTFR, ms)`); - lines.push(``); - lines.push(`| Query | ${engines.join(' | ')} | Best |`); - lines.push(sep); - qids.forEach(qid => { - const vals = engines.map(e => { const r = runs.find(r => r.engine === e && r.queryId === qid); return r && r.medianTtfrMs != null && r.medianTtfrMs >= 0 ? r.medianTtfrMs : null; }); - const minMs = Math.min(...vals.filter(v => v !== null)); - const winner = isFinite(minMs) ? engines[vals.indexOf(minMs)] : null; - lines.push(`| ${qid} | ${vals.map(v => v === null ? '—' : `${v.toLocaleString()} ms`).join(' | ')} | ${winner ?? '—'} |`); - }); - lines.push(``); - } - - // Heap delta table - const hasHeap = runs.some(r => r.heapDeltaMb != null); - if (hasHeap) { - lines.push(`## Heap Memory Delta (MB)`); - lines.push(``); - lines.push(`| Query | ${engines.join(' | ')} |`); - lines.push(`|---|${engines.map(() => '---:').join('|')}|`); - qids.forEach(qid => { - const cells = engines.map(e => { const r = runs.find(r => r.engine === e && r.queryId === qid); return r && r.heapDeltaMb != null ? r.heapDeltaMb.toFixed(1) + ' MB' : '—'; }); - lines.push(`| ${qid} | ${cells.join(' | ')} |`); - }); - lines.push(``); - } - - const blob = new Blob([lines.join('\n')], { type: 'text/markdown;charset=utf-8;' }); - const url = URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = `benchmark-${dataset}-${now}.md`; - a.click(); - URL.revokeObjectURL(url); -} - -// ── Export PDF (print-ready HTML report) ───────────────────────────────────── - -function exportQueryPdf() { - const runs = (allQueryRuns ?? []).filter(r => - !hiddenEngines.has(r.engine) && - (activeQueryEngines.size === 0 || activeQueryEngines.has(r.engine)) && - (activeEngines.size === 0 || activeEngines.has(r.engine)) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) && - (activeQueryTypeFilter === 'all' || (r.queryCategory ?? 'GRAPH_PATTERN') === activeQueryTypeFilter) - ); - if (runs.length === 0) return; - - const engines = [...new Set(runs.map(r => r.engine))]; - const qids = [...new Set(runs.map(r => r.queryId))].sort( - (a, b) => parseInt(a.split('_')[1]) - parseInt(b.split('_')[1]) - ); - const meta = currentData?.metadata ?? {}; - const dataset = runs[0]?.dataset ?? ''; - const now = new Date().toISOString().slice(0, 10); - const hasTtfr = runs.some(r => r.medianTtfrMs != null && r.medianTtfrMs >= 0); - const hasHeap = runs.some(r => r.heapDeltaMb != null); - - const ENGINE_COLORS = ['#4e79a7','#f28e2b','#59a14f','#e15759','#76b7b2','#edc948','#b07aa1','#ff9da7']; - const colorMap = {}; - engines.forEach((e, i) => { colorMap[e] = ENGINE_COLORS[i % ENGINE_COLORS.length]; }); - - const thStyle = `style="padding:6px 10px;text-align:right;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; - const th0Style = `style="padding:6px 10px;text-align:left;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; - const tdStyle = `style="padding:5px 10px;text-align:right;border:1px solid #ddd"`; - const td0Style = `style="padding:5px 10px;text-align:left;border:1px solid #ddd;font-family:monospace"`; - - function buildTable(title, getCellFn, showBest) { - const header = `Query${engines.map(e => - `${e}`).join('')}${showBest ? `Best` : ''}`; - const rows = qids.map(qid => { - const vals = engines.map(e => getCellFn(runs.find(r => r.engine === e && r.queryId === qid))); - const nums = vals.map(v => typeof v === 'number' ? v : null); - const minV = Math.min(...nums.filter(v => v !== null)); - const wiIdx = isFinite(minV) ? nums.indexOf(minV) : -1; - const cells = vals.map((v, i) => { - const isWin = showBest && i === wiIdx; - const disp = v === null ? '—' : typeof v === 'number' ? v.toLocaleString() : v; - return `${disp}`; - }); - const bestCell = showBest ? `${wiIdx >= 0 ? `${engines[wiIdx]}` : '—'}` : ''; - return `${qid}${cells.join('')}${bestCell}`; - }).join(''); - return `

${title}

- ${header}${rows}
`; - } - - const execTable = buildTable('Median Execution Time (ms)', - r => (r && r.medianMs >= 0) ? r.medianMs : null, true); - const ttfrTable = hasTtfr ? buildTable('Time to First Result — TTFR (ms)', - r => (r && r.medianTtfrMs != null && r.medianTtfrMs >= 0) ? r.medianTtfrMs : null, true) : ''; - const heapTable = hasHeap ? buildTable('Heap Memory Delta (MB)', - r => (r && r.heapDeltaMb != null) ? r.heapDeltaMb.toFixed(1) + ' MB' : null, false) : ''; - - const filterNote = activeQueryTypeFilter !== 'all' - ? `

Query type filter: ${activeQueryTypeFilter}

` : ''; - - const html = ` - SPARQL Benchmark — ${dataset} — ${now} - - -

SPARQL Benchmark Comparison

-

Dataset: ${dataset}

-

Generated: ${meta.generatedAt ?? now}

-

Java: ${meta.java ?? '—'}  ·  OS: ${meta.os ?? '—'}

-

Protocol: warmup + ${meta.protocol?.queryRepetitions ?? 3} repetitions, median

- ${filterNote} - ${execTable}${ttfrTable}${heapTable} -

Generated by corese-benchmark dashboard — ${now}

- `; - - // Use a hidden iframe to avoid popup blocker issues - let iframe = document.getElementById('_pdf-print-frame'); - if (iframe) iframe.remove(); - iframe = document.createElement('iframe'); - iframe.id = '_pdf-print-frame'; - iframe.style.cssText = 'position:fixed;top:-9999px;left:-9999px;width:1px;height:1px;border:none'; - document.body.appendChild(iframe); - iframe.contentDocument.open(); - iframe.contentDocument.write(html); - iframe.contentDocument.close(); - setTimeout(() => { iframe.contentWindow.focus(); iframe.contentWindow.print(); }, 400); -} - -// ── Export JSON (filtered view) ─────────────────────────────────────────────── - -function exportFilteredJson() { - const runs = getFilteredRuns(allRuns); - const queryRuns = (allQueryRuns ?? []).filter(r => - !hiddenEngines.has(r.engine) && - (activeEngines.size === 0 || activeEngines.has(r.engine)) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) - ); - if (runs.length === 0 && queryRuns.length === 0) return; - - const payload = { metadata: currentData?.metadata ?? {}, runs }; - if (queryRuns.length > 0) payload.queryRuns = queryRuns; - - const blob = new Blob([JSON.stringify(payload, null, 2)], { type: 'application/json;charset=utf-8;' }); - const url = URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = `benchmark-filtered-${new Date().toISOString().slice(0,10)}.json`; - a.click(); - URL.revokeObjectURL(url); -} - -// ── Export CSV (filtered view) ──────────────────────────────────────────────── - -function exportFilteredCsv() { - const runs = getFilteredRuns(allRuns); - const queryRuns = (allQueryRuns ?? []).filter(r => - !hiddenEngines.has(r.engine) && - (activeEngines.size === 0 || activeEngines.has(r.engine)) && - (activeDatasets.size === 0 || activeDatasets.has(r.dataset)) - ); - if (runs.length === 0 && queryRuns.length === 0) return; - - const escape = v => `"${String(v ?? '').replace(/"/g, '""')}"`; - const lines = []; - - if (runs.length > 0) { - const hdr = ['engine', 'dataset', 'file', 'triples', 'loadingTimeMs', 'memoryDeltaMb', 'cpuPercent']; - lines.push('# LOAD BENCHMARK'); - lines.push(hdr.join(',')); - runs.forEach(r => lines.push(hdr.map(h => escape(r[h])).join(','))); - } - - if (queryRuns.length > 0) { - if (lines.length) lines.push(''); - lines.push('# QUERY BENCHMARK'); - lines.push(['engine', 'dataset', 'queryId', 'medianMs'].join(',')); - queryRuns.forEach(r => - lines.push([escape(r.engine), escape(r.dataset), escape(r.queryId), escape(r.medianMs)].join(',')) - ); - } - - const blob = new Blob([lines.join('\n')], { type: 'text/csv;charset=utf-8;' }); - const url = URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = `benchmark-filtered-${new Date().toISOString().slice(0,10)}.csv`; - a.click(); - URL.revokeObjectURL(url); -} - -main(); diff --git a/site/build-bundle.js b/site/build-bundle.js new file mode 100644 index 0000000..dc2c612 --- /dev/null +++ b/site/build-bundle.js @@ -0,0 +1,67 @@ +// build-bundle.js — Concatenate ES6 modules into a single non-module script +// Usage: node build-bundle.js +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +const BASE = path.join(__dirname, 'js'); + +// Files in dependency order +const FILES = [ + 'state.js', + 'formatters.js', + 'data-loader.js', + 'components/status-badge.js', + 'components/result-dialog.js', + 'components/result-table.js', + 'charts/loading-chart.js', + 'charts/throughput-chart.js', + 'charts/cpu-chart.js', + 'charts/query-breakdown.js', + 'chart-expand.js', + 'pages/overview.js', + 'pages/bowlogna.js', + 'pages/bsbm.js', + 'pages/lubm.js', + 'pages/dbpedia.js', + 'pages/w3c.js', + 'pages/transparency.js', + 'export-md.js', + 'export-pdf.js', + 'export-csv.js', + 'app.js', +]; + +// Files whose top-level consts should be block-scoped to avoid collisions +// (these files are wrapped in { } blocks; function declarations hoist in sloppy mode) +const BLOCK_WRAP = new Set([ + 'pages/bowlogna.js', 'pages/bsbm.js', 'pages/lubm.js', 'pages/dbpedia.js', + 'charts/query-breakdown.js', +]); + +let bundle = '// bundle.js — Auto-generated. Do not edit directly.\n// Run: node build-bundle.js\n(function () {\n// sloppy mode intentional: block-level function declarations hoist to this scope\n\n'; + +for (const file of FILES) { + let src = fs.readFileSync(path.join(BASE, file), 'utf8'); + + const cleaned = src + .split('\n') + .filter(line => !line.match(/^'use strict';?$/)) + .filter(line => !line.match(/^import .+from .+;$/)) + .filter(line => !line.match(/^export default \w+;$/)) + .map(line => line.replace(/^export (async function|function|const|let|class) /, '$1 ')) + .join('\n'); + + if (BLOCK_WRAP.has(file)) { + bundle += `// ── ${file} ──\n{\n${cleaned}\n}\n\n`; + } else { + bundle += `// ── ${file} ──\n${cleaned}\n\n`; + } +} + +bundle += '})();\n'; + +const out = path.join(__dirname, 'js', 'bundle.js'); +fs.writeFileSync(out, bundle, 'utf8'); +console.log(`Written ${out} (${(bundle.length / 1024).toFixed(1)} KB)`); diff --git a/site/data/mock-report-v2.json b/site/data/mock-report-v2.json index 9cb6a04..741b7af 100644 --- a/site/data/mock-report-v2.json +++ b/site/data/mock-report-v2.json @@ -13,10 +13,10 @@ "cpuSockets": 1, "cpuCores": 16, "cpuThreads": 32, - "cpuFrequencyMhz": 2450.0, + "cpuFrequencyMhz": 2450, "cpuGovernor": "performance", - "ramTotalGb": 64.0, - "swapTotalGb": 8.0, + "ramTotalGb": 64, + "swapTotalGb": 8, "swappiness": 1, "osDistribution": "Ubuntu 24.04.1 LTS", "osKernel": "6.8.0-45-generic", @@ -37,15 +37,381 @@ "metric": "median" }, "engines": [ - { "id": "corese.next", "family": "corese", "version": "5.0.0-SNAPSHOT", "label": "Corese v5 (Next)" }, - { "id": "jena.6.2.0", "family": "jena", "version": "6.2.0", "label": "Apache Jena 6.2.0" }, - { "id": "rdf4j.5.3.2", "family": "rdf4j", "version": "5.3.2", "label": "Eclipse RDF4J 5.3.2" } + { + "id": "corese.next", + "family": "corese", + "version": "5.0.0-SNAPSHOT", + "label": "Corese v5 (Next)" + }, + { + "id": "corese.4.6.5", + "family": "corese", + "version": "4.6.5", + "label": "Corese v4.6.5" + }, + { + "id": "jena.6.2.0", + "family": "jena", + "version": "6.2.0", + "label": "Apache Jena 6.2.0" + }, + { + "id": "rdf4j.5.3.2", + "family": "rdf4j", + "version": "5.3.2", + "label": "Eclipse RDF4J 5.3.2" + } ], "datasetQueries": { "bowlogna": [ - { "id": "query_1", "category": "GRAPH_PATTERN", "label": "Count Master Theses", "sparql": "PREFIX rdf: PREFIX bb: SELECT (COUNT(?X) as ?MasterTheses) WHERE { ?X rdf:type bb:Master_Thesis }", "expectedRowCount": 1, "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - { "id": "query_8", "category": "AGGREGATION", "label": "Failures for teaching unit (GROUP BY)", "sparql": "PREFIX rdf: PREFIX bb: SELECT DISTINCT ?X (count(?E) as ?Failures) WHERE { ?X rdf:type bb:Teaching_Unit . ?E bb:evaluatesTeachingUnit ?X . ?E bb:hasMark ?Y . FILTER (?Y < 3) } GROUP BY ?X", "expectedRowCount": 42, "expectedHash": "8f3e2a0459a1c8996fb92427ae41e4649b934ca495991b7852b8554a7b9c1e11" }, - { "id": "query_10", "category": "REGEX_TEMPORAL", "label": "Supervised theses ranking (REGEX, LIMIT)", "sparql": "PREFIX rdf: PREFIX bb: SELECT ?X (COUNT(?Y) as ?num) WHERE { ?X rdf:type bb:Professor . ?Y bb:supervisedBy ?X . ?Y rdf:type ?t . FILTER REGEX (?t, 'Thesis', 'i') } GROUP BY ?X ORDER BY DESC(?num) LIMIT 1", "expectedRowCount": 1, "expectedHash": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae" } + { + "id": "query_1", + "category": "GRAPH_PATTERN", + "label": "Q1", + "sparql": "SELECT (COUNT(?X) as ?n) WHERE { ?X a bb:Master_Thesis }", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_2", + "category": "GRAPH_PATTERN", + "label": "Q2", + "sparql": "SELECT ?X WHERE { ?X a bb:Master_Thesis ; bb:hasMention ?m }", + "expectedRowCount": 312, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_3", + "category": "REGEX_TEMPORAL", + "label": "Q3", + "sparql": "SELECT ?X WHERE { ?X a bb:Student ; bb:graduatedAt ?d . FILTER(xsd:dateTime(?d) < NOW()) }", + "expectedRowCount": 980, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_4", + "category": "REGEX_TEMPORAL", + "label": "Q4", + "sparql": "SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledIn ?m . FILTER(xsd:dateTime(?m) < NOW()) }", + "expectedRowCount": 452, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_5", + "category": "COMPLEX_JOIN", + "label": "Q5", + "sparql": "SELECT ?X (SUM(?c) as ?ects) WHERE { ?X bb:took ?u . ?u bb:hasCredits ?c } GROUP BY ?X", + "expectedRowCount": 62, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_6", + "category": "REGEX_TEMPORAL", + "label": "Q6", + "sparql": "SELECT ?X WHERE { ?X a bb:Student ; bb:lastName ?ln . FILTER(regex(?ln,\"^D\")) }", + "expectedRowCount": 145, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_7", + "category": "COMPLEX_JOIN", + "label": "Q7", + "sparql": "SELECT ?X ?Y WHERE { ?X bb:attr1 ?A . ?A bb:attr2 ?Y }", + "expectedRowCount": 88, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_8", + "category": "AGGREGATION", + "label": "Q8", + "sparql": "SELECT ?X (COUNT(?E) as ?Failures) WHERE { ?X a bb:Teaching_Unit . ?E bb:hasMark ?Y . FILTER(?Y < 3) } GROUP BY ?X", + "expectedRowCount": 42, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_9", + "category": "AGGREGATION", + "label": "Q9", + "sparql": "SELECT ?X (COUNT(?E) as ?Evals) WHERE { ?X a bb:Teaching_Unit . ?E bb:evaluatesTeachingUnit ?X } GROUP BY ?X", + "expectedRowCount": 42, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_10", + "category": "REGEX_TEMPORAL", + "label": "Q10", + "sparql": "SELECT ?X (COUNT(?Y) as ?n) WHERE { ?X a bb:Professor . ?Y bb:supervisedBy ?X . FILTER REGEX(?t,\"Thesis\",\"i\") } GROUP BY ?X ORDER BY DESC(?n) LIMIT 1", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_11", + "category": "AGGREGATION", + "label": "Q11", + "sparql": "SELECT ?X (AVG(?m) as ?avg) WHERE { ?X a bb:Student ; bb:hasMark ?m } GROUP BY ?X ORDER BY DESC(?avg) LIMIT 5", + "expectedRowCount": 5, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_12", + "category": "AGGREGATION", + "label": "Q12", + "sparql": "SELECT ?T (AVG(?d) as ?dur) WHERE { ?T a bb:Track ; bb:duration ?d } GROUP BY ?T", + "expectedRowCount": 18, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_13", + "category": "AGGREGATION", + "label": "Q13", + "sparql": "SELECT (AVG(?m) as ?avg) WHERE { ?X bb:hasMark ?m ; bb:atSemester 1 }", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_14", + "category": "COMPLEX_JOIN", + "label": "Q14", + "sparql": "SELECT ?D ?P WHERE { ?X a bb:Student ; bb:inDept ?D . ?P a bb:Professor ; bb:inDept ?D }", + "expectedRowCount": 28, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_15", + "category": "GRAPH_PATTERN", + "label": "Q15", + "sparql": "SELECT ?U WHERE { ?U a bb:Teaching_Unit ; bb:language \"en\" }", + "expectedRowCount": 7, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_16", + "category": "REGEX_TEMPORAL", + "label": "Q16", + "sparql": "SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledFrom ?s . FILTER(?s >= \"2020-01-01\"^^xsd:date) }", + "expectedRowCount": 220, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_17", + "category": "REGEX_TEMPORAL", + "label": "Q17", + "sparql": "SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledTo ?e . FILTER(?e <= \"2025-12-31\"^^xsd:date) }", + "expectedRowCount": 195, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "bsbm": [ + { + "id": "query_1", + "category": "SEARCH", + "label": "Q1", + "sparql": "SELECT DISTINCT ?product WHERE { ?product a bsbm:Product ; bsbm:productFeature ?f1 ; bsbm:productPropertyNumeric1 ?v1 . FILTER(?v1 > 450) } ORDER BY ?product LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_2", + "category": "SEARCH", + "label": "Q2", + "sparql": "SELECT ?label ?comment ?producer WHERE { ?p rdfs:label ?label ; rdfs:comment ?comment ; bsbm:producer ?producer }", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_3", + "category": "SEARCH", + "label": "Q3", + "sparql": "SELECT ?product WHERE { ?product a bsbm:Product ; bsbm:productFeature ?f ; bsbm:productPropertyNumeric1 ?v1 ; bsbm:productPropertyNumeric3 ?v3 . FILTER(?v1 > 350 && ?v3 < 950) } LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_4", + "category": "SEARCH", + "label": "Q4", + "sparql": "SELECT ?product ?label WHERE { { ?product bsbm:productFeature ?f } UNION { ?product rdfs:label ?label . FILTER regex(?label,\"en\") } } ORDER BY ?label LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_5", + "category": "JOIN", + "label": "Q5", + "sparql": "SELECT DISTINCT ?product WHERE { ?product bsbm:productFeature ?f . ?p2 bsbm:productFeature ?f . FILTER(?product != ?p2) } LIMIT 5", + "expectedRowCount": 5, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_6", + "category": "REVIEW", + "label": "Q6", + "sparql": "SELECT ?review ?title WHERE { ?review a bsbm:Review ; dc:title ?title ; bsbm:reviewFor ?product } LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_7", + "category": "OFFER", + "label": "Q7", + "sparql": "SELECT ?offer ?price WHERE { ?offer a bsbm:Offer ; bsbm:price ?price ; bsbm:product ?product } ORDER BY ?price LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_8", + "category": "OFFER", + "label": "Q8", + "sparql": "SELECT ?title ?text WHERE { ?review dc:title ?title ; rev:text ?text ; bsbm:reviewFor ?product }", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_9", + "category": "REVIEW", + "label": "Q9", + "sparql": "SELECT DISTINCT ?reviewer WHERE { ?review bsbm:reviewFor ?product ; rev:reviewer ?reviewer } LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_10", + "category": "OFFER", + "label": "Q10", + "sparql": "SELECT DISTINCT ?offer ?vendor WHERE { ?offer bsbm:vendor ?vendor ; bsbm:product ?product } LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_11", + "category": "REVIEW", + "label": "Q11", + "sparql": "SELECT ?review ?rating WHERE { ?review bsbm:rating1 ?r1 ; bsbm:rating2 ?r2 . BIND((?r1+?r2)/2 AS ?rating) } LIMIT 10", + "expectedRowCount": 10, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_12", + "category": "REVIEW", + "label": "Q12", + "sparql": "SELECT ?review WHERE { ?review a bsbm:Review ; bsbm:reviewFor ?product . FILTER NOT EXISTS { ?other bsbm:reviewFor ?product . FILTER(?other != ?review) } } LIMIT 5", + "expectedRowCount": 5, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "lubm": [ + { + "id": "query_1", + "category": "SELECTIVE", + "label": "Q1", + "sparql": "SELECT ?X WHERE { ?X a ub:GraduateStudent ; ub:takesCourse ?C . ?C a ub:GraduateCourse ; ub:subOrganizationOf }", + "expectedRowCount": 4, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_2", + "category": "LARGE_RESULT", + "label": "Q2", + "sparql": "SELECT ?X ?Y ?Z WHERE { ?X a ub:GraduateStudent ; ub:memberOf ?Y . ?Y a ub:Department ; ub:subOrganizationOf ?Z . ?Z a ub:University }", + "expectedRowCount": 2348, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_3", + "category": "SELECTIVE", + "label": "Q3", + "sparql": "SELECT ?X WHERE { ?X a ub:Publication ; ub:publicationAuthor ?Y . ?Y ub:memberOf }", + "expectedRowCount": 6, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_4", + "category": "TRANSITIVE", + "label": "Q4", + "sparql": "SELECT ?X ?Y1 ?Y2 ?Y3 WHERE { ?X a ub:Professor ; ub:worksFor ; ub:name ?Y1 ; ub:emailAddress ?Y2 ; ub:telephone ?Y3 }", + "expectedRowCount": 34, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_5", + "category": "SELECTIVE", + "label": "Q5", + "sparql": "SELECT ?X WHERE { ?X a ub:Person ; ub:memberOf }", + "expectedRowCount": 719, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_6", + "category": "LARGE_RESULT", + "label": "Q6", + "sparql": "SELECT ?X WHERE { ?X a ub:Student }", + "expectedRowCount": 7790, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_7", + "category": "SELECTIVE", + "label": "Q7", + "sparql": "SELECT ?X ?Y WHERE { ?X a ub:Student ; ub:takesCourse ?Y . ?Y a ub:Course . ?Y ub:teachingAssistantOf ?X }", + "expectedRowCount": 67, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_8", + "category": "SELECTIVE", + "label": "Q8", + "sparql": "SELECT ?X ?Y ?Z WHERE { ?X a ub:Student ; ub:emailAddress ?Y ; ub:memberOf ?Z . ?Z a ub:Department ; ub:subOrganizationOf }", + "expectedRowCount": 7790, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_9", + "category": "LARGE_RESULT", + "label": "Q9", + "sparql": "SELECT ?X ?Y ?Z WHERE { ?X a ub:Student ; ub:advisor ?Y ; ub:takesCourse ?Z . ?Y ub:teacherOf ?Z }", + "expectedRowCount": 208, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_10", + "category": "SELECTIVE", + "label": "Q10", + "sparql": "SELECT ?X WHERE { ?X a ub:Student ; ub:takesCourse ?C . ?C a ub:GraduateCourse ; ub:subOrganizationOf }", + "expectedRowCount": 4, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_11", + "category": "TRANSITIVE", + "label": "Q11", + "sparql": "SELECT ?X WHERE { ?X a ub:ResearchGroup ; ub:subOrganizationOf }", + "expectedRowCount": 224, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_12", + "category": "TRANSITIVE", + "label": "Q12", + "sparql": "SELECT ?X ?Y WHERE { ?X a ub:Chair ; ub:worksFor ?Y . ?Y ub:subOrganizationOf }", + "expectedRowCount": 15, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_13", + "category": "TRANSITIVE", + "label": "Q13", + "sparql": "SELECT ?X WHERE { ?X a ub:Person ; ub:hasAlumnus }", + "expectedRowCount": 1, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "id": "query_14", + "category": "SELECTIVE", + "label": "Q14", + "sparql": "SELECT ?X WHERE { ?X a ub:UndergraduateStudent }", + "expectedRowCount": 5916, + "expectedHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } ] } }, @@ -56,18 +422,91 @@ "file": "bowlogna.ttl", "triples": 1234567, "loadingTimeMs": 2450, - "repetitionsMs": [2610, 2450, 2430], - "throughputTriplesPerSec": 503904.8, - "memoryBeforeMb": 42.1, - "memoryAfterMb": 387.3, - "memoryDeltaMb": 345.2, - "cpuPercent": 85.4, + "repetitionsMs": [ + 2597, + 2450, + 2377 + ], + "throughputTriplesPerSec": 503905, + "memoryBeforeMb": 40, + "memoryAfterMb": 488.3363818257978, + "memoryDeltaMb": 448.3363818257978, + "cpuPercent": 80, "timeSeries": [ - { "elapsedMs": 0, "triplesLoaded": 0, "heapUsedMb": 42.1 }, - { "elapsedMs": 500, "triplesLoaded": 310000, "heapUsedMb": 115.4 }, - { "elapsedMs": 1000, "triplesLoaded": 650000, "heapUsedMb": 198.0 }, - { "elapsedMs": 1500, "triplesLoaded": 980000, "heapUsedMb": 280.2 }, - { "elapsedMs": 2000, "triplesLoaded": 1234567, "heapUsedMb": 387.3 } + { + "elapsedMs": 0, + "triplesLoaded": 0, + "heapUsedMb": 42 + }, + { + "elapsedMs": 500, + "triplesLoaded": 310000, + "heapUsedMb": 115 + }, + { + "elapsedMs": 1000, + "triplesLoaded": 650000, + "heapUsedMb": 198 + }, + { + "elapsedMs": 1500, + "triplesLoaded": 980000, + "heapUsedMb": 280 + }, + { + "elapsedMs": 2000, + "triplesLoaded": 1234567, + "heapUsedMb": 387 + } + ] + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "file": "bowlogna.ttl", + "triples": 1234567, + "loadingTimeMs": 3850, + "repetitionsMs": [ + 4081, + 3850, + 3735 + ], + "throughputTriplesPerSec": 320667, + "memoryBeforeMb": 40, + "memoryAfterMb": 506.5544779042716, + "memoryDeltaMb": 466.5544779042716, + "cpuPercent": 86, + "timeSeries": [ + { + "elapsedMs": 0, + "triplesLoaded": 0, + "heapUsedMb": 44 + }, + { + "elapsedMs": 500, + "triplesLoaded": 260000, + "heapUsedMb": 125 + }, + { + "elapsedMs": 1000, + "triplesLoaded": 560000, + "heapUsedMb": 215 + }, + { + "elapsedMs": 1500, + "triplesLoaded": 880000, + "heapUsedMb": 310 + }, + { + "elapsedMs": 2000, + "triplesLoaded": 1150000, + "heapUsedMb": 405 + }, + { + "elapsedMs": 2500, + "triplesLoaded": 1234567, + "heapUsedMb": 430 + } ] }, { @@ -76,18 +515,42 @@ "file": "bowlogna.ttl", "triples": 1234567, "loadingTimeMs": 2180, - "repetitionsMs": [2250, 2180, 2160], - "throughputTriplesPerSec": 566315.1, - "memoryBeforeMb": 45.0, - "memoryAfterMb": 412.0, - "memoryDeltaMb": 367.0, - "cpuPercent": 92.1, + "repetitionsMs": [ + 2311, + 2180, + 2115 + ], + "throughputTriplesPerSec": 566315, + "memoryBeforeMb": 40, + "memoryAfterMb": 447.40680901841904, + "memoryDeltaMb": 407.40680901841904, + "cpuPercent": 87, "timeSeries": [ - { "elapsedMs": 0, "triplesLoaded": 0, "heapUsedMb": 45.0 }, - { "elapsedMs": 500, "triplesLoaded": 350000, "heapUsedMb": 130.0 }, - { "elapsedMs": 1000, "triplesLoaded": 720000, "heapUsedMb": 220.0 }, - { "elapsedMs": 1500, "triplesLoaded": 1050000, "heapUsedMb": 315.0 }, - { "elapsedMs": 2000, "triplesLoaded": 1234567, "heapUsedMb": 412.0 } + { + "elapsedMs": 0, + "triplesLoaded": 0, + "heapUsedMb": 45 + }, + { + "elapsedMs": 500, + "triplesLoaded": 350000, + "heapUsedMb": 130 + }, + { + "elapsedMs": 1000, + "triplesLoaded": 720000, + "heapUsedMb": 220 + }, + { + "elapsedMs": 1500, + "triplesLoaded": 1050000, + "heapUsedMb": 315 + }, + { + "elapsedMs": 2000, + "triplesLoaded": 1234567, + "heapUsedMb": 412 + } ] }, { @@ -96,20 +559,552 @@ "file": "bowlogna.ttl", "triples": 1234567, "loadingTimeMs": 3150, - "repetitionsMs": [3300, 3150, 3120], - "throughputTriplesPerSec": 391926.0, - "memoryBeforeMb": 40.5, - "memoryAfterMb": 510.5, - "memoryDeltaMb": 470.0, - "cpuPercent": 78.5, + "repetitionsMs": [ + 3339, + 3150, + 3056 + ], + "throughputTriplesPerSec": 391926, + "memoryBeforeMb": 40, + "memoryAfterMb": 480.8698035181285, + "memoryDeltaMb": 440.8698035181285, + "cpuPercent": 87, "timeSeries": [ - { "elapsedMs": 0, "triplesLoaded": 0, "heapUsedMb": 40.5 }, - { "elapsedMs": 500, "triplesLoaded": 220000, "heapUsedMb": 110.0 }, - { "elapsedMs": 1000, "triplesLoaded": 480000, "heapUsedMb": 210.0 }, - { "elapsedMs": 1500, "triplesLoaded": 750000, "heapUsedMb": 320.0 }, - { "elapsedMs": 2000, "triplesLoaded": 1020000, "heapUsedMb": 430.0 }, - { "elapsedMs": 2500, "triplesLoaded": 1234567, "heapUsedMb": 510.5 } + { + "elapsedMs": 0, + "triplesLoaded": 0, + "heapUsedMb": 40 + }, + { + "elapsedMs": 500, + "triplesLoaded": 220000, + "heapUsedMb": 110 + }, + { + "elapsedMs": 1000, + "triplesLoaded": 480000, + "heapUsedMb": 210 + }, + { + "elapsedMs": 1500, + "triplesLoaded": 750000, + "heapUsedMb": 320 + }, + { + "elapsedMs": 2000, + "triplesLoaded": 1020000, + "heapUsedMb": 430 + }, + { + "elapsedMs": 2500, + "triplesLoaded": 1234567, + "heapUsedMb": 510 + } ] + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "file": "bsbm_1m.nt", + "triples": 1800000, + "loadingTimeMs": 3800, + "repetitionsMs": [ + 4028, + 3800, + 3686 + ], + "throughputTriplesPerSec": 473684, + "memoryBeforeMb": 45, + "memoryAfterMb": 518.9258269786317, + "memoryDeltaMb": 473.9258269786317, + "cpuPercent": 81, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "file": "bsbm_1m.nt", + "triples": 1800000, + "loadingTimeMs": 5900, + "repetitionsMs": [ + 6254, + 5900, + 5723 + ], + "throughputTriplesPerSec": 305085, + "memoryBeforeMb": 45, + "memoryAfterMb": 576.588974860786, + "memoryDeltaMb": 531.588974860786, + "cpuPercent": 91, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "file": "bsbm_1m.nt", + "triples": 1800000, + "loadingTimeMs": 3200, + "repetitionsMs": [ + 3392, + 3200, + 3104 + ], + "throughputTriplesPerSec": 562500, + "memoryBeforeMb": 45, + "memoryAfterMb": 519.1516301348852, + "memoryDeltaMb": 474.1516301348852, + "cpuPercent": 81, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "file": "bsbm_1m.nt", + "triples": 1800000, + "loadingTimeMs": 5100, + "repetitionsMs": [ + 5406, + 5100, + 4947 + ], + "throughputTriplesPerSec": 352941, + "memoryBeforeMb": 45, + "memoryAfterMb": 547.1946881304165, + "memoryDeltaMb": 502.19468813041647, + "cpuPercent": 78, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "lubm", + "file": "lubm_univ10.nt", + "triples": 3200000, + "loadingTimeMs": 7200, + "repetitionsMs": [ + 7632, + 7200, + 6984 + ], + "throughputTriplesPerSec": 444444, + "memoryBeforeMb": 50, + "memoryAfterMb": 972.0157225835871, + "memoryDeltaMb": 922.0157225835871, + "cpuPercent": 92, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "file": "lubm_univ10.nt", + "triples": 3200000, + "loadingTimeMs": 11400, + "repetitionsMs": [ + 12084, + 11400, + 11058 + ], + "throughputTriplesPerSec": 280702, + "memoryBeforeMb": 50, + "memoryAfterMb": 880.2340201735084, + "memoryDeltaMb": 830.2340201735084, + "cpuPercent": 93, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "file": "lubm_univ10.nt", + "triples": 3200000, + "loadingTimeMs": 5800, + "repetitionsMs": [ + 6148, + 5800, + 5626 + ], + "throughputTriplesPerSec": 551724, + "memoryBeforeMb": 50, + "memoryAfterMb": 1011.3881346414328, + "memoryDeltaMb": 961.3881346414328, + "cpuPercent": 88, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "file": "lubm_univ10.nt", + "triples": 3200000, + "loadingTimeMs": 9400, + "repetitionsMs": [ + 9964, + 9400, + 9118 + ], + "throughputTriplesPerSec": 340426, + "memoryBeforeMb": 50, + "memoryAfterMb": 959.782982834467, + "memoryDeltaMb": 909.782982834467, + "cpuPercent": 85, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "dbpedia", + "file": "persondata_en.nt", + "triples": 356914, + "loadingTimeMs": 744, + "repetitionsMs": [ + 789, + 744, + 722 + ], + "throughputTriplesPerSec": 479723, + "memoryBeforeMb": 45, + "memoryAfterMb": 181.97542857142855, + "memoryDeltaMb": 136.97542857142855, + "cpuPercent": 93, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "dbpedia", + "file": "persondata_en.nt", + "triples": 356914, + "loadingTimeMs": 1190, + "repetitionsMs": [ + 1261, + 1190, + 1154 + ], + "throughputTriplesPerSec": 299928, + "memoryBeforeMb": 45, + "memoryAfterMb": 181.97542857142855, + "memoryDeltaMb": 136.97542857142855, + "cpuPercent": 86, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "dbpedia", + "file": "persondata_en.nt", + "triples": 356914, + "loadingTimeMs": 632, + "repetitionsMs": [ + 670, + 632, + 613 + ], + "throughputTriplesPerSec": 564737, + "memoryBeforeMb": 45, + "memoryAfterMb": 181.97542857142855, + "memoryDeltaMb": 136.97542857142855, + "cpuPercent": 84, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "dbpedia", + "file": "persondata_en.nt", + "triples": 356914, + "loadingTimeMs": 1004, + "repetitionsMs": [ + 1064, + 1004, + 974 + ], + "throughputTriplesPerSec": 355492, + "memoryBeforeMb": 45, + "memoryAfterMb": 181.97542857142855, + "memoryDeltaMb": 136.97542857142855, + "cpuPercent": 88, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "dbpedia", + "file": "homepages_en.nt", + "triples": 394897, + "loadingTimeMs": 823, + "repetitionsMs": [ + 872, + 823, + 798 + ], + "throughputTriplesPerSec": 479826, + "memoryBeforeMb": 45, + "memoryAfterMb": 192.82771428571428, + "memoryDeltaMb": 147.82771428571428, + "cpuPercent": 83, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "dbpedia", + "file": "homepages_en.nt", + "triples": 394897, + "loadingTimeMs": 1316, + "repetitionsMs": [ + 1395, + 1316, + 1277 + ], + "throughputTriplesPerSec": 300074, + "memoryBeforeMb": 45, + "memoryAfterMb": 192.82771428571428, + "memoryDeltaMb": 147.82771428571428, + "cpuPercent": 82, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "dbpedia", + "file": "homepages_en.nt", + "triples": 394897, + "loadingTimeMs": 699, + "repetitionsMs": [ + 741, + 699, + 678 + ], + "throughputTriplesPerSec": 564946, + "memoryBeforeMb": 45, + "memoryAfterMb": 192.82771428571428, + "memoryDeltaMb": 147.82771428571428, + "cpuPercent": 86, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "dbpedia", + "file": "homepages_en.nt", + "triples": 394897, + "loadingTimeMs": 1111, + "repetitionsMs": [ + 1178, + 1111, + 1078 + ], + "throughputTriplesPerSec": 355443, + "memoryBeforeMb": 45, + "memoryAfterMb": 192.82771428571428, + "memoryDeltaMb": 147.82771428571428, + "cpuPercent": 90, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "dbpedia", + "file": "category_labels_en.nt", + "triples": 565108, + "loadingTimeMs": 1177, + "repetitionsMs": [ + 1248, + 1177, + 1142 + ], + "throughputTriplesPerSec": 480126, + "memoryBeforeMb": 45, + "memoryAfterMb": 241.45942857142856, + "memoryDeltaMb": 196.45942857142856, + "cpuPercent": 90, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "dbpedia", + "file": "category_labels_en.nt", + "triples": 565108, + "loadingTimeMs": 1884, + "repetitionsMs": [ + 1997, + 1884, + 1827 + ], + "throughputTriplesPerSec": 299951, + "memoryBeforeMb": 45, + "memoryAfterMb": 241.45942857142856, + "memoryDeltaMb": 196.45942857142856, + "cpuPercent": 91, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "dbpedia", + "file": "category_labels_en.nt", + "triples": 565108, + "loadingTimeMs": 1001, + "repetitionsMs": [ + 1061, + 1001, + 971 + ], + "throughputTriplesPerSec": 564543, + "memoryBeforeMb": 45, + "memoryAfterMb": 241.45942857142856, + "memoryDeltaMb": 196.45942857142856, + "cpuPercent": 89, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "dbpedia", + "file": "category_labels_en.nt", + "triples": 565108, + "loadingTimeMs": 1589, + "repetitionsMs": [ + 1684, + 1589, + 1541 + ], + "throughputTriplesPerSec": 355638, + "memoryBeforeMb": 45, + "memoryAfterMb": 241.45942857142856, + "memoryDeltaMb": 196.45942857142856, + "cpuPercent": 84, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "dbpedia", + "file": "disambiguations_en.nt", + "triples": 768924, + "loadingTimeMs": 1602, + "repetitionsMs": [ + 1698, + 1602, + 1554 + ], + "throughputTriplesPerSec": 479978, + "memoryBeforeMb": 45, + "memoryAfterMb": 299.69257142857145, + "memoryDeltaMb": 254.69257142857145, + "cpuPercent": 87, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "dbpedia", + "file": "disambiguations_en.nt", + "triples": 768924, + "loadingTimeMs": 2563, + "repetitionsMs": [ + 2717, + 2563, + 2486 + ], + "throughputTriplesPerSec": 300009, + "memoryBeforeMb": 45, + "memoryAfterMb": 299.69257142857145, + "memoryDeltaMb": 254.69257142857145, + "cpuPercent": 89, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "dbpedia", + "file": "disambiguations_en.nt", + "triples": 768924, + "loadingTimeMs": 1362, + "repetitionsMs": [ + 1444, + 1362, + 1321 + ], + "throughputTriplesPerSec": 564555, + "memoryBeforeMb": 45, + "memoryAfterMb": 299.69257142857145, + "memoryDeltaMb": 254.69257142857145, + "cpuPercent": 79, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "dbpedia", + "file": "disambiguations_en.nt", + "triples": 768924, + "loadingTimeMs": 2163, + "repetitionsMs": [ + 2293, + 2163, + 2098 + ], + "throughputTriplesPerSec": 355490, + "memoryBeforeMb": 45, + "memoryAfterMb": 299.69257142857145, + "memoryDeltaMb": 254.69257142857145, + "cpuPercent": 85, + "timeSeries": [] + }, + { + "engine": "corese.next", + "dataset": "dbpedia", + "file": "specific_mappingbased_properties_en.nt", + "triples": 182530, + "loadingTimeMs": 380, + "repetitionsMs": [ + 403, + 380, + 369 + ], + "throughputTriplesPerSec": 480342, + "memoryBeforeMb": 45, + "memoryAfterMb": 132.15142857142857, + "memoryDeltaMb": 87.15142857142857, + "cpuPercent": 87, + "timeSeries": [] + }, + { + "engine": "corese.4.6.5", + "dataset": "dbpedia", + "file": "specific_mappingbased_properties_en.nt", + "triples": 182530, + "loadingTimeMs": 608, + "repetitionsMs": [ + 644, + 608, + 590 + ], + "throughputTriplesPerSec": 300214, + "memoryBeforeMb": 45, + "memoryAfterMb": 132.15142857142857, + "memoryDeltaMb": 87.15142857142857, + "cpuPercent": 83, + "timeSeries": [] + }, + { + "engine": "jena.6.2.0", + "dataset": "dbpedia", + "file": "specific_mappingbased_properties_en.nt", + "triples": 182530, + "loadingTimeMs": 323, + "repetitionsMs": [ + 342, + 323, + 313 + ], + "throughputTriplesPerSec": 565108, + "memoryBeforeMb": 45, + "memoryAfterMb": 132.15142857142857, + "memoryDeltaMb": 87.15142857142857, + "cpuPercent": 86, + "timeSeries": [] + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "dbpedia", + "file": "specific_mappingbased_properties_en.nt", + "triples": 182530, + "loadingTimeMs": 513, + "repetitionsMs": [ + 544, + 513, + 498 + ], + "throughputTriplesPerSec": 355809, + "memoryBeforeMb": 45, + "memoryAfterMb": 132.15142857142857, + "memoryDeltaMb": 87.15142857142857, + "cpuPercent": 84, + "timeSeries": [] } ], "queryRuns": [ @@ -119,9 +1114,38 @@ "queryId": "query_1", "status": "PASS", "medianMs": 8, - "repetitionsMs": [12, 8, 7], - "medianTtfrMs": 6, - "repetitionsTtfrMs": [9, 6, 5], + "repetitionsMs": [ + 9, + 8, + 8 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_1", + "status": "PASS", + "medianMs": 12, + "repetitionsMs": [ + 13, + 12, + 12 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], "rowCount": 1, "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null @@ -132,9 +1156,17 @@ "queryId": "query_1", "status": "PASS", "medianMs": 9, - "repetitionsMs": [14, 9, 8], - "medianTtfrMs": 7, - "repetitionsTtfrMs": [10, 7, 6], + "repetitionsMs": [ + 10, + 9, + 9 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], "rowCount": 1, "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null @@ -145,9 +1177,17 @@ "queryId": "query_1", "status": "PASS", "medianMs": 11, - "repetitionsMs": [16, 11, 10], - "medianTtfrMs": 9, - "repetitionsTtfrMs": [13, 9, 8], + "repetitionsMs": [ + 12, + 11, + 11 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], "rowCount": 1, "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null @@ -155,80 +1195,3530 @@ { "engine": "corese.next", "dataset": "bowlogna", - "queryId": "query_8", + "queryId": "query_2", + "status": "PASS", + "medianMs": 35, + "repetitionsMs": [ + 38, + 35, + 34 + ], + "medianTtfrMs": 4, + "repetitionsTtfrMs": [ + 4, + 4, + 4 + ], + "rowCount": 312, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_2", + "status": "PASS", + "medianMs": 55, + "repetitionsMs": [ + 59, + 55, + 53 + ], + "medianTtfrMs": 7, + "repetitionsTtfrMs": [ + 8, + 7, + 7 + ], + "rowCount": 312, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_2", + "status": "PASS", + "medianMs": 30, + "repetitionsMs": [ + 32, + 30, + 29 + ], + "medianTtfrMs": 4, + "repetitionsTtfrMs": [ + 4, + 4, + 4 + ], + "rowCount": 312, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_2", + "status": "PASS", + "medianMs": 45, + "repetitionsMs": [ + 49, + 45, + 44 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 312, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_3", "status": "PASS", "medianMs": 280, - "repetitionsMs": [310, 280, 275], - "medianTtfrMs": 15, - "repetitionsTtfrMs": [20, 15, 14], - "rowCount": 42, - "hash": "8f3e2a0459a1c8996fb92427ae41e4649b934ca495991b7852b8554a7b9c1e11", + "repetitionsMs": [ + 302, + 280, + 272 + ], + "medianTtfrMs": 34, + "repetitionsTtfrMs": [ + 37, + 34, + 32 + ], + "rowCount": 980, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_3", + "status": "PASS", + "medianMs": 420, + "repetitionsMs": [ + 454, + 420, + 407 + ], + "medianTtfrMs": 50, + "repetitionsTtfrMs": [ + 55, + 50, + 48 + ], + "rowCount": 980, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null }, { "engine": "jena.6.2.0", "dataset": "bowlogna", - "queryId": "query_8", + "queryId": "query_3", + "status": "PASS", + "medianMs": 250, + "repetitionsMs": [ + 270, + 250, + 243 + ], + "medianTtfrMs": 30, + "repetitionsTtfrMs": [ + 33, + 30, + 29 + ], + "rowCount": 980, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_3", "status": "PASS", "medianMs": 320, - "repetitionsMs": [345, 320, 318], - "medianTtfrMs": 45, - "repetitionsTtfrMs": [50, 45, 43], - "rowCount": 42, - "hash": "8f3e2a0459a1c8996fb92427ae41e4649b934ca495991b7852b8554a7b9c1e11", + "repetitionsMs": [ + 346, + 320, + 310 + ], + "medianTtfrMs": 38, + "repetitionsTtfrMs": [ + 42, + 38, + 36 + ], + "rowCount": 980, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_4", + "status": "PASS", + "medianMs": 190, + "repetitionsMs": [ + 205, + 190, + 184 + ], + "medianTtfrMs": 23, + "repetitionsTtfrMs": [ + 25, + 23, + 22 + ], + "rowCount": 452, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_4", + "status": "PASS", + "medianMs": 290, + "repetitionsMs": [ + 313, + 290, + 281 + ], + "medianTtfrMs": 35, + "repetitionsTtfrMs": [ + 39, + 35, + 33 + ], + "rowCount": 452, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_4", + "status": "PASS", + "medianMs": 170, + "repetitionsMs": [ + 184, + 170, + 165 + ], + "medianTtfrMs": 20, + "repetitionsTtfrMs": [ + 22, + 20, + 19 + ], + "rowCount": 452, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null }, { "engine": "rdf4j.5.3.2", "dataset": "bowlogna", - "queryId": "query_8", + "queryId": "query_4", "status": "PASS", - "medianMs": 410, - "repetitionsMs": [430, 410, 405], - "medianTtfrMs": 60, - "repetitionsTtfrMs": [65, 60, 58], - "rowCount": 42, - "hash": "8f3e2a0459a1c8996fb92427ae41e4649b934ca495991b7852b8554a7b9c1e11", + "medianMs": 210, + "repetitionsMs": [ + 227, + 210, + 204 + ], + "medianTtfrMs": 25, + "repetitionsTtfrMs": [ + 28, + 25, + 24 + ], + "rowCount": 452, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null }, { "engine": "corese.next", "dataset": "bowlogna", - "queryId": "query_10", + "queryId": "query_5", "status": "PASS", - "medianMs": 45, - "repetitionsMs": [50, 45, 44], - "medianTtfrMs": 12, - "repetitionsTtfrMs": [15, 12, 11], - "rowCount": 1, - "hash": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae", + "medianMs": 1200, + "repetitionsMs": [ + 1296, + 1200, + 1164 + ], + "medianTtfrMs": 144, + "repetitionsTtfrMs": [ + 158, + 144, + 137 + ], + "rowCount": 62, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_5", + "status": "PASS", + "medianMs": 1850, + "repetitionsMs": [ + 1998, + 1850, + 1795 + ], + "medianTtfrMs": 222, + "repetitionsTtfrMs": [ + 244, + 222, + 211 + ], + "rowCount": 62, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null }, { "engine": "jena.6.2.0", "dataset": "bowlogna", - "queryId": "query_10", + "queryId": "query_5", "status": "PASS", - "medianMs": 48, - "repetitionsMs": [52, 48, 47], - "medianTtfrMs": 14, - "repetitionsTtfrMs": [17, 14, 13], - "rowCount": 1, - "hash": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae", + "medianMs": 900, + "repetitionsMs": [ + 972, + 900, + 873 + ], + "medianTtfrMs": 108, + "repetitionsTtfrMs": [ + 119, + 108, + 103 + ], + "rowCount": 62, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "errorMessage": null }, { "engine": "rdf4j.5.3.2", "dataset": "bowlogna", - "queryId": "query_10", + "queryId": "query_5", + "status": "PASS", + "medianMs": 1500, + "repetitionsMs": [ + 1620, + 1500, + 1455 + ], + "medianTtfrMs": 180, + "repetitionsTtfrMs": [ + 198, + 180, + 171 + ], + "rowCount": 62, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_6", + "status": "PASS", + "medianMs": 95, + "repetitionsMs": [ + 103, + 95, + 92 + ], + "medianTtfrMs": 11, + "repetitionsTtfrMs": [ + 12, + 11, + 10 + ], + "rowCount": 145, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_6", + "status": "PASS", + "medianMs": 140, + "repetitionsMs": [ + 151, + 140, + 136 + ], + "medianTtfrMs": 17, + "repetitionsTtfrMs": [ + 19, + 17, + 16 + ], + "rowCount": 145, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_6", + "status": "PASS", + "medianMs": 80, + "repetitionsMs": [ + 86, + 80, + 78 + ], + "medianTtfrMs": 10, + "repetitionsTtfrMs": [ + 11, + 10, + 10 + ], + "rowCount": 145, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_6", + "status": "PASS", + "medianMs": 110, + "repetitionsMs": [ + 119, + 110, + 107 + ], + "medianTtfrMs": 13, + "repetitionsTtfrMs": [ + 14, + 13, + 12 + ], + "rowCount": 145, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_7", + "status": "PASS", + "medianMs": 420, + "repetitionsMs": [ + 454, + 420, + 407 + ], + "medianTtfrMs": 50, + "repetitionsTtfrMs": [ + 55, + 50, + 48 + ], + "rowCount": 88, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_7", + "status": "PASS", + "medianMs": 650, + "repetitionsMs": [ + 702, + 650, + 631 + ], + "medianTtfrMs": 78, + "repetitionsTtfrMs": [ + 86, + 78, + 74 + ], + "rowCount": 88, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_7", + "status": "PASS", + "medianMs": 350, + "repetitionsMs": [ + 378, + 350, + 340 + ], + "medianTtfrMs": 42, + "repetitionsTtfrMs": [ + 46, + 42, + 40 + ], + "rowCount": 88, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_7", + "status": "PASS", + "medianMs": 480, + "repetitionsMs": [ + 518, + 480, + 466 + ], + "medianTtfrMs": 58, + "repetitionsTtfrMs": [ + 64, + 58, + 55 + ], + "rowCount": 88, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_8", + "status": "PASS", + "medianMs": 280, + "repetitionsMs": [ + 302, + 280, + 272 + ], + "medianTtfrMs": 34, + "repetitionsTtfrMs": [ + 37, + 34, + 32 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_8", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_8", + "status": "PASS", + "medianMs": 320, + "repetitionsMs": [ + 346, + 320, + 310 + ], + "medianTtfrMs": 38, + "repetitionsTtfrMs": [ + 42, + 38, + 36 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_8", + "status": "PASS", + "medianMs": 410, + "repetitionsMs": [ + 443, + 410, + 398 + ], + "medianTtfrMs": 49, + "repetitionsTtfrMs": [ + 54, + 49, + 47 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_9", + "status": "PASS", + "medianMs": 265, + "repetitionsMs": [ + 286, + 265, + 257 + ], + "medianTtfrMs": 32, + "repetitionsTtfrMs": [ + 35, + 32, + 30 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_9", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_9", + "status": "PASS", + "medianMs": 305, + "repetitionsMs": [ + 329, + 305, + 296 + ], + "medianTtfrMs": 37, + "repetitionsTtfrMs": [ + 41, + 37, + 35 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_9", + "status": "PASS", + "medianMs": 390, + "repetitionsMs": [ + 421, + 390, + 378 + ], + "medianTtfrMs": 47, + "repetitionsTtfrMs": [ + 52, + 47, + 45 + ], + "rowCount": 42, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_10", + "status": "PASS", + "medianMs": 45, + "repetitionsMs": [ + 49, + 45, + 44 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_10", + "status": "PASS", + "medianMs": 72, + "repetitionsMs": [ + 78, + 72, + 70 + ], + "medianTtfrMs": 9, + "repetitionsTtfrMs": [ + 10, + 9, + 9 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_10", + "status": "PASS", + "medianMs": 48, + "repetitionsMs": [ + 52, + 48, + 47 + ], + "medianTtfrMs": 6, + "repetitionsTtfrMs": [ + 7, + 6, + 6 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_10", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_11", + "status": "PASS", + "medianMs": 310, + "repetitionsMs": [ + 335, + 310, + 301 + ], + "medianTtfrMs": 37, + "repetitionsTtfrMs": [ + 41, + 37, + 35 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_11", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_11", + "status": "PASS", + "medianMs": 290, + "repetitionsMs": [ + 313, + 290, + 281 + ], + "medianTtfrMs": 35, + "repetitionsTtfrMs": [ + 39, + 35, + 33 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_11", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_12", + "status": "PASS", + "medianMs": 185, + "repetitionsMs": [ + 200, + 185, + 179 + ], + "medianTtfrMs": 22, + "repetitionsTtfrMs": [ + 24, + 22, + 21 + ], + "rowCount": 18, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_12", + "status": "PASS", + "medianMs": 280, + "repetitionsMs": [ + 302, + 280, + 272 + ], + "medianTtfrMs": 34, + "repetitionsTtfrMs": [ + 37, + 34, + 32 + ], + "rowCount": 18, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_12", + "status": "PASS", + "medianMs": 170, + "repetitionsMs": [ + 184, + 170, + 165 + ], + "medianTtfrMs": 20, + "repetitionsTtfrMs": [ + 22, + 20, + 19 + ], + "rowCount": 18, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_12", + "status": "PASS", + "medianMs": 220, + "repetitionsMs": [ + 238, + 220, + 213 + ], + "medianTtfrMs": 26, + "repetitionsTtfrMs": [ + 29, + 26, + 25 + ], + "rowCount": 18, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_13", + "status": "PASS", + "medianMs": 22, + "repetitionsMs": [ + 24, + 22, + 21 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_13", + "status": "PASS", + "medianMs": 35, + "repetitionsMs": [ + 38, + 35, + 34 + ], + "medianTtfrMs": 4, + "repetitionsTtfrMs": [ + 4, + 4, + 4 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_13", + "status": "PASS", + "medianMs": 19, + "repetitionsMs": [ + 21, + 19, + 18 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_13", + "status": "PASS", + "medianMs": 28, + "repetitionsMs": [ + 30, + 28, + 27 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_14", + "status": "PASS", + "medianMs": 650, + "repetitionsMs": [ + 702, + 650, + 631 + ], + "medianTtfrMs": 78, + "repetitionsTtfrMs": [ + 86, + 78, + 74 + ], + "rowCount": 28, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_14", + "status": "PASS", + "medianMs": 980, + "repetitionsMs": [ + 1058, + 980, + 951 + ], + "medianTtfrMs": 118, + "repetitionsTtfrMs": [ + 130, + 118, + 112 + ], + "rowCount": 28, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_14", + "status": "PASS", + "medianMs": 520, + "repetitionsMs": [ + 562, + 520, + 504 + ], + "medianTtfrMs": 62, + "repetitionsTtfrMs": [ + 68, + 62, + 59 + ], + "rowCount": 28, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_14", + "status": "PASS", + "medianMs": 780, + "repetitionsMs": [ + 842, + 780, + 757 + ], + "medianTtfrMs": 94, + "repetitionsTtfrMs": [ + 103, + 94, + 89 + ], + "rowCount": 28, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_15", + "status": "PASS", + "medianMs": 12, + "repetitionsMs": [ + 13, + 12, + 12 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 7, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_15", + "status": "PASS", + "medianMs": 18, + "repetitionsMs": [ + 19, + 18, + 17 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 7, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_15", + "status": "PASS", + "medianMs": 11, + "repetitionsMs": [ + 12, + 11, + 11 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 7, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_15", + "status": "PASS", + "medianMs": 15, + "repetitionsMs": [ + 16, + 15, + 15 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 7, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_16", + "status": "PASS", + "medianMs": 350, + "repetitionsMs": [ + 378, + 350, + 340 + ], + "medianTtfrMs": 42, + "repetitionsTtfrMs": [ + 46, + 42, + 40 + ], + "rowCount": 220, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_16", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_16", + "status": "PASS", + "medianMs": 320, + "repetitionsMs": [ + 346, + 320, + 310 + ], + "medianTtfrMs": 38, + "repetitionsTtfrMs": [ + 42, + 38, + 36 + ], + "rowCount": 220, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_16", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "bowlogna", + "queryId": "query_17", + "status": "PASS", + "medianMs": 340, + "repetitionsMs": [ + 367, + 340, + 330 + ], + "medianTtfrMs": 41, + "repetitionsTtfrMs": [ + 45, + 41, + 39 + ], + "rowCount": 195, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bowlogna", + "queryId": "query_17", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bowlogna", + "queryId": "query_17", + "status": "PASS", + "medianMs": 310, + "repetitionsMs": [ + 335, + 310, + 301 + ], + "medianTtfrMs": 37, + "repetitionsTtfrMs": [ + 41, + 37, + 35 + ], + "rowCount": 195, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bowlogna", + "queryId": "query_17", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 42, + "repetitionsMs": [ + 45, + 42, + 41 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 68, + "repetitionsMs": [ + 73, + 68, + 66 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 38, + "repetitionsMs": [ + 41, + 38, + 37 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 55, + "repetitionsMs": [ + 59, + 55, + 53 + ], + "medianTtfrMs": 7, + "repetitionsTtfrMs": [ + 8, + 7, + 7 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 8, + "repetitionsMs": [ + 9, + 8, + 8 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 13, + "repetitionsMs": [ + 14, + 13, + 13 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 7, + "repetitionsMs": [ + 8, + 7, + 7 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 10, + "repetitionsMs": [ + 11, + 10, + 10 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 65, + "repetitionsMs": [ + 70, + 65, + 63 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 98, + "repetitionsMs": [ + 106, + 98, + 95 + ], + "medianTtfrMs": 12, + "repetitionsTtfrMs": [ + 13, + 12, + 11 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 58, + "repetitionsMs": [ + 63, + 58, + 56 + ], + "medianTtfrMs": 7, + "repetitionsTtfrMs": [ + 8, + 7, + 7 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 80, + "repetitionsMs": [ + 86, + 80, + 78 + ], + "medianTtfrMs": 10, + "repetitionsTtfrMs": [ + 11, + 10, + 10 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 120, + "repetitionsMs": [ + 130, + 120, + 116 + ], + "medianTtfrMs": 14, + "repetitionsTtfrMs": [ + 15, + 14, + 13 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 185, + "repetitionsMs": [ + 200, + 185, + 179 + ], + "medianTtfrMs": 22, + "repetitionsTtfrMs": [ + 24, + 22, + 21 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 105, + "repetitionsMs": [ + 113, + 105, + 102 + ], + "medianTtfrMs": 13, + "repetitionsTtfrMs": [ + 14, + 13, + 12 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 145, + "repetitionsMs": [ + 157, + 145, + 141 + ], + "medianTtfrMs": 17, + "repetitionsTtfrMs": [ + 19, + 17, + 16 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 380, + "repetitionsMs": [ + 410, + 380, + 369 + ], + "medianTtfrMs": 46, + "repetitionsTtfrMs": [ + 51, + 46, + 44 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 590, + "repetitionsMs": [ + 637, + 590, + 572 + ], + "medianTtfrMs": 71, + "repetitionsTtfrMs": [ + 78, + 71, + 67 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 310, + "repetitionsMs": [ + 335, + 310, + 301 + ], + "medianTtfrMs": 37, + "repetitionsTtfrMs": [ + 41, + 37, + 35 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 450, + "repetitionsMs": [ + 486, + 450, + 437 + ], + "medianTtfrMs": 54, + "repetitionsTtfrMs": [ + 59, + 54, + 51 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_6", + "status": "PASS", + "medianMs": 28, + "repetitionsMs": [ + 30, + 28, + 27 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_6", + "status": "PASS", + "medianMs": 44, + "repetitionsMs": [ + 48, + 44, + 43 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_6", + "status": "PASS", + "medianMs": 25, + "repetitionsMs": [ + 27, + 25, + 24 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_6", + "status": "PASS", + "medianMs": 35, + "repetitionsMs": [ + 38, + 35, + 34 + ], + "medianTtfrMs": 4, + "repetitionsTtfrMs": [ + 4, + 4, + 4 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 52, + "repetitionsMs": [ + 56, + 52, + 50 + ], + "medianTtfrMs": 6, + "repetitionsTtfrMs": [ + 7, + 6, + 6 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 80, + "repetitionsMs": [ + 86, + 80, + 78 + ], + "medianTtfrMs": 10, + "repetitionsTtfrMs": [ + 11, + 10, + 10 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 45, + "repetitionsMs": [ + 49, + 45, + 44 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 65, + "repetitionsMs": [ + 70, + 65, + 63 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_8", + "status": "PASS", + "medianMs": 15, + "repetitionsMs": [ + 16, + 15, + 15 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_8", + "status": "PASS", + "medianMs": 23, + "repetitionsMs": [ + 25, + 23, + 22 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_8", + "status": "PASS", + "medianMs": 13, + "repetitionsMs": [ + 14, + 13, + 13 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_8", + "status": "PASS", + "medianMs": 18, + "repetitionsMs": [ + 19, + 18, + 17 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 95, + "repetitionsMs": [ + 103, + 95, + 92 + ], + "medianTtfrMs": 11, + "repetitionsTtfrMs": [ + 12, + 11, + 10 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 145, + "repetitionsMs": [ + 157, + 145, + 141 + ], + "medianTtfrMs": 17, + "repetitionsTtfrMs": [ + 19, + 17, + 16 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 85, + "repetitionsMs": [ + 92, + 85, + 82 + ], + "medianTtfrMs": 10, + "repetitionsTtfrMs": [ + 11, + 10, + 10 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 115, + "repetitionsMs": [ + 124, + 115, + 112 + ], + "medianTtfrMs": 14, + "repetitionsTtfrMs": [ + 15, + 14, + 13 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 45, + "repetitionsMs": [ + 49, + 45, + 44 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 70, + "repetitionsMs": [ + 76, + 70, + 68 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 40, + "repetitionsMs": [ + 43, + 40, + 39 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 58, + "repetitionsMs": [ + 63, + 58, + 56 + ], + "medianTtfrMs": 7, + "repetitionsTtfrMs": [ + 8, + 7, + 7 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 75, + "repetitionsMs": [ + 81, + 75, + 73 + ], + "medianTtfrMs": 9, + "repetitionsTtfrMs": [ + 10, + 9, + 9 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 115, + "repetitionsMs": [ + 124, + 115, + 112 + ], + "medianTtfrMs": 14, + "repetitionsTtfrMs": [ + 15, + 14, + 13 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 68, + "repetitionsMs": [ + 73, + 68, + 66 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 92, + "repetitionsMs": [ + 99, + 92, + 89 + ], + "medianTtfrMs": 11, + "repetitionsTtfrMs": [ + 12, + 11, + 10 + ], + "rowCount": 10, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "bsbm", + "queryId": "query_12", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.4.6.5", + "dataset": "bsbm", + "queryId": "query_12", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "bsbm", + "queryId": "query_12", + "status": "PASS", + "medianMs": 280, + "repetitionsMs": [ + 302, + 280, + 272 + ], + "medianTtfrMs": 34, + "repetitionsTtfrMs": [ + 37, + 34, + 32 + ], + "rowCount": 5, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "bsbm", + "queryId": "query_12", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 12, + "repetitionsMs": [ + 13, + 12, + 12 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 18, + "repetitionsMs": [ + 19, + 18, + 17 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 10, + "repetitionsMs": [ + 11, + 10, + 10 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_1", + "status": "PASS", + "medianMs": 15, + "repetitionsMs": [ + 16, + 15, + 15 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 450, + "repetitionsMs": [ + 486, + 450, + 437 + ], + "medianTtfrMs": 54, + "repetitionsTtfrMs": [ + 59, + 54, + 51 + ], + "rowCount": 2348, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 720, + "repetitionsMs": [ + 778, + 720, + 698 + ], + "medianTtfrMs": 86, + "repetitionsTtfrMs": [ + 95, + 86, + 82 + ], + "rowCount": 2348, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_2", + "status": "PASS", + "medianMs": 380, + "repetitionsMs": [ + 410, + 380, + 369 + ], + "medianTtfrMs": 46, + "repetitionsTtfrMs": [ + 51, + 46, + 44 + ], + "rowCount": 2348, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_2", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 8, + "repetitionsMs": [ + 9, + 8, + 8 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 6, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 12, + "repetitionsMs": [ + 13, + 12, + 12 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 6, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 7, + "repetitionsMs": [ + 8, + 7, + 7 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 6, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_3", + "status": "PASS", + "medianMs": 9, + "repetitionsMs": [ + 10, + 9, + 9 + ], + "medianTtfrMs": 1, + "repetitionsTtfrMs": [ + 1, + 1, + 1 + ], + "rowCount": 6, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 18, + "repetitionsMs": [ + 19, + 18, + 17 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 34, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 28, + "repetitionsMs": [ + 30, + 28, + 27 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 34, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 15, + "repetitionsMs": [ + 16, + 15, + 15 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 34, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_4", + "status": "PASS", + "medianMs": 22, + "repetitionsMs": [ + 24, + 22, + 21 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 34, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 95, + "repetitionsMs": [ + 103, + 95, + 92 + ], + "medianTtfrMs": 11, + "repetitionsTtfrMs": [ + 12, + 11, + 10 + ], + "rowCount": 719, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 145, + "repetitionsMs": [ + 157, + 145, + 141 + ], + "medianTtfrMs": 17, + "repetitionsTtfrMs": [ + 19, + 17, + 16 + ], + "rowCount": 719, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 85, + "repetitionsMs": [ + 92, + 85, + 82 + ], + "medianTtfrMs": 10, + "repetitionsTtfrMs": [ + 11, + 10, + 10 + ], + "rowCount": 719, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_5", + "status": "PASS", + "medianMs": 110, + "repetitionsMs": [ + 119, + 110, + 107 + ], + "medianTtfrMs": 13, + "repetitionsTtfrMs": [ + 14, + 13, + 12 + ], + "rowCount": 719, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_6", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_6", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_6", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_6", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 280, + "repetitionsMs": [ + 302, + 280, + 272 + ], + "medianTtfrMs": 34, + "repetitionsTtfrMs": [ + 37, + 34, + 32 + ], + "rowCount": 67, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 430, + "repetitionsMs": [ + 464, + 430, + 417 + ], + "medianTtfrMs": 52, + "repetitionsTtfrMs": [ + 57, + 52, + 49 + ], + "rowCount": 67, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 250, + "repetitionsMs": [ + 270, + 250, + 243 + ], + "medianTtfrMs": 30, + "repetitionsTtfrMs": [ + 33, + 30, + 29 + ], + "rowCount": 67, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_7", + "status": "PASS", + "medianMs": 330, + "repetitionsMs": [ + 356, + 330, + 320 + ], + "medianTtfrMs": 40, + "repetitionsTtfrMs": [ + 44, + 40, + 38 + ], + "rowCount": 67, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_8", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_8", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_8", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_8", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 520, + "repetitionsMs": [ + 562, + 520, + 504 + ], + "medianTtfrMs": 62, + "repetitionsTtfrMs": [ + 68, + 62, + 59 + ], + "rowCount": 208, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_9", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_9", + "status": "PASS", + "medianMs": 460, + "repetitionsMs": [ + 497, + 460, + 446 + ], + "medianTtfrMs": 55, + "repetitionsTtfrMs": [ + 61, + 55, + 52 + ], + "rowCount": 208, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_9", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 15, + "repetitionsMs": [ + 16, + 15, + 15 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 22, + "repetitionsMs": [ + 24, + 22, + 21 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 13, + "repetitionsMs": [ + 14, + 13, + 13 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_10", + "status": "PASS", + "medianMs": 18, + "repetitionsMs": [ + 19, + 18, + 17 + ], + "medianTtfrMs": 2, + "repetitionsTtfrMs": [ + 2, + 2, + 2 + ], + "rowCount": 4, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 42, + "repetitionsMs": [ + 45, + 42, + 41 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 224, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 65, + "repetitionsMs": [ + 70, + 65, + 63 + ], + "medianTtfrMs": 8, + "repetitionsTtfrMs": [ + 9, + 8, + 8 + ], + "rowCount": 224, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 38, + "repetitionsMs": [ + 41, + 38, + 37 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 224, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_11", + "status": "PASS", + "medianMs": 50, + "repetitionsMs": [ + 54, + 50, + 49 + ], + "medianTtfrMs": 6, + "repetitionsTtfrMs": [ + 7, + 6, + 6 + ], + "rowCount": 224, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_12", + "status": "PASS", + "medianMs": 28, + "repetitionsMs": [ + 30, + 28, + 27 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 15, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_12", + "status": "PASS", + "medianMs": 42, + "repetitionsMs": [ + 45, + 42, + 41 + ], + "medianTtfrMs": 5, + "repetitionsTtfrMs": [ + 6, + 5, + 5 + ], + "rowCount": 15, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_12", + "status": "PASS", + "medianMs": 25, + "repetitionsMs": [ + 27, + 25, + 24 + ], + "medianTtfrMs": 3, + "repetitionsTtfrMs": [ + 3, + 3, + 3 + ], + "rowCount": 15, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_12", + "status": "PASS", + "medianMs": 34, + "repetitionsMs": [ + 37, + 34, + 33 + ], + "medianTtfrMs": 4, + "repetitionsTtfrMs": [ + 4, + 4, + 4 + ], + "rowCount": 15, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_13", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_13", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_13", + "status": "PASS", + "medianMs": 220, + "repetitionsMs": [ + 238, + 220, + 213 + ], + "medianTtfrMs": 26, + "repetitionsTtfrMs": [ + 29, + 26, + 25 + ], + "rowCount": 1, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_13", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "corese.next", + "dataset": "lubm", + "queryId": "query_14", + "status": "PASS", + "medianMs": 380, + "repetitionsMs": [ + 410, + 380, + 369 + ], + "medianTtfrMs": 46, + "repetitionsTtfrMs": [ + 51, + 46, + 44 + ], + "rowCount": 5916, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "corese.4.6.5", + "dataset": "lubm", + "queryId": "query_14", + "status": "TIMEOUT", + "medianMs": 60000, + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], + "medianTtfrMs": -1, + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], + "rowCount": 0, + "hash": "", + "errorMessage": "Query execution exceeded timeout of 60000 ms" + }, + { + "engine": "jena.6.2.0", + "dataset": "lubm", + "queryId": "query_14", + "status": "PASS", + "medianMs": 350, + "repetitionsMs": [ + 378, + 350, + 340 + ], + "medianTtfrMs": 42, + "repetitionsTtfrMs": [ + 46, + 42, + 40 + ], + "rowCount": 5916, + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "errorMessage": null + }, + { + "engine": "rdf4j.5.3.2", + "dataset": "lubm", + "queryId": "query_14", "status": "TIMEOUT", "medianMs": 60000, - "repetitionsMs": [60000, 60000, 60000], + "repetitionsMs": [ + 64800, + 60000, + 58200 + ], "medianTtfrMs": -1, - "repetitionsTtfrMs": [-1, -1, -1], + "repetitionsTtfrMs": [ + -1, + -1, + -1 + ], "rowCount": 0, "hash": "", "errorMessage": "Query execution exceeded timeout of 60000 ms" } ] -} +} \ No newline at end of file diff --git a/site/gen-mock.js b/site/gen-mock.js new file mode 100644 index 0000000..eb117f9 --- /dev/null +++ b/site/gen-mock.js @@ -0,0 +1,238 @@ +// gen-mock.js — Generate complete mock-report-v2.json with all datasets +'use strict'; +const fs = require('fs'); + +const ENGINES = ['corese.next', 'corese.4.6.5', 'jena.6.2.0', 'rdf4j.5.3.2']; +const HASH_OK = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'; + +function qrun(engine, dataset, queryId, status, medianMs, ttfrMs, rowCount, hash, err) { + return { + engine, dataset, queryId, status, medianMs, + repetitionsMs: [Math.round(medianMs * 1.08), medianMs, Math.round(medianMs * 0.97)], + medianTtfrMs: ttfrMs, + repetitionsTtfrMs: ttfrMs === -1 ? [-1, -1, -1] : [Math.round(ttfrMs * 1.1), ttfrMs, Math.round(ttfrMs * 0.95)], + rowCount: rowCount != null ? rowCount : null, + hash: hash || '', + errorMessage: err || null, + }; +} + +function lrun(engine, dataset, file, triples, ms, tpSec, memBefore, memAfter, tsPoints) { + return { + engine, dataset, file, triples, + loadingTimeMs: ms, + repetitionsMs: [Math.round(ms * 1.06), ms, Math.round(ms * 0.97)], + throughputTriplesPerSec: tpSec, + memoryBeforeMb: memBefore, + memoryAfterMb: memAfter, + memoryDeltaMb: memAfter - memBefore, + cpuPercent: Math.round(78 + Math.random() * 15), + timeSeries: tsPoints || [], + }; +} + +function ts(ms, triples, heap) { return { elapsedMs: ms, triplesLoaded: triples, heapUsedMb: heap }; } + +// ── Bowlogna ────────────────────────────────────────────────────────────────── +const BOWLOGNA_QUERIES = { + query_1: { cat: 'GRAPH_PATTERN', rows: 1, sparql: 'SELECT (COUNT(?X) as ?n) WHERE { ?X a bb:Master_Thesis }' }, + query_2: { cat: 'GRAPH_PATTERN', rows: 312, sparql: 'SELECT ?X WHERE { ?X a bb:Master_Thesis ; bb:hasMention ?m }' }, + query_3: { cat: 'REGEX_TEMPORAL', rows: 980, sparql: 'SELECT ?X WHERE { ?X a bb:Student ; bb:graduatedAt ?d . FILTER(xsd:dateTime(?d) < NOW()) }' }, + query_4: { cat: 'REGEX_TEMPORAL', rows: 452, sparql: 'SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledIn ?m . FILTER(xsd:dateTime(?m) < NOW()) }' }, + query_5: { cat: 'COMPLEX_JOIN', rows: 62, sparql: 'SELECT ?X (SUM(?c) as ?ects) WHERE { ?X bb:took ?u . ?u bb:hasCredits ?c } GROUP BY ?X' }, + query_6: { cat: 'REGEX_TEMPORAL', rows: 145, sparql: 'SELECT ?X WHERE { ?X a bb:Student ; bb:lastName ?ln . FILTER(regex(?ln,"^D")) }' }, + query_7: { cat: 'COMPLEX_JOIN', rows: 88, sparql: 'SELECT ?X ?Y WHERE { ?X bb:attr1 ?A . ?A bb:attr2 ?Y }' }, + query_8: { cat: 'AGGREGATION', rows: 42, sparql: 'SELECT ?X (COUNT(?E) as ?Failures) WHERE { ?X a bb:Teaching_Unit . ?E bb:hasMark ?Y . FILTER(?Y < 3) } GROUP BY ?X' }, + query_9: { cat: 'AGGREGATION', rows: 42, sparql: 'SELECT ?X (COUNT(?E) as ?Evals) WHERE { ?X a bb:Teaching_Unit . ?E bb:evaluatesTeachingUnit ?X } GROUP BY ?X' }, + query_10: { cat: 'REGEX_TEMPORAL', rows: 1, sparql: 'SELECT ?X (COUNT(?Y) as ?n) WHERE { ?X a bb:Professor . ?Y bb:supervisedBy ?X . FILTER REGEX(?t,"Thesis","i") } GROUP BY ?X ORDER BY DESC(?n) LIMIT 1' }, + query_11: { cat: 'AGGREGATION', rows: 5, sparql: 'SELECT ?X (AVG(?m) as ?avg) WHERE { ?X a bb:Student ; bb:hasMark ?m } GROUP BY ?X ORDER BY DESC(?avg) LIMIT 5' }, + query_12: { cat: 'AGGREGATION', rows: 18, sparql: 'SELECT ?T (AVG(?d) as ?dur) WHERE { ?T a bb:Track ; bb:duration ?d } GROUP BY ?T' }, + query_13: { cat: 'AGGREGATION', rows: 1, sparql: 'SELECT (AVG(?m) as ?avg) WHERE { ?X bb:hasMark ?m ; bb:atSemester 1 }' }, + query_14: { cat: 'COMPLEX_JOIN', rows: 28, sparql: 'SELECT ?D ?P WHERE { ?X a bb:Student ; bb:inDept ?D . ?P a bb:Professor ; bb:inDept ?D }' }, + query_15: { cat: 'GRAPH_PATTERN', rows: 7, sparql: 'SELECT ?U WHERE { ?U a bb:Teaching_Unit ; bb:language "en" }' }, + query_16: { cat: 'REGEX_TEMPORAL', rows: 220, sparql: 'SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledFrom ?s . FILTER(?s >= "2020-01-01"^^xsd:date) }' }, + query_17: { cat: 'REGEX_TEMPORAL', rows: 195, sparql: 'SELECT ?X WHERE { ?X a bb:Student ; bb:enrolledTo ?e . FILTER(?e <= "2025-12-31"^^xsd:date) }' }, +}; + +// [corese.next_ms, corese.4.6.5_ms, jena.6.2.0_ms, rdf4j.5.3.2_ms] — null = TIMEOUT +const BOWLOGNA_PERF = { + query_1: [8, 12, 9, 11 ], query_2: [35, 55, 30, 45 ], + query_3: [280, 420, 250, 320 ], query_4: [190, 290, 170, 210 ], + query_5: [1200, 1850, 900, 1500 ], query_6: [95, 140, 80, 110 ], + query_7: [420, 650, 350, 480 ], query_8: [280, null, 320, 410 ], + query_9: [265, null, 305, 390 ], query_10: [45, 72, 48, null ], + query_11: [310, null, 290, null ], query_12: [185, 280, 170, 220 ], + query_13: [22, 35, 19, 28 ], query_14: [650, 980, 520, 780 ], + query_15: [12, 18, 11, 15 ], query_16: [350, null, 320, null ], + query_17: [340, null, 310, null ], +}; + +// ── BSBM ────────────────────────────────────────────────────────────────────── +const BSBM_QUERIES = { + query_1: { cat: 'SEARCH', rows: 10, sparql: 'SELECT DISTINCT ?product WHERE { ?product a bsbm:Product ; bsbm:productFeature ?f1 ; bsbm:productPropertyNumeric1 ?v1 . FILTER(?v1 > 450) } ORDER BY ?product LIMIT 10' }, + query_2: { cat: 'SEARCH', rows: 1, sparql: 'SELECT ?label ?comment ?producer WHERE { ?p rdfs:label ?label ; rdfs:comment ?comment ; bsbm:producer ?producer }' }, + query_3: { cat: 'SEARCH', rows: 10, sparql: 'SELECT ?product WHERE { ?product a bsbm:Product ; bsbm:productFeature ?f ; bsbm:productPropertyNumeric1 ?v1 ; bsbm:productPropertyNumeric3 ?v3 . FILTER(?v1 > 350 && ?v3 < 950) } LIMIT 10' }, + query_4: { cat: 'SEARCH', rows: 10, sparql: 'SELECT ?product ?label WHERE { { ?product bsbm:productFeature ?f } UNION { ?product rdfs:label ?label . FILTER regex(?label,"en") } } ORDER BY ?label LIMIT 10' }, + query_5: { cat: 'JOIN', rows: 5, sparql: 'SELECT DISTINCT ?product WHERE { ?product bsbm:productFeature ?f . ?p2 bsbm:productFeature ?f . FILTER(?product != ?p2) } LIMIT 5' }, + query_6: { cat: 'REVIEW', rows: 10, sparql: 'SELECT ?review ?title WHERE { ?review a bsbm:Review ; dc:title ?title ; bsbm:reviewFor ?product } LIMIT 10' }, + query_7: { cat: 'OFFER', rows: 10, sparql: 'SELECT ?offer ?price WHERE { ?offer a bsbm:Offer ; bsbm:price ?price ; bsbm:product ?product } ORDER BY ?price LIMIT 10' }, + query_8: { cat: 'OFFER', rows: 1, sparql: 'SELECT ?title ?text WHERE { ?review dc:title ?title ; rev:text ?text ; bsbm:reviewFor ?product }' }, + query_9: { cat: 'REVIEW', rows: 10, sparql: 'SELECT DISTINCT ?reviewer WHERE { ?review bsbm:reviewFor ?product ; rev:reviewer ?reviewer } LIMIT 10' }, + query_10: { cat: 'OFFER', rows: 10, sparql: 'SELECT DISTINCT ?offer ?vendor WHERE { ?offer bsbm:vendor ?vendor ; bsbm:product ?product } LIMIT 10' }, + query_11: { cat: 'REVIEW', rows: 10, sparql: 'SELECT ?review ?rating WHERE { ?review bsbm:rating1 ?r1 ; bsbm:rating2 ?r2 . BIND((?r1+?r2)/2 AS ?rating) } LIMIT 10' }, + query_12: { cat: 'REVIEW', rows: 5, sparql: 'SELECT ?review WHERE { ?review a bsbm:Review ; bsbm:reviewFor ?product . FILTER NOT EXISTS { ?other bsbm:reviewFor ?product . FILTER(?other != ?review) } } LIMIT 5' }, +}; + +const BSBM_PERF = { + query_1: [42, 68, 38, 55 ], query_2: [8, 13, 7, 10 ], + query_3: [65, 98, 58, 80 ], query_4: [120, 185, 105, 145 ], + query_5: [380, 590, 310, 450 ], query_6: [28, 44, 25, 35 ], + query_7: [52, 80, 45, 65 ], query_8: [15, 23, 13, 18 ], + query_9: [95, 145, 85, 115 ], query_10: [45, 70, 40, 58 ], + query_11: [75, 115, 68, 92 ], query_12: [null, null, 280, null ], +}; + +// ── LUBM ────────────────────────────────────────────────────────────────────── +const LUBM_QUERIES = { + query_1: { cat: 'SELECTIVE', rows: 4, sparql: 'SELECT ?X WHERE { ?X a ub:GraduateStudent ; ub:takesCourse ?C . ?C a ub:GraduateCourse ; ub:subOrganizationOf }' }, + query_2: { cat: 'LARGE_RESULT', rows: 2348, sparql: 'SELECT ?X ?Y ?Z WHERE { ?X a ub:GraduateStudent ; ub:memberOf ?Y . ?Y a ub:Department ; ub:subOrganizationOf ?Z . ?Z a ub:University }' }, + query_3: { cat: 'SELECTIVE', rows: 6, sparql: 'SELECT ?X WHERE { ?X a ub:Publication ; ub:publicationAuthor ?Y . ?Y ub:memberOf }' }, + query_4: { cat: 'TRANSITIVE', rows: 34, sparql: 'SELECT ?X ?Y1 ?Y2 ?Y3 WHERE { ?X a ub:Professor ; ub:worksFor ; ub:name ?Y1 ; ub:emailAddress ?Y2 ; ub:telephone ?Y3 }' }, + query_5: { cat: 'SELECTIVE', rows: 719, sparql: 'SELECT ?X WHERE { ?X a ub:Person ; ub:memberOf }' }, + query_6: { cat: 'LARGE_RESULT', rows: 7790, sparql: 'SELECT ?X WHERE { ?X a ub:Student }' }, + query_7: { cat: 'SELECTIVE', rows: 67, sparql: 'SELECT ?X ?Y WHERE { ?X a ub:Student ; ub:takesCourse ?Y . ?Y a ub:Course . ?Y ub:teachingAssistantOf ?X }' }, + query_8: { cat: 'SELECTIVE', rows: 7790, sparql: 'SELECT ?X ?Y ?Z WHERE { ?X a ub:Student ; ub:emailAddress ?Y ; ub:memberOf ?Z . ?Z a ub:Department ; ub:subOrganizationOf }' }, + query_9: { cat: 'LARGE_RESULT', rows: 208, sparql: 'SELECT ?X ?Y ?Z WHERE { ?X a ub:Student ; ub:advisor ?Y ; ub:takesCourse ?Z . ?Y ub:teacherOf ?Z }' }, + query_10: { cat: 'SELECTIVE', rows: 4, sparql: 'SELECT ?X WHERE { ?X a ub:Student ; ub:takesCourse ?C . ?C a ub:GraduateCourse ; ub:subOrganizationOf }' }, + query_11: { cat: 'TRANSITIVE', rows: 224, sparql: 'SELECT ?X WHERE { ?X a ub:ResearchGroup ; ub:subOrganizationOf }' }, + query_12: { cat: 'TRANSITIVE', rows: 15, sparql: 'SELECT ?X ?Y WHERE { ?X a ub:Chair ; ub:worksFor ?Y . ?Y ub:subOrganizationOf }' }, + query_13: { cat: 'TRANSITIVE', rows: 1, sparql: 'SELECT ?X WHERE { ?X a ub:Person ; ub:hasAlumnus }' }, + query_14: { cat: 'SELECTIVE', rows: 5916, sparql: 'SELECT ?X WHERE { ?X a ub:UndergraduateStudent }' }, +}; + +const LUBM_PERF = { + query_1: [12, 18, 10, 15 ], query_2: [450, 720, 380, null ], + query_3: [8, 12, 7, 9 ], query_4: [18, 28, 15, 22 ], + query_5: [95, 145, 85, 110 ], query_6: [null,null, null, null ], + query_7: [280, 430, 250, 330 ], query_8: [null,null, null, null ], + query_9: [520, null, 460, null ], query_10: [15, 22, 13, 18 ], + query_11: [42, 65, 38, 50 ], query_12: [28, 42, 25, 34 ], + query_13: [null,null, 220, null ], query_14: [380, null, 350, null ], +}; + +// ── DBpedia loading (5 files × 3 engines) ───────────────────────────────────── +const DBPEDIA_FILES = [ + { file: 'persondata_en.nt', triples: 356914 }, + { file: 'homepages_en.nt', triples: 394897 }, + { file: 'category_labels_en.nt', triples: 565108 }, + { file: 'disambiguations_en.nt', triples: 768924 }, + { file: 'specific_mappingbased_properties_en.nt', triples: 182530 }, +]; + +// ── Build loadingRuns ───────────────────────────────────────────────────────── +const loadingRuns = []; + +// Bowlogna +const bowlognaTs = { + 'corese.next': [ts(0,0,42),ts(500,310000,115),ts(1000,650000,198),ts(1500,980000,280),ts(2000,1234567,387)], + 'corese.4.6.5': [ts(0,0,44),ts(500,260000,125),ts(1000,560000,215),ts(1500,880000,310),ts(2000,1150000,405),ts(2500,1234567,430)], + 'jena.6.2.0': [ts(0,0,45),ts(500,350000,130),ts(1000,720000,220),ts(1500,1050000,315),ts(2000,1234567,412)], + 'rdf4j.5.3.2': [ts(0,0,40),ts(500,220000,110),ts(1000,480000,210),ts(1500,750000,320),ts(2000,1020000,430),ts(2500,1234567,510)], +}; +const bowlognaTimes = { 'corese.next': 2450, 'corese.4.6.5': 3850, 'jena.6.2.0': 2180, 'rdf4j.5.3.2': 3150 }; +ENGINES.forEach(eng => { + const ms = bowlognaTimes[eng]; + loadingRuns.push(lrun(eng,'bowlogna','bowlogna.ttl',1234567,ms,Math.round(1234567/(ms/1000)),40,380+Math.random()*130,bowlognaTs[eng])); +}); + +// BSBM +const bsbmTimes = { 'corese.next': 3800, 'corese.4.6.5': 5900, 'jena.6.2.0': 3200, 'rdf4j.5.3.2': 5100 }; +ENGINES.forEach(eng => { + const ms = bsbmTimes[eng]; + loadingRuns.push(lrun(eng,'bsbm','bsbm_1m.nt',1800000,ms,Math.round(1800000/(ms/1000)),45,500+Math.random()*100,[])); +}); + +// LUBM +const lubmTimes = { 'corese.next': 7200, 'corese.4.6.5': 11400, 'jena.6.2.0': 5800, 'rdf4j.5.3.2': 9400 }; +ENGINES.forEach(eng => { + const ms = lubmTimes[eng]; + loadingRuns.push(lrun(eng,'lubm','lubm_univ10.nt',3200000,ms,Math.round(3200000/(ms/1000)),50,850+Math.random()*180,[])); +}); + +// DBpedia +DBPEDIA_FILES.forEach(({ file, triples }) => { + ENGINES.forEach(eng => { + const factor = eng === 'corese.next' ? 1.0 : eng === 'corese.4.6.5' ? 1.60 : eng === 'jena.6.2.0' ? 0.85 : 1.35; + const ms = Math.round((triples / 480000) * 1000 * factor); + const mem = 80 + triples / 3500; + loadingRuns.push(lrun(eng,'dbpedia',file,triples,ms,Math.round(triples/(ms/1000)),45,mem,[])); + }); +}); + +// ── Build queryRuns ─────────────────────────────────────────────────────────── +const queryRuns = []; + +function addQueryRuns(dataset, queries, perf) { + Object.entries(queries).forEach(([qid, meta]) => { + const times = perf[qid] || [50, 45, 60]; + ENGINES.forEach((eng, i) => { + const ms = times[i]; + if (ms === null) { + queryRuns.push(qrun(eng, dataset, qid, 'TIMEOUT', 60000, -1, 0, '', 'Query execution exceeded timeout of 60000 ms')); + } else { + queryRuns.push(qrun(eng, dataset, qid, 'PASS', ms, Math.round(ms * 0.12), meta.rows, HASH_OK, null)); + } + }); + }); +} + +addQueryRuns('bowlogna', BOWLOGNA_QUERIES, BOWLOGNA_PERF); +addQueryRuns('bsbm', BSBM_QUERIES, BSBM_PERF); +addQueryRuns('lubm', LUBM_QUERIES, LUBM_PERF); + +// ── datasetQueries metadata ──────────────────────────────────────────────────── +function buildDsMeta(queries) { + return Object.entries(queries).map(([id, m]) => ({ + id, category: m.cat, label: id.replace('query_','Q'), sparql: m.sparql, + expectedRowCount: m.rows, expectedHash: HASH_OK, + })); +} + +// ── Assemble & write ────────────────────────────────────────────────────────── +const mock = { + metadata: { + version: '2.0', + generatedAt: '2026-10-29T16:00:00Z', + git: { benchmarkCommit: '360e097', coreseCommit: '3a7b8e1', branch: 'main' }, + environment: { + cpuModel: 'AMD EPYC 7763 64-Core Processor', cpuArchitecture: 'x86_64', + cpuSockets: 1, cpuCores: 16, cpuThreads: 32, cpuFrequencyMhz: 2450.0, + cpuGovernor: 'performance', ramTotalGb: 64.0, swapTotalGb: 8.0, swappiness: 1, + osDistribution: 'Ubuntu 24.04.1 LTS', osKernel: '6.8.0-45-generic', + jvmVendor: 'Ubuntu', jvmVersion: '21.0.4+7-Ubuntu-1ubuntu224.04', + jvmFlags: ['-Xms4g', '-Xmx8g', '-XX:+UseG1GC'], + }, + protocol: { warmup: 1, repetitions: 3, queryRepetitions: 3, queryTimeoutMs: 60000, loadTimeoutMs: 120000, metric: 'median' }, + engines: [ + { id: 'corese.next', family: 'corese', version: '5.0.0-SNAPSHOT', label: 'Corese v5 (Next)' }, + { id: 'corese.4.6.5', family: 'corese', version: '4.6.5', label: 'Corese v4.6.5' }, + { id: 'jena.6.2.0', family: 'jena', version: '6.2.0', label: 'Apache Jena 6.2.0' }, + { id: 'rdf4j.5.3.2', family: 'rdf4j', version: '5.3.2', label: 'Eclipse RDF4J 5.3.2' }, + ], + datasetQueries: { + bowlogna: buildDsMeta(BOWLOGNA_QUERIES), + bsbm: buildDsMeta(BSBM_QUERIES), + lubm: buildDsMeta(LUBM_QUERIES), + }, + }, + loadingRuns, + queryRuns, +}; + +fs.writeFileSync('C:/DEV/corese-benchmark/site/data/mock-report-v2.json', JSON.stringify(mock, null, 2), 'utf8'); +const js = 'window.__BENCHMARK_DATA__ = ' + JSON.stringify(mock) + ';\n'; +fs.writeFileSync('C:/DEV/corese-benchmark/site/data/report-data.js', js, 'utf8'); + +console.log('loadingRuns:', mock.loadingRuns.length, '| datasets:', [...new Set(mock.loadingRuns.map(r=>r.dataset))].join(', ')); +console.log('queryRuns: ', mock.queryRuns.length, '| datasets:', [...new Set(mock.queryRuns.map(r=>r.dataset))].join(', ')); +console.log('report-data.js:', (js.length/1024).toFixed(1), 'KB'); diff --git a/site/index.html b/site/index.html index 9b22827..e7dcf2a 100644 --- a/site/index.html +++ b/site/index.html @@ -3,354 +3,83 @@ - Corese · Benchmark Dashboard + Corese Benchmark Dashboard - - - - + +
- +
- -
+
- Corese Benchmark - +

Corese Benchmark Dashboard

- -
- Engines: - -
- - +
+ + + + +
+
-
+ +
-
- - - - - - - - - JSON - - - - - - - - - - CSV - -
+ +
- -
-
- - -
-
-
-
-
+ +
- -
- - -
-
- -
- -
- Overview -
    -
  • Overview
  • -
-
- -
- Data -
    -
  • - Datasets - -
  • -
  • - Engines - -
  • -
  • - W3C Conformance - -
  • -
-
- -
- Results -
    -
  • Performance
  • -
  • - Full results - -
  • -
  • - SPARQL - -
  • - -
-
- -
- -
-
- - -
- -
-
📭
-
Aucune donnée disponible
-
Le fichier data/benchmark-report.json est introuvable ou vide.
Lance un benchmark ou vérifie la connexion.
-
- - -
-
-

Overview

- -
- -
- -
- -
-
-
- Avg loading time by engine - ms — lower is better -
- -
-
-
- Performance profile - normalized score — higher is better -
- -
-
-
- - -
-
-

Datasets

- -
-
- -
-
- - -
-
-

Engines tested

- -
-

Click one or more engines to filter the charts

-
- -
-
- - -
-
-

Performance

- -
-
- -
-
- Loading time - ms — lower is better - - -
- -
- -
-
- Memory - ΔMB — lower is better - - -
- -
- -
-
- CPU - % — lower is better - - -
- -
- -
-
- - -
-
-

Full results

- -
- - -
-
-
-
- - - - - - - - - - - - - - -
EngineFileTriplesLoading (ms)Throughput (t/s)Memory ΔMBCPU %Repetitions (ms)
-
-
-
- - -
- -
- - -
- -
- -
-
- - -
-
- -
- - -
-
- -
-
- - - -
-
-
Add an engine
-
Select the triplestore and version to add to the comparison.
-
- - -
-
- - -
-
- - -
-
+ +
+
!
+
No Data Available
+
Could not load benchmark data.
+

Check that data/benchmark-report.json or data/mock-report-v2.json exists.

-
+ +
+ +

- corese-stack/corese-benchmark -  ·  Protocol : warmup + 3 repetitions + median -  ·  Corese Engine — Inria Wimmics + corese-stack/corese-benchmark + · Protocol: warmup + 3 repetitions + median + · Corese Engine — Inria Wimmics

- - + + diff --git a/site/js/app.js b/site/js/app.js new file mode 100644 index 0000000..9d32f23 --- /dev/null +++ b/site/js/app.js @@ -0,0 +1,294 @@ +// app.js — Bootstrap & navigation for Corese Benchmark Dashboard v2 +'use strict'; + +import state from './state.js'; +import { loadData, getEngineColor } from './data-loader.js'; +import { downloadMarkdownReport } from './export-md.js'; +import { downloadPdfReport } from './export-pdf.js'; +import { downloadLoadingCsv, downloadQueryCsv } from './export-csv.js'; +import { renderOverview } from './pages/overview.js'; +import { renderBowlogna } from './pages/bowlogna.js'; +import { renderBsbm } from './pages/bsbm.js'; +import { renderLubm } from './pages/lubm.js'; +import { renderDbpedia } from './pages/dbpedia.js'; +import { renderW3c } from './pages/w3c.js'; +import { renderTransparency } from './pages/transparency.js'; + +const TABS = [ + { id: 'overview', label: 'Global Overview', render: renderOverview }, + { id: 'bowlogna', label: 'Bowlogna', render: renderBowlogna }, + { id: 'bsbm', label: 'BSBM', render: renderBsbm }, + { id: 'lubm', label: 'LUBM', render: renderLubm }, + { id: 'dbpedia', label: 'DBpedia', render: renderDbpedia }, + { id: 'w3c', label: 'W3C Conformance', render: renderW3c }, + { id: 'transparency', label: 'Environment & Protocol', render: renderTransparency }, +]; + +// ── Init ────────────────────────────────────────────────────────────────────── + +document.addEventListener('DOMContentLoaded', async () => { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + const stickyPill = document.getElementById('sticky-pill'); + const errorState = document.getElementById('error-state'); + + try { + await loadData(); + + // Build sticky header pill + buildStickyPill(stickyPill); + + // Wire export buttons + const exportBtn = document.getElementById('export-md-btn'); + if (exportBtn) { + exportBtn.style.display = ''; + exportBtn.addEventListener('click', downloadMarkdownReport); + } + const exportPdfBtn = document.getElementById('export-pdf-btn'); + if (exportPdfBtn) { + exportPdfBtn.style.display = ''; + exportPdfBtn.addEventListener('click', downloadPdfReport); + } + const exportLoadingCsvBtn = document.getElementById('export-loading-csv-btn'); + if (exportLoadingCsvBtn) { + exportLoadingCsvBtn.style.display = ''; + exportLoadingCsvBtn.addEventListener('click', downloadLoadingCsv); + } + const exportQueryCsvBtn = document.getElementById('export-query-csv-btn'); + if (exportQueryCsvBtn) { + exportQueryCsvBtn.style.display = ''; + exportQueryCsvBtn.addEventListener('click', downloadQueryCsv); + } + + // Build engine filter bar + const engineBar = document.getElementById('engine-bar'); + buildEngineBar(engineBar, mainContent, tabBar); + + // Build tab bar + buildTabBar(tabBar); + + // Render initial tab + const hash = window.location.hash.replace('#', ''); + const initialTab = TABS.find(t => t.id === hash) ? hash : 'overview'; + switchTab(initialTab, mainContent, tabBar); + + } catch (err) { + console.error('Failed to load data:', err); + if (mainContent) mainContent.style.display = 'none'; + if (errorState) { + errorState.style.display = 'block'; + const errMsg = errorState.querySelector('.error-message'); + if (errMsg) errMsg.textContent = err.message; + } + } + + // Export JSON button + const exportJsonBtn = document.getElementById('export-json-btn'); + if (exportJsonBtn && state.rawData) { + exportJsonBtn.style.display = ''; + exportJsonBtn.addEventListener('click', () => { + const blob = new Blob([JSON.stringify(state.rawData, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `corese-benchmark-${new Date().toISOString().slice(0, 10)}.json`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + }); + } +}); + +function buildTabBar(tabBar) { + if (!tabBar) return; + tabBar.innerHTML = ''; + + TABS.forEach(tab => { + const btn = document.createElement('button'); + btn.className = 'tab-btn'; + btn.textContent = tab.label; + btn.dataset.tab = tab.id; + btn.addEventListener('click', () => { + const mainContent = document.getElementById('main-content'); + switchTab(tab.id, mainContent, tabBar); + }); + tabBar.appendChild(btn); + }); +} + +function switchTab(tabId, mainContent, tabBar) { + state.activeTab = tabId; + + // Update URL hash + window.location.hash = tabId; + + // Update tab buttons + if (tabBar) { + tabBar.querySelectorAll('.tab-btn').forEach(btn => { + btn.classList.toggle('active', btn.dataset.tab === tabId); + }); + } + + // Destroy all existing charts + Object.keys(state.charts).forEach(key => { + if (state.charts[key]) { + state.charts[key].destroy(); + delete state.charts[key]; + } + }); + + // Render page + const tab = TABS.find(t => t.id === tabId); + if (tab && mainContent) { + tab.render(mainContent); + } +} + +function buildStickyPill(pillEl) { + if (!pillEl || !state.data) return; + + const env = state.data.metadata.environment || {}; + const protocol = state.data.metadata.protocol || {}; + + const parts = []; + + // Location — derive from context + parts.push('\ud83d\udccd Inria SED Sophia'); + + // CPU + if (env.cpuCores && env.cpuThreads) { + parts.push(`${env.cpuCores}c/${env.cpuThreads}t CPU`); + } + + // RAM + if (env.ramTotalGb) { + parts.push(`${env.ramTotalGb} GB RAM`); + } + + // OS + if (env.osKernel) { + const kernelShort = env.osKernel.replace(/-generic$/, '').replace(/^Linux /, ''); + parts.push(`Linux ${kernelShort}`); + } else if (env.osDistribution) { + parts.push(env.osDistribution); + } + + // JVM + if (env.jvmVersion) { + const jdkVersion = env.jvmVersion.match(/^(\d+)/); + const flags = env.jvmFlags ? env.jvmFlags.filter(f => f.startsWith('-X')).join(' ') : ''; + parts.push(`OpenJDK ${jdkVersion ? jdkVersion[1] : '?'}${flags ? ` (${flags})` : ''}`); + } + + // Protocol + if (protocol.warmup != null && protocol.repetitions) { + parts.push(`Protocol: Warmup + ${protocol.repetitions} Reps (Median)`); + } + + pillEl.textContent = parts.join(' \u00b7 '); + + // Click -> navigate to transparency tab + pillEl.style.cursor = 'pointer'; + pillEl.addEventListener('click', () => { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + switchTab('transparency', mainContent, tabBar); + }); +} + +function buildEngineBar(engineBar, mainContent, tabBar) { + if (!engineBar || !state.data) return; + engineBar.innerHTML = ''; + + let dragSrc = null; + + state.engines.forEach(engineId => { + const eng = state.data.engines.find(e => e.id === engineId); + const label = eng ? eng.label : engineId; + const color = getEngineColor(engineId); + + const btn = document.createElement('button'); + btn.dataset.engine = engineId; + btn.style.setProperty('--engine-color', color); + btn.draggable = true; + + function updateBtn() { + const isActive = state.activeEngines.includes(engineId); + btn.className = 'engine-btn' + (isActive ? ' active' : ''); + btn.innerHTML = isActive + ? `${label} \u00d7` + : `+ ${label}`; + btn.title = isActive ? `Hide ${label}` : `Show ${label}`; + } + + updateBtn(); + + btn.addEventListener('click', () => { + const isActive = state.activeEngines.includes(engineId); + if (isActive && state.activeEngines.length === 1) return; + + state.activeEngines = isActive + ? state.activeEngines.filter(e => e !== engineId) + : [...state.activeEngines, engineId]; + + updateBtn(); + + const tab = TABS.find(t => t.id === state.activeTab); + if (tab && mainContent) tab.render(mainContent); + }); + + // ── Drag & drop reorder ────────────────────────────────────────────────── + btn.addEventListener('dragstart', (e) => { + dragSrc = btn; + e.dataTransfer.effectAllowed = 'move'; + btn.classList.add('dragging'); + }); + btn.addEventListener('dragend', () => { + btn.classList.remove('dragging'); + engineBar.querySelectorAll('.engine-btn').forEach(b => b.classList.remove('drag-over')); + }); + btn.addEventListener('dragover', (e) => { + e.preventDefault(); + e.dataTransfer.dropEffect = 'move'; + if (btn !== dragSrc) btn.classList.add('drag-over'); + }); + btn.addEventListener('dragleave', () => { + btn.classList.remove('drag-over'); + }); + btn.addEventListener('drop', (e) => { + e.preventDefault(); + btn.classList.remove('drag-over'); + if (!dragSrc || dragSrc === btn) return; + + // Reorder in DOM + const btns = [...engineBar.querySelectorAll('.engine-btn')]; + const srcIdx = btns.indexOf(dragSrc); + const tgtIdx = btns.indexOf(btn); + if (srcIdx < tgtIdx) engineBar.insertBefore(dragSrc, btn.nextSibling); + else engineBar.insertBefore(dragSrc, btn); + + // Sync state.engines and state.activeEngines to new DOM order + const newOrder = [...engineBar.querySelectorAll('.engine-btn')].map(b => b.dataset.engine); + state.engines = newOrder; + state.activeEngines = newOrder.filter(e => state.activeEngines.includes(e)); + + // Re-render current tab + const tab = TABS.find(t => t.id === state.activeTab); + if (tab && mainContent) tab.render(mainContent); + }); + + engineBar.appendChild(btn); + }); +} + +// Handle hash changes +window.addEventListener('hashchange', () => { + const hash = window.location.hash.replace('#', ''); + const tab = TABS.find(t => t.id === hash); + if (tab && tab.id !== state.activeTab) { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + switchTab(tab.id, mainContent, tabBar); + } +}); diff --git a/site/js/bundle.js b/site/js/bundle.js new file mode 100644 index 0000000..b627a6a --- /dev/null +++ b/site/js/bundle.js @@ -0,0 +1,3646 @@ +// bundle.js — Auto-generated. Do not edit directly. +// Run: node build-bundle.js +(function () { +// sloppy mode intentional: block-level function declarations hoist to this scope + +// ── state.js ── +// state.js — Global application state (singleton) + +const state = { + activeTab: 'overview', + data: null, // normalized data + rawData: null, // original JSON + engines: [], // engine id list + activeEngines: [], // currently visible engines + charts: {}, // chart instance registry (id -> Chart) + dataFormat: null, // 'v1' or 'v2' +}; + + + +// ── formatters.js ── +// formatters.js — Number, duration, throughput, memory formatting + +/** Format a number with locale (fr-FR) and fixed decimal digits */ +function fmt(n, decimals = 0) { + if (n == null || n === '') return '\u2014'; // em-dash + return Number(n).toLocaleString('fr-FR', { maximumFractionDigits: decimals }); +} + +/** Format milliseconds to human-readable string */ +function fmtMs(ms) { + if (ms == null || ms === -1) return '\u2014'; + if (ms >= 60000) return `${(ms / 1000).toFixed(1)}s`; + if (ms >= 1000) return `${(ms / 1000).toFixed(2)}s`; + return `${fmt(ms)} ms`; +} + +/** Format throughput (triples/sec) */ +function fmtThroughput(t) { + if (t == null) return '\u2014'; + if (t >= 1000000) return `${(t / 1000000).toFixed(2)}M t/s`; + if (t >= 1000) return `${(t / 1000).toFixed(1)}K t/s`; + return `${fmt(t)} t/s`; +} + +/** Format memory in MB — NEVER clamp to 0 (GC can produce negative) */ +function fmtMemory(mb) { + if (mb == null) return '\u2014'; + return `${Number(mb).toFixed(1)} MB`; +} + +/** Format percentage */ +function fmtPercent(p, decimals = 1) { + if (p == null) return '\u2014'; + return `${Number(p).toFixed(decimals)}%`; +} + +/** Coefficient of variation from array of values */ +function computeCV(values) { + if (!values || values.length < 2) return null; + const nums = values.filter(v => v != null && v >= 0); + if (nums.length < 2) return null; + const mean = nums.reduce((a, b) => a + b, 0) / nums.length; + if (mean === 0) return 0; + const variance = nums.reduce((sum, v) => sum + (v - mean) ** 2, 0) / nums.length; + return (Math.sqrt(variance) / mean) * 100; +} + +/** Escape HTML for safe textContent-equivalent in template strings */ +function escapeHtml(str) { + if (!str) return ''; + const div = document.createElement('div'); + div.textContent = str; + return div.innerHTML; +} + + +// ── data-loader.js ── +// data-loader.js — Load and normalize benchmark JSON (v1 real + v2 mock) + + +/** Engine color palette */ +const ENGINE_COLORS = { + 'corese': '#4472C4', + 'corese.next': '#2E75B6', + 'jena': '#ED7D31', + 'rdf4j': '#70AD47', +}; + +// Versioned overrides (e.g. corese.4.6.5 → lighter blue to distinguish from v5) +function versionedColor(engineId) { + const id = engineId.toLowerCase(); + if (id.startsWith('corese.') && id !== 'corese.next') return '#7EB3E8'; + return null; +} + +function getEngineColor(engineId) { + if (ENGINE_COLORS[engineId]) return ENGINE_COLORS[engineId]; + const versioned = versionedColor(engineId); + if (versioned) return versioned; + const family = engineId.split('.')[0].toLowerCase(); + return ENGINE_COLORS[family] || '#8b949e'; +} + +function getEngineLabel(engineId) { + if (!state.data) return engineId; + const eng = state.data.engines.find(e => e.id === engineId); + return eng ? eng.label : engineId; +} + +/** Try loading benchmark data: injected global → fetch JSON → fetch mock */ +async function loadData() { + let raw = null; + let format = null; + + // 1. Prefer pre-injected data (works with file:// and GitHub Pages) + if (window.__BENCHMARK_DATA__) { + raw = window.__BENCHMARK_DATA__; + format = detectFormat(raw); + } + + // 2. Fetch real JSON (works when served over HTTP) + if (!raw) { + try { + const res = await fetch('data/benchmark-report.json'); + if (res.ok) { + raw = await res.json(); + format = detectFormat(raw); + } + } catch (_) { /* ignore */ } + } + + // 3. Fallback to mock data + if (!raw) { + try { + const res = await fetch('data/mock-report-v2.json'); + if (res.ok) { + raw = await res.json(); + format = detectFormat(raw); + } + } catch (_) { /* ignore */ } + } + + if (!raw) throw new Error('No benchmark data found'); + + state.rawData = raw; + state.dataFormat = format; + state.data = normalize(raw, format); + state.engines = state.data.engines.map(e => e.id); + state.activeEngines = [...state.engines]; + + return state.data; +} + +function detectFormat(json) { + // v2 has loadingRuns array and metadata.engines + if (json.loadingRuns && json.metadata && json.metadata.engines) return 'v2'; + // v1 has runs array + if (json.runs) return 'v1'; + // default to v2 if loadingRuns exists + if (json.loadingRuns) return 'v2'; + return 'v1'; +} + +/** + * Normalize both formats to a common internal structure: + * { + * metadata: { generatedAt, protocol, environment }, + * engines: [{ id, family, version, label }], + * loadingRuns: [{ engine, dataset, file, triples, loadingTimeMs, ... }], + * queryRuns: [{ engine, dataset, queryId, queryCategory, status, medianMs, medianTtfrMs, ... }], + * timeSeries: { "engine::dataset": [...] }, + * datasetQueries: { dataset: [{ id, category, label, sparql, expectedRowCount, expectedHash }] } + * } + */ +function normalize(raw, format) { + if (format === 'v2') return normalizeV2(raw); + return normalizeV1(raw); +} + +function normalizeV2(raw) { + const meta = raw.metadata || {}; + const env = meta.environment || {}; + const protocol = meta.protocol || {}; + + const engines = (meta.engines || []).map(e => ({ + id: e.id, + family: e.family || e.id.split('.')[0], + version: e.version || '', + label: e.label || e.id, + })); + + const loadingRuns = (raw.loadingRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + file: r.file, + triples: r.triples, + loadingTimeMs: r.loadingTimeMs, + repetitionsMs: r.repetitionsMs || [], + throughputTriplesPerSec: r.throughputTriplesPerSec, + memoryBeforeMb: r.memoryBeforeMb, + memoryAfterMb: r.memoryAfterMb, + memoryDeltaMb: r.memoryDeltaMb, // can be negative! + cpuPercent: r.cpuPercent, + })); + + // Build timeSeries map + const timeSeries = {}; + (raw.loadingRuns || []).forEach(r => { + if (r.timeSeries && r.timeSeries.length > 0) { + timeSeries[`${r.engine}::${r.dataset}`] = r.timeSeries; + } + }); + + const queryRuns = (raw.queryRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + queryId: r.queryId, + queryCategory: r.queryCategory || '', + status: r.status, + medianMs: r.medianMs, + repetitionsMs: r.repetitionsMs || [], + medianTtfrMs: r.medianTtfrMs, + repetitionsTtfrMs: r.repetitionsTtfrMs || [], + rowCount: r.rowCount, + hash: r.hash || r.resultHash || '', + errorMessage: r.errorMessage || null, + heapDeltaMb: r.heapDeltaMb, + })); + + const datasetQueries = meta.datasetQueries || {}; + + return { + metadata: { + generatedAt: meta.generatedAt, + git: meta.git || {}, + protocol, + environment: env, + }, + engines, + loadingRuns, + queryRuns, + timeSeries, + datasetQueries, + }; +} + +function normalizeV1(raw) { + const meta = raw.metadata || {}; + const protocol = meta.protocol || {}; + + // Extract engines from runs + const engineSet = new Set(); + (raw.runs || []).forEach(r => engineSet.add(r.engine)); + (raw.queryRuns || []).forEach(r => engineSet.add(r.engine)); + + const engines = [...engineSet].map(id => ({ + id, + family: id.split('.')[0], + version: id.split('.').slice(1).join('.') || '', + label: id, + })); + + // v1 "runs" -> loadingRuns + const loadingRuns = (raw.runs || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + file: r.file, + triples: r.triples, + loadingTimeMs: r.loadingTimeMs, + repetitionsMs: r.repetitionsMs || [], + throughputTriplesPerSec: r.throughputTriplesPerSec || (r.triples && r.loadingTimeMs ? r.triples / (r.loadingTimeMs / 1000) : null), + memoryBeforeMb: r.memoryBeforeMb, + memoryAfterMb: r.memoryAfterMb, + memoryDeltaMb: r.memoryDeltaMb, + cpuPercent: r.cpuPercent, + })); + + const queryRuns = (raw.queryRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + queryId: r.queryId, + queryCategory: r.queryCategory || '', + status: r.status || 'PASS', // v1 only records successful runs + medianMs: r.medianMs, + repetitionsMs: r.repetitionsMs || [], + medianTtfrMs: r.medianTtfrMs != null ? r.medianTtfrMs : -1, + repetitionsTtfrMs: r.repetitionsTtfrMs || [], + rowCount: r.rowCount != null ? r.rowCount : null, + hash: r.resultHash || r.hash || '', + errorMessage: r.errorMessage || null, + heapDeltaMb: r.heapDeltaMb, + })); + + // Build environment from v1 metadata + const environment = { + cpuModel: meta.cpu || '', + cpuCores: meta.cpuCores, + cpuThreads: meta.cpuThreads, + ramTotalGb: meta.ramGb, + osDistribution: meta.os || '', + osKernel: meta.osKernel || '', + jvmVersion: meta.java || '', + jvmFlags: meta.jvmFlags || (protocol.jvmArgs ? protocol.jvmArgs : []), + }; + + return { + metadata: { + generatedAt: meta.generatedAt, + git: meta.git || {}, + protocol, + environment, + }, + engines, + loadingRuns, + queryRuns, + timeSeries: {}, + datasetQueries: meta.datasetQueries || {}, + }; +} + +/** Get unique datasets present in the data */ +function getDatasets() { + if (!state.data) return []; + const sets = new Set(); + state.data.loadingRuns.forEach(r => sets.add(r.dataset)); + state.data.queryRuns.forEach(r => sets.add(r.dataset)); + return [...sets]; +} + +/** Filter queryRuns by dataset and optionally by engine */ +function getQueryRuns(dataset, engines) { + if (!state.data) return []; + const eng = engines || state.activeEngines; + return state.data.queryRuns.filter(r => + r.dataset === dataset && eng.includes(r.engine) + ); +} + +/** Filter loadingRuns by dataset and optionally by engine */ +function getLoadingRuns(dataset, engines) { + if (!state.data) return []; + const eng = engines || state.activeEngines; + return state.data.loadingRuns.filter(r => + r.dataset === dataset && eng.includes(r.engine) + ); +} + +/** Get query metadata for a dataset */ +function getQueryMeta(dataset, queryId) { + if (!state.data || !state.data.datasetQueries[dataset]) return null; + return state.data.datasetQueries[dataset].find(q => q.id === queryId) || null; +} + + +// ── components/status-badge.js ── +// status-badge.js — Render status badges (PASS, MISMATCH, TIMEOUT, ERROR) + +const STATUS_STYLES = { + PASS: { bg: '#2ecc71', color: '#fff', label: 'PASS' }, + MISMATCH: { bg: '#e74c3c', color: '#fff', label: 'MISMATCH' }, + TIMEOUT: { bg: '#f39c12', color: '#fff', label: 'TIMEOUT' }, + ERROR: { bg: '#8e44ad', color: '#fff', label: 'ERROR' }, +}; + +/** + * Create a status badge element. + * @param {string} status - PASS, MISMATCH, TIMEOUT, ERROR + * @param {object} [opts] - Optional: { clickable, onClick } + * @returns {HTMLSpanElement} + */ +function createStatusBadge(status, opts = {}) { + const style = STATUS_STYLES[status] || STATUS_STYLES.ERROR; + const span = document.createElement('span'); + span.className = 'status-badge'; + span.textContent = style.label; + span.style.cssText = ` + display: inline-block; + padding: 2px 8px; + border-radius: 4px; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.5px; + background: ${style.bg}; + color: ${style.color}; + cursor: ${opts.clickable ? 'pointer' : 'default'}; + user-select: none; + `; + + if (opts.clickable && opts.onClick) { + span.addEventListener('click', opts.onClick); + span.title = 'Click to inspect'; + } + + return span; +} + +/** + * Return status badge as HTML string (for use in innerHTML-free contexts, + * to be appended via DOM methods). + */ +function statusBadgeHTML(status) { + const style = STATUS_STYLES[status] || STATUS_STYLES.ERROR; + // Returns a span element — caller must use textContent or DOM methods + return { label: style.label, bg: style.bg, color: style.color }; +} + + + +// ── components/result-dialog.js ── +// result-dialog.js — Modal dialog for inspecting query results (diff inspector) + + +let dialogEl = null; + +function ensureDialog() { + if (dialogEl) return dialogEl; + + dialogEl = document.createElement('dialog'); + dialogEl.className = 'result-dialog'; + dialogEl.addEventListener('click', (e) => { + if (e.target === dialogEl) dialogEl.close(); + }); + + document.body.appendChild(dialogEl); + return dialogEl; +} + +/** + * Open the result inspection dialog for a query run. + * @param {object} run - normalized queryRun + */ +function openResultDialog(run) { + const dialog = ensureDialog(); + dialog.innerHTML = ''; + + const inner = document.createElement('div'); + inner.className = 'result-dialog-inner'; + + // Header + const header = document.createElement('div'); + header.className = 'result-dialog-header'; + + const title = document.createElement('h3'); + title.textContent = `${run.queryId} \u2014 ${getEngineLabel(run.engine)}`; + header.appendChild(title); + + const badge = createStatusBadge(run.status); + header.appendChild(badge); + + const closeBtn = document.createElement('button'); + closeBtn.className = 'dialog-close-btn'; + closeBtn.textContent = '\u2715'; + closeBtn.addEventListener('click', () => dialog.close()); + header.appendChild(closeBtn); + + inner.appendChild(header); + + // Query metadata + const queryMeta = getQueryMeta(run.dataset, run.queryId); + + // SPARQL query display (XSS-safe: textContent only) + if (queryMeta && queryMeta.sparql) { + const sparqlSection = document.createElement('div'); + sparqlSection.className = 'result-dialog-section'; + + const sparqlLabel = document.createElement('h4'); + sparqlLabel.textContent = 'SPARQL Query'; + sparqlSection.appendChild(sparqlLabel); + + const pre = document.createElement('pre'); + pre.className = 'sparql-display'; + const code = document.createElement('code'); + code.textContent = queryMeta.sparql; // XSS-safe + pre.appendChild(code); + sparqlSection.appendChild(pre); + inner.appendChild(sparqlSection); + } + + // Results comparison — only shown when at least one value is available (v2 data) + const expectedRows = queryMeta ? queryMeta.expectedRowCount : null; + const expectedHash = queryMeta ? queryMeta.expectedHash : null; + const hasComparisonData = expectedRows != null || run.rowCount != null || expectedHash || run.hash; + + if (hasComparisonData) { + const compSection = document.createElement('div'); + compSection.className = 'result-dialog-section'; + + const compLabel = document.createElement('h4'); + compLabel.textContent = 'Result Comparison'; + compSection.appendChild(compLabel); + + const grid = document.createElement('div'); + grid.className = 'result-dialog-grid'; + + addComparisonRow(grid, 'Row Count', + expectedRows != null ? fmt(expectedRows) : '\u2014', + run.rowCount != null ? fmt(run.rowCount) : '\u2014', + expectedRows != null && run.rowCount !== expectedRows + ); + + addComparisonRow(grid, 'Result Hash (SHA-256)', + expectedHash || '\u2014', + run.hash || '\u2014', + expectedHash != null && run.hash !== expectedHash + ); + + compSection.appendChild(grid); + inner.appendChild(compSection); + } + + // Metrics + const metricsSection = document.createElement('div'); + metricsSection.className = 'result-dialog-section'; + + const metricsLabel = document.createElement('h4'); + metricsLabel.textContent = 'Execution Metrics'; + metricsSection.appendChild(metricsLabel); + + const metricsList = document.createElement('dl'); + metricsList.className = 'result-dialog-metrics'; + + addMetric(metricsList, 'Median Time', fmtMs(run.medianMs)); + addMetric(metricsList, 'TTFR', run.medianTtfrMs === -1 ? '\u2014' : fmtMs(run.medianTtfrMs)); + addMetric(metricsList, 'Repetitions (ms)', Array.isArray(run.repetitionsMs) && run.repetitionsMs.length ? run.repetitionsMs.join(', ') : '\u2014'); + + if (run.errorMessage) { + const errSection = document.createElement('div'); + errSection.className = 'result-dialog-error'; + const errLabel = document.createElement('strong'); + errLabel.textContent = 'Error: '; + errSection.appendChild(errLabel); + const errMsg = document.createElement('span'); + errMsg.textContent = run.errorMessage; // XSS-safe + errSection.appendChild(errMsg); + metricsSection.appendChild(errSection); + } + + metricsSection.appendChild(metricsList); + inner.appendChild(metricsSection); + + dialog.appendChild(inner); + dialog.showModal(); +} + +function addComparisonRow(grid, label, expected, actual, isMismatch) { + const row = document.createElement('div'); + row.className = 'comparison-row' + (isMismatch ? ' mismatch' : ''); + + const lbl = document.createElement('div'); + lbl.className = 'comparison-label'; + lbl.textContent = label; + + const exp = document.createElement('div'); + exp.className = 'comparison-expected'; + const expLabel = document.createElement('small'); + expLabel.textContent = 'Expected: '; + exp.appendChild(expLabel); + const expVal = document.createElement('span'); + expVal.className = 'font-mono'; + expVal.textContent = expected; + exp.appendChild(expVal); + + const act = document.createElement('div'); + act.className = 'comparison-actual'; + const actLabel = document.createElement('small'); + actLabel.textContent = 'Actual: '; + act.appendChild(actLabel); + const actVal = document.createElement('span'); + actVal.className = 'font-mono'; + actVal.textContent = actual; + act.appendChild(actVal); + + row.appendChild(lbl); + row.appendChild(exp); + row.appendChild(act); + grid.appendChild(row); +} + +function addMetric(dl, label, value) { + const dt = document.createElement('dt'); + dt.textContent = label; + dl.appendChild(dt); + const dd = document.createElement('dd'); + dd.textContent = value; + dd.className = 'font-mono'; + dl.appendChild(dd); +} + + + +// ── components/result-table.js ── +// result-table.js — Interactive sortable result tables + + +/** + * Build a loading runs table inside a container element. + * @param {HTMLElement} container + * @param {Array} runs - normalized loadingRuns + */ +function buildLoadingTable(container, runs) { + container.innerHTML = ''; + + const COLS = [ + { label: 'Engine', key: r => getEngineLabel(r.engine), fmt: r => getEngineLabel(r.engine), cls: '' }, + { label: 'Dataset', key: r => r.dataset, fmt: r => r.dataset, cls: '' }, + { label: 'File', key: r => r.file || '', fmt: r => r.file || '\u2014', cls: '' }, + { label: 'Triples', key: r => r.triples || 0, fmt: r => fmt(r.triples), cls: 'text-right font-mono' }, + { label: 'Median Time', key: r => r.loadingTimeMs || 0, fmt: r => fmtMs(r.loadingTimeMs), cls: 'text-right font-mono' }, + { label: 'Throughput', key: r => r.throughputTriplesPerSec || 0, fmt: r => fmtThroughput(r.throughputTriplesPerSec), cls: 'text-right font-mono' }, + { label: 'Heap \u0394', key: r => r.memoryDeltaMb != null ? r.memoryDeltaMb : -Infinity, fmt: r => fmtMemory(r.memoryDeltaMb), cls: 'text-right font-mono' }, + { label: 'CPU %', key: r => r.cpuPercent != null ? r.cpuPercent : -Infinity, fmt: r => r.cpuPercent != null ? r.cpuPercent.toFixed(1) + '%' : '\u2014', cls: 'text-right font-mono' }, + { label: 'Repetitions', key: null, fmt: r => r.repetitionsMs ? r.repetitionsMs.map(v => fmt(v)).join(', ') : '\u2014', cls: 'font-mono' }, + { label: 'CV (%)', key: r => computeCV(r.repetitionsMs) ?? -Infinity, fmt: r => computeCV(r.repetitionsMs) != null ? computeCV(r.repetitionsMs).toFixed(1) + '%' : '\u2014', cls: 'text-right font-mono' }, + ]; + + let sortCol = null; + let sortAsc = true; + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + + const table = document.createElement('table'); + table.className = 'data-table'; + + // Header + const thead = document.createElement('thead'); + const headerRow = document.createElement('tr'); + const thEls = COLS.map((col, i) => { + const th = document.createElement('th'); + th.className = col.cls.includes('text-right') ? 'text-right' : ''; + if (col.key) { + th.classList.add('sortable'); + th.style.cursor = 'pointer'; + th.addEventListener('click', () => { + if (sortCol === i) { sortAsc = !sortAsc; } + else { sortCol = i; sortAsc = true; } + renderBody(); + updateHeaders(); + }); + } + th.innerHTML = `${col.label} `; + headerRow.appendChild(th); + return th; + }); + thead.appendChild(headerRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + table.appendChild(tbody); + + function updateHeaders() { + thEls.forEach((th, i) => { + const icon = th.querySelector('.sort-icon'); + if (!icon) return; + icon.textContent = sortCol === i ? (sortAsc ? ' \u25b2' : ' \u25bc') : ''; + }); + } + + function renderBody() { + tbody.innerHTML = ''; + let sorted = [...runs]; + if (sortCol !== null && COLS[sortCol].key) { + const keyFn = COLS[sortCol].key; + sorted.sort((a, b) => { + const va = keyFn(a), vb = keyFn(b); + if (typeof va === 'string') return sortAsc ? va.localeCompare(vb) : vb.localeCompare(va); + return sortAsc ? va - vb : vb - va; + }); + } + sorted.forEach(r => { + const tr = document.createElement('tr'); + COLS.forEach(col => { + const td = document.createElement('td'); + td.textContent = col.fmt(r); + if (col.cls) td.className = col.cls; + tr.appendChild(td); + }); + tr.style.borderLeft = `3px solid ${getEngineColor(r.engine)}`; + tbody.appendChild(tr); + }); + } + + renderBody(); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} + +/** + * Build a loading table preceded by an All / Best-per-file filter bar. + * @param {HTMLElement} container + * @param {Array} allRuns - normalized loadingRuns + */ +function buildLoadingTableWithFilter(container, allRuns) { + container.innerHTML = ''; + + // Compute best (lowest loadingTimeMs) per (dataset, file) + function getBest(runs) { + const best = {}; + runs.forEach(r => { + const key = `${r.dataset}::${r.file || ''}`; + if (!best[key] || r.loadingTimeMs < best[key].loadingTimeMs) best[key] = r; + }); + return Object.values(best); + } + + let tableFilter = 'all'; + + const LOADING_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per File' }, + ]; + + const filterBar = document.createElement('div'); + filterBar.className = 'table-filter-bar'; + + const tableContainer = document.createElement('div'); + + const btns = LOADING_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + btns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + render(); + }); + filterBar.appendChild(btn); + return btn; + }); + + function render() { + const runs = tableFilter === 'best' ? getBest(allRuns) : allRuns; + buildLoadingTable(tableContainer, runs); + } + + container.appendChild(filterBar); + container.appendChild(tableContainer); + render(); +} + +/** + * Build a query runs table with status badges. + * @param {HTMLElement} container + * @param {Array} runs - normalized queryRuns + * @param {Function} onBadgeClick - callback(run) when badge is clicked + */ +function buildQueryTable(container, runs, onBadgeClick) { + container.innerHTML = ''; + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + + const table = document.createElement('table'); + table.className = 'data-table'; + + // Header + const thead = document.createElement('thead'); + const headerRow = document.createElement('tr'); + ['Engine', 'Query', 'Status', 'Median (ms)', 'TTFR (ms)', 'Rows', 'Repetitions'].forEach(h => { + const th = document.createElement('th'); + th.textContent = h; + if (['Median (ms)', 'TTFR (ms)', 'Rows'].includes(h)) { + th.className = 'text-right'; + } + headerRow.appendChild(th); + }); + thead.appendChild(headerRow); + table.appendChild(thead); + + // Body + const tbody = document.createElement('tbody'); + runs.forEach(r => { + const tr = document.createElement('tr'); + + // Engine + const tdEngine = document.createElement('td'); + tdEngine.textContent = getEngineLabel(r.engine); + tr.appendChild(tdEngine); + + // Query + const tdQuery = document.createElement('td'); + tdQuery.textContent = r.queryId; + tdQuery.className = 'font-mono'; + tr.appendChild(tdQuery); + + // Status badge + const tdStatus = document.createElement('td'); + const badge = createStatusBadge(r.status, { + clickable: true, + onClick: () => onBadgeClick && onBadgeClick(r), + }); + tdStatus.appendChild(badge); + tr.appendChild(tdStatus); + + // Median + const tdMedian = document.createElement('td'); + tdMedian.textContent = r.status === 'TIMEOUT' ? '> 60s (TIMEOUT)' : fmtMs(r.medianMs); + tdMedian.className = 'text-right font-mono'; + tr.appendChild(tdMedian); + + // TTFR — display dash if -1 + const tdTtfr = document.createElement('td'); + tdTtfr.textContent = (r.medianTtfrMs == null || r.medianTtfrMs === -1) ? '\u2014' : fmtMs(r.medianTtfrMs); + tdTtfr.className = 'text-right font-mono'; + tr.appendChild(tdTtfr); + + // Rows + const tdRows = document.createElement('td'); + tdRows.textContent = fmt(r.rowCount); + tdRows.className = 'text-right font-mono'; + tr.appendChild(tdRows); + + // Repetitions + const tdReps = document.createElement('td'); + tdReps.textContent = r.repetitionsMs ? r.repetitionsMs.map(v => fmt(v)).join(', ') : '\u2014'; + tdReps.className = 'font-mono'; + tr.appendChild(tdReps); + + tr.style.borderLeft = `3px solid ${getEngineColor(r.engine)}`; + tbody.appendChild(tr); + }); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} + + +// ── charts/loading-chart.js ── +// loading-chart.js — Bi-axis loading chart (heap memory + triples loaded over time) + + +/** + * Render bi-axis loading chart on a canvas. + * X = elapsed time (s), Y1 = heap used (MB), Y2 = triples loaded (cumulative) + * @param {string} canvasId + * @param {string} dataset + * @returns {Chart|null} + */ +function renderLoadingChart(canvasId, dataset) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + // Destroy previous instance + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + // Collect timeSeries data for this dataset + const datasets = []; + state.activeEngines.forEach(engineId => { + const key = `${engineId}::${dataset}`; + const ts = state.data.timeSeries[key]; + if (!ts || ts.length === 0) return; + + const color = getEngineColor(engineId); + const label = getEngineLabel(engineId); + + // Heap line (Y1 - left axis) + datasets.push({ + label: `${label} - Heap (MB)`, + data: ts.map(p => ({ x: p.elapsedMs / 1000, y: p.heapUsedMb })), + borderColor: color, + backgroundColor: color + '33', + borderWidth: 2, + pointRadius: 2, + fill: false, + yAxisID: 'y1', + tension: 0.3, + }); + + // Triples line (Y2 - right axis) + datasets.push({ + label: `${label} - Triples`, + data: ts.map(p => ({ x: p.elapsedMs / 1000, y: p.triplesLoaded })), + borderColor: color, + backgroundColor: color + '15', + borderWidth: 2, + borderDash: [5, 3], + pointRadius: 0, + fill: true, + yAxisID: 'y2', + tension: 0.3, + }); + }); + + // Fallback: no timeSeries data (v1 format) → bar chart of loading times + if (datasets.length === 0) { + const barLabels = []; + const barValues = []; + const barColors = []; + state.activeEngines.forEach(engineId => { + const run = state.data.loadingRuns.find(r => r.engine === engineId && r.dataset === dataset); + if (!run) return; + barLabels.push(getEngineLabel(engineId)); + barValues.push(run.loadingTimeMs); + barColors.push(getEngineColor(engineId)); + }); + if (barLabels.length === 0) return null; + const chart = new Chart(ctx, { + type: 'bar', + data: { + labels: barLabels, + datasets: [{ + label: 'Loading Time (ms)', + data: barValues, + backgroundColor: barColors.map(c => c + 'cc'), + borderColor: barColors, + borderWidth: 1, + }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + tooltip: { callbacks: { label: ctx => { + const ms = ctx.parsed.y; + return `${ms >= 1000 ? (ms/1000).toFixed(1)+'s' : ms+' ms'}`; + }}}, + }, + scales: { + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + y: { + title: { display: true, text: 'Loading Time (ms)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000 ? (v/1000).toFixed(1)+'s' : v }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); + state.charts[canvasId] = chart; + return chart; + } + + const chart = new Chart(ctx, { + type: 'line', + data: { datasets }, + options: { + responsive: true, + maintainAspectRatio: false, + interaction: { + mode: 'index', + intersect: false, + }, + plugins: { + legend: { + position: 'bottom', + labels: { color: getComputedStyle(document.body).getPropertyValue('--text-main').trim() || '#e6edf3', font: { size: 11 } }, + }, + tooltip: { + callbacks: { + label: function(ctx) { + const label = ctx.dataset.label || ''; + const val = ctx.parsed.y; + if (label.includes('Heap')) return `${label}: ${val.toFixed(1)} MB`; + if (label.includes('Triples')) return `${label}: ${val.toLocaleString()}`; + return `${label}: ${val}`; + } + } + } + }, + scales: { + x: { + type: 'linear', + title: { display: true, text: 'Elapsed Time (s)', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.5)' }, + }, + y1: { + type: 'linear', + position: 'left', + title: { display: true, text: 'Heap Used (MB)', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y2: { + type: 'linear', + position: 'right', + title: { display: true, text: 'Triples Loaded', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { drawOnChartArea: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + + + +// ── charts/throughput-chart.js ── +// throughput-chart.js — Horizontal bar chart for loading throughput with min/max error bars + + +/** Inline Chart.js plugin to draw horizontal error bar whiskers */ +const errorBarPlugin = { + id: 'errorBars', + afterDatasetsDraw(chart, args, opts) { + if (!opts || !opts.bars || opts.bars.length === 0) return; + const ctx = chart.ctx; + const xScale = chart.scales.x; + const meta = chart.getDatasetMeta(0); + if (!meta || !meta.data) return; + + ctx.save(); + ctx.strokeStyle = 'rgba(200,200,210,0.85)'; + ctx.lineWidth = 2; + const CAP = 5; + + opts.bars.forEach((bar, i) => { + if (!bar) return; + const element = meta.data[i]; + if (!element) return; + const y = element.y; + const xMin = xScale.getPixelForValue(bar.min); + const xMax = xScale.getPixelForValue(bar.max); + + // Whisker line + ctx.beginPath(); ctx.moveTo(xMin, y); ctx.lineTo(xMax, y); ctx.stroke(); + // End caps + ctx.beginPath(); ctx.moveTo(xMin, y - CAP); ctx.lineTo(xMin, y + CAP); ctx.stroke(); + ctx.beginPath(); ctx.moveTo(xMax, y - CAP); ctx.lineTo(xMax, y + CAP); ctx.stroke(); + }); + + ctx.restore(); + }, +}; + +/** + * Render throughput horizontal bar chart with min/max error bars. + * @param {string} canvasId + * @param {Array} loadingRuns - filtered loading runs + */ +function renderThroughputChart(canvasId, loadingRuns) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + // Group by engine + const engineData = {}; + loadingRuns.forEach(r => { + if (!state.activeEngines.includes(r.engine)) return; + if (!engineData[r.engine]) engineData[r.engine] = []; + engineData[r.engine].push(r); + }); + + const labels = []; + const data = []; + const bgColors = []; + const borderColors = []; + const errorBars = []; + + Object.entries(engineData).forEach(([engine, runs]) => { + const avgThroughput = runs.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / runs.length; + + // Compute per-repetition throughputs for min/max whiskers + const allRepThroughputs = runs.flatMap(r => { + if (!r.repetitionsMs || !r.triples) return []; + return r.repetitionsMs.filter(ms => ms > 0).map(ms => r.triples / (ms / 1000)); + }); + + labels.push(getEngineLabel(engine)); + data.push(Math.round(avgThroughput)); + bgColors.push(getEngineColor(engine) + 'cc'); + borderColors.push(getEngineColor(engine)); + + errorBars.push(allRepThroughputs.length >= 2 ? { + min: Math.round(Math.min(...allRepThroughputs)), + max: Math.round(Math.max(...allRepThroughputs)), + } : null); + }); + + if (data.length === 0) return null; + + const chart = new Chart(ctx, { + type: 'bar', + plugins: [errorBarPlugin], + data: { + labels, + datasets: [{ + label: 'Throughput (triples/s)', + data, + backgroundColor: bgColors, + borderColor: borderColors, + borderWidth: 1, + }], + }, + options: { + indexAxis: 'y', + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + errorBars: { bars: errorBars }, + tooltip: { + callbacks: { + label(ctx) { + const bar = errorBars[ctx.dataIndex]; + let line = `Avg: ${ctx.parsed.x.toLocaleString()} t/s`; + if (bar) line += ` | Min: ${bar.min.toLocaleString()} Max: ${bar.max.toLocaleString()}`; + return line; + }, + }, + }, + }, + scales: { + x: { + title: { display: true, text: 'Throughput (triples/s)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v.toLocaleString() }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + ticks: { color: '#8b949e' }, + grid: { display: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + + + +// ── charts/cpu-chart.js ── +// cpu-chart.js — Horizontal bar chart for average CPU usage during loading + + +/** + * Render CPU % horizontal bar chart. + * @param {string} canvasId + * @param {Array} loadingRuns - filtered loading runs + */ +function renderCpuChart(canvasId, loadingRuns) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + const labels = []; + const data = []; + const bgColors = []; + const borderColors = []; + + state.activeEngines.forEach(engine => { + const runs = loadingRuns.filter(r => r.engine === engine && r.cpuPercent != null); + if (runs.length === 0) return; + const avg = runs.reduce((s, r) => s + r.cpuPercent, 0) / runs.length; + labels.push(getEngineLabel(engine)); + data.push(+avg.toFixed(1)); + bgColors.push(getEngineColor(engine) + 'cc'); + borderColors.push(getEngineColor(engine)); + }); + + if (data.length === 0) return null; + + const chart = new Chart(ctx, { + type: 'bar', + data: { + labels, + datasets: [{ + label: 'Avg CPU (%)', + data, + backgroundColor: bgColors, + borderColor: borderColors, + borderWidth: 1, + }], + }, + options: { + indexAxis: 'y', + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + tooltip: { + callbacks: { + label: ctx => `${ctx.parsed.x.toFixed(1)} %`, + }, + }, + }, + scales: { + x: { + min: 0, + max: 100, + title: { display: true, text: 'CPU Usage (%)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v + '%' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + ticks: { color: '#8b949e' }, + grid: { display: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + + + +// ── charts/query-breakdown.js ── +{ +// query-breakdown.js — Grouped bar chart: median time per query per engine + + +const TIMEOUT_MS = 60000; + +/** Create a diagonal hatch CanvasPattern for TIMEOUT bars */ +function createHatchPattern(ctx, color) { + const size = 8; + const pc = document.createElement('canvas'); + pc.width = size; pc.height = size; + const pctx = pc.getContext('2d'); + pctx.strokeStyle = color; + pctx.lineWidth = 1.5; + // diagonal stripe + pctx.beginPath(); pctx.moveTo(0, size); pctx.lineTo(size, 0); pctx.stroke(); + pctx.beginPath(); pctx.moveTo(-size/2, size/2); pctx.lineTo(size/2, -size/2); pctx.stroke(); + pctx.beginPath(); pctx.moveTo(size/2, size*1.5); pctx.lineTo(size*1.5, size/2); pctx.stroke(); + return ctx.createPattern(pc, 'repeat'); +} + +/** + * Render grouped bar chart: one bar per engine per query, showing median ms. + * TIMEOUT queries shown at 60000ms with diagonal hatch pattern. + * + * @param {string} canvasId + * @param {Array} queryRuns - filtered queryRuns for one dataset + * @param {Array} queryIds - ordered query IDs to display + * @param {boolean} [logScale=false] + * @returns {Chart|null} + */ +function renderQueryBreakdown(canvasId, queryRuns, queryIds, logScale = false) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + const engines = state.activeEngines; + + const labels = queryIds.map(qid => qid.replace('query_', 'Q')); + + const datasets = engines.map(eng => { + const color = getEngineColor(eng); + const label = getEngineLabel(eng); + const data = []; + const statuses = []; + + queryIds.forEach(qid => { + const run = queryRuns.find(r => r.engine === eng && r.queryId === qid); + if (!run) { + data.push(null); + statuses.push(null); + } else if (run.status === 'TIMEOUT') { + data.push(TIMEOUT_MS); + statuses.push('TIMEOUT'); + } else { + data.push(run.medianMs || 0); + statuses.push(run.status); + } + }); + + const hatch = createHatchPattern(ctx, color); + + return { + label, + data, + backgroundColor: data.map((_, i) => statuses[i] === 'TIMEOUT' ? hatch : color + 'cc'), + borderColor: color, + borderWidth: 1, + borderRadius: 2, + _statuses: statuses, + }; + }); + + const chart = new Chart(ctx, { + type: 'bar', + data: { labels, datasets }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { + position: 'bottom', + labels: { + color: '#8b949e', + font: { size: 11 }, + boxWidth: 12, + }, + }, + tooltip: { + callbacks: { + label: function(context) { + const ds = context.dataset; + const i = context.dataIndex; + const val = context.parsed.y; + if (val === null) return `${ds.label}: N/A`; + if (ds._statuses && ds._statuses[i] === 'TIMEOUT') { + return `${ds.label}: > 60s (TIMEOUT)`; + } + return `${ds.label}: ${val.toLocaleString()} ms`; + } + } + } + }, + scales: { + x: { + ticks: { color: '#8b949e', font: { size: 11 } }, + grid: { display: false }, + }, + y: { + type: logScale ? 'logarithmic' : 'linear', + title: { display: true, text: 'ms — lower is better', color: '#8b949e' }, + ticks: { + color: '#8b949e', + callback: v => v === 0 ? '0 ms' : v.toLocaleString() + ' ms', + }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + + +} + +// ── chart-expand.js ── +// chart-expand.js — Fullscreen expand + PNG download buttons for chart boxes + + +function collapseChart(box) { + box.classList.remove('chart-fullscreen'); + const backdrop = document.querySelector('.chart-backdrop'); + if (backdrop) backdrop.remove(); + const canvas = box.querySelector('canvas'); + if (canvas && canvas.id && state.charts[canvas.id]) { + setTimeout(() => state.charts[canvas.id].resize(), 50); + } +} + +function downloadChartPng(chartBox) { + const canvas = chartBox.querySelector('canvas'); + if (!canvas) return; + + // Draw chart onto a white-background offscreen canvas for clean PNG + const offscreen = document.createElement('canvas'); + offscreen.width = canvas.width; + offscreen.height = canvas.height; + const ctx = offscreen.getContext('2d'); + ctx.fillStyle = '#ffffff'; + ctx.fillRect(0, 0, offscreen.width, offscreen.height); + ctx.drawImage(canvas, 0, 0); + + const title = chartBox.querySelector('h4')?.textContent || 'chart'; + const name = title.toLowerCase().replace(/[^a-z0-9]+/g, '-'); + const a = document.createElement('a'); + a.download = `corese-benchmark-${name}.png`; + a.href = offscreen.toDataURL('image/png'); + a.click(); +} + +/** + * Add expand (⛶) and download (⬇) buttons to a chart box header. + * @param {HTMLElement} chartBox - element with class chart-box + */ +function addExpandButton(chartBox) { + if (!chartBox) return; + const header = chartBox.querySelector('.chart-box-header'); + if (!header || header.querySelector('.chart-expand-btn')) return; + + const btnGroup = document.createElement('div'); + btnGroup.className = 'chart-btn-group'; + + // Download PNG button + const dlBtn = document.createElement('button'); + dlBtn.className = 'chart-expand-btn'; + dlBtn.title = 'Download PNG'; + dlBtn.textContent = '\u2193'; // ↓ + dlBtn.addEventListener('click', (e) => { + e.stopPropagation(); + downloadChartPng(chartBox); + }); + + // Expand button + const expBtn = document.createElement('button'); + expBtn.className = 'chart-expand-btn'; + expBtn.title = 'Enlarge chart'; + expBtn.textContent = '\u26f6'; // ⛶ + + expBtn.addEventListener('click', (e) => { + e.stopPropagation(); + const isExpanded = chartBox.classList.contains('chart-fullscreen'); + + document.querySelectorAll('.chart-fullscreen').forEach(b => collapseChart(b)); + + if (!isExpanded) { + const backdrop = document.createElement('div'); + backdrop.className = 'chart-backdrop'; + backdrop.addEventListener('click', () => collapseChart(chartBox)); + document.body.appendChild(backdrop); + + chartBox.classList.add('chart-fullscreen'); + const canvas = chartBox.querySelector('canvas'); + if (canvas && canvas.id && state.charts[canvas.id]) { + setTimeout(() => state.charts[canvas.id].resize(), 50); + } + } + }); + + btnGroup.appendChild(dlBtn); + btnGroup.appendChild(expBtn); + header.appendChild(btnGroup); +} + + +// ── pages/overview.js ── +// overview.js — Overview page with KPI cards and summary charts + + +/** + * Render the overview page. + * @param {HTMLElement} container + */ +function renderOverview(container) { + container.innerHTML = ''; + + const data = state.data; + if (!data) return; + + // Section heading + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Overview'; + container.appendChild(heading); + + // KPI cards grid + const kpiGrid = document.createElement('div'); + kpiGrid.className = 'kpi-grid'; + + // Compute KPIs per engine + state.activeEngines.forEach(engineId => { + const loadRuns = data.loadingRuns.filter(r => r.engine === engineId); + const queryRuns = data.queryRuns.filter(r => r.engine === engineId); + + // Avg throughput + const avgThroughput = loadRuns.length > 0 + ? loadRuns.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / loadRuns.length + : null; + + // Avg median latency (PASS only) + const passRuns = queryRuns.filter(r => r.status === 'PASS'); + const avgLatency = passRuns.length > 0 + ? passRuns.reduce((s, r) => s + r.medianMs, 0) / passRuns.length + : null; + + // Pass rate + const totalQueries = queryRuns.length; + const passCount = passRuns.length; + const passRate = totalQueries > 0 ? (passCount / totalQueries) * 100 : null; + + const card = createKpiCard(getEngineLabel(engineId), getEngineColor(engineId), [ + { label: 'Avg Throughput', value: fmtThroughput(avgThroughput) }, + { label: 'Avg Latency (PASS)', value: fmtMs(avgLatency) }, + { label: 'Pass Rate', value: passRate != null ? fmtPercent(passRate) : '\u2014' }, + { label: 'Queries', value: `${passCount} / ${totalQueries}` }, + ]); + kpiGrid.appendChild(card); + }); + + container.appendChild(kpiGrid); + + // Charts section + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row'; + + // Throughput bar chart + const throughputBox = createChartBox('Average Ingestion Throughput', 'chart-overview-throughput'); + chartsRow.appendChild(throughputBox); + + // Latency bar chart + const latencyBox = createChartBox('Average Query Latency (PASS only)', 'chart-overview-latency'); + chartsRow.appendChild(latencyBox); + + container.appendChild(chartsRow); + + // Render charts after DOM is in place + requestAnimationFrame(() => { + renderThroughputOverview('chart-overview-throughput'); + renderLatencyOverview('chart-overview-latency'); + }); +} + +function createKpiCard(title, color, metrics) { + const card = document.createElement('div'); + card.className = 'kpi-card'; + card.style.borderTopColor = color; + + const h3 = document.createElement('h3'); + h3.className = 'kpi-card-title'; + h3.textContent = title; + h3.style.color = color; + card.appendChild(h3); + + const metricsDiv = document.createElement('div'); + metricsDiv.className = 'kpi-card-metrics'; + + metrics.forEach(m => { + const row = document.createElement('div'); + row.className = 'kpi-metric-row'; + + const label = document.createElement('span'); + label.className = 'kpi-metric-label'; + label.textContent = m.label; + row.appendChild(label); + + const value = document.createElement('span'); + value.className = 'kpi-metric-value font-mono'; + value.textContent = m.value; + row.appendChild(value); + + metricsDiv.appendChild(row); + }); + + card.appendChild(metricsDiv); + return card; +} + +function createChartBox(title, canvasId) { + const box = document.createElement('div'); + box.className = 'chart-box'; + + const header = document.createElement('div'); + header.className = 'chart-box-header'; + const h4 = document.createElement('h4'); + h4.textContent = title; + header.appendChild(h4); + box.appendChild(header); + + const canvasWrap = document.createElement('div'); + canvasWrap.className = 'chart-canvas-wrap'; + const canvas = document.createElement('canvas'); + canvas.id = canvasId; + canvasWrap.appendChild(canvas); + box.appendChild(canvasWrap); + + return box; +} + +function renderThroughputOverview(canvasId) { + const canvas = document.getElementById(canvasId); + if (!canvas) return; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const labels = []; + const values = []; + const colors = []; + + state.activeEngines.forEach(eng => { + const runs = state.data.loadingRuns.filter(r => r.engine === eng); + if (runs.length === 0) return; + const avg = runs.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / runs.length; + labels.push(getEngineLabel(eng)); + values.push(Math.round(avg)); + colors.push(getEngineColor(eng)); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { + labels, + datasets: [{ data: values, backgroundColor: colors.map(c => c + 'cc'), borderColor: colors, borderWidth: 1 }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { legend: { display: false }, tooltip: { callbacks: { label: ctx => `${ctx.parsed.y.toLocaleString()} t/s` } } }, + scales: { + y: { title: { display: true, text: 'Throughput (t/s)', color: '#8b949e' }, ticks: { color: '#8b949e', callback: v => v.toLocaleString() }, grid: { color: 'rgba(48,54,61,0.3)' } }, + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + }, + }, + }); +} + +function renderLatencyOverview(canvasId) { + const canvas = document.getElementById(canvasId); + if (!canvas) return; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const labels = []; + const values = []; + const colors = []; + + state.activeEngines.forEach(eng => { + const passRuns = state.data.queryRuns.filter(r => r.engine === eng && r.status === 'PASS'); + if (passRuns.length === 0) return; + const avg = passRuns.reduce((s, r) => s + r.medianMs, 0) / passRuns.length; + labels.push(getEngineLabel(eng)); + values.push(Math.round(avg)); + colors.push(getEngineColor(eng)); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { + labels, + datasets: [{ data: values, backgroundColor: colors.map(c => c + 'cc'), borderColor: colors, borderWidth: 1 }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { legend: { display: false }, tooltip: { callbacks: { label: ctx => `${ctx.parsed.y.toLocaleString()} ms` } } }, + scales: { + y: { title: { display: true, text: 'Median Latency (ms)', color: '#8b949e' }, ticks: { color: '#8b949e' }, grid: { color: 'rgba(48,54,61,0.3)' } }, + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + }, + }, + }); +} + + + +// ── pages/bowlogna.js ── +{ +// bowlogna.js — Bowlogna benchmark page + + +const DATASET = 'bowlogna'; + +const FILTERS = { + all: { label: 'All (17)', queries: null }, + aggregations: { label: 'Aggregations', queries: ['query_8','query_9','query_11','query_12','query_13'] }, + complex_joins: { label: 'Complex Joins', queries: ['query_5','query_7','query_14'] }, + temporal_regex:{ label: 'Temporal & Regex', queries: ['query_3','query_4','query_6','query_10','query_16','query_17'] }, + simple_count: { label: 'Simple & Count', queries: ['query_1','query_2','query_15'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + // fallback: if no PASS for a query, show fastest non-PASS + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +function renderBowlogna(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Bowlogna Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Academic benchmark \u2014 1.23M triples, 17 SPARQL queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A: Ingestion ─────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-bowlogna-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-bowlogna-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-bowlogna-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B: SPARQL Queries ────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + // Query-family filter bar + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + filterBar.id = 'bowlogna-filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBowlogna(); + }); + filterBar.appendChild(btn); + }); + sectionB.appendChild(filterBar); + + // TTFR chart + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-bowlogna-ttfr'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + // Table filter bar + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBowlogna(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'bowlogna-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateBowlogna(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-bowlogna-loading', DATASET); + renderThroughputChart('chart-bowlogna-throughput', runs); + renderCpuChart('chart-bowlogna-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateBowlogna() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-bowlogna-ttfr', filteredRuns, queryIds); + + const tableContainer = document.getElementById('bowlogna-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + + +} + +// ── pages/bsbm.js ── +{ +// bsbm.js — BSBM benchmark page + + +const DATASET = 'bsbm'; + +const FILTERS = { + all: { label: 'All Queries (12)', queries: null }, + search_product: { label: 'Search & Product Features', queries: ['query_1','query_2','query_3','query_4'] }, + simulations: { label: 'Simulations & Joins', queries: ['query_5'] }, + reviews: { label: 'Reviews & Ratings', queries: ['query_6','query_9','query_11','query_12'] }, + offers: { label: 'Offers & Vendors', queries: ['query_7','query_8','query_10'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let logScale = false; +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +function renderBsbm(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + logScale = false; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'BSBM Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Berlin SPARQL Benchmark \u2014 eCommerce dataset, 12 queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A ────────────────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-bsbm-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-bsbm-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-bsbm-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B ────────────────────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + filterBar.id = 'bsbm-filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn:not(.log-scale-btn)').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBsbm(); + }); + filterBar.appendChild(btn); + }); + const logBtn = document.createElement('button'); + logBtn.className = 'filter-btn log-scale-btn'; + logBtn.textContent = 'Log Scale'; + logBtn.addEventListener('click', () => { + logScale = !logScale; + logBtn.classList.toggle('active', logScale); + updateBsbm(); + }); + filterBar.appendChild(logBtn); + sectionB.appendChild(filterBar); + + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-bsbm-breakdown'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBsbm(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'bsbm-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateBsbm(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-bsbm-loading', DATASET); + renderThroughputChart('chart-bsbm-throughput', runs); + renderCpuChart('chart-bsbm-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateBsbm() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-bsbm-breakdown', filteredRuns, queryIds, logScale); + + const tableContainer = document.getElementById('bsbm-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + + +} + +// ── pages/lubm.js ── +{ +// lubm.js — LUBM benchmark page + + +const DATASET = 'lubm'; + +const FILTERS = { + all: { label: 'All Queries (14)', queries: null }, + large_results: { label: 'Large Result Sets', queries: ['query_2','query_6','query_9'] }, + selective: { label: 'Selective Graph Patterns', queries: ['query_1','query_3','query_5','query_7','query_8','query_10','query_14'] }, + transitive: { label: 'Transitive & SubOrganization', queries: ['query_4','query_11','query_12','query_13'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +function renderLubm(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'LUBM Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Lehigh University Benchmark \u2014 Inference & RDFS, 14 queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A ────────────────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-lubm-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-lubm-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-lubm-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B ────────────────────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateLubm(); + }); + filterBar.appendChild(btn); + }); + sectionB.appendChild(filterBar); + + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-lubm-breakdown'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateLubm(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'lubm-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateLubm(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-lubm-loading', DATASET); + renderThroughputChart('chart-lubm-throughput', runs); + renderCpuChart('chart-lubm-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateLubm() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-lubm-breakdown', filteredRuns, queryIds); + + const tableContainer = document.getElementById('lubm-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + + +} + +// ── pages/dbpedia.js ── +{ +// dbpedia.js — DBpedia Scale page with file selector and bilogarithmic chart + + +const DATASET = 'dbpedia'; + +const DBPEDIA_FILES = [ + 'persondata_en.nt', + 'homepages_en.nt', + 'category_labels_en.nt', + 'disambiguations_en.nt', + 'specific_mappingbased_properties_en.nt', +]; + +let selectedFile = null; // null = all files + +function renderDbpedia(container) { + container.innerHTML = ''; + selectedFile = null; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'DBpedia Scale'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Scalability testing on real-world DBpedia datasets \u2014 bilogarithmic curve (triples \u00d7 loading time).'; + container.appendChild(desc); + + // ── File selector ────────────────────────────────────────────────────────── + const fileBar = document.createElement('div'); + fileBar.className = 'filter-bar'; + + const allBtn = document.createElement('button'); + allBtn.className = 'filter-btn active'; + allBtn.textContent = 'All Files'; + allBtn.addEventListener('click', () => { + selectedFile = null; + fileBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + allBtn.classList.add('active'); + updateDbpedia(); + }); + fileBar.appendChild(allBtn); + + DBPEDIA_FILES.forEach(f => { + const btn = document.createElement('button'); + btn.className = 'filter-btn'; + btn.textContent = f.replace('_en.nt', ''); + btn.addEventListener('click', () => { + selectedFile = f; + fileBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateDbpedia(); + }); + fileBar.appendChild(btn); + }); + + container.appendChild(fileBar); + + // ── Charts row ───────────────────────────────────────────────────────────── + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row'; + + const scaleBox = document.createElement('div'); + scaleBox.className = 'chart-box'; + const sh = document.createElement('div'); sh.className = 'chart-box-header'; + const st = document.createElement('h4'); st.textContent = 'Triples vs Loading Time (log\u2013log)'; + const ss = document.createElement('span'); ss.className = 'chart-subtitle'; ss.textContent = 'bilogarithmic scale'; + sh.appendChild(st); sh.appendChild(ss); scaleBox.appendChild(sh); + const sw = document.createElement('div'); sw.className = 'chart-canvas-wrap'; + const sc = document.createElement('canvas'); sc.id = 'chart-dbpedia-scale'; + sw.appendChild(sc); scaleBox.appendChild(sw); + chartsRow.appendChild(scaleBox); + + const memBox = document.createElement('div'); + memBox.className = 'chart-box'; + const mh = document.createElement('div'); mh.className = 'chart-box-header'; + const mt = document.createElement('h4'); mt.textContent = 'Memory Efficiency (MB / M triples)'; + const ms2 = document.createElement('span'); ms2.className = 'chart-subtitle'; ms2.textContent = 'lower is better'; + mh.appendChild(mt); mh.appendChild(ms2); memBox.appendChild(mh); + const mw = document.createElement('div'); mw.className = 'chart-canvas-wrap'; + const mc = document.createElement('canvas'); mc.id = 'chart-dbpedia-memory'; + mw.appendChild(mc); memBox.appendChild(mw); + chartsRow.appendChild(memBox); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-dbpedia-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + chartsRow.appendChild(cpuBox); + + container.appendChild(chartsRow); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Loading Results'; + container.appendChild(tableTitle); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'dbpedia-table'; + container.appendChild(tableContainer); + + requestAnimationFrame(() => { + updateDbpedia(); + addExpandButton(scaleBox); + addExpandButton(memBox); + addExpandButton(cpuBox); + }); +} + +function updateDbpedia() { + let runs = getLoadingRuns(DATASET); + if (selectedFile) runs = runs.filter(r => r.file === selectedFile); + + const tableContainer = document.getElementById('dbpedia-table'); + if (tableContainer) buildLoadingTableWithFilter(tableContainer, runs); + + renderScaleChart(runs); + renderMemoryChart(runs); + renderCpuChart('chart-dbpedia-cpu', runs); +} + +function renderScaleChart(runs) { + const canvasId = 'chart-dbpedia-scale'; + const canvas = document.getElementById(canvasId); + if (!canvas) return; + if (state.charts[canvasId]) { state.charts[canvasId].destroy(); delete state.charts[canvasId]; } + + const datasets = []; + state.activeEngines.forEach(eng => { + const engRuns = runs.filter(r => r.engine === eng).sort((a, b) => a.triples - b.triples); + if (engRuns.length === 0) return; + datasets.push({ + label: getEngineLabel(eng), + data: engRuns.map(r => ({ x: r.triples, y: r.loadingTimeMs })), + borderColor: getEngineColor(eng), + backgroundColor: getEngineColor(eng) + '33', + borderWidth: 2, + pointRadius: 4, + fill: false, + tension: 0.3, + }); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'line', + data: { datasets }, + options: { + responsive: true, maintainAspectRatio: false, + plugins: { legend: { position: 'bottom', labels: { color: '#8b949e' } } }, + scales: { + x: { + type: 'logarithmic', + title: { display: true, text: 'Triples (log)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000000 ? (v / 1000000).toFixed(0) + 'M' : v >= 1000 ? (v / 1000).toFixed(0) + 'K' : v }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + type: 'logarithmic', + title: { display: true, text: 'Loading Time ms (log)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000 ? (v / 1000).toFixed(0) + 's' : v + 'ms' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); +} + +function renderMemoryChart(runs) { + const canvasId = 'chart-dbpedia-memory'; + const canvas = document.getElementById(canvasId); + if (!canvas) return; + if (state.charts[canvasId]) { state.charts[canvasId].destroy(); delete state.charts[canvasId]; } + + const files = selectedFile ? [selectedFile] : [...new Set(runs.map(r => r.file))]; + const datasets = []; + + state.activeEngines.forEach(eng => { + const engData = files.map(f => { + const run = runs.find(r => r.engine === eng && r.file === f); + if (run && run.memoryDeltaMb != null && run.triples > 0) { + return run.memoryDeltaMb / (run.triples / 1000000); // DO NOT clamp to 0 — GC can produce negative + } + return 0; + }); + datasets.push({ + label: getEngineLabel(eng), + data: engData, + backgroundColor: getEngineColor(eng) + 'cc', + borderColor: getEngineColor(eng), + borderWidth: 1, + }); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { labels: files.map(f => f.replace('_en.nt', '')), datasets }, + options: { + responsive: true, maintainAspectRatio: false, + plugins: { legend: { position: 'bottom', labels: { color: '#8b949e' } } }, + scales: { + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + y: { + title: { display: true, text: 'MB / M triples', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); +} + + +} + +// ── pages/w3c.js ── +// w3c.js — W3C Conformance page (static data from corese-w3c portal) + +const SUMMARY = { total: 2915, passed: 2897, failed: 3, inapplicable: 13, untested: 0, cantTell: 2 }; + +const SUITES = [ + { name: 'JSON-LD 1.1 (fromRdf)', spec: 'https://www.w3.org/TR/json-ld11-api/#dom-jsonldprocessor-fromrdf', total: 54, passed: 51, failed: 2, inapplicable: 1, cantTell: 0 }, + { name: 'JSON-LD 1.1 (toRdf)', spec: 'https://www.w3.org/TR/json-ld11-api/#dom-jsonldprocessor-tordf', total: 467, passed: 454, failed: 1, inapplicable: 12, cantTell: 0 }, + { name: 'N-Quads (RDF 1.1)', spec: 'https://www.w3.org/TR/n-quads/', total: 87, passed: 87, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'N-Triples (RDF 1.1)', spec: 'https://www.w3.org/TR/n-triples/', total: 70, passed: 70, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFC-1.0 (Canonicalization)', spec: 'https://www.w3.org/TR/rdf-canon/', total: 86, passed: 86, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDF/XML (RDF 1.1)', spec: 'https://www.w3.org/TR/rdf-syntax-grammar/', total: 166, passed: 166, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (SVG)', spec: 'https://www.w3.org/TR/SVG11/', total: 31, passed: 31, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (XHTML)', spec: 'https://www.w3.org/TR/rdfa-core/', total: 181, passed: 181, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (XML)', spec: 'https://www.w3.org/TR/rdfa-core/', total: 126, passed: 126, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'SPARQL 1.0', spec: 'https://www.w3.org/TR/rdf-sparql-query/', total: 482, passed: 482, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'SPARQL 1.1', spec: 'https://www.w3.org/TR/sparql11-query/', total: 495, passed: 493, failed: 0, inapplicable: 0, cantTell: 2 }, + { name: 'TriG (RDF 1.1)', spec: 'https://www.w3.org/TR/trig/', total: 357, passed: 357, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'Turtle (RDF 1.1)', spec: 'https://www.w3.org/TR/turtle/', total: 313, passed: 313, failed: 0, inapplicable: 0, cantTell: 0 }, +]; + +const FAILED_TESTS = [ + { + suite: 'JSON-LD 1.1 (fromRdf)', + test: 'use native types flag with values that cannot be serialized to JSON', + description: 'useNativeTypes flag being true is disregarded for a value that cannot be serialized into a native JSON value.', + error: 'Character I is neither a decimal digit nor \u201c.\u201d', + }, + { + suite: 'JSON-LD 1.1 (fromRdf)', + test: 'use native types flag with non-native values', + description: 'Ensure that useNativeTypes flag being true does not interfere with values that cannot be serialized to a native value.', + error: 'For input string: \u201cAAA\u201d', + }, + { + suite: 'JSON-LD 1.1 (toRdf)', + test: 'List with bad @base.', + description: 'Tests list elements expanded to IRIs with a bad @base.', + error: 'JsonLdError[code=An invalid base IRI has been detected]', + }, +]; + +const CANNOT_TELL_TESTS = [ + { + suite: 'SPARQL 1.1', + test: 'agg-empty-group', + description: 'Aggregate on empty group returns correct result.', + error: 'Result differs \u2014 ambiguous specification', + }, + { + suite: 'SPARQL 1.1', + test: 'agg-empty-group-count', + description: 'COUNT on empty group.', + error: 'Result differs \u2014 ambiguous specification', + }, +]; + +function renderW3c(container) { + container.innerHTML = ''; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'W3C Conformance'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Official W3C certification for Corese v5 \u2014 13 test suites, source: corese-w3c.'; + container.appendChild(desc); + + // ── KPI cards ────────────────────────────────────────────────────────────── + const kpiGrid = document.createElement('div'); + kpiGrid.className = 'w3c-kpi-grid'; + + const KPIS = [ + { label: 'TOTAL TESTS', value: SUMMARY.total.toLocaleString(), sub: '13 standard suites', color: 'var(--text-main)' }, + { label: 'PASSED', value: SUMMARY.passed.toLocaleString(), sub: (SUMMARY.passed/SUMMARY.total*100).toFixed(1)+'% of all entries', color: 'var(--status-pass)' }, + { label: 'FAILURES', value: SUMMARY.failed.toString(), sub: 'Failed tests', color: SUMMARY.failed > 0 ? 'var(--status-mismatch)' : 'var(--status-pass)' }, + { label: 'UNTESTED', value: SUMMARY.untested.toString(), sub: '', color: 'var(--text-muted)' }, + { label: 'INAPPLICABLE', value: SUMMARY.inapplicable.toString(), sub: 'See rationale', color: 'var(--status-timeout)' }, + { label: 'CANNOT TELL', value: SUMMARY.cantTell.toString(), sub: 'See rationale', color: '#8e44ad' }, + ]; + + KPIS.forEach(kpi => { + const card = document.createElement('div'); + card.className = 'w3c-kpi-card'; + + const lbl = document.createElement('div'); + lbl.className = 'w3c-kpi-label'; + lbl.textContent = kpi.label; + card.appendChild(lbl); + + const val = document.createElement('div'); + val.className = 'w3c-kpi-value'; + val.textContent = kpi.value; + val.style.color = kpi.color; + card.appendChild(val); + + if (kpi.sub) { + const sub = document.createElement('div'); + sub.className = 'w3c-kpi-sub'; + sub.textContent = kpi.sub; + card.appendChild(sub); + } + + kpiGrid.appendChild(card); + }); + + container.appendChild(kpiGrid); + + // Progress bar + const progressBar = document.createElement('div'); + progressBar.className = 'w3c-progress'; + const progressFill = document.createElement('div'); + progressFill.className = 'w3c-progress-fill'; + progressFill.style.width = (SUMMARY.passed / SUMMARY.total * 100).toFixed(2) + '%'; + progressBar.appendChild(progressFill); + container.appendChild(progressBar); + + // Link button + const linkBtn = document.createElement('a'); + linkBtn.className = 'w3c-link-btn'; + linkBtn.href = 'https://corese-stack.github.io/corese-w3c/'; + linkBtn.target = '_blank'; + linkBtn.rel = 'noopener noreferrer'; + linkBtn.textContent = 'View the official W3C conformance portal (corese-w3c) \u2197'; + container.appendChild(linkBtn); + + // ── Suite table ──────────────────────────────────────────────────────────── + const tableTitle = document.createElement('h3'); + tableTitle.className = 'page-subtitle'; + tableTitle.textContent = 'Detail by test suite'; + container.appendChild(tableTitle); + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + const table = document.createElement('table'); + table.className = 'data-table'; + + const thead = document.createElement('thead'); + const hRow = document.createElement('tr'); + ['Suite', 'Specification', 'Total', 'Passed', 'Failures', 'Inapplicable', 'Cannot Tell', 'Rate'].forEach((h, i) => { + const th = document.createElement('th'); + th.textContent = h; + if (i > 1) th.className = 'text-right'; + hRow.appendChild(th); + }); + thead.appendChild(hRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + + SUITES.forEach(row => { + const rate = (row.passed / row.total * 100).toFixed(2) + '%'; + const tr = document.createElement('tr'); + + // Suite name cell + const tdName = document.createElement('td'); + tdName.textContent = row.name; + tr.appendChild(tdName); + + // Specification link cell + const tdSpec = document.createElement('td'); + const a = document.createElement('a'); + a.href = row.spec; + a.target = '_blank'; + a.rel = 'noopener noreferrer'; + a.textContent = row.spec.replace('https://www.w3.org/TR/', '').replace(/\/$/, ''); + a.className = 'w3c-spec-link'; + tdSpec.appendChild(a); + tr.appendChild(tdSpec); + + // Numeric cells: Total, Passed, Failed, Inapplicable, Cannot Tell, Rate + const nums = [row.total, row.passed, row.failed, row.inapplicable, row.cantTell, rate]; + nums.forEach((val, i) => { + const td = document.createElement('td'); + td.textContent = val; + td.className = 'text-right font-mono'; + if (i === 2 && val > 0) { td.style.color = 'var(--status-mismatch)'; td.style.fontWeight = '600'; } + if (i === 2 && val === 0) td.style.color = 'var(--status-pass)'; + if (i === 3 && val > 0) td.style.color = 'var(--status-timeout)'; + if (i === 4 && val > 0) td.style.color = '#8e44ad'; + tr.appendChild(td); + }); + tbody.appendChild(tr); + }); + + // Total row + const trTotal = document.createElement('tr'); + trTotal.style.fontWeight = '700'; + trTotal.style.borderTop = '2px solid var(--border-color)'; + const grandRate = (SUMMARY.passed / SUMMARY.total * 100).toFixed(2) + '%'; + [ + 'Total', '', SUMMARY.total, SUMMARY.passed, + SUMMARY.failed, SUMMARY.inapplicable, SUMMARY.cantTell, grandRate + ].forEach((val, i) => { + const td = document.createElement('td'); + td.textContent = val; + if (i > 1) td.className = 'text-right font-mono'; + trTotal.appendChild(td); + }); + tbody.appendChild(trTotal); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); + + // ── Failure / Cannot-Tell detail tables ─────────────────────────────────── + buildDetailTable(container, 'Failed (3)', FAILED_TESTS, 'failed'); + buildDetailTable(container, 'Cannot Tell (2)', CANNOT_TELL_TESTS, 'cannot-tell'); +} + +function buildDetailTable(container, title, rows, kind) { + const titleEl = document.createElement('h3'); + titleEl.className = 'page-subtitle'; + titleEl.textContent = title; + container.appendChild(titleEl); + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + const table = document.createElement('table'); + table.className = 'data-table'; + + const thead = document.createElement('thead'); + const hRow = document.createElement('tr'); + ['Suite', 'Test', 'Description', 'Error'].forEach(h => { + const th = document.createElement('th'); + th.textContent = h; + hRow.appendChild(th); + }); + thead.appendChild(hRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + rows.forEach(row => { + const tr = document.createElement('tr'); + + const tdSuite = document.createElement('td'); + tdSuite.textContent = row.suite; + tdSuite.style.whiteSpace = 'nowrap'; + tr.appendChild(tdSuite); + + const tdTest = document.createElement('td'); + tdTest.className = 'font-mono'; + tdTest.textContent = row.test; + tr.appendChild(tdTest); + + const tdDesc = document.createElement('td'); + tdDesc.textContent = row.description; + tdDesc.style.color = 'var(--text-muted)'; + tdDesc.style.fontSize = '0.85rem'; + tr.appendChild(tdDesc); + + const tdErr = document.createElement('td'); + tdErr.textContent = row.error; + tdErr.style.fontSize = '0.82rem'; + if (kind === 'failed') { + tdErr.style.color = 'var(--status-mismatch)'; + } else { + tdErr.style.color = '#8e44ad'; + } + tr.appendChild(tdErr); + + tbody.appendChild(tr); + }); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} + + + +// ── pages/transparency.js ── +// transparency.js — Machine & Transparency page (6 info cards) + + +/** + * Render the Machine & Transparency page. + * @param {HTMLElement} container + */ +function renderTransparency(container) { + container.innerHTML = ''; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Machine & Transparency'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Complete identity card of the benchmark execution environment.'; + container.appendChild(desc); + + const env = (state.data && state.data.metadata.environment) || {}; + const protocol = (state.data && state.data.metadata.protocol) || {}; + const git = (state.data && state.data.metadata.git) || {}; + + const grid = document.createElement('div'); + grid.className = 'transparency-grid'; + + // 1. CPU + grid.appendChild(createInfoCard('CPU', '\u2699\ufe0f', [ + { label: 'Model', value: env.cpuModel || '\u2014' }, + { label: 'Architecture', value: env.cpuArchitecture || '\u2014' }, + { label: 'Sockets', value: env.cpuSockets || '\u2014' }, + { label: 'Cores', value: env.cpuCores || '\u2014' }, + { label: 'Threads', value: env.cpuThreads || '\u2014' }, + { label: 'Frequency', value: env.cpuFrequencyMhz ? `${env.cpuFrequencyMhz} MHz` : '\u2014' }, + { label: 'Governor', value: env.cpuGovernor || '\u2014' }, + ])); + + // 2. Memory & Disk + grid.appendChild(createInfoCard('Memory & Disk', '\ud83d\udcbe', [ + { label: 'RAM Total', value: env.ramTotalGb ? `${env.ramTotalGb} GB` : '\u2014' }, + { label: 'Swap', value: env.swapTotalGb ? `${env.swapTotalGb} GB` : '\u2014' }, + { label: 'Swappiness', value: env.swappiness != null ? String(env.swappiness) : '\u2014' }, + ])); + + // 3. OS & Kernel + grid.appendChild(createInfoCard('OS & Kernel', '\ud83d\udda5\ufe0f', [ + { label: 'Distribution', value: env.osDistribution || '\u2014' }, + { label: 'Kernel', value: env.osKernel || '\u2014' }, + ])); + + // 4. JVM + grid.appendChild(createInfoCard('JVM', '\u2615', [ + { label: 'Vendor', value: env.jvmVendor || '\u2014' }, + { label: 'Version', value: env.jvmVersion || '\u2014' }, + { label: 'Flags', value: env.jvmFlags ? env.jvmFlags.join(' ') : '\u2014' }, + ])); + + // 5. Protocol + grid.appendChild(createInfoCard('Measurement Protocol', '\ud83d\udccf', [ + { label: 'Warmup Runs', value: protocol.warmup != null ? String(protocol.warmup) : '\u2014' }, + { label: 'Repetitions', value: protocol.repetitions != null ? String(protocol.repetitions) : '\u2014' }, + { label: 'Query Repetitions', value: protocol.queryRepetitions != null ? String(protocol.queryRepetitions) : '\u2014' }, + { label: 'Query Timeout', value: protocol.queryTimeoutMs ? `${protocol.queryTimeoutMs / 1000}s` : '\u2014' }, + { label: 'Load Timeout', value: protocol.loadTimeoutMs ? `${protocol.loadTimeoutMs / 1000}s` : '\u2014' }, + { label: 'Metric', value: protocol.metric || 'median' }, + ])); + + // 7. Engines + const engines = (state.data && state.data.engines) || []; + const engineItems = engines.map(e => ({ + label: e.label || e.id, + value: e.version ? `v${e.version}` : '\u2014', + })); + if (engineItems.length > 0) { + grid.appendChild(createInfoCard('Engines', '\u26a1', engineItems)); + } + + container.appendChild(grid); +} + +function createInfoCard(title, icon, items) { + const card = document.createElement('div'); + card.className = 'info-card'; + + const header = document.createElement('div'); + header.className = 'info-card-header'; + + const iconEl = document.createElement('span'); + iconEl.className = 'info-card-icon'; + iconEl.textContent = icon; + header.appendChild(iconEl); + + const titleEl = document.createElement('h3'); + titleEl.className = 'info-card-title'; + titleEl.textContent = title; + header.appendChild(titleEl); + + card.appendChild(header); + + const list = document.createElement('dl'); + list.className = 'info-card-list'; + + items.forEach(item => { + const dt = document.createElement('dt'); + dt.textContent = item.label; + list.appendChild(dt); + + const dd = document.createElement('dd'); + dd.className = 'font-mono'; + dd.textContent = item.value; + list.appendChild(dd); + }); + + card.appendChild(list); + return card; +} + + + +// ── export-md.js ── +// export-md.js — Generate and download a Markdown benchmark report + + +function downloadMarkdownReport() { + if (!state.data) return; + + const md = buildMarkdown(); + const blob = new Blob([md], { type: 'text/markdown; charset=utf-8' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `corese-benchmark-report-${new Date().toISOString().slice(0, 10)}.md`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); +} + +function buildMarkdown() { + const data = state.data; + const meta = data.metadata; + const env = meta.environment || {}; + const protocol = meta.protocol || {}; + const engines = state.activeEngines; + const lines = []; + + // ── Header ──────────────────────────────────────────────────────────────── + lines.push('# Corese Benchmark Report'); + lines.push(''); + lines.push(`> Generated: ${meta.generatedAt || new Date().toISOString()}`); + if (meta.git && meta.git.benchmarkCommit) { + lines.push(`> Commit: \`${meta.git.benchmarkCommit}\` (${meta.git.branch || 'main'})`); + } + lines.push(''); + + // ── Environment ─────────────────────────────────────────────────────────── + lines.push('## Environment'); + lines.push(''); + lines.push('| Property | Value |'); + lines.push('|----------|-------|'); + if (env.cpuModel) lines.push(`| CPU | ${env.cpuModel} |`); + if (env.cpuCores) lines.push(`| Cores / Threads | ${env.cpuCores}c / ${env.cpuThreads}t |`); + if (env.ramTotalGb) lines.push(`| RAM | ${env.ramTotalGb} GB |`); + if (env.osDistribution) lines.push(`| OS | ${env.osDistribution} |`); + if (env.osKernel) lines.push(`| Kernel | ${env.osKernel} |`); + if (env.jvmVersion) lines.push(`| JVM | ${env.jvmVersion} |`); + if (env.jvmFlags && Array.isArray(env.jvmFlags)) lines.push(`| JVM Flags | \`${env.jvmFlags.join(' ')}\` |`); + lines.push(''); + + // ── Protocol ────────────────────────────────────────────────────────────── + lines.push('## Protocol'); + lines.push(''); + lines.push(`- Warmup: ${protocol.warmup ?? 1} run`); + lines.push(`- Repetitions: ${protocol.repetitions ?? 3}`); + lines.push(`- Metric: ${protocol.metric || 'median'}`); + lines.push(`- Query timeout: ${(protocol.queryTimeoutMs || 60000) / 1000}s`); + lines.push(`- Load timeout: ${(protocol.loadTimeoutMs || 120000) / 1000}s`); + lines.push(''); + + // ── Engines ─────────────────────────────────────────────────────────────── + lines.push('## Engines'); + lines.push(''); + lines.push('| ID | Label | Version |'); + lines.push('|----|-------|---------|'); + (data.engines || []).filter(e => engines.includes(e.id)).forEach(e => { + lines.push(`| \`${e.id}\` | ${e.label} | ${e.version || '—'} |`); + }); + lines.push(''); + + // ── Loading & Ingestion ─────────────────────────────────────────────────── + const datasets = [...new Set(data.loadingRuns.map(r => r.dataset))]; + + lines.push('## Loading & Ingestion'); + lines.push(''); + + datasets.forEach(ds => { + lines.push(`### ${ds}`); + lines.push(''); + lines.push('| Engine | File | Triples | Median Time | Throughput | Heap Δ |'); + lines.push('|--------|------|---------|-------------|------------|--------|'); + data.loadingRuns + .filter(r => r.dataset === ds && engines.includes(r.engine)) + .forEach(r => { + lines.push(`| ${getEngineLabel(r.engine)} | ${r.file || '—'} | ${(r.triples || 0).toLocaleString()} | ${fmtMs(r.loadingTimeMs)} | ${fmtThroughput(r.throughputTriplesPerSec)} | ${fmtMemory(r.memoryDeltaMb)} |`); + }); + lines.push(''); + }); + + // ── Query Results per dataset ───────────────────────────────────────────── + const queryDatasets = [...new Set(data.queryRuns.map(r => r.dataset))]; + + lines.push('## Query Results'); + lines.push(''); + + queryDatasets.forEach(ds => { + lines.push(`### ${ds}`); + lines.push(''); + + const queryIds = [...new Set( + data.queryRuns.filter(r => r.dataset === ds).map(r => r.queryId) + )].sort((a, b) => { + const na = parseInt(a.replace(/\D/g, '')); + const nb = parseInt(b.replace(/\D/g, '')); + return na - nb; + }); + + // Header: Query | Engine1 | Engine2 | ... + const engLabels = engines.map(e => getEngineLabel(e)); + lines.push(`| Query | ${engLabels.join(' | ')} |`); + lines.push(`|-------|${engines.map(() => '----').join('|')}|`); + + queryIds.forEach(qid => { + const cells = engines.map(eng => { + const run = data.queryRuns.find(r => r.dataset === ds && r.engine === eng && r.queryId === qid); + if (!run) return '—'; + if (run.status === 'TIMEOUT') return `\`> ${(protocol.queryTimeoutMs || 60000) / 1000}s (TIMEOUT)\``; + if (run.status !== 'PASS') return `\`${run.status}\``; + return fmtMs(run.medianMs); + }); + lines.push(`| ${qid.replace('query_', 'Q')} | ${cells.join(' | ')} |`); + }); + lines.push(''); + + // TTFR sub-table + lines.push(`**TTFR (Time To First Result) — ${ds}**`); + lines.push(''); + lines.push(`| Query | ${engLabels.join(' | ')} |`); + lines.push(`|-------|${engines.map(() => '----').join('|')}|`); + + queryIds.forEach(qid => { + const cells = engines.map(eng => { + const run = data.queryRuns.find(r => r.dataset === ds && r.engine === eng && r.queryId === qid); + if (!run || run.status !== 'PASS') return '—'; + if (run.medianTtfrMs === -1) return '—'; + return fmtMs(run.medianTtfrMs); + }); + lines.push(`| ${qid.replace('query_', 'Q')} | ${cells.join(' | ')} |`); + }); + lines.push(''); + }); + + // ── Failed Queries Summary ──────────────────────────────────────────────── + const failed = data.queryRuns.filter(r => engines.includes(r.engine) && r.status !== 'PASS'); + if (failed.length > 0) { + lines.push('## Failures & Timeouts'); + lines.push(''); + lines.push('| Engine | Dataset | Query | Status | Message |'); + lines.push('|--------|---------|-------|--------|---------|'); + failed.forEach(r => { + const msg = (r.errorMessage || '').replace(/\|/g, '\\|'); + lines.push(`| ${getEngineLabel(r.engine)} | ${r.dataset} | ${r.queryId.replace('query_', 'Q')} | **${r.status}** | ${msg || '—'} |`); + }); + lines.push(''); + } + + lines.push('---'); + lines.push(''); + lines.push('*Generated by [Corese Benchmark Dashboard](https://github.com/corese-stack/corese-benchmark)*'); + + return lines.join('\n'); +} + + +// ── export-pdf.js ── +// export-pdf.js — Generate and print a PDF benchmark report + + +function downloadPdfReport() { + if (!state.data) return; + + const html = buildHtml(); + + let iframe = document.getElementById('_pdf-print-frame'); + if (iframe) iframe.remove(); + iframe = document.createElement('iframe'); + iframe.id = '_pdf-print-frame'; + iframe.style.cssText = 'position:fixed;top:-9999px;left:-9999px;width:1px;height:1px;border:none'; + document.body.appendChild(iframe); + iframe.contentDocument.open(); + iframe.contentDocument.write(html); + iframe.contentDocument.close(); + setTimeout(() => { iframe.contentWindow.focus(); iframe.contentWindow.print(); }, 400); +} + +function buildHtml() { + const data = state.data; + const meta = data.metadata || {}; + const env = meta.environment || {}; + const proto = meta.protocol || {}; + const engines = state.activeEngines; + const now = new Date().toISOString().slice(0, 10); + + const ENGINE_COLORS = ['#4e79a7','#f28e2b','#59a14f','#e15759','#76b7b2','#edc948','#b07aa1','#ff9da7']; + const colorMap = {}; + engines.forEach((e, i) => { colorMap[e] = ENGINE_COLORS[i % ENGINE_COLORS.length]; }); + + const th = `style="padding:6px 10px;text-align:right;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; + const th0 = `style="padding:6px 10px;text-align:left;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; + const td = `style="padding:5px 10px;text-align:right;border:1px solid #ddd"`; + const td0 = `style="padding:5px 10px;text-align:left;border:1px solid #ddd;font-family:monospace"`; + const tdW = `style="padding:5px 10px;text-align:right;border:1px solid #ddd;font-weight:700;background:#fffbe6"`; + + function queryTable(title, runs) { + const queryIds = [...new Set(runs.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace(/\D/g,'')) - parseInt(b.replace(/\D/g,'')) + ); + const header = `Query${engines.map(e => + `${getEngineLabel(e)}` + ).join('')}Best`; + + const rows = queryIds.map(qid => { + const vals = engines.map(eng => { + const run = runs.find(r => r.engine === eng && r.queryId === qid); + if (!run) return null; + if (run.status === 'TIMEOUT') return 'TIMEOUT'; + if (run.status !== 'PASS') return run.status; + return run.medianMs; + }); + const nums = vals.map(v => (typeof v === 'number') ? v : null); + const minV = Math.min(...nums.filter(v => v !== null)); + const winIdx = isFinite(minV) ? nums.indexOf(minV) : -1; + + const cells = vals.map((v, i) => { + const style = (i === winIdx) ? tdW : td; + const disp = v === null ? '—' : typeof v === 'number' ? v.toLocaleString() + ' ms' : v; + return `${disp}`; + }).join(''); + const best = winIdx >= 0 + ? `${getEngineLabel(engines[winIdx])}` + : '—'; + return `${qid.replace('query_', 'Q')}${cells}${best}`; + }).join(''); + + return `

${title}

+ ${header}${rows}
`; + } + + const datasets = [...new Set(data.queryRuns.map(r => r.dataset))]; + const sections = datasets.map(ds => { + const runs = data.queryRuns.filter(r => r.dataset === ds && engines.includes(r.engine)); + return `

${ds}

+ ${queryTable('Median Execution Time', runs)}`; + }).join(''); + + return ` + Corese Benchmark — ${now} + + +

Corese Benchmark Report

+

Generated: ${meta.generatedAt || now}

+

CPU: ${env.cpuModel || '—'} (${env.cpuCores || '?'}c/${env.cpuThreads || '?'}t)  ·  RAM: ${env.ramTotalGb || '?'} GB

+

OS: ${env.osDistribution || '—'}  ·  JVM: ${env.jvmVersion || '—'}

+

Protocol: warmup + ${proto.repetitions || 3} repetitions, median — timeout ${(proto.queryTimeoutMs || 60000) / 1000}s

+ ${sections} +

Generated by Corese Benchmark Dashboard — ${now}

+ `; +} + + + +// ── export-csv.js ── +// export-csv.js — CSV export for loading runs and query runs + + +function escape(v) { + if (v == null) return ''; + const s = String(v); + return s.includes(',') || s.includes('"') || s.includes('\n') + ? '"' + s.replace(/"/g, '""') + '"' + : s; +} + +function triggerDownload(content, filename) { + const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = filename; + a.click(); + URL.revokeObjectURL(url); +} + +function downloadLoadingCsv() { + if (!state.data) return; + const date = new Date().toISOString().slice(0, 10); + + const headers = ['engine', 'engine_label', 'dataset', 'file', 'triples', + 'loading_time_ms', 'throughput_triples_per_sec', 'memory_delta_mb', + 'cpu_percent', 'repetitions_ms', 'cv_percent']; + + const rows = state.data.loadingRuns.map(r => [ + r.engine, + getEngineLabel(r.engine), + r.dataset, + r.file || '', + r.triples, + r.loadingTimeMs, + r.throughputTriplesPerSec != null ? r.throughputTriplesPerSec.toFixed(0) : '', + r.memoryDeltaMb != null ? r.memoryDeltaMb.toFixed(2) : '', + r.cpuPercent != null ? r.cpuPercent.toFixed(1) : '', + Array.isArray(r.repetitionsMs) ? r.repetitionsMs.join(';') : '', + computeCV(r.repetitionsMs) != null ? computeCV(r.repetitionsMs).toFixed(2) : '', + ]); + + const csv = [headers, ...rows].map(row => row.map(escape).join(',')).join('\r\n'); + triggerDownload(csv, `corese-benchmark-loading-${date}.csv`); +} + +function downloadQueryCsv() { + if (!state.data) return; + const date = new Date().toISOString().slice(0, 10); + + const headers = ['engine', 'engine_label', 'dataset', 'query_id', + 'status', 'median_ms', 'ttfr_ms', 'row_count', + 'repetitions_ms', 'hash']; + + const rows = state.data.queryRuns.map(r => [ + r.engine, + getEngineLabel(r.engine), + r.dataset, + r.queryId, + r.status, + r.medianMs, + r.medianTtfrMs != null && r.medianTtfrMs !== -1 ? r.medianTtfrMs : '', + r.rowCount != null ? r.rowCount : '', + Array.isArray(r.repetitionsMs) ? r.repetitionsMs.join(';') : '', + r.hash || '', + ]); + + const csv = [headers, ...rows].map(row => row.map(escape).join(',')).join('\r\n'); + triggerDownload(csv, `corese-benchmark-queries-${date}.csv`); +} + + +// ── app.js ── +// app.js — Bootstrap & navigation for Corese Benchmark Dashboard v2 + + +const TABS = [ + { id: 'overview', label: 'Global Overview', render: renderOverview }, + { id: 'bowlogna', label: 'Bowlogna', render: renderBowlogna }, + { id: 'bsbm', label: 'BSBM', render: renderBsbm }, + { id: 'lubm', label: 'LUBM', render: renderLubm }, + { id: 'dbpedia', label: 'DBpedia', render: renderDbpedia }, + { id: 'w3c', label: 'W3C Conformance', render: renderW3c }, + { id: 'transparency', label: 'Environment & Protocol', render: renderTransparency }, +]; + +// ── Init ────────────────────────────────────────────────────────────────────── + +document.addEventListener('DOMContentLoaded', async () => { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + const stickyPill = document.getElementById('sticky-pill'); + const errorState = document.getElementById('error-state'); + + try { + await loadData(); + + // Build sticky header pill + buildStickyPill(stickyPill); + + // Wire export buttons + const exportBtn = document.getElementById('export-md-btn'); + if (exportBtn) { + exportBtn.style.display = ''; + exportBtn.addEventListener('click', downloadMarkdownReport); + } + const exportPdfBtn = document.getElementById('export-pdf-btn'); + if (exportPdfBtn) { + exportPdfBtn.style.display = ''; + exportPdfBtn.addEventListener('click', downloadPdfReport); + } + const exportLoadingCsvBtn = document.getElementById('export-loading-csv-btn'); + if (exportLoadingCsvBtn) { + exportLoadingCsvBtn.style.display = ''; + exportLoadingCsvBtn.addEventListener('click', downloadLoadingCsv); + } + const exportQueryCsvBtn = document.getElementById('export-query-csv-btn'); + if (exportQueryCsvBtn) { + exportQueryCsvBtn.style.display = ''; + exportQueryCsvBtn.addEventListener('click', downloadQueryCsv); + } + + // Build engine filter bar + const engineBar = document.getElementById('engine-bar'); + buildEngineBar(engineBar, mainContent, tabBar); + + // Build tab bar + buildTabBar(tabBar); + + // Render initial tab + const hash = window.location.hash.replace('#', ''); + const initialTab = TABS.find(t => t.id === hash) ? hash : 'overview'; + switchTab(initialTab, mainContent, tabBar); + + } catch (err) { + console.error('Failed to load data:', err); + if (mainContent) mainContent.style.display = 'none'; + if (errorState) { + errorState.style.display = 'block'; + const errMsg = errorState.querySelector('.error-message'); + if (errMsg) errMsg.textContent = err.message; + } + } + + // Export JSON button + const exportJsonBtn = document.getElementById('export-json-btn'); + if (exportJsonBtn && state.rawData) { + exportJsonBtn.style.display = ''; + exportJsonBtn.addEventListener('click', () => { + const blob = new Blob([JSON.stringify(state.rawData, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `corese-benchmark-${new Date().toISOString().slice(0, 10)}.json`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + }); + } +}); + +function buildTabBar(tabBar) { + if (!tabBar) return; + tabBar.innerHTML = ''; + + TABS.forEach(tab => { + const btn = document.createElement('button'); + btn.className = 'tab-btn'; + btn.textContent = tab.label; + btn.dataset.tab = tab.id; + btn.addEventListener('click', () => { + const mainContent = document.getElementById('main-content'); + switchTab(tab.id, mainContent, tabBar); + }); + tabBar.appendChild(btn); + }); +} + +function switchTab(tabId, mainContent, tabBar) { + state.activeTab = tabId; + + // Update URL hash + window.location.hash = tabId; + + // Update tab buttons + if (tabBar) { + tabBar.querySelectorAll('.tab-btn').forEach(btn => { + btn.classList.toggle('active', btn.dataset.tab === tabId); + }); + } + + // Destroy all existing charts + Object.keys(state.charts).forEach(key => { + if (state.charts[key]) { + state.charts[key].destroy(); + delete state.charts[key]; + } + }); + + // Render page + const tab = TABS.find(t => t.id === tabId); + if (tab && mainContent) { + tab.render(mainContent); + } +} + +function buildStickyPill(pillEl) { + if (!pillEl || !state.data) return; + + const env = state.data.metadata.environment || {}; + const protocol = state.data.metadata.protocol || {}; + + const parts = []; + + // Location — derive from context + parts.push('\ud83d\udccd Inria SED Sophia'); + + // CPU + if (env.cpuCores && env.cpuThreads) { + parts.push(`${env.cpuCores}c/${env.cpuThreads}t CPU`); + } + + // RAM + if (env.ramTotalGb) { + parts.push(`${env.ramTotalGb} GB RAM`); + } + + // OS + if (env.osKernel) { + const kernelShort = env.osKernel.replace(/-generic$/, '').replace(/^Linux /, ''); + parts.push(`Linux ${kernelShort}`); + } else if (env.osDistribution) { + parts.push(env.osDistribution); + } + + // JVM + if (env.jvmVersion) { + const jdkVersion = env.jvmVersion.match(/^(\d+)/); + const flags = env.jvmFlags ? env.jvmFlags.filter(f => f.startsWith('-X')).join(' ') : ''; + parts.push(`OpenJDK ${jdkVersion ? jdkVersion[1] : '?'}${flags ? ` (${flags})` : ''}`); + } + + // Protocol + if (protocol.warmup != null && protocol.repetitions) { + parts.push(`Protocol: Warmup + ${protocol.repetitions} Reps (Median)`); + } + + pillEl.textContent = parts.join(' \u00b7 '); + + // Click -> navigate to transparency tab + pillEl.style.cursor = 'pointer'; + pillEl.addEventListener('click', () => { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + switchTab('transparency', mainContent, tabBar); + }); +} + +function buildEngineBar(engineBar, mainContent, tabBar) { + if (!engineBar || !state.data) return; + engineBar.innerHTML = ''; + + let dragSrc = null; + + state.engines.forEach(engineId => { + const eng = state.data.engines.find(e => e.id === engineId); + const label = eng ? eng.label : engineId; + const color = getEngineColor(engineId); + + const btn = document.createElement('button'); + btn.dataset.engine = engineId; + btn.style.setProperty('--engine-color', color); + btn.draggable = true; + + function updateBtn() { + const isActive = state.activeEngines.includes(engineId); + btn.className = 'engine-btn' + (isActive ? ' active' : ''); + btn.innerHTML = isActive + ? `${label} \u00d7` + : `+ ${label}`; + btn.title = isActive ? `Hide ${label}` : `Show ${label}`; + } + + updateBtn(); + + btn.addEventListener('click', () => { + const isActive = state.activeEngines.includes(engineId); + if (isActive && state.activeEngines.length === 1) return; + + state.activeEngines = isActive + ? state.activeEngines.filter(e => e !== engineId) + : [...state.activeEngines, engineId]; + + updateBtn(); + + const tab = TABS.find(t => t.id === state.activeTab); + if (tab && mainContent) tab.render(mainContent); + }); + + // ── Drag & drop reorder ────────────────────────────────────────────────── + btn.addEventListener('dragstart', (e) => { + dragSrc = btn; + e.dataTransfer.effectAllowed = 'move'; + btn.classList.add('dragging'); + }); + btn.addEventListener('dragend', () => { + btn.classList.remove('dragging'); + engineBar.querySelectorAll('.engine-btn').forEach(b => b.classList.remove('drag-over')); + }); + btn.addEventListener('dragover', (e) => { + e.preventDefault(); + e.dataTransfer.dropEffect = 'move'; + if (btn !== dragSrc) btn.classList.add('drag-over'); + }); + btn.addEventListener('dragleave', () => { + btn.classList.remove('drag-over'); + }); + btn.addEventListener('drop', (e) => { + e.preventDefault(); + btn.classList.remove('drag-over'); + if (!dragSrc || dragSrc === btn) return; + + // Reorder in DOM + const btns = [...engineBar.querySelectorAll('.engine-btn')]; + const srcIdx = btns.indexOf(dragSrc); + const tgtIdx = btns.indexOf(btn); + if (srcIdx < tgtIdx) engineBar.insertBefore(dragSrc, btn.nextSibling); + else engineBar.insertBefore(dragSrc, btn); + + // Sync state.engines and state.activeEngines to new DOM order + const newOrder = [...engineBar.querySelectorAll('.engine-btn')].map(b => b.dataset.engine); + state.engines = newOrder; + state.activeEngines = newOrder.filter(e => state.activeEngines.includes(e)); + + // Re-render current tab + const tab = TABS.find(t => t.id === state.activeTab); + if (tab && mainContent) tab.render(mainContent); + }); + + engineBar.appendChild(btn); + }); +} + +// Handle hash changes +window.addEventListener('hashchange', () => { + const hash = window.location.hash.replace('#', ''); + const tab = TABS.find(t => t.id === hash); + if (tab && tab.id !== state.activeTab) { + const mainContent = document.getElementById('main-content'); + const tabBar = document.getElementById('tab-bar'); + switchTab(tab.id, mainContent, tabBar); + } +}); + + +})(); diff --git a/site/js/chart-expand.js b/site/js/chart-expand.js new file mode 100644 index 0000000..912016b --- /dev/null +++ b/site/js/chart-expand.js @@ -0,0 +1,88 @@ +// chart-expand.js — Fullscreen expand + PNG download buttons for chart boxes +'use strict'; + +import state from './state.js'; + +function collapseChart(box) { + box.classList.remove('chart-fullscreen'); + const backdrop = document.querySelector('.chart-backdrop'); + if (backdrop) backdrop.remove(); + const canvas = box.querySelector('canvas'); + if (canvas && canvas.id && state.charts[canvas.id]) { + setTimeout(() => state.charts[canvas.id].resize(), 50); + } +} + +function downloadChartPng(chartBox) { + const canvas = chartBox.querySelector('canvas'); + if (!canvas) return; + + // Draw chart onto a white-background offscreen canvas for clean PNG + const offscreen = document.createElement('canvas'); + offscreen.width = canvas.width; + offscreen.height = canvas.height; + const ctx = offscreen.getContext('2d'); + ctx.fillStyle = '#ffffff'; + ctx.fillRect(0, 0, offscreen.width, offscreen.height); + ctx.drawImage(canvas, 0, 0); + + const title = chartBox.querySelector('h4')?.textContent || 'chart'; + const name = title.toLowerCase().replace(/[^a-z0-9]+/g, '-'); + const a = document.createElement('a'); + a.download = `corese-benchmark-${name}.png`; + a.href = offscreen.toDataURL('image/png'); + a.click(); +} + +/** + * Add expand (⛶) and download (⬇) buttons to a chart box header. + * @param {HTMLElement} chartBox - element with class chart-box + */ +export function addExpandButton(chartBox) { + if (!chartBox) return; + const header = chartBox.querySelector('.chart-box-header'); + if (!header || header.querySelector('.chart-expand-btn')) return; + + const btnGroup = document.createElement('div'); + btnGroup.className = 'chart-btn-group'; + + // Download PNG button + const dlBtn = document.createElement('button'); + dlBtn.className = 'chart-expand-btn'; + dlBtn.title = 'Download PNG'; + dlBtn.textContent = '\u2193'; // ↓ + dlBtn.addEventListener('click', (e) => { + e.stopPropagation(); + downloadChartPng(chartBox); + }); + + // Expand button + const expBtn = document.createElement('button'); + expBtn.className = 'chart-expand-btn'; + expBtn.title = 'Enlarge chart'; + expBtn.textContent = '\u26f6'; // ⛶ + + expBtn.addEventListener('click', (e) => { + e.stopPropagation(); + const isExpanded = chartBox.classList.contains('chart-fullscreen'); + + document.querySelectorAll('.chart-fullscreen').forEach(b => collapseChart(b)); + + if (!isExpanded) { + const backdrop = document.createElement('div'); + backdrop.className = 'chart-backdrop'; + backdrop.addEventListener('click', () => collapseChart(chartBox)); + document.body.appendChild(backdrop); + + chartBox.classList.add('chart-fullscreen'); + const canvas = chartBox.querySelector('canvas'); + if (canvas && canvas.id && state.charts[canvas.id]) { + setTimeout(() => state.charts[canvas.id].resize(), 50); + } + } + }); + + btnGroup.appendChild(dlBtn); + btnGroup.appendChild(expBtn); + header.appendChild(btnGroup); +} diff --git a/site/js/charts/cpu-chart.js b/site/js/charts/cpu-chart.js new file mode 100644 index 0000000..5adaac1 --- /dev/null +++ b/site/js/charts/cpu-chart.js @@ -0,0 +1,84 @@ +// cpu-chart.js — Horizontal bar chart for average CPU usage during loading +'use strict'; + +import state from '../state.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +/** + * Render CPU % horizontal bar chart. + * @param {string} canvasId + * @param {Array} loadingRuns - filtered loading runs + */ +export function renderCpuChart(canvasId, loadingRuns) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + const labels = []; + const data = []; + const bgColors = []; + const borderColors = []; + + state.activeEngines.forEach(engine => { + const runs = loadingRuns.filter(r => r.engine === engine && r.cpuPercent != null); + if (runs.length === 0) return; + const avg = runs.reduce((s, r) => s + r.cpuPercent, 0) / runs.length; + labels.push(getEngineLabel(engine)); + data.push(+avg.toFixed(1)); + bgColors.push(getEngineColor(engine) + 'cc'); + borderColors.push(getEngineColor(engine)); + }); + + if (data.length === 0) return null; + + const chart = new Chart(ctx, { + type: 'bar', + data: { + labels, + datasets: [{ + label: 'Avg CPU (%)', + data, + backgroundColor: bgColors, + borderColor: borderColors, + borderWidth: 1, + }], + }, + options: { + indexAxis: 'y', + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + tooltip: { + callbacks: { + label: ctx => `${ctx.parsed.x.toFixed(1)} %`, + }, + }, + }, + scales: { + x: { + min: 0, + max: 100, + title: { display: true, text: 'CPU Usage (%)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v + '%' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + ticks: { color: '#8b949e' }, + grid: { display: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + +export default renderCpuChart; diff --git a/site/js/charts/loading-chart.js b/site/js/charts/loading-chart.js new file mode 100644 index 0000000..9251042 --- /dev/null +++ b/site/js/charts/loading-chart.js @@ -0,0 +1,169 @@ +// loading-chart.js — Bi-axis loading chart (heap memory + triples loaded over time) +'use strict'; + +import state from '../state.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +/** + * Render bi-axis loading chart on a canvas. + * X = elapsed time (s), Y1 = heap used (MB), Y2 = triples loaded (cumulative) + * @param {string} canvasId + * @param {string} dataset + * @returns {Chart|null} + */ +export function renderLoadingChart(canvasId, dataset) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + // Destroy previous instance + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + // Collect timeSeries data for this dataset + const datasets = []; + state.activeEngines.forEach(engineId => { + const key = `${engineId}::${dataset}`; + const ts = state.data.timeSeries[key]; + if (!ts || ts.length === 0) return; + + const color = getEngineColor(engineId); + const label = getEngineLabel(engineId); + + // Heap line (Y1 - left axis) + datasets.push({ + label: `${label} - Heap (MB)`, + data: ts.map(p => ({ x: p.elapsedMs / 1000, y: p.heapUsedMb })), + borderColor: color, + backgroundColor: color + '33', + borderWidth: 2, + pointRadius: 2, + fill: false, + yAxisID: 'y1', + tension: 0.3, + }); + + // Triples line (Y2 - right axis) + datasets.push({ + label: `${label} - Triples`, + data: ts.map(p => ({ x: p.elapsedMs / 1000, y: p.triplesLoaded })), + borderColor: color, + backgroundColor: color + '15', + borderWidth: 2, + borderDash: [5, 3], + pointRadius: 0, + fill: true, + yAxisID: 'y2', + tension: 0.3, + }); + }); + + // Fallback: no timeSeries data (v1 format) → bar chart of loading times + if (datasets.length === 0) { + const barLabels = []; + const barValues = []; + const barColors = []; + state.activeEngines.forEach(engineId => { + const run = state.data.loadingRuns.find(r => r.engine === engineId && r.dataset === dataset); + if (!run) return; + barLabels.push(getEngineLabel(engineId)); + barValues.push(run.loadingTimeMs); + barColors.push(getEngineColor(engineId)); + }); + if (barLabels.length === 0) return null; + const chart = new Chart(ctx, { + type: 'bar', + data: { + labels: barLabels, + datasets: [{ + label: 'Loading Time (ms)', + data: barValues, + backgroundColor: barColors.map(c => c + 'cc'), + borderColor: barColors, + borderWidth: 1, + }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + tooltip: { callbacks: { label: ctx => { + const ms = ctx.parsed.y; + return `${ms >= 1000 ? (ms/1000).toFixed(1)+'s' : ms+' ms'}`; + }}}, + }, + scales: { + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + y: { + title: { display: true, text: 'Loading Time (ms)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000 ? (v/1000).toFixed(1)+'s' : v }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); + state.charts[canvasId] = chart; + return chart; + } + + const chart = new Chart(ctx, { + type: 'line', + data: { datasets }, + options: { + responsive: true, + maintainAspectRatio: false, + interaction: { + mode: 'index', + intersect: false, + }, + plugins: { + legend: { + position: 'bottom', + labels: { color: getComputedStyle(document.body).getPropertyValue('--text-main').trim() || '#e6edf3', font: { size: 11 } }, + }, + tooltip: { + callbacks: { + label: function(ctx) { + const label = ctx.dataset.label || ''; + const val = ctx.parsed.y; + if (label.includes('Heap')) return `${label}: ${val.toFixed(1)} MB`; + if (label.includes('Triples')) return `${label}: ${val.toLocaleString()}`; + return `${label}: ${val}`; + } + } + } + }, + scales: { + x: { + type: 'linear', + title: { display: true, text: 'Elapsed Time (s)', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.5)' }, + }, + y1: { + type: 'linear', + position: 'left', + title: { display: true, text: 'Heap Used (MB)', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y2: { + type: 'linear', + position: 'right', + title: { display: true, text: 'Triples Loaded', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { drawOnChartArea: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + +export default renderLoadingChart; diff --git a/site/js/charts/query-breakdown.js b/site/js/charts/query-breakdown.js new file mode 100644 index 0000000..8bbcf55 --- /dev/null +++ b/site/js/charts/query-breakdown.js @@ -0,0 +1,133 @@ +// query-breakdown.js — Grouped bar chart: median time per query per engine +'use strict'; + +import state from '../state.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +const TIMEOUT_MS = 60000; + +/** Create a diagonal hatch CanvasPattern for TIMEOUT bars */ +function createHatchPattern(ctx, color) { + const size = 8; + const pc = document.createElement('canvas'); + pc.width = size; pc.height = size; + const pctx = pc.getContext('2d'); + pctx.strokeStyle = color; + pctx.lineWidth = 1.5; + // diagonal stripe + pctx.beginPath(); pctx.moveTo(0, size); pctx.lineTo(size, 0); pctx.stroke(); + pctx.beginPath(); pctx.moveTo(-size/2, size/2); pctx.lineTo(size/2, -size/2); pctx.stroke(); + pctx.beginPath(); pctx.moveTo(size/2, size*1.5); pctx.lineTo(size*1.5, size/2); pctx.stroke(); + return ctx.createPattern(pc, 'repeat'); +} + +/** + * Render grouped bar chart: one bar per engine per query, showing median ms. + * TIMEOUT queries shown at 60000ms with diagonal hatch pattern. + * + * @param {string} canvasId + * @param {Array} queryRuns - filtered queryRuns for one dataset + * @param {Array} queryIds - ordered query IDs to display + * @param {boolean} [logScale=false] + * @returns {Chart|null} + */ +export function renderQueryBreakdown(canvasId, queryRuns, queryIds, logScale = false) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + const engines = state.activeEngines; + + const labels = queryIds.map(qid => qid.replace('query_', 'Q')); + + const datasets = engines.map(eng => { + const color = getEngineColor(eng); + const label = getEngineLabel(eng); + const data = []; + const statuses = []; + + queryIds.forEach(qid => { + const run = queryRuns.find(r => r.engine === eng && r.queryId === qid); + if (!run) { + data.push(null); + statuses.push(null); + } else if (run.status === 'TIMEOUT') { + data.push(TIMEOUT_MS); + statuses.push('TIMEOUT'); + } else { + data.push(run.medianMs || 0); + statuses.push(run.status); + } + }); + + const hatch = createHatchPattern(ctx, color); + + return { + label, + data, + backgroundColor: data.map((_, i) => statuses[i] === 'TIMEOUT' ? hatch : color + 'cc'), + borderColor: color, + borderWidth: 1, + borderRadius: 2, + _statuses: statuses, + }; + }); + + const chart = new Chart(ctx, { + type: 'bar', + data: { labels, datasets }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { + position: 'bottom', + labels: { + color: '#8b949e', + font: { size: 11 }, + boxWidth: 12, + }, + }, + tooltip: { + callbacks: { + label: function(context) { + const ds = context.dataset; + const i = context.dataIndex; + const val = context.parsed.y; + if (val === null) return `${ds.label}: N/A`; + if (ds._statuses && ds._statuses[i] === 'TIMEOUT') { + return `${ds.label}: > 60s (TIMEOUT)`; + } + return `${ds.label}: ${val.toLocaleString()} ms`; + } + } + } + }, + scales: { + x: { + ticks: { color: '#8b949e', font: { size: 11 } }, + grid: { display: false }, + }, + y: { + type: logScale ? 'logarithmic' : 'linear', + title: { display: true, text: 'ms — lower is better', color: '#8b949e' }, + ticks: { + color: '#8b949e', + callback: v => v === 0 ? '0 ms' : v.toLocaleString() + ' ms', + }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + +export default renderQueryBreakdown; diff --git a/site/js/charts/throughput-chart.js b/site/js/charts/throughput-chart.js new file mode 100644 index 0000000..bbf86b2 --- /dev/null +++ b/site/js/charts/throughput-chart.js @@ -0,0 +1,142 @@ +// throughput-chart.js — Horizontal bar chart for loading throughput with min/max error bars +'use strict'; + +import state from '../state.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +/** Inline Chart.js plugin to draw horizontal error bar whiskers */ +const errorBarPlugin = { + id: 'errorBars', + afterDatasetsDraw(chart, args, opts) { + if (!opts || !opts.bars || opts.bars.length === 0) return; + const ctx = chart.ctx; + const xScale = chart.scales.x; + const meta = chart.getDatasetMeta(0); + if (!meta || !meta.data) return; + + ctx.save(); + ctx.strokeStyle = 'rgba(200,200,210,0.85)'; + ctx.lineWidth = 2; + const CAP = 5; + + opts.bars.forEach((bar, i) => { + if (!bar) return; + const element = meta.data[i]; + if (!element) return; + const y = element.y; + const xMin = xScale.getPixelForValue(bar.min); + const xMax = xScale.getPixelForValue(bar.max); + + // Whisker line + ctx.beginPath(); ctx.moveTo(xMin, y); ctx.lineTo(xMax, y); ctx.stroke(); + // End caps + ctx.beginPath(); ctx.moveTo(xMin, y - CAP); ctx.lineTo(xMin, y + CAP); ctx.stroke(); + ctx.beginPath(); ctx.moveTo(xMax, y - CAP); ctx.lineTo(xMax, y + CAP); ctx.stroke(); + }); + + ctx.restore(); + }, +}; + +/** + * Render throughput horizontal bar chart with min/max error bars. + * @param {string} canvasId + * @param {Array} loadingRuns - filtered loading runs + */ +export function renderThroughputChart(canvasId, loadingRuns) { + const canvas = document.getElementById(canvasId); + if (!canvas) return null; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const ctx = canvas.getContext('2d'); + + // Group by engine + const engineData = {}; + loadingRuns.forEach(r => { + if (!state.activeEngines.includes(r.engine)) return; + if (!engineData[r.engine]) engineData[r.engine] = []; + engineData[r.engine].push(r); + }); + + const labels = []; + const data = []; + const bgColors = []; + const borderColors = []; + const errorBars = []; + + Object.entries(engineData).forEach(([engine, runs]) => { + const avgThroughput = runs.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / runs.length; + + // Compute per-repetition throughputs for min/max whiskers + const allRepThroughputs = runs.flatMap(r => { + if (!r.repetitionsMs || !r.triples) return []; + return r.repetitionsMs.filter(ms => ms > 0).map(ms => r.triples / (ms / 1000)); + }); + + labels.push(getEngineLabel(engine)); + data.push(Math.round(avgThroughput)); + bgColors.push(getEngineColor(engine) + 'cc'); + borderColors.push(getEngineColor(engine)); + + errorBars.push(allRepThroughputs.length >= 2 ? { + min: Math.round(Math.min(...allRepThroughputs)), + max: Math.round(Math.max(...allRepThroughputs)), + } : null); + }); + + if (data.length === 0) return null; + + const chart = new Chart(ctx, { + type: 'bar', + plugins: [errorBarPlugin], + data: { + labels, + datasets: [{ + label: 'Throughput (triples/s)', + data, + backgroundColor: bgColors, + borderColor: borderColors, + borderWidth: 1, + }], + }, + options: { + indexAxis: 'y', + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + errorBars: { bars: errorBars }, + tooltip: { + callbacks: { + label(ctx) { + const bar = errorBars[ctx.dataIndex]; + let line = `Avg: ${ctx.parsed.x.toLocaleString()} t/s`; + if (bar) line += ` | Min: ${bar.min.toLocaleString()} Max: ${bar.max.toLocaleString()}`; + return line; + }, + }, + }, + }, + scales: { + x: { + title: { display: true, text: 'Throughput (triples/s)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v.toLocaleString() }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + ticks: { color: '#8b949e' }, + grid: { display: false }, + }, + }, + }, + }); + + state.charts[canvasId] = chart; + return chart; +} + +export default renderThroughputChart; diff --git a/site/js/components/result-dialog.js b/site/js/components/result-dialog.js new file mode 100644 index 0000000..745987c --- /dev/null +++ b/site/js/components/result-dialog.js @@ -0,0 +1,184 @@ +// result-dialog.js — Modal dialog for inspecting query results (diff inspector) +'use strict'; + +import { fmt, fmtMs, escapeHtml } from '../formatters.js'; +import { getEngineLabel, getQueryMeta } from '../data-loader.js'; +import { createStatusBadge } from './status-badge.js'; + +let dialogEl = null; + +function ensureDialog() { + if (dialogEl) return dialogEl; + + dialogEl = document.createElement('dialog'); + dialogEl.className = 'result-dialog'; + dialogEl.addEventListener('click', (e) => { + if (e.target === dialogEl) dialogEl.close(); + }); + + document.body.appendChild(dialogEl); + return dialogEl; +} + +/** + * Open the result inspection dialog for a query run. + * @param {object} run - normalized queryRun + */ +export function openResultDialog(run) { + const dialog = ensureDialog(); + dialog.innerHTML = ''; + + const inner = document.createElement('div'); + inner.className = 'result-dialog-inner'; + + // Header + const header = document.createElement('div'); + header.className = 'result-dialog-header'; + + const title = document.createElement('h3'); + title.textContent = `${run.queryId} \u2014 ${getEngineLabel(run.engine)}`; + header.appendChild(title); + + const badge = createStatusBadge(run.status); + header.appendChild(badge); + + const closeBtn = document.createElement('button'); + closeBtn.className = 'dialog-close-btn'; + closeBtn.textContent = '\u2715'; + closeBtn.addEventListener('click', () => dialog.close()); + header.appendChild(closeBtn); + + inner.appendChild(header); + + // Query metadata + const queryMeta = getQueryMeta(run.dataset, run.queryId); + + // SPARQL query display (XSS-safe: textContent only) + if (queryMeta && queryMeta.sparql) { + const sparqlSection = document.createElement('div'); + sparqlSection.className = 'result-dialog-section'; + + const sparqlLabel = document.createElement('h4'); + sparqlLabel.textContent = 'SPARQL Query'; + sparqlSection.appendChild(sparqlLabel); + + const pre = document.createElement('pre'); + pre.className = 'sparql-display'; + const code = document.createElement('code'); + code.textContent = queryMeta.sparql; // XSS-safe + pre.appendChild(code); + sparqlSection.appendChild(pre); + inner.appendChild(sparqlSection); + } + + // Results comparison — only shown when at least one value is available (v2 data) + const expectedRows = queryMeta ? queryMeta.expectedRowCount : null; + const expectedHash = queryMeta ? queryMeta.expectedHash : null; + const hasComparisonData = expectedRows != null || run.rowCount != null || expectedHash || run.hash; + + if (hasComparisonData) { + const compSection = document.createElement('div'); + compSection.className = 'result-dialog-section'; + + const compLabel = document.createElement('h4'); + compLabel.textContent = 'Result Comparison'; + compSection.appendChild(compLabel); + + const grid = document.createElement('div'); + grid.className = 'result-dialog-grid'; + + addComparisonRow(grid, 'Row Count', + expectedRows != null ? fmt(expectedRows) : '\u2014', + run.rowCount != null ? fmt(run.rowCount) : '\u2014', + expectedRows != null && run.rowCount !== expectedRows + ); + + addComparisonRow(grid, 'Result Hash (SHA-256)', + expectedHash || '\u2014', + run.hash || '\u2014', + expectedHash != null && run.hash !== expectedHash + ); + + compSection.appendChild(grid); + inner.appendChild(compSection); + } + + // Metrics + const metricsSection = document.createElement('div'); + metricsSection.className = 'result-dialog-section'; + + const metricsLabel = document.createElement('h4'); + metricsLabel.textContent = 'Execution Metrics'; + metricsSection.appendChild(metricsLabel); + + const metricsList = document.createElement('dl'); + metricsList.className = 'result-dialog-metrics'; + + addMetric(metricsList, 'Median Time', fmtMs(run.medianMs)); + addMetric(metricsList, 'TTFR', run.medianTtfrMs === -1 ? '\u2014' : fmtMs(run.medianTtfrMs)); + addMetric(metricsList, 'Repetitions (ms)', Array.isArray(run.repetitionsMs) && run.repetitionsMs.length ? run.repetitionsMs.join(', ') : '\u2014'); + + if (run.errorMessage) { + const errSection = document.createElement('div'); + errSection.className = 'result-dialog-error'; + const errLabel = document.createElement('strong'); + errLabel.textContent = 'Error: '; + errSection.appendChild(errLabel); + const errMsg = document.createElement('span'); + errMsg.textContent = run.errorMessage; // XSS-safe + errSection.appendChild(errMsg); + metricsSection.appendChild(errSection); + } + + metricsSection.appendChild(metricsList); + inner.appendChild(metricsSection); + + dialog.appendChild(inner); + dialog.showModal(); +} + +function addComparisonRow(grid, label, expected, actual, isMismatch) { + const row = document.createElement('div'); + row.className = 'comparison-row' + (isMismatch ? ' mismatch' : ''); + + const lbl = document.createElement('div'); + lbl.className = 'comparison-label'; + lbl.textContent = label; + + const exp = document.createElement('div'); + exp.className = 'comparison-expected'; + const expLabel = document.createElement('small'); + expLabel.textContent = 'Expected: '; + exp.appendChild(expLabel); + const expVal = document.createElement('span'); + expVal.className = 'font-mono'; + expVal.textContent = expected; + exp.appendChild(expVal); + + const act = document.createElement('div'); + act.className = 'comparison-actual'; + const actLabel = document.createElement('small'); + actLabel.textContent = 'Actual: '; + act.appendChild(actLabel); + const actVal = document.createElement('span'); + actVal.className = 'font-mono'; + actVal.textContent = actual; + act.appendChild(actVal); + + row.appendChild(lbl); + row.appendChild(exp); + row.appendChild(act); + grid.appendChild(row); +} + +function addMetric(dl, label, value) { + const dt = document.createElement('dt'); + dt.textContent = label; + dl.appendChild(dt); + const dd = document.createElement('dd'); + dd.textContent = value; + dd.className = 'font-mono'; + dl.appendChild(dd); +} + +export default openResultDialog; diff --git a/site/js/components/result-table.js b/site/js/components/result-table.js new file mode 100644 index 0000000..30747f5 --- /dev/null +++ b/site/js/components/result-table.js @@ -0,0 +1,248 @@ +// result-table.js — Interactive sortable result tables +'use strict'; + +import { fmt, fmtMs, fmtThroughput, fmtMemory, computeCV } from '../formatters.js'; +import { createStatusBadge } from './status-badge.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +/** + * Build a loading runs table inside a container element. + * @param {HTMLElement} container + * @param {Array} runs - normalized loadingRuns + */ +export function buildLoadingTable(container, runs) { + container.innerHTML = ''; + + const COLS = [ + { label: 'Engine', key: r => getEngineLabel(r.engine), fmt: r => getEngineLabel(r.engine), cls: '' }, + { label: 'Dataset', key: r => r.dataset, fmt: r => r.dataset, cls: '' }, + { label: 'File', key: r => r.file || '', fmt: r => r.file || '\u2014', cls: '' }, + { label: 'Triples', key: r => r.triples || 0, fmt: r => fmt(r.triples), cls: 'text-right font-mono' }, + { label: 'Median Time', key: r => r.loadingTimeMs || 0, fmt: r => fmtMs(r.loadingTimeMs), cls: 'text-right font-mono' }, + { label: 'Throughput', key: r => r.throughputTriplesPerSec || 0, fmt: r => fmtThroughput(r.throughputTriplesPerSec), cls: 'text-right font-mono' }, + { label: 'Heap \u0394', key: r => r.memoryDeltaMb != null ? r.memoryDeltaMb : -Infinity, fmt: r => fmtMemory(r.memoryDeltaMb), cls: 'text-right font-mono' }, + { label: 'CPU %', key: r => r.cpuPercent != null ? r.cpuPercent : -Infinity, fmt: r => r.cpuPercent != null ? r.cpuPercent.toFixed(1) + '%' : '\u2014', cls: 'text-right font-mono' }, + { label: 'Repetitions', key: null, fmt: r => r.repetitionsMs ? r.repetitionsMs.map(v => fmt(v)).join(', ') : '\u2014', cls: 'font-mono' }, + { label: 'CV (%)', key: r => computeCV(r.repetitionsMs) ?? -Infinity, fmt: r => computeCV(r.repetitionsMs) != null ? computeCV(r.repetitionsMs).toFixed(1) + '%' : '\u2014', cls: 'text-right font-mono' }, + ]; + + let sortCol = null; + let sortAsc = true; + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + + const table = document.createElement('table'); + table.className = 'data-table'; + + // Header + const thead = document.createElement('thead'); + const headerRow = document.createElement('tr'); + const thEls = COLS.map((col, i) => { + const th = document.createElement('th'); + th.className = col.cls.includes('text-right') ? 'text-right' : ''; + if (col.key) { + th.classList.add('sortable'); + th.style.cursor = 'pointer'; + th.addEventListener('click', () => { + if (sortCol === i) { sortAsc = !sortAsc; } + else { sortCol = i; sortAsc = true; } + renderBody(); + updateHeaders(); + }); + } + th.innerHTML = `${col.label} `; + headerRow.appendChild(th); + return th; + }); + thead.appendChild(headerRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + table.appendChild(tbody); + + function updateHeaders() { + thEls.forEach((th, i) => { + const icon = th.querySelector('.sort-icon'); + if (!icon) return; + icon.textContent = sortCol === i ? (sortAsc ? ' \u25b2' : ' \u25bc') : ''; + }); + } + + function renderBody() { + tbody.innerHTML = ''; + let sorted = [...runs]; + if (sortCol !== null && COLS[sortCol].key) { + const keyFn = COLS[sortCol].key; + sorted.sort((a, b) => { + const va = keyFn(a), vb = keyFn(b); + if (typeof va === 'string') return sortAsc ? va.localeCompare(vb) : vb.localeCompare(va); + return sortAsc ? va - vb : vb - va; + }); + } + sorted.forEach(r => { + const tr = document.createElement('tr'); + COLS.forEach(col => { + const td = document.createElement('td'); + td.textContent = col.fmt(r); + if (col.cls) td.className = col.cls; + tr.appendChild(td); + }); + tr.style.borderLeft = `3px solid ${getEngineColor(r.engine)}`; + tbody.appendChild(tr); + }); + } + + renderBody(); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} + +/** + * Build a loading table preceded by an All / Best-per-file filter bar. + * @param {HTMLElement} container + * @param {Array} allRuns - normalized loadingRuns + */ +export function buildLoadingTableWithFilter(container, allRuns) { + container.innerHTML = ''; + + // Compute best (lowest loadingTimeMs) per (dataset, file) + function getBest(runs) { + const best = {}; + runs.forEach(r => { + const key = `${r.dataset}::${r.file || ''}`; + if (!best[key] || r.loadingTimeMs < best[key].loadingTimeMs) best[key] = r; + }); + return Object.values(best); + } + + let tableFilter = 'all'; + + const LOADING_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per File' }, + ]; + + const filterBar = document.createElement('div'); + filterBar.className = 'table-filter-bar'; + + const tableContainer = document.createElement('div'); + + const btns = LOADING_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + btns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + render(); + }); + filterBar.appendChild(btn); + return btn; + }); + + function render() { + const runs = tableFilter === 'best' ? getBest(allRuns) : allRuns; + buildLoadingTable(tableContainer, runs); + } + + container.appendChild(filterBar); + container.appendChild(tableContainer); + render(); +} + +/** + * Build a query runs table with status badges. + * @param {HTMLElement} container + * @param {Array} runs - normalized queryRuns + * @param {Function} onBadgeClick - callback(run) when badge is clicked + */ +export function buildQueryTable(container, runs, onBadgeClick) { + container.innerHTML = ''; + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + + const table = document.createElement('table'); + table.className = 'data-table'; + + // Header + const thead = document.createElement('thead'); + const headerRow = document.createElement('tr'); + ['Engine', 'Query', 'Status', 'Median (ms)', 'TTFR (ms)', 'Rows', 'Repetitions'].forEach(h => { + const th = document.createElement('th'); + th.textContent = h; + if (['Median (ms)', 'TTFR (ms)', 'Rows'].includes(h)) { + th.className = 'text-right'; + } + headerRow.appendChild(th); + }); + thead.appendChild(headerRow); + table.appendChild(thead); + + // Body + const tbody = document.createElement('tbody'); + runs.forEach(r => { + const tr = document.createElement('tr'); + + // Engine + const tdEngine = document.createElement('td'); + tdEngine.textContent = getEngineLabel(r.engine); + tr.appendChild(tdEngine); + + // Query + const tdQuery = document.createElement('td'); + tdQuery.textContent = r.queryId; + tdQuery.className = 'font-mono'; + tr.appendChild(tdQuery); + + // Status badge + const tdStatus = document.createElement('td'); + const badge = createStatusBadge(r.status, { + clickable: true, + onClick: () => onBadgeClick && onBadgeClick(r), + }); + tdStatus.appendChild(badge); + tr.appendChild(tdStatus); + + // Median + const tdMedian = document.createElement('td'); + tdMedian.textContent = r.status === 'TIMEOUT' ? '> 60s (TIMEOUT)' : fmtMs(r.medianMs); + tdMedian.className = 'text-right font-mono'; + tr.appendChild(tdMedian); + + // TTFR — display dash if -1 + const tdTtfr = document.createElement('td'); + tdTtfr.textContent = (r.medianTtfrMs == null || r.medianTtfrMs === -1) ? '\u2014' : fmtMs(r.medianTtfrMs); + tdTtfr.className = 'text-right font-mono'; + tr.appendChild(tdTtfr); + + // Rows + const tdRows = document.createElement('td'); + tdRows.textContent = fmt(r.rowCount); + tdRows.className = 'text-right font-mono'; + tr.appendChild(tdRows); + + // Repetitions + const tdReps = document.createElement('td'); + tdReps.textContent = r.repetitionsMs ? r.repetitionsMs.map(v => fmt(v)).join(', ') : '\u2014'; + tdReps.className = 'font-mono'; + tr.appendChild(tdReps); + + tr.style.borderLeft = `3px solid ${getEngineColor(r.engine)}`; + tbody.appendChild(tr); + }); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} diff --git a/site/js/components/status-badge.js b/site/js/components/status-badge.js new file mode 100644 index 0000000..f38ce6b --- /dev/null +++ b/site/js/components/status-badge.js @@ -0,0 +1,53 @@ +// status-badge.js — Render status badges (PASS, MISMATCH, TIMEOUT, ERROR) +'use strict'; + +const STATUS_STYLES = { + PASS: { bg: '#2ecc71', color: '#fff', label: 'PASS' }, + MISMATCH: { bg: '#e74c3c', color: '#fff', label: 'MISMATCH' }, + TIMEOUT: { bg: '#f39c12', color: '#fff', label: 'TIMEOUT' }, + ERROR: { bg: '#8e44ad', color: '#fff', label: 'ERROR' }, +}; + +/** + * Create a status badge element. + * @param {string} status - PASS, MISMATCH, TIMEOUT, ERROR + * @param {object} [opts] - Optional: { clickable, onClick } + * @returns {HTMLSpanElement} + */ +export function createStatusBadge(status, opts = {}) { + const style = STATUS_STYLES[status] || STATUS_STYLES.ERROR; + const span = document.createElement('span'); + span.className = 'status-badge'; + span.textContent = style.label; + span.style.cssText = ` + display: inline-block; + padding: 2px 8px; + border-radius: 4px; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.5px; + background: ${style.bg}; + color: ${style.color}; + cursor: ${opts.clickable ? 'pointer' : 'default'}; + user-select: none; + `; + + if (opts.clickable && opts.onClick) { + span.addEventListener('click', opts.onClick); + span.title = 'Click to inspect'; + } + + return span; +} + +/** + * Return status badge as HTML string (for use in innerHTML-free contexts, + * to be appended via DOM methods). + */ +export function statusBadgeHTML(status) { + const style = STATUS_STYLES[status] || STATUS_STYLES.ERROR; + // Returns a span element — caller must use textContent or DOM methods + return { label: style.label, bg: style.bg, color: style.color }; +} + +export default createStatusBadge; diff --git a/site/js/data-loader.js b/site/js/data-loader.js new file mode 100644 index 0000000..d28bf17 --- /dev/null +++ b/site/js/data-loader.js @@ -0,0 +1,277 @@ +// data-loader.js — Load and normalize benchmark JSON (v1 real + v2 mock) +'use strict'; + +import state from './state.js'; + +/** Engine color palette */ +const ENGINE_COLORS = { + 'corese': '#4472C4', + 'corese.next': '#2E75B6', + 'jena': '#ED7D31', + 'rdf4j': '#70AD47', +}; + +// Versioned overrides (e.g. corese.4.6.5 → lighter blue to distinguish from v5) +function versionedColor(engineId) { + const id = engineId.toLowerCase(); + if (id.startsWith('corese.') && id !== 'corese.next') return '#7EB3E8'; + return null; +} + +export function getEngineColor(engineId) { + if (ENGINE_COLORS[engineId]) return ENGINE_COLORS[engineId]; + const versioned = versionedColor(engineId); + if (versioned) return versioned; + const family = engineId.split('.')[0].toLowerCase(); + return ENGINE_COLORS[family] || '#8b949e'; +} + +export function getEngineLabel(engineId) { + if (!state.data) return engineId; + const eng = state.data.engines.find(e => e.id === engineId); + return eng ? eng.label : engineId; +} + +/** Try loading benchmark data: injected global → fetch JSON → fetch mock */ +export async function loadData() { + let raw = null; + let format = null; + + // 1. Prefer pre-injected data (works with file:// and GitHub Pages) + if (window.__BENCHMARK_DATA__) { + raw = window.__BENCHMARK_DATA__; + format = detectFormat(raw); + } + + // 2. Fetch real JSON (works when served over HTTP) + if (!raw) { + try { + const res = await fetch('data/benchmark-report.json'); + if (res.ok) { + raw = await res.json(); + format = detectFormat(raw); + } + } catch (_) { /* ignore */ } + } + + // 3. Fallback to mock data + if (!raw) { + try { + const res = await fetch('data/mock-report-v2.json'); + if (res.ok) { + raw = await res.json(); + format = detectFormat(raw); + } + } catch (_) { /* ignore */ } + } + + if (!raw) throw new Error('No benchmark data found'); + + state.rawData = raw; + state.dataFormat = format; + state.data = normalize(raw, format); + state.engines = state.data.engines.map(e => e.id); + state.activeEngines = [...state.engines]; + + return state.data; +} + +function detectFormat(json) { + // v2 has loadingRuns array and metadata.engines + if (json.loadingRuns && json.metadata && json.metadata.engines) return 'v2'; + // v1 has runs array + if (json.runs) return 'v1'; + // default to v2 if loadingRuns exists + if (json.loadingRuns) return 'v2'; + return 'v1'; +} + +/** + * Normalize both formats to a common internal structure: + * { + * metadata: { generatedAt, protocol, environment }, + * engines: [{ id, family, version, label }], + * loadingRuns: [{ engine, dataset, file, triples, loadingTimeMs, ... }], + * queryRuns: [{ engine, dataset, queryId, queryCategory, status, medianMs, medianTtfrMs, ... }], + * timeSeries: { "engine::dataset": [...] }, + * datasetQueries: { dataset: [{ id, category, label, sparql, expectedRowCount, expectedHash }] } + * } + */ +function normalize(raw, format) { + if (format === 'v2') return normalizeV2(raw); + return normalizeV1(raw); +} + +function normalizeV2(raw) { + const meta = raw.metadata || {}; + const env = meta.environment || {}; + const protocol = meta.protocol || {}; + + const engines = (meta.engines || []).map(e => ({ + id: e.id, + family: e.family || e.id.split('.')[0], + version: e.version || '', + label: e.label || e.id, + })); + + const loadingRuns = (raw.loadingRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + file: r.file, + triples: r.triples, + loadingTimeMs: r.loadingTimeMs, + repetitionsMs: r.repetitionsMs || [], + throughputTriplesPerSec: r.throughputTriplesPerSec, + memoryBeforeMb: r.memoryBeforeMb, + memoryAfterMb: r.memoryAfterMb, + memoryDeltaMb: r.memoryDeltaMb, // can be negative! + cpuPercent: r.cpuPercent, + })); + + // Build timeSeries map + const timeSeries = {}; + (raw.loadingRuns || []).forEach(r => { + if (r.timeSeries && r.timeSeries.length > 0) { + timeSeries[`${r.engine}::${r.dataset}`] = r.timeSeries; + } + }); + + const queryRuns = (raw.queryRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + queryId: r.queryId, + queryCategory: r.queryCategory || '', + status: r.status, + medianMs: r.medianMs, + repetitionsMs: r.repetitionsMs || [], + medianTtfrMs: r.medianTtfrMs, + repetitionsTtfrMs: r.repetitionsTtfrMs || [], + rowCount: r.rowCount, + hash: r.hash || r.resultHash || '', + errorMessage: r.errorMessage || null, + heapDeltaMb: r.heapDeltaMb, + })); + + const datasetQueries = meta.datasetQueries || {}; + + return { + metadata: { + generatedAt: meta.generatedAt, + git: meta.git || {}, + protocol, + environment: env, + }, + engines, + loadingRuns, + queryRuns, + timeSeries, + datasetQueries, + }; +} + +function normalizeV1(raw) { + const meta = raw.metadata || {}; + const protocol = meta.protocol || {}; + + // Extract engines from runs + const engineSet = new Set(); + (raw.runs || []).forEach(r => engineSet.add(r.engine)); + (raw.queryRuns || []).forEach(r => engineSet.add(r.engine)); + + const engines = [...engineSet].map(id => ({ + id, + family: id.split('.')[0], + version: id.split('.').slice(1).join('.') || '', + label: id, + })); + + // v1 "runs" -> loadingRuns + const loadingRuns = (raw.runs || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + file: r.file, + triples: r.triples, + loadingTimeMs: r.loadingTimeMs, + repetitionsMs: r.repetitionsMs || [], + throughputTriplesPerSec: r.throughputTriplesPerSec || (r.triples && r.loadingTimeMs ? r.triples / (r.loadingTimeMs / 1000) : null), + memoryBeforeMb: r.memoryBeforeMb, + memoryAfterMb: r.memoryAfterMb, + memoryDeltaMb: r.memoryDeltaMb, + cpuPercent: r.cpuPercent, + })); + + const queryRuns = (raw.queryRuns || []).map(r => ({ + engine: r.engine, + dataset: r.dataset, + queryId: r.queryId, + queryCategory: r.queryCategory || '', + status: r.status || 'PASS', // v1 only records successful runs + medianMs: r.medianMs, + repetitionsMs: r.repetitionsMs || [], + medianTtfrMs: r.medianTtfrMs != null ? r.medianTtfrMs : -1, + repetitionsTtfrMs: r.repetitionsTtfrMs || [], + rowCount: r.rowCount != null ? r.rowCount : null, + hash: r.resultHash || r.hash || '', + errorMessage: r.errorMessage || null, + heapDeltaMb: r.heapDeltaMb, + })); + + // Build environment from v1 metadata + const environment = { + cpuModel: meta.cpu || '', + cpuCores: meta.cpuCores, + cpuThreads: meta.cpuThreads, + ramTotalGb: meta.ramGb, + osDistribution: meta.os || '', + osKernel: meta.osKernel || '', + jvmVersion: meta.java || '', + jvmFlags: meta.jvmFlags || (protocol.jvmArgs ? protocol.jvmArgs : []), + }; + + return { + metadata: { + generatedAt: meta.generatedAt, + git: meta.git || {}, + protocol, + environment, + }, + engines, + loadingRuns, + queryRuns, + timeSeries: {}, + datasetQueries: meta.datasetQueries || {}, + }; +} + +/** Get unique datasets present in the data */ +export function getDatasets() { + if (!state.data) return []; + const sets = new Set(); + state.data.loadingRuns.forEach(r => sets.add(r.dataset)); + state.data.queryRuns.forEach(r => sets.add(r.dataset)); + return [...sets]; +} + +/** Filter queryRuns by dataset and optionally by engine */ +export function getQueryRuns(dataset, engines) { + if (!state.data) return []; + const eng = engines || state.activeEngines; + return state.data.queryRuns.filter(r => + r.dataset === dataset && eng.includes(r.engine) + ); +} + +/** Filter loadingRuns by dataset and optionally by engine */ +export function getLoadingRuns(dataset, engines) { + if (!state.data) return []; + const eng = engines || state.activeEngines; + return state.data.loadingRuns.filter(r => + r.dataset === dataset && eng.includes(r.engine) + ); +} + +/** Get query metadata for a dataset */ +export function getQueryMeta(dataset, queryId) { + if (!state.data || !state.data.datasetQueries[dataset]) return null; + return state.data.datasetQueries[dataset].find(q => q.id === queryId) || null; +} diff --git a/site/js/export-csv.js b/site/js/export-csv.js new file mode 100644 index 0000000..ddfb411 --- /dev/null +++ b/site/js/export-csv.js @@ -0,0 +1,75 @@ +// export-csv.js — CSV export for loading runs and query runs +'use strict'; + +import state from './state.js'; +import { getEngineLabel } from './data-loader.js'; +import { computeCV } from './formatters.js'; + +function escape(v) { + if (v == null) return ''; + const s = String(v); + return s.includes(',') || s.includes('"') || s.includes('\n') + ? '"' + s.replace(/"/g, '""') + '"' + : s; +} + +function triggerDownload(content, filename) { + const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = filename; + a.click(); + URL.revokeObjectURL(url); +} + +export function downloadLoadingCsv() { + if (!state.data) return; + const date = new Date().toISOString().slice(0, 10); + + const headers = ['engine', 'engine_label', 'dataset', 'file', 'triples', + 'loading_time_ms', 'throughput_triples_per_sec', 'memory_delta_mb', + 'cpu_percent', 'repetitions_ms', 'cv_percent']; + + const rows = state.data.loadingRuns.map(r => [ + r.engine, + getEngineLabel(r.engine), + r.dataset, + r.file || '', + r.triples, + r.loadingTimeMs, + r.throughputTriplesPerSec != null ? r.throughputTriplesPerSec.toFixed(0) : '', + r.memoryDeltaMb != null ? r.memoryDeltaMb.toFixed(2) : '', + r.cpuPercent != null ? r.cpuPercent.toFixed(1) : '', + Array.isArray(r.repetitionsMs) ? r.repetitionsMs.join(';') : '', + computeCV(r.repetitionsMs) != null ? computeCV(r.repetitionsMs).toFixed(2) : '', + ]); + + const csv = [headers, ...rows].map(row => row.map(escape).join(',')).join('\r\n'); + triggerDownload(csv, `corese-benchmark-loading-${date}.csv`); +} + +export function downloadQueryCsv() { + if (!state.data) return; + const date = new Date().toISOString().slice(0, 10); + + const headers = ['engine', 'engine_label', 'dataset', 'query_id', + 'status', 'median_ms', 'ttfr_ms', 'row_count', + 'repetitions_ms', 'hash']; + + const rows = state.data.queryRuns.map(r => [ + r.engine, + getEngineLabel(r.engine), + r.dataset, + r.queryId, + r.status, + r.medianMs, + r.medianTtfrMs != null && r.medianTtfrMs !== -1 ? r.medianTtfrMs : '', + r.rowCount != null ? r.rowCount : '', + Array.isArray(r.repetitionsMs) ? r.repetitionsMs.join(';') : '', + r.hash || '', + ]); + + const csv = [headers, ...rows].map(row => row.map(escape).join(',')).join('\r\n'); + triggerDownload(csv, `corese-benchmark-queries-${date}.csv`); +} diff --git a/site/js/export-md.js b/site/js/export-md.js new file mode 100644 index 0000000..31e9407 --- /dev/null +++ b/site/js/export-md.js @@ -0,0 +1,165 @@ +// export-md.js — Generate and download a Markdown benchmark report +'use strict'; + +import state from './state.js'; +import { getEngineLabel } from './data-loader.js'; +import { fmtMs, fmtThroughput, fmtMemory } from './formatters.js'; + +export function downloadMarkdownReport() { + if (!state.data) return; + + const md = buildMarkdown(); + const blob = new Blob([md], { type: 'text/markdown; charset=utf-8' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `corese-benchmark-report-${new Date().toISOString().slice(0, 10)}.md`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); +} + +function buildMarkdown() { + const data = state.data; + const meta = data.metadata; + const env = meta.environment || {}; + const protocol = meta.protocol || {}; + const engines = state.activeEngines; + const lines = []; + + // ── Header ──────────────────────────────────────────────────────────────── + lines.push('# Corese Benchmark Report'); + lines.push(''); + lines.push(`> Generated: ${meta.generatedAt || new Date().toISOString()}`); + if (meta.git && meta.git.benchmarkCommit) { + lines.push(`> Commit: \`${meta.git.benchmarkCommit}\` (${meta.git.branch || 'main'})`); + } + lines.push(''); + + // ── Environment ─────────────────────────────────────────────────────────── + lines.push('## Environment'); + lines.push(''); + lines.push('| Property | Value |'); + lines.push('|----------|-------|'); + if (env.cpuModel) lines.push(`| CPU | ${env.cpuModel} |`); + if (env.cpuCores) lines.push(`| Cores / Threads | ${env.cpuCores}c / ${env.cpuThreads}t |`); + if (env.ramTotalGb) lines.push(`| RAM | ${env.ramTotalGb} GB |`); + if (env.osDistribution) lines.push(`| OS | ${env.osDistribution} |`); + if (env.osKernel) lines.push(`| Kernel | ${env.osKernel} |`); + if (env.jvmVersion) lines.push(`| JVM | ${env.jvmVersion} |`); + if (env.jvmFlags && Array.isArray(env.jvmFlags)) lines.push(`| JVM Flags | \`${env.jvmFlags.join(' ')}\` |`); + lines.push(''); + + // ── Protocol ────────────────────────────────────────────────────────────── + lines.push('## Protocol'); + lines.push(''); + lines.push(`- Warmup: ${protocol.warmup ?? 1} run`); + lines.push(`- Repetitions: ${protocol.repetitions ?? 3}`); + lines.push(`- Metric: ${protocol.metric || 'median'}`); + lines.push(`- Query timeout: ${(protocol.queryTimeoutMs || 60000) / 1000}s`); + lines.push(`- Load timeout: ${(protocol.loadTimeoutMs || 120000) / 1000}s`); + lines.push(''); + + // ── Engines ─────────────────────────────────────────────────────────────── + lines.push('## Engines'); + lines.push(''); + lines.push('| ID | Label | Version |'); + lines.push('|----|-------|---------|'); + (data.engines || []).filter(e => engines.includes(e.id)).forEach(e => { + lines.push(`| \`${e.id}\` | ${e.label} | ${e.version || '—'} |`); + }); + lines.push(''); + + // ── Loading & Ingestion ─────────────────────────────────────────────────── + const datasets = [...new Set(data.loadingRuns.map(r => r.dataset))]; + + lines.push('## Loading & Ingestion'); + lines.push(''); + + datasets.forEach(ds => { + lines.push(`### ${ds}`); + lines.push(''); + lines.push('| Engine | File | Triples | Median Time | Throughput | Heap Δ |'); + lines.push('|--------|------|---------|-------------|------------|--------|'); + data.loadingRuns + .filter(r => r.dataset === ds && engines.includes(r.engine)) + .forEach(r => { + lines.push(`| ${getEngineLabel(r.engine)} | ${r.file || '—'} | ${(r.triples || 0).toLocaleString()} | ${fmtMs(r.loadingTimeMs)} | ${fmtThroughput(r.throughputTriplesPerSec)} | ${fmtMemory(r.memoryDeltaMb)} |`); + }); + lines.push(''); + }); + + // ── Query Results per dataset ───────────────────────────────────────────── + const queryDatasets = [...new Set(data.queryRuns.map(r => r.dataset))]; + + lines.push('## Query Results'); + lines.push(''); + + queryDatasets.forEach(ds => { + lines.push(`### ${ds}`); + lines.push(''); + + const queryIds = [...new Set( + data.queryRuns.filter(r => r.dataset === ds).map(r => r.queryId) + )].sort((a, b) => { + const na = parseInt(a.replace(/\D/g, '')); + const nb = parseInt(b.replace(/\D/g, '')); + return na - nb; + }); + + // Header: Query | Engine1 | Engine2 | ... + const engLabels = engines.map(e => getEngineLabel(e)); + lines.push(`| Query | ${engLabels.join(' | ')} |`); + lines.push(`|-------|${engines.map(() => '----').join('|')}|`); + + queryIds.forEach(qid => { + const cells = engines.map(eng => { + const run = data.queryRuns.find(r => r.dataset === ds && r.engine === eng && r.queryId === qid); + if (!run) return '—'; + if (run.status === 'TIMEOUT') return `\`> ${(protocol.queryTimeoutMs || 60000) / 1000}s (TIMEOUT)\``; + if (run.status !== 'PASS') return `\`${run.status}\``; + return fmtMs(run.medianMs); + }); + lines.push(`| ${qid.replace('query_', 'Q')} | ${cells.join(' | ')} |`); + }); + lines.push(''); + + // TTFR sub-table + lines.push(`**TTFR (Time To First Result) — ${ds}**`); + lines.push(''); + lines.push(`| Query | ${engLabels.join(' | ')} |`); + lines.push(`|-------|${engines.map(() => '----').join('|')}|`); + + queryIds.forEach(qid => { + const cells = engines.map(eng => { + const run = data.queryRuns.find(r => r.dataset === ds && r.engine === eng && r.queryId === qid); + if (!run || run.status !== 'PASS') return '—'; + if (run.medianTtfrMs === -1) return '—'; + return fmtMs(run.medianTtfrMs); + }); + lines.push(`| ${qid.replace('query_', 'Q')} | ${cells.join(' | ')} |`); + }); + lines.push(''); + }); + + // ── Failed Queries Summary ──────────────────────────────────────────────── + const failed = data.queryRuns.filter(r => engines.includes(r.engine) && r.status !== 'PASS'); + if (failed.length > 0) { + lines.push('## Failures & Timeouts'); + lines.push(''); + lines.push('| Engine | Dataset | Query | Status | Message |'); + lines.push('|--------|---------|-------|--------|---------|'); + failed.forEach(r => { + const msg = (r.errorMessage || '').replace(/\|/g, '\\|'); + lines.push(`| ${getEngineLabel(r.engine)} | ${r.dataset} | ${r.queryId.replace('query_', 'Q')} | **${r.status}** | ${msg || '—'} |`); + }); + lines.push(''); + } + + lines.push('---'); + lines.push(''); + lines.push('*Generated by [Corese Benchmark Dashboard](https://github.com/corese-stack/corese-benchmark)*'); + + return lines.join('\n'); +} diff --git a/site/js/export-pdf.js b/site/js/export-pdf.js new file mode 100644 index 0000000..a507634 --- /dev/null +++ b/site/js/export-pdf.js @@ -0,0 +1,102 @@ +// export-pdf.js — Generate and print a PDF benchmark report +'use strict'; + +import state from './state.js'; +import { getEngineLabel } from './data-loader.js'; + +export function downloadPdfReport() { + if (!state.data) return; + + const html = buildHtml(); + + let iframe = document.getElementById('_pdf-print-frame'); + if (iframe) iframe.remove(); + iframe = document.createElement('iframe'); + iframe.id = '_pdf-print-frame'; + iframe.style.cssText = 'position:fixed;top:-9999px;left:-9999px;width:1px;height:1px;border:none'; + document.body.appendChild(iframe); + iframe.contentDocument.open(); + iframe.contentDocument.write(html); + iframe.contentDocument.close(); + setTimeout(() => { iframe.contentWindow.focus(); iframe.contentWindow.print(); }, 400); +} + +function buildHtml() { + const data = state.data; + const meta = data.metadata || {}; + const env = meta.environment || {}; + const proto = meta.protocol || {}; + const engines = state.activeEngines; + const now = new Date().toISOString().slice(0, 10); + + const ENGINE_COLORS = ['#4e79a7','#f28e2b','#59a14f','#e15759','#76b7b2','#edc948','#b07aa1','#ff9da7']; + const colorMap = {}; + engines.forEach((e, i) => { colorMap[e] = ENGINE_COLORS[i % ENGINE_COLORS.length]; }); + + const th = `style="padding:6px 10px;text-align:right;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; + const th0 = `style="padding:6px 10px;text-align:left;border:1px solid #ddd;background:#f5f5f5;font-weight:600"`; + const td = `style="padding:5px 10px;text-align:right;border:1px solid #ddd"`; + const td0 = `style="padding:5px 10px;text-align:left;border:1px solid #ddd;font-family:monospace"`; + const tdW = `style="padding:5px 10px;text-align:right;border:1px solid #ddd;font-weight:700;background:#fffbe6"`; + + function queryTable(title, runs) { + const queryIds = [...new Set(runs.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace(/\D/g,'')) - parseInt(b.replace(/\D/g,'')) + ); + const header = `Query${engines.map(e => + `${getEngineLabel(e)}` + ).join('')}Best`; + + const rows = queryIds.map(qid => { + const vals = engines.map(eng => { + const run = runs.find(r => r.engine === eng && r.queryId === qid); + if (!run) return null; + if (run.status === 'TIMEOUT') return 'TIMEOUT'; + if (run.status !== 'PASS') return run.status; + return run.medianMs; + }); + const nums = vals.map(v => (typeof v === 'number') ? v : null); + const minV = Math.min(...nums.filter(v => v !== null)); + const winIdx = isFinite(minV) ? nums.indexOf(minV) : -1; + + const cells = vals.map((v, i) => { + const style = (i === winIdx) ? tdW : td; + const disp = v === null ? '—' : typeof v === 'number' ? v.toLocaleString() + ' ms' : v; + return `${disp}`; + }).join(''); + const best = winIdx >= 0 + ? `${getEngineLabel(engines[winIdx])}` + : '—'; + return `${qid.replace('query_', 'Q')}${cells}${best}`; + }).join(''); + + return `

${title}

+ ${header}${rows}
`; + } + + const datasets = [...new Set(data.queryRuns.map(r => r.dataset))]; + const sections = datasets.map(ds => { + const runs = data.queryRuns.filter(r => r.dataset === ds && engines.includes(r.engine)); + return `

${ds}

+ ${queryTable('Median Execution Time', runs)}`; + }).join(''); + + return ` + Corese Benchmark — ${now} + + +

Corese Benchmark Report

+

Generated: ${meta.generatedAt || now}

+

CPU: ${env.cpuModel || '—'} (${env.cpuCores || '?'}c/${env.cpuThreads || '?'}t)  ·  RAM: ${env.ramTotalGb || '?'} GB

+

OS: ${env.osDistribution || '—'}  ·  JVM: ${env.jvmVersion || '—'}

+

Protocol: warmup + ${proto.repetitions || 3} repetitions, median — timeout ${(proto.queryTimeoutMs || 60000) / 1000}s

+ ${sections} +

Generated by Corese Benchmark Dashboard — ${now}

+ `; +} + +export default downloadPdfReport; diff --git a/site/js/formatters.js b/site/js/formatters.js new file mode 100644 index 0000000..fd79988 --- /dev/null +++ b/site/js/formatters.js @@ -0,0 +1,55 @@ +// formatters.js — Number, duration, throughput, memory formatting +'use strict'; + +/** Format a number with locale (fr-FR) and fixed decimal digits */ +export function fmt(n, decimals = 0) { + if (n == null || n === '') return '\u2014'; // em-dash + return Number(n).toLocaleString('fr-FR', { maximumFractionDigits: decimals }); +} + +/** Format milliseconds to human-readable string */ +export function fmtMs(ms) { + if (ms == null || ms === -1) return '\u2014'; + if (ms >= 60000) return `${(ms / 1000).toFixed(1)}s`; + if (ms >= 1000) return `${(ms / 1000).toFixed(2)}s`; + return `${fmt(ms)} ms`; +} + +/** Format throughput (triples/sec) */ +export function fmtThroughput(t) { + if (t == null) return '\u2014'; + if (t >= 1000000) return `${(t / 1000000).toFixed(2)}M t/s`; + if (t >= 1000) return `${(t / 1000).toFixed(1)}K t/s`; + return `${fmt(t)} t/s`; +} + +/** Format memory in MB — NEVER clamp to 0 (GC can produce negative) */ +export function fmtMemory(mb) { + if (mb == null) return '\u2014'; + return `${Number(mb).toFixed(1)} MB`; +} + +/** Format percentage */ +export function fmtPercent(p, decimals = 1) { + if (p == null) return '\u2014'; + return `${Number(p).toFixed(decimals)}%`; +} + +/** Coefficient of variation from array of values */ +export function computeCV(values) { + if (!values || values.length < 2) return null; + const nums = values.filter(v => v != null && v >= 0); + if (nums.length < 2) return null; + const mean = nums.reduce((a, b) => a + b, 0) / nums.length; + if (mean === 0) return 0; + const variance = nums.reduce((sum, v) => sum + (v - mean) ** 2, 0) / nums.length; + return (Math.sqrt(variance) / mean) * 100; +} + +/** Escape HTML for safe textContent-equivalent in template strings */ +export function escapeHtml(str) { + if (!str) return ''; + const div = document.createElement('div'); + div.textContent = str; + return div.innerHTML; +} diff --git a/site/js/pages/bowlogna.js b/site/js/pages/bowlogna.js new file mode 100644 index 0000000..7fbd344 --- /dev/null +++ b/site/js/pages/bowlogna.js @@ -0,0 +1,253 @@ +// bowlogna.js — Bowlogna benchmark page +'use strict'; + +import state from '../state.js'; +import { getQueryRuns, getLoadingRuns } from '../data-loader.js'; +import { buildQueryTable, buildLoadingTableWithFilter } from '../components/result-table.js'; +import { openResultDialog } from '../components/result-dialog.js'; +import { renderQueryBreakdown } from '../charts/query-breakdown.js'; +import { renderLoadingChart } from '../charts/loading-chart.js'; +import { renderThroughputChart } from '../charts/throughput-chart.js'; +import { renderCpuChart } from '../charts/cpu-chart.js'; +import { addExpandButton } from '../chart-expand.js'; + +const DATASET = 'bowlogna'; + +const FILTERS = { + all: { label: 'All (17)', queries: null }, + aggregations: { label: 'Aggregations', queries: ['query_8','query_9','query_11','query_12','query_13'] }, + complex_joins: { label: 'Complex Joins', queries: ['query_5','query_7','query_14'] }, + temporal_regex:{ label: 'Temporal & Regex', queries: ['query_3','query_4','query_6','query_10','query_16','query_17'] }, + simple_count: { label: 'Simple & Count', queries: ['query_1','query_2','query_15'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + // fallback: if no PASS for a query, show fastest non-PASS + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +export function renderBowlogna(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Bowlogna Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Academic benchmark \u2014 1.23M triples, 17 SPARQL queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A: Ingestion ─────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-bowlogna-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-bowlogna-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-bowlogna-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B: SPARQL Queries ────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + // Query-family filter bar + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + filterBar.id = 'bowlogna-filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBowlogna(); + }); + filterBar.appendChild(btn); + }); + sectionB.appendChild(filterBar); + + // TTFR chart + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-bowlogna-ttfr'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + // Table filter bar + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBowlogna(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'bowlogna-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateBowlogna(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-bowlogna-loading', DATASET); + renderThroughputChart('chart-bowlogna-throughput', runs); + renderCpuChart('chart-bowlogna-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateBowlogna() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-bowlogna-ttfr', filteredRuns, queryIds); + + const tableContainer = document.getElementById('bowlogna-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + +export default renderBowlogna; diff --git a/site/js/pages/bsbm.js b/site/js/pages/bsbm.js new file mode 100644 index 0000000..fd544cb --- /dev/null +++ b/site/js/pages/bsbm.js @@ -0,0 +1,255 @@ +// bsbm.js — BSBM benchmark page +'use strict'; + +import state from '../state.js'; +import { getQueryRuns, getLoadingRuns } from '../data-loader.js'; +import { buildQueryTable, buildLoadingTableWithFilter } from '../components/result-table.js'; +import { openResultDialog } from '../components/result-dialog.js'; +import { renderQueryBreakdown } from '../charts/query-breakdown.js'; +import { renderLoadingChart } from '../charts/loading-chart.js'; +import { renderThroughputChart } from '../charts/throughput-chart.js'; +import { renderCpuChart } from '../charts/cpu-chart.js'; +import { addExpandButton } from '../chart-expand.js'; + +const DATASET = 'bsbm'; + +const FILTERS = { + all: { label: 'All Queries (12)', queries: null }, + search_product: { label: 'Search & Product Features', queries: ['query_1','query_2','query_3','query_4'] }, + simulations: { label: 'Simulations & Joins', queries: ['query_5'] }, + reviews: { label: 'Reviews & Ratings', queries: ['query_6','query_9','query_11','query_12'] }, + offers: { label: 'Offers & Vendors', queries: ['query_7','query_8','query_10'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let logScale = false; +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +export function renderBsbm(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + logScale = false; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'BSBM Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Berlin SPARQL Benchmark \u2014 eCommerce dataset, 12 queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A ────────────────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-bsbm-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-bsbm-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-bsbm-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B ────────────────────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + filterBar.id = 'bsbm-filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn:not(.log-scale-btn)').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBsbm(); + }); + filterBar.appendChild(btn); + }); + const logBtn = document.createElement('button'); + logBtn.className = 'filter-btn log-scale-btn'; + logBtn.textContent = 'Log Scale'; + logBtn.addEventListener('click', () => { + logScale = !logScale; + logBtn.classList.toggle('active', logScale); + updateBsbm(); + }); + filterBar.appendChild(logBtn); + sectionB.appendChild(filterBar); + + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-bsbm-breakdown'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateBsbm(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'bsbm-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateBsbm(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-bsbm-loading', DATASET); + renderThroughputChart('chart-bsbm-throughput', runs); + renderCpuChart('chart-bsbm-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateBsbm() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-bsbm-breakdown', filteredRuns, queryIds, logScale); + + const tableContainer = document.getElementById('bsbm-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + +export default renderBsbm; diff --git a/site/js/pages/dbpedia.js b/site/js/pages/dbpedia.js new file mode 100644 index 0000000..a83c9bb --- /dev/null +++ b/site/js/pages/dbpedia.js @@ -0,0 +1,225 @@ +// dbpedia.js — DBpedia Scale page with file selector and bilogarithmic chart +'use strict'; + +import state from '../state.js'; +import { getLoadingRuns } from '../data-loader.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; +import { buildLoadingTableWithFilter } from '../components/result-table.js'; +import { addExpandButton } from '../chart-expand.js'; +import { renderCpuChart } from '../charts/cpu-chart.js'; + +const DATASET = 'dbpedia'; + +const DBPEDIA_FILES = [ + 'persondata_en.nt', + 'homepages_en.nt', + 'category_labels_en.nt', + 'disambiguations_en.nt', + 'specific_mappingbased_properties_en.nt', +]; + +let selectedFile = null; // null = all files + +export function renderDbpedia(container) { + container.innerHTML = ''; + selectedFile = null; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'DBpedia Scale'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Scalability testing on real-world DBpedia datasets \u2014 bilogarithmic curve (triples \u00d7 loading time).'; + container.appendChild(desc); + + // ── File selector ────────────────────────────────────────────────────────── + const fileBar = document.createElement('div'); + fileBar.className = 'filter-bar'; + + const allBtn = document.createElement('button'); + allBtn.className = 'filter-btn active'; + allBtn.textContent = 'All Files'; + allBtn.addEventListener('click', () => { + selectedFile = null; + fileBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + allBtn.classList.add('active'); + updateDbpedia(); + }); + fileBar.appendChild(allBtn); + + DBPEDIA_FILES.forEach(f => { + const btn = document.createElement('button'); + btn.className = 'filter-btn'; + btn.textContent = f.replace('_en.nt', ''); + btn.addEventListener('click', () => { + selectedFile = f; + fileBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateDbpedia(); + }); + fileBar.appendChild(btn); + }); + + container.appendChild(fileBar); + + // ── Charts row ───────────────────────────────────────────────────────────── + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row'; + + const scaleBox = document.createElement('div'); + scaleBox.className = 'chart-box'; + const sh = document.createElement('div'); sh.className = 'chart-box-header'; + const st = document.createElement('h4'); st.textContent = 'Triples vs Loading Time (log\u2013log)'; + const ss = document.createElement('span'); ss.className = 'chart-subtitle'; ss.textContent = 'bilogarithmic scale'; + sh.appendChild(st); sh.appendChild(ss); scaleBox.appendChild(sh); + const sw = document.createElement('div'); sw.className = 'chart-canvas-wrap'; + const sc = document.createElement('canvas'); sc.id = 'chart-dbpedia-scale'; + sw.appendChild(sc); scaleBox.appendChild(sw); + chartsRow.appendChild(scaleBox); + + const memBox = document.createElement('div'); + memBox.className = 'chart-box'; + const mh = document.createElement('div'); mh.className = 'chart-box-header'; + const mt = document.createElement('h4'); mt.textContent = 'Memory Efficiency (MB / M triples)'; + const ms2 = document.createElement('span'); ms2.className = 'chart-subtitle'; ms2.textContent = 'lower is better'; + mh.appendChild(mt); mh.appendChild(ms2); memBox.appendChild(mh); + const mw = document.createElement('div'); mw.className = 'chart-canvas-wrap'; + const mc = document.createElement('canvas'); mc.id = 'chart-dbpedia-memory'; + mw.appendChild(mc); memBox.appendChild(mw); + chartsRow.appendChild(memBox); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-dbpedia-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + chartsRow.appendChild(cpuBox); + + container.appendChild(chartsRow); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Loading Results'; + container.appendChild(tableTitle); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'dbpedia-table'; + container.appendChild(tableContainer); + + requestAnimationFrame(() => { + updateDbpedia(); + addExpandButton(scaleBox); + addExpandButton(memBox); + addExpandButton(cpuBox); + }); +} + +function updateDbpedia() { + let runs = getLoadingRuns(DATASET); + if (selectedFile) runs = runs.filter(r => r.file === selectedFile); + + const tableContainer = document.getElementById('dbpedia-table'); + if (tableContainer) buildLoadingTableWithFilter(tableContainer, runs); + + renderScaleChart(runs); + renderMemoryChart(runs); + renderCpuChart('chart-dbpedia-cpu', runs); +} + +function renderScaleChart(runs) { + const canvasId = 'chart-dbpedia-scale'; + const canvas = document.getElementById(canvasId); + if (!canvas) return; + if (state.charts[canvasId]) { state.charts[canvasId].destroy(); delete state.charts[canvasId]; } + + const datasets = []; + state.activeEngines.forEach(eng => { + const engRuns = runs.filter(r => r.engine === eng).sort((a, b) => a.triples - b.triples); + if (engRuns.length === 0) return; + datasets.push({ + label: getEngineLabel(eng), + data: engRuns.map(r => ({ x: r.triples, y: r.loadingTimeMs })), + borderColor: getEngineColor(eng), + backgroundColor: getEngineColor(eng) + '33', + borderWidth: 2, + pointRadius: 4, + fill: false, + tension: 0.3, + }); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'line', + data: { datasets }, + options: { + responsive: true, maintainAspectRatio: false, + plugins: { legend: { position: 'bottom', labels: { color: '#8b949e' } } }, + scales: { + x: { + type: 'logarithmic', + title: { display: true, text: 'Triples (log)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000000 ? (v / 1000000).toFixed(0) + 'M' : v >= 1000 ? (v / 1000).toFixed(0) + 'K' : v }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + y: { + type: 'logarithmic', + title: { display: true, text: 'Loading Time ms (log)', color: '#8b949e' }, + ticks: { color: '#8b949e', callback: v => v >= 1000 ? (v / 1000).toFixed(0) + 's' : v + 'ms' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); +} + +function renderMemoryChart(runs) { + const canvasId = 'chart-dbpedia-memory'; + const canvas = document.getElementById(canvasId); + if (!canvas) return; + if (state.charts[canvasId]) { state.charts[canvasId].destroy(); delete state.charts[canvasId]; } + + const files = selectedFile ? [selectedFile] : [...new Set(runs.map(r => r.file))]; + const datasets = []; + + state.activeEngines.forEach(eng => { + const engData = files.map(f => { + const run = runs.find(r => r.engine === eng && r.file === f); + if (run && run.memoryDeltaMb != null && run.triples > 0) { + return run.memoryDeltaMb / (run.triples / 1000000); // DO NOT clamp to 0 — GC can produce negative + } + return 0; + }); + datasets.push({ + label: getEngineLabel(eng), + data: engData, + backgroundColor: getEngineColor(eng) + 'cc', + borderColor: getEngineColor(eng), + borderWidth: 1, + }); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { labels: files.map(f => f.replace('_en.nt', '')), datasets }, + options: { + responsive: true, maintainAspectRatio: false, + plugins: { legend: { position: 'bottom', labels: { color: '#8b949e' } } }, + scales: { + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + y: { + title: { display: true, text: 'MB / M triples', color: '#8b949e' }, + ticks: { color: '#8b949e' }, + grid: { color: 'rgba(48,54,61,0.3)' }, + }, + }, + }, + }); +} + +export default renderDbpedia; diff --git a/site/js/pages/lubm.js b/site/js/pages/lubm.js new file mode 100644 index 0000000..1068016 --- /dev/null +++ b/site/js/pages/lubm.js @@ -0,0 +1,242 @@ +// lubm.js — LUBM benchmark page +'use strict'; + +import state from '../state.js'; +import { getQueryRuns, getLoadingRuns } from '../data-loader.js'; +import { buildQueryTable, buildLoadingTableWithFilter } from '../components/result-table.js'; +import { openResultDialog } from '../components/result-dialog.js'; +import { renderQueryBreakdown } from '../charts/query-breakdown.js'; +import { renderLoadingChart } from '../charts/loading-chart.js'; +import { renderThroughputChart } from '../charts/throughput-chart.js'; +import { renderCpuChart } from '../charts/cpu-chart.js'; +import { addExpandButton } from '../chart-expand.js'; + +const DATASET = 'lubm'; + +const FILTERS = { + all: { label: 'All Queries (14)', queries: null }, + large_results: { label: 'Large Result Sets', queries: ['query_2','query_6','query_9'] }, + selective: { label: 'Selective Graph Patterns', queries: ['query_1','query_3','query_5','query_7','query_8','query_10','query_14'] }, + transitive: { label: 'Transitive & SubOrganization', queries: ['query_4','query_11','query_12','query_13'] }, +}; + +let currentFilter = 'all'; +let tableFilter = 'all'; // 'all' | 'best' | 'pass' | 'failures' +let queriesRendered = false; + +function getBestPerQuery(runs) { + const best = {}; + runs.forEach(r => { + if (r.status === 'PASS') { + if (!best[r.queryId] || r.medianMs < best[r.queryId].medianMs) best[r.queryId] = r; + } + }); + runs.forEach(r => { if (!best[r.queryId]) best[r.queryId] = r; }); + return Object.values(best).sort((a, b) => + parseInt(a.queryId.replace('query_','')) - parseInt(b.queryId.replace('query_','')) + ); +} + +export function renderLubm(container) { + container.innerHTML = ''; + currentFilter = 'all'; + tableFilter = 'all'; + queriesRendered = false; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'LUBM Benchmark'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Lehigh University Benchmark \u2014 Inference & RDFS, 14 queries.'; + container.appendChild(desc); + + // ── Sub-navigation ───────────────────────────────────────────────────────── + const subNav = document.createElement('nav'); + subNav.className = 'subnav-bar'; + const btnA = document.createElement('button'); + btnA.className = 'subnav-btn active'; + btnA.textContent = 'Ingestion & Memory'; + const btnB = document.createElement('button'); + btnB.className = 'subnav-btn'; + btnB.textContent = 'SPARQL Queries'; + subNav.appendChild(btnA); + subNav.appendChild(btnB); + container.appendChild(subNav); + + // ── Section A ────────────────────────────────────────────────────────────── + const sectionA = document.createElement('div'); + + const loadingBox = document.createElement('div'); + loadingBox.className = 'chart-box chart-box-full'; + const lh = document.createElement('div'); lh.className = 'chart-box-header'; + const lt = document.createElement('h4'); lt.textContent = 'Heap Memory & Triples Over Time'; + const ls = document.createElement('span'); ls.className = 'chart-subtitle'; ls.textContent = 'ms \u2014 lower is better'; + lh.appendChild(lt); lh.appendChild(ls); loadingBox.appendChild(lh); + const lcw = document.createElement('div'); lcw.className = 'chart-canvas-wrap chart-canvas-tall'; + const lc = document.createElement('canvas'); lc.id = 'chart-lubm-loading'; + lcw.appendChild(lc); loadingBox.appendChild(lcw); + const tpBox = document.createElement('div'); + tpBox.className = 'chart-box'; + const th2 = document.createElement('div'); th2.className = 'chart-box-header'; + const tt2 = document.createElement('h4'); tt2.textContent = 'Average Throughput (t/s)'; + const ts2 = document.createElement('span'); ts2.className = 'chart-subtitle'; ts2.textContent = 'triples/s \u2014 higher is better'; + th2.appendChild(tt2); th2.appendChild(ts2); tpBox.appendChild(th2); + const tcw = document.createElement('div'); tcw.className = 'chart-canvas-wrap'; + const tc = document.createElement('canvas'); tc.id = 'chart-lubm-throughput'; + tcw.appendChild(tc); tpBox.appendChild(tcw); + + const cpuBox = document.createElement('div'); + cpuBox.className = 'chart-box'; + const ch2 = document.createElement('div'); ch2.className = 'chart-box-header'; + const ct2 = document.createElement('h4'); ct2.textContent = 'Average CPU Usage (%)'; + const cs2 = document.createElement('span'); cs2.className = 'chart-subtitle'; cs2.textContent = 'lower is better'; + ch2.appendChild(ct2); ch2.appendChild(cs2); cpuBox.appendChild(ch2); + const ccw = document.createElement('div'); ccw.className = 'chart-canvas-wrap'; + const cc2 = document.createElement('canvas'); cc2.id = 'chart-lubm-cpu'; + ccw.appendChild(cc2); cpuBox.appendChild(ccw); + + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row charts-row-ingestion'; + loadingBox.className = 'chart-box chart-box-wide'; + chartsRow.appendChild(loadingBox); + chartsRow.appendChild(tpBox); + chartsRow.appendChild(cpuBox); + sectionA.appendChild(chartsRow); + + const loadTableTitle = document.createElement('h4'); + loadTableTitle.className = 'table-section-title'; + loadTableTitle.textContent = 'Ingestion Results'; + sectionA.appendChild(loadTableTitle); + const loadTableContainer = document.createElement('div'); + sectionA.appendChild(loadTableContainer); + container.appendChild(sectionA); + + // ── Section B ────────────────────────────────────────────────────────────── + const sectionB = document.createElement('div'); + sectionB.style.display = 'none'; + + const filterBar = document.createElement('div'); + filterBar.className = 'filter-bar'; + Object.entries(FILTERS).forEach(([key, f]) => { + const btn = document.createElement('button'); + btn.className = 'filter-btn' + (key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + currentFilter = key; + filterBar.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateLubm(); + }); + filterBar.appendChild(btn); + }); + sectionB.appendChild(filterBar); + + const chartBox = document.createElement('div'); + chartBox.className = 'chart-box chart-box-full'; + const ch = document.createElement('div'); ch.className = 'chart-box-header'; + const ct = document.createElement('h4'); ct.textContent = 'Time per Query'; + const cs = document.createElement('span'); cs.className = 'chart-subtitle'; cs.textContent = 'ms \u2014 lower is better'; + const chint = document.createElement('span'); chint.className = 'chart-legend-hint'; + chint.textContent = '\u2573 Hatched bar\u00a0=\u00a0Timeout (> 60\u00a0s)'; + ch.appendChild(ct); ch.appendChild(cs); ch.appendChild(chint); chartBox.appendChild(ch); + const cw = document.createElement('div'); cw.className = 'chart-canvas-wrap chart-canvas-tall'; + const cc = document.createElement('canvas'); cc.id = 'chart-lubm-breakdown'; + cw.appendChild(cc); chartBox.appendChild(cw); + sectionB.appendChild(chartBox); + + const tableFilterBar = document.createElement('div'); + tableFilterBar.className = 'table-filter-bar'; + const TABLE_FILTERS = [ + { key: 'all', label: 'All Results' }, + { key: 'best', label: '\ud83c\udfc6 Best per Query' }, + { key: 'pass', label: '\u2713 PASS only' }, + { key: 'failures', label: '\u2715 Failures' }, + ]; + const tfBtns = TABLE_FILTERS.map(f => { + const btn = document.createElement('button'); + btn.className = 'table-filter-btn' + (f.key === 'all' ? ' active' : ''); + btn.textContent = f.label; + btn.addEventListener('click', () => { + tableFilter = f.key; + tfBtns.forEach(b => b.classList.remove('active')); + btn.classList.add('active'); + updateLubm(); + }); + tableFilterBar.appendChild(btn); + return btn; + }); + + const tableTitle = document.createElement('h4'); + tableTitle.className = 'table-section-title'; + tableTitle.textContent = 'Query Results'; + sectionB.appendChild(tableTitle); + sectionB.appendChild(tableFilterBar); + + const tableContainer = document.createElement('div'); + tableContainer.id = 'lubm-table'; + sectionB.appendChild(tableContainer); + container.appendChild(sectionB); + + // ── Sub-nav handlers ─────────────────────────────────────────────────────── + btnA.addEventListener('click', () => { + sectionA.style.display = ''; + sectionB.style.display = 'none'; + btnA.classList.add('active'); + btnB.classList.remove('active'); + }); + btnB.addEventListener('click', () => { + sectionA.style.display = 'none'; + sectionB.style.display = ''; + btnA.classList.remove('active'); + btnB.classList.add('active'); + if (!queriesRendered) { + queriesRendered = true; + requestAnimationFrame(() => { + updateLubm(); + addExpandButton(chartBox); + }); + } + }); + + requestAnimationFrame(() => { + const runs = getLoadingRuns(DATASET); + renderLoadingChart('chart-lubm-loading', DATASET); + renderThroughputChart('chart-lubm-throughput', runs); + renderCpuChart('chart-lubm-cpu', runs); + buildLoadingTableWithFilter(loadTableContainer, runs); + addExpandButton(loadingBox); + addExpandButton(tpBox); + addExpandButton(cpuBox); + }); +} + +function updateLubm() { + const allRuns = getQueryRuns(DATASET); + const filter = FILTERS[currentFilter]; + + const allQueryIds = [...new Set(allRuns.map(r => r.queryId))].sort((a, b) => + parseInt(a.replace('query_','')) - parseInt(b.replace('query_','')) + ); + const queryIds = filter.queries + ? allQueryIds.filter(id => filter.queries.includes(id)) + : allQueryIds; + const filteredRuns = filter.queries + ? allRuns.filter(r => filter.queries.includes(r.queryId)) + : allRuns; + + renderQueryBreakdown('chart-lubm-breakdown', filteredRuns, queryIds); + + const tableContainer = document.getElementById('lubm-table'); + if (tableContainer) { + let tableRuns = filteredRuns; + if (tableFilter === 'best') tableRuns = getBestPerQuery(filteredRuns); + else if (tableFilter === 'pass') tableRuns = filteredRuns.filter(r => r.status === 'PASS'); + else if (tableFilter === 'failures') tableRuns = filteredRuns.filter(r => r.status !== 'PASS'); + buildQueryTable(tableContainer, tableRuns, openResultDialog); + } +} + +export default renderLubm; diff --git a/site/js/pages/overview.js b/site/js/pages/overview.js new file mode 100644 index 0000000..f063036 --- /dev/null +++ b/site/js/pages/overview.js @@ -0,0 +1,217 @@ +// overview.js — Overview page with KPI cards and summary charts +'use strict'; + +import state from '../state.js'; +import { fmt, fmtMs, fmtThroughput, fmtPercent } from '../formatters.js'; +import { getEngineColor, getEngineLabel } from '../data-loader.js'; + +/** + * Render the overview page. + * @param {HTMLElement} container + */ +export function renderOverview(container) { + container.innerHTML = ''; + + const data = state.data; + if (!data) return; + + // Section heading + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Overview'; + container.appendChild(heading); + + // KPI cards grid + const kpiGrid = document.createElement('div'); + kpiGrid.className = 'kpi-grid'; + + // Compute KPIs per engine + state.activeEngines.forEach(engineId => { + const loadRuns = data.loadingRuns.filter(r => r.engine === engineId); + const queryRuns = data.queryRuns.filter(r => r.engine === engineId); + + // Avg throughput + const avgThroughput = loadRuns.length > 0 + ? loadRuns.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / loadRuns.length + : null; + + // Avg median latency (PASS only) + const passRuns = queryRuns.filter(r => r.status === 'PASS'); + const avgLatency = passRuns.length > 0 + ? passRuns.reduce((s, r) => s + r.medianMs, 0) / passRuns.length + : null; + + // Pass rate + const totalQueries = queryRuns.length; + const passCount = passRuns.length; + const passRate = totalQueries > 0 ? (passCount / totalQueries) * 100 : null; + + const card = createKpiCard(getEngineLabel(engineId), getEngineColor(engineId), [ + { label: 'Avg Throughput', value: fmtThroughput(avgThroughput) }, + { label: 'Avg Latency (PASS)', value: fmtMs(avgLatency) }, + { label: 'Pass Rate', value: passRate != null ? fmtPercent(passRate) : '\u2014' }, + { label: 'Queries', value: `${passCount} / ${totalQueries}` }, + ]); + kpiGrid.appendChild(card); + }); + + container.appendChild(kpiGrid); + + // Charts section + const chartsRow = document.createElement('div'); + chartsRow.className = 'charts-row'; + + // Throughput bar chart + const throughputBox = createChartBox('Average Ingestion Throughput', 'chart-overview-throughput'); + chartsRow.appendChild(throughputBox); + + // Latency bar chart + const latencyBox = createChartBox('Average Query Latency (PASS only)', 'chart-overview-latency'); + chartsRow.appendChild(latencyBox); + + container.appendChild(chartsRow); + + // Render charts after DOM is in place + requestAnimationFrame(() => { + renderThroughputOverview('chart-overview-throughput'); + renderLatencyOverview('chart-overview-latency'); + }); +} + +function createKpiCard(title, color, metrics) { + const card = document.createElement('div'); + card.className = 'kpi-card'; + card.style.borderTopColor = color; + + const h3 = document.createElement('h3'); + h3.className = 'kpi-card-title'; + h3.textContent = title; + h3.style.color = color; + card.appendChild(h3); + + const metricsDiv = document.createElement('div'); + metricsDiv.className = 'kpi-card-metrics'; + + metrics.forEach(m => { + const row = document.createElement('div'); + row.className = 'kpi-metric-row'; + + const label = document.createElement('span'); + label.className = 'kpi-metric-label'; + label.textContent = m.label; + row.appendChild(label); + + const value = document.createElement('span'); + value.className = 'kpi-metric-value font-mono'; + value.textContent = m.value; + row.appendChild(value); + + metricsDiv.appendChild(row); + }); + + card.appendChild(metricsDiv); + return card; +} + +function createChartBox(title, canvasId) { + const box = document.createElement('div'); + box.className = 'chart-box'; + + const header = document.createElement('div'); + header.className = 'chart-box-header'; + const h4 = document.createElement('h4'); + h4.textContent = title; + header.appendChild(h4); + box.appendChild(header); + + const canvasWrap = document.createElement('div'); + canvasWrap.className = 'chart-canvas-wrap'; + const canvas = document.createElement('canvas'); + canvas.id = canvasId; + canvasWrap.appendChild(canvas); + box.appendChild(canvasWrap); + + return box; +} + +function renderThroughputOverview(canvasId) { + const canvas = document.getElementById(canvasId); + if (!canvas) return; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const labels = []; + const values = []; + const colors = []; + + state.activeEngines.forEach(eng => { + const runs = state.data.loadingRuns.filter(r => r.engine === eng); + if (runs.length === 0) return; + const avg = runs.reduce((s, r) => s + (r.throughputTriplesPerSec || 0), 0) / runs.length; + labels.push(getEngineLabel(eng)); + values.push(Math.round(avg)); + colors.push(getEngineColor(eng)); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { + labels, + datasets: [{ data: values, backgroundColor: colors.map(c => c + 'cc'), borderColor: colors, borderWidth: 1 }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { legend: { display: false }, tooltip: { callbacks: { label: ctx => `${ctx.parsed.y.toLocaleString()} t/s` } } }, + scales: { + y: { title: { display: true, text: 'Throughput (t/s)', color: '#8b949e' }, ticks: { color: '#8b949e', callback: v => v.toLocaleString() }, grid: { color: 'rgba(48,54,61,0.3)' } }, + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + }, + }, + }); +} + +function renderLatencyOverview(canvasId) { + const canvas = document.getElementById(canvasId); + if (!canvas) return; + + if (state.charts[canvasId]) { + state.charts[canvasId].destroy(); + delete state.charts[canvasId]; + } + + const labels = []; + const values = []; + const colors = []; + + state.activeEngines.forEach(eng => { + const passRuns = state.data.queryRuns.filter(r => r.engine === eng && r.status === 'PASS'); + if (passRuns.length === 0) return; + const avg = passRuns.reduce((s, r) => s + r.medianMs, 0) / passRuns.length; + labels.push(getEngineLabel(eng)); + values.push(Math.round(avg)); + colors.push(getEngineColor(eng)); + }); + + state.charts[canvasId] = new Chart(canvas.getContext('2d'), { + type: 'bar', + data: { + labels, + datasets: [{ data: values, backgroundColor: colors.map(c => c + 'cc'), borderColor: colors, borderWidth: 1 }], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { legend: { display: false }, tooltip: { callbacks: { label: ctx => `${ctx.parsed.y.toLocaleString()} ms` } } }, + scales: { + y: { title: { display: true, text: 'Median Latency (ms)', color: '#8b949e' }, ticks: { color: '#8b949e' }, grid: { color: 'rgba(48,54,61,0.3)' } }, + x: { ticks: { color: '#8b949e' }, grid: { display: false } }, + }, + }, + }); +} + +export default renderOverview; diff --git a/site/js/pages/transparency.js b/site/js/pages/transparency.js new file mode 100644 index 0000000..1a41aab --- /dev/null +++ b/site/js/pages/transparency.js @@ -0,0 +1,121 @@ +// transparency.js — Machine & Transparency page (6 info cards) +'use strict'; + +import state from '../state.js'; + +/** + * Render the Machine & Transparency page. + * @param {HTMLElement} container + */ +export function renderTransparency(container) { + container.innerHTML = ''; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'Machine & Transparency'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Complete identity card of the benchmark execution environment.'; + container.appendChild(desc); + + const env = (state.data && state.data.metadata.environment) || {}; + const protocol = (state.data && state.data.metadata.protocol) || {}; + const git = (state.data && state.data.metadata.git) || {}; + + const grid = document.createElement('div'); + grid.className = 'transparency-grid'; + + // 1. CPU + grid.appendChild(createInfoCard('CPU', '\u2699\ufe0f', [ + { label: 'Model', value: env.cpuModel || '\u2014' }, + { label: 'Architecture', value: env.cpuArchitecture || '\u2014' }, + { label: 'Sockets', value: env.cpuSockets || '\u2014' }, + { label: 'Cores', value: env.cpuCores || '\u2014' }, + { label: 'Threads', value: env.cpuThreads || '\u2014' }, + { label: 'Frequency', value: env.cpuFrequencyMhz ? `${env.cpuFrequencyMhz} MHz` : '\u2014' }, + { label: 'Governor', value: env.cpuGovernor || '\u2014' }, + ])); + + // 2. Memory & Disk + grid.appendChild(createInfoCard('Memory & Disk', '\ud83d\udcbe', [ + { label: 'RAM Total', value: env.ramTotalGb ? `${env.ramTotalGb} GB` : '\u2014' }, + { label: 'Swap', value: env.swapTotalGb ? `${env.swapTotalGb} GB` : '\u2014' }, + { label: 'Swappiness', value: env.swappiness != null ? String(env.swappiness) : '\u2014' }, + ])); + + // 3. OS & Kernel + grid.appendChild(createInfoCard('OS & Kernel', '\ud83d\udda5\ufe0f', [ + { label: 'Distribution', value: env.osDistribution || '\u2014' }, + { label: 'Kernel', value: env.osKernel || '\u2014' }, + ])); + + // 4. JVM + grid.appendChild(createInfoCard('JVM', '\u2615', [ + { label: 'Vendor', value: env.jvmVendor || '\u2014' }, + { label: 'Version', value: env.jvmVersion || '\u2014' }, + { label: 'Flags', value: env.jvmFlags ? env.jvmFlags.join(' ') : '\u2014' }, + ])); + + // 5. Protocol + grid.appendChild(createInfoCard('Measurement Protocol', '\ud83d\udccf', [ + { label: 'Warmup Runs', value: protocol.warmup != null ? String(protocol.warmup) : '\u2014' }, + { label: 'Repetitions', value: protocol.repetitions != null ? String(protocol.repetitions) : '\u2014' }, + { label: 'Query Repetitions', value: protocol.queryRepetitions != null ? String(protocol.queryRepetitions) : '\u2014' }, + { label: 'Query Timeout', value: protocol.queryTimeoutMs ? `${protocol.queryTimeoutMs / 1000}s` : '\u2014' }, + { label: 'Load Timeout', value: protocol.loadTimeoutMs ? `${protocol.loadTimeoutMs / 1000}s` : '\u2014' }, + { label: 'Metric', value: protocol.metric || 'median' }, + ])); + + // 7. Engines + const engines = (state.data && state.data.engines) || []; + const engineItems = engines.map(e => ({ + label: e.label || e.id, + value: e.version ? `v${e.version}` : '\u2014', + })); + if (engineItems.length > 0) { + grid.appendChild(createInfoCard('Engines', '\u26a1', engineItems)); + } + + container.appendChild(grid); +} + +function createInfoCard(title, icon, items) { + const card = document.createElement('div'); + card.className = 'info-card'; + + const header = document.createElement('div'); + header.className = 'info-card-header'; + + const iconEl = document.createElement('span'); + iconEl.className = 'info-card-icon'; + iconEl.textContent = icon; + header.appendChild(iconEl); + + const titleEl = document.createElement('h3'); + titleEl.className = 'info-card-title'; + titleEl.textContent = title; + header.appendChild(titleEl); + + card.appendChild(header); + + const list = document.createElement('dl'); + list.className = 'info-card-list'; + + items.forEach(item => { + const dt = document.createElement('dt'); + dt.textContent = item.label; + list.appendChild(dt); + + const dd = document.createElement('dd'); + dd.className = 'font-mono'; + dd.textContent = item.value; + list.appendChild(dd); + }); + + card.appendChild(list); + return card; +} + +export default renderTransparency; diff --git a/site/js/pages/w3c.js b/site/js/pages/w3c.js new file mode 100644 index 0000000..b7752b1 --- /dev/null +++ b/site/js/pages/w3c.js @@ -0,0 +1,278 @@ +// w3c.js — W3C Conformance page (static data from corese-w3c portal) +'use strict'; + +const SUMMARY = { total: 2915, passed: 2897, failed: 3, inapplicable: 13, untested: 0, cantTell: 2 }; + +const SUITES = [ + { name: 'JSON-LD 1.1 (fromRdf)', spec: 'https://www.w3.org/TR/json-ld11-api/#dom-jsonldprocessor-fromrdf', total: 54, passed: 51, failed: 2, inapplicable: 1, cantTell: 0 }, + { name: 'JSON-LD 1.1 (toRdf)', spec: 'https://www.w3.org/TR/json-ld11-api/#dom-jsonldprocessor-tordf', total: 467, passed: 454, failed: 1, inapplicable: 12, cantTell: 0 }, + { name: 'N-Quads (RDF 1.1)', spec: 'https://www.w3.org/TR/n-quads/', total: 87, passed: 87, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'N-Triples (RDF 1.1)', spec: 'https://www.w3.org/TR/n-triples/', total: 70, passed: 70, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFC-1.0 (Canonicalization)', spec: 'https://www.w3.org/TR/rdf-canon/', total: 86, passed: 86, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDF/XML (RDF 1.1)', spec: 'https://www.w3.org/TR/rdf-syntax-grammar/', total: 166, passed: 166, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (SVG)', spec: 'https://www.w3.org/TR/SVG11/', total: 31, passed: 31, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (XHTML)', spec: 'https://www.w3.org/TR/rdfa-core/', total: 181, passed: 181, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'RDFa 1.1 (XML)', spec: 'https://www.w3.org/TR/rdfa-core/', total: 126, passed: 126, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'SPARQL 1.0', spec: 'https://www.w3.org/TR/rdf-sparql-query/', total: 482, passed: 482, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'SPARQL 1.1', spec: 'https://www.w3.org/TR/sparql11-query/', total: 495, passed: 493, failed: 0, inapplicable: 0, cantTell: 2 }, + { name: 'TriG (RDF 1.1)', spec: 'https://www.w3.org/TR/trig/', total: 357, passed: 357, failed: 0, inapplicable: 0, cantTell: 0 }, + { name: 'Turtle (RDF 1.1)', spec: 'https://www.w3.org/TR/turtle/', total: 313, passed: 313, failed: 0, inapplicable: 0, cantTell: 0 }, +]; + +const FAILED_TESTS = [ + { + suite: 'JSON-LD 1.1 (fromRdf)', + test: 'use native types flag with values that cannot be serialized to JSON', + description: 'useNativeTypes flag being true is disregarded for a value that cannot be serialized into a native JSON value.', + error: 'Character I is neither a decimal digit nor \u201c.\u201d', + }, + { + suite: 'JSON-LD 1.1 (fromRdf)', + test: 'use native types flag with non-native values', + description: 'Ensure that useNativeTypes flag being true does not interfere with values that cannot be serialized to a native value.', + error: 'For input string: \u201cAAA\u201d', + }, + { + suite: 'JSON-LD 1.1 (toRdf)', + test: 'List with bad @base.', + description: 'Tests list elements expanded to IRIs with a bad @base.', + error: 'JsonLdError[code=An invalid base IRI has been detected]', + }, +]; + +const CANNOT_TELL_TESTS = [ + { + suite: 'SPARQL 1.1', + test: 'agg-empty-group', + description: 'Aggregate on empty group returns correct result.', + error: 'Result differs \u2014 ambiguous specification', + }, + { + suite: 'SPARQL 1.1', + test: 'agg-empty-group-count', + description: 'COUNT on empty group.', + error: 'Result differs \u2014 ambiguous specification', + }, +]; + +export function renderW3c(container) { + container.innerHTML = ''; + + const heading = document.createElement('h2'); + heading.className = 'page-title'; + heading.textContent = 'W3C Conformance'; + container.appendChild(heading); + + const desc = document.createElement('p'); + desc.className = 'page-desc'; + desc.textContent = 'Official W3C certification for Corese v5 \u2014 13 test suites, source: corese-w3c.'; + container.appendChild(desc); + + // ── KPI cards ────────────────────────────────────────────────────────────── + const kpiGrid = document.createElement('div'); + kpiGrid.className = 'w3c-kpi-grid'; + + const KPIS = [ + { label: 'TOTAL TESTS', value: SUMMARY.total.toLocaleString(), sub: '13 standard suites', color: 'var(--text-main)' }, + { label: 'PASSED', value: SUMMARY.passed.toLocaleString(), sub: (SUMMARY.passed/SUMMARY.total*100).toFixed(1)+'% of all entries', color: 'var(--status-pass)' }, + { label: 'FAILURES', value: SUMMARY.failed.toString(), sub: 'Failed tests', color: SUMMARY.failed > 0 ? 'var(--status-mismatch)' : 'var(--status-pass)' }, + { label: 'UNTESTED', value: SUMMARY.untested.toString(), sub: '', color: 'var(--text-muted)' }, + { label: 'INAPPLICABLE', value: SUMMARY.inapplicable.toString(), sub: 'See rationale', color: 'var(--status-timeout)' }, + { label: 'CANNOT TELL', value: SUMMARY.cantTell.toString(), sub: 'See rationale', color: '#8e44ad' }, + ]; + + KPIS.forEach(kpi => { + const card = document.createElement('div'); + card.className = 'w3c-kpi-card'; + + const lbl = document.createElement('div'); + lbl.className = 'w3c-kpi-label'; + lbl.textContent = kpi.label; + card.appendChild(lbl); + + const val = document.createElement('div'); + val.className = 'w3c-kpi-value'; + val.textContent = kpi.value; + val.style.color = kpi.color; + card.appendChild(val); + + if (kpi.sub) { + const sub = document.createElement('div'); + sub.className = 'w3c-kpi-sub'; + sub.textContent = kpi.sub; + card.appendChild(sub); + } + + kpiGrid.appendChild(card); + }); + + container.appendChild(kpiGrid); + + // Progress bar + const progressBar = document.createElement('div'); + progressBar.className = 'w3c-progress'; + const progressFill = document.createElement('div'); + progressFill.className = 'w3c-progress-fill'; + progressFill.style.width = (SUMMARY.passed / SUMMARY.total * 100).toFixed(2) + '%'; + progressBar.appendChild(progressFill); + container.appendChild(progressBar); + + // Link button + const linkBtn = document.createElement('a'); + linkBtn.className = 'w3c-link-btn'; + linkBtn.href = 'https://corese-stack.github.io/corese-w3c/'; + linkBtn.target = '_blank'; + linkBtn.rel = 'noopener noreferrer'; + linkBtn.textContent = 'View the official W3C conformance portal (corese-w3c) \u2197'; + container.appendChild(linkBtn); + + // ── Suite table ──────────────────────────────────────────────────────────── + const tableTitle = document.createElement('h3'); + tableTitle.className = 'page-subtitle'; + tableTitle.textContent = 'Detail by test suite'; + container.appendChild(tableTitle); + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + const table = document.createElement('table'); + table.className = 'data-table'; + + const thead = document.createElement('thead'); + const hRow = document.createElement('tr'); + ['Suite', 'Specification', 'Total', 'Passed', 'Failures', 'Inapplicable', 'Cannot Tell', 'Rate'].forEach((h, i) => { + const th = document.createElement('th'); + th.textContent = h; + if (i > 1) th.className = 'text-right'; + hRow.appendChild(th); + }); + thead.appendChild(hRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + + SUITES.forEach(row => { + const rate = (row.passed / row.total * 100).toFixed(2) + '%'; + const tr = document.createElement('tr'); + + // Suite name cell + const tdName = document.createElement('td'); + tdName.textContent = row.name; + tr.appendChild(tdName); + + // Specification link cell + const tdSpec = document.createElement('td'); + const a = document.createElement('a'); + a.href = row.spec; + a.target = '_blank'; + a.rel = 'noopener noreferrer'; + a.textContent = row.spec.replace('https://www.w3.org/TR/', '').replace(/\/$/, ''); + a.className = 'w3c-spec-link'; + tdSpec.appendChild(a); + tr.appendChild(tdSpec); + + // Numeric cells: Total, Passed, Failed, Inapplicable, Cannot Tell, Rate + const nums = [row.total, row.passed, row.failed, row.inapplicable, row.cantTell, rate]; + nums.forEach((val, i) => { + const td = document.createElement('td'); + td.textContent = val; + td.className = 'text-right font-mono'; + if (i === 2 && val > 0) { td.style.color = 'var(--status-mismatch)'; td.style.fontWeight = '600'; } + if (i === 2 && val === 0) td.style.color = 'var(--status-pass)'; + if (i === 3 && val > 0) td.style.color = 'var(--status-timeout)'; + if (i === 4 && val > 0) td.style.color = '#8e44ad'; + tr.appendChild(td); + }); + tbody.appendChild(tr); + }); + + // Total row + const trTotal = document.createElement('tr'); + trTotal.style.fontWeight = '700'; + trTotal.style.borderTop = '2px solid var(--border-color)'; + const grandRate = (SUMMARY.passed / SUMMARY.total * 100).toFixed(2) + '%'; + [ + 'Total', '', SUMMARY.total, SUMMARY.passed, + SUMMARY.failed, SUMMARY.inapplicable, SUMMARY.cantTell, grandRate + ].forEach((val, i) => { + const td = document.createElement('td'); + td.textContent = val; + if (i > 1) td.className = 'text-right font-mono'; + trTotal.appendChild(td); + }); + tbody.appendChild(trTotal); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); + + // ── Failure / Cannot-Tell detail tables ─────────────────────────────────── + buildDetailTable(container, 'Failed (3)', FAILED_TESTS, 'failed'); + buildDetailTable(container, 'Cannot Tell (2)', CANNOT_TELL_TESTS, 'cannot-tell'); +} + +function buildDetailTable(container, title, rows, kind) { + const titleEl = document.createElement('h3'); + titleEl.className = 'page-subtitle'; + titleEl.textContent = title; + container.appendChild(titleEl); + + const wrapper = document.createElement('div'); + wrapper.className = 'table-surface'; + const scroll = document.createElement('div'); + scroll.className = 'table-scroll'; + const table = document.createElement('table'); + table.className = 'data-table'; + + const thead = document.createElement('thead'); + const hRow = document.createElement('tr'); + ['Suite', 'Test', 'Description', 'Error'].forEach(h => { + const th = document.createElement('th'); + th.textContent = h; + hRow.appendChild(th); + }); + thead.appendChild(hRow); + table.appendChild(thead); + + const tbody = document.createElement('tbody'); + rows.forEach(row => { + const tr = document.createElement('tr'); + + const tdSuite = document.createElement('td'); + tdSuite.textContent = row.suite; + tdSuite.style.whiteSpace = 'nowrap'; + tr.appendChild(tdSuite); + + const tdTest = document.createElement('td'); + tdTest.className = 'font-mono'; + tdTest.textContent = row.test; + tr.appendChild(tdTest); + + const tdDesc = document.createElement('td'); + tdDesc.textContent = row.description; + tdDesc.style.color = 'var(--text-muted)'; + tdDesc.style.fontSize = '0.85rem'; + tr.appendChild(tdDesc); + + const tdErr = document.createElement('td'); + tdErr.textContent = row.error; + tdErr.style.fontSize = '0.82rem'; + if (kind === 'failed') { + tdErr.style.color = 'var(--status-mismatch)'; + } else { + tdErr.style.color = '#8e44ad'; + } + tr.appendChild(tdErr); + + tbody.appendChild(tr); + }); + + table.appendChild(tbody); + scroll.appendChild(table); + wrapper.appendChild(scroll); + container.appendChild(wrapper); +} + +export default renderW3c; diff --git a/site/js/state.js b/site/js/state.js new file mode 100644 index 0000000..81f66e9 --- /dev/null +++ b/site/js/state.js @@ -0,0 +1,14 @@ +// state.js — Global application state (singleton) +'use strict'; + +const state = { + activeTab: 'overview', + data: null, // normalized data + rawData: null, // original JSON + engines: [], // engine id list + activeEngines: [], // currently visible engines + charts: {}, // chart instance registry (id -> Chart) + dataFormat: null, // 'v1' or 'v2' +}; + +export default state; diff --git a/site/styles.css b/site/styles.css index fdb1b00..6b5979e 100644 --- a/site/styles.css +++ b/site/styles.css @@ -1,9 +1,9 @@ -/* ── Variables (même système que corese-w3c) ──────────────────────────────── */ +/* ── Variables ────────────────────────────────────────────────────────────── */ :root { --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; - /* Thème sombre (défaut) */ + /* Dark theme (default) */ --bg-page: #0d1117; --bg-surface: #161b22; --bg-surface-hover: #1c2128; @@ -18,29 +18,35 @@ --accent: #58a6ff; --accent-hover: #79c0ff; - /* Couleurs engines */ + /* Engine colors */ --corese-color: #4472C4; - --corese-bg: rgba(68, 114, 196, 0.15); --jena-color: #ED7D31; - --jena-bg: rgba(237, 125, 49, 0.15); --rdf4j-color: #70AD47; - --rdf4j-bg: rgba(112, 173, 71, 0.15); + --corese-next-color: #2E75B6; + + /* Status colors */ + --status-pass: #2ecc71; + --status-mismatch: #e74c3c; + --status-timeout: #f39c12; + --status-error: #8e44ad; --radius-sm: 4px; --radius-md: 6px; + --radius-lg: 10px; } +/* ── Light theme ──────────────────────────────────────────────────────────── */ [data-theme="light"] { --bg-page: #ffffff; --bg-surface: #f6f8fa; --bg-surface-hover: #eaeef2; - --bg-surface-active: #e1e4e8; + --bg-surface-active: #dde1e6; --border-color: #d0d7de; --border-subtle: #eaeef2; --text-main: #1f2328; - --text-muted: #57606a; - --text-faint: #8c959f; + --text-muted: #656d76; + --text-faint: #9198a1; --accent: #0969da; --accent-hover: #0550ae; @@ -62,1570 +68,961 @@ body { .font-mono { font-family: var(--font-mono); } .text-right { text-align: right; } +a { color: var(--accent); text-decoration: none; } +a:hover { color: var(--accent-hover); text-decoration: underline; } + +/* ── App wrapper ──────────────────────────────────────────────────────────── */ .app-wrapper { - max-width: 1200px; + max-width: 1280px; margin: 0 auto; - padding: 24px 20px 60px; + padding: 0 24px; + min-height: 100vh; } /* ── Header ───────────────────────────────────────────────────────────────── */ .page-header { + position: sticky; + top: 0; + z-index: 100; + background: var(--bg-page); border-bottom: 1px solid var(--border-color); - padding-bottom: 18px; - margin-bottom: 24px; + padding: 16px 0 0; } -.header-top-row { +.header-top { display: flex; - justify-content: space-between; align-items: center; - gap: 16px; - flex-wrap: wrap; + justify-content: space-between; margin-bottom: 8px; } -.brand-group { - display: flex; - align-items: center; - gap: 10px; - flex-wrap: wrap; -} - -.main-title { - font-size: 22px; +.brand-title { + font-size: 20px; font-weight: 700; letter-spacing: -0.3px; } -.badge-tag { - font-size: 11px; - font-weight: 600; - background-color: var(--bg-surface); - border: 1px solid var(--border-color); - padding: 2px 8px; - border-radius: var(--radius-sm); - color: var(--text-muted); - white-space: nowrap; -} - -.header-controls { - display: flex; - align-items: center; - gap: 10px; - flex-wrap: wrap; -} - -.meta-tags { +.header-actions { display: flex; align-items: center; gap: 8px; + flex-shrink: 0; } -.meta-tag { - font-size: 11px; +.export-btn { + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); color: var(--text-muted); + font-size: 12px; + font-weight: 500; + font-family: var(--font-sans); + padding: 0 12px; + height: 34px; + cursor: pointer; + transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; } -.download-group { - display: flex; - gap: 6px; +.export-btn:hover { + background: var(--bg-surface-hover); + border-color: var(--accent); + color: var(--text-main); } -.btn-download { - display: inline-flex; - align-items: center; - gap: 5px; - font-family: var(--font-mono); - font-size: 11px; - font-weight: 500; - color: var(--text-muted); +.theme-toggle-btn { background: var(--bg-surface); border: 1px solid var(--border-color); - border-radius: var(--radius-sm); - padding: 4px 9px; - text-decoration: none; + border-radius: var(--radius-md); + color: var(--text-muted); + font-size: 18px; + width: 34px; + height: 34px; cursor: pointer; - transition: all 0.15s; - white-space: nowrap; + display: flex; + align-items: center; + justify-content: center; + transition: background 0.15s, border-color 0.15s, color 0.15s; + flex-shrink: 0; } -.btn-download:hover { + +.theme-toggle-btn:hover { background: var(--bg-surface-hover); border-color: var(--accent); - color: var(--accent); + color: var(--text-main); } -.theme-btn { - display: inline-flex; - align-items: center; +/* ── Sticky pill ──────────────────────────────────────────────────────────── */ +.sticky-pill { background: var(--bg-surface); border: 1px solid var(--border-color); - border-radius: var(--radius-sm); - padding: 5px 8px; + border-radius: 20px; + padding: 6px 16px; + font-size: 11px; color: var(--text-muted); + margin-bottom: 10px; cursor: pointer; - transition: all 0.15s; + transition: background 0.2s, border-color 0.2s; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } -.theme-btn:hover { background: var(--bg-surface-hover); color: var(--text-main); } -.main-desc { - font-size: 13px; - color: var(--text-muted); - line-height: 1.5; +.sticky-pill:hover { + background: var(--bg-surface-hover); + border-color: var(--accent); + color: var(--text-main); } -/* ── Run info bar ─────────────────────────────────────────────────────────── */ -.run-info-bar { +/* ── Engine filter bar ────────────────────────────────────────────────────── */ +.engine-bar { display: flex; - align-items: center; - gap: 20px; + gap: 6px; + margin-bottom: 8px; flex-wrap: wrap; - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - padding: 10px 16px; - margin-bottom: 20px; - font-size: 12px; } -.run-info-label { - font-weight: 700; - font-size: 11px; - text-transform: uppercase; - letter-spacing: .05em; +.engine-btn { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 3px 10px; + border-radius: 20px; + border: 1.5px dashed var(--border-color); + background: transparent; color: var(--text-faint); - margin-right: 4px; + font-size: 12px; + font-weight: 500; + font-family: var(--font-sans); + cursor: grab; + transition: background 0.15s, color 0.15s, border-color 0.15s; } - -.run-info-item { - display: flex; - align-items: center; - gap: 6px; +.engine-btn.dragging { + opacity: 0.4; + cursor: grabbing; } - -.run-info-key { - font-size: 11px; - font-weight: 600; - color: var(--text-faint); +.engine-btn.drag-over { + border-style: solid; + border-color: var(--accent); + background: color-mix(in srgb, var(--accent) 15%, transparent); } -/* ── Metrics grid (KPI) ───────────────────────────────────────────────────── */ -.metrics-grid { - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 12px; - margin-bottom: 16px; +.engine-btn.active { + border-style: solid; + border-color: var(--engine-color, var(--accent)); + background: color-mix(in srgb, var(--engine-color, var(--accent)) 15%, transparent); + color: var(--text-main); } -.metric-block { - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - padding: 14px 16px 10px; - transition: border-color 0.15s, background-color 0.15s; +.engine-btn:hover { + border-color: var(--engine-color, var(--accent)); + background: color-mix(in srgb, var(--engine-color, var(--accent)) 20%, transparent); + color: var(--text-main); } -.metric-block:hover { - background: var(--bg-surface-hover); - border-color: var(--text-faint); + +.engine-btn-icon { + font-size: 14px; + font-weight: 700; + line-height: 1; + opacity: 0.7; } -/* Winner cards */ -.kpi-winner-card { display: flex; flex-direction: column; gap: 4px; } -.kpi-winner-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); } -.kpi-winner-engine { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; } -.kpi-winner-value { font-size: 20px; font-weight: 700; color: var(--text-main); margin-top: 2px; } +/* ── Tab bar ──────────────────────────────────────────────────────────────── */ +.tab-bar { + display: flex; + gap: 2px; + overflow-x: auto; + padding-bottom: 0; + scrollbar-width: none; +} -/* Context card */ -.kpi-context-card { display: flex; flex-direction: column; justify-content: center; gap: 8px; } -.kpi-context-row { display: flex; align-items: baseline; gap: 6px; } -.kpi-context-num { font-size: 22px; font-weight: 700; color: var(--text-main); } -.kpi-context-lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; } +.tab-bar::-webkit-scrollbar { display: none; } -.metric-label { - font-size: 11px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: .06em; +.tab-btn { + flex-shrink: 0; + padding: 8px 16px; + border: none; + background: transparent; color: var(--text-muted); - margin-bottom: 6px; + font-size: 13px; + font-weight: 500; + font-family: var(--font-sans); + cursor: pointer; + border-bottom: 2px solid transparent; + transition: color 0.15s, border-color 0.15s; + white-space: nowrap; } -.metric-num { - font-size: 26px; - font-weight: 700; - font-family: var(--font-mono); - line-height: 1; +.tab-btn:hover { color: var(--text-main); + background: var(--bg-surface-hover); } -.metric-note { - font-size: 11px; - color: var(--text-faint); - margin-top: 5px; -} - -/* ── Global meter ─────────────────────────────────────────────────────────── */ -.global-meter-wrap { - margin-bottom: 28px; +.tab-btn.active { + color: var(--accent); + border-bottom-color: var(--accent); } -.global-meter { - display: flex; - height: 8px; - border-radius: 4px; - overflow: hidden; - gap: 0; - box-shadow: inset 0 1px 2px rgba(0,0,0,.2); - background: var(--border-subtle); +/* ── Main content ─────────────────────────────────────────────────────────── */ +.main-content { + padding: 24px 0 60px; + min-height: 50vh; } -.meter-segment { - height: 100%; - transition: width 0.3s ease; +/* ── Page titles ──────────────────────────────────────────────────────────── */ +.page-subtitle { + font-size: 16px; + font-weight: 600; + margin: 24px 0 10px; + color: var(--text-main); } -/* ── Section headings ─────────────────────────────────────────────────────── */ -.section-heading { - font-size: 14px; +.page-title { + font-size: 22px; font-weight: 700; - color: var(--text-main); margin-bottom: 6px; + letter-spacing: -0.3px; } -.section-sub { - font-size: 12px; - color: var(--text-faint); - margin-bottom: 12px; - text-align: right; +.page-desc { + color: var(--text-muted); + font-size: 13px; + margin-bottom: 20px; } -/* ── Engine cards (suite-item style) ─────────────────────────────────────── */ -.suites-list { +/* ── KPI cards ────────────────────────────────────────────────────────────── */ +.kpi-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); - gap: 10px; + grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); + gap: 16px; + margin-bottom: 28px; } -.suite-item { +.kpi-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); - padding: 12px 14px; - cursor: pointer; - transition: border-color 0.15s, background-color 0.15s; - user-select: none; + padding: 16px 20px; + border-top: 3px solid var(--accent); } -.suite-item:hover { - background: var(--bg-surface-hover); - border-color: var(--text-faint); + +.kpi-card-title { + font-size: 14px; + font-weight: 600; + margin-bottom: 12px; } -.suite-item.active { - border-color: var(--accent); - background: var(--bg-surface-active); + +.kpi-card-metrics { + display: flex; + flex-direction: column; + gap: 6px; } -.suite-item-header { +.kpi-metric-row { display: flex; - align-items: center; justify-content: space-between; - margin-bottom: 8px; + align-items: center; +} + +.kpi-metric-label { + color: var(--text-muted); + font-size: 12px; } -.suite-name { +.kpi-metric-value { font-size: 13px; font-weight: 600; - display: flex; - align-items: center; - gap: 8px; } -.section-heading-row { - display: flex; - align-items: center; - gap: 12px; +/* ── Charts ───────────────────────────────────────────────────────────────── */ +.charts-row { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + gap: 16px; + margin-bottom: 24px; } -.btn-clear-filter { - font-size: 11px; - padding: 3px 10px; - border-radius: 4px; - border: 1px solid var(--color-border); - background: transparent; - color: var(--color-muted); - cursor: pointer; - transition: color 0.15s, border-color 0.15s; +.chart-box { + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + padding: 16px; } -.btn-clear-filter:hover { color: var(--color-text); border-color: var(--color-text); } -.suite-item[draggable="true"] { cursor: grab; } -.suite-item[draggable="true"]:active { cursor: grabbing; } -.suite-item.dragging { opacity: 0.4; } -.suite-item.drag-over { outline: 2px dashed var(--color-accent); outline-offset: 2px; } +.chart-box-wide { + grid-column: span 2; +} -.dataset-card { cursor: pointer; } -.dataset-card.active { border-color: var(--accent); background: var(--bg-surface-active); } -.dataset-card:hover { transform: none; box-shadow: none; } +/* 3-column ingestion layout: loading (2fr) + throughput (1fr) + cpu (1fr) */ +.charts-row-ingestion { + grid-template-columns: 2fr 1fr 1fr; +} +.charts-row-ingestion .chart-box-wide { + grid-column: span 1; +} -.dataset-desc { - font-size: 11px; - color: var(--color-muted); - margin: 0 0 8px; - line-height: 1.4; +@media (max-width: 840px) { + .chart-box-wide { grid-column: span 1; } + .charts-row-ingestion { grid-template-columns: 1fr; } } -.file-tags { - display: flex; - flex-wrap: wrap; - gap: 4px; - margin-top: 8px; +.chart-box-full { + margin-bottom: 24px; + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + padding: 16px; } -.file-tag { - font-size: 10px; - font-family: var(--font-mono); - padding: 2px 7px; - border-radius: 3px; - background: var(--color-surface2); - color: var(--color-muted); - border: 1px solid var(--color-border); +.chart-box-header { + margin-bottom: 12px; } -.queries-details { - margin-top: 10px; - border-top: 1px solid var(--color-border); - padding-top: 8px; +.chart-box-header h4 { + font-size: 13px; + font-weight: 600; + color: var(--text-muted); + text-transform: uppercase; + letter-spacing: 0.5px; } -.queries-summary { - list-style: none; - cursor: pointer; - font-size: 11px; - color: var(--color-accent); - display: flex; - align-items: center; - gap: 5px; - user-select: none; +.chart-canvas-wrap { + position: relative; + height: 220px; } -.queries-summary::-webkit-details-marker { display: none; } -.queries-summary svg { transition: transform 0.2s; } -.queries-details[open] .queries-summary svg { transform: rotate(90deg); } -.queries-list { - margin-top: 8px; - display: flex; - flex-direction: column; - gap: 6px; - max-height: 300px; - overflow-y: auto; +.chart-canvas-wrap canvas { + width: 100% !important; + height: 100% !important; + background: transparent !important; } -.query-item { - display: flex; - gap: 8px; - align-items: flex-start; +.chart-canvas-tall { + height: 320px; } -.query-item-id { - font-size: 10px; - font-weight: 600; - color: var(--color-accent); - min-width: 24px; - padding-top: 3px; +/* ── Sub-navigation (Ingestion | Requêtes) ────────────────────────────────── */ +.subnav-bar { + display: flex; + gap: 0; + margin-bottom: 24px; + border-bottom: 2px solid var(--border-color); } -.query-item-text { - font-size: 10px; - font-family: var(--font-mono); - color: var(--color-muted); - margin: 0; - white-space: pre-wrap; - word-break: break-all; - background: var(--color-surface2); - padding: 4px 8px; - border-radius: 3px; - flex: 1; -} - -.dataset-source-link { - display: inline-flex; - align-items: center; - gap: 4px; - font-size: 11px; - color: var(--color-accent); - text-decoration: none; - padding: 2px 8px; - border: 1px solid var(--color-accent); - border-radius: 4px; - opacity: 0.8; - transition: opacity 0.15s; -} -.dataset-source-link:hover { opacity: 1; text-decoration: none; } - -.engine-dot { - width: 9px; height: 9px; - border-radius: 50%; - flex-shrink: 0; -} - -.suite-pct { - font-family: var(--font-mono); +.subnav-btn { + padding: 10px 22px; + background: none; + border: none; + border-bottom: 3px solid transparent; + margin-bottom: -2px; + color: var(--text-muted); font-size: 13px; font-weight: 600; - color: var(--text-muted); -} - -.suite-stats { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 6px 12px; - margin-bottom: 10px; + font-family: var(--font-sans); + cursor: pointer; + transition: color 0.15s, border-color 0.15s; } -.stat-item .stat-label { - font-size: 10px; - text-transform: uppercase; - letter-spacing: .05em; - color: var(--text-faint); - font-weight: 600; -} -.stat-item .stat-value { - font-family: var(--font-mono); - font-size: 12px; - font-weight: 600; +.subnav-btn:hover { color: var(--text-main); } -.suite-meter { - display: flex; - height: 5px; - border-radius: 3px; - overflow: hidden; - background: var(--border-subtle); -} - -/* ── Charts ───────────────────────────────────────────────────────────────── */ -.charts-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 12px; -} - - -@media (max-width: 800px) { .charts-grid { grid-template-columns: 1fr; } } - -.chart-surface { - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - padding: 16px 18px 12px; - height: 300px; +.subnav-btn.active { + color: var(--accent); + border-bottom-color: var(--accent); } -.chart-header { +/* ── Chart expand button & fullscreen ─────────────────────────────────────── */ +.chart-box-header { display: flex; align-items: center; - gap: 10px; - margin-bottom: 12px; -} - -.chart-title { - font-size: 13px; - font-weight: 600; - color: var(--text-main); + justify-content: space-between; } -.chart-unit { +.chart-subtitle { font-size: 11px; color: var(--text-faint); - flex: 1; -} - -.btn-chart-png { - font-size: 10px; - padding: 2px 8px; - border-radius: 4px; - border: 1px solid var(--color-border); - background: transparent; - color: var(--color-muted); - cursor: pointer; - opacity: 0; - transition: opacity 0.15s, color 0.15s; - white-space: nowrap; -} -.chart-surface:hover .btn-chart-png { opacity: 1; } -.btn-chart-png:hover { color: var(--color-text); border-color: var(--color-text); } - -.chart-surface canvas { max-height: 218px; } - -/* ── Table ────────────────────────────────────────────────────────────────── */ -.table-surface { - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - overflow: hidden; -} - -.table-scroll { overflow-x: auto; overflow-y: auto; max-height: 520px; } -#section-results .table-scroll { max-height: 60vh; } - -.report-table { - width: 100%; - border-collapse: collapse; - font-size: 12px; + font-weight: 400; + margin-left: 8px; } -.report-table thead th { - position: sticky; - top: 0; - z-index: 2; - background: var(--bg-surface-hover); - padding: 9px 12px; - text-align: left; +.chart-legend-hint { font-size: 11px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: .05em; - color: var(--text-muted); - border-bottom: 2px solid var(--border-color); - white-space: nowrap; -} -.report-table thead th.text-right, -.report-table tbody td.text-right { text-align: right; } - -.sortable { user-select: none; } -.sortable:hover { color: var(--color-accent); } -.sort-asc::after { content: ' ↑'; font-size: 10px; color: var(--color-accent); } -.sort-desc::after { content: ' ↓'; font-size: 10px; color: var(--color-accent); } - -.diff-col { color: var(--color-muted); font-style: italic; } -.diff-better { color: #3fb950; font-weight: 600; } -.diff-worse { color: #f85149; font-weight: 600; } - -.report-table tbody tr { - border-bottom: 1px solid var(--border-subtle); - cursor: default; - transition: background 0.1s; -} -.report-table tbody tr:last-child { border-bottom: none; } -.report-table tbody tr:hover { background: var(--bg-surface-hover); } - -.report-table tbody td { - padding: 8px 12px; - white-space: nowrap; - font-variant-numeric: tabular-nums; -} - -/* ── Engine badge ─────────────────────────────────────────────────────────── */ -.engine-badge { - display: inline-block; - padding: 2px 7px; - border-radius: 10px; - font-size: 10px; - font-weight: 700; - font-family: var(--font-mono); - letter-spacing: .02em; - color: #fff; -} -/* Familles connues — couleur fixe via variable CSS */ -.badge-corese { background: var(--corese-color); } -.badge-jena { background: var(--jena-color); } -.badge-rdf4j { background: var(--rdf4j-color); } -.badge-oxigraph { background: #E05C5C; } -.badge-blazegraph{ background: #9B59B6; } -/* Fallback : la couleur est injectée via style inline par app.js */ -.badge-unknown { background: #8b949e; } - -.reps { color: var(--text-faint); - font-family: var(--font-mono); - font-size: 11px; + font-style: italic; + white-space: nowrap; } -/* ── Query section ────────────────────────────────────────────────────────── */ -.query-section { margin-top: 40px; } -.query-section h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; } - -.query-details { border: none; } -.query-details summary { list-style: none; cursor: pointer; } -.query-details summary::-webkit-details-marker { display: none; } - -.query-summary { +.chart-btn-group { display: flex; - align-items: center; - gap: 12px; - padding: 10px 0; - user-select: none; -} -.query-summary::before { - content: '▶'; - font-size: 10px; - color: var(--color-muted); - transition: transform 0.2s; + gap: 4px; flex-shrink: 0; } -.query-details[open] .query-summary::before { transform: rotate(90deg); } -.query-summary-meta { - font-size: 11px; - color: var(--color-muted); - font-weight: 400; -} -.section-note { font-size: 12px; color: var(--text-faint); margin-bottom: 16px; } -.query-cards { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); - gap: 12px; - margin-bottom: 8px; -} -.query-engine-card { - background: var(--card-bg); - border: 1px solid var(--border-color); - border-radius: var(--radius); - padding: 14px 16px; -} -.query-engine-header { - display: flex; - align-items: center; - gap: 8px; - margin-bottom: 10px; - font-size: 13px; -} - -/* Query-type filter pills */ -.query-type-filter-bar { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 6px; - margin: 10px 0 8px; -} -.query-type-filter-bar .filter-label { - font-size: 11px; - color: var(--text-muted); - margin-right: 2px; -} -.query-type-pill { - padding: 3px 10px; - border-radius: 12px; +.chart-expand-btn { + background: none; border: 1px solid var(--border-color); - background: transparent; + border-radius: var(--radius-sm); color: var(--text-muted); - font-size: 11px; + font-size: 14px; + padding: 2px 6px; cursor: pointer; - transition: background 0.15s, color 0.15s, border-color 0.15s; + line-height: 1; + flex-shrink: 0; + transition: color 0.15s, border-color 0.15s; } -.query-type-pill:hover { background: var(--bg-surface-hover); color: var(--text-main); } -.query-type-pill.active { - background: var(--accent); - color: #fff; - border-color: var(--accent); +.chart-expand-btn:hover { + color: var(--text-main); + border-color: var(--text-muted); } -/* Tableau requêtes */ -.query-section .report-table td, -.query-section .report-table th { white-space: nowrap; } -.query-best { color: #3fb950; font-weight: 600; } -.query-worst { color: #f85149; } -.query-slow { color: #e3a945; } -.query-fail { color: var(--text-faint); font-style: italic; } - -/* ── Empty state ─────────────────────────────────────────────────────────── */ -.empty-state { - text-align: center; - padding: 60px 20px; - border: 1px dashed var(--color-border); - border-radius: 8px; - margin-top: 40px; -} -.empty-state-icon { font-size: 32px; margin-bottom: 12px; } -.empty-state-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: #f85149; } -.empty-state-msg { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; } -.empty-state-hint { font-size: 12px; color: var(--color-muted); } -.empty-state-hint code { - font-family: var(--font-mono); - background: var(--color-surface2); - padding: 1px 6px; - border-radius: 3px; +.chart-fullscreen { + position: fixed !important; + inset: 20px !important; + z-index: 1001; + border-radius: var(--radius-lg) !important; + margin: 0 !important; + width: auto !important; + flex: none !important; +} +.chart-fullscreen .chart-canvas-wrap { + height: calc(100% - 48px) !important; } -.query-ratio { font-size: 10px; color: var(--text-faint); margin-left: 2px; } -/* ── Footer ───────────────────────────────────────────────────────────────── */ -.page-footer { - border-top: 1px solid var(--border-color); - margin-top: 48px; - padding: 20px 20px; - text-align: center; - font-size: 11px; - color: var(--text-faint); +.chart-backdrop { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.65); + z-index: 1000; + cursor: pointer; } -.page-footer a { color: var(--accent); text-decoration: none; } -.page-footer a:hover { text-decoration: underline; } -/* ── Dataset filter pills (header) ───────────────────────────────────────── */ -.header-pills-row { +/* ── Table filter bar (All Results / Best per Query) ──────────────────────── */ +.table-filter-bar { display: flex; - align-items: center; - justify-content: space-between; - flex-wrap: wrap; gap: 8px; - margin-top: 6px; -} -.engine-pills { - display: flex; - flex-wrap: wrap; - gap: 12px; - align-items: center; -} -.engine-family-group { - display: flex; - align-items: center; - gap: 5px; -} -.engine-family-label { - font-size: 11px; - font-weight: 600; - font-family: var(--font-mono); - text-transform: uppercase; - letter-spacing: 0.04em; - margin-right: 2px; - white-space: nowrap; + margin-bottom: 10px; } -.engine-pill { - display: inline-flex; - align-items: center; - gap: 5px; - font-size: 12px; - color: var(--text-muted); - font-family: var(--font-mono); - background: var(--bg-surface); + +.table-filter-btn { + padding: 5px 14px; border: 1px solid var(--border-color); - border-radius: 12px; - padding: 3px 10px; + border-radius: var(--radius-md); + background: var(--bg-surface); + color: var(--text-muted); + font-size: 12px; + font-weight: 500; + font-family: var(--font-sans); cursor: pointer; transition: all 0.15s; - user-select: none; } -.engine-pill:hover { - border-color: var(--accent); +.table-filter-btn:hover { + background: var(--bg-surface-hover); color: var(--text-main); } -.engine-pill.ep-active { +.table-filter-btn.active { + background: var(--accent); + color: #fff; border-color: var(--accent); - background: var(--bg-surface-active); - color: var(--text-main); -} -.engine-pill.ep-dimmed { - opacity: 0.4; } -.pill-sign { - font-size: 13px; - font-weight: 700; - line-height: 1; - margin-left: 2px; - color: var(--accent); -} -.engine-pill.ep-dimmed .pill-sign { color: var(--text-faint); } -.dataset-filter-pills { + +/* ── Filter bar ───────────────────────────────────────────────────────────── */ +.filter-bar { display: flex; - gap: 6px; flex-wrap: wrap; + gap: 6px; + margin-bottom: 20px; } -.dataset-pill { - display: inline-flex; - align-items: center; - font-size: 11px; - font-weight: 600; - padding: 3px 12px; - border-radius: 12px; + +.filter-btn { + padding: 6px 14px; border: 1px solid var(--border-color); + border-radius: 20px; background: var(--bg-surface); color: var(--text-muted); + font-size: 12px; + font-weight: 500; + font-family: var(--font-sans); cursor: pointer; transition: all 0.15s; } -.dataset-pill:hover { + +.filter-btn:hover { background: var(--bg-surface-hover); - border-color: var(--accent); color: var(--text-main); + border-color: var(--text-muted); } -.dataset-pill.active { + +.filter-btn.active { background: var(--accent); - border-color: var(--accent); color: #fff; + border-color: var(--accent); } -/* ── Chart zoom modal ─────────────────────────────────────────────────────── */ -.chart-zoom-dialog { - position: fixed; - top: 50%; left: 50%; - transform: translate(-50%, -50%); - width: min(92vw, 1100px); - max-height: 90vh; - margin: 0; - padding: 0; - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: 10px; - box-shadow: 0 12px 48px rgba(0,0,0,0.6); - overflow: hidden; -} -.chart-zoom-dialog::backdrop { - background: rgba(0,0,0,0.65); -} -.chart-zoom-inner { - display: flex; - flex-direction: column; - height: 80vh; - padding: 16px 20px 20px; - box-sizing: border-box; -} -.chart-zoom-header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 12px; - flex-shrink: 0; -} -.chart-zoom-title { - font-size: 15px; - font-weight: 600; - color: var(--text-primary); -} -.chart-zoom-actions { - display: flex; - align-items: center; - gap: 8px; -} -#chart-zoom-canvas { - flex: 1; - min-height: 0; +.log-scale-btn { + margin-left: auto; + border-style: dashed; } -/* ── Dataset modal ────────────────────────────────────────────────────────── */ -.dataset-modal-dialog { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - margin: 0; - background: var(--bg-surface); - border: 1px solid var(--border-color); - border-radius: 10px; - padding: 0; - min-width: 380px; - max-width: 540px; - width: 90vw; - color: var(--text-main); - box-shadow: 0 8px 32px rgba(0,0,0,0.4); -} -.dataset-modal-dialog::backdrop { - background: rgba(0,0,0,0.55); -} -.modal-inner { - padding: 20px 24px 24px; -} -.modal-top { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 16px; - border-bottom: 1px solid var(--border-subtle); - padding-bottom: 12px; -} -.modal-title { - font-size: 15px; - font-weight: 700; +.log-scale-btn.active { + background: var(--status-timeout); + border-color: var(--status-timeout); + color: #fff; } -.modal-close { - background: none; - border: none; + +/* ── Tables ───────────────────────────────────────────────────────────────── */ +.table-section-title { + font-size: 13px; + font-weight: 600; color: var(--text-muted); - cursor: pointer; - font-size: 16px; - line-height: 1; - padding: 2px 6px; - border-radius: 4px; - transition: color 0.15s; -} -.modal-close:hover { color: var(--text-main); } -.modal-info-grid { - display: flex; - flex-direction: column; - gap: 10px; -} -.info-row { - display: grid; - grid-template-columns: 100px 1fr; - gap: 8px; - font-size: 12px; - align-items: start; -} -.info-label { - font-weight: 700; - color: var(--text-faint); text-transform: uppercase; - font-size: 10px; - letter-spacing: .05em; - padding-top: 2px; -} -.info-code { - font-family: var(--font-mono); - font-size: 11px; -} -.modal-link { - color: var(--accent); - font-size: 11px; - word-break: break-all; - text-decoration: none; -} -.modal-link:hover { text-decoration: underline; } - -.modal-queries-details { - margin-top: 14px; - border-top: 1px solid var(--border-subtle); - padding-top: 10px; -} -.modal-queries-summary { - list-style: none; - cursor: pointer; - font-size: 12px; - color: var(--accent); - display: flex; - align-items: center; - gap: 5px; - user-select: none; -} -.modal-queries-summary::-webkit-details-marker { display: none; } -.modal-queries-summary svg { transition: transform 0.2s; } -.modal-queries-details[open] .modal-queries-summary svg { transform: rotate(90deg); } -.modal-queries-list { - margin-top: 8px; - display: flex; - flex-direction: column; - gap: 6px; - max-height: 320px; - overflow-y: auto; -} - -.modal-files-list { - display: flex; - flex-direction: column; - gap: 2px; - margin-top: 14px; - border-top: 1px solid var(--border-subtle); - padding-top: 12px; -} -.modal-file-link { - display: inline-flex; - align-items: center; - gap: 5px; - color: var(--accent); - font-size: 12px; - font-family: var(--font-mono); - text-decoration: none; - padding: 4px 0; - transition: color 0.15s; -} -.modal-file-link:hover { color: var(--accent-hover); text-decoration: underline; } -.modal-file-link--plain { color: var(--text-muted); cursor: default; } -.modal-file-link--plain:hover { text-decoration: none; color: var(--text-muted); } - -/* ── Reference engine button ──────────────────────────────────────────────── */ -.btn-set-ref { - background: none; - border: none; - color: var(--text-faint); - cursor: pointer; - font-size: 15px; - line-height: 1; - padding: 0 4px; - transition: color 0.15s; + letter-spacing: 0.5px; + margin-bottom: 10px; } -.btn-set-ref:hover { color: var(--text-main); } -.btn-set-ref.is-ref { color: #f1c232; } - -.dataset-card { cursor: pointer !important; } -/* ── W3C Conformance section ─────────────────────────────────────────────── */ -.w3c-pass-bar-wrap { - display: flex; - align-items: center; - gap: 12px; - margin-top: 14px; -} -.w3c-pass-bar-track { - flex: 1; - height: 8px; - background: var(--border-color); - border-radius: 4px; +.table-surface { + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); overflow: hidden; } -.w3c-pass-bar-fill { - height: 100%; - border-radius: 4px; - transition: width 0.6s ease; -} -.w3c-pass-bar-label { - font-size: 13px; - font-weight: 700; - font-family: var(--font-mono); - min-width: 52px; - text-align: right; -} -.w3c-card-pass .kpi-winner-value { color: #3fb950; } -.w3c-card-fail .kpi-winner-value { color: #f85149; } -.w3c-fail-cell { color: #f85149; font-weight: 600; } -.w3c-pct-cell { font-weight: 600; font-family: var(--font-mono); } -.text-muted-cell { color: var(--text-muted); font-size: 11px; white-space: nowrap; } -#section-w3c .report-table td, #section-w3c .report-table th { white-space: nowrap; } -.w3c-failed-details { margin-top: 16px; } -/* ── Responsive ───────────────────────────────────────────────────────────── */ -@media (max-width: 768px) { - .header-top-row { flex-direction: column; align-items: flex-start; } - .metrics-grid { grid-template-columns: repeat(2, 1fr); } - .metrics-grid > :nth-child(4) { grid-column: span 2; } - .run-info-bar { flex-direction: column; align-items: flex-start; gap: 8px; } +.table-scroll { + overflow-x: auto; } -/* ── New layout: header / sidebar / content ─── */ -.app-wrapper { - /* override: remove old max-width + padding — layout now uses sidebar */ - max-width: none; - padding: 0; - display: flex; - flex-direction: column; - min-height: 100vh; +.data-table { + width: 100%; + border-collapse: collapse; + font-size: 12px; } -.page-header { - display: flex; - flex-direction: column; - padding: 0 20px; - position: sticky; - top: 0; - z-index: 100; - background-color: var(--bg-surface); +.data-table th { + background: var(--bg-surface-active); + color: var(--text-muted); + font-weight: 600; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.5px; + padding: 8px 12px; + text-align: left; border-bottom: 1px solid var(--border-color); - padding-bottom: 0; - margin-bottom: 0; + white-space: nowrap; } -.header-top-row { - display: flex; - align-items: center; - gap: 16px; - height: 44px; -} +.data-table th.text-right { text-align: right; } -.header-bottom-row { - display: flex; - align-items: stretch; - padding: 0; - border-top: 1px solid var(--border-color); - height: 34px; -} +.data-table th.sortable:hover { color: var(--text-main); background: var(--bg-surface-hover); } -.header-brand { flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; } -.brand-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; } -.brand-run-date { font-size: 10px; color: var(--text-muted); white-space: nowrap; } +.sort-icon { font-size: 10px; color: var(--accent); } -.comparator-bar { - display: flex; - align-items: center; - gap: 8px; - flex: 1; - min-width: 0; - background: var(--bg-page); - border: 1px solid var(--border-color); - border-radius: var(--radius-md); - padding: 3px 10px; - overflow: hidden; +.data-table td { + padding: 7px 12px; + border-bottom: 1px solid var(--border-subtle); + color: var(--text-main); + white-space: nowrap; } -.dataset-filter-bar { - display: flex; - align-items: stretch; - gap: 0; - background: transparent; - border: none; - padding: 0; - flex: 1; - min-width: 0; +.data-table tbody tr { + transition: background 0.1s; } -.dataset-pills-wrap { - display: flex; - align-items: stretch; - gap: 0; +.data-table tbody tr:hover { + background: var(--bg-surface-hover); } -.dataset-pill { - display: inline-flex; - align-items: center; - padding: 0 16px; - font-size: 12px; - font-weight: 500; - border: none; - border-right: 1px solid var(--border-color); - background: transparent; - color: var(--text-muted); - cursor: pointer; - white-space: nowrap; - transition: color 0.15s, background 0.15s; - position: relative; -} -.dataset-pill:first-child { border-left: 1px solid var(--border-color); } -.dataset-pill:hover { color: var(--text-main); background: var(--bg-surface-hover); } -.dataset-pill.active { - color: var(--text-main); - background: var(--bg-surface-active); - font-weight: 600; +.data-table tbody tr.row-best { + background: rgba(253, 214, 99, 0.07); } -.dataset-pill.active::after { - content: ''; - position: absolute; - bottom: 0; - left: 0; - right: 0; - height: 2px; - background: var(--accent); +.data-table tbody tr.row-best:hover { + background: rgba(253, 214, 99, 0.13); } -.comparator-label { - font-size: 11px; - font-weight: 700; - text-transform: uppercase; - color: var(--text-faint); - letter-spacing: 0.5px; - white-space: nowrap; -} - -.engine-pills-wrap { - display: flex; - align-items: center; - gap: 6px; - flex-wrap: nowrap; - overflow-x: auto; - flex: 1; - min-width: 0; - scrollbar-width: none; +/* ── Dataset sections ─────────────────────────────────────────────────────── */ +.dataset-section { + margin-bottom: 36px; } -.engine-pills-wrap::-webkit-scrollbar { display: none; } -.pills-scroll-btn { - flex-shrink: 0; - display: none; /* shown by JS when overflow */ - background: none; - border: 1px solid var(--border); - border-radius: var(--radius-sm); - color: var(--text-secondary); +.dataset-title { font-size: 16px; - line-height: 1; - padding: 1px 6px 3px; - cursor: pointer; - transition: opacity 0.15s, color 0.15s; + font-weight: 600; + margin-bottom: 16px; + text-transform: capitalize; + color: var(--accent); } -.pills-scroll-btn:hover { color: var(--text-main); } -/* engine pills in comparator bar — reuse .engine-pill class */ -.engine-pills-wrap .engine-pill { - display: inline-flex; - align-items: center; - gap: 5px; +/* ── Status badges ────────────────────────────────────────────────────────── */ +.status-badge { + display: inline-block; padding: 2px 8px; - border-radius: var(--radius-sm); + border-radius: 4px; font-size: 11px; font-weight: 600; - border: 1px solid transparent; - white-space: nowrap; - cursor: pointer; - transition: opacity 0.15s, transform 0.15s; - user-select: none; -} -.engine-pills-wrap .engine-pill:hover { transform: translateY(-1px); } -.engine-pills-wrap .engine-pill.ep-dimmed { opacity: 0.35; } -.engine-pills-wrap .engine-pill.ep-active { box-shadow: 0 0 0 2px currentColor; } -.engine-pills-wrap .engine-pill.pill-dragging { opacity: 0.4; cursor: grabbing; } -.engine-pills-wrap .engine-pill.pill-drag-over { outline: 2px dashed currentColor; outline-offset: 2px; } - -.engine-pills-wrap .pill-version { - font-family: var(--font-mono); - font-size: 10px; - background: rgba(0,0,0,0.08); - padding: 1px 4px; - border-radius: 2px; + letter-spacing: 0.5px; } -[data-theme="dark"] .engine-pills-wrap .pill-version, -:root:not([data-theme="light"]) .engine-pills-wrap .pill-version { background: rgba(255,255,255,0.12); } -.engine-pills-wrap .pill-remove-btn { - background: none; - border: none; - cursor: pointer; - color: inherit; - opacity: 0.55; - font-size: 13px; - line-height: 1; - padding: 0 1px; - display: flex; - align-items: center; +/* ── W3C KPI grid ─────────────────────────────────────────────────────────── */ +.w3c-kpi-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); + gap: 12px; + margin-bottom: 16px; } -.engine-pills-wrap .pill-remove-btn:hover { opacity: 1; } -.btn-add-engine-trigger { - display: inline-flex; - align-items: center; - gap: 5px; - padding: 3px 9px; - border: 1px dashed var(--border-color); - border-radius: var(--radius-sm); +.w3c-kpi-card { background: var(--bg-surface); - color: var(--text-muted); - font-size: 11px; - font-weight: 600; - cursor: pointer; - white-space: nowrap; - flex-shrink: 0; - transition: all 0.15s; + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + padding: 14px 16px; } -.btn-add-engine-trigger:hover { border-color: var(--accent); color: var(--accent); } -.header-right { - display: flex; - align-items: center; - gap: 10px; - flex-shrink: 0; +.w3c-kpi-label { + font-size: 10px; + font-weight: 700; + letter-spacing: 0.8px; + text-transform: uppercase; + color: var(--text-muted); + margin-bottom: 6px; } -/* ── App body: sidebar + content ─── */ -.app-body { - display: flex; - flex: 1; - min-height: 0; +.w3c-kpi-value { + font-size: 28px; + font-weight: 700; + font-variant-numeric: tabular-nums; + line-height: 1; + margin-bottom: 4px; } -.app-sidebar { - width: 220px; - flex-shrink: 0; - background: var(--bg-surface); - border-right: 1px solid var(--border-color); - padding: 16px 12px; - display: flex; - flex-direction: column; - gap: 16px; - position: sticky; - top: 56px; - height: calc(100vh - 56px); - overflow-y: auto; +.w3c-kpi-sub { + font-size: 11px; + color: var(--text-faint); } -.sidebar-search-box input { - width: 100%; - padding: 6px 10px; - background: var(--bg-page); +/* ── W3C card ─────────────────────────────────────────────────────────────── */ +.w3c-card { + background: var(--bg-surface); border: 1px solid var(--border-color); - border-radius: var(--radius-sm); - color: var(--text-main); - font-size: 12px; - font-family: var(--font-sans); - outline: none; - transition: border-color 0.15s; + border-radius: var(--radius-lg); + padding: 32px; + max-width: 520px; + text-align: center; } -.sidebar-search-box input:focus { border-color: var(--accent); } -.sidebar-group { display: flex; flex-direction: column; gap: 2px; } - -.sidebar-heading { - font-size: 10.5px; - font-weight: 700; - text-transform: uppercase; - letter-spacing: 0.6px; - color: var(--text-faint); - padding: 0 8px; - margin-bottom: 4px; +.w3c-rate-section { + margin-bottom: 20px; } -.sidebar-nav-list { list-style: none; display: flex; flex-direction: column; gap: 1px; } +.w3c-rate-number { + font-size: 52px; + font-weight: 800; + color: var(--status-pass); + line-height: 1; + margin-bottom: 6px; +} -.sidebar-nav-item { - display: flex; - align-items: center; - justify-content: space-between; - padding: 6px 10px; - border-radius: var(--radius-sm); +.w3c-rate-detail { + font-size: 15px; color: var(--text-muted); - font-size: 12px; font-weight: 500; - cursor: pointer; - border-left: 2px solid transparent; - text-decoration: none; - transition: all 0.1s; - user-select: none; } -.sidebar-nav-item:hover { background: var(--bg-surface-hover); color: var(--text-main); } -.sidebar-nav-item.active { + +.w3c-progress { + height: 8px; background: var(--bg-surface-active); - color: var(--accent); - font-weight: 600; - border-left-color: var(--accent); + border-radius: 4px; + overflow: hidden; + margin-bottom: 20px; } -.sidebar-item-badge { - font-family: var(--font-mono); - font-size: 10px; - padding: 1px 5px; - border-radius: var(--radius-sm); - background: var(--bg-page); - border: 1px solid var(--border-color); - color: var(--text-faint); - white-space: nowrap; +.w3c-progress-fill { + height: 100%; + background: var(--status-pass); + border-radius: 4px; + transition: width 0.5s ease; } -.sidebar-footer-box { - margin-top: auto; - padding: 10px 12px; - border: 1px solid var(--border-color); - border-radius: var(--radius-sm); - background: var(--bg-page); - font-size: 11px; +.w3c-note { + font-size: 13px; color: var(--text-muted); line-height: 1.6; + margin-bottom: 20px; } -.sidebar-footer-box strong { color: var(--text-main); display: block; margin-bottom: 3px; font-size: 11px; } -.sidebar-footer-box code { font-family: var(--font-mono); font-size: 10px; color: var(--accent); } -.meta-box-title { - display: block; - font-size: 10px; +.w3c-link-btn { + display: inline-block; + padding: 10px 24px; + background: var(--accent); + color: #fff !important; + border-radius: var(--radius-md); font-weight: 600; - text-transform: uppercase; - letter-spacing: .06em; - color: var(--text-muted); - margin-bottom: 6px; + font-size: 13px; + text-decoration: none !important; + transition: background 0.15s; } -.meta-box-grid { - display: grid; - grid-template-columns: auto 1fr; - column-gap: 10px; - row-gap: 3px; - margin: 0; - padding: 0; + +.w3c-link-btn:hover { + background: var(--accent-hover); } -.meta-box-grid dt { - color: var(--text-muted); - font-weight: 500; + +.w3c-spec-link { + color: var(--accent); + text-decoration: none; + font-size: 0.8rem; white-space: nowrap; } -.meta-box-grid dd { - margin: 0; - color: var(--text-main); - word-break: break-word; +.w3c-spec-link:hover { + text-decoration: underline; } -.meta-box-grid code { font-family: var(--font-mono); font-size: 10px; color: var(--accent); } -/* ── Main content area ─── */ -.app-content { - flex: 1; - min-width: 0; - padding: 28px 32px 60px; - overflow-y: auto; +/* ── Transparency grid ────────────────────────────────────────────────────── */ +.transparency-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); + gap: 16px; } -.page-section { - margin-bottom: 48px; - scroll-margin-top: 72px; /* header height + 16 */ +.info-card { + background: var(--bg-surface); + border: 1px solid var(--border-color); + border-radius: var(--radius-md); + padding: 20px; } -.section-head-bar { +.info-card-header { display: flex; align-items: center; - justify-content: space-between; + gap: 8px; margin-bottom: 14px; - padding-bottom: 10px; - border-bottom: 1px solid var(--border-color); } -.section-meta { - font-size: 11px; - color: var(--text-faint); - font-family: var(--font-mono); +.info-card-icon { + font-size: 20px; } -/* ── Add engine modal overlay ─── */ -.modal-overlay { - position: fixed; - inset: 0; - background: rgba(0,0,0,0.45); - backdrop-filter: blur(2px); - display: flex; - align-items: center; - justify-content: center; - z-index: 200; - opacity: 0; - pointer-events: none; - transition: opacity 0.15s; +.info-card-title { + font-size: 15px; + font-weight: 600; +} + +.info-card-list { + display: grid; + grid-template-columns: auto 1fr; + gap: 4px 12px; + font-size: 12px; +} + +.info-card-list dt { + color: var(--text-muted); + font-weight: 500; } -.modal-overlay.active { opacity: 1; pointer-events: auto; } -.modal-card { +.info-card-list dd { + color: var(--text-main); + word-break: break-all; +} + +/* ── Result dialog (modal) ────────────────────────────────────────────────── */ +.result-dialog { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + max-width: 640px; + width: 90vw; + max-height: 85vh; + overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-color); - border-radius: var(--radius-md); - width: 100%; - max-width: 400px; - padding: 20px 22px; - box-shadow: 0 8px 24px rgba(0,0,0,0.25); + border-radius: var(--radius-lg); + padding: 0; + color: var(--text-main); + z-index: 1000; } -.modal-card-title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; } -.modal-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; } -.modal-engine-list { - list-style: none; - display: flex; - flex-direction: column; - gap: 6px; - max-height: 300px; - overflow-y: auto; - margin-bottom: 16px; +.result-dialog::backdrop { + background: rgba(0, 0, 0, 0.6); +} + +.result-dialog-inner { + padding: 24px; } -.modal-engine-item { + +.result-dialog-header { display: flex; align-items: center; - justify-content: space-between; - padding: 8px 12px; - border: 1px solid var(--border-color); - border-radius: var(--radius-sm); - background: var(--bg-page); + gap: 12px; + margin-bottom: 20px; +} + +.result-dialog-header h3 { + flex: 1; + font-size: 16px; + font-weight: 600; +} + +.dialog-close-btn { + background: none; + border: none; + color: var(--text-muted); + font-size: 18px; cursor: pointer; - transition: all 0.12s; + padding: 4px 8px; + border-radius: var(--radius-sm); } -.modal-engine-item:hover { border-color: var(--accent); background: var(--bg-surface-hover); } -.modal-engine-item.active { border-color: var(--accent); background: var(--bg-surface-active); } -.modal-engine-name { font-size: 12px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 8px; } -.modal-engine-status { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); } -.modal-engine-item.active .modal-engine-status { color: var(--accent); } -.modal-form-group { margin-bottom: 14px; } -.modal-form-label { - display: block; - font-size: 11px; - font-weight: 700; +.dialog-close-btn:hover { + background: var(--bg-surface-hover); + color: var(--text-main); +} + +.result-dialog-section { + margin-bottom: 20px; +} + +.result-dialog-section h4 { + font-size: 12px; + font-weight: 600; + color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; - color: var(--text-faint); - margin-bottom: 6px; + margin-bottom: 8px; } -.modal-form-select { - width: 100%; - padding: 7px 10px; + +.sparql-display { background: var(--bg-page); border: 1px solid var(--border-color); border-radius: var(--radius-sm); + padding: 12px; + font-size: 11px; + font-family: var(--font-mono); + overflow-x: auto; + white-space: pre-wrap; + word-break: break-all; + max-height: 180px; + overflow-y: auto; color: var(--text-main); - font-size: 13px; - font-family: var(--font-sans); - outline: none; - cursor: pointer; - transition: border-color 0.15s; } -.modal-form-select:focus { border-color: var(--accent); } -.modal-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; } -.btn-modal-cancel { - padding: 6px 14px; + +.result-dialog-grid { + display: flex; + flex-direction: column; + gap: 10px; +} + +.comparison-row { background: var(--bg-page); border: 1px solid var(--border-color); border-radius: var(--radius-sm); - color: var(--text-main); - font-size: 12px; - font-weight: 600; - cursor: pointer; - transition: all 0.12s; + padding: 10px 14px; } -.btn-modal-cancel:hover { background: var(--bg-surface-hover); } -.btn-modal-submit { - padding: 6px 16px; - background: var(--accent); - border: 1px solid transparent; - border-radius: var(--radius-sm); - color: #fff; + +.comparison-row.mismatch { + border-color: var(--status-mismatch); + background: rgba(231, 76, 60, 0.08); +} + +.comparison-label { font-size: 12px; font-weight: 600; - cursor: pointer; - transition: all 0.12s; + margin-bottom: 6px; } -.btn-modal-submit:hover { opacity: 0.88; } - -/* engine pill colors in comparator bar */ -.engine-pills-wrap .engine-pill.family-corese { background: var(--corese-bg); border-color: var(--corese-color); color: var(--corese-color); } -.engine-pills-wrap .engine-pill.family-jena { background: var(--jena-bg); border-color: var(--jena-color); color: var(--jena-color); } -.engine-pills-wrap .engine-pill.family-rdf4j { background: var(--rdf4j-bg); border-color: var(--rdf4j-color); color: var(--rdf4j-color); } -/* ── Overview section ─────────────────────────────────────────────────────── */ -.metric-sub-label { +.comparison-expected, +.comparison-actual { font-size: 11px; - color: var(--text-faint); - margin-bottom: 10px; -} - -.kpi-breakdown { display: flex; - flex-direction: column; gap: 6px; + align-items: baseline; } -.kpi-breakdown-row { - display: flex; - align-items: center; - justify-content: space-between; +.comparison-expected small, +.comparison-actual small { + color: var(--text-muted); + min-width: 60px; +} + +.result-dialog-metrics { + display: grid; + grid-template-columns: auto 1fr; + gap: 4px 16px; + font-size: 12px; +} + +.result-dialog-metrics dt { + color: var(--text-muted); +} + +.result-dialog-error { + margin-top: 10px; + padding: 8px 12px; + background: rgba(142, 68, 173, 0.1); + border: 1px solid var(--status-error); + border-radius: var(--radius-sm); font-size: 12px; + color: var(--status-error); +} + +/* ── Error state ──────────────────────────────────────────────────────────── */ +.error-state { + text-align: center; + padding: 80px 24px; + color: var(--text-muted); } -.kpi-breakdown-name { +.error-icon { + width: 48px; + height: 48px; + margin: 0 auto 16px; + background: var(--status-mismatch); + color: #fff; + border-radius: 50%; display: flex; align-items: center; - gap: 6px; - color: var(--text-muted); - font-weight: 500; + justify-content: center; + font-size: 24px; + font-weight: 700; } -.kpi-breakdown-val { - font-family: var(--font-mono); +.error-title { + font-size: 18px; font-weight: 600; - font-size: 12px; color: var(--text-main); + margin-bottom: 8px; } -.kpi-best { - color: #3fb950; - background: rgba(63,185,80,0.1); - border: 1px solid rgba(63,185,80,0.25); - padding: 1px 6px; - border-radius: var(--radius-sm); +.error-message { + font-size: 14px; + margin-bottom: 8px; } -[data-theme="light"] .kpi-best { - color: #1a7f37; - background: rgba(26,127,55,0.08); - border-color: rgba(26,127,55,0.2); +.error-hint { + font-size: 12px; } -.kpi-single { gap: 0; } -.kpi-big { - font-size: 28px; - font-weight: 700; +.error-hint code { font-family: var(--font-mono); - line-height: 1; - color: var(--text-main); + background: var(--bg-surface); + padding: 2px 6px; + border-radius: 3px; } -.overview-charts-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 14px; - margin-top: 16px; +/* ── Footer ───────────────────────────────────────────────────────────────── */ +.page-footer { + border-top: 1px solid var(--border-color); + padding: 16px 24px; + text-align: center; + font-size: 12px; + color: var(--text-muted); + max-width: 1280px; + margin: 0 auto; } -@media (max-width: 750px) { - .overview-charts-grid { grid-template-columns: 1fr; } +/* ── Responsive ───────────────────────────────────────────────────────────── */ +@media (max-width: 640px) { + .app-wrapper { padding: 0 12px; } + .kpi-grid { grid-template-columns: 1fr; } + .charts-row { grid-template-columns: 1fr; } + .transparency-grid { grid-template-columns: 1fr; } + .tab-btn { padding: 6px 10px; font-size: 12px; } + .sticky-pill { font-size: 10px; padding: 4px 10px; } } diff --git a/site/vendor/chart.umd.min.js b/site/vendor/chart.umd.min.js new file mode 100644 index 0000000..c0f9743 --- /dev/null +++ b/site/vendor/chart.umd.min.js @@ -0,0 +1,20 @@ +/** + * Skipped minification because the original files appears to be already minified. + * Original file: /npm/chart.js@4.4.3/dist/chart.umd.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/*! + * Chart.js v4.4.3 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";var t=Object.freeze({__proto__:null,get Colors(){return Go},get Decimation(){return Qo},get Filler(){return ma},get Legend(){return ya},get SubTitle(){return ka},get Title(){return Ma},get Tooltip(){return Ba}});function e(){}const i=(()=>{let t=0;return()=>t++})();function s(t){return null==t}function n(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function o(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function r(t,e){return a(t)?t:e}function l(t,e){return void 0===t?e:t}const h=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,c=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function d(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function u(t,e,i,s){let a,r,l;if(n(t))if(r=t.length,s)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;at,x:t=>t.x,y:t=>t.y};function v(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function M(t,e){const i=y[e]||(y[e]=function(t){const e=v(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}const k=t=>void 0!==t,S=t=>"function"==typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function D(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const C=Math.PI,O=2*C,A=O+C,T=Number.POSITIVE_INFINITY,L=C/180,E=C/2,R=C/4,I=2*C/3,z=Math.log10,F=Math.sign;function V(t,e,i){return Math.abs(t-e)t-e)).pop(),e}function N(t){return!isNaN(parseFloat(t))&&isFinite(t)}function H(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function j(t,e,i){let s,n,o;for(s=0,n=t.length;sl&&h=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function et(t,e,i){i=i||(i=>t[i]1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const it=(t,e,i,s)=>et(t,i,s?s=>{const n=t[s][e];return nt[s][e]et(t,i,(s=>t[s][e]>=i));function nt(t,e,i){let s=0,n=t.length;for(;ss&&t[n-1]>i;)n--;return s>0||n{const i="_onData"+w(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function rt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(ot.forEach((e=>{delete t[e]})),delete t._chartjs)}function lt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ht="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ct(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ht.call(window,(()=>{s=!1,t.apply(e,i)})))}}function dt(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const ut=t=>"start"===t?"left":"end"===t?"right":"center",ft=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,gt=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function pt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=J(Math.min(it(r,l,h).lo,i?s:it(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?J(Math.max(it(r,a.axis,c,!0).hi+1,i?0:it(e,l,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}function mt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}class xt{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=ht.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var bt=new xt; +/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e);function vt(t){return yt(_t(2.55*t),0,255)}function Mt(t){return yt(_t(255*t),0,255)}function wt(t){return yt(_t(t/2.55)/100,0,1)}function kt(t){return yt(_t(100*t),0,100)}const St={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Pt=[..."0123456789ABCDEF"],Dt=t=>Pt[15&t],Ct=t=>Pt[(240&t)>>4]+Pt[15&t],Ot=t=>(240&t)>>4==(15&t);function At(t){var e=(t=>Ot(t.r)&&Ot(t.g)&&Ot(t.b)&&Ot(t.a))(t)?Dt:Ct;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Tt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Lt(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Et(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Rt(t,e,i){const s=Lt(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function It(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e>16&255,o>>8&255,255&o]}return t}(),Ht.transparent=[0,0,0,0]);const e=Ht[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const $t=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Yt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Ut=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xt(t,e,i){if(t){let s=It(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Ft(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function qt(t,e){return t?Object.assign(e||{},t):t}function Kt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Mt(t[3]))):(e=qt(t,{r:0,g:0,b:0,a:1})).a=Mt(e.a),e}function Gt(t){return"r"===t.charAt(0)?function(t){const e=$t.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?vt(t):yt(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?vt(i):yt(i,0,255)),s=255&(e[4]?vt(s):yt(s,0,255)),n=255&(e[6]?vt(n):yt(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):Bt(t)}class Zt{constructor(t){if(t instanceof Zt)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=Kt(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*St[s[1]],g:255&17*St[s[2]],b:255&17*St[s[3]],a:5===o?17*St[s[4]]:255}:7!==o&&9!==o||(n={r:St[s[1]]<<4|St[s[2]],g:St[s[3]]<<4|St[s[4]],b:St[s[5]]<<4|St[s[6]],a:9===o?St[s[7]]<<4|St[s[8]]:255})),i=n||jt(t)||Gt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=qt(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=Kt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?At(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=It(t),i=e[0],s=kt(e[1]),n=kt(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${wt(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=Ut(wt(t.r)),n=Ut(wt(t.g)),o=Ut(wt(t.b));return{r:Mt(Yt(s+i*(Ut(wt(e.r))-s))),g:Mt(Yt(n+i*(Ut(wt(e.g))-n))),b:Mt(Yt(o+i*(Ut(wt(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Zt(this.rgb)}alpha(t){return this._rgb.a=Mt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=_t(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Xt(this._rgb,2,t),this}darken(t){return Xt(this._rgb,2,-t),this}saturate(t){return Xt(this._rgb,1,t),this}desaturate(t){return Xt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=It(t);i[0]=Vt(i[0]+e),i=Ft(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Jt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Qt(t){return Jt(t)?t:new Zt(t)}function te(t){return Jt(t)?t:new Zt(t).saturate(.5).darken(.1).hexString()}const ee=["x","y","borderWidth","radius","tension"],ie=["color","borderColor","backgroundColor"];const se=new Map;function ne(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=se.get(i);return s||(s=new Intl.NumberFormat(t,e),se.set(i,s)),s}(e,i).format(t)}const oe={values:t=>n(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=z(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ne(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(z(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?oe.numeric.call(this,t,e,i):""}};var ae={formatters:oe};const re=Object.create(null),le=Object.create(null);function he(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>te(e.backgroundColor),this.hoverBorderColor=(t,e)=>te(e.borderColor),this.hoverColor=(t,e)=>te(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return ce(this,t,e)}get(t){return he(this,t)}describe(t,e){return ce(le,t,e)}override(t,e){return ce(re,t,e)}route(t,e,i,s){const n=he(this,t),a=he(this,i),r="_"+e;Object.defineProperties(n,{[r]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=a[s];return o(t)?Object.assign({},e,t):l(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach((t=>t(this)))}}var ue=new de({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:ie},numbers:{type:"number",properties:ee}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ae.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function fe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ge(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function pe(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const me=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function xe(t,e){return me(t).getPropertyValue(e)}const be=["top","right","bottom","left"];function _e(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=be[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const ye=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ve(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=me(i),o="border-box"===n.boxSizing,a=_e(n,"padding"),r=_e(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(ye(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const Me=t=>Math.round(10*t)/10;function we(t,e,i,s){const n=me(t),o=_e(n,"margin"),a=pe(n.maxWidth,t,"clientWidth")||T,r=pe(n.maxHeight,t,"clientHeight")||T,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=t&&ge(t);if(o){const t=o.getBoundingClientRect(),a=me(o),r=_e(a,"border","width"),l=_e(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=pe(a.maxWidth,o,"clientWidth"),n=pe(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||T,maxHeight:n||T}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=_e(n,"border","width"),e=_e(n,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-o.width),c=Math.max(0,s?h/s:c-o.height),h=Me(Math.min(h,a,l.maxWidth)),c=Me(Math.min(c,r,l.maxHeight)),h&&!c&&(c=Me(h/2));return(void 0!==e||void 0!==i)&&s&&l.height&&c>l.height&&(c=l.height,h=Me(Math.floor(c*s))),{width:h,height:c}}function ke(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Se=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};fe()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Pe(t,e){const i=xe(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function De(t){return!t||s(t.size)||s(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Ce(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function Oe(t,e,i,s){let o=(s=s||{}).data=s.data||{},a=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(o=s.data={},a=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let r=0;const l=i.length;let h,c,d,u,f;for(h=0;hi.length){for(h=0;h0&&t.stroke()}}function Re(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let c,d;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),s(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),c=0;ct[0])){const o=i||t;void 0===s&&(s=ti("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>je([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>qe(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=ti(Ue(o,t),i),void 0!==n)return Xe(t,n)?Je(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ei(t).includes(e),ownKeys:t=>ei(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function $e(t,e,i,s){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ye(t,s),setContext:e=>$e(t,e,i,s),override:n=>$e(t.override(n),e,i,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>qe(t,e,(()=>function(t,e,i){const{_proxy:s,_context:a,_subProxy:r,_descriptors:l}=t;let h=s[e];S(h)&&l.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(o,a||s);r.delete(t),Xe(t,l)&&(l=Je(n._scopes,n,t,l));return l}(e,h,t,i));n(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:n,_context:a,_subProxy:r,_descriptors:l}=i;if(void 0!==a.index&&s(t))return e[a.index%e.length];if(o(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const o of i){const i=Je(s,n,t,o);e.push($e(i,a,r&&r[t],l))}}return e}(e,h,t,l.isIndexable));Xe(e,h)&&(h=$e(h,a,r&&r[e],l));return h}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Ye(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:S(i)?i:()=>i,isIndexable:S(s)?s:()=>s}}const Ue=(t,e)=>t?t+w(e):e,Xe=(t,e)=>o(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function qe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const s=i();return t[e]=s,s}function Ke(t,e,i){return S(t)?t(e,i):t}const Ge=(t,e)=>!0===t?e:"string"==typeof t?M(e,t):void 0;function Ze(t,e,i,s,n){for(const o of e){const e=Ge(i,o);if(e){t.add(e);const o=Ke(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Je(t,e,i,s){const a=e._rootScopes,r=Ke(e._fallback,i,s),l=[...t,...a],h=new Set;h.add(s);let c=Qe(h,l,i,r||i,s);return null!==c&&((void 0===r||r===i||(c=Qe(h,l,r,c,s),null!==c))&&je(Array.from(h),[""],a,r,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const a=s[e];if(n(a)&&o(i))return i;return a||{}}(e,i,s))))}function Qe(t,e,i,s,n){for(;i;)i=Ze(t,e,i,s,n);return i}function ti(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function ei(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function ii(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;re"x"===t?"y":"x";function ai(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=q(o,n),l=q(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function ri(t,e="x"){const i=oi(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=ni(t,0);for(a=0;a!t.skip))),"monotone"===e.cubicInterpolationMode)ri(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o0===t||1===t,di=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/i),ui=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/i)+1,fi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*E),easeOutSine:t=>Math.sin(t*E),easeInOutSine:t=>-.5*(Math.cos(C*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ci(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ci(t)?t:di(t,.075,.3),easeOutElastic:t=>ci(t)?t:ui(t,.075,.3),easeInOutElastic(t){const e=.1125;return ci(t)?t:t<.5?.5*di(2*t,e,.45):.5+.5*ui(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-fi.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*fi.easeInBounce(2*t):.5*fi.easeOutBounce(2*t-1)+.5};function gi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function mi(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=gi(t,n,i),r=gi(n,o,i),l=gi(o,e,i),h=gi(a,r,i),c=gi(r,l,i);return gi(h,c,i)}const xi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _i(t,e){const i=(""+t).match(xi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const yi=t=>+t||0;function vi(t,e){const i={},s=o(e),n=s?Object.keys(e):e,a=o(t)?s?i=>l(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=yi(a(t));return i}function Mi(t){return vi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function wi(t){return vi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ki(t){const e=Mi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Si(t,e){t=t||{},e=e||ue.font;let i=l(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=l(t.style,e.style);s&&!(""+s).match(bi)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:l(t.family,e.family),lineHeight:_i(l(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:l(t.weight,e.weight),string:""};return n.string=De(n),n}function Pi(t,e,i,s){let o,a,r,l=!0;for(o=0,a=t.length;oi&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ci(t,e){return Object.assign(Object.create(t),e)}function Oi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ai(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Ti(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Li(t){return"angle"===t?{between:Z,compare:K,normalize:G}:{between:tt,compare:(t,e)=>t-e,normalize:t=>t}}function Ei({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Ri(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Li(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Li(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;hb||l(n,x,p)&&0!==r(n,x),v=()=>!b||0===r(o,p)||l(o,x,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==x&&(b=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(Ei({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=p));return null!==_&&g.push(Ei({start:_,end:d,loop:u,count:a,style:f})),g}function Ii(t,e){const i=[],s=t.segments;for(let n=0;nn&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return Fi(t,[{start:a,end:r,loop:o}],i,e);return Fi(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Xi={evaluateInteractionItems:Hi,modes:{index(t,e,i,s){const n=ve(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?ji(t,n,o,s,a):Yi(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=ve(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?ji(t,n,o,s,a):Yi(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tji(t,ve(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ve(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return Yi(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Ui(t,ve(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Ui(t,ve(e,t),"y",i.intersect,s)}};const qi=["left","top","right","bottom"];function Ki(t,e){return t.filter((t=>t.pos===e))}function Gi(t,e){return t.filter((t=>-1===qi.indexOf(t.pos)&&t.box.axis===e))}function Zi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ji(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!qi.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function ss(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;ot.box.fullSize)),!0),s=Zi(Ki(e,"left"),!0),n=Zi(Ki(e,"right")),o=Zi(Ki(e,"top"),!0),a=Zi(Ki(e,"bottom")),r=Gi(e,"x"),l=Gi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Ki(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;u(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),f=Object.assign({},n);ts(f,ki(s));const g=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),p=Ji(l.concat(h),d);ss(r.fullSize,g,d,p),ss(l,g,d,p),ss(h,g,d,p)&&ss(l,g,d,p),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(g),os(r.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,os(r.rightAndBottom,g,d,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},u(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})}))}};class rs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ls extends rs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const hs="$chartjs",cs={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ds=t=>null===t||""===t;const us=!!Se&&{passive:!0};function fs(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,us)}function gs(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ps(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gs(i.addedNodes,s),e=e&&!gs(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function ms(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||gs(i.removedNodes,s),e=e&&!gs(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const xs=new Map;let bs=0;function _s(){const t=window.devicePixelRatio;t!==bs&&(bs=t,xs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function ys(t,e,i){const s=t.canvas,n=s&&ge(s);if(!n)return;const o=ct(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){xs.size||window.addEventListener("resize",_s),xs.set(t,e)}(t,o),a}function vs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){xs.delete(t),xs.size||window.removeEventListener("resize",_s)}(t)}function Ms(t,e,i){const s=t.canvas,n=ct((e=>{null!==t.ctx&&i(function(t,e){const i=cs[t.type]||t.type,{x:s,y:n}=ve(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,us)}(s,e,n),n}class ws extends rs{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[hs]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",ds(n)){const e=Pe(t,"width");void 0!==e&&(t.width=e)}if(ds(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Pe(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[hs])return!1;const i=e[hs].initial;["height","width"].forEach((t=>{const n=i[t];s(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[hs],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:ps,detach:ms,resize:ys}[e]||Ms;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:vs,detach:vs,resize:vs}[e]||fs)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return we(t,e,i,s)}isAttached(t){const e=t&&ge(t);return!(!e||!e.isConnected)}}function ks(t){return!fe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ls:ws}var Ss=Object.freeze({__proto__:null,BasePlatform:rs,BasicPlatform:ls,DomPlatform:ws,_detectPlatform:ks});const Ps="transparent",Ds={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Qt(t||Ps),n=s.valid&&Qt(e||Ps);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Cs{constructor(t,e,i,s){const n=e[i];s=Pi([t.to,s,n,t.from]);const o=Pi([t.from,n,s]);this._active=!0,this._fn=t.fn||Ds[t.type||typeof o],this._easing=fi[t.easing]||fi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Pi([t.to,e,s,t.from]),this._from=Pi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const a=t[s];if(!o(a))return;const r={};for(const t of e)r[t]=a[t];(n(a.properties)&&a.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,r)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new Cs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(bt.add(this._chart,i),!0):void 0}}function As(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function Ts(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function zs(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function Vs(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const Bs=t=>"reset"===t||"none"===t,Ws=(t,e)=>e?t:Object.assign({},t);class Ns{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Es(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Vs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=l(i.xAxisID,Fs(t,"x")),o=e.yAxisID=l(i.yAxisID,Fs(t,"y")),a=e.rAxisID=l(i.rAxisID,Fs(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),c=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&rt(this._data,this),t._stacked&&Vs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(o(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:s}=e,n="x"===i.axis?"x":"y",o="x"===s.axis?"x":"y",a=Object.keys(t),r=new Array(a.length);let l,h,c;for(l=0,h=a.length;l0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,d=s;else{d=n(s[t])?this.parseArrayData(i,s,t,e):o(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const a=()=>null===c[l]||f&&c[l]t&&!e.hidden&&e._stacked&&{keys:Ts(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let u,f;function g(){f=s[u];const e=f[r.axis];return!a(f[t.axis])||c>e||d=0;--u)if(!g()){this.updateRangeFromParsed(h,t,f,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ws(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new Os(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Bs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){Bs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Bs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function js(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;io)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;nn)return e}return Math.max(n,1)}(a,e,o);if(r>0){let t,i;const n=r>1?Math.round((h-l)/(r-1)):null;for($s(e,c,d,s(n)?0:l-n,l),t=0,i=r-1;t"top"===e||"left"===e?t[e]+i:t[e]-i,Us=(t,e)=>Math.min(e||t,t);function Xs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return h}function Ks(t){return t.drawTicks?t.tickLength:0}function Gs(t,e){if(!t.display)return 0;const i=Si(t.font,e),s=ki(t.padding);return(n(t.text)?t.text.length:1)*i.lineHeight+s.height}function Zs(t,e,i){let s=ut(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Js extends Hs{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=r(t,Number.POSITIVE_INFINITY),e=r(e,Number.NEGATIVE_INFINITY),i=r(i,Number.POSITIVE_INFINITY),s=r(s,Number.NEGATIVE_INFINITY),{min:r(t,i),max:r(e,s),minDefined:a(t),maxDefined:a(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;rs?s:i,s=n&&i>s?i:s,{min:r(i,r(s,i)),max:r(s,r(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){d(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Di(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=J(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Ks(t.grid)-e.padding-Gs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Y(Math.min(Math.asin(J((h.highest.height+6)/o,-1,1)),Math.asin(J(a/r,-1,1))-Math.asin(J(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){d(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){d(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Gs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ks(n)+o):(t.height=this.maxHeight,t.width=Ks(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=$(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){d(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:r[t]||0,height:l[t]||0});return{first:P(0),last:P(e-1),widest:P(k),highest:P(S),widths:r,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Q(this._alignToPixels?Ae(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:a,border:r}=s,h=n.offset,c=this.isHorizontal(),d=this.ticks.length+(h?1:0),u=Ks(n),f=[],g=r.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,x=function(t){return Ae(i,t,p)};let b,_,y,v,M,w,k,S,P,D,C,O;if("top"===a)b=x(this.bottom),w=this.bottom-u,S=b-m,D=x(t.top)+m,O=t.bottom;else if("bottom"===a)b=x(this.top),D=t.top,O=x(t.bottom)-m,w=b+m,S=this.top+u;else if("left"===a)b=x(this.right),M=this.right-u,k=b-m,P=x(t.left)+m,C=t.right;else if("right"===a)b=x(this.left),P=t.left,C=x(t.right)-m,M=b+m,k=this.left+u;else if("x"===e){if("center"===a)b=x((t.top+t.bottom)/2+.5);else if(o(a)){const t=Object.keys(a)[0],e=a[t];b=x(this.chart.scales[t].getPixelForValue(e))}D=t.top,O=t.bottom,w=b+m,S=w+u}else if("y"===e){if("center"===a)b=x((t.left+t.right)/2);else if(o(a)){const t=Object.keys(a)[0],e=a[t];b=x(this.chart.scales[t].getPixelForValue(e))}M=b-m,k=M-u,P=t.left,C=t.right}const A=l(s.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/A));for(_=0;_0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}x.push({label:v,font:P,textOffset:O,options:{rotation:m,color:i,strokeColor:o,strokeWidth:h,textAlign:f,textBaseline:A,translation:[M,w],backdrop:d}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");ue.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&ue.describe(e,t.descriptors)}(t,o,i),this.override&&ue.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in ue[s]&&(delete ue[s][i],this.override&&delete re[i])}}class tn{constructor(){this.controllers=new Qs(Ns,"datasets",!0),this.elements=new Qs(Hs,"elements"),this.plugins=new Qs(Object,"plugins"),this.scales=new Qs(Js,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):u(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=w(t);d(i["before"+s],[],i),e[t](i),d(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function nn(t,e){return e||!1!==t?!0===t?{}:t:null}function on(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function an(t,e){const i=ue.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function rn(t){if("x"===t||"y"===t||"r"===t)return t}function ln(t,...e){if(rn(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&rn(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function hn(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function cn(t,e){const i=re[t.type]||{scales:{}},s=e.scales||{},n=an(t.type,e),a=Object.create(null);return Object.keys(s).forEach((e=>{const r=s[e];if(!o(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=ln(e,r,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return hn(t,"x",i[0])||hn(t,"y",i[0])}return{}}(e,t),ue.scales[r.type]),h=function(t,e){return t===e?"_index_":"_value_"}(l,n),c=i.scales||{};a[e]=b(Object.create(null),[{axis:l},r,c[l],c[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,o=i.indexAxis||an(n,e),r=(re[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),n=i[e+"AxisID"]||e;a[n]=a[n]||Object.create(null),b(a[n],[{axis:e},s[n],r[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];b(e,[ue.scales[e.type],ue.scale])})),a}function dn(t){const e=t.options||(t.options={});e.plugins=l(e.plugins,{}),e.scales=cn(t,e)}function un(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const fn=new Map,gn=new Set;function pn(t,e){let i=fn.get(t);return i||(i=e(),fn.set(t,i),gn.add(i)),i}const mn=(t,e,i)=>{const s=M(e,i);void 0!==s&&t.add(s)};class xn{constructor(t){this._config=function(t){return(t=t||{}).data=un(t.data),dn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=un(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),dn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return pn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return pn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return pn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>mn(r,t,e)))),e.forEach((t=>mn(r,s,t))),e.forEach((t=>mn(r,re[n]||{},t))),e.forEach((t=>mn(r,ue,t))),e.forEach((t=>mn(r,le,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),gn.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,re[e]||{},ue.datasets[e]||{},{type:e},ue,le]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=bn(this._resolverCache,t,s);let l=a;if(function(t,e){const{isScriptable:i,isIndexable:s}=Ye(t);for(const o of e){const e=i(o),a=s(o),r=(a||e)&&t[o];if(e&&(S(r)||_n(r))||a&&n(r))return!0}return!1}(a,e)){o.$shared=!1;l=$e(a,i=S(i)?i():i,this.createResolver(t,i,r))}for(const t of e)o[t]=l[t];return o}createResolver(t,e,i=[""],s){const{resolver:n}=bn(this._resolverCache,t,i);return o(e)?$e(n,e,void 0,s):n}}function bn(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:je(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const _n=t=>o(t)&&Object.getOwnPropertyNames(t).some((e=>S(t[e])));const yn=["top","bottom","left","right","chartArea"];function vn(t,e){return"top"===t||"bottom"===t||-1===yn.indexOf(t)&&"x"===e}function Mn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function wn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),d(i&&i.onComplete,[t],e)}function kn(t){const e=t.chart,i=e.options.animation;d(i&&i.onProgress,[t],e)}function Sn(t){return fe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Pn={},Dn=t=>{const e=Sn(t);return Object.values(Pn).filter((t=>t.canvas===e)).pop()};function Cn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function On(t,e,i){return t.options.clip?t[i]:e[i]}class An{static defaults=ue;static instances=Pn;static overrides=re;static registry=en;static version="4.4.3";static getChart=Dn;static register(...t){en.add(...t),Tn()}static unregister(...t){en.remove(...t),Tn()}constructor(t,e){const s=this.config=new xn(e),n=Sn(t),o=Dn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||ks(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,h=l&&l.height,c=l&&l.width;this.id=i(),this.ctx=r,this.canvas=l,this.width=c,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new sn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=dt((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],Pn[this.id]=this,r&&l?(bt.listen(this,"complete",wn),bt.listen(this,"progress",kn),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return s(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return en}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ke(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Te(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(t,e){bt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ke(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),d(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){u(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=ln(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),u(n,(e=>{const n=e.options,o=n.id,a=ln(o,n),r=l(n.type,e.dtype);void 0!==n.position&&vn(n.position,a)===vn(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===r)h=i[o];else{h=new(en.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)})),u(s,((t,e)=>{t||delete i[e]})),u(i,(t=>{as.configure(this,t,t.options),as.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){u(this.scales,(t=>{as.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);P(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){Cn(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;as.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],u(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:On(i,e,"left"),right:On(i,e,"right"),top:On(s,e,"top"),bottom:On(s,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Ie(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&ze(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Re(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Xi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ci(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);k(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),bt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};u(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){u(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},u(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!f(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=D(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,d(n.onHover,[t,a,this],this),r&&d(n.onClick,[t,a,this],this));const h=!f(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function Tn(){return u(An.instances,(t=>t._plugins.invalidate()))}function Ln(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class En{static override(t){Object.assign(En.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ln()}parse(){return Ln()}format(){return Ln()}add(){return Ln()}diff(){return Ln()}startOf(){return Ln()}endOf(){return Ln()}}var Rn={_date:En};function In(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;et-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(k(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;sMath.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Fn(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;ht.x,i="left",s="right"):(e=t.base"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map(((e,n)=>{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,a,r=t=>+i[t];if(o(i[t])){const{key:t="value"}=this._parsing;r=e=>+M(i[e],t)}for(n=t,a=t+e;nZ(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Z(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(E,c,u),x=g(C,h,d),b=g(C+E,c,u);s=(p-x)/2,n=(m-b)/2,o=-(p+x)/2,a=-(m+b)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(u,d,r),x=(i.width-o)/f,b=(i.height-o)/g,_=Math.max(Math.min(x,b)/2,0),y=c(this.options.radius,_),v=(y-Math.max(y*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/O)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,s);let p,m=this._getRotation();for(p=0;p0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ne(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s{const o=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:s,lineWidth:o.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ne(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return ii.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(se.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*C;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$(this.resolveDataElementOptions(t,e).angle||i):0}}var Yn=Object.freeze({__proto__:null,BarController:class extends Ns{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Fn(t,e,i,s)}parseArrayData(t,e,i,s){return Fn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,f,g;for(d=i,u=i+s;dt.controller.options.grouped)),o=i.options.stacked,a=[],r=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(s(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!r(i))&&((!1===o||-1===a.indexOf(i.stack)||void 0===o&&void 0===i.stack)&&a.push(i.stack),i.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n=i?1:-1)}(u,e,r)*a,f===r&&(x-=u/2);const t=e.getPixelForDecimal(0),s=e.getPixelForDecimal(1),o=Math.min(t,s),h=Math.max(t,s);x=Math.max(Math.min(x,h),o),d=x+u,i&&!c&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(d)-e.getValueForPixel(x))}if(x===e.getPixelForValue(r)){const t=F(u)*e.getLineWidthForValue(r)/2;x+=t,u-=t}return{size:u,base:x,head:d,center:d+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,o=n.skipNull,a=l(n.maxBarThickness,1/0);let r,h;if(e.grouped){const i=o?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:i[t]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,s),h=o.axis,c=a.axis;for(let d=e;d0&&this.getParsed(e-1);for(let i=0;i<_;++i){const g=t[i],_=x?g:{};if(i=b){_.skip=!0;continue}const v=this.getParsed(i),M=s(v[f]),w=_[u]=a.getPixelForValue(v[u],i),k=_[f]=o||M?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[f],i);_.skip=isNaN(w)||isNaN(k)||M,_.stop=i>0&&Math.abs(v[u]-y[u])>m,p&&(_.parsed=v,_.raw=h.data[i]),d&&(_.options=c||this.resolveDataElementOptions(i,g.active?"active":n)),x||this.updateElement(g,i,_,n),y=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends jn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:$n,RadarController:class extends Ns{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ii.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a0&&this.getParsed(e-1);for(let c=e;c0&&Math.abs(i[f]-_[f])>x,m&&(p.parsed=i,p.raw=h.data[c]),u&&(p.options=d||this.resolveDataElementOptions(c,e.active?"active":n)),b||this.updateElement(e,c,p,n),_=i}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}});function Un(t,e,i,s){const n=vi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return J(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:J(n.innerStart,0,a),innerEnd:J(n.innerEnd,0,a)}}function Xn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function qn(t,e,i,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const g=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(g-(0!==t?g*t/(t+s):g))/2}const p=(g-Math.max(.001,g*d-i/C)/d)/2,m=l+p+f,x=n-p-f,{outerStart:b,outerEnd:_,innerStart:y,innerEnd:v}=Un(e,u,d,x-m),M=d-b,w=d-_,k=m+b/M,S=x-_/w,P=u+y,D=u+v,O=m+y/P,A=x-v/D;if(t.beginPath(),o){const e=(k+S)/2;if(t.arc(a,r,d,k,e),t.arc(a,r,d,e,S),_>0){const e=Xn(w,S,a,r);t.arc(e.x,e.y,_,S,x+E)}const i=Xn(D,x,a,r);if(t.lineTo(i.x,i.y),v>0){const e=Xn(D,A,a,r);t.arc(e.x,e.y,v,x+E,A+Math.PI)}const s=(x-v/u+(m+y/u))/2;if(t.arc(a,r,u,x-v/u,s,!0),t.arc(a,r,u,s,m+y/u,!0),y>0){const e=Xn(P,O,a,r);t.arc(e.x,e.y,y,O+Math.PI,m-E)}const n=Xn(M,m,a,r);if(t.lineTo(n.x,n.y),b>0){const e=Xn(M,k,a,r);t.arc(e.x,e.y,b,m-E,k)}}else{t.moveTo(a,r);const e=Math.cos(k)*d+a,i=Math.sin(k)*d+r;t.lineTo(e,i);const s=Math.cos(S)*d+a,n=Math.sin(S)*d+r;t.lineTo(s,n)}t.closePath()}function Kn(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,f?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let g=e.endAngle;if(o){qn(t,e,i,s,g,n);for(let e=0;en?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+E,s-E),t.closePath(),t.clip()}(t,e,g),o||(qn(t,e,i,s,g,n),t.stroke())}function Gn(t,e,i=e){t.lineCap=l(i.borderCapStyle,e.borderCapStyle),t.setLineDash(l(i.borderDash,e.borderDash)),t.lineDashOffset=l(i.borderDashOffset,e.borderDashOffset),t.lineJoin=l(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=l(i.borderWidth,e.borderWidth),t.strokeStyle=l(i.borderColor,e.borderColor)}function Zn(t,e,i){t.lineTo(i.x,i.y)}function Jn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=nr&&o>r;return{count:s,start:l,loop:e.loop,ilen:h(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ig&&(g=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,f=g=i),p=i}_()}function eo(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?to:Qn}const io="function"==typeof Path2D;function so(t,e,i,s){io&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Gn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=eo(e);for(const r of n)Gn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class no extends Hs{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;hi(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=Ii(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?pi:t.tension||"monotone"===t.cubicInterpolationMode?mi:gi}(i);let l,h;for(l=0,h=o.length;l"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=X(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:h,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=l(d,r-a)>=O||Z(n,a,r),g=tt(o,h+u,c+u);return f&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/4,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>O?Math.floor(i/O):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const r=s*(1-Math.sin(Math.min(C,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let l=e.endAngle;if(o){qn(t,e,i,s,l,n);for(let e=0;e("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}function po(t){const e=this.getLabels();return t>=0&&ts=e?s:t,a=t=>n=i?n:t;if(t){const t=F(s),e=F(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:o,min:a,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,x=!s(a),b=!s(r),_=!s(h),y=(m-p)/(d+1);let v,M,w,k,S=B((m-p)/g/f)*f;if(S<1e-14&&!x&&!b)return[{value:p},{value:m}];k=Math.ceil(m/S)-Math.floor(p/S),k>g&&(S=B(k*S/g/f)*f),s(l)||(v=Math.pow(10,l),S=Math.ceil(S*v)/v),"ticks"===n?(M=Math.floor(p/S)*S,w=Math.ceil(m/S)*S):(M=p,w=m),x&&b&&o&&H((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,M=a,w=r):_?(M=x?a:M,w=b?r:w,k=h-1,S=(w-M)/k):(k=(w-M)/S,k=V(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(U(S),U(M));v=Math.pow(10,s(l)?P:l),M=Math.round(M*v)/v,w=Math.round(w*v)/v;let D=0;for(x&&(u&&M!==a?(i.push({value:a}),Mr)break;i.push({value:t})}return b&&u&&w!==r?i.length&&V(i[i.length-1].value,r,mo(r,y,t))?i[i.length-1].value=r:i.push({value:r}):b&&w!==r||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&j(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ne(t,this.chart.options.locale,this.options.ticks.format)}}class bo extends xo{static id="linear";static defaults={ticks:{callback:ae.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=a(t)?t:0,this.max=a(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _o=t=>Math.floor(z(t)),yo=(t,e)=>Math.pow(10,_o(t)+e);function vo(t){return 1===t/Math.pow(10,_o(t))}function Mo(t,e,i){const s=Math.pow(10,i),n=Math.floor(t/s);return Math.ceil(e/s)-n}function wo(t,{min:e,max:i}){e=r(t.min,e);const s=[],n=_o(e);let o=function(t,e){let i=_o(e-t);for(;Mo(t,e,i)>10;)i++;for(;Mo(t,e,i)<10;)i--;return Math.min(i,_o(t))}(e,i),a=o<0?Math.pow(10,Math.abs(o)):1;const l=Math.pow(10,o),h=n>o?Math.pow(10,n):0,c=Math.round((e-h)*a)/a,d=Math.floor((e-h)/l/10)*l*10;let u=Math.floor((c-d)/Math.pow(10,o)),f=r(t.min,Math.round((h+d+u*Math.pow(10,o))*a)/a);for(;f=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,a=o>=0?1:a),f=Math.round((h+d+u*Math.pow(10,o))*a)/a;const g=r(t.max,f);return s.push({value:g,major:vo(g),significand:u}),s}class ko extends Js{static id="logarithmic";static defaults={ticks:{callback:ae.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=xo.prototype.parse.apply(this,[t,e]);if(0!==i)return a(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=a(t)?Math.max(0,t):null,this.max=a(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!a(this._userMin)&&(this.min=t===yo(this.min,0)?yo(this.min,-1):yo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t;i===s&&(i<=0?(n(1),o(10)):(n(yo(i,-1)),o(yo(s,1)))),i<=0&&n(yo(s,-1)),s<=0&&o(yo(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=wo({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&j(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ne(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=z(t),this._valueRange=z(this.max)-z(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(z(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function So(t){const e=t.ticks;if(e.display&&t.display){const t=ki(e.backdropPadding);return l(e.font&&e.font.size,ue.font.size)+t.height}return 0}function Po(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function Do(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],o=[],a=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?C/a:0;for(let u=0;ue.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function Oo(t,e,i){const s=t.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=i,l=t.getPointPosition(e,s+n+a,o),h=Math.round(Y(G(l.angle+E))),c=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,r.h,h),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(h),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,r.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function Ao(t,e){if(!e)return!0;const{left:i,top:s,right:n,bottom:o}=t;return!(Re({x:i,y:s},e)||Re({x:i,y:o},e)||Re({x:n,y:s},e)||Re({x:n,y:o},e))}function To(t,e,i){const{left:n,top:o,right:a,bottom:r}=i,{backdropColor:l}=e;if(!s(l)){const i=wi(e.borderRadius),s=ki(e.backdropPadding);t.fillStyle=l;const h=n-s.left,c=o-s.top,d=a-n+s.width,u=r-o+s.height;Object.values(i).some((t=>0!==t))?(t.beginPath(),He(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function Lo(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,O);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;ot,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ki(So(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=a(t)&&!isNaN(t)?t:0,this.max=a(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/So(this.options))}generateTickLabels(t){xo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=d(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Do(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return G(t*(O/(this._pointLabels.length||1))+$(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(s(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(s(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;n--){const e=t._pointLabelItems[n];if(!e.visible)continue;const o=s.setContext(t.getPointLabelContext(n));To(i,o,e);const a=Si(o.font),{x:r,y:l,textAlign:h}=e;Ne(i,t._pointLabels[n],r,l+a.lineHeight/2,a,{color:o.color,textAlign:h,textBaseline:"middle"})}}(this,o),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),a=s.setContext(i),l=n.setContext(i);!function(t,e,i,s,n){const o=t.ctx,a=e.circular,{color:r,lineWidth:l}=e;!a&&!s||!r||!l||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),Lo(t,i,a,s),o.closePath(),o.stroke(),o.restore())}(this,a,r,o,l)}})),i.display){for(t.save(),a=o-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=s;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=Si(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=ki(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Ne(t,s.label,0,-n,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})})),t.restore()}drawTitle(){}}const Ro={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Io=Object.keys(Ro);function zo(t,e){return t-e}function Fo(t,e){if(s(e))return null;const i=t._adapter,{parser:n,round:o,isoWeekday:r}=t._parseOpts;let l=e;return"function"==typeof n&&(l=n(l)),a(l)||(l="string"==typeof n?i.parse(l,n):i.parse(l)),null===l?null:(o&&(l="week"!==o||!N(r)&&!0!==r?i.startOf(l,o):i.startOf(l,"isoWeek",r)),+l)}function Vo(t,e,i,s){const n=Io.length;for(let o=Io.indexOf(t);o=e?i[s]:i[n]]=!0}}else t[e]=!0}function Wo(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a=0&&(e[l].major=!0);return e}(t,s,n,i):s}class No extends Js{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Rn._date(t.adapters.date);s.init(e),b(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Fo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:r}=this.getUserBounds();function l(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}o&&r||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),s=a(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=a(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=nt(s,n,this.max);return this._unit=e.unit||(i.autoSkip?Vo(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=Io.length-1;o>=Io.indexOf(i);o--){const i=Io[o];if(Ro[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return Io[i?Io.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Io.indexOf(t)+1,i=Io.length;e+t.value)))}initOffsets(t=[]){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=J(s,0,o),n=J(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||Vo(n.minUnit,e,i,this._getLabelCapacity(e)),a=l(s.ticks.stepSize,1),r="week"===o&&n.isoWeekday,h=N(r)||!0===r,c={};let d,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",r)),f=+t.startOf(f,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,s=this._unit,n=e||i[s];return this._adapter.format(t,n)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.ticks.callback;if(o)return d(o,[t,e,i],this);const a=n.time.displayFormats,r=this._unit,l=this._majorUnit,h=r&&a[r],c=l&&a[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,s||(f?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=it(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=it(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}var jo=Object.freeze({__proto__:null,CategoryScale:class extends Js{static id="category";static defaults={ticks:{callback:po}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(s(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:J(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:go(i,t,l(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return po.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:bo,LogarithmicScale:ko,RadialLinearScale:Eo,TimeScale:No,TimeSeriesScale:class extends No{static id="timeseries";static defaults=No.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ho(e,this.min),this._tableRange=Ho(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;ot-e))}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ho(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ho(this._table,i*this._tableRange+this._minPos,!0)}}});const $o=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Yo=$o.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function Uo(t){return $o[t%$o.length]}function Xo(t){return Yo[t%Yo.length]}function qo(t){let e=0;return(i,s)=>{const n=t.getDatasetMeta(s).controller;n instanceof jn?e=function(t,e){return t.backgroundColor=t.data.map((()=>Uo(e++))),e}(i,e):n instanceof $n?e=function(t,e){return t.backgroundColor=t.data.map((()=>Xo(e++))),e}(i,e):n&&(e=function(t,e){return t.borderColor=Uo(e),t.backgroundColor=Xo(e),++e}(i,e))}}function Ko(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Go={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:s},options:n}=t.config,{elements:o}=n;if(!i.forceOverride&&(Ko(s)||(a=n)&&(a.borderColor||a.backgroundColor)||o&&Ko(o)))return;var a;const r=qo(t);s.forEach(r)}};function Zo(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Jo(t){t.data.datasets.forEach((t=>{Zo(t)}))}var Qo={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Jo(t);const n=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,l=t.getDatasetMeta(o),h=a||e.data;if("y"===Pi([r,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=J(it(e,o.axis,a).lo,0,i-1)),s=h?J(it(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(l,h);if(u<=(i.threshold||4*n))return void Zo(e);let f;switch(s(a)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":f=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;cu&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(h,d,u,n,i);break;case"min-max":f=function(t,e,i,n){let o,a,r,l,h,c,d,u,f,g,p=0,m=0;const x=[],b=e+i-1,_=t[e].x,y=t[b].x-_;for(o=e;og&&(g=l,d=o),p=(m*p+a.x)/++m;else{const i=o-1;if(!s(c)&&!s(d)){const e=Math.min(c,d),s=Math.max(c,d);e!==u&&e!==i&&x.push({...t[e],x:p}),s!==u&&s!==i&&x.push({...t[s],x:p})}o>0&&i!==u&&x.push(t[i]),x.push(a),h=e,m=0,f=g=l,c=d=u=o}}return x}(h,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=f}))},destroy(t){Jo(t)}};function ta(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=G(n),o=G(o)),{property:t,start:n,end:o}}function ea(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function ia(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function sa(t,e){let i=[],s=!1;return n(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=ea(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new no({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function na(t){return t&&!1!==t.fill}function oa(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!a(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function aa(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=l(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(o(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return a(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ra(t,e,i){const s=[];for(let n=0;n=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&da(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;na(i)&&da(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;na(s)&&"beforeDatasetDraw"===i.drawTime&&da(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xa=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class ba extends Hs{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=d(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=Si(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=xa(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,s,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const{itemWidth:p,itemHeight:m}=function(t,e,i,s,n){const o=function(t,e,i,s){let n=t.text;n&&"string"!=typeof n&&(n=n.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+s.measureText(n).width}(s,t,e,i),a=function(t,e,i){let s=t;"string"!=typeof e.text&&(s=_a(e,i));return s}(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}(i,e,n,t,s);o>0&&u+m+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:m},d=Math.max(d,p),u+=m+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=Oi(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=ft(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,a=ft(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,a=ft(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Ie(t,this),this._draw(),ze(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,a=ue.color,r=Oi(t.rtl,this.left,this.width),h=Si(o.font),{padding:c}=o,d=h.size,u=d/2;let f;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=xa(o,d),x=this.isHorizontal(),b=this._computeTitleHeight();f=x?{x:ft(n,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:ft(n,this.top+b+c,this.bottom-e[0].height),line:0},Ai(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach(((y,v)=>{s.strokeStyle=y.fontColor,s.fillStyle=y.fontColor;const M=s.measureText(y.text).width,w=r.textAlign(y.textAlign||(y.textAlign=o.textAlign)),k=g+u+M;let S=f.x,P=f.y;r.setWidth(this.width),x?v>0&&S+k+c>this.right&&(P=f.y+=_,f.line++,S=f.x=ft(n,this.left+c,this.right-i[f.line])):v>0&&P+_>this.bottom&&(S=f.x=S+e[f.line].width+c,f.line++,P=f.y=ft(n,this.top+b+c,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();const n=l(i.lineWidth,1);if(s.fillStyle=l(i.fillStyle,a),s.lineCap=l(i.lineCap,"butt"),s.lineDashOffset=l(i.lineDashOffset,0),s.lineJoin=l(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=l(i.strokeStyle,a),s.setLineDash(l(i.lineDash,[])),o.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},l=r.xPlus(t,g/2);Ee(s,a,l,e+u,o.pointStyleWidth&&g)}else{const o=e+Math.max((d-p)/2,0),a=r.leftForLtr(t,g),l=wi(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?He(s,{x:a,y:o,w:g,h:p,radius:l}):s.rect(a,o,g,p),s.fill(),0!==n&&s.stroke()}s.restore()}(r.x(S),P,y),S=gt(w,S+g+u,x?S+k:this.right,t.rtl),function(t,e,i){Ne(s,i.text,t,e+m/2,h,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(S),P,y),x)f.x+=k+c;else if("string"!=typeof y.text){const t=h.lineHeight;f.y+=_a(y,t)+c}else f.y+=_})),Ti(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Si(e.font),s=ki(e.padding);if(!e.display)return;const n=Oi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=ft(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ft(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=ft(a,c,c+d);o.textAlign=n.textAlign(ut(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Ne(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Si(t.font),i=ki(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(tt(t,this.left,this.right)&&tt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=ki(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class va extends Hs{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=n(i.text)?i.text.length:1;this._padding=ki(i.padding);const o=s*Si(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,l,h,c=0;return this.isHorizontal()?(l=ft(a,i,n),h=e+t,r=n-i):("left"===o.position?(l=i+t,h=ft(a,s,e),c=-.5*C):(l=n-t,h=ft(a,e,s),c=.5*C),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Si(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:a,rotation:r}=this._drawArgs(s);Ne(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:r,textAlign:ut(e.align),textBaseline:"middle",translation:[n,o]})}}var Ma={id:"title",_element:va,start(t,e,i){!function(t,e){const i=new va({ctx:t.ctx,options:e,chart:t});as.configure(t,i,e),as.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;as.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;as.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const wa=new WeakMap;var ka={id:"subtitle",start(t,e,i){const s=new va({ctx:t.ctx,options:i,chart:t});as.configure(t,s,i),as.addBox(t,s),wa.set(t,s)},stop(t){as.removeBox(t,wa.get(t)),wa.delete(t)},beforeUpdate(t,e,i){const s=wa.get(t);as.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Sa={average(t){if(!t.length)return!1;let e,i,s=new Set,n=0,o=0;for(e=0,i=t.length;et+e))/s.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i-1?t.split("\n"):t}function Ca(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Oa(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=Si(e.bodyFont),h=Si(e.titleFont),c=Si(e.footerFont),d=o.length,f=n.length,g=s.length,p=ki(e.padding);let m=p.height,x=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){m+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-g)*l.lineHeight+(b-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){x=Math.max(x,i.measureText(t).width+_)};return i.save(),i.font=h.string,u(t.title,y),i.font=l.string,u(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,u(s,(t=>{u(t.before,y),u(t.lines,y),u(t.after,y)})),_=0,i.font=c.string,u(t.footer,y),i.restore(),x+=p.width,{width:x,height:m}}function Aa(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function Ta(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Aa(t,e,i,s),yAlign:s}}function La(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=wi(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:J(g,0,s.width-e.width),y:J(p,0,s.height-e.height)}}function Ea(t,e,i){const s=ki(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Ra(t){return Pa([],Da(t))}function Ia(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const za={beforeTitle:e,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex{const e={before:[],lines:[],after:[]},n=Ia(i,t);Pa(e.before,Da(Fa(n,"beforeLabel",this,t))),Pa(e.lines,Fa(n,"label",this,t)),Pa(e.after,Da(Fa(n,"afterLabel",this,t))),s.push(e)})),s}getAfterBody(t,e){return Ra(Fa(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Fa(i,"beforeFooter",this,t),n=Fa(i,"footer",this,t),o=Fa(i,"afterFooter",this,t);let a=[];return a=Pa(a,Da(s)),a=Pa(a,Da(n)),a=Pa(a,Da(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;at.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),u(l,(e=>{const i=Ia(t.callbacks,e);s.push(Fa(i,"labelColor",this,e)),n.push(Fa(i,"labelPointStyle",this,e)),o.push(Fa(i,"labelTextColor",this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Sa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Oa(this,i),a=Object.assign({},t,e),r=Ta(this.chart,i,a),l=La(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=wi(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,x,b,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,b=_+o,y=_-o):(p=d+f,m=p+o,b=_-o,y=_+o),x=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(b=u,_=b-o,p=m-o,x=m+o):(b=u+g,_=b+o,p=m+o,x=m-o),y=b),{x1:p,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=Oi(i.rtl,this.x,this.width);for(t.x=Ea(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=Si(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,He(t,{x:e,y:g,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),He(t,{x:i,y:g+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,h,l),t.strokeRect(e,g,h,l),t.fillStyle=a.backgroundColor,t.fillRect(i,g+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Si(i.bodyFont);let d=c.lineHeight,f=0;const g=Oi(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+f),t.y+d/2),t.y+=d+n},m=g.textAlign(o);let x,b,_,y,v,M,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ea(this,m,i),e.fillStyle=i.bodyColor,u(this.beforeBody,p),f=a&&"right"!==m?"center"===o?l/2+h:l+2+h:0,y=0,M=s.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Sa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Oa(this,t),a=Object.assign({},i,this._size),r=Ta(e,t,a),l=La(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ki(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Ai(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Ti(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!f(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!f(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Sa[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}var Ba={id:"tooltip",_element:Va,positioners:Sa,afterInit(t,e,i){i&&(t.tooltip=new Va({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:za},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return An.register(Yn,jo,fo,t),An.helpers={...Wi},An._adapters=Rn,An.Animation=Cs,An.Animations=Os,An.animator=bt,An.controllers=en.controllers.items,An.DatasetController=Ns,An.Element=Hs,An.elements=fo,An.Interaction=Xi,An.layouts=as,An.platforms=Ss,An.Scale=Js,An.Ticks=ae,Object.assign(An,Yn,jo,fo,t,Ss),An.Chart=An,"undefined"!=typeof window&&(window.Chart=An),An})); +//# sourceMappingURL=chart.umd.js.map diff --git a/src/main/java/fr/inria/corese/benchmark/driver/BenchmarkFormat.java b/src/main/java/fr/inria/corese/benchmark/driver/BenchmarkFormat.java index 0560223..1e01121 100644 --- a/src/main/java/fr/inria/corese/benchmark/driver/BenchmarkFormat.java +++ b/src/main/java/fr/inria/corese/benchmark/driver/BenchmarkFormat.java @@ -23,10 +23,6 @@ public enum BenchmarkFormat { this.supportsNamedGraphs = supportsNamedGraphs; } - public String getExtension() { - return extension; - } - public boolean supportsNamedGraphs() { return supportsNamedGraphs; } diff --git a/src/main/java/fr/inria/corese/benchmark/driver/RDF4JDriver.java b/src/main/java/fr/inria/corese/benchmark/driver/RDF4JDriver.java index 9423aa5..67bfea8 100644 --- a/src/main/java/fr/inria/corese/benchmark/driver/RDF4JDriver.java +++ b/src/main/java/fr/inria/corese/benchmark/driver/RDF4JDriver.java @@ -171,7 +171,7 @@ public QueryMetrics queryWithMetrics(String sparql) { long start = System.currentTimeMillis(); long ttfr; long count = 0; - String hash = ""; + String hash; try (RepositoryConnection conn = repository.getConnection()) { TupleQuery q = conn.prepareTupleQuery(QueryLanguage.SPARQL, sparql); try (TupleQueryResult result = q.evaluate()) { diff --git a/src/main/java/fr/inria/corese/benchmark/harness/BenchmarkHarness.java b/src/main/java/fr/inria/corese/benchmark/harness/BenchmarkHarness.java index 5a02f52..024b468 100644 --- a/src/main/java/fr/inria/corese/benchmark/harness/BenchmarkHarness.java +++ b/src/main/java/fr/inria/corese/benchmark/harness/BenchmarkHarness.java @@ -240,13 +240,13 @@ private record RepetitionBuffers( @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof RepetitionBuffers b)) return false; - return Arrays.equals(times, b.times) - && Arrays.equals(ttfrTimes, b.ttfrTimes) - && Arrays.equals(heapDeltas, b.heapDeltas) - && Arrays.equals(rowCounts, b.rowCounts) - && Arrays.equals(hashes, b.hashes) - && Arrays.equals(statuses, b.statuses); + if (!(o instanceof RepetitionBuffers(var t, var tf, var hd, var rc, var h, var s))) return false; + return Arrays.equals(times, t) + && Arrays.equals(ttfrTimes, tf) + && Arrays.equals(heapDeltas, hd) + && Arrays.equals(rowCounts, rc) + && Arrays.equals(hashes, h) + && Arrays.equals(statuses, s); } @Override @@ -260,10 +260,6 @@ public int hashCode() { return result; } - @Override - public String toString() { - return "RepetitionBuffers"; - } } private void executeSingleRepetition( @@ -395,14 +391,12 @@ private FileResult benchmarkFile(File file) throws Exception { driver.clear(); memBefore[i] = metrics.getUsedMemoryMb(); - IngestionTelemetrySampler sampler = null; - if (i == reps - 1) { + try (IngestionTelemetrySampler sampler = i == reps - 1 + ? new IngestionTelemetrySampler(100, () -> 0L) + : null) { // Non-intrusive heap telemetry sampling during the final repetition - sampler = new IngestionTelemetrySampler(100, () -> 0L); - sampler.start(); - } + if (sampler != null) sampler.start(); - try { long start = System.nanoTime(); loadWithTimeout(path); timesMs[i] = (System.nanoTime() - start) / 1_000_000L; @@ -410,7 +404,7 @@ private FileResult benchmarkFile(File file) throws Exception { cpuSamples[i] = metrics.getCpuPercent(); memAfter[i] = metrics.getUsedMemoryMb(); triples = driver.getGraphSize(); - } finally { + if (sampler != null) { timeSeries = sampler.stop(triples); } diff --git a/src/main/java/fr/inria/corese/benchmark/metrics/FileResult.java b/src/main/java/fr/inria/corese/benchmark/metrics/FileResult.java index 4b61e1c..bf7ad54 100644 --- a/src/main/java/fr/inria/corese/benchmark/metrics/FileResult.java +++ b/src/main/java/fr/inria/corese/benchmark/metrics/FileResult.java @@ -47,39 +47,26 @@ public record FileResult( // Real-time telemetry samples during loading List timeSeries ) { - public FileResult( - String engine, - String dataset, - String file, - long triples, - long loadingTimeMs, - double throughputTriplesPerSec, - double memoryBeforeMb, - double memoryAfterMb, - double memoryDeltaMb, - double cpuPercent, - long[] repetitionsMs - ) { - this(engine, dataset, file, triples, loadingTimeMs, throughputTriplesPerSec, - memoryBeforeMb, memoryAfterMb, memoryDeltaMb, cpuPercent, repetitionsMs, List.of()); - } - @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof FileResult other)) return false; - return triples == other.triples && - loadingTimeMs == other.loadingTimeMs && - Double.compare(other.throughputTriplesPerSec, throughputTriplesPerSec) == 0 && - Double.compare(other.memoryBeforeMb, memoryBeforeMb) == 0 && - Double.compare(other.memoryAfterMb, memoryAfterMb) == 0 && - Double.compare(other.memoryDeltaMb, memoryDeltaMb) == 0 && - Double.compare(other.cpuPercent, cpuPercent) == 0 && - Objects.equals(engine, other.engine) && - Objects.equals(dataset, other.dataset) && - Objects.equals(file, other.file) && - Arrays.equals(repetitionsMs, other.repetitionsMs) && - Objects.equals(timeSeries, other.timeSeries); + if (!(o instanceof FileResult( + var eng, var ds, var f, var tri, + var ltMs, var thpt, + var memBef, var memAft, var memDelta, + var cpu, var reps, var ts))) return false; + return triples == tri && + loadingTimeMs == ltMs && + Double.compare(thpt, throughputTriplesPerSec) == 0 && + Double.compare(memBef, memoryBeforeMb) == 0 && + Double.compare(memAft, memoryAfterMb) == 0 && + Double.compare(memDelta, memoryDeltaMb) == 0 && + Double.compare(cpu, cpuPercent) == 0 && + Objects.equals(engine, eng) && + Objects.equals(dataset, ds) && + Objects.equals(file, f) && + Arrays.equals(repetitionsMs, reps) && + Objects.equals(timeSeries, ts); } @Override @@ -90,20 +77,4 @@ public int hashCode() { return result; } - @Override - public String toString() { - return "FileResult[" + - "engine=" + engine + ", " + - "dataset=" + dataset + ", " + - "file=" + file + ", " + - "triples=" + triples + ", " + - "loadingTimeMs=" + loadingTimeMs + ", " + - "throughputTriplesPerSec=" + throughputTriplesPerSec + ", " + - "memoryBeforeMb=" + memoryBeforeMb + ", " + - "memoryAfterMb=" + memoryAfterMb + ", " + - "memoryDeltaMb=" + memoryDeltaMb + ", " + - "cpuPercent=" + cpuPercent + ", " + - "repetitionsMs=" + Arrays.toString(repetitionsMs) + ", " + - "timeSeries=" + (timeSeries != null ? timeSeries.size() + " points" : "none") + ']'; - } } diff --git a/src/main/java/fr/inria/corese/benchmark/metrics/QueryResult.java b/src/main/java/fr/inria/corese/benchmark/metrics/QueryResult.java index 6b5cc0e..879c605 100644 --- a/src/main/java/fr/inria/corese/benchmark/metrics/QueryResult.java +++ b/src/main/java/fr/inria/corese/benchmark/metrics/QueryResult.java @@ -42,36 +42,26 @@ public record QueryResult( String resultHash, String status ) { - public QueryResult( - String engine, - String dataset, - String queryId, - String queryCategory, - long medianMs, - long[] repetitionsMs, - long medianTtfrMs, - long[] repetitionsTtfrMs, - double heapDeltaMb - ) { - this(engine, dataset, queryId, queryCategory, medianMs, repetitionsMs, medianTtfrMs, repetitionsTtfrMs, heapDeltaMb, -1L, "", medianMs >= 0 ? "PASS" : "TIMEOUT"); - } - @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof QueryResult other)) return false; - return medianMs == other.medianMs && - medianTtfrMs == other.medianTtfrMs && - rowCount == other.rowCount && - Double.compare(other.heapDeltaMb, heapDeltaMb) == 0 && - Objects.equals(engine, other.engine) && - Objects.equals(dataset, other.dataset) && - Objects.equals(queryId, other.queryId) && - Objects.equals(queryCategory, other.queryCategory) && - Objects.equals(resultHash, other.resultHash) && - Objects.equals(status, other.status) && - Arrays.equals(repetitionsMs, other.repetitionsMs) && - Arrays.equals(repetitionsTtfrMs, other.repetitionsTtfrMs); + if (!(o instanceof QueryResult( + var eng, var ds, var qId, var qCat, + var mMs, var rMs, + var mTtfr, var rTtfr, + var heap, var rows, var hash, var st))) return false; + return medianMs == mMs && + medianTtfrMs == mTtfr && + rowCount == rows && + Double.compare(heap, heapDeltaMb) == 0 && + Objects.equals(engine, eng) && + Objects.equals(dataset, ds) && + Objects.equals(queryId, qId) && + Objects.equals(queryCategory, qCat) && + Objects.equals(resultHash, hash) && + Objects.equals(status, st) && + Arrays.equals(repetitionsMs, rMs) && + Arrays.equals(repetitionsTtfrMs, rTtfr); } @Override @@ -82,20 +72,4 @@ public int hashCode() { return result; } - @Override - public String toString() { - return "QueryResult[" + - "engine=" + engine + ", " + - "dataset=" + dataset + ", " + - "queryId=" + queryId + ", " + - "queryCategory=" + queryCategory + ", " + - "medianMs=" + medianMs + ", " + - "repetitionsMs=" + Arrays.toString(repetitionsMs) + ", " + - "medianTtfrMs=" + medianTtfrMs + ", " + - "repetitionsTtfrMs=" + Arrays.toString(repetitionsTtfrMs) + ", " + - "heapDeltaMb=" + heapDeltaMb + ", " + - "rowCount=" + rowCount + ", " + - "resultHash=" + resultHash + ", " + - "status=" + status + ']'; - } } diff --git a/src/main/java/fr/inria/corese/benchmark/report/BenchmarkReport.java b/src/main/java/fr/inria/corese/benchmark/report/BenchmarkReport.java index bbe7203..9e5cea8 100644 --- a/src/main/java/fr/inria/corese/benchmark/report/BenchmarkReport.java +++ b/src/main/java/fr/inria/corese/benchmark/report/BenchmarkReport.java @@ -19,6 +19,7 @@ import java.util.Locale; import java.util.Map; import java.util.LinkedHashMap; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -65,7 +66,7 @@ public static void write(List results, List queryResult log.warn("Could not collect system environment metadata: {}", e.getMessage()); } - BenchmarkProtocol proto = (protocolConfig != null) ? protocolConfig : BenchmarkProtocol.defaultProtocol(); + BenchmarkProtocol proto = Objects.requireNonNullElse(protocolConfig, BenchmarkProtocol.defaultProtocol()); Map protocol = new LinkedHashMap<>(); protocol.put("warmup", proto.warmup()); protocol.put("repetitions", proto.repetitions()); @@ -118,10 +119,7 @@ private static Path resolveCsvDirectory(Path jsonPath) { return Path.of("csv"); } Path grandParent = parent.getParent(); - if (grandParent != null) { - return grandParent.resolve("csv"); - } - return parent.resolve("csv"); + return Objects.requireNonNullElse(grandParent, parent).resolve("csv"); } /** @@ -136,7 +134,7 @@ private static Path resolveCsvDirectory(Path jsonPath) { private static void writeCsv(List results, List queryResults, String csvPath) throws Exception { try (PrintWriter pw = new PrintWriter(csvPath)) { // Load benchmark section - int loadReps = results.isEmpty() ? 3 : results.get(0).repetitionsMs().length; + int loadReps = results.isEmpty() ? 3 : results.getFirst().repetitionsMs().length; String loadRepHeaders = java.util.stream.IntStream.rangeClosed(1, loadReps) .mapToObj(i -> "rep" + i + "Ms") .collect(Collectors.joining(",")); @@ -155,7 +153,7 @@ private static void writeCsv(List results, List queryRe // Query benchmark section (optional) if (queryResults != null && !queryResults.isEmpty()) { - int qReps = queryResults.get(0).repetitionsMs().length; + int qReps = queryResults.getFirst().repetitionsMs().length; String qRepHeaders = java.util.stream.IntStream.rangeClosed(1, qReps) .mapToObj(i -> "rep" + i + "Ms") .collect(Collectors.joining(",")); diff --git a/src/main/java/fr/inria/corese/benchmark/telemetry/IngestionTelemetrySampler.java b/src/main/java/fr/inria/corese/benchmark/telemetry/IngestionTelemetrySampler.java index e958a84..7496101 100644 --- a/src/main/java/fr/inria/corese/benchmark/telemetry/IngestionTelemetrySampler.java +++ b/src/main/java/fr/inria/corese/benchmark/telemetry/IngestionTelemetrySampler.java @@ -143,6 +143,7 @@ private static double currentHeapUsedMb() { /** Thread factory producing a single named daemon thread so the JVM can exit cleanly. */ private static final class DaemonThreadFactory implements ThreadFactory { @Override + @SuppressWarnings("NullableProblems") public Thread newThread(Runnable r) { Thread thread = new Thread(r, "ingestion-telemetry-sampler"); thread.setDaemon(true); diff --git a/src/main/java/fr/inria/corese/benchmark/telemetry/SystemEnvironmentCollector.java b/src/main/java/fr/inria/corese/benchmark/telemetry/SystemEnvironmentCollector.java index cec36f6..2536018 100644 --- a/src/main/java/fr/inria/corese/benchmark/telemetry/SystemEnvironmentCollector.java +++ b/src/main/java/fr/inria/corese/benchmark/telemetry/SystemEnvironmentCollector.java @@ -106,7 +106,7 @@ private static int readCpuSockets(List cpuinfoLines) { private static int readCpuCores(List cpuinfoLines) { java.util.Set coreKeys = new java.util.LinkedHashSet<>(); String currentPhysicalId = "0"; - String currentCoreId = null; + String currentCoreId; for (String line : cpuinfoLines) { if (line.startsWith("physical id")) { String value = valueAfterColon(line);