svg定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Antigua & Barbuda (アンティグア・バーブーダ), AG, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 686 B.
The drawing flag("AG", { shape: "4:3" }) uses, made for that shape by hand rather than cut from the flag. The /manifest entry's framings say how each frame was chosen.
インポート
import { svg } from "@johnmorrisdotca/hata/flags/ag.4x3";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><defs><clipPath id=\"hata-ag-4x3-a\"><path fill-opacity=\".7\" d=\"M-79.7 0H603v512H-79.7z\"/></clipPath></defs><g fill-rule=\"evenodd\" clip-path=\"url(#hata-ag-4x3-a)\" transform=\"translate(74.7)scale(.9375)\"><path fill=\"#fff\" d=\"M-79.7 0H603v512H-79.7z\"/><path fill=\"#000001\" d=\"M-79.6 0H603v204.8H-79.7z\"/><path fill=\"#0072c6\" d=\"M21.3 203.2h480v112h-480z\"/><path fill=\"#ce1126\" d=\"M603 .1V512H261.6L603 0zM-79.7.1V512h341.3L-79.7 0z\"/><path fill=\"#fcd116\" d=\"M440.4 203.3 364 184l64.9-49-79.7 11.4 41-69.5-70.7 41L332.3 37l-47.9 63.8-19.3-74-21.7 76.3-47.8-65 13.7 83.2L138.5 78l41 69.5-77.4-12.5 63.8 47.8L86 203.3z\"/></g></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/ag.4x3";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/ag.4x3";
console.log(svg.startsWith("<svg"),svg.length);true 686出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。