worldorbit 3.2.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +543 -543
  2. package/dist/browser/core/dist/atlas-edit.js +146 -1
  3. package/dist/browser/core/dist/atlas-validate.js +105 -10
  4. package/dist/browser/core/dist/draft-parse.js +461 -17
  5. package/dist/browser/core/dist/draft.d.ts +2 -1
  6. package/dist/browser/core/dist/draft.js +26 -4
  7. package/dist/browser/core/dist/format.js +126 -5
  8. package/dist/browser/core/dist/index.d.ts +1 -0
  9. package/dist/browser/core/dist/index.js +1 -0
  10. package/dist/browser/core/dist/load.js +12 -2
  11. package/dist/browser/core/dist/normalize.js +1 -0
  12. package/dist/browser/core/dist/scene.js +226 -5
  13. package/dist/browser/core/dist/schema.js +11 -1
  14. package/dist/browser/core/dist/solver.d.ts +33 -0
  15. package/dist/browser/core/dist/solver.js +99 -0
  16. package/dist/browser/core/dist/spatial-scene.js +56 -0
  17. package/dist/browser/core/dist/types.d.ts +130 -4
  18. package/dist/browser/editor/dist/editor.js +844 -719
  19. package/dist/browser/editor/dist/types.d.ts +2 -1
  20. package/dist/browser/viewer/dist/minimap.js +9 -7
  21. package/dist/browser/viewer/dist/render.js +78 -18
  22. package/dist/browser/viewer/dist/runtime-3d.js +2 -0
  23. package/dist/browser/viewer/dist/theme.js +1 -0
  24. package/dist/browser/viewer/dist/types.d.ts +7 -0
  25. package/dist/browser/viewer/dist/viewer.js +34 -3
  26. package/dist/obsidian-plugin/README.md +141 -124
  27. package/dist/obsidian-plugin/main.js +82 -68
  28. package/dist/unpkg/core/dist/atlas-edit.js +146 -1
  29. package/dist/unpkg/core/dist/atlas-validate.js +105 -10
  30. package/dist/unpkg/core/dist/draft-parse.js +461 -17
  31. package/dist/unpkg/core/dist/draft.d.ts +2 -1
  32. package/dist/unpkg/core/dist/draft.js +26 -4
  33. package/dist/unpkg/core/dist/format.js +126 -5
  34. package/dist/unpkg/core/dist/index.d.ts +1 -0
  35. package/dist/unpkg/core/dist/index.js +1 -0
  36. package/dist/unpkg/core/dist/load.js +12 -2
  37. package/dist/unpkg/core/dist/normalize.js +1 -0
  38. package/dist/unpkg/core/dist/scene.js +226 -5
  39. package/dist/unpkg/core/dist/schema.js +11 -1
  40. package/dist/unpkg/core/dist/solver.d.ts +33 -0
  41. package/dist/unpkg/core/dist/solver.js +99 -0
  42. package/dist/unpkg/core/dist/spatial-scene.js +56 -0
  43. package/dist/unpkg/core/dist/types.d.ts +130 -4
  44. package/dist/unpkg/editor/dist/editor.js +844 -719
  45. package/dist/unpkg/editor/dist/types.d.ts +2 -1
  46. package/dist/unpkg/viewer/dist/minimap.js +9 -7
  47. package/dist/unpkg/viewer/dist/render.js +78 -18
  48. package/dist/unpkg/viewer/dist/runtime-3d.js +2 -0
  49. package/dist/unpkg/viewer/dist/theme.js +1 -0
  50. package/dist/unpkg/viewer/dist/types.d.ts +7 -0
  51. package/dist/unpkg/viewer/dist/viewer.js +34 -3
  52. package/dist/unpkg/worldorbit-core.min.js +12 -12
  53. package/dist/unpkg/worldorbit-editor.min.js +381 -340
  54. package/dist/unpkg/worldorbit-markdown.min.js +47 -33
  55. package/dist/unpkg/worldorbit-viewer.min.js +238 -224
  56. package/dist/unpkg/worldorbit.js +1218 -46
  57. package/dist/unpkg/worldorbit.min.js +242 -228
  58. package/package.json +5 -1
  59. package/packages/core/dist/atlas-edit.js +146 -1
  60. package/packages/core/dist/atlas-validate.js +105 -10
  61. package/packages/core/dist/draft-parse.js +461 -17
  62. package/packages/core/dist/draft.d.ts +2 -1
  63. package/packages/core/dist/draft.js +26 -4
  64. package/packages/core/dist/format.js +126 -5
  65. package/packages/core/dist/index.d.ts +1 -0
  66. package/packages/core/dist/index.js +1 -0
  67. package/packages/core/dist/load.js +12 -2
  68. package/packages/core/dist/normalize.js +1 -0
  69. package/packages/core/dist/scene.js +226 -5
  70. package/packages/core/dist/schema.js +11 -1
  71. package/packages/core/dist/solver.d.ts +33 -0
  72. package/packages/core/dist/solver.js +99 -0
  73. package/packages/core/dist/spatial-scene.js +56 -0
  74. package/packages/core/dist/types.d.ts +130 -4
  75. package/packages/editor/dist/editor.js +844 -719
  76. package/packages/editor/dist/types.d.ts +2 -1
  77. package/packages/viewer/dist/minimap.js +9 -7
  78. package/packages/viewer/dist/render.js +78 -18
  79. package/packages/viewer/dist/runtime-3d.js +2 -0
  80. package/packages/viewer/dist/theme.js +1 -0
  81. package/packages/viewer/dist/types.d.ts +7 -0
  82. package/packages/viewer/dist/viewer.js +34 -3
