flight-indicators 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/dist/index.cjs +347 -204
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +347 -205
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
Modern SVG flight instruments for React, with no runtime dependencies.
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
- Sixteen instruments: **Attitude**, **Heading**, **Airspeed**, **Altimeter**, **Vertical speed**, **Turn coordinator**, **VOR / CDI**, **VOR / ILS** (crossed needles with glideslope), **ADF**, **Radio panel** (NAV / ADF / DME), **Wind / runway**, **Fuel**, **Flaps**, **Angle of attack**, **Engine monitor** and a custom **Data panel** for any readouts you like
|
|
12
12
|
- Plus **RadioStack**, an interactive NAV / ADF / DME radio with editable standby frequencies
|
|
13
13
|
- Pure SVG with no image files, so instruments stay sharp at any size and work with any bundler
|
|
14
14
|
- Written in TypeScript and ships its type declarations
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
VerticalSpeed,
|
|
37
37
|
TurnCoordinator,
|
|
38
38
|
VorIndicator,
|
|
39
|
+
IlsIndicator,
|
|
39
40
|
AdfIndicator,
|
|
40
41
|
RadioPanel,
|
|
41
42
|
relativeBearing,
|
|
@@ -58,6 +59,7 @@ export function Panel({ data }) {
|
|
|
58
59
|
<VerticalSpeed verticalSpeed={data.vs} />
|
|
59
60
|
<WindIndicator runway={90} windDirection={data.windDir} windSpeed={data.windSpeed} />
|
|
60
61
|
<VorIndicator course={data.obs} radial={data.navRadial} />
|
|
62
|
+
<IlsIndicator course={data.obs} radial={data.navRadial} glideslope={data.gsDeviation} />
|
|
61
63
|
<AdfIndicator heading={data.heading} bearing={relativeBearing(data.heading, data.ndbBearing)} />
|
|
62
64
|
<RadioPanel nav={{ active: data.nav1, standby: data.nav1Stby }} adf={{ active: data.adf }} dme={data.dme} />
|
|
63
65
|
<FuelIndicator capacity={26} tanks={[{ name: 'Left', quantity: data.fuelL }, { name: 'Right', quantity: data.fuelR }]} />
|
|
@@ -165,6 +167,30 @@ A VOR / course deviation indicator with an OBS card. The card turns so the selec
|
|
|
165
167
|
|
|
166
168
|
`vorDeviation(course, radial)` is exported too and returns `{ deviation, toFrom }` if you want the same maths without the drawing.
|
|
167
169
|
|
|
170
|
+
### `<IlsIndicator />`
|
|
171
|
+
|
|
172
|
+
A crossed-needle VOR / ILS head with an OBS card, as found in many light aircraft. The vertical needle shows course (VOR or localizer) deviation and the horizontal needle glideslope deviation, each over a scale of 5 dots either side of the centre circle. Small windows show TO (upper right) or FR (lower left), and orange flags with arrows drop into the window at the bottom when the NAV signal is lost and into the window on the right when there is no glideslope. An OBS knob is drawn on the mounting plate. Course inputs work just like `<VorIndicator />`: give `course` and `radial`, or pass `deviation` and `toFrom` directly.
|
|
173
|
+
|
|
174
|
+
| Prop | Type | Default | Description |
|
|
175
|
+
| --------------------- | ------------------------- | --------- | ------------------------------------------------------------------ |
|
|
176
|
+
| `course` | `number` | `0` | Selected course (OBS) in degrees. |
|
|
177
|
+
| `radial` | `number` | | Radial from the station the aircraft is on, in degrees. Drives the course needle and the TO/FROM window. |
|
|
178
|
+
| `deviation` | `number` | | Course deviation in degrees, positive when the course is to the right. Overrides `radial`. |
|
|
179
|
+
| `fullScale` | `number` | `10` | Course deviation at full scale (5 dots). `10` suits a VOR; use `2.5` for a localizer. |
|
|
180
|
+
| `toFrom` | `"TO" \| "FROM" \| "OFF"` | | TO/FROM indication. Overrides `radial`. |
|
|
181
|
+
| `signal` | `boolean` | `true` | `false` drops the NAV flag, centres the course needle and blanks TO/FROM. |
|
|
182
|
+
| `glideslope` | `number` | | Glideslope deviation in degrees, positive when the glidepath is above you (fly up). Leave it out when no glideslope is received. |
|
|
183
|
+
| `glideslopeFullScale` | `number` | `0.7` | Glideslope deviation at full scale (5 dots). |
|
|
184
|
+
| `glideslopeSignal` | `boolean` | | Whether the glideslope is received. Defaults to `true` when `glideslope` is a number; `false` drops the GS flag and parks the needle. |
|
|
185
|
+
| `needles` | `"slide" \| "swing"` | `"slide"` | `"slide"` moves both needles parallel to themselves over hatched scales. `"swing"` hinges the course needle near the bottom and the glideslope needle near the left, so they pivot like on older heads; without a glideslope the hinged needle is parked above the scale. |
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
// VOR only: the glideslope flag stays down.
|
|
189
|
+
<IlsIndicator course={270} radial={84} />
|
|
190
|
+
// ILS approach on a localizer, with the older hinged-needle look.
|
|
191
|
+
<IlsIndicator course={265} deviation={-0.8} fullScale={2.5} glideslope={0.2} needles="swing" />
|
|
192
|
+
```
|
|
193
|
+
|
|
168
194
|
### `<AdfIndicator />`
|
|
169
195
|
|
|
170
196
|
An automatic direction finder. The needle points at the tuned NDB: give it the `bearing` of the station relative to the nose. With `heading` left at `0` it is a fixed-card ADF that reads relative bearing. Pass the aircraft `heading` and the card turns with it (a rotatable-card ADF or RMI), so the needle head reads the magnetic bearing to the station and the tail the bearing from it.
|