mouse-trajectory-plotter
SKILL.md
Mouse Trajectory Plotter
Purpose
Convert mouse trajectory input into a trajectory image.
Required Input Parameter
Use a required parameter named mouse_trajectory.
Accepted shapes:
- Array of point objects:
[
{ "x": 120, "y": 340, "t": 0 },
{ "x": 125, "y": 336, "t": 16 },
{ "x": 131, "y": 331, "t": 33 }
]
- Object with
points:
{
"points": [
{ "x": 120, "y": 340, "t": 0 },
{ "x": 125, "y": 336, "t": 16 }
]
}
- File path pointing to JSON with one of the two shapes above.
Workflow
- Validate
mouse_trajectoryexists and includes at least 2 points. - Save normalized points to a JSON file if needed.
- Run:
python3 scripts/plot_mouse_trajectory.py --input <input-json-or-path> --output <output-svg-path> --title "Mouse Trajectory"
- Return:
- output image path
- point count
- min/max x and y
Command Reference
Script path:
scripts/plot_mouse_trajectory.py
Arguments:
--input(required): inline JSON string or JSON file path--output(required): output SVG path--title(optional): chart title--width(optional): canvas width, default1000--height(optional): canvas height, default700--padding(optional): canvas padding, default40
Error Handling
- If
mouse_trajectoryis missing, ask for it explicitly. - If point count < 2, ask for more points.
- If any point misses
xory, return a clear validation error.
Additional Resource
- Usage examples: examples/sample_trajectory.json