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

svgconstant

The flag of Fukushima (福島県), JP-07, as an SVG string: viewBox 1500 by 1000 (3:2), 504 B. From Wikimedia Commons, "Flag of Fukushima 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 { svg } from "@johnmorrisdotca/hata/flags/jp-07";

Definition

const svg: string = "<svg data-hata=\"jp-07\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1500 1000\"><path fill=\"#d84b24\" d=\"M0 0h1500v1000H0z\"/><g fill=\"#fff\" transform=\"translate(600 440)\"><path d=\"M47.3-386.4a60 60 0 0 0 30.3 96.6A300 300 0 1 1-96.8-284 225 225 0 0 0-21-199a200 200 0 1 0 72.7 5.8A200 200 0 0 1-96.5-386.4z\"/><path id=\"hata-jp-07-a\" d=\"M293.3 140A100 100 0 0 0 402 202.3a450 450 0 0 1-64.4 95.2 200 200 0 0 1-107-68.5 325 325 0 0 0 62.7-89\"/><use href=\"#hata-jp-07-a\" transform=\"scale(-1 1)\"/></g></svg>"

Examples

Example 1

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

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

What it prints (run when this page was built)

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