Contributing a New Entry
Each entry in the encyclopedia is a single .mdx file in
src/content/ifs/. To add a new fractal, fork the
repository,
create the file, and open a pull request.
1. Choose a slug
The filename (without .mdx) becomes the URL path: /ifs/your-slug.
Use lowercase letters, digits, and hyphens only. Examples: gosper-island,
twin-dragon, ammann-beenker.
2. Frontmatter fields
Every entry starts with a YAML frontmatter block between --- delimiters.
Required fields
| Field | Type | Description |
|---|---|---|
name | string | Human-readable display name. Shown in the catalog, page title, and search results. |
description | string | One sentence. Used in <meta description> and the search index. |
transforms | integer | Number of affine maps in the IFS (positive integer). |
tags | array | See the tag list below. At minimum include a dimension tag (plane or 3d). |
aifs | literal block string | AIFS program that renders the fractal. See §3 below. |
Optional fields
| Field | Type | Description |
|---|---|---|
cardDescription | string | Short text shown on the catalog card. Falls back to description if omitted. |
dimension | string | Hausdorff dimension as a display string, e.g. "log(3)/log(2) ≈ 1.585" or "2". |
boundaryDimension | string | Hausdorff dimension of the boundary ∂A, e.g. "≈ 1.5236", "1 (polyhedral)", or "0 (point contacts)". |
references | array | List of {text, url?} objects. Include original papers, Wikipedia, and Tilings Encyclopedia links where available. |
Complete frontmatter example
---
name: "Gosper Island"
description: "Self-similar 2D fractal tile associated with the polynomial x²−5x+7."
cardDescription: "Seven self-similar maps with hexagonal algebra."
dimension: "2"
transforms: 7
boundaryDimension: "≈ 1.1292"
tags: [plane, self-similar, tiling, algebraic]
aifs: |
@
$dim=2
$subspace=[s,0]
s=[0,-1,1,1]
g=[3,1,-1,2]
h0=s^2*[1,0]
h1=s^5*[0,-1]
h2=s^2*[-1,0]
h3=1
h4=[0,-1]
h5=s^2*[0,-1]
h6=s*[1,0]
A=g^-1*(h0|h1|h2|h3|h4|h5|h6)*A
references:
- text: "Mandelbrot, B. B. (1982). The Fractal Geometry of Nature."
- text: "Gosper island — Wikipedia"
url: "https://en.wikipedia.org/wiki/Gosper_island"
--- 3. Writing the AIFS program
The aifs field contains an AIFS program — the language used
by IFStile and the
in-browser renderer. Use a YAML literal block scalar (the | character after
the field name), then indent the program by two spaces.
Minimal 2D IFS (Sierpiński triangle)
aifs: |
@
$dim=2
f1=[0.5,0,0,0.5]
f2=[0.5,0]*[0.5,0,0,0.5]
f3=[0.25,0.5]*[0.5,0,0,0.5]
S=(f1|f2|f3)*S @— starts an anonymous block.$dim=2— 2D rational space (required).[tx,ty]*[a,b,c,d]— affine map: matrix[[a,b],[c,d]]then translation[tx,ty].S=(f1|f2|f3)*S— attractor equation (mandatory; without it nothing renders).
Algebraic IFS via companion matrix (Heighway dragon)
aifs: |
@
$dim=2
s=$companion([1,0]) # s satisfies s²+1=0, i.e. s ↔ i
g=s+1 # expansion: 1+i
A=(s*g^-1|[1,0]*s^2*g^-1)*A $companion([a0,a1,...,an-1]) builds the companion matrix for
xn + an−1xn−1 + … + a0.
Use $subspace=[s,0] to project onto the first eigenplane of s
when the IFS lives in a higher-dimensional rational space.
GIFS — multiple tile types (Robinson triangles)
When the tiling has several prototile shapes, each gets its own attractor variable and
equation. Add the gifs tag.
aifs: |
@
$dim=4
$subspace=[s,0]
s=$companion([1,0,0,0]) # 8th cyclotomic, s↔e^(iπ/4)
...
A1=g^-1*(h0*A1|h1*A2)
A2=g^-1*(h2*A1|h3*A2|h4*A2)
To render a specific attractor set, add $root=A1 inside the block,
or pass a root prop to <IFSCanvas>.
Verify in IFStile
Paste the AIFS program into app.ifstile.com before submitting. The attractor should render without errors. Common mistakes:
- Missing attractor equation —
initsucceeds but nothing is drawn. - Expansion instead of contraction — swap
g^-1*h*Aandh^-1*g*Aforms. #starts a comment — everything after it on the line is ignored.
4. Tags
Use tags from the table below. Combine freely; order does not matter.
| Tag | Meaning |
|---|---|
plane | Lives in 2D (Euclidean plane). Mutually exclusive with 3d. |
3d | Three-dimensional fractal. |
self-similar | The standard IFS attractor equation A = ⋃ fᵢ(A). |
gifs | Generalized IFS — multiple interleaved attractor sets (e.g. GIFS tilings). |
tiling | The attractor tiles the plane (or space) by copies of itself. |
rep-tile | The tile is a rep-tile: it can be dissected into smaller similar copies. |
curve | The attractor is a fractal curve (1D Hausdorff, plane-filling or not). |
algebraic | Defined via a companion matrix or arithmetic in an algebraic number field. |
aperiodic-tiling | The tiling is aperiodic (no translational periodicity). |
quasicrystal | Has long-range quasicrystalline order (5-, 7-, 8-, 10-, 12-fold symmetry). |
limit-periodic | Limit-periodic tiling (chair, sphinx, etc.). |
p-adic | Related to p-adic structure or hierarchical substitution. |
pentagonal | 5-fold symmetry (pentadendrite, pentigree, Robinson triangles …). |
hexagonal | 6-fold symmetry (sphinx, Koch snowflake …). |
dendrite | Fractal dendrite (star-shaped, tree-like boundary). |
classic | Historically well-known entry found in most fractal textbooks. |
probabilistic | Random IFS (maps chosen with probabilities, e.g. Barnsley fern). |
naturalistic | Resembles a natural object (plant, landscape, …). |
5. Writing the Markdown body
After the closing ---, write freely in Markdown. A typical structure:
- Overview — one paragraph describing what the fractal is and why it is interesting.
- Definition — the maps in matrix/vector form using LaTeX math.
- Properties — dimension, symmetry, algebraic structure.
- Boundary Dimension (optional) — if you computed it.
- References — the
referencesfrontmatter field is rendered automatically at the bottom.
Math syntax
- Inline math:
$f(x) = Ax + b$ - Display math: put
$$alone on its own line, never at the end of a content line. - Separate adjacent display blocks with a blank line.
Canvas (fractal preview)
For a single attractor the canvas is rendered automatically from the aifs
frontmatter field — nothing extra needed.
Multiple variants on one page (family / gallery)
If your entry showcases a family of related fractals (like the Square Family),
put each variant in its own export const AIFS string in the MDX body,
then place as many <IFSCanvas> elements as you need.
The aifs frontmatter field should hold the most representative or canonical
variant — it is used for the catalog card thumbnail.
import IFSCanvas from '../../components/IFSCanvas.astro';
export const aifsVariantA = `@
$dim=2
...
A=...`;
export const aifsVariantB = `@
$dim=2
...
A=...`;
<div class="canvas-row">
<figure>
<IFSCanvas id="my-slug-a" aifs={aifsVariantA} width={280} height={280} label="Variant A" />
<figcaption>Variant A</figcaption>
</figure>
<figure>
<IFSCanvas id="my-slug-b" aifs={aifsVariantB} width={280} height={280} label="Variant B" />
<figcaption>Variant B</figcaption>
</figure>
</div> - Always use
export const, not plainconst— plain variables are not accessible inside the compiled MDX content. - Each canvas
idmust be unique across the page (useslug-suffixstyle). - Group canvases in
<div class="canvas-row">for horizontal layout; three canvases fit comfortably withwidth=280.
GIFS — multiple tile types in one AIFS
When a single AIFS program has multiple interleaved attractor sets (e.g. two
triangle types in Robinson triangles), render each with a separate canvas pointing at the
same AIFS string but a different root:
import IFSCanvas from '../../components/IFSCanvas.astro';
export const myAifs = `@
$dim=4
...
A1=g^-1*(h0*A1|h1*A2)
A2=g^-1*(h2*A1|h3*A2)`;
<div class="canvas-row">
<figure>
<IFSCanvas id="my-slug-a1" aifs={myAifs} root="A1" width={380} height={380} label="Tile A1" />
<figcaption>Tile $A_1$</figcaption>
</figure>
<figure>
<IFSCanvas id="my-slug-a2" aifs={myAifs} root="A2" width={380} height={380} label="Tile A2" />
<figcaption>Tile $A_2$</figcaption>
</figure>
</div> Zoomed fragment canvas
To highlight a specific region of the fractal (e.g. a magnified boundary detail),
pass a camera prop to <IFSCanvas>.
For 2D, it is an array [cx, cy, r, angle_deg]: center coordinates,
inscribed-circle radius, and rotation angle (use 0 for no rotation).
The easiest way to find the coordinates is to open the attractor in app.ifstile.com, zoom and pan to the desired view, then copy the camera values from the IFStile UI.
The AIFS string for a zoomed canvas is the same as the main entry — do not
embed $camera inside the AIFS itself; pass it as a prop instead so the
canvas and the "Open in IFStile" link both work correctly.
import IFSCanvas from '../../components/IFSCanvas.astro';
export const aifsMain = `@
$dim=2
...
A=...`;
<!-- zoomed view of a boundary region -->
<IFSCanvas
id="my-slug-zoom"
aifs={aifsMain}
width={480} height={480}
label="My Fractal — zoomed boundary"
camera={[0.554, 0.872, 0.006, 0]}
/>
A width/height of 480 works well for zoomed canvases.
Reuse the same export const AIFS string — no need to duplicate it.
6. Submit a pull request
- Fork github.com/ifsdb/ifsdb.github.io.
- Create a branch:
git checkout -b add/your-slug. - Add your file at
src/content/ifs/your-slug.mdx. - Open a pull request with a short description of the entry.
Once the PR is merged, the main repository's CI builds and deploys the site automatically. No local setup is required.
To verify your file builds without errors before opening a PR, install Node.js 18+ and run:
npm install
npx astro build
For a live preview with hot reload, use npx astro dev instead — the dev
server opens at http://127.0.0.1:4321. See the
Astro installation guide
for full details.
If you are unsure about the AIFS program or the mathematical details, open an issue first and we can help refine it before the full PR.