Roadmap / MVP Scope
このページでは、Fluxion で現在使える MVP 機能と、将来構想としてまだ固定しない範囲を分けて整理します。
Fluxion の現在の MVP は、Manim 風 Python DSL とブラウザ向け Text DSL から同じ .fluxion.json を生成し、ブラウザ上の SVG Runtime で再生する最小実装です。Text DSL はすでに playground の主要な入力方式として利用できます。
現在使えるもの
Section titled “現在使えるもの”- Python DSL:
Scene,Mobject,Circle,Rectangle,Line,Text,Math,Group - Timeline IR:
create,delete,set,animate - JSON export:
Scene.export_json()とexport_scene() - Web Runtime: TypeScript
.fluxion.jsonloader, scene graph, timeline player, SVG renderer, diff patch helper - Text DSL compiler: ブラウザ上で短い宣言的テキストを
.fluxion.jsonに変換 - Browser editor: live compile, playback controls, scrubber, generated JSON preview
- Schema:
schemas/fluxion.schema.json - Example:
examples/simple_circle.pyと生成済みexamples/simple_circle.fluxion.json
Text DSL
Section titled “Text DSL”Text DSL は、短いテキスト記述をブラウザ内 compiler で .fluxion.json に変換する入力方式です。この方式では任意の Python / JavaScript コードを実行せず、Text DSL parser → .fluxion.json → Web Runtime の順に処理します。
scene width=1280 height=720 fps=60camera at 0,0 scale=1
value phase = 0text title "Fluxion MVP" at 640,110 size=32 fill="#e2e8f0"math equation "e^{i\\pi}+1=0" at 640,190 size=34 expandTokens=truecircle c1 r=48 at 220,360 fill="#38bdf8" stroke="#0f172a" strokeWidth=4rect box w=96 h=96 at 640,360 fill="#f97316"line axis x1=-120 y1=0 x2=120 y2=0 at 640,520 stroke="#e2e8f0" strokeWidth=2path curve d="M 0 0 C 40 80 80 80 120 0" at 640,455 fill="none" stroke="#38bdf8"group intro title equation
at 0s: show intro show c1 set title.fill to "#38bdf8"
wait 0.25splay FadeIn(axis) duration=0.5sanimate c1.x from 220 to 640 duration=1.5s easing=easeInOutanimate phase from 0 to 6.283 duration=1.5sset c1.y to expr="360 + 40 * sin(phase)"play Transform(c1, box) duration=1s easing=easeInOuthide c1 at 3.5s現在使える構文は以下です。
scene width=1280 height=720 fps=60circle,rect,line,path,text,math,groupcameraとvaluetrackerat x,y,fill,stroke,strokeWidth,size/fontSize, geometry optionsx,y,scale,rotation,opacity, camera properties, style / geometry aliasesset id.property to valueとset id.property to expr="..."show,hide,waitanimate id.property from A to B ...とanimate valueId from A to B ...play FadeIn(...),FadeOut(...),Create(...),Transform(...),TransformMatchingTex(...),AnimationGroup(...),Succession(...)at 0s:block 内のshow,hide,set,wait,play,animate
明示的に show されていない node は、preview しやすいように t=0 の create として自動追加します。
詳細な構文、既定値、現在の制約は Text DSL reference にまとめます。
Web Runtime
Section titled “Web Runtime”Runtime は .fluxion.json の nodes と timeline から Scene Graph を再構築し、SVG Renderer へ渡します。現在使える再生 semantics は以下です。
createoperation を含む document は空の graph から再生を開始するcreateoperation を含まない document はnodesを初期 graph として表示する- 同時刻 operation は
create→setValue→set→effect→animateValue→animate→setExpr→ updater 系 →deleteの優先順で適用する - 同じ時刻・同じ operation type の中では source array order を保持する
duration <= 0の animation は即時に final value を適用する- 非数値 animation は完了時に
tovalue へ切り替える - Value tracker を初期化し、
setValue/animateValueを適用した上でsetExprと updater 系 operation を評価する
詳細は Web Runtime にまとめます。
現在の MVP Scope には含めず、将来の候補として扱うものは以下です。
- Text DSL の
include,component, loop, conditional, nested block - CSS color validation と compiler 内 schema validation のさらなる強化
- Manim 互換 syntax の拡張
- complex TeX layout の厳密な glyph 位置合わせ
- richer editor diagnostics と code action
- Python DSL と Text DSL の相互変換
- fenced code block embedding
PYTHONPATH=python python examples/simple_circle.pycd web && npm run buildcd .. && python -m http.server 8000ブラウザで http://localhost:8000/web/ を開くと、SVG プレビューを再生できます。
画面左の Text DSL を編集すると Live compile で .fluxion.json に変換され、Preview, scrubber, generated JSON を同じページ上で確認できます。