Interactive playground for experimenting with linear regression algorithms.
This sketch demonstrates three different approaches to linear regression:
- Simple Trick: Basic gradient descent approach
- Square Trick: Least squares method with squared error
- Absolute Trick: Robust regression using absolute error
Click and drag to add data points, then experiment with different algorithms to see how they fit lines to your data.
- Mouse: Click to add data points, drag to create multiple points
- Keyboard:
1
- Simple Trick algorithm2
- Square Trick algorithm3
- Absolute Trick algorithmr
- Reset data pointsspace
- Toggle algorithm animation
- Canvas size: 400x400 pixels
- Libraries: p5.js v1.11.2, p5.sound v0.3.14
- Features: Interactive data points, algorithm visualization, real-time line fitting
- Performance: Any notes about framerate or optimization
- Clone this repository
- Open
index.html
in a web browser - Or serve with a local server:
python -m http.server 8000
├── index.html # Main HTML file with responsive design
├── sketch.js # p5.js sketch code
├── style.css # CSS with dark mode support
├── values.yaml # Sketch metadata and GitOps configuration
├── libraries/ # p5.js library files
└── GitOps files # Chart.yaml, templates/
This template uses a simplified ConfigMap-based approach for automatic deployment to the Goldentooth Kubernetes cluster.
-
Edit values.yaml with your sketch details:
sketch: name: "my-amazing-sketch" title: "My Amazing Sketch" description: "A beautiful p5.js creation" author: "Your Name" repository: "https://github.com/goldentooth/my-amazing-sketch.git"
-
Add
gitops-repo
topic to your GitHub repository -
Push to main branch → Automatic deployment!
- ArgoCD detects repositories with
gitops-repo
topic - ConfigMap created containing sketch registration data
- p5js-sketches controller watches for new ConfigMaps
- Sync job created to clone your repository to Ceph storage
- Sketch goes live at
https://p5js-sketches.services.k8s.goldentooth.net/<name>/
# Check ConfigMap created
kubectl get configmaps -n p5js-sketches -l p5js-sketch/registration=true
# Watch sync jobs
kubectl get jobs -n p5js-sketches -l p5js-sketch/component=sync
# Check controller logs
kubectl logs -n p5js-sketches deployment/p5js-sketches -c sketch-controller
- Sync fails: Check repository access and ensure
index.html
andsketch.js
exist - Not discovered: Verify
gitops-repo
topic is added to repository - Files not appearing: Check controller logs and verify Ceph storage connectivity
- All sync logic centralized in p5js-sketches controller
- Template repositories only contain simple ConfigMap creation
- No complex job manifests duplicated across sketches
- Single ConfigMap template vs 5+ complex manifests
- Easier to understand and maintain
- Consistent behavior across all sketches
- All sync operations in single namespace
- Centralized logging and monitoring
- Single controller to debug
Goldentooth Project
Part of the Goldentooth cluster p5.js sketch collection
MIT License - Feel free to use and modify