Reference · A picture of each of the 88 constellations, in light and dark
figureThumbnailfunction
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 it
import { figureThumbnail } from "@johnmorrisdotca/hoshi-stars/thumbnails";
Definition
function figureThumbnail(input: FigureThumbnailInput, options?: ThumbnailOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
input | FigureThumbnailInput | The title, the stars and the lines. |
options (optional) | ThumbnailOptions | The look, the size and whether the neighbours are drawn. |
Returns
string
A standalone SVG document as a string, a square of THUMBNAIL_UNITS units.
Examples
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 trueWhat it prints (run when this page was built)