Skip to content

Commit

Permalink
dont show bootstrap final row twice
Browse files Browse the repository at this point in the history
  • Loading branch information
shapiromatron committed Nov 15, 2024
1 parent 78600d5 commit 1c3eaf9
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions frontend/src/components/Output/NestedDichotomous/BootstrapRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,39 @@ import {ff, fractionalFormatter} from "@/utils/formatters";

const getData = function(model) {
const results = model.results.bootstrap,
rows = _.range(results.p_value.length).map(run => [
run + 1,
fractionalFormatter(results.p_value[run]),
ff(results.p50[run]),
ff(results.p90[run]),
ff(results.p95[run]),
ff(results.p99[run]),
]);
rows.push([
<span key={0} className="font-weight-bold">
Combined
</span>,
<span key={1} className="font-weight-bold">
{fractionalFormatter(results.p_value[3])}
</span>,
<span key={2} className="font-weight-bold">
{ff(results.p50[3])}
</span>,
<span key={3} className="font-weight-bold">
{ff(results.p90[3])}
</span>,
<span key={4} className="font-weight-bold">
{ff(results.p95[3])}
</span>,
<span key={5} className="font-weight-bold">
{ff(results.p99[3])}
</span>,
]);
finalIdx = results.p_value.length - 1,
rows = _.range(results.p_value.length).map(idx => {
return idx === finalIdx
? [
<span key={0} className="font-weight-bold">
Combined
</span>,
<span key={1} className="font-weight-bold">
{fractionalFormatter(results.p_value[idx])}
</span>,
<span key={2} className="font-weight-bold">
{ff(results.p50[idx])}
</span>,
<span key={3} className="font-weight-bold">
{ff(results.p90[idx])}
</span>,
<span key={4} className="font-weight-bold">
{ff(results.p95[idx])}
</span>,
<span key={5} className="font-weight-bold">
{ff(results.p99[idx])}
</span>,
]
: [
idx + 1,
fractionalFormatter(results.p_value[idx]),
ff(results.p50[idx]),
ff(results.p90[idx]),
ff(results.p95[idx]),
ff(results.p99[idx]),
];
});
rows.push();

return {
headers: [
Expand Down

0 comments on commit 1c3eaf9

Please sign in to comment.