Update nonc input

This commit is contained in:
2025-05-18 22:37:38 +02:00
parent 122a77fcfa
commit 64325b8e0f
2 changed files with 6 additions and 3 deletions

View File

@@ -60,8 +60,11 @@ chart = {
// nonc control // nonc control
const noncControl = controlsContainer.append("div").style("display","flex").style("align-items","center").style("gap","10px"); const noncControl = controlsContainer.append("div").style("display","flex").style("align-items","center").style("gap","10px");
noncControl.append("label").text("Non-centrality:").style("font-size","16px"); noncControl.append("label").text("Non-centrality:").style("font-size","16px");
noncControl.append("select").selectAll("option").data([-4,0,2,4]).enter().append("option").attr("value", d => d).property("selected", d => d === selectedNonc).text(d => d); noncControl.append("input")
noncControl.select("select").on("change", function() { selectedNonc = +this.value; updateChart(filteredData()); }); .attr("type","range").attr("min", -4).attr("max", 4).attr("step", 2)
.property("value", selectedNonc)
.on("input", function() { selectedNonc = +this.value; noncControl.select("span").text(selectedNonc); updateChart(filteredData()); });
noncControl.append("span").text(selectedNonc).style("font-size","16px");
// tail weight control // tail weight control
const tailwControl = controlsContainer.append("div").style("display","flex").style("align-items","center").style("gap","10px"); const tailwControl = controlsContainer.append("div").style("display","flex").style("align-items","center").style("gap","10px");
tailwControl.append("label").text("Tail weight:").style("font-size","16px"); tailwControl.append("label").text("Tail weight:").style("font-size","16px");

2
test.R
View File

@@ -42,7 +42,7 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail
knot_values <- c(10) knot_values <- c(10)
mu_values <- seq(0.1, 0.9, by = 0.2) mu_values <- seq(0.1, 0.9, by = 0.2)
sig_values <- 2^(-2:2) sig_values <- 2^(-2:2)
nonc_values <- c(-4,2,0,2,4) nonc_values <- c(-4,-2,0,2,4)
tailw_values <- 2^(-2:2) tailw_values <- 2^(-2:2)
# Create an empty list to store all combinations # Create an empty list to store all combinations