Sketching & Iteration

The REPL Loop

Eido's primary workflow is REPL-driven: edit a scene, evaluate it, see the result, adjust. No compile step, no build tool, no save-and-refresh cycle.

(require '[eido.core :as eido])

;; Define a scene
(def scene
  {:image/size [400 400]
   :image/background [:color/name "linen"]
   :image/nodes
   [{:node/type     :shape/circle
     :circle/center [200 200]
     :circle/radius 120
     :style/fill    [:color/name "crimson"]}]})

;; Render and display in the REPL
(eido/show scene)
Rendered output

Change the radius, re-evaluate, see the result instantly. This tight loop is how most Eido work happens.

Watch Workflows

For continuous feedback, watch a scene atom or a file. Every change triggers a re-render in a preview window:

;; Watch an atom — updates on every swap!/reset!
(def my-scene (atom scene))
(eido/watch-scene my-scene)

;; Now just change the atom:
(swap! my-scene assoc-in [:image/nodes 0 :circle/radius] 80)
;; Preview updates automatically

;; Or watch an EDN file — updates on every save
(eido/watch-file "sketch.edn")

The first render validates the scene; subsequent re-renders skip validation for speed.

Exploring Seeds

seed-grid renders a grid of variations from different seeds — a visual overview of what your algorithm produces:

(require '[eido.gen.series :as series])

(series/seed-grid
  {:spec      {:hue {:type :uniform :lo 0.0 :hi 360.0}
               :density {:type :gaussian :mean 20.0 :sd 5.0}}
   :master-seed 42
   :scene-fn  (fn [params _edition]
                (make-scene params))
   :cols 5 :rows 3
   :thumb-size [160 160]})

Each cell is a different edition with different sampled parameters. Spot interesting ones, note the edition number, and explore further.

Parameter Sweeps

param-grid isolates a single parameter, rendering a sweep across a range of values:

(series/param-grid
  {:scene-fn    (fn [v] (make-scene {:density v}))
   :param-name  "density"
   :values      (range 5 50 5)
   :thumb-size  [120 120]})

This makes design decisions concrete — you can see exactly where a parameter transitions from "too sparse" to "just right" to "too dense."

Capturing Interesting Seeds

When you find a combination you like, use save-seed! to bookmark it:

(require '[eido.gen.series :as series])

;; Bookmark a discovery
(series/save-seed! "keepers.edn"
  {:seed 4217 :params params :note "nice organic density"})

;; Later, load all bookmarks
(series/load-seeds "keepers.edn")
;=> [{:seed 4217 :params {...} :note "nice organic density"
;     :timestamp "2026-04-10T..."}]

Each entry is timestamped automatically. The file accumulates entries — one per save-seed! call.

For maximum reliability, save the scene map directly — it's a complete, self-contained description that can be re-rendered anytime:

(spit "keeper-4217.edn" (pr-str scene))