File "vector"
This file provides means the generate and interact with scalable
vector graphics. The output predicates require a markup writer as
found in library(misc/markup), either explicit as a parameter or
implicit as current output. The SVG output area will have 500x400
SVG coordinate dimension and a twelfth of it in relative font size
as browser dimension.
The following vector predicates are provided:
svg_begin(L):
svg_begin(S, L):
- The predicate succeeds. As a side effect a new SVG output
area with options in L. The binary predicate allows specifying a
markup writer S. The following begin options are recognized
- height(H): The relative height H in percent, default is 100.
- width(W): The relative width W in percent, default is 100.
- style(S): The style sheet S to include, default is ''.
- svg_end:
svg_end(S):
- The predicate succeeds. As a side effect the SVG output area
is closed. The unary predicate allows specifying a markup writer
S.
- svg_group_begin(X, Y, A):
svg_group_begin(S, X, Y, A):
- The predicate succeeds. As a side effect a SVG group with
translation X,Y and rotation A is created. The quaternary
predicate allows specifying a markup writer S.
- svg_group_end:
svg_group_end(S):
- The predicate succeeds. As a side effect the SVG group is
closed. The unary predicate allows specifying a markup writer S.
- svg_rect(X, Y, W, H, L):
svg_rect(S, X, Y, W, H, L):
- The predicate succeeds. As a side effect a rectangle element
at (X,Y) with dimension (W,H) and style L is added to the SVG
output area. The septenary predicate allows specifying a DOM
writer. The following style options are supported:
class(C): Use the classes C for the element.
style(S): Use the style S for the element.
- svg_line(X1, Y1, X2, Y2, L):
svg_line(S, X1, Y1, X2, Y2, L):
- The predicate succeeds. As a side effect a line element from
(X1,Y1) to (X2,Y2) with style L is added to the SVG output area.
The septenary predicate allows specifying a markup writer S.
- svg_text(X, Y, T, L):
svg_text(S, X, Y, T, L):
- The predicate succeeds. As a side effect a text element at
(X,Y) with content T and style L is added to the SVG output
area. The pentamery predicate allows specifying a markup writer
S.
- svg_circle(X, Y, R, L):
svg_circle(S, X, Y, R, L):
- The predicate succeeds. As a side effect a circle element
(X,Y) with radius R and style L is added to the SVG output area.
The pentamery predicate allows specifying a markup writer S.
- svg_path(P, L):
svg_path(S, P, L):
- The predicate succeeds. As a side effect a path element with
shape P and style L is added to the SVG output area. The ternary
predicate allows specifying a markup writer S.
- svg_image(X, Y, W, H, U):
svg_image(S, X, Y, W, H, U):
- The predicate succeeds. As a side effect an image element at
(X,Y) with width W, height H and image URL U s added to the SVG
output area. The sixternary predicate allows specifying a markup
writer S.
- svg_view_inverse(E, I):
- The predicate succeeds in I with the inverse transform of the
element E.
- svg_apply_transform(I, CX, CY, SX, SY):
- The predicate succeeds in the viewport coordinates (SX,SY)
with the inverse transform I applied to the client coordinates
(CX,CY).
Kommentare