ChartViewDetailtype
What hoshi-view says: where the chart looks now, and final once the hand has settled.
Import it
import type { ChartViewDetail } from "@johnmorrisdotca/hoshi-stars/chart/element";
Definition
interface ChartViewDetail {
projection: Projection;
ra: number;
dec: number;
zoom: number;
final: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
projection | "stereographic" | "orthographic" | "gnomonic" | "equidistant" | "equirectangular" | "mollweide" | "hammer" | |
ra | number | |
dec | number | |
zoom | number | |
final | boolean |
Examples
import type { ChartViewDetail } from "@johnmorrisdotca/hoshi-stars/chart/element";
document.querySelector("hoshi-chart")!.addEventListener("hoshi-view", (event) => {
const { ra, dec, zoom, final } = (event as CustomEvent<ChartViewDetail>).detail;
if (final) history.replaceState(null, "", `?ra=${ra.toFixed(2)}&dec=${dec.toFixed(2)}&zoom=${zoom.toFixed(2)}`);
});