Public
Edited
Jan 12, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
model.container_height({top_margin$_in: 10, bottom_margin$_in: 10, num_bars_in: 9, bar_height$_in: 45, gap$_in: 10})
Insert cell
model.container_height({top_margin$_in: top_margin_in, bottom_margin$_in: bottom_margin_in, num_bars_in: num_bars_in, bar_height$_in: bar_height_in, gap$_in: gap_in})
Insert cell
{ // controller
if (unlocked == 'container_height') {
viewof container_height_in['0'].labels[0].innerHTML = 'container_height 🔓'
//viewof C['0'].labels[0].innerHTML = 'C'

var v = model.container_height({top_margin$_in: top_margin_in, bottom_margin$_in: bottom_margin_in, num_bars_in/*not unlockable*/, bar_height$_in: bar_height_in, gap$_in: gap_in});
/*viewof container_height_in['1'].max = Math.max(v, viewof container_height_in['1'].max);
viewof container_height_in['0'].min = Math.min(v, viewof container_height_in['0'].min); // lots of stuff which doens't fix bounds problem fully..
viewof container_height_in['0'].max = Math.max(v, viewof container_height_in['0'].max);
viewof container_height_in['0'].size = viewof container_height_in['0'].max - viewof container_height_in['0'].min;
viewof container_height_in['1'].min = Math.min(v, viewof container_height_in['1'].min);
viewof container_height_in['1'].max = Math.max(v, viewof container_height_in['1'].max);*/
//viewof F['1'].size = viewof F['1'].max - viewof F['1'].min;
viewof container_height_in.value = v;
viewof container_height_in.dispatchEvent(new CustomEvent("input"));

viewof top_margin_in['0'].disabled = false;
viewof top_margin_in['1'].disabled = false;
// reset everything else too...
viewof container_height_in['0'].disabled = true;
viewof container_height_in['1'].disabled = true;
} else if (unlocked == 'top_margin') {
viewof top_margin_in['0'].labels[0].innerHTML = 'top_margin 🔓'
// unset rest... or control this separately

var v = model.top_margin({container_height$_in: container_height_in, bottom_margin$_in: bottom_margin_in, num_bars_in /*not unlockable*/, bar_height$_in:bar_height_in, gap$_in: gap_in});
viewof top_margin_in.value = v;
viewof top_margin_in.dispatchEvent(new CustomEvent("input"));

viewof container_height_in['0'].disabled = false;
viewof container_height_in['1'].disabled = false;
viewof top_margin_in['0'].disabled = true;
viewof top_margin_in['1'].disabled = true;
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more