MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / drawTable

Function drawTable

telemetry-dashboard/public/app.js:231–258  ·  view source on GitHub ↗
(section, spec)

Source from the content-addressed store, hash-verified

229}
230
231function drawTable(section, spec) {
232 const host = $(section, 'table');
233 host.replaceChildren();
234 if (!spec) return;
235
236 const table = el('table');
237 const thead = el('thead');
238 const headRow = el('tr');
239 for (const column of spec.columns) {
240 const th = el('th', null, column);
241 th.scope = 'col';
242 headRow.append(th);
243 }
244 thead.append(headRow);
245
246 const tbody = el('tbody');
247 for (const row of spec.rows) {
248 const tr = el('tr');
249 row.forEach((cell, i) => {
250 const node = el(i === 0 ? 'th' : 'td', null, String(cell));
251 if (i === 0) node.scope = 'row';
252 tr.append(node);
253 });
254 tbody.append(tr);
255 }
256 table.append(thead, tbody);
257 host.append(table);
258}
259
260function drawStat(section, stat) {
261 const host = $(section, 'stat');

Callers 1

drawPanelFunction · 0.85

Calls 2

$Function · 0.85
elFunction · 0.85

Tested by

no test coverage detected