SteadyStateCalculator

3 variants. Open one in isolation: use the link on each card.


src/ui/2_organisms/SteadyStateCalculator.astro
---
import InteractiveChart from './InteractiveChart.astro'
interface Props {
subscribers?: number
newPerMonth?: number
churnPct?: number
}
const {
subscribers = 1000,
newPerMonth = 100,
churnPct = 2,
} = Astro.props
---
<InteractiveChart
name="steady-state-calculator"
ariaLabel="Subscriber base over the next 36 months, approaching its steady state"
fields={[
{ key: 'subscribers', label: 'Subscribers today', initial: subscribers },
{ key: 'new', label: 'New signups / month', initial: newPerMonth },
{ key: 'churn', label: 'Churn / month (%)', initial: churnPct },
]}
/>
<script>
import { registerInteractiveChart } from '../../lib/interactive-chart/registry'
import { bootInteractiveCharts } from '../../lib/interactive-chart/init'
import { describeSteadyState, generateSteadyStateChart } from '../../lib/interactive-chart/steady-state'
registerInteractiveChart('steady-state-calculator', {
generate: generateSteadyStateChart,
describe: describeSteadyState,
})
// Guard: this module can be imported server-side (e.g. by the UI gallery's
// story-data glob), where document does not exist.
if (typeof document !== 'undefined') {
bootInteractiveCharts()
}
</script>