Using p5.js in Hugo blog posts

2022/12/30

Tags: visualization p5js hugo

This is a post where I’m experimenting with integrating p5.js into my blog posts.

Sample javascript code:

function drawCursor() {
    drawingContext.setLineDash([2, 20])
    background(255)
    stroke(color(0, 100, 0))
    line(mouseX, 0, mouseX, height)
}

Sample python code:

from dataclasses import dataclass, field
from typing import Optional, List, Tuple, Callable
from math import floor

@dataclass
class Endpoint:
    v: float
    ix: int

Sample visualization using p5.js:

More content goes here.