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

svgconstant

The flag of West Indies Federation (西インド連邦), WIF, as an SVG string: viewBox 632 by 316 (2:1), 968 B. From Wikimedia Commons, "Flag of the West Indies Federation (1958–1962).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/wif";

Definition

const svg: string = "<svg data-hata=\"wif\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 632 316\"><path fill=\"#002d82\" d=\"M0 0h632v316H0z\"/><g fill=\"#fff\"><path id=\"hata-wif-a\" d=\"M632 33c-14-8-23-11-50.5-11-47.5 0-41 21-88.5 21s-41-21-88.5-21-41 21-88.5 21-41-21-88.5-21-41 21-88.5 21-41-21-88.5-21c-28 0-37 3-50.5 11v23c13-8 22-10 50.5-10 47.5 0 41 20 88.5 20s41-20 88.5-20 41 20 88.5 20 41-20 88.5-20 41 20 88.5 20 41-20 88.5-20c28 0 37 2 50.5 10z\"/><use width=\"100%\" height=\"100%\" y=\"47\" href=\"#hata-wif-a\" transform=\"translate(0 26)\"/><path id=\"hata-wif-b\" d=\"M632 283c-14 8-23 11-50.5 11-47.5 0-41-21-88.5-21s-41 21-88.5 21-41-21-88.5-21-41 21-88.5 21-41-21-88.5-21-41 21-88.5 21c-28 0-37-3-50.5-11v-24c13 9 22 11 50.5 11 47.5 0 41-21 88.5-21s41 21 88.5 21 41-21 88.5-21 41 21 88.5 21 41-21 88.5-21 41 21 88.5 21c28 0 37-2 50.5-11z\"/><use width=\"100%\" height=\"100%\" y=\"-47\" href=\"#hata-wif-b\" transform=\"translate(0 -26)\"/></g><circle cx=\"316\" cy=\"158\" r=\"79\" fill=\"#ffa100\"/></svg>"

Examples

Example 1

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

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

What it prints (run when this page was built)

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