Liking cljdoc? Tell your friends :D

patterning.layouts


alt-colsclj/s

(alt-cols n groups1 groups2)

Fills a group-stream with cols from alternative group-streams

Fills a group-stream with cols from alternative group-streams
sourceraw docstring

alt-cols-grid-layoutclj/s

(alt-cols-grid-layout n groups1 groups2)

Every other column from two streams

Every other column from two streams
sourceraw docstring

alt-rowsclj/s

(alt-rows n groups1 groups2)

Fills a group-stream with rows from alternative group-streams

Fills a group-stream with rows from alternative group-streams
sourceraw docstring

alt-rows-grid-layoutclj/s

(alt-rows-grid-layout n groups1 groups2)

Every other row from two streams

Every other row from two streams
sourceraw docstring

aspect-ratio-frameclj/s

(aspect-ratio-frame cols rows corner-pattern edge-pattern)
source

aspect-ratio-framedclj/s

(aspect-ratio-framed cols rows corner-pattern edge-pattern inner-pattern)
(aspect-ratio-framed cols rows corner-pattern edge-pattern inner-pattern fit-fn)
source

calc-dimsclj/s

(calc-dims cols rows)
source

cartclj/s

(cart colls)

Cartesian Product of two collections

Cartesian Product of two collections
sourceraw docstring

check-seqclj/s

(check-seq n groups1 groups2)

returns the appropriate lazy seq of groups for constructing a checkered-grid

returns the appropriate lazy seq of groups for constructing a checkered-grid
sourceraw docstring

checkered-gridclj/s

(checkered-grid number groups1 groups2)

does checks using grid layout (column-wise)

does checks using grid layout (column-wise)
sourceraw docstring

clock-rotateclj/s

(clock-rotate n group)
(clock-rotate n offset group)

Circular layout. Returns n copies in a rotation. Optional offset pushes items out from center before rotating.

Circular layout. Returns n copies in a rotation. Optional offset pushes items out from center before rotating.
sourceraw docstring

cornersclj/s

(corners cols rows corner-pattern)
source

diamond-gridclj/s

(diamond-grid n groups)

Like half-drop

Like half-drop
sourceraw docstring

diamond-layout-positionsclj/s

(diamond-layout-positions number)

Diamond grid, actually created like a half-drop

Diamond grid, actually created like a half-drop
sourceraw docstring

drop-everyclj/s

(drop-every n xs)
source

edgesclj/s

(edges cols rows edge-pattern)
source

ensure-sequenceclj/s

(ensure-sequence xs)

If xs is a single group/pattern (sequence of SShapes), repeat it. If xs is already a sequence of groups/patterns, return as-is.

If xs is a single group/pattern (sequence of SShapes), repeat it.
If xs is already a sequence of groups/patterns, return as-is.
sourceraw docstring

flower-of-life-positionsclj/s

(flower-of-life-positions r depth [cx cy])
source

four-mirrorclj/s

(four-mirror group)

Four-way mirroring. Returns the group repeated four times reflected vertically and horizontall

Four-way mirroring. Returns the group repeated four times reflected vertically and horizontall
sourceraw docstring

four-roundclj/s

(four-round group)

Four squares rotated

Four squares rotated
sourceraw docstring

frameclj/s

(frame grid-size corners edges)

Frames consist of corners and edges.

Frames consist of corners and edges. 
sourceraw docstring

framedclj/s

(framed grid-size corners edges inner)

Puts a frame around the other group

Puts a frame around the other group
sourceraw docstring

gridclj/s

(grid n groups)

Takes an n and a group-stream and returns items from the group-stream in an n X n grid (column-wise: top to bottom, then next column)

Takes an n and a group-stream and returns items from the group-stream in an n X n grid (column-wise: top to bottom, then next column)
sourceraw docstring

grid-layout-positionsclj/s

(grid-layout-positions number)

calculates the positions for a grid layout (column-wise: top to bottom, then next column)

calculates the positions for a grid layout (column-wise: top to bottom, then next column)
sourceraw docstring

h-checkered-gridclj/s

(h-checkered-grid number groups1 groups2)

