Skip to content

foresight_backend_svg ​

foresight_backend_svg, SVG output device.

The document is streamed to <file>.tmp and renamed over <file> when the page ends, so a viewer polling <file> never reads a partial document. The plot area is a nested <svg class="fs-plot"> whose viewBox is the unit square: data geometry lives in unit coordinates, and vector-effect="non-scaling-stroke" keeps its line widths in pixels. Panels are <g class="fs-axes"> carrying their geometry and axis ranges as data-* attributes; decorations the interactive viewer regenerates are <g class="fs-..."> groups. The second y axis and the mirror settings add their attributes only when active or not the default, so a plain panel reads the same as before them.

Source: src/lib/foresight_backend_svg.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
PX_DECIMALSinteger(kind=I4P)parameterDecimals of pixel coordinates.
UNIT_DECIMALSinteger(kind=I4P)parameterDecimals of unit-square coordinates.
PAIRS_PER_LINEinteger(kind=I4P)parameterCoordinate pairs per output line.
FONT_FAMILYcharacter(len=*)parameterDefault font family.
IMAGE_ATTRIBUTEScharacter(len=*)parameterSharp pixels, any scale; the xlink namespace declared here, the root kept unchanged.
DIGIT_WIDTHreal(kind=R8P)parameterDigit width, between the vertical segment axes.
DIGIT_PITCHreal(kind=R8P)parameterDistance between the cells.
SEGMENT_WIDTHreal(kind=R8P)parameterSegment thickness, also the decimal point side.
POINT_OFFSETreal(kind=R8P)parameterDecimal point left side, from its cell.
SLANTreal(kind=R8P)parameterSlant: tan(8 deg), the bottom shifted left.
SEGMENT_GAPreal(kind=R8P)parameterGap between segment ends [segment thickness].

Derived Types ​

backend_svg ​

SVG output device.

Inheritance

Extends: backend_object

Components

