The Turtle Path ROC Curve app is a browser-based teaching tool that animates how a classifier walks along a Receiver Operating Characteristic (ROC) curve. Every threshold step moves the “turtle”, recolours the ROC grid, and updates the confusion matrix and AUC.
This manual is written for instructors who plan to adapt the app for their own lessons—across medicine, pharmacology, bioinformatics, statistics, data science, or machine learning. By editing a single configuration file (turtle_config.js) you can localise text, swap datasets, adjust colours, change the cursor, and show only the controls that matter for your learners.
turtle_path.html, turtle_config.js, and the cursors/ folder together.turtle_path.html in a modern browser.turtle_config.js, save, and refresh the page to see your changes.If the Play/Pause button is visible (default), the turtle starts in the paused state so you can describe the layout before playing the animation. If you hide the button, the turtle runs automatically.
| Region | Behaviour |
|---|---|
| Plot title | Configurable (STRINGS.plot.title). |
| ROC grid | The turtle steps through the ROC path. Each time it crosses a new column, the cells below the curve, the cells above the curve, and any tie regions are shaded. |
| Case symbols | Positives (circles), negatives (diamonds), and tie steps (squares). Idle symbols use LAYOUT.opacities.idle; the current step is fully opaque. |
| Cursor | Choose between built-in shapes (None, Circle, Square) or any SVG stored in cursors/. Rotation is optional. |
| Confusion matrix | Displays TP, FP, FN, TN counts that update with each step. The panel is draggable. |
| Legend | Shows the symbols, area colours, and AUC. The legend mirrors the dataset—tie entries only appear when there are tied scores. |
| Controls | Dataset selector, Play/Pause button, optional cursor selector. All can be shown or hidden individually. |
All options live in turtle_config.js. Reload the browser after editing.
STRINGS)| Key group | Description |
|---|---|
pageTitle |
Browser tab title. |
plot.title |
Title displayed above the ROC chart. |
datasetLabel |
Label beside the dataset selector. |
control.play, control.pause |
Text on the Play/Pause button. |
confusion |
Titles and labels for the confusion matrix table. |
legend |
Legend header plus row labels for each item and AUC captions. |
cursor |
Label and option names for the cursor selector. |
tooltip |
Strings used inside point tooltips. |
datasets |
Friendly names for each dataset (keys must match DATASETS). |
axes.xLabel, axes.yLabel |
Axis captions (e.g., change to “Specificity” when reversing the x-axis). |
PALETTE)| Key | Use |
|---|---|
positive, negative, tie |
Fill colours for the symbols. |
areaBelowCurve, areaAboveCurve, tieRegionFill |
Colours for the shaded grid cells once the turtle has passed a column. To hide a category, set the colour equal to gridBackground. |
plotBackground, gridBackground, gridLine |
Plot backdrop and grid lines. |
rocStroke |
Polyline colour. |
| Remaining keys | Style the confusion matrix, legend card, panels, etc. |
DATASETS & DATASET_ORDER)scores (descending numeric values) and labels (1 for positive, 0 for negative).DATASET_ORDER to show it in the dropdown. Dataset order follows the array.LAYOUT)| Section | Keys | Purpose |
|---|---|---|
margin |
top, right, bottom, left |
Padding applied inside the SVG so titles, axes, and large cursors fit. |
symbolSizes |
Radii for origin, points, tie symbols, turtle fallback | Adjust icon sizes. |
opacities.idle |
Idle opacity used across all non-active symbols, segments, and cells. | |
animation |
stepDelay, resetDelay |
Millisecond delays between steps and before the animation restarts. |
layoutOffsets |
confusionQuadrantX, confusionQuadrantY, minPadding |
Default position of the confusion/legend panel relative to the plot size. |
grid |
enabled, lineWidth, showOuterBorder, axisLabelOffset |
Controls grid drawing and axis label offset. |
LAYOUT.turtle)| Key | Description |
|---|---|
shape |
Fallback shape when no SVG is selected ("square" or "circle"). |
size |
Maximum dimension used both for fallback shapes and for scaling SVG cursors. |
useSvgCursor |
Enables SVG cursor support. |
svgUrl |
Default SVG file (relative path). |
svgOffsetX, svgOffsetY |
Fine alignment tweaks applied after scaling. |
rotateWithPath |
Whether the cursor rotates toward the next ROC step. |
defaultOption |
Which cursor is selected on load (value from the list below). |
availableOptions |
Array of custom cursor entries: { label, value, svgOffsetX, svgOffsetY, size, rotateWithPath }. |
Adding custom cursors
cursors/ directory.availableOptions with the relative path (e.g., "cursors/arrow.svg").size, svgOffsetX, svgOffsetY, or rotateWithPath for that specific cursor.LAYOUT.controls)| Flag | Behaviour |
|---|---|
showPlayPause |
Displays the Play/Pause button. |
showDatasetSelector |
Displays the dataset dropdown. |
showCursorSelector |
Displays the cursor dropdown. |
showConfusionMatrix |
Show/hide the confusion matrix table. |
showLegend |
Show/hide the legend and AUC display. |
showPartialAuc |
When false, AUC is hidden until the turtle finishes the walk. |
#ffeeaa) represent pairwise wins.#ff3333) represent losses.#ff9900) indicate equal scores.As the turtle passes each column, the corresponding cells become opaque and the AUC updates:
[ \text{AUC} = \frac{\text{cells below} + 0.5 \times \text{tie cells}}{\text{total cells}} ]
showPartialAuc is true, the legend displays “AUC (partial)” until all columns are processed. Set showPartialAuc to false to withhold the number until the animation completes.areaBelowCurve, areaAboveCurve, or tieRegionFill to the same value as gridBackground.When showCursorSelector is enabled:
availableOptions.showCursorSelector: false) to lock in a single cursor.showConfusionMatrix and showLegend can be toggled independently; the panel disappears entirely if both are false.turtle_path.html can be edited for further branding (fonts, panel colours, etc.).<iframe> or load both files in platforms like R Shiny or htmlwidgets; the configuration file remains the single source of truth.STRINGS with localised plot titles, labels, and legend wording.DATASETS and DATASET_ORDER.PALETTE; match area colours to gridBackground to hide them.LAYOUT.turtle so the default cursor and available choices reflect your lesson.LAYOUT.controls.LAYOUT.animation and margins.turtle_path.html, then walk through the complete ROC path to confirm behaviour.Adapting the Turtle Path ROC Curve app is intentionally flexible. With a few edits you can align the visuals, text, and interaction with whichever ROC-focused story you need to teach. Happy customising, and may your students enjoy following the turtle on its journey!***