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 · MR flag SVG

defaultconstant

The flag of Mauritania (モーリタニア), MR, as an SVG string: viewBox 3000 by 2000 (3:2), 317 B. From Wikimedia Commons, "Flag of Mauritania.svg" (public domain); the /manifest entry gives its author, licence and why it was chosen. It has a viewBox and no width or height, so it fills the box it is put in at its own aspect ratio.

Import it

import value from "@johnmorrisdotca/hata/flags/mr";

Definition

const svg: string = "<svg data-hata=\"mr\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 3000 2000\"><path fill=\"#d01c1f\" d=\"M0 0h3000v2000H0z\"/><path fill=\"#00a95c\" d=\"M0 400h3000v1200H0z\"/><path fill=\"gold\" d=\"M1299 744h153l48-144 48 144h153l-126 92 51 146-126-90-126 90 51-146zm-549-74a760 628 0 0 0 1500 0 750 730 0 0 1-1500 0\"/></svg>"

Examples

Example 1

import flag from "@johnmorrisdotca/hata/flags/mr";

const host=document.createElement("div");
host.innerHTML = flag; // or toDataUri(flag) from "@johnmorrisdotca/hata" for an <img src>
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

Example 2

import { svg } from "@johnmorrisdotca/hata/flags/mr";
console.log(svg.startsWith("<svg"),svg.length);
true 317

What it prints (run when this page was built)

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