Public
Edited
Jun 5, 2023
Insert cell
Insert cell
viewof range = Inputs.range([0, 100], {label: "Membership Rate", step: 0.01, value: 10})
Insert cell
Insert cell
Insert cell
afterCosts = {
let result = 0
if (range <= 3) {
// for $3 or less, 5% + $0.10
result = (range * 0.95) - 0.1
} else {
// over $3, 2.9% + $0.30
result = (range * 0.971) - 0.3
}

return result >= 0 ? result : 0
}
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