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

defaultconstant

The flag of Niue (ニウエ), NU, as an SVG string: viewBox 120 by 60 (2:1), 1.0 KB. From Wikimedia Commons, "Flag of Niue.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/nu";

Definition

const svg: string = "<svg data-hata=\"nu\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 120 60\"><clipPath id=\"hata-nu-a\"><path d=\"M0 0v15h70v15H60zm0 30v10h30V0h30z\"/></clipPath><title>Flag of Niue</title><path fill=\"#012169\" d=\"M0 0h120v60H0z\"/><g stroke=\"#c8102e\" stroke-width=\"6\"><path stroke=\"#fff\" d=\"m0 0 60 30m0-30L0 30\"/><path stroke-width=\"4\" d=\"m0 0 60 30m0-30L0 30\" clip-path=\"url(#hata-nu-a)\"/><path stroke=\"#fff\" stroke-width=\"10\" d=\"M30 0v40M0 15h70\"/><path d=\"M30 0v40M0 15h70\"/></g><path fill=\"#fedd00\" d=\"M60 0h60v60H0V30h60z\"/><g transform=\"translate(30,15)\"><g transform=\"scale(5.10390485)\"><circle r=\"1\" fill=\"#012169\"/><path id=\"hata-nu-b\" fill=\"#fedd00\" d=\"m0-513674 301930 929245-790463-574305h977066l-790463 574305\" transform=\"scale(0.00000194676)\"/></g><use href=\"#hata-nu-b\" transform=\"translate(-17.5,0.29) scale(3)\"/><use href=\"#hata-nu-b\" transform=\"translate(17.5,0.29) scale(3)\"/><use href=\"#hata-nu-b\" transform=\"translate(0,10.29) scale(3)\"/><use href=\"#hata-nu-b\" transform=\"translate(0,-9.71) scale(3)\"/></g></svg>"

Examples

Example 1

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

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

What it prints (run when this page was built)

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