MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / updateSampleRowOutput

Function updateSampleRowOutput

data-csv/ui.js:74–95  ·  view source on GitHub ↗
(rawRow)

Source from the content-addressed store, hash-verified

72 * sample row.
73 */
74export function updateSampleRowOutput(rawRow) {
75 sampleRowOutputContainerElement.textContent = '';
76 const row = rawRow;
77 for (const key in row) {
78 if (row.hasOwnProperty(key)) {
79 const oneKeyRow = document.createElement('div');
80 oneKeyRow.className = 'divTableRow';
81 oneKeyRow.align = 'left';
82 const keyDiv = document.createElement('div');
83 const valueDiv = document.createElement('div');
84 // TODO(bileschi): There is probably a better way to style this.
85 keyDiv.className = 'divTableCellKey';
86 valueDiv.className = 'divTableCell';
87 keyDiv.textContent = key + ': ';
88 valueDiv.textContent = row[key];
89 oneKeyRow.appendChild(keyDiv);
90 oneKeyRow.appendChild(valueDiv);
91 // add the div child to updateSampleRowOutput
92 sampleRowOutputContainerElement.appendChild(oneKeyRow);
93 }
94 }
95};
96
97// Returns current value of the selected sample index as a number.
98export function getSampleIndex() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected