GreenSloth ships curated photosynthesis ODE models, each simulated entirely in your browser. A model is now data, not code: a small folder you can add through the GitHub web UI. The full write-up lives in CONTRIBUTING.md.
src/lib/models/<slug>/ folder (below), run the checks, and
open a PR.Models are auto-discovered: drop a folder under src/lib/models/<slug>/ and it registers itself. A model appears
on the site when it has a meta.ts and a model file in any supported
format — model.mxl.json (preferred), model.sbml, or a hand-written model.ts.
src/lib/models/<slug>/ model.mxl.json # the model as data (or model.sbml) meta.ts # title, DOI, tags, dashboard analyses model.md # prose description shown on the model page comment.md # short validation note (optional) scheme.svg # reaction scheme diagram (optional)
Pick a <slug> like matuszynska2016_npq; it
must match the slug field in meta.ts.
The model itself is data. You don't hand-write it — export it from a tool:
.mxl.json directly — the format greensloth
loads first.model.sbml in the folder
and greensloth converts it on load with sbmlToModel.model.ts (a KineticModelBuilder) stays supported as the authoring source;
generate its data file with the script:# Hand-written model.ts is still supported as the authoring source. # After writing src/lib/models/<slug>/model.ts, generate the data file: npm run generate:mxl # writes model.mxl.json next to every model.ts
The in-app builder loads your model and
runs it live — the quickest way to confirm a .mxl.json or .sbml file is well-formed before opening a contribution.
meta.ts, presentation metadataPresentation stays typed TypeScript — title, DOI, tags and the dashboard
analyses. The builder generates this for you; the full ModelMeta and analysis options are documented in src/lib/types.ts.
import type { ModelMeta } from "$lib/types";
export const meta: ModelMeta = {
slug: "authoryear",
title: "Author Year, Journal",
DOI: "10.xxxx/xxxxx",
tags: {
"Part of Photosynthesis": ["PSII", "PQ Cycle"],
Demonstrations: ["PAM Simulation"],
},
analyses: [
{ type: "timecourse", title: "Time course", tEnd: 100, nTimePoints: 500 },
],
};model.md — a couple of paragraphs: what the model describes, the
organism, the key reference (link the DOI).comment.md — one line on how the model was validated (optional).scheme.svg — a diagram of the reaction scheme (optional).npm install npm run validate:models # schema-validate + smoke-check every model npm run dev # open the model page, confirm the analyses run
Then open a pull request against green-sloth. CI
re-runs validate:models and a build on every PR.