NameTypeAttributesDescription
themetype(theme_object)Output theme: colors the layout's ones are mapped to (foresight_theme).
enhancedlogicalTexts read as gnuplot's enhanced text (foresight_enhanced).
latin1logicalTexts in ISO 8859-1, written in UTF-8 (set encoding iso_8859_1).
literallogicalThe texts written now as they are (an automatic title, noenhanced).
texlogicalTexts are LaTeX source, set by LaTeX (cairolatex): numbers in math mode.
text_sizereal(kind=R8P)Default font size of the texts [px].
boxedlogicalThe texts written now are boxed (gnuplot's textbox): on the background.
page_familycharacter(len=48)Font family of the page (set terminal ... font), empty: the device's.
fonttype(font_object)The font of the texts written now (gnuplot font "..."); unset parts the page's.
head_pxreal(kind=R8P)Length [px] and angle [deg] of the data arrowheads drawn now, 0 for the default head.
head_fixedlogicalThose heads keep their size on short arrows (gnuplot fixed).
glyphslogicalTexts drawn from the compiled-in glyphs (gnuplot-style fontglyphs: the same shapes as the PDF), each text kept transparent for selection; else by name.
glyph_faceinteger(kind=I4P)allocatableFace of each glyph drawn (fontglyphs).
glyph_numberinteger(kind=I4P)allocatableIts glyph index.
nglyphsinteger(kind=I4P)Glyphs drawn.
unitinteger(kind=I4P)Output unit.
filecharacter(len=:)allocatableFinal output file.
tmp_filecharacter(len=:)allocatableFile being written.
areareal(kind=R8P)Current plot area: left, top, width, height [px].
capscharacter(len=:)allocatableError bar caps of the current plot area, pixel overlay.
markscharacter(len=:)allocatablePoint type markers of the current plot area, pixel overlay.
spilllogicalA marker of the current plot area crosses its border.
headscharacter(len=:)allocatableArrowheads of the current plot area, pixel overlay.
labelscharacter(len=:)allocatableText labels of the data of the current plot area, pixel overlay.
patternsinteger(kind=I4P)Fill pattern definitions written.
pattern_keycharacter(len=:)allocatableKey of the last pattern definition (pattern, color, space).
seriesinteger(kind=I4P)Series of the open group, 0 for none.
textboxlogicalThe textbox filter is defined.

Type-Bound Procedures

NameAttributesDescription
rotates_textpass(self)Whether text can be rotated.
wants_scenepass(self)Whether 3D scenes are written.
scenepass(self)A 3D view's scene (JSON).
row_heightpass(self)Text row height, 0 if none.
begin_pagepass(self)Open the output file with a page of width x height px and the default font_size [px].
end_pagepass(self)Close the document and publish it atomically.
begin_axespass(self)Open a panel group carrying geometry and axis ranges as data-* attributes.
end_axespass(self)Close the panel group.
begin_grouppass(self)Open the group of class name; hidden with display="none" when visible is false; a series group carries its number as data-series, as do its overlay markers and caps; fs-crisp draws its shapes with crisp edges.
end_grouppass(self)Close the group.
rectpass(self)Rectangle of top-left corner (x, y) [px].
polylinepass(self)Open polyline through the points (x, y) [px].
dotspass(self)Filled round dots centred on the points (x, y) [px], or point type markers.
polygonpass(self)Closed polygon of the vertices (x, y) [px], filled and stroked; a ghost faintly filled only.
imagepass(self)Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px], an embedded PNG.
textpass(self)Text (text_raw), ISO 8859-1 texts in UTF-8 first (latin1).
text_rawpass(self)text without the ISO 8859-1 conversion.
begin_plot_areapass(self)Open the clipped plot area; its user space is the unit square, y upward.
end_plot_areapass(self)Close the plot area, then write the overlays of error bar caps and point type markers (pixel space, clipped to the plot area): they keep their pixel size under zoom, the interactive viewer regenerates them from the data.
data_polylinepass(self)Open polyline through the points (x, y) [unit square].
data_dotspass(self)Filled round dots centred on the points (x, y) [unit square], or point type markers.
data_barspass(self)Error bars [unit square] as one path of Mx1,y1Lx2,y2 segments, classed fs-ybars/fs-xbars with the cap length in data-cap; caps are queued for the pixel overlay written by end_plot_area.
data_polygonpass(self)Closed polygon of the vertices (x, y) [unit square], clipped by the plot area; its border keeps its pixel width under zoom.
data_imagepass(self)Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square], an embedded PNG in the plot area: zoomed with the data, its pixels kept sharp (pixelated).
text_widthpass(self)Width of string with its superscript sup [px], from the compiled-in fonts (foresight_font): the face of the texts written now (self%font, unset parts the page's family), kerned; the superscript at 0.75 size.
text_facepass(self)The compiled-in face (foresight_fontdata, 1-8) of the texts written now: self%font, its family the page's when unset (set terminal ... font, else Arial: the sans face).
readoutpass(self)Seven-segment readout of top-left corner (x, y) [px], a ``: the bold label above a glass slanted by 8 degrees, the unlit segments drawn faintly (GHOST_OPACITY), the unit text beside it.
readout_extentpass(self)Width and height [px] of a readout: label row, glass with its slant and segment overhangs, unit text.
data_arrowspass(self)Arrows [unit square]: the shafts as one path of Mx1,y1Lx2,y2 segments classed fs-vectors (the heads as data-head, data-filled), the heads queued for the pixel overlay written by end_plot_area, which the interactive viewer regenerates after a zoom.
pattern_fillpass(self)Fill of a polygon, a pattern defined if needed.
data_labelpass(self)Text at a data point (data_label_raw), ISO 8859-1 texts in UTF-8 first (latin1).
hoverpass(self)Text on mouse-over of a point: a transparent disk with its title.
front_areapass(self)The front layer of the plot area: an svg over the overlays.
pixmappass(self)A PNG image: an `` of the file as data.
data_label_rawpass(self)data_label without the ISO 8859-1 conversion.
close_filepass(self)Close the stream and publish the file atomically.
open_filepass(self)Open the stream on .tmp.
open_svgpass(self)Write the root `` start tag.
output_unitpass(self)Unit of the open stream.
putpass(self)Write a line.
write_pairspass(self)Write coordinate pairs.
glyph_grouppass(self)A text drawn from the glyphs (fontglyphs).
glyph_defspass(self)The definitions of the glyphs drawn (the HTML device's too).

backend_svg%rotates_text ​

Whether the device draws text rotated, as tick labels rotated by gnuplot: true but on text devices, which write them horizontally, as gnuplot's dumb terminal.

Attributes: pure

Returns: logical

fortran
function rotates_text(self) result(rotates)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

backend_svg%wants_scene ​

Whether the device writes the scene of a 3D view (the HTML page, for the viewer's mouse rotation): no.

Attributes: pure

Returns: logical

fortran
function wants_scene(self) result(wants)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

backend_svg%scene ​

The scene of a 3D view (foresight_scene3d's JSON), in the open panel: nothing on a device without a viewer.

fortran
subroutine scene(self, json)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inoutDevice.
jsoncharacter(len=*)inScene.

Call graph

backend_svg%row_height ​

Height of a text row of the device [px]: 0 on vector devices, where text sits anywhere.

Attributes: pure

Returns: real(kind=R8P)

fortran
function row_height(self) result(height)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

Subroutines ​

begin_page ​

Open the output file with a page of width x height px and the default font_size [px].

fortran
subroutine begin_page(self, file, width, height, font_size)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
filecharacter(len=*)inOutput file.
widthreal(kind=R8P)inPage width [px].
heightreal(kind=R8P)inPage height [px].
font_sizereal(kind=R8P)inDefault font size [px].

Call graph

end_page ​

Close the document and publish it atomically.

fortran
subroutine end_page(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

begin_axes ​

Open a panel group carrying geometry and axis ranges as data-* attributes.

fortran
subroutine begin_axes(self, view)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
viewtype(axes_view)inPanel geometry and axis ranges.

Call graph

end_axes ​

Close the panel group.

fortran
subroutine end_axes(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

begin_group ​

Open the group of class name; hidden with display="none" when visible is false; a series group carries its number as data-series, as do its overlay markers and caps; fs-crisp draws its shapes with crisp edges.

fortran
subroutine begin_group(self, name, visible, series)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
namecharacter(len=*)inGroup name.
visiblelogicalinoptionalGroup shown.
seriesinteger(kind=I4P)inoptionalSeries number.

Call graph

end_group ​

Close the group.

fortran
subroutine end_group(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

rect ​

Rectangle of top-left corner (x, y) [px].

fortran
subroutine rect(self, x, y, width, height, stroke, fill, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].
strokecharacter(len=*)inStroke color.
fillcharacter(len=*)inFill color.
line_widthreal(kind=R8P)inStroke width [px].

Call graph

polyline ​

Open polyline through the points (x, y) [px].

fortran
subroutine polyline(self, x, y, color, line_width, dasharray)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
dasharraycharacter(len=*)inSVG dash array, empty for solid.

Call graph

dots ​

Filled round dots centred on the points (x, y) [px], or point type markers.

fortran
subroutine dots(self, x, y, color, diameter, pt, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inFill color.
diameterreal(kind=R8P)inDot diameter, or marker width [px].
ptinteger(kind=I4P)inoptionalgnuplot point type; negative or absent: round dots.
line_widthreal(kind=R8P)inoptionalMarker line width [px], default gnuplot's (marker_line).

Call graph

polygon ​

Closed polygon of the vertices (x, y) [px], filled and stroked; a ghost faintly filled only.

fortran
subroutine polygon(self, x, y, fill, opacity, stroke, line_width, ghost)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inVertex abscissae [px].
yreal(kind=R8P)inVertex ordinates [px].
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell of a segmented fill.

Call graph

image ​

Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px], an embedded PNG.

fortran
subroutine image(self, x0, y0, x1, y1, rgba)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
x0real(kind=R8P)inLeft [px].
y0real(kind=R8P)inTop [px].
x1real(kind=R8P)inRight [px].
y1real(kind=R8P)inBottom [px].
rgbainteger(kind=I4P)inPixels.

Call graph

text ​

Text (text_raw), ISO 8859-1 texts in UTF-8 first (latin1).

fortran
subroutine text(self, x, y, string, anchor, sup, rotate, color)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inAnchor ordinate (baseline) [px].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
supcharacter(len=*)inoptionalSuperscript appended to string.
rotatereal(kind=R8P)inoptionalRotation.
colorcharacter(len=*)inoptionalText color.

Call graph

text_raw ​

Text whose baseline passes through the anchor point (x, y) [px], in color if given. Superscript. Color. Rotation.

fortran
subroutine text_raw(self, x, y, string, anchor, sup, rotate, color)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inAnchor ordinate (baseline) [px].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
supcharacter(len=*)inoptionalSuperscript appended to string.
rotatereal(kind=R8P)inoptionalRotation about the anchor point [deg, clockwise].
colorcharacter(len=*)inoptionalText color, the frame's if absent.

Call graph

begin_plot_area ​

Open the clipped plot area; its user space is the unit square, y upward.

fortran
subroutine begin_plot_area(self, x, y, width, height)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].

Call graph

end_plot_area ​

Close the plot area, then write the overlays of error bar caps and point type markers (pixel space, clipped to the plot area): they keep their pixel size under zoom, the interactive viewer regenerates them from the data.

fortran
subroutine end_plot_area(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

data_polyline ​

Open polyline through the points (x, y) [unit square].

fortran
subroutine data_polyline(self, x, y, color, line_width, dasharray)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissae [unit].
yreal(kind=R8P)inOrdinates [unit].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
dasharraycharacter(len=*)inSVG dash array, empty for solid.

Call graph

data_dots ​

Filled round dots centred on the points (x, y) [unit square], or point type markers.

Markers keep their shape only in pixels: the plot area holds their centres as an invisible fs-pts path of M moves (unit square) carrying the marker as data-* attributes, and the markers are queued for the pixel overlay written by end_plot_area, which the interactive viewer regenerates from the centres after a zoom.

fortran
subroutine data_dots(self, x, y, color, diameter, pt, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissae [unit].
yreal(kind=R8P)inOrdinates [unit].
colorcharacter(len=*)inFill color.
diameterreal(kind=R8P)inDot diameter, or marker width [px].
ptinteger(kind=I4P)inoptionalgnuplot point type; negative or absent: round dots.
line_widthreal(kind=R8P)inoptionalMarker line width [px], default gnuplot's (marker_line).

Call graph

data_bars ​

Error bars [unit square] as one path of Mx1,y1Lx2,y2 segments, classed fs-ybars/fs-xbars with the cap length in data-cap; caps are queued for the pixel overlay written by end_plot_area.

fortran
subroutine data_bars(self, x1, y1, x2, y2, color, line_width, cap, vertical)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
x1real(kind=R8P)inBar start abscissae.
y1real(kind=R8P)inBar start ordinates.
x2real(kind=R8P)inBar end abscissae.
y2real(kind=R8P)inBar end ordinates.
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
capreal(kind=R8P)inCap length [px].
verticallogicalinVertical bars (horizontal caps), else horizontal.

Call graph

data_arrows ​

Arrows [unit square]: the shafts as one path of Mx1,y1Lx2,y2 segments classed fs-vectors (the heads as data-head, data-filled), the heads queued for the pixel overlay written by end_plot_area, which the interactive viewer regenerates after a zoom.

fortran
subroutine data_arrows(self, x1, y1, x2, y2, color, line_width, head, filled)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
x1real(kind=R8P)inTail abscissae [unit].
y1real(kind=R8P)inTail ordinates [unit].
x2real(kind=R8P)inTip abscissae [unit].
y2real(kind=R8P)inTip ordinates [unit].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
headinteger(kind=I4P)inHeads: 0 none, 1 end, 2 start, 3 both.
filledlogicalinFilled heads.

Call graph

pixmap ​

The PNG image png (base64) with its top left corner at (x, y), width x height [px], stretched: an <image> holding the file, as gnuplot's svg set pixmap.

fortran
subroutine pixmap(self, x, y, width, height, png)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].
pngcharacter(len=*)inThe PNG file, base64.

Call graph

front_area ​

Open (opening) or close the front layer of the plot area: an svg of the plot area's geometry (fs-front, zoomed with it by the viewer) written after the overlays, so that gnuplot's front objects cover the markers.

fortran
subroutine front_area(self, opening, separate)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
openinglogicalinOpen, else close.
separatelogicaloutA layer of its own.

Call graph

hover ​

gnuplot's hypertext: text shown on mouse-over of the point (x, y) [unit square], a transparent disk of diameter [px] (at least 8) over the markers carrying it as its title (the browser's tooltip).

fortran
subroutine hover(self, x, y, text, diameter)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissa [unit].
yreal(kind=R8P)inOrdinate [unit].
textcharacter(len=*)inText.
diameterreal(kind=R8P)inSensitive disk [px].

Call graph

data_label ​

Text at a data point (data_label_raw), ISO 8859-1 texts in UTF-8 first (latin1).

fortran
subroutine data_label(self, x, y, string, anchor, rotate, color, dx, dy)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [unit].
yreal(kind=R8P)inAnchor ordinate [unit].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
rotatereal(kind=R8P)inRotation [deg, counterclockwise].
colorcharacter(len=*)inText color.
dxreal(kind=R8P)inHorizontal offset [px].
dyreal(kind=R8P)inVertical offset [px, downward].

Call graph

data_label_raw ​

Text anchored at a data point [unit square], queued for the pixel overlay of the labels: each fs-label text carries its anchor (data-u, data-v, unit square, y downward) and offset (data-dx, data-dy) for the interactive viewer to move it after a zoom.

fortran
subroutine data_label_raw(self, x, y, string, anchor, rotate, color, dx, dy)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [unit].
yreal(kind=R8P)inAnchor ordinate [unit].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
rotatereal(kind=R8P)inRotation [deg, counterclockwise].
colorcharacter(len=*)inText color.
dxreal(kind=R8P)inHorizontal offset [px].
dyreal(kind=R8P)inVertical offset [px, downward].

Call graph

data_polygon ​

Closed polygon of the vertices (x, y) [unit square], clipped by the plot area; its border keeps its pixel width under zoom.

fortran
subroutine data_polygon(self, x, y, fill, opacity, stroke, line_width, ghost)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inVertex abscissae [unit].
yreal(kind=R8P)inVertex ordinates [unit].
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell of a segmented fill.

Call graph

data_image ​

Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square], an embedded PNG in the plot area: zoomed with the data, its pixels kept sharp (pixelated).

fortran
subroutine data_image(self, x0, y0, x1, y1, rgba)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
x0real(kind=R8P)inLeft [unit].
y0real(kind=R8P)inBottom [unit].
x1real(kind=R8P)inRight [unit].
y1real(kind=R8P)inTop [unit].
rgbainteger(kind=I4P)inPixels.

Call graph

readout ​

Seven-segment readout of top-left corner (x, y) [px], a <g class="fs-readout">: the bold label above a glass slanted by 8 degrees, the unlit segments drawn faintly (GHOST_OPACITY), the unit text beside it.

fortran
subroutine readout(self, x, y, height, masks, label, prefix, suffix, color, font_size)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
heightreal(kind=R8P)inDigit height [px].
masksinteger(kind=I4P)inSegments of each cell.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
suffixcharacter(len=*)inText after the glass.
colorcharacter(len=*)inColor of the lit segments.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

glyph_defs ​

The definitions of the glyphs drawn: their outlines in font units, y upward (fontglyphs).

fortran
subroutine glyph_defs(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

close_file ​

Close the stream and rename <file>.tmp over <file>.

fortran
subroutine close_file(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

open_file ​

Open the output stream on <file>.tmp.

fortran
subroutine open_file(self, file)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
filecharacter(len=*)inOutput file.

Call graph

open_svg ​

Write the root <svg> start tag, with optional extra attributes (a leading space included).

fortran
subroutine open_svg(self, width, height, font_size, attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
widthreal(kind=R8P)inPage width [px].
heightreal(kind=R8P)inPage height [px].
font_sizereal(kind=R8P)inDefault font size [px].
attributescharacter(len=*)inoptionalExtra attributes.

Call graph

put ​

Write a complete line.

fortran
subroutine put(self, line)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
linecharacter(len=*)inLine.

Call graph

write_pairs ​

Write prefix x,y suffix for each point, space separated, PAIRS_PER_LINE per line, without final newline.

fortran
subroutine write_pairs(self, x, y, ndec, prefix, suffix)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAbscissae.
yreal(kind=R8P)inOrdinates.
ndecinteger(kind=I4P)inDecimals.
prefixcharacter(len=*)inText before each pair.
suffixcharacter(len=*)inText after each pair.

Call graph

Functions ​

pattern_fill ​

Paint of the fill of a polygon: the fill itself, or for a pattern fill (foresight_style fill_color) a reference to its definition, written before the polygon (once while pattern, color, width and space do not change): an 8 px tile of gnuplot's svg terminal, in page pixels or (unit) mapped to the unit square of the plot area, its lines as wide as the polygon's border (gnuplot's tile inherits the line width in effect; 1 px without).

Returns: character(len=:)

fortran
function pattern_fill(self, fill, unit, line_width) result(paint)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
fillcharacter(len=*)inFill color, or pattern fill.
unitlogicalinThe polygon is in the unit square of the plot area.
line_widthreal(kind=R8P)inBorder width [px], not positive without a border.

Call graph

textbox_attribute ​

The filter attribute of a boxed text, gnuplot's svg textbox: the background flooding the text's bounding box (no border, no margin, as gnuplot's svg terminal draws it); the filter defined once, before its first use.

Returns: character(len=:)

fortran
function textbox_attribute(self) result(attribute)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.

Call graph

text_width ​

Width of string with its superscript sup [px], from the compiled-in fonts (foresight_font): the face of the texts written now (self%font, unset parts the page's family), kerned; the superscript at 0.75 size.

Attributes: pure

Returns: real(kind=R8P)

fortran
function text_width(self, string, sup, font_size) result(width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.
stringcharacter(len=*)inText.
supcharacter(len=*)inSuperscript.
font_sizereal(kind=R8P)inFont size [px].

Call graph

text_face ​

The compiled-in face (foresight_fontdata, 1-8) of the texts written now: self%font, its family the page's when unset (set terminal ... font, else Arial: the sans face).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function text_face(self) result(face)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.

Call graph

readout_extent ​

Width and height [px] of a readout: label row, glass with its slant and segment overhangs, unit text.

Attributes: pure

Returns: real(kind=R8P)

fortran
function readout_extent(self, height, cells, label, prefix, suffix, font_size) result(extent)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.
heightreal(kind=R8P)inDigit height [px].
cellsinteger(kind=I4P)inGlass cells.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
suffixcharacter(len=*)inText after the glass.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

glyph_group ​

The glyphs of string and its superscript sup (foresight_textlayout), the baseline through (x, y) [px] anchored by anchor, rotated by rotate [deg, clockwise]: a group of <use> of the glyph definitions, filled with color (the page's text color if empty).

Returns: character(len=:)

fortran
function glyph_group(self, x, y, string, anchor, sup, rotate, color) result(group)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inBaseline [px].
stringcharacter(len=*)inText, UTF-8.
anchorcharacter(len=*)instart, middle or end.
supcharacter(len=*)inSuperscript, empty for none.
rotatereal(kind=R8P)inRotation [deg, clockwise].
colorcharacter(len=*)inFill, empty for the page's.

Call graph

output_unit ​

Unit of the open output stream.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function output_unit(self) result(unit)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.

Call graph

marker_element ​

One <path> of the markers of gnuplot point type pt, width_px px wide, centred on the points (x, y) [px]: the filled shapes (the odd types from 5, and the dot) are filled with color, the others stroked only.

Returns: character(len=:)

fortran
function marker_element(x, y, color, width_px, pt, line_width, series) result(element)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inColor.
width_pxreal(kind=R8P)inMarker width [px].
ptinteger(kind=I4P)ingnuplot point type, >= 0.
line_widthreal(kind=R8P)inoptionalLine width [px], default gnuplot's (marker_line).
seriesinteger(kind=I4P)inoptionalSeries number, 0 or absent for none.

Call graph

marker_line ​

gnuplot's svg marker line [px]: the symbols are drawn 0.222 of their half width wide whatever the line width (about ps px), the dot (type 0) 0.5 px.

Attributes: elemental

Returns: real(kind=R8P)

fortran
function marker_line(width_px, pt) result(width)

Arguments

NameTypeIntentAttributesDescription
width_pxreal(kind=R8P)inMarker width [px].
ptinteger(kind=I4P)ingnuplot point type, >= 0.

Call graph

marker_path ​

Path data of a marker of half width r centred on (x, y) [px]: gnuplot's svg shapes, 1 plus, 2 cross, 3 star, 4-5 square, 6-7 circle, 8-9 triangle, 10-11 inverted triangle, 12-13 diamond, 14-15 pentagon, 0 a 1 px dot.

Attributes: pure

Returns: character(len=:)

fortran
function marker_path(x, y, r, shape) result(d)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inCentre abscissa [px].
yreal(kind=R8P)inCentre ordinate [px].
rreal(kind=R8P)inHalf width [px].
shapeinteger(kind=I4P)inShape, 0..15.

Call graph

glass_geometry ​

Glass of a readout of top-left corner (x, y): origin of its first cell (left, top of the digits), width up to the last decimal point, the prefix width and the label row height [px]. The origin leaves room for the slant of the digit bottoms and for the half thickness of the segments.

Attributes: pure

Returns: real(kind=R8P)

fortran
function glass_geometry(self, x, y, height, cells, label, prefix, font_size) result(geometry)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
heightreal(kind=R8P)inDigit height [px].
cellsinteger(kind=I4P)inGlass cells.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

segment_path ​

Path data of the hexagon of segment (0-6: a, b, c, d, e, f, g) of the cell of left side ox, digits height px high, in glass coordinates (origin at the top left of the first cell).

Attributes: pure

Returns: character(len=:)

fortran
function segment_path(ox, segment, height) result(d)

Arguments

NameTypeIntentAttributesDescription
oxreal(kind=R8P)inCell left [px].
segmentinteger(kind=I4P)inSegment, 0-6.
heightreal(kind=R8P)inDigit height [px].

Call graph

polygon_paint ​

Paint attributes of a polygon in the theme colors; a ghost (an unlit cell) at the theme ghost opacity, no border.

Attributes: pure

Returns: character(len=:)

fortran
function polygon_paint(self, fill, opacity, stroke, line_width, ghost) result(attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell.

Call graph

glow_attribute ​

filter="url(#fs-glow)" with a glowing theme, else nothing.

Attributes: pure

Returns: character(len=:)

fortran
function glow_attribute(self) result(attribute)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_svg)inDevice.

Call graph

paint ​

Fill and stroke attributes of a polygon: fill-opacity only below 1, the stroke width only with a stroke.

Attributes: pure

Returns: character(len=:)

fortran
function paint(fill, opacity, stroke, line_width) result(attributes)

Arguments

NameTypeIntentAttributesDescription
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].

Call graph

dash_attribute ​

stroke-dasharray="..." attribute, empty for solid lines.

Attributes: pure

Returns: character(len=:)

fortran
function dash_attribute(dasharray) result(attribute)

Arguments

NameTypeIntentAttributesDescription
dasharraycharacter(len=*)inSVG dash array.

Call graph

series_attribute ​

data-series="N" attribute.

Attributes: pure

Returns: character(len=:)

fortran
function series_attribute(series) result(attribute)

Arguments

NameTypeIntentAttributesDescription
seriesinteger(kind=I4P)inSeries number.

Call graph

flag ​

1 or 0.

Attributes: pure

Returns: character(len=:)

fortran
function flag(value) result(str)

Arguments

NameTypeIntentAttributesDescription
valuelogicalinFlag.

Call graph

px ​

Pixel coordinate text.

Attributes: pure

Returns: character(len=:)

fortran
function px(v) result(str)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inValue [px].

Call graph

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.