Update tailweight input
This commit is contained in:
7
app.qmd
7
app.qmd
@@ -65,8 +65,11 @@ chart = {
|
|||||||
// 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");
|
||||||
tailwControl.append("select").selectAll("option").data([0.25,0.5,1,2,4]).enter().append("option").attr("value", d => d).property("selected", d => d === selectedTailw).text(d => d);
|
tailwControl.append("input")
|
||||||
tailwControl.select("select").on("change", function() { selectedTailw = +this.value; updateChart(filteredData()); });
|
.attr("type","range").attr("min", -2).attr("max", 2).attr("step", 1)
|
||||||
|
.property("value", Math.log2(selectedTailw))
|
||||||
|
.on("input", function() { selectedTailw = 2 ** (+this.value); tailwControl.select("span").text(selectedTailw); updateChart(filteredData()); });
|
||||||
|
tailwControl.append("span").text(selectedTailw).style("font-size","16px");
|
||||||
// Build SVG
|
// Build SVG
|
||||||
const width = 800;
|
const width = 800;
|
||||||
const height = 400;
|
const height = 400;
|
||||||
|
|||||||
Reference in New Issue
Block a user