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
引数
| 名前 | 型 | 説明 |
|---|---|---|
options | ChartSvgOptions | The size, and where and how to look (see |
戻り値
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 truetrue true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。