does checks using h-grid layout (row-wise)

does checks using h-grid layout (row-wise)
sourceraw docstring

h-gridclj/s

(h-grid n groups)

Takes an n and a group-stream and returns items from the group-stream in an n X n grid (row-wise: left to right, then next row)

Takes an n and a group-stream and returns items from the group-stream in an n X n grid (row-wise: left to right, then next row)
sourceraw docstring

h-grid-layout-positionsclj/s

(h-grid-layout-positions number)

calculates the positions for a grid layout (row-wise: left to right, then next row)

calculates the positions for a grid layout (row-wise: left to right, then next row)
sourceraw docstring

h-mirrorclj/s

(h-mirror group)

Reflect horizontally and stretch

Reflect horizontally and stretch
sourceraw docstring

h-rowclj/s

(h-row n margin groups)

Takes n (number of groups), margin (spacing between groups), and groups (sequence of patterns). Lays out groups left to right with margin spacing.

Takes n (number of groups), margin (spacing between groups), and groups (sequence of patterns). Lays out groups left to right with margin spacing.
sourceraw docstring

half-drop-gridclj/s

(half-drop-grid n groups)

Like grid but with half-drop

Like grid but with half-drop
sourceraw docstring

half-drop-grid-layout-positionsclj/s

(half-drop-grid-layout-positions number)

Like a grid but with a half-drop every other column

Like a grid but with a half-drop every other column
sourceraw docstring

hex-gridclj/s

(hex-grid n groups)

Takes an n and a group-stream and returns items in a hexagonal grid layout

Takes an n and a group-stream and returns items in a hexagonal grid layout
sourceraw docstring

hex-grid-layout-positionsclj/s

(hex-grid-layout-positions number)

calculates positions for a hexagonal grid layout (pointy-top hexagons)

calculates positions for a hexagonal grid layout (pointy-top hexagons)
sourceraw docstring

inner-maxclj/s

(inner-max inner-w inner-h inner-content)

Fills inner rectangle and clips excess (crop to fit)

Fills inner rectangle and clips excess (crop to fit)
sourceraw docstring

inner-minclj/s

(inner-min inner-w inner-h inner-content)

Shrinks content to fit within inner rectangle (letterbox/pillarbox)

Shrinks content to fit within inner rectangle (letterbox/pillarbox)
sourceraw docstring

inner-stretchclj/s

(inner-stretch inner-w inner-h inner-content)

Stretches content to exactly fill the inner rectangle

Stretches content to exactly fill the inner rectangle
sourceraw docstring

iterate-stackclj/s

(iterate-stack n f pattern)

Applies a transformation function iteratively to a pattern and stacks all results. Returns n+1 patterns: [original, f(original), f(f(original)), ...] for n iterations.

