defaultconstant
The flag of Iran (イラン), IR, as an SVG string: viewBox 630 by 360 (7:4), 1.3 KB. From Wikimedia Commons, "Flag of Iran.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/ir";
Definition
const svg: string = "<svg data-hata=\"ir\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 630 360\"><path fill=\"#da0000\" d=\"M0 0h630v360H0z\"/><path fill=\"#fff\" d=\"M0 0h630v240H0z\"/><path fill=\"#239f40\" d=\"M0 0h630v120H0z\"/><g transform=\"translate(8.4,100.4)\"><g id=\"hata-ir-e\"><g id=\"hata-ir-c\" fill=\"none\" stroke=\"#fff\" stroke-width=\"2\"><path id=\"hata-ir-b\" d=\"M0 1h26M1 10V5h8v4h8V5h-5M4 9h2m20 0h-5V5h8m0-5v9h8V0m-4 0v9\" transform=\"scale(1.4)\"/><path id=\"hata-ir-a\" d=\"M0 7h9m1 0h9\" transform=\"scale(2.8)\"/><use y=\"120\" href=\"#hata-ir-a\"/><use y=\"145.2\" href=\"#hata-ir-b\"/></g><g id=\"hata-ir-d\"><use x=\"56\" href=\"#hata-ir-c\"/><use x=\"112\" href=\"#hata-ir-c\"/><use x=\"168\" href=\"#hata-ir-c\"/></g></g><use x=\"168\" href=\"#hata-ir-d\"/><use x=\"392\" href=\"#hata-ir-e\"/></g><g fill=\"#da0000\" transform=\"matrix(45,0,0,45,315,180)\"><g id=\"hata-ir-f\"><path d=\"M1.016-.016a.78.78 0 0 1-.414.687A1.004 1.004 0 0 0 .444-.741L.4-.775a.776.776 0 0 1 .617.76\"/><path d=\"M.656-.047A.927.927 0 0 1-.557.834l.05.001a1.016 1.016 0 0 0 .84-1.584.92.92 0 0 1 .322.702M.262-.944A.142.142 0 0 1 0-.869l-.017-.017L0-.969A.132.132 0 0 0 .25-1a.14.14 0 0 1 .012.056\"/><path d=\"M.12-.714A.3.3 0 0 1 0-.81l-.05.794L0 1 .079.892l.01-.25L.1.38.101.348V.335L.105.281.111.117l.005-.132.002-.039.002-.048zM0 .315\"/></g><use href=\"#hata-ir-f\" transform=\"scale(-1,1)\"/></g></svg>"
Examples
Example 1
import flag from "@johnmorrisdotca/hata/flags/ir";
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/ir";
console.log(svg.startsWith("<svg"),svg.length);true 1322What it prints (run when this page was built)