package/README.md CHANGED
@@ -1,545 +1,545 @@
1
- # WorldOrbit
2
-
3
- WorldOrbit is a text-first DSL, viewer, and optional editor platform for fictional orbital systems.
4
-
5
- It is designed as a specialized Mermaid-like alternative for worldbuilding: you can describe stellar systems in plain text, embed them in Markdown, render them as static diagrams, or explore them interactively with pan, rotate, zoom, and object tooltips.
6
-
7
- WorldOrbit is built for:
8
-
9
- - worldbuilding projects
10
- - Markdown-based lore repositories and CMS setups
11
- - fictional atlases and codices
12
- - interactive setting documentation
13
- - browser-based orbital diagram tooling
14
-
15
- ## Why WorldOrbit?
16
-
17
- Generic diagram tools can show relationships, but they are not built for fictional orbital systems.
18
-
19
- WorldOrbit is designed specifically for:
20
-
21
- - stars, planets, moons, belts, structures, and phenomena
22
- - orbit-aware layouts instead of generic node graphs
23
- - Markdown-native embedding
24
- - optional interactivity
25
- - optional visual authoring through Studio
26
-
27
- WorldOrbit is not intended to be a real-world astronomy simulator or a high-precision astrophysics engine. Its goal is clear, expressive orbital worldbuilding that works well in content workflows.
28
-
29
- ## Quick Example
30
-
31
- ```worldorbit
32
- schema 2.5
33
-
34
- system Iyath
35
- title "Iyath System"
36
- epoch "JY-0001.0"
37
- referencePlane ecliptic
38
-
39
- defaults
40
- view orthographic
41
- scale presentation
42
- preset atlas-card
43
- theme atlas
44
-
45
- group inner-system
46
- label "Inner System"
47
- color #d9b37a
48
-
49
- viewpoint eclipse
50
- label "Eclipse View"
51
- projection perspective
52
- camera
53
- azimuth 36
54
- elevation 22
55
- distance 6
56
- layers background guides orbits-back events objects labels metadata
57
- events naar-eclipse
58
-
59
- object star Iyath
60
-
61
- object planet Naar
62
- orbit Iyath
63
- semiMajor 1.18au
64
- eccentricity 0.08
65
- angle 28deg
66
- inclination 24deg
67
- phase 42deg
68
- atmosphere nitrogen-oxygen
69
- groups inner-system
70
-
71
- object moon Seyra
72
- orbit Naar
73
- distance 384400km
74
-
75
- event naar-eclipse
76
- kind solar-eclipse
77
- target Naar
78
- participants Iyath Naar Seyra
79
- ````
80
-
81
- ## Installation
82
-
83
- ### npm
84
-
85
- ```bash
86
- npm install worldorbit
87
- ```
88
-
89
- ### What the `worldorbit` package contains
90
-
91
- The published `worldorbit` package is the public entry point.
92
-
93
- It includes:
94
-
95
- * the browser bundles
96
- * subpath exports for core modules
97
- * the packages used by the viewer, Markdown integration, and editor tooling
98
-
99
- So for most users, this is enough:
100
-
101
- ```bash
102
- npm install worldorbit
103
- ```
104
-
105
- And then:
106
-
107
- ```ts
108
- import { parse, loadWorldOrbitSource } from "worldorbit";
109
- import * as Viewer from "worldorbit/viewer";
110
- ```
111
-
112
- ## Browser / CDN Quick Setup
113
-
114
- For direct browser usage, use the browser bundle:
115
-
116
- ```html
117
- <!DOCTYPE html>
118
- <html>
119
- <head>
120
- <meta charset="utf-8" />
121
- <style>
122
- html, body {
123
- margin: 0;
124
- width: 100%;
125
- height: 100%;
126
- }
127
-
128
- #view {
129
- width: 100vw;
130
- height: 100vh;
131
- }
132
- </style>
133
- </head>
134
- <body>
135
- <div id="view"></div>
136
-
137
- <script type="module">
138
- import {
139
- createInteractiveViewer,
140
- loadWorldOrbitSource
141
- } from "https://unpkg.com/worldorbit@3.0.7/dist/unpkg/worldorbit.esm.js";
142
-
143
- const source = `
144
- schema 2.5
145
-
146
- system Iyath
147
- epoch "JY-0001.0"
148
-
149
- object star Iyath
150
- object planet Naar
151
- orbit Iyath
152
- semiMajor 1.18au
153
- `.trim();
154
-
155
- const loaded = loadWorldOrbitSource(source);
156
-
157
- createInteractiveViewer(document.getElementById("view"), {
158
- document: loaded.document
159
- });
160
- </script>
161
- </body>
162
- </html>
163
- ```
164
-
165
- For browser usage today, prefer the ESM entry point `worldorbit.esm.js`.
166
-
167
- ## Static and Interactive Rendering
168
-
169
- WorldOrbit can be used in different ways from the same source:
170
-
171
- * as a static diagram
172
- * as an interactive SVG viewer
173
- * inside Markdown pipelines
174
- * inside the optional Studio editor
175
-
176
- This means the same WorldOrbit document can be:
177
-
178
- * written in plain text
179
- * embedded in Markdown
180
- * rendered in a documentation page
181
- * explored interactively
182
- * edited visually if needed
183
-
184
- ## Studio Editor
185
-
186
- WorldOrbit includes an optional Studio editor for easier authoring and exploration.
187
-
188
- Studio is useful when you want:
189
-
190
- * visual placement editing
191
- * source and preview side by side
192
- * inspector-based editing
193
- * faster onboarding for non-technical users
194
-
195
- The editor is optional. The core format remains text-first.
196
-
197
- ## Canonical Schema
198
-
1
+ # WorldOrbit
2
+
3
+ WorldOrbit is a text-first DSL, viewer, and optional editor platform for fictional orbital systems.
4
+
5
+ It is designed as a specialized Mermaid-like alternative for worldbuilding: you can describe stellar systems in plain text, embed them in Markdown, render them as static diagrams, or explore them interactively with pan, rotate, zoom, and object tooltips.
6
+
7
+ WorldOrbit is built for:
8
+
9
+ - worldbuilding projects
10
+ - Markdown-based lore repositories and CMS setups
11
+ - fictional atlases and codices
12
+ - interactive setting documentation
13
+ - browser-based orbital diagram tooling
14
+
15
+ ## Why WorldOrbit?
16
+
17
+ Generic diagram tools can show relationships, but they are not built for fictional orbital systems.
18
+
19
+ WorldOrbit is designed specifically for:
20
+
21
+ - stars, planets, moons, belts, structures, and phenomena
22
+ - orbit-aware layouts instead of generic node graphs
23
+ - Markdown-native embedding
24
+ - optional interactivity
25
+ - optional visual authoring through Studio
26
+
27
+ WorldOrbit is not intended to be a real-world astronomy simulator or a high-precision astrophysics engine. Its goal is clear, expressive orbital worldbuilding that works well in content workflows.
28
+
29
+ ## Quick Example
30
+
31
+ ```worldorbit
32
+ schema 3.1
33
+
34
+ system Iyath
35
+ title "Iyath System"
36
+ epoch "JY-0001.0"
37
+ referencePlane ecliptic
38
+
39
+ defaults
40
+ view orthographic
41
+ scale presentation
42
+ preset atlas-card
43
+ theme atlas
44
+
45
+ group inner-system
46
+ label "Inner System"
47
+ color #d9b37a
48
+
49
+ viewpoint eclipse
50
+ label "Eclipse View"
51
+ projection perspective
52
+ camera
53
+ azimuth 36
54
+ elevation 22
55
+ distance 6
56
+ layers background guides orbits-back events objects labels metadata
57
+ events naar-eclipse
58
+
59
+ object star Iyath
60
+
61
+ object planet Naar
62
+ orbit Iyath
63
+ semiMajor 1.18au
64
+ eccentricity 0.08
65
+ angle 28deg
66
+ inclination 24deg
67
+ phase 42deg
68
+ atmosphere nitrogen-oxygen
69
+ groups inner-system
70
+
71
+ object moon Seyra
72
+ orbit Naar
73
+ distance 384400km
74
+
75
+ event naar-eclipse
76
+ kind solar-eclipse
77
+ target Naar
78
+ participants Iyath Naar Seyra
79
+ ````
80
+
81
+ ## Installation
82
+
83
+ ### npm
84
+
85
+ ```bash
86
+ npm install worldorbit
87
+ ```
88
+
89
+ ### What the `worldorbit` package contains
90
+
91
+ The published `worldorbit` package is the public entry point.
92
+
93
+ It includes:
94
+
95
+ * the browser bundles
96
+ * subpath exports for core modules
97
+ * the packages used by the viewer, Markdown integration, and editor tooling
98
+
99
+ So for most users, this is enough:
100
+
101
+ ```bash
102
+ npm install worldorbit
103
+ ```
104
+
105
+ And then:
106
+
107
+ ```ts
108
+ import { parse, loadWorldOrbitSource } from "worldorbit";
109
+ import * as Viewer from "worldorbit/viewer";
110
+ ```
111
+
112
+ ## Browser / CDN Quick Setup
113
+
114
+ For direct browser usage, use the browser bundle:
115
+
116
+ ```html
117
+ <!DOCTYPE html>
118
+ <html>
119
+ <head>
120
+ <meta charset="utf-8" />
121
+ <style>
122
+ html, body {
123
+ margin: 0;
124
+ width: 100%;
125
+ height: 100%;
126
+ }
127
+
128
+ #view {
129
+ width: 100vw;
130
+ height: 100vh;
131
+ }
132
+ </style>
133
+ </head>
134
+ <body>
135
+ <div id="view"></div>
136
+
137
+ <script type="module">
138
+ import {
139
+ createInteractiveViewer,
140
+ loadWorldOrbitSource
141
+ } from "https://unpkg.com/worldorbit@5.0.0/dist/unpkg/worldorbit.esm.js";
142
+
143
+ const source = `
144
+ schema 3.1
145
+
146
+ system Iyath
147
+ epoch "JY-0001.0"
148
+
149
+ object star Iyath
150
+ object planet Naar
151
+ orbit Iyath
152
+ semiMajor 1.18au
153
+ `.trim();
154
+
155
+ const loaded = loadWorldOrbitSource(source);
156
+
157
+ createInteractiveViewer(document.getElementById("view"), {
158
+ document: loaded.document
159
+ });
160
+ </script>
161
+ </body>
162
+ </html>
163
+ ```
164
+
165
+ For browser usage today, prefer the ESM entry point `worldorbit.esm.js`.
166
+
167
+ ## Static and Interactive Rendering
168
+
169
+ WorldOrbit can be used in different ways from the same source:
170
+
171
+ * as a static diagram
172
+ * as an interactive SVG viewer
173
+ * inside Markdown pipelines
174
+ * inside the optional Studio editor
175
+
176
+ This means the same WorldOrbit document can be:
177
+
178
+ * written in plain text
179
+ * embedded in Markdown
180
+ * rendered in a documentation page
181
+ * explored interactively
182
+ * edited visually if needed
183
+
184
+ ## Studio Editor
185
+
186
+ WorldOrbit includes an optional Studio editor for easier authoring and exploration.
187
+
188
+ Studio is useful when you want:
189
+
190
+ * visual placement editing
191
+ * source and preview side by side
192
+ * inspector-based editing
193
+ * faster onboarding for non-technical users
194
+
195
+ The editor is optional. The core format remains text-first.
196
+
197
+ ## Canonical Schema
198
+
199
199
  New atlas authoring should start with:
