AnatomyForgeThe collection
← All studies

Metabolism / Study notes

Diabetic ketoacidosis (DKA)

Source: saved session 01a154bf-cfa0-743b-9ef2-78cd8a7b7cd3, October 19, 2026.

The original physiology write-up and follow-up control instructions are preserved verbatim below. Desktop paths and verification claims refer to that original session, not this import. Educational material only; not a clinical protocol. Medical statements and cited consensus thresholds have not been independently verified during import. The original limitations include assumed full respiratory compensation, potassium discussed only in the caption, and the fluid-deficit beaker interpretation. Clinical review is required before teaching or patient-care use.


I built the DKA figure: an interactive bench machine where each part stands for one piece of the physiology, driven by a small numerical model. Both pages open with no console errors. The line-end check showed no stray lines in either theme, at rest, in full DKA and partway through treatment. Hover and treatment both work in the browser, and I checked the desktop, phone and close-up views.

Files are in ~/Desktop/02_projects/anatomy-dka/:

What each part stands for

Part Meaning
Hopper with two valves on one bar The liver: one valve releases glucose, the other ketoacids
Syringe holding the bar up Insulin, keeping both valves shut
Springs pushing the bar down Glucagon, cortisol and adrenaline, which push the valves open
Left column Blood glucose. Above 180 mg/dL it spills over a lip into the beaker (urine), taking water with it
Right column, piston (the highlighted part) Bicarbonate below the piston, ketone acids above it. Each acid uses up one bicarbonate, so the piston drops as the anion gap (the readout's AG) grows
Bellows on springs The lungs, breathing out CO₂. They breathe deeper and faster as acid builds (Kussmaul breathing)
Dial Blood pH, with a red band below 7.30
Red marks on the scales DKA thresholds: glucose 200 mg/dL, bicarbonate 18

How it works

Model and sources

Limitations


I've opened the light version (dka-light.html) in your browser. To open the dark version, run open ~/Desktop/02_projects/anatomy-dka/dka.html.


There are no on-screen buttons. Everything is controlled with the mouse or keyboard directly on the figure.

Mouse

Keyboard (press Tab to select the figure first; a thin outline appears)

Key Action
→ or ↑ Less insulin (5% steps)
← or ↓ More insulin (5% steps)
Shift + arrow 25% steps
Home Normal insulin
End No insulin (full DKA)
Space or Enter Start or stop treatment

Clicking also selects the figure for the keys, but it starts treatment at the same time. Tab selects it without that.

Touch: a tap starts treatment. Phones have no hover, so you can't set the insulin level by hand there; the automatic loop shows the full range.

When you stop interacting for 4 seconds, the automatic loop takes over again: normal, DKA developing, treatment, recovery.