Viewtype
Where the chart looks: the projection, the point in the middle (degrees) and the zoom, in the chart's own unit: 1 fits the projection's whole sky in the smaller side, more is closer.
Import it
import type { View } from "@johnmorrisdotca/hoshi-stars/chart/element";
Definition
interface View {
projection: Projection;
ra: number;
dec: number;
zoom: number;
}
Members
| Name | Type | Description |
|---|---|---|
projection | "stereographic" | "orthographic" | "gnomonic" | "equidistant" | "equirectangular" | "mollweide" | "hammer" | |
ra | number | |
dec | number | |
zoom | number |
Examples
import type { View } from "@johnmorrisdotca/hoshi-stars/chart/element";
const chart = document.querySelector("hoshi-chart")! as HTMLElement & { view: View | undefined; setView(change: Partial<View>): void };
chart.setView({ ra: 279.2, dec: 38.8, zoom: 12 });
console.log(chart.view?.zoom);