本文へ移動

Hoshi Stars星

肉眼で見える星の名前・色・距離、88星座の線と境界、メシエ天体、そしてそれらを描くための7種類の図法を使えます。

「星」(ほし) は、夜空に光って見えるものです。 名前について(英語)

目次

リファレンス · /chart

chartSvg関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The sky chart as a complete SVG element, as a string: the stars, and the layers asked for, laid out for width by height, on the night background. Pure: it reads no clock and fetches nothing.

インポート

import { chartSvg } from "@johnmorrisdotca/hoshi-stars/chart";

定義

function chartSvg(options: ChartSvgOptions): string

引数

名前型説明
optionsChartSvgOptions

The size, and where and how to look (see ChartSvgOptions).

戻り値

string

An <svg> with a viewBox of the size, role="img" and an accessible name; put it in a page as it is.

例

import { chartSvg } from "@johnmorrisdotca/hoshi-stars/chart";

const svg = chartSvg({ width: 640, height: 400, constellation: "Ori" });
console.log(svg.startsWith("<svg"), svg.includes('viewBox="0 0 640 400"'));
// true true
true true

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hoshi-stars 0.47.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。