Aeronautical Diagram Functions Reference

Table of contents


Introduction

These functions draw the common aeronautical diagrams as SVG drawings using an SvgScene: the runway wind diagram on the departure and destination pages, the fuel and time diagram on the enroute page, and the weight and balance diagram on the weight and balance page.

Each function is designed to be assigned as the value of an svg state variable. The state variable calls the function with the wrapper DOM node of the drawing, and the function renders the diagram into the node by setting its innerHTML. If node is falsy, nothing is drawn. The functions read the current state variable values when called, so the drawing must be re-rendered by assigning the function to the state variable again when its inputs change. For example:

io.dep_runwayDiagram.value = (node) => drawRunwaySvg(node, 'dep');

The diagrams use the dark mode setting (nav_darkMode state variable) to select the text and line colors.


Importing

The diagram functions are available for import from common/aero/export.js.


drawEnrtDiagramSvg()

Syntax

drawEnrtDiagramSvg(node, io)

Draws the enroute fuel and time diagram into node. The diagram has a horizontal fuel bar and a horizontal time bar that both span from zero fuel to the fuel on board (FOB). Between the bars, the fuel on board is divided into colored zones:

If the fuel on board is less than the minimum reserve, the whole bar is red. If the required values are not valid, the bar area is grey.

A solid blue line marks the fuel (and time) to the destination, with boxes showing the fuel to the destination and the estimated time enroute. It is drawn if the fuel remaining at the destination is at least the minimum reserve. A dotted blue line marks the fuel to the alternate airport. It is drawn if the fuel at the alternate is at least the minimum reserve, the alternate is farther than the destination, and the alternate reserve is at least the minimum reserve. The labels at the ends of the bars show the zero values, the fuel on board and the endurance.

Parameters

Return value

None.


drawRunwaySvg()

Syntax

drawRunwaySvg(node, pageId)

Draws the takeoff or landing runway wind diagram into node. The diagram contains:

Parameters

Return value

None.


drawWBSvg()

Syntax

drawWBSvg(node, io, bewCg)
drawWBSvg(node, io, bewCg, tkoCg, ldgCg, zfCg)
drawWBSvg(node, io, bewCg, tkoCg, ldgCg, zfCg, cgFn)

Draws the weight and balance diagram into node. The diagram always contains the aircraft's CG envelope (the normal category, or the utility category for utility-only aircraft) with the weight on the vertical axis and the arm on the horizontal axis, a dotted line at the maximum landing weight (if it is lower than the maximum takeoff weight), Fwd and Aft labels, and the basic empty weight (BEW) label.

If the takeoff and zero-fuel CG points are valid, the diagram also contains:

The function asserts that the takeoff weight is not less than the landing weight, and that the landing weight is not less than the zero-fuel weight.

Parameters

The aircraft data (acData) supplies the envelope (wb.cgEnvelope), the maximum takeoff, landing and zero-fuel weights (wb.maxTkoWeight, wb.maxLdgWeight, and wb.maxZfWeight), and the fuel density (fuel.lbToGal()).

Return value

None.