class Svg extends XMLWriter (View source)

This Class inherits the XMLwriter class and helps in developing structure of SVG Schema Export

Properties

string $title
string $author
string $font
int $fontSize

Methods

__construct()

Upon instantiation This starts writing the RelationStatsSvg XML document

void
setTitle(string $value)

Set document title

void
setAuthor(string $value)

Set document author

void
setFont(string $value)

Set document font

string
getFont()

Get document font

void
setFontSize(int $value)

Set document font size

int
getFontSize()

Get document font size

void
startSvgDoc(int|float $width, int|float $height, int|float $x = 0, int|float $y = 0)

Starts RelationStatsSvg Document

void
endSvgDoc()

Ends RelationStatsSvg Document

string
getOutputData()

No description

void
printElement(string $name, int|float $x, int|float $y, int|float $width, int $height, string|null $text = '', string $styles = '')

Draws RelationStatsSvg elements

void
printElementLine(string $name, int|float $x1, int|float $y1, int|float $x2, int|float $y2, string $styles)

Draws RelationStatsSvg Line element

Details

__construct()

Upon instantiation This starts writing the RelationStatsSvg XML document

See also

\XMLWriter::openMemory()
\XMLWriter::setIndent()
\XMLWriter::startDocument()

void setTitle(string $value)

Set document title

Parameters

string $value

sets the title text

Return Value

void

void setAuthor(string $value)

Set document author

Parameters

string $value

sets the author

Return Value

void

void setFont(string $value)

Set document font

Parameters

string $value

sets the font e.g Arial, Sans-serif etc

Return Value

void

string getFont()

Get document font

Return Value

string

returns the font name

void setFontSize(int $value)

Set document font size

Parameters

int $value

sets the font size in pixels

Return Value

void

int getFontSize()

Get document font size

Return Value

int

returns the font size

void startSvgDoc(int|float $width, int|float $height, int|float $x = 0, int|float $y = 0)

Starts RelationStatsSvg Document

svg document starts by first initializing svg tag which contains all the attributes and namespace that needed to define the svg document

Parameters

int|float $width

total width of the RelationStatsSvg document

int|float $height

total height of the RelationStatsSvg document

int|float $x

min-x of the view box

int|float $y

min-y of the view box

Return Value

void

See also

\XMLWriter::startElement()
\XMLWriter::writeAttribute()

void endSvgDoc()

Ends RelationStatsSvg Document

Return Value

void

See also

\XMLWriter::endElement()
\XMLWriter::endDocument()

string getOutputData()

No description

Return Value

string

void printElement(string $name, int|float $x, int|float $y, int|float $width, int $height, string|null $text = '', string $styles = '')

Draws RelationStatsSvg elements

SVG has some predefined shape elements like rectangle & text and other elements who have x,y co-ordinates are drawn. specify their width and height and can give styles too.

Parameters

string $name

RelationStatsSvg element name

int|float $x

The x attr defines the left position of the element (e.g. x="0" places the element 0 pixels from the left of the browser window)

int|float $y

The y attribute defines the top position of the element (e.g. y="0" places the element 0 pixels from the top of the browser window)

int|float $width

The width attribute defines the width the element

int $height

The height attribute defines the height the element

string|null $text

The text attribute defines the text the element

string $styles

The style attribute defines the style the element styles can be defined like CSS styles

Return Value

void

See also

\XMLWriter::startElement()
\XMLWriter::writeAttribute()
\XMLWriter::text()
\XMLWriter::endElement()

void printElementLine(string $name, int|float $x1, int|float $y1, int|float $x2, int|float $y2, string $styles)

Draws RelationStatsSvg Line element

RelationStatsSvg line element is drawn for connecting the tables. arrows are also drawn by specify its start and ending co-ordinates

Parameters

string $name

RelationStatsSvg element name i.e line

int|float $x1

Defines the start of the line on the x-axis

int|float $y1

Defines the start of the line on the y-axis

int|float $x2

Defines the end of the line on the x-axis

int|float $y2

Defines the end of the line on the y-axis

string $styles

The style attribute defines the style the element styles can be defined like CSS styles

Return Value

void

See also

\XMLWriter::startElement()
\XMLWriter::writeAttribute()
\XMLWriter::endElement()