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/element

ChartMarkerDetailtype

What hoshi-marker says: a marker was clicked, tapped, or chosen with Enter or Space while it had the focus.

Import it

import type { ChartMarkerDetail } from "@johnmorrisdotca/hoshi-stars/chart/element";

Definition

interface ChartMarkerDetail {
    marker: SkyMarker;
    id: string;
    index: number;
    source: "pointer" | "key";
}

Members

NameTypeDescription
markerSkyMarker

The marker, as the page gave it (the same object when it was set as a property).

idstring

The marker's id, or m<position> when it has none.

indexnumber

Its position in markers.

source"pointer" | "key"

pointer for a click or a tap, key for Enter or Space on a marker that has the focus.

Examples

import type { ChartMarkerDetail } from "@johnmorrisdotca/hoshi-stars/chart/element";

document.querySelector("hoshi-chart")!.addEventListener("hoshi-marker", (event) => {
  const { marker, id, source } = (event as CustomEvent<ChartMarkerDetail>).detail;
  console.log(id, marker.label ?? "", source);
});

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