Public
Edited
May 17, 2023
2 forks
1 star
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
Bolus = 1
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rendertherapeutic_range_level = () => {
return svg`<defs>
<linearGradient x1="0%" y1="50%" x2="100%" y2="50%" id="linearGradient-1">
<stop stop-color="#44B029" offset="0%"></stop>
<stop stop-color="#44B029" offset="100%"></stop>
</linearGradient>
</defs>
<g id="Artboard" stroke="none" stroke-width="10" fill="none" fill-rule="evenodd">
<rect id="Rectangle" fill="url(#linearGradient-1)" x="0" y="0" width="100" height="3"></rect>
</g>`;
}
Insert cell
sleeplinePlotFn = (allData, params) => {
const { x, y, margin, seriesIndex, plotHeight, TargetThreshold } = params;

if (allData.flat().filter((d) => TargetThreshold <= d.y).length === 0)
return null;
const calculateTime = calculatecalculateTime(allData);
const output = svg`
<g transform="translate(${x(calculateTime)}, ${y(TargetThreshold) - 10})">
${renderTargetIcon()}
</g>

<rect class="sleep-line-border"
x="${x(calculateTime) - 2.5}" width="3"
y="${y(TargetThreshold)}"
height="${plotHeight - y(TargetThreshold)}"
/>

<rect class="sleep-line"
x="${x(calculateTime) - 2.5}" width="3"
y="${y(TargetThreshold)}"
height="${plotHeight - y(TargetThreshold) + 12}"
/>



`;

return output;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { slider, radio, select } from "@jashkenas/inputs"
Insert cell
// viewof Bolus = {
// const output = radio({
// title: "Pentobarbital Bolus (mg/kg)",
// description: "",
// options: [
// { label: "1 mg/kg", value: 1 },
// { label: "5 mg/kg", value: 5 },
// { label: "10 mg/kg", value: 10 }
// ],
// value: state.Bolus || 5
// });
// output.addEventListener("input", () => {
// mutable state = { ...state, Bolus: parseInt(output.value) };
// });
// return output;
// }
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