本文へ移動

Hoshi Stars星

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

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

目次

リファレンス · /chart/element

ChartMarkerDetail型

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

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

インポート

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

定義

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

メンバー

名前型説明
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.

例

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);
});

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

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