本文へ移動

Hata旗

国や地域の旗を読み込み、対応する表示の形を選び、絵ごとの資料・作者・ライセンスを保てます。

「旗(はた)」は、旗を表す日本語です。 名前について(英語)

目次

リファレンス

旗の資料と表示の情報

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

最小化と gzip 圧縮をしたサイズは 86.9 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

エクスポート

名前種類概要
FlagRecord型Where one flag's drawing comes from, under what licence, and why that drawing was chosen.
FlagSource型Where 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.
Framing型How 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.
FramingCrop型The crop of a flag at one shape: which crop fit: "auto" chooses, and the side fit: "crop" asked for by name keeps.
LEFT_OUT定数Every 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.
leftOut関数Why a code Kuni knows has no flag in this version.
LeftOutRecord型A code Kuni knows that has no flag in this version, and why.
LicenceKind型The 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).
manifest関数Where one flag's drawing comes from, its licence and author, and why it was chosen.
MANIFEST定数Every 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.
Variant型One 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.
variantsOf関数Every 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.

ソースを見るGitHub で編集@johnmorrisdotca/hata 1.6.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。