Align input width and plot width
This commit is contained in:
7
app.qmd
7
app.qmd
@@ -79,6 +79,13 @@ chart = {
|
|||||||
const margin = {top: 40, right: 20, bottom: 40, left: 40};
|
const margin = {top: 40, right: 20, bottom: 40, left: 40};
|
||||||
const innerWidth = width - margin.left - margin.right;
|
const innerWidth = width - margin.left - margin.right;
|
||||||
const innerHeight = height - margin.top - margin.bottom;
|
const innerHeight = height - margin.top - margin.bottom;
|
||||||
|
// Set container width to match SVG plot width
|
||||||
|
container.style("max-width", `${width}px`).style("width", "100%");
|
||||||
|
// Set controls container width to match SVG plot width
|
||||||
|
controlsContainer.style("max-width", `${width}px`).style("width", "100%");
|
||||||
|
// Distribute each control evenly and make sliders full-width
|
||||||
|
controlsContainer.selectAll("div").style("flex", "1").style("min-width", "0px");
|
||||||
|
controlsContainer.selectAll("input").style("width", "100%").style("box-sizing", "border-box");
|
||||||
|
|
||||||
// Create scales
|
// Create scales
|
||||||
const x = d3.scaleLinear()
|
const x = d3.scaleLinear()
|
||||||
|
|||||||
Reference in New Issue
Block a user