MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / populateSelects

Function populateSelects

jena-weather/ui.js:34–57  ·  view source on GitHub ↗
(dataObj)

Source from the content-addressed store, hash-verified

32}
33
34export function populateSelects(dataObj) {
35 const columnNames = ['None'].concat(dataObj.getDataColumnNames());
36 for (const selectSeries of [selectSeries1, selectSeries2]) {
37 while (selectSeries.firstChild) {
38 selectSeries.removeChild(selectSeries.firstChild);
39 }
40 console.log(columnNames);
41 for (const name of columnNames) {
42 const option = document.createElement('option');
43 option.setAttribute('value', name);
44 option.textContent = name;
45 selectSeries.appendChild(option);
46 }
47 }
48
49 if (columnNames.indexOf('T (degC)') !== -1) {
50 selectSeries1.value = 'T (degC)';
51 }
52 if (columnNames.indexOf('p (mbar)') !== -1) {
53 selectSeries2.value = 'p (mbar)';
54 }
55 timeSpanSelect.value = 'week';
56 dataNormalizedCheckbox.checked = true;
57}
58
59export const TIME_SPAN_RANGE_MAP = {
60 hour: 6,

Callers 1

runFunction · 0.90

Calls 1

getDataColumnNamesMethod · 0.80

Tested by

no test coverage detected