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-22 flag SVG

defaultconstant

The flag of Shizuoka (静岡県), JP-22, as an SVG string: viewBox 27 by 18 (3:2), 687 B. From Wikimedia Commons, "Flag of Shizuoka 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-22";

Definition

const svg: string = "<svg data-hata=\"jp-22\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-13.5 -4.5 27 18\"><path fill=\"#004a8f\" d=\"M-13.5-4.5h27v18h-27z\"/><path fill=\"#f98f00\" stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M.495.5a.75.75 0 0 1 .736.606 7.3 7.3 0 0 0 2.695 4.37A5.03 5.03 0 0 0 6.5 6.5a8.5 8.5 0 0 0-4.783 1.837.75.75 0 0 1-.934-1.174 10 10 0 0 1 .686-.5.75.75 0 0 0 .138-1.13 2.176 2.176 0 0 0-3.324 2.804A8.5 8.5 0 0 0-6.5 6.5a5.03 5.03 0 0 0 2.574-1.025 7.3 7.3 0 0 0 2.695-4.369A.75.75 0 0 1-.495.5zm-1.726.606a7 7 0 0 0 .065-.39A.25.25 0 0 1-.92.5h.424m.99 0H.92a.25.25 0 0 1 .247.216 7 7 0 0 0 .065.39m.238 5.557.213-.138a.5.5 0 0 0 .155-.691 2 2 0 0 0-.23-.301\"/></svg>"

Examples

Example 1

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

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-22";
console.log(svg.startsWith("<svg"),svg.length);
true 687

What it prints (run when this page was built)

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