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

svgconstant

The flag of Tuvalu (ツバル), TV, as an SVG string: viewBox 120 by 60 (2:1), 1.1 KB. From Wikimedia Commons, "Flag of Tuvalu.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/tv";

Definition

const svg: string = "<svg data-hata=\"tv\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"#fedd00\" viewBox=\"0 0 120 60\"><title>Flag of Tuvalu</title><defs><clipPath id=\"hata-tv-a\"><path d=\"M0 0h120v60H0z\"/></clipPath><clipPath id=\"hata-tv-b\"><path d=\"M0 0v15h62v16zm0 30v1h30V0h30z\"/></clipPath><path id=\"hata-tv-c\" d=\"m0-5.26 3.09 9.51L-5-1.62H5l-8.09 5.87z\"/><path id=\"hata-tv-d\" d=\"m0 5.26-3.09-9.51L5 1.62H-5l8.09-5.87z\"/></defs><path fill=\"#012169\" d=\"M0 0h120v60H0z\"/><g fill=\"none\" stroke=\"#c8102e\" stroke-width=\"6\" clip-path=\"url(#hata-tv-a)\"><path stroke=\"#fff\" d=\"m0 0 60 30M0 30 60 0\"/><path stroke-width=\"4\" d=\"m0 0 60 30M0 30 60 0\" clip-path=\"url(#hata-tv-b)\"/><path stroke=\"#fff\" stroke-width=\"10\" d=\"M30 0v31M0 15h62\"/><path d=\"M30 0v31M0 15h62\"/></g><path fill=\"#009cde\" d=\"M60 0h60v60H0V30h60z\"/><use x=\"65.5\" y=\"54\" href=\"#hata-tv-c\"/><use x=\"78\" y=\"38.5\" href=\"#hata-tv-d\"/><use x=\"78\" y=\"51\" href=\"#hata-tv-d\"/><use x=\"90.5\" y=\"21.5\" href=\"#hata-tv-d\"/><use x=\"90.5\" y=\"47.5\" href=\"#hata-tv-d\"/><use x=\"101\" y=\"17.5\" href=\"#hata-tv-d\"/><use x=\"101\" y=\"38.5\" href=\"#hata-tv-c\"/><use x=\"111.5\" y=\"8\" href=\"#hata-tv-c\"/><use x=\"111.5\" y=\"32\" href=\"#hata-tv-c\"/></svg>"

Examples

Example 1

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

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

What it prints (run when this page was built)

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