Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/old-otters-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navigraph/charts": patch
---

Updated the `Chart` types & associated documentation to better aid developers. Also added information about the newly introduced additional bounding boxes: `profile`, `minimums` and `header`.
27 changes: 27 additions & 0 deletions packages/charts/src/public-types.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
/**
* A bounding box representation in pixels from the origin (top left) of the chart.
*
* **Note:** The first coordinate is the *bottom left* corner, the second
* coordinate is the *top right* corner.
*/
export interface Pixels {
x1: number;
y1: number;
x2: number;
y2: number;
}

/** The same as {@link Pixels}, but with geographical coordinates instead. */
export interface Latlng {
lng1: number;
lat1: number;
lng2: number;
lat2: number;
}

/**
* World references for the "Map" part of the chart, containing the top-down route.
* Can be used to accurately show the ownship location.
*/
export interface Planview {
pixels: Pixels;
latlng: Latlng;
Expand All @@ -21,17 +32,31 @@ export interface Inset {
pixels: Pixels;
}

/**
* A list of bounding boxes available for the chart. Can be used to make the chart
* more interactive by exclusively showing certain features.
*
* **Note:** To the extent that it is possible, always keep the disclaimer
* text visible - regardless of which bounding box is active.
*/
export interface BoundingBoxes {
planview: Planview;
insets: Inset[];
profile?: Inset;
minimums?: Inset;
header?: Inset;
}

export type ChartCategory = "APT" | "REF" | "ARR" | "DEP" | "APP";

export type Chart = {
/** @deprecated Use {@link Chart.image_day_url|image_day_url} instead */
image_day: string;
/** @deprecated Use {@link Chart.image_night_url|image_night_url} instead */
image_night: string;
/** @deprecated Use {@link Chart.thumb_day_url|thumb_day_url} instead */
thumb_day: string;
/** @deprecated Use {@link Chart.thumb_night_url|thumb_night_url} instead */
thumb_night: string;
icao_airport_identifier: string;
id: string;
Expand All @@ -42,7 +67,9 @@ export type Chart = {
revision_date: string;
width: number;
height: number;
/** The procedures, if any, that is associated with this chart. */
procedures: string[];
/** The runways, if any, that is associated with this chart. */
runways: string[];
image_day_url: string;
image_night_url: string;
Expand Down