Skip to content

Projects and Export

Mingxuan Liu edited this page Nov 4, 2026 · 1 revision

Use a named local save to return to your work. To give someone an editable copy, download the project as JSON. For a class that only needs to play the presentation, you can package a portable player.

Save and reopen a project

  1. Open Project in the editing workspace. Move the physical-time slider to the moment you want the project to reopen at.
  2. Enter a Local save name, such as double-transit, and choose Save locally. Use a new name when you want a separate version. The astronomy app stores its named saves in .local/exoplanet-projects/ in your checkout.
  3. To open a save, choose its name under Saved projects and click Open selected. Use Refresh list if another window saved a newer version. Opening or importing starts a new Undo history, so save any current edits you want to keep.

To launch the astronomy app directly into that named project next time, run this from the Cosmic Lego repository root.

bash scripts/node.sh apps/exoplanet.mjs --open double-transit

Share an editable copy

Choose Project → Download JSON and send the downloaded file. The recipient opens a compatible installation of Cosmic Lego and chooses Project → Import JSON…. After importing, they can choose a name and Save locally. The file includes the accepted construction, model requirements, and the information needed to reconstruct the study at the saved time.

Local saves and downloads have separate Include public conversation checkboxes. Both start unchecked when you open a project. If you want to share a conversation along with a lesson, select the download checkbox explicitly.

Package a player for class

A player packages the saved study and its playback dependencies together. The recipient needs Node.js 20 or later and a WebGL2-capable browser. They can run the player locally without an agent connection.

For these examples, place your downloaded project at lesson.json in the repository root. Use a new directory name for each export.

bash scripts/node.sh apps/exoplanet.mjs package lesson.json lesson-player

Copy the entire lesson-player directory to the other computer and follow the command in its included README. Open the printed local address. The player supports scrubbing and exact-time seeks through the saved presentation.

Export frames for slides or video

The frame exporter needs a compatible Playwright and Chromium installation with WebGL2. If Playwright and the browser are installed outside the repository, set COSMIC_LEGO_PLAYWRIGHT to the absolute path of Playwright’s entry file and COSMIC_LEGO_CHROME to the browser executable.

For the transit example, the following command exports the conjunction hold at presentation seconds 3, 4, and 5.

bash scripts/node.sh apps/exoplanet.mjs export lesson.json lesson-frames \
  --start 3 --end 5 --fps 1 --width 1280 --height 720

The numbered PNGs are in lesson-frames/frames/. Each has a matching JSON file that records, among other things, the presentation time, physical time, and scientific values. Check progress.json for complete before using the full sequence. If the run stops early, it records the number of finished frames. Use a fresh output directory to retry.

Try the transit study · Getting started

Clone this wiki locally