200
-
201
- ```worldorbit
202
- schema 2.5
203
- ```
204
-
205
- Example:
206
-
207
- ```worldorbit
208
- schema 2.5
209
-
210
- system Iyath
211
- title "Iyath System"
212
- epoch "JY-0001.0"
213
- referencePlane ecliptic
214
-
215
- defaults
216
- view orthographic
217
- scale presentation
218
- preset atlas-card
219
- theme atlas
220
-
221
- group inner-system
222
- label "Inner System"
223
- summary "Naar and its inhabited infrastructure"
224
- color #d9b37a
225
-
226
- viewpoint overview
227
- label "Atlas Overview"
228
- summary "Fit the whole system."
229
- projection orthographic
230
- camera
231
- azimuth 24
232
- elevation 18
233
- layers background guides orbits-back events objects labels metadata
234
- events naar-eclipse
235
- filter
236
- groups inner-system
237
-
238
- annotation naar-notes
239
- label "Naar Notes"
240
- target Naar
241
- body "Heimatwelt der Enari."
242
-
243
- object star Iyath
244
- mass 1.02sol
245
-
246
- object planet Naar
247
- orbit Iyath
248
- semiMajor 1.18au
249
- eccentricity 0.08
250
- angle 28deg
251
- inclination 24deg
252
- phase 42deg
253
- groups inner-system
254
- image /demo/assets/naar-map.png
255
- atmosphere nitrogen-oxygen
256
-
257
- object moon Seyra
258
- orbit Naar
259
- distance 384400km
260
- groups inner-system
261
-
262
- event naar-eclipse
263
- kind solar-eclipse
264
- label "Naar Eclipse"
265
- target Naar
266
- participants Iyath Naar Seyra
267
- epoch "JY-0001.0"
268
- referencePlane ecliptic
269
-
270
- positions
271
- pose Naar
272
- orbit Iyath
273
- semiMajor 1.18au
274
- phase 90deg
275
-
276
- pose Seyra
277
- orbit Naar
278
- distance 384400km
279
- phase 90deg
280
- ```
281
-
282
- ## What's New In Schema 2.5
283
-
284
- Schema `2.5` keeps Schema `2.1` fully readable and adds a clearer 3D-ready authoring surface without turning WorldOrbit into a full 3D engine.
285
-
200
+
201
+ ```worldorbit
202
+ schema 3.1
203
+ ```
204
+
205
+ Example:
206
+
207
+ ```worldorbit
208
+ schema 3.0
209
+
210
+ system Iyath
211
+ title "Iyath System"
212
+ epoch "JY-0001.0"
213
+ referencePlane ecliptic
214
+
215
+ defaults
216
+ view orthographic
217
+ scale presentation
218
+ preset atlas-card
219
+ theme atlas
220
+
221
+ group inner-system
222
+ label "Inner System"
223
+ summary "Naar and its inhabited infrastructure"
224
+ color #d9b37a
225
+
226
+ viewpoint overview
227
+ label "Atlas Overview"
228
+ summary "Fit the whole system."
229
+ projection orthographic
230
+ camera
231
+ azimuth 24
232
+ elevation 18
233
+ layers background guides orbits-back events objects labels metadata
234
+ events naar-eclipse
235
+ filter
236
+ groups inner-system
237
+
238
+ annotation naar-notes
239
+ label "Naar Notes"
240
+ target Naar
241
+ body "Heimatwelt der Enari."
242
+
243
+ object star Iyath
244
+ mass 1.02sol
245
+
246
+ object planet Naar
247
+ orbit Iyath
248
+ semiMajor 1.18au
249
+ eccentricity 0.08
250
+ angle 28deg
251
+ inclination 24deg
252
+ phase 42deg
253
+ groups inner-system
254
+ image /demo/assets/naar-map.png
255
+ atmosphere nitrogen-oxygen
256
+
257
+ object moon Seyra
258
+ orbit Naar
259
+ distance 384400km
260
+ groups inner-system
261
+
262
+ event naar-eclipse
263
+ kind solar-eclipse
264
+ label "Naar Eclipse"
265
+ target Naar
266
+ participants Iyath Naar Seyra
267
+ epoch "JY-0001.0"
268
+ referencePlane ecliptic
269
+
270
+ positions
271
+ pose Naar
272
+ orbit Iyath
273
+ semiMajor 1.18au
274
+ phase 90deg
275
+
276
+ pose Seyra
277
+ orbit Naar
278
+ distance 384400km
279
+ phase 90deg
280
+ ```
281
+
282
+ ## What's New In Schema 3.1
283
+
284
+ Schema `3.1` keeps Schema `3.0` and Schema `2.6` fully readable and expands WorldOrbit from declarative mission authoring into visible mission-curve rendering.
285
+
286
286
  It adds:
