svgconstant
The flag of Guinea-Bissau (ギニアビサウ), GW, as an SVG string: viewBox 12 by 6 (2:1), 541 B. From Wikimedia Commons, "Flag of Guinea-Bissau.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/gw";
Definition
const svg: string = "<svg data-hata=\"gw\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-2 -3 12 6\"><path fill=\"#fcd116\" d=\"M-2-3h12v6H-2z\"/><path fill=\"#009e49\" d=\"M-2 0h12v3H-2z\"/><path fill=\"#ce1126\" d=\"M-2-3h4v6h-4z\"/><g id=\"hata-gw-b\"><path id=\"hata-gw-a\" fill=\"#000\" d=\"M0-1v1h.5\" transform=\"rotate(18 0,-1)\"/><use href=\"#hata-gw-a\" transform=\"scale(-1,1)\"/></g><use href=\"#hata-gw-b\" transform=\"rotate(72)\"/><use href=\"#hata-gw-b\" transform=\"rotate(144)\"/><use href=\"#hata-gw-b\" transform=\"rotate(216)\"/><use href=\"#hata-gw-b\" transform=\"rotate(288)\"/></svg>"
Examples
Example 1
import flag from "@johnmorrisdotca/hata/flags/gw";
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/gw";
console.log(svg.startsWith("<svg"),svg.length);true 541What it prints (run when this page was built)