Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/webr-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
# Match the pkgdown workflow's release trigger so publishing a release rebuilds
# the wasm binary too, keeping it in sync with the docs that install from it.
release:
types: [published]
workflow_dispatch:

name: webr-repo.yaml
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LAGOtrials 1.1.0

* Added a live in-browser demo to the documentation site (`live-demo.html`) that runs the real package client-side with webR (R compiled to WebAssembly), so anyone can try `lago_optimization()` with no installation. A GitHub Actions workflow builds the package to WebAssembly with the rwasm toolchain and publishes it as a small CRAN-like repository alongside the site.
* Added a live in-browser demo to the documentation site (`live-demo.html`) that runs the real package client-side with webR (R compiled to WebAssembly), so anyone can try `lago_optimization()` with no installation, plus an interactive playground (`playground.html`) where you pick a bundled dataset or upload a CSV, configure the model with sliders and toggles, and see the recommendation drawn with the package's own D3 charts alongside a copy-pasteable R snippet. A GitHub Actions workflow builds the package to WebAssembly with the rwasm toolchain and publishes it as a small CRAN-like repository alongside the site.
* `lago_report()` now renders an interactive HTML dashboard: the confidence set is a hover-enabled D3 plot (a scatter for two components, a strip for one) with the recommended intervention highlighted, and each intervention component gets interactive total-cost and marginal-cost curves. The report stays a single self-contained offline file (D3 is inlined, no CDN or server) and its API is unchanged; rendering now also uses `jsonlite` (a new Suggests).
* Added an MCP (Model Context Protocol) server to the Python package (`python -m lago.mcp_server`) that exposes `optimize` and `sensitivity` as tools any MCP-aware AI agent can call, plus a `sensitivity()` function in the Python wrapper.
* Added `lago_sensitivity()`, which re-runs an optimization across a sweep of one input (an outcome or power goal, or a `"cost_multiplier"` that scales all costs) and reports how the recommended intervention, its cost, and the estimated outcome move, with `print()` and `plot()` methods.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The LAGOtrials R package bridges the gap between theoretical advances in Learn-A
3) estimating the optimal intervention based on data from all stages,
4) calculating the 95% confidence sets for the recommended interventions and the optimal interventions.

> **Try it in your browser, no installation needed:** the [live demo](https://correspondmerchant.github.io/LAGO-R-Package/live-demo.html) runs the real `LAGOtrials` package client-side with [webR](https://docs.r-wasm.org/webr/latest/) (R compiled to WebAssembly). Edit the example and press Run.
> **Try it in your browser, no installation needed:** the [live demo](https://correspondmerchant.github.io/LAGO-R-Package/live-demo.html) runs the real `LAGOtrials` package client-side with [webR](https://docs.r-wasm.org/webr/latest/) (R compiled to WebAssembly) — edit the example and press Run. For a guided version, the [playground](https://correspondmerchant.github.io/LAGO-R-Package/playground.html) lets you pick a bundled dataset or upload your own CSV, configure the model with sliders and toggles, and see the recommendation as interactive charts plus a copy-pasteable R snippet.

## Table of Contents
1. [How to install the R package](#how-to-install-the-r-package)
Expand All @@ -42,7 +42,7 @@ The LAGOtrials R package bridges the gap between theoretical advances in Learn-A
```
- Method 2: Clone this repo into RStudio, you can follow the directions provided [in this video](https://www.youtube.com/watch?v=NInwldFZgwA&t=275s).

Not ready to install? Try the package in your browser on the [live demo page](https://correspondmerchant.github.io/LAGO-R-Package/live-demo.html).
Not ready to install? Try the package in your browser on the [live demo page](https://correspondmerchant.github.io/LAGO-R-Package/live-demo.html), or design an optimization interactively with the [guided playground](https://correspondmerchant.github.io/LAGO-R-Package/playground.html).

## The main functions
The LAGOtrials R package has four user-facing functions `lago_optimization()`, `lago_sensitivity()`, `visualize_cost()`, and `lago_report()`.
Expand Down
5 changes: 4 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ authors:

navbar:
structure:
left: [reference, articles, news, demo]
left: [reference, articles, news, demo, playground]
right: [search, github]
components:
demo:
text: Live demo
href: live-demo.html
playground:
text: Playground
href: playground.html

news:
releases:
Expand Down
3 changes: 2 additions & 1 deletion pkgdown/assets/live-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<h1>LAGOtrials &mdash; live demo</h1>
<nav>
<a href="./index.html">Home</a>
<a href="./playground.html">Playground</a>
<a href="./reference/index.html">Reference</a>
<a href="https://github.com/correspondMerchant/LAGO-R-Package">GitHub</a>
</nav>
Expand All @@ -92,7 +93,7 @@ <h1>LAGOtrials &mdash; live demo</h1>
so give it a moment.
</p>

<div id="status" class="status"><span class="spinner"></span><span id="status-text">Starting webR&hellip;</span></div>
<div id="status" class="status" role="status" aria-live="polite"><span class="spinner"></span><span id="status-text">Starting webR&hellip;</span></div>

<label for="code">R code</label>
<textarea id="code" spellcheck="false"></textarea>
Expand Down
Loading
Loading