Widget:Svg

From Disaster Risk Gateway
Revision as of 14:25, 20 February 2025 by Myriad-admin (talk | contribs) (Created page with "{{Widget |description=Allows you to embed a Scalable Vector Graphics (SVG) image (img tag using inline markup encoded for data url scheme) on a page. |author=DSquirrelGM |status=active |security=checked }} <noinclude>__NOTOC__ This widget allows you to embed a '''[https://www.w3.org/TR/SVG11/ Scalable Vector Graphics]''' image (img tag using inline markup encoded for data url scheme) on your wiki page. Written by DSquirrelGM. ==Copy to your site==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Widget

This widget allows you to embed a Scalable Vector Graphics image (img tag using inline markup encoded for data url scheme) on your wiki page.

Written by DSquirrelGM.

Copy to your site

To use this widget on your site, install the Widgets extension and copy the full source code of this page to your wiki as Widget:Svg article.

Usage

Refer to the SVG specification for the use of these attributes: width, height, viewBox, preserveAspectRatio, x, y, version

width   horizontal image size   100%
height   vertical image size   100%
version   specification version   1.1
x   horizontal origin (ignored on top level element)   0
y   vertical origin (ignored on top level element)   0
preserveAspectRatio   Aspect ratio adjustment   xMidYMid meet
viewBox   viewport extents   0 0 100% 100%
content   SVG markup to be embedded
url   (set a value to use url() scheme instead of img tag)

Sample results

Example 1
Error in widget SVG: Unable to load template 'wiki:SVG'
Example 2

<div style="background:

Error in widget SVG: Unable to load template 'wiki:SVG'

transparent;">1 2 3
4 5 6

Template:Comments