{
const checkTable = [],
{ df1, df2, alpha: targetAlpha } = fDistributionTableSetup,
alpha = [...new Array(100)].map((_, i) => i * 0.001);
alpha.map((alpha) => {
checkTable.push({
alpha,
fValue: statsBaseDistsF.quantile(1 - alpha, df1, df2),
df1,
df2
});
});
return htl.html`
<h2>${
checkTable
.filter((d) => d.alpha === targetAlpha)
.map((d) => pfString(df1, df2, d.alpha, d.fValue))[0]
}</h2>
<div style= "display: flex">
${[
Plot.plot({
x: { nice: true },
y: { nice: true },
grid: true,
color: { nice: true, legend: true, domain: [-1, 5] },
marks: [
Plot.dot(checkTable, { x: "alpha", y: "fValue", fill: "fValue" }),
Plot.ruleX([targetAlpha]),
Plot.text(
checkTable.filter((d) => d.alpha === targetAlpha),
{
x: "alpha",
y: "fValue",
text: (d) => pfString(df1, df2, d.alpha, d.fValue),
lineAnchor: "bottom",
frameAnchor: "bottom-left",
dx: 20,
dy: -20,
fill: "black",
stroke: "fValue",
fontSize: 20
}
),
Plot.frame()
]
}),
Plot.plot({
x: { nice: true },
y: { nice: true },
grid: true,
color: {
nice: true,
legend: true,
domain: [-1, 5]
},
marks: [
Plot.cell(table, { x: "df2", y: "df1", fill: "fValue" }),
Plot.ruleX([df2 - 0.5, df2 + 0.5]),
Plot.ruleY([df1 - 0.5, df1 + 0.5]),
Plot.frame()
]
})
]}
</div>
`;
return table;
}