Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

Reference · /chart

chartSvgfunction

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 it

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

Definition

function chartSvg(options: ChartSvgOptions): string

Parameters

NameTypeDescription
optionsChartSvgOptions

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

Returns

string

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

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.47.0.