Skip to content

Add survival curves, distribution fitting, and layer opacity#34

Merged
mortonanalytics merged 1 commit intodevelopfrom
feature/session1-stats
Mar 29, 2026
Merged

Add survival curves, distribution fitting, and layer opacity#34
mortonanalytics merged 1 commit intodevelopfrom
feature/session1-stats

Conversation

@mortonanalytics
Copy link
Copy Markdown
Owner

Summary

Phase 4 Session 1 — completing the statistical visualization story:

  • Kaplan-Meier survival curves: transform_survfit computes KM estimator + Greenwood CI using base R only. composite_survfit expands to step-curve line + CI band + censored markers. Group stratification via group mapping
  • Distribution fitting overlay: transform_fit_distribution fits normal/lognormal/exponential via MLE. composite_histogram_fit renders histogram + fitted density curve + parameter annotation
  • Layer opacity: setLayerOpacity(label, opacity) for per-layer transparency, applied renderer-agnostically in routeLayers()

Test plan

  • R tests: 770/770 pass (23 survfit + 7 dist fit + 6 opacity = 36 new)
  • JS tests: 194/194 pass
  • No external dependencies (base R stats:: only)
  • Manual: survival curve with lung cancer data
  • Manual: histogram + normal fit overlay

🤖 Generated with Claude Code

… Session 1)

Three new features completing the statistical visualization story:

- Kaplan-Meier survival curves: transform_survfit computes KM estimator +
  Greenwood CI using base R only. composite_survfit expands to step-curve
  line + CI band + censored markers. Group stratification supported.
- Distribution fitting: transform_fit_distribution fits normal/lognormal/
  exponential via MLE. composite_histogram_fit overlays fitted density on
  histogram.
- Layer opacity: setLayerOpacity(label, opacity) for per-layer transparency.
  Applied in Chart.js routeLayers().

Tests: 23 survfit + 7 histogram_fit + 6 opacity = 36 new R tests
Total: 770 R tests, 194 JS tests, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mortonanalytics mortonanalytics merged commit aae9c8f into develop Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant