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

Flag source and framing metadata

import { … } from "@johnmorrisdotca/hata/manifest";

86.9 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
FlagRecordtypeWhere one flag's drawing comes from, under what licence, and why that drawing was chosen.
FlagSourcetypeWhere a drawing comes from: Wikimedia Commons (the file Wikidata names as the place's flag), or one of the MIT flag sets, chosen where it draws the same flag at its true proportions and is smaller, or is free where Commons' file is not.
FramingtypeHow one frame shows a flag, measured so that no frame misrepresents it (pnpm data:framing): a frame keeps a flag's colours when every colour covering at least 5% of the flag still covers at least half that share.
FramingCroptypeThe crop of a flag at one shape: which crop fit: "auto" chooses, and the side fit: "crop" asked for by name keeps.
LEFT_OUTconstantEvery code Kuni knows that has no flag in this version, with the reason: no source names one, or the only drawing's licence is not one this package can ship.
leftOutfunctionWhy a code Kuni knows has no flag in this version.
LeftOutRecordtypeA code Kuni knows that has no flag in this version, and why.
LicenceKindtypeThe kinds of licence a shipped drawing can be under: for a Wikimedia Commons file, as Commons states it, public-domain (PD-… templates: a government work, or a design too simple to be copyrighted), cc0, or cc-by (credit asked; NOTICE.md gives it), or accepted (another licence the maintainer decided to accept, written in the licence's name: Mississippi's "Copyrighted free use"); for a flag set's drawing, mit (the set's notice is in NOTICE.md).
manifestfunctionWhere one flag's drawing comes from, its licence and author, and why it was chosen.
MANIFESTconstantEvery flag's record, in the order of FLAG_CODES: its source, file, page, licence, author, restrictions, size, aspect ratio, and why that drawing was chosen.
VarianttypeOne of a place's flags in real use, for flag(code, { variant }) and variantsOf(code): Afghanistan's Republic tricolour and the Taliban's flag, Bavaria's lozenges and stripes, Guadeloupe's French tricolour and its local flag.
variantsOffunctionEvery flag of a place that has more than one in real use, with its status, dates, reason and drawing: Afghanistan's Republic tricolour (the default) and the Taliban's flag, Bavaria's lozenges and stripes, Northern Ireland's Union Flag and former Ulster Banner (it has no flag of its own by default), the French tricolour and the local flag of each French territory.

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