From 1e8669ecc77d9512abe187a3b483c64af343e872 Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Sun, 18 May 2025 22:17:52 +0200 Subject: [PATCH] Update sigma input --- app.qmd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app.qmd b/app.qmd index 3849f8e..df0424f 100644 --- a/app.qmd +++ b/app.qmd @@ -52,8 +52,11 @@ chart = { // sigma control const sigControl = controlsContainer.append("div").style("display","flex").style("align-items","center").style("gap","10px"); sigControl.append("label").text("Sigma:").style("font-size","16px"); - sigControl.append("select").selectAll("option").data([0.25,0.5,1,2,4]).enter().append("option").attr("value", d => d).property("selected", d => d === selectedSig).text(d => d); - sigControl.select("select").on("change", function() { selectedSig = +this.value; updateChart(filteredData()); }); + sigControl.append("input") + .attr("type","range").attr("min", -1).attr("max", 2).attr("step", 1) + .property("value", Math.log2(selectedSig)) + .on("input", function() { selectedSig = 2 ** (+this.value); sigControl.select("span").text(selectedSig); updateChart(filteredData()); }); + sigControl.append("span").text(selectedSig).style("font-size","16px"); // 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");