Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Ship signal flags (International Code of Signals)

signalAspectfunction

A flag's width over its height, from its viewBox: 1.2 for a letter flag, 3.5 for a numeral pennant. For keeping a box before the picture is drawn.

Import it

import { signalAspect } from "@johnmorrisdotca/hata/signals";

Definition

function signalAspect(id: string): number | null

Parameters

NameTypeDescription
idstring

A flag's id, in any case, with or without ics:.

Returns

number | null

The aspect ratio, or null when the Code has no such flag.

Examples

import { signalAspect } from "@johnmorrisdotca/hata/signals";

console.log(signalAspect("ics:a")); // 1.2
console.log(signalAspect("ics:0")); // 3.5
1.2
3.5

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.