From 7a21162dc9ab4b54401b2fb31eece491798388a2 Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Sun, 18 May 2025 22:37:38 +0200 Subject: [PATCH] Update nonc input --- app.qmd | 7 +++++-- test.R | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app.qmd b/app.qmd index ee2f899..fce998d 100644 --- a/app.qmd +++ b/app.qmd @@ -60,8 +60,11 @@ chart = { // nonc control 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("select").selectAll("option").data([-4,0,2,4]).enter().append("option").attr("value", d => d).property("selected", d => d === selectedNonc).text(d => d); - noncControl.select("select").on("change", function() { selectedNonc = +this.value; updateChart(filteredData()); }); + noncControl.append("input") + .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 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"); diff --git a/test.R b/test.R index a6a594c..5a276ed 100644 --- a/test.R +++ b/test.R @@ -42,7 +42,7 @@ generate_basis_data <- function(num_knots, mu_value, sig_value, nonc_value, tail knot_values <- c(10) mu_values <- seq(0.1, 0.9, by = 0.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) # Create an empty list to store all combinations