リファレンス · 88星座それぞれの絵 (明るい版と暗い版)
figureThumbnail関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The picture of a figure of a sky culture (a Chinese asterism, a traditional Japanese figure), drawn the way a constellation's is, so every sky makes one set: the same square, the same room round the figure, the neighbouring constellations' boundaries and stars faint behind it, the same line and star sizes. A figure of two stars or more stands in a soft dashed outline with a faint wash (it has no official boundary: only the 88 constellations do, and the outline is a drawing aid), its stars in full. A figure of one star (Rigel as 源氏星, Sirius as 天狼, or an asterism of which the catalogue holds one star) stands in the same dashed outline round that star, ringed in the accent colour, with the neighbouring boundaries and stars faint behind it: no other figure's lines, so the picture shows only what the figure has.
インポート
import { figureThumbnail } from "@johnmorrisdotca/hoshi-stars/thumbnails";
定義
function figureThumbnail(input: FigureThumbnailInput, options?: ThumbnailOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
input | FigureThumbnailInput | The title, the stars and the lines. |
options (省略可) | ThumbnailOptions | The look, the size and whether the neighbours are drawn. |
戻り値
string
A standalone SVG document as a string, a square of THUMBNAIL_UNITS units.
例
import { figureOf } from "@johnmorrisdotca/hoshi-stars/lines";
import { figureThumbnail } from "@johnmorrisdotca/hoshi-stars/thumbnails";
import { chinese } from "@johnmorrisdotca/hoshi-stars/cultures/chinese";
const dipper = figureOf("北斗", chinese);
const svg = figureThumbnail({ title: "北斗", stars: dipper.stars, segments: dipper.segments }, { theme: "dark" });
const sirius = figureOf("天狼", chinese);
console.log(svg.includes("stroke-dasharray"), figureThumbnail({ title: "天狼", stars: sirius.stars, segments: [] }).includes("data-ring"));true true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。