Reference · Flag source and framing metadata
FramingCroptype
The crop of a flag at one shape: which crop fit: "auto" chooses, and the side fit: "crop" asked for by name keeps.
Both the whole flag and a crop are offered for every flag: fit: "whole" shows all of it, fit: "crop" crops it.
Import it
import type { FramingCrop } from "@johnmorrisdotca/hata/manifest";
Definition
interface FramingCrop {
rule: "own" | "curated" | "centre" | "whole";
at: "left" | "right" | "top" | "bottom" | "centre";
why: string | null;
loses: string[];
}
Members
| Name | Type | Description |
|---|---|---|
rule | "whole" | "own" | "curated" | "centre" | What |
at | "centre" | "left" | "right" | "top" | "bottom" | The side |
why | string | null | Why a person chose this side, or chose to show the flag whole; null where nobody chose (a centre crop, or a flag that is already this shape). |
loses | string[] | The colours (each covering 5% or more of the flag) that a crop at |
Examples
import { manifest, type FramingCrop } from "@johnmorrisdotca/hata/manifest";
const crop: FramingCrop | undefined = manifest("US-HI")?.framings["1:1"].crop;
console.log(crop?.rule); // "curated": a person chose the side
console.log(crop?.at); // "left": the canton and the stripes beside itcurated
leftWhat it prints (run when this page was built)