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
| Name | Type | Description |
|---|---|---|
marker | SkyMarker | The marker, as the page gave it (the same object when it was set as a property). |
id | string | The marker's |
index | number | Its position in |
source | "pointer" | "key" |
|
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);
});