Quiq::Svg::Tag - Erzeuge SVG Markup-Code
Quiq::Tag
use Quiq::Svg::Tag; my $p = Quiq::Svg::Tag->new;
$svg = $p->cat( $p->preamble, $p->tag('svg', width => 80, height => 80, $p->tag('circle', cx => 40, cy => 40, r => 39, style => 'stroke: black; fill: none', ), ), );
erzeugt
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="80" height="80" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle cx="40" cy="40" r="39" style="stroke: black; fill: yellow" /> </svg>
was darstellt wird als
Anstelle eines Kreises kann jeder andere SVG-Code erzeugt werden.
Ein Objekt der Klasse erzeugt SVG Markup-Code beliebiger Komplexität. Dies geschieht durch systematische Anwendung der Methode $p->tag(), die in der Basisklasse Quiq::Tag definiert ist und hier in Quiq::Svg::Tag zur Erzeugung von SVG Markup überschrieben wurde.
Mozilla SVG Element Reference
$p = $class->new;
Objekt
Instantiiere ein Objekt der Klasse und liefere eine Referenz auf dieses Objekt zurück.
$svg = $p->preamble;
SVG-Vorspann (String)
Liefere die SVG-Präambel bestehend aus der "XML Processing Instruction" und der "DOCTYPE Declaration":
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
$svg = $p->tag($elem,@opts,@attrs); $svg = $p->tag($elem,@opts,@attrs,$content); $svg = $p->tag($elem,@opts,@attrs,'-',@content);
Siehe Quiq::Tag->tag()
SVG-Code (String)
Erzeuge einen SVG-Tag und liefere diesen zurück. Die Methode ruft die gleichnamige Basisklassenmethode auf und übergibt die SVG-spezifischen Element-Definitionen per Option -elements. Diese definieren die Default-Formatierung und die Default-Attribute einzelner SVG-Elemente. Details zur Methode siehe Quiq::Tag->tag().
-elements
1.189
Frank Seitz, http://fseitz.de/
Copyright (C) 2020 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Quiq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quiq
CPAN shell
perl -MCPAN -e shell install Quiq
For more information on module installation, please visit the detailed CPAN module installation guide.