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 · Flags a page registers itself

customAspectfunction

A custom flag's width over its height, from its viewBox, for keeping a box before it is drawn.

Import it

import { customAspect } from "@johnmorrisdotca/hata/custom";

Definition

function customAspect(id: string): number | null

Parameters

NameTypeDescription
idstring

The flag's id, in any case.

Returns

number | null

The aspect ratio, or null when no such flag is registered.

Examples

import { customAspect } from "@johnmorrisdotca/hata/custom";

console.log(customAspect("custom:nothing-here")); // null
null

What it prints (run when this page was built)

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