Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the live-simulation equilibrium/Kd plotting and related UI flow, including adding competitive binding (Ki) support and a few UI/parameter tweaks.
Changes:
- Rename the precomputed simulation name→type map for clarity and tweak live binding parameters.
- Update equilibrium plot logic to support competitive binding (Ki) with different fit/annotation behavior.
- Small UI/UX updates (enable navigation button, add quiz hint text, lock page scrolling, reset additional analysis state).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/simulation/PreComputedSimulationData.ts |
Renames static map used to derive agent/product types. |
src/simulation/LiveSimulationData.ts |
Adjusts binding parameter (kOn) and formatting. |
src/simulation/BindingSimulator2D.ts |
Formatting-only changes (trailing commas). |
src/index.css |
Enables overflow: hidden on body. |
src/content/LowAffinity.tsx |
Enables nextButton at end of Low Affinity content. |
src/components/quiz-questions/KdQuestion.tsx |
Adds additional hint paragraph for answering the question. |
src/components/plots/EquilibriumPlot.tsx |
Adds module-dependent regression/annotation logic (Kd vs Ki). |
src/App.tsx |
Expands analysis reset, minor navigation behavior change, and adds a debug log. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <p> | ||
| If you're not sure, look at the where the line crosses the 50% | ||
| mark on the <strong>Equilibrium concentration plot.</strong> | ||
| </p> |
There was a problem hiding this comment.
The new helper text has a grammatical typo: "look at the where" should be "look at where".
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Fixed in c8b057b — removed the extra "the" so the text now reads "look at where the line crosses the 50%".
| if (module === Module.A_B_D_AB) { | ||
| bestFit = regression.exponential(regressionData); | ||
| const max = Math.max(...y); | ||
| const min = Math.min(...y); | ||
| const halfMax = (max - min) / 2 + min; | ||
| // for exponential, the equation is in the form y = a * e^(b*x) | ||
| // bestFit.equation[0] is a and bestFit.equation[1] is b, so to solve for x when y is halfMax: | ||
| // halfMax = a * e^(b*x) | ||
| // halfMax / a = e^(b*x) | ||
| // ln(halfMax / a) = b*x | ||
| // x = ln(halfMax / a) / b | ||
| value = | ||
| Math.log(halfMax / bestFit.equation[0]) / bestFit.equation[1]; | ||
| } else { |
There was a problem hiding this comment.
When module === Module.A_B_D_AB and there are no recorded points yet, y can be empty here. In that case Math.max(...y)/Math.min(...y) evaluate to -Infinity/Infinity, making halfMax and the derived value become NaN. Consider guarding this branch (and skipping regression) until you have enough data points.
Agent-Logs-Url: https://github.com/simularium/binding-sim-edu/sessions/8cd74e6d-d6f7-47e6-b8ff-ab0f707e2892 Co-authored-by: meganrm <5170636+meganrm@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| background-color: var(--background-color); | ||
| color: var(--text-color); | ||
| /* overflow: hidden; */ | ||
| overflow: hidden; |
There was a problem hiding this comment.
Setting body { overflow: hidden; } prevents page scrolling and can clip content on smaller viewports or when text is zoomed, which is an accessibility regression. Prefer scoping overflow constraints to the simulation container/canvas, or allow vertical scrolling (overflow-y: auto) while controlling only the area that must be fixed.
| overflow: hidden; | |
| overflow-x: hidden; | |
| overflow-y: auto; |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…o to avoid variable shadowing Agent-Logs-Url: https://github.com/simularium/binding-sim-edu/sessions/25c7a586-2e66-4802-954b-ec3df06ecf12 Co-authored-by: meganrm <5170636+meganrm@users.noreply.github.com>
console.log("NEW BINDING SIMULATOR")debug statement in App.tsx (guarded behindprocess.env.NODE_ENV !== "production")let bestFitvariable tofitResultinside thebestFituseMemo in EquilibriumPlot.tsxFull set of changes in this PR:
bestFit→fitResultinside EquilibriumPlot useMemoconsole.log(guarded behind dev-only check)⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.