Skip to content

Instantly share code, notes, and snippets.

@taylorh140
taylorh140 / treemap.typ
Created November 6, 2023 22:16
A treemap displayer for typst it uses cetz to render. (based of squarify)
#import "@preview/cetz:0.1.2": canvas, chart, draw
// INTERNAL FUNCTIONS not meant to be used by the user
#let pad_rectangle(rect) = {
if rect.dx > 2 {
rect.x += 1
rect.dx -= 2
}
if rect.dy > 2 {