Portrait型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A portrait scene: the bodies, back to front, and how they are arranged, sized, lit and drawn. Plain data: keep it, change it by making a new one, and encodeScene it for an address.
インポート
import type { Portrait } from "@johnmorrisdotca/wakusei-planets";
定義
interface Portrait {
items: Item[];
layout: "auto" | "manual";
arrange: Arrange;
scale: ScaleMode;
moons: "auto" | "manual";
look: Look;
bg: Background;
aspect: number;
light: {
az: number;
el: number;
};
labels: boolean;
orbits: boolean;
shadows: boolean;
date: string | undefined;
camera: {
x: number;
y: number;
h: number;
};
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
items | Item[] | Back to front. |
layout | "auto" | "manual" |
|
arrange | Arrange | |
scale | ScaleMode | |
moons | "auto" | "manual" |
|
look | Look | |
bg | Background | |
aspect | number | Width over height. |
light | { az: number; el: number; } | Where the Sun is: |
labels | boolean | |
orbits | boolean | |
shadows | boolean | |
date | string | undefined | The body as the Earth sees it on this date (ISO), or |
camera | { x: number; y: number; h: number; } | The view in a manual layout: the centre and the half-height, in scene units. An automatic layout always fits. |
例
import { addBody, defaultPortrait, type Portrait } from "@johnmorrisdotca/wakusei-planets";
const scene: Portrait = addBody(addBody(defaultPortrait(), "jupiter"), "io");
console.log(scene.items.length, scene.layout, scene.scale);2 auto readable出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。