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 · Military flags (naval ensigns, jacks and war flags)

militaryAspectfunction

A flag's width over its height, from its viewBox: 1.5 for the Self-Defense Force ensign's 3 to 2. For keeping a box before the picture is drawn.

Import it

import { militaryAspect } from "@johnmorrisdotca/hata/military";

Definition

function militaryAspect(id: string): number | null

Parameters

NameTypeDescription
idstring

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

Returns

number | null

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

Examples

import { militaryAspect } from "@johnmorrisdotca/hata/military";

console.log(militaryAspect("mil:jp-jmsdf-ensign")); // 1.5
console.log(militaryAspect("mil:gb-white-ensign")); // 2
1.5
2

What it prints (run when this page was built)

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