287
-
288
- * new viewpoint projections: `orthographic` and `perspective`
289
- * a Schema-level `camera` block with `azimuth`, `elevation`, optional `roll`, and optional `distance`
290
- * clearer inheritance for `epoch` and `referencePlane` across system, object, event, and pose contexts
291
- * more stable event snapshots, where missing pose fields fall back to object, event, and system context instead of implying empty values
292
- * stronger validation around viewpoints, camera fields, event/pose consistency, and ambiguous authoring combinations
293
-
294
- Schema `2.5` still does **not** add full 3D coordinates, meshes, materials, quaternions, lighting, or simulation-heavy orbital solving.
295
-
296
- Schema `2.1` already added comments, semantic `group` and `relation` sections, declarative `event` sections with per-event `positions`/`pose` snapshots, viewpoint-linked `events`, object-level `epoch` and `referencePlane`, declarative resonance and validation hints, and optional structured lore blocks such as `climate`, `habitability`, and `settlement`.
297
-
298
- Stable `1.0` source is still accepted. Canonical `schema 2.0` source remains fully supported, and legacy `schema 2.0-draft` files stay readable as a compatibility path with a deprecation diagnostic.
299
-
300
- ## Basic Usage
301
-
302
- ### Parse and load source
303
-
304
- ```ts
305
- import {
306
- loadWorldOrbitSource,
307
- parse,
308
- } from "worldorbit";
309
-
310
- const parsed = parse(`
311
- system Iyath
312
- star Iyath
313
- planet Naar orbit Iyath distance 1.18au
314
- `.trim());
315
-
316
- const loaded = loadWorldOrbitSource(`
317
- schema 2.5
318
-
319
- system Iyath
320
- object star Iyath
321
- object planet Naar
322
- orbit Iyath
323
- semiMajor 1.18au
324
- `.trim());
325
- ```
326
-
327
- ### Render a scene
328
-
329
- ```ts
330
- import {
331
- loadWorldOrbitSource,
332
- renderDocumentToScene,
333
- } from "worldorbit";
334
-
335
- const loaded = loadWorldOrbitSource(source);
336
-
337
- const scene = renderDocumentToScene(loaded.document, {
338
- projection: "isometric",
339
- scaleModel: {
340
- orbitDistanceMultiplier: 1.1,
341
- bodyRadiusMultiplier: 1.15,
342
- },
343
- });
344
- ```
345
-
346
- ### Create an interactive viewer
347
-
348
- ```ts
349
- import { loadWorldOrbitSource } from "worldorbit";
350
- import { createInteractiveViewer } from "worldorbit/viewer";
351
-
352
- const loaded = loadWorldOrbitSource(source);
353
-
354
- createInteractiveViewer(document.getElementById("preview"), {
355
- document: loaded.document,
356
- projection: "isometric",
357
- theme: "atlas",
358
- viewMode: "3d",
359
- });
360
- ```
361
-
362
- ## Package Overview
363
-
364
- WorldOrbit is organized internally as a small ecosystem.
365
-
366
- ### `worldorbit`
367
-
368
- Public package entry point with browser bundles and main exports.
369
-
370
- ### `worldorbit/core`
371
-
372
- Use this when you need:
373
-
374
- * parsing
375
- * normalization
376
- * validation
377
- * diagnostics
378
- * schema loading
379
- * canonical formatting
380
- * scene generation
381
-
382
- ### `worldorbit/viewer`
383
-
384
- Use this when you need:
385
-
386
- * static SVG rendering
387
- * interactive viewing
388
- * atlas-style exploration
389
- * themes and embeds
390
-
391
- ### `worldorbit/markdown`
392
-
393
- Use this when you want to transform fenced `worldorbit` blocks inside Markdown pipelines.
394
-
395
- ### `worldorbit/editor`
396
-
397
- Use this when you want browser-based visual authoring on top of the text format.
398
-
399
- ## Core Example
400
-
401
- ```ts
402
- import {
403
- formatDocument,
404
- loadWorldOrbitSource,
405
- parse,
406
- parseWorldOrbitAtlas,
407
- renderDocumentToScene,
408
- upgradeDocumentToV2,
409
- } from "worldorbit/core";
410
-
411
- const stable = parse(`
412
- system Iyath
413
- star Iyath
414
- planet Naar orbit Iyath distance 1.18au
415
- `.trim());
416
-
417
- const atlasDocument = upgradeDocumentToV2(stable.document, {
418
- preset: "atlas-card",
419
- });
420
-
421
- const atlasSource = formatDocument(atlasDocument, { schema: "2.5" });
422
- const loaded = loadWorldOrbitSource(atlasSource);
423
- const parsedAtlas = parseWorldOrbitAtlas(atlasSource);
424
- const scene = renderDocumentToScene(loaded.document, {
425
- projection: "isometric",
426
- scaleModel: {
427
- orbitDistanceMultiplier: 1.1,
428
- bodyRadiusMultiplier: 1.15,
429
- },
430
- });
431
- ```
432
-
433
- ## Viewer Capabilities
434
-
435
- Viewer features in `v3.0.7` include:
436
-
437
- * scene-based SVG rendering
438
- * renderer-neutral spatial scenes through `renderDocumentToSpatialScene(...)`
439
- * a full 3D viewer mode on the same documents and placements as 2D
440
- * deterministic orbit animation with play, pause, reset, and speed controls
441
- * projections: `topdown`, `isometric`, `orthographic`, and `perspective`
442
- * theme presets: `atlas`, `nightglass`, `ember`
443
- * layer controls for background, guides, orbits, events, objects, labels, metadata, and relations
444
- * selection, hover, focus, fit, pan, zoom, and rotate
445
- * tooltip cards and object detail payloads
446
- * viewpoints, filters, search, and bookmark capture
447
- * deep-linkable atlas state
448
- * embeddable viewer custom elements
449
- * semantic group filters, relation and event overlays, active event scenes, Schema 2.5 camera metadata, and event/object reference-context detail metadata
450
-
451
- ## Markdown Integration
452
-
453
- Use `worldorbit/markdown` to transform fenced `worldorbit` blocks into static output, interactive 2D output, or interactive 3D output.
454
-
455
- ```ts
456
- import rehypeStringify from "rehype-stringify";
457
- import remarkParse from "remark-parse";
458
- import remarkRehype from "remark-rehype";
459
- import { unified } from "unified";
460
-
461
- import { remarkWorldOrbit } from "worldorbit/markdown";
462
-
463
- const html = String(
464
- await unified()
465
- .use(remarkParse)
466
- .use(remarkWorldOrbit, { mode: "interactive-3d" })
467
- .use(remarkRehype, { allowDangerousHtml: true })
468
- .use(rehypeStringify, { allowDangerousHtml: true })
469
- .process(markdownSource),
470
- );
471
- ```
472
-
473
- In the browser:
474
-
475
- ```ts
476
- import { mountWorldOrbitEmbeds } from "worldorbit/viewer";
477
-
478
- mountWorldOrbitEmbeds(document, {
479
- mode: "interactive-3d",
480
- });
481
- ```
482
-
483
- ## Examples
484
-
485
- Examples live in:
486
-
487
- * [examples/minimal.worldorbit](./examples/minimal.worldorbit)
488
- * [examples/minimal-3d.worldorbit](./examples/minimal-3d.worldorbit)
489
- * [examples/showcase-3d.worldorbit](./examples/showcase-3d.worldorbit)
490
- * [examples/schema25-camera.worldorbit](./examples/schema25-camera.worldorbit)
491
- * [examples/schema25-event-snapshot.worldorbit](./examples/schema25-event-snapshot.worldorbit)
492
- * [examples/studio.schema25.worldorbit](./examples/studio.schema25.worldorbit)
493
- * [examples/iyath.worldorbit](./examples/iyath.worldorbit)
494
- * [examples/iyath.schema2.worldorbit](./examples/iyath.schema2.worldorbit)
495
- * [examples/iyath.schema21.worldorbit](./examples/iyath.schema21.worldorbit)
496
- * [examples/iyath.schema2-draft.worldorbit](./examples/iyath.schema2-draft.worldorbit)
497
- * [examples/markdown/static.md](./examples/markdown/static.md)
498
- * [examples/markdown/interactive.md](./examples/markdown/interactive.md)
499
- * [examples/markdown/build.mjs](./examples/markdown/build.mjs)
500
-
501
- Browser-facing examples and demos live in the repository under `demo/`, `studio/`, and `examples/`.
502
-
503
- ## Documentation
504
-
505
- * [migration guide: v0.8 to v1.0](./docs/migration-v0.8-to-v1.0.md)
506
- * [migration guide: v1 to v2](./docs/migration-v1-to-v2.md)
507
- * [migration guide: v2.0 to v2.1](./docs/migration-v2-to-v2.1.md)
508
- * [migration guide: v2.1 to v2.5](./docs/migration-v2.1-to-v2.5.md)
509
- * [migration guide: v2.6 to v3.0](./docs/migration-v2.6-to-v3.0.md)
510
- * [language reference](./docs/language-reference.md)
511
- * [language reference (DE)](./docs/language-reference.de.md)
512
- * [API inventory](./docs/api-inventory.md)
513
- * [changelog](./docs/changelog.md)
514
-
515
- ## Development
516
-
517
- ```bash
518
- npm install
519
- npm run build
520
- npm test
521
- ```
522
-
523
- The workspace builds outputs into package-specific distribution folders and browser bundles.
524
-
525
- Useful notes:
526
-
527
- * `npm run build` compiles all packages and refreshes local package shims
528
- * `npm test` rebuilds first, then runs the regression suite
529
- * the repository remains parser-first: rendering and atlas interaction stay downstream of parse, normalize, and validate
530
-
531
- ## Project Direction
532
-
533
- WorldOrbit is intended as a specialized Mermaid-like solution for fictional orbital systems.
534
-
535
- The long-term focus is:
536
-
537
- * strong text-first authoring
538
- * clean Markdown embedding
539
- * rich static and interactive rendering
540
- * optional visual editing
541
- * stable schema evolution over time
542
-
543
- ## License
544
-
545
- MIT
287
+
288
+ * visible `trajectory` rendering in 2D and 3D scenes
289
+ * official `illustrative`, `solver`, and `auto` trajectory render modes
290
+ * trajectory waypoint labels, dates, marker controls, and per-segment render hints
291
+ * official trajectory sampling APIs through `worldorbit/core/solver`
292
+ * continued support for declarative `craft`, `trajectory`, `event`, and `pose` mission authoring
293
+
294
+ Schema `3.1` still does **not** add a built-in N-body simulator, NASA-grade ephemerides, continuous freeform XYZ authoring, or hard astrophysics requirements.
295
+
296
+ Schema `2.6` remains the direct compatibility base, and older documents continue to load through the same parser and normalization pipeline.
297
+
298
+ Stable `1.0` source is still accepted. Canonical `schema 2.0` source remains fully supported, and legacy `schema 2.0-draft` files stay readable as a compatibility path with a deprecation diagnostic.
299
+
300
+ ## Basic Usage
301
+
302
+ ### Parse and load source
303
+
304
+ ```ts
305
+ import {
306
+ loadWorldOrbitSource,
307
+ parse,
308
+ } from "worldorbit";
309
+
310
+ const parsed = parse(`
311
+ system Iyath
312
+ star Iyath
313
+ planet Naar orbit Iyath distance 1.18au
314
+ `.trim());
315
+
316
+ const loaded = loadWorldOrbitSource(`
317
+ schema 3.0
318
+
319
+ system Iyath
320
+ object star Iyath
321
+ object planet Naar
322
+ orbit Iyath
323
+ semiMajor 1.18au
324
+ `.trim());
325
+ ```
326
+
327
+ ### Render a scene
328
+
329
+ ```ts
330
+ import {
331
+ loadWorldOrbitSource,
332
+ renderDocumentToScene,
333
+ } from "worldorbit";
334
+
335
+ const loaded = loadWorldOrbitSource(source);
336
+
337
+ const scene = renderDocumentToScene(loaded.document, {
338
+ projection: "isometric",
339
+ scaleModel: {
340
+ orbitDistanceMultiplier: 1.1,
341
+ bodyRadiusMultiplier: 1.15,
342
+ },
343
+ });
344
+ ```
345
+
346
+ ### Create an interactive viewer
347
+
348
+ ```ts
349
+ import { loadWorldOrbitSource } from "worldorbit";
350
+ import { createInteractiveViewer } from "worldorbit/viewer";
351
+
352
+ const loaded = loadWorldOrbitSource(source);
353
+
354
+ createInteractiveViewer(document.getElementById("preview"), {
355
+ document: loaded.document,
356
+ projection: "isometric",
357
+ theme: "atlas",
358
+ viewMode: "3d",
359
+ });
360
+ ```
361
+
362
+ ## Package Overview
363
+
364
+ WorldOrbit is organized internally as a small ecosystem.
365
+
366
+ ### `worldorbit`
367
+
368
+ Public package entry point with browser bundles and main exports.
369
+
370
+ ### `worldorbit/core`
371
+
372
+ Use this when you need:
373
+
374
+ * parsing
375
+ * normalization
376
+ * validation
377
+ * diagnostics
378
+ * schema loading
379
+ * canonical formatting
380
+ * scene generation
381
+
382
+ ### `worldorbit/viewer`
383
+
384
+ Use this when you need:
385
+
386
+ * static SVG rendering
387
+ * interactive viewing
388
+ * atlas-style exploration
389
+ * themes and embeds
390
+
391
+ ### `worldorbit/markdown`
392
+
393
+ Use this when you want to transform fenced `worldorbit` blocks inside Markdown pipelines.
394
+
395
+ ### `worldorbit/editor`
396
+
397
+ Use this when you want browser-based visual authoring on top of the text format.
398
+
399
+ ## Core Example
400
+
401
+ ```ts
402
+ import {
403
+ formatDocument,
404
+ loadWorldOrbitSource,
405
+ parse,
406
+ parseWorldOrbitAtlas,
407
+ renderDocumentToScene,
408
+ upgradeDocumentToV2,
409
+ } from "worldorbit/core";
410
+
411
+ const stable = parse(`
412
+ system Iyath
413
+ star Iyath
414
+ planet Naar orbit Iyath distance 1.18au
415
+ `.trim());
416
+
417
+ const atlasDocument = upgradeDocumentToV2(stable.document, {
418
+ preset: "atlas-card",
419
+ });
420
+
421
+ const atlasSource = formatDocument(atlasDocument, { schema: "3.1" });
422
+ const loaded = loadWorldOrbitSource(atlasSource);
423
+ const parsedAtlas = parseWorldOrbitAtlas(atlasSource);
424
+ const scene = renderDocumentToScene(loaded.document, {
425
+ projection: "isometric",
426
+ scaleModel: {
427
+ orbitDistanceMultiplier: 1.1,
428
+ bodyRadiusMultiplier: 1.15,
429
+ },
430
+ });
431
+ ```
432
+
433
+ ## Viewer Capabilities
434
+
435
+ Viewer features in `v5.0.0` include:
436
+
437
+ * scene-based SVG rendering
438
+ * renderer-neutral spatial scenes through `renderDocumentToSpatialScene(...)`
439
+ * a full 3D viewer mode on the same documents and placements as 2D
440
+ * deterministic orbit animation with play, pause, reset, and speed controls
441
+ * projections: `topdown`, `isometric`, `orthographic`, and `perspective`
442
+ * theme presets: `atlas`, `nightglass`, `ember`
443
+ * layer controls for background, guides, orbits, events, objects, labels, metadata, and relations
444
+ * selection, hover, focus, fit, pan, zoom, and rotate
445
+ * tooltip cards and object detail payloads
446
+ * viewpoints, filters, search, and bookmark capture
447
+ * deep-linkable atlas state
448
+ * embeddable viewer custom elements
449
+ * semantic group filters, relation and event overlays, active event scenes, Schema 3.1 camera and trajectory metadata, visible mission curves, waypoint labels, and event/object reference-context detail metadata
450
+
451
+ ## Markdown Integration
452
+
453
+ Use `worldorbit/markdown` to transform fenced `worldorbit` blocks into static output, interactive 2D output, or interactive 3D output.
454
+
455
+ ```ts
456
+ import rehypeStringify from "rehype-stringify";
457
+ import remarkParse from "remark-parse";
458
+ import remarkRehype from "remark-rehype";
459
+ import { unified } from "unified";
460
+
461
+ import { remarkWorldOrbit } from "worldorbit/markdown";
462
+
463
+ const html = String(
464
+ await unified()
465
+ .use(remarkParse)
466
+ .use(remarkWorldOrbit, { mode: "interactive-3d" })
467
+ .use(remarkRehype, { allowDangerousHtml: true })
468
+ .use(rehypeStringify, { allowDangerousHtml: true })
469
+ .process(markdownSource),
470
+ );
471
+ ```
472
+
473
+ In the browser:
474
+
475
+ ```ts
476
+ import { mountWorldOrbitEmbeds } from "worldorbit/viewer";
477
+
478
+ mountWorldOrbitEmbeds(document, {
479
+ mode: "interactive-3d",
480
+ });
481
+ ```
482
+
483
+ ## Examples
484
+
485
+ Examples live in:
486
+
487
+ * [examples/minimal.worldorbit](./examples/minimal.worldorbit)
488
+ * [examples/minimal-3d.worldorbit](./examples/minimal-3d.worldorbit)
489
+ * [examples/showcase-3d.worldorbit](./examples/showcase-3d.worldorbit)
490
+ * [examples/schema25-camera.worldorbit](./examples/schema25-camera.worldorbit)
491
+ * [examples/schema25-event-snapshot.worldorbit](./examples/schema25-event-snapshot.worldorbit)
492
+ * [examples/studio.schema25.worldorbit](./examples/studio.schema25.worldorbit)
493
+ * [examples/iyath.worldorbit](./examples/iyath.worldorbit)
494
+ * [examples/iyath.schema2.worldorbit](./examples/iyath.schema2.worldorbit)
495
+ * [examples/iyath.schema21.worldorbit](./examples/iyath.schema21.worldorbit)
496
+ * [examples/iyath.schema2-draft.worldorbit](./examples/iyath.schema2-draft.worldorbit)
497
+ * [examples/markdown/static.md](./examples/markdown/static.md)
498
+ * [examples/markdown/interactive.md](./examples/markdown/interactive.md)
499
+ * [examples/markdown/build.mjs](./examples/markdown/build.mjs)
500
+
501
+ Browser-facing examples and demos live in the repository under `demo/`, `studio/`, and `examples/`.
502
+
503
+ ## Documentation
504
+
505
+ * [migration guide: v0.8 to v1.0](./docs/migration-v0.8-to-v1.0.md)
506
+ * [migration guide: v1 to v2](./docs/migration-v1-to-v2.md)
507
+ * [migration guide: v2.0 to v2.1](./docs/migration-v2-to-v2.1.md)
508
+ * [migration guide: v2.1 to v2.5](./docs/migration-v2.1-to-v2.5.md)
509
+ * [migration guide: v2.6 to v3.0](./docs/migration-v2.6-to-v3.0.md)
510
+ * [language reference](./docs/language-reference.md)
511
+ * [language reference (DE)](./docs/language-reference.de.md)
512
+ * [API inventory](./docs/api-inventory.md)
513
+ * [changelog](./docs/changelog.md)
514
+
515
+ ## Development
516
+
517
+ ```bash
518
+ npm install
519
+ npm run build
520
+ npm test
521
+ ```
522
+
523
+ The workspace builds outputs into package-specific distribution folders and browser bundles.
524
+
525
+ Useful notes:
526
+
527
+ * `npm run build` compiles all packages and refreshes local package shims
528
+ * `npm test` rebuilds first, then runs the regression suite
529
+ * the repository remains parser-first: rendering and atlas interaction stay downstream of parse, normalize, and validate
530
+
531
+ ## Project Direction
532
+
533
+ WorldOrbit is intended as a specialized Mermaid-like solution for fictional orbital systems.
534
+
535
+ The long-term focus is:
536
+
537
+ * strong text-first authoring
538
+ * clean Markdown embedding
539
+ * rich static and interactive rendering
540
+ * optional visual editing
541
+ * stable schema evolution over time
542
+
543
+ ## License
544
+
545
+ MIT