Module:SVG example/doc
Uiterlijk
(MediaWiki:Scribunto-doc-page-header)
Dit is de documentatiepagina voor Module:SVG example.
- This module is meant to demonstrate the syntax of mw.svg.new() for use in Extension:Scribunto. (@ mediawiki)
Cirkel
Wikicode
{{#Invoke:SVG example|drawCircle}}
Lua
local p = {}
function p.drawCircle()
local svg = mw.svg.new()
return svg:setAttribute( 'width', '100px' )
:setAttribute( 'height', '100px' )
:setContent( '<circle cx="50" cy="50" r="45" style="fill:green;" />' )
:setImgAttribute( 'alt', 'SVG image' )
:toImage() -- Gives the image
end
return p
Resultaat
Grafiek
Wikicode
{{#Invoke:SVG example|drawGraph}}
Lua
- (zie Module:SVG example)
Resultaat