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

Function drawTable

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

Source from the content-addressed store, hash-verified

252}
253
254function drawTable(section, spec) {
255 const host = $(section, 'table');
256 host.replaceChildren();
257 if (!spec) return;
258
259 const table = el('table');
260 const thead = el('thead');
261 const headRow = el('tr');
262 for (const column of spec.columns) {
263 const th = el('th', null, column);
264 th.scope = 'col';
265 headRow.append(th);
266 }
267 thead.append(headRow);
268
269 const tbody = el('tbody');
270 for (const row of spec.rows) {
271 const tr = el('tr');
272 row.forEach((cell, i) => {
273 const node = el(i === 0 ? 'th' : 'td', null, String(cell));
274 if (i === 0) node.scope = 'row';
275 tr.append(node);
276 });
277 tbody.append(tr);
278 }
279 table.append(thead, tbody);
280 host.append(table);
281}
282
283function drawStat(section, stat) {
284 const host = $(section, 'stat');

Callers 1

drawPanelFunction · 0.85

Calls 2

$Function · 0.85
elFunction · 0.85

Tested by

no test coverage detected