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 · JP-02 flag SVG

defaultconstant

The flag of Aomori (青森県), JP-02, as an SVG string: viewBox 400 by 280 (10:7), 450 B. From Wikimedia Commons, "Flag of Aomori Prefecture.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/jp-02";

Definition

const svg: string = "<svg data-hata=\"jp-02\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\" viewBox=\"0 0 400 280\"><path fill=\"#fff\" d=\"M0 0h400v280H0z\"/><path fill=\"#04773d\" stroke=\"#04773d\" d=\"M196 43c13.5 11.8 30.9 25.5 52 26 20.9.5 28-7 42-13 0 0-14.8 38.1-16 51s-.8 12.2 0 23 12.1 69.3 52 95H66c33.8-30.1 54.4-68 54-118h40c2.7 23.7 1.4 57.8 16 66 14 7.9 20.4-13.5 20-21h18c-1 10.7 6 21.3 16 21 11-.4 18-26.6 18-43 0-16-3.4-20.5-12-23s-29.3 12.4-40 23z\"/></svg>"

Examples

Example 1

import flag from "@johnmorrisdotca/hata/flags/jp-02";

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/jp-02";
console.log(svg.startsWith("<svg"),svg.length);
true 450

What it prints (run when this page was built)

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