Examples: (iterate-stack 3 #(groups/scale 0.8 %) pattern) ; progressively smaller (iterate-stack 5 #(groups/translate 0.1 0.1 %) pattern) ; progressive translation (iterate-stack 4 #(groups/rotate (/ maths/PI 8) %) pattern) ; progressive rotation

Applies a transformation function iteratively to a pattern and stacks all results.
Returns n+1 patterns: [original, f(original), f(f(original)), ...] for n iterations.

Examples:
(iterate-stack 3 #(groups/scale 0.8 %) pattern)  ; progressively smaller
(iterate-stack 5 #(groups/translate 0.1 0.1 %) pattern)  ; progressive translation
(iterate-stack 4 #(groups/rotate (/ maths/PI 8) %) pattern)  ; progressive rotation
sourceraw docstring

map-stackclj/s

(map-stack f patterns)

Maps a function across a sequence of patterns and stacks the results. Can accept either a single pattern or a sequence of patterns.

Examples: (map-stack #(groups/scale 0.8 %) [pat1 pat2 pat3]) (map-stack #(groups/rotate (/ maths/PI 4) %) pattern)

Maps a function across a sequence of patterns and stacks the results.
Can accept either a single pattern or a sequence of patterns.

Examples:
(map-stack #(groups/scale 0.8 %) [pat1 pat2 pat3])
(map-stack #(groups/rotate (/ maths/PI 4) %) pattern)
sourceraw docstring

nested-stackclj/s

(nested-stack reducer n group & [styles])

superimpose smaller copies of a shape

superimpose smaller copies of a shape
sourceraw docstring

old-ringclj/s

(old-ring n offset groups)

Legacy ring layout (pre-2026 behavior).

Legacy ring layout (pre-2026 behavior).
sourceraw docstring

one-col-layoutclj/s

(one-col-layout n i groups1 groups2)

uses one-x-layout with rows

uses one-x-layout with rows
sourceraw docstring

one-row-layoutclj/s

(one-row-layout n i groups1 groups2)

uses one-x-layout with rows

uses one-x-layout with rows
sourceraw docstring

one-x-layoutclj/s

(one-x-layout n i f groups1 groups2)

Takes a total number of rows, an index i and two group-streams. Makes an n X n square where row or col i is from group-stream2 and everything else is group-stream1

Takes a total number of rows, an index i and two group-streams.
Makes an n X n square where row or col i is from group-stream2 and everything else is group-stream1
sourceraw docstring

place-groups-at-positionsclj/s

(place-groups-at-positions groups positions)

Takes a list of groups and a list of positions and puts one of the groups at each position

Takes a list of groups and a list of positions and puts one of the groups at each position
sourceraw docstring

q1-rot-groupclj/s

(q1-rot-group group)
source

q2-rot-groupclj/s

(q2-rot-group group)
source

q3-rot-groupclj/s

(q3-rot-group group)
source

random-gridclj/s

(random-grid n groups & {:keys [random] :or {random default-random}})

Takes a group and returns a grid with random quarter rotations

Takes a group and returns a grid with random quarter rotations
sourceraw docstring

random-turn-groupsclj/s

(random-turn-groups groups & {:keys [random] :or {random default-random}})
source

rgridclj/s

(rgrid cols rows groups)

Takes cols, rows, and a group-stream and returns items in a rectangular grid with square tiles, filled row-wise (left to right, top to bottom)

Takes cols, rows, and a group-stream and returns items in a rectangular grid with square tiles, filled row-wise (left to right, top to bottom)
sourceraw docstring

rgrid-layout-positionsclj/s

(rgrid-layout-positions cols rows)

calculates the positions for a rectangular grid layout in row-wise order (left to right, top to bottom)

calculates the positions for a rectangular grid layout in row-wise order (left to right, top to bottom)
sourceraw docstring

ringclj/s

(ring rotation-number group)
(ring rotation-number radius-offset scale-factor group)

Ring layout where each copy keeps its original orientation.

Ring layout where each copy keeps its original orientation.
sourceraw docstring

ring-outclj/s

(ring-out rotation-number group)
(ring-out rotation-number radius-offset scale-factor group)

Ring layout where each copy faces outward from the center.

Ring layout where each copy faces outward from the center.
sourceraw docstring

ring-rotateclj/s

(ring-rotate rotation-number group)
(ring-rotate rotation-number radius-offset scale-factor group)

Ring layout where each copy is rotated by its position (clock-rotate style).

Ring layout where each copy is rotated by its position (clock-rotate style).
sourceraw docstring

rowsclj/s

(rows row-groups)

Lay out a nested vector of rows, left-to-right and top-to-bottom. Short rows are padded with empty patterns to match the longest row.

Lay out a nested vector of rows, left-to-right and top-to-bottom.
Short rows are padded with empty patterns to match the longest row.
sourceraw docstring

scale-group-streamclj/s

(scale-group-stream n groups)
source

sshape-as-layoutclj/s

(sshape-as-layout sshape group-stream scalar)
source

sshape-to-positionsclj/s

(sshape-to-positions {:keys [style points] :as sshape})
source

stackclj/s

(stack & groups)

superimpose a number of groups

superimpose a number of groups
sourceraw docstring

superimpose-layoutclj/s

(superimpose-layout group1 group2)

simplest layout, two groups located on top of each other

simplest layout, two groups located on top of each other 
sourceraw docstring

v-mirrorclj/s

(v-mirror group)

Reflect vertically and stretch

Reflect vertically and stretch
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close