3b1b setup guide

2026-03-25

3Blue1Brown Setup Guide

This is an AI generated guide I wrote for myself that I put up on my blog for safekeeps.

This tutorial covers how to replicate Grant Sanderson's interactive math animation environment (as seen at the start of this video) using the ManimGL engine and the uv package manager.


1. Environment Initialization

Grant uses ManimGL (the OpenGL version), which allows for real-time interaction. Use uv to manage the specific legacy dependencies required.

# Create project and pin stable Python version
mkdir math-animations && cd math-animations
uv init
uv python pin 3.12

# Install ManimGL and legacy compatibility tools
uv add manimgl "setuptools<70.0.0"

2. Fixing LaTeX Dependencies

Manim renders math via LaTeX. If you see .sty file errors, you are likely using a minimal LaTeX install (like BasicTeX) and need to add specific packages via your terminal:

sudo tlmgr install calligra relsize standalone preview doublestroke fundus-calligra

3. The Interactive Script

Create start.py. This script uses self.embed() to open the interactive window and an IPython terminal simultaneously.

from manimlib import *

class InteractiveScene(Scene):
    def construct(self):
        plane = ComplexPlane()
        self.add(plane)

        # Input Dot (Yellow)
        dot = Dot(color=YELLOW).shift(RIGHT)
        self.add(dot)

        # Output Dot (Pink) following w = z^2
        out_dot = Dot(color=PINK)
        out_dot.add_updater(lambda m: m.move_to(
            plane.c2p(plane.p2c(dot.get_center())**2)
        ))
        
        # Visual trail
        trace = TracedPath(out_dot.get_center, stroke_color=PINK)
        self.add(out_dot, trace)

        self.embed() 

4. Running the Setup

Execute the following command:

uv run manimgl start.py InteractiveScene

5. Interaction Controls

Once the window opens:

  • Mouse: Click and drag the yellow dot to see the pink dot react.
  • Terminal: Type dot.set_color(BLUE) in the IPython prompt to see the change live.
  • Camera: Right-click and drag to rotate into 3D; use Z + scroll to zoom.

The Sediment of Software Chart

2026-03-08

I started maintaining a new project that tracks the evolution of a Github repository using "sediment" charts. The final output is a Github Pages site that lets you explore sediment charts for different Python projects. Here's one example for the sentence-transformers library.

Uploaded image
There's not a whole lot of action between 2022-2024. But then huggingface took over maintainership.

These charts track each line of code in the project and how it's changing over time. The resulting chart looks like layers of sediment that changes over time.

For Python projects you can also overlay the version number, to try and get some extra context. Usually, Bitco changes coincide with the new version, like with the Django projects shown below.

Uploaded image
Around version 4 you can see a big shift where a lot of *recent* code is changing. Maybe they updated the docs here? Or possibly switches from flake8 to ruff?

I like to think these charts also say something about the health of a project. A good project shows more code being added over time, but without huge changes to past code. The most healthy image I found so far is for marimo. This is my employer, and it is nice to see how the chart matches my experience with the culture there.

Uploaded image
This project is relatively young, so time is measured in quarters instead of years.

Over time I hope this project might track the effect of coding agents. Are we going to see a big spike up? Is it going to rewrite everything from the past? Time will tell, but these charts will give me a nice summary. If you are curious you can run the notebook yourself if you want to give it a spin for your own projects.

I also recorded a YT video for this work here, if you prefer to see a live demo.

local mlx speedups

2026-03-02

I never really used the MLX features from Apple but the UMAP-MLX project is making me wonder if I should dabble in it more. This project takes UMAP and gives it a significant speedup, 30x! Small caveat here is this currently only works for datasets that are small enough not to need approximation algorithms.

Uploaded image
The clusters look similar too

Some stats from the readme:

N       umap-learn    MLX      speedup
1000    4.87s         0.40s    12x
2000    6.18s         0.36s    17x
5000    17.22s        0.44s    40x
10000   25.85s        0.56s    46x
20000   22.01s        0.54s    41x
60000   68.99s        2.04s    34x
70000   81.40s        2.65s    31x

Impressive!