Skip to content

Commit

Permalink
started table body
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneenders committed Nov 8, 2023
1 parent 41212a2 commit a3ceddb
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/web/resources/report-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,32 @@ function buildBody(jsonData, otherJsonData, filterFunction) {
Element("figcaption", {}, [tempPareto_B])
])
])
return [header, stats, figureRow]
return [header, stats, figureRow, tableBody(jsonData, otherJsonData, filterFunction)]
}

function tableBody(jsonData, otherJsonData, filterFunction) {
for (let test of jsonData.tests) {
let other = diffAgainstFields[test.name]
if (filterFunction(test, other)) {
eitherOr(test, other,
(function () {
console.log("only normal")
})
, (function () {
console.log("pair")
}))
}
}
}


function eitherOr(baselineRow, diffRow, singleFunction, pairFunctions) {
// Pulled out into a function so if testing for diffRow needs to change only have to update here
if (diffRow == undefined) {
singleFunction()
} else {
pairFunctions()
}
}

function update(jsonData, otherJsonData) {
Expand All @@ -294,6 +319,14 @@ function makeFilterFunction() {
const currentFilterState = filterState
// TODO collect internal state into a filter function
// TODO actually filter
eitherOr(baselineRow, diffRow,
(function () {
console.log("filter normal")
})
, (function () {
console.log(`baselineRow: ${baselineRow}`)
console.log(`diffRow: ${diffRow}`)
}))
return true
}
}
Expand Down

0 comments on commit a3ceddb

Please sign in to comment.