Skip to main content

Module chart_export

Module chart_export 

Source
Expand description

Chart export: the chart is drawn once as SVG, in the bundled font (IBM Plex Sans, under the SIL Open Font License, in assets/fonts), then written as SVG with its text as outlines, rasterized to PNG, or written as PDF from the same outlines (chart_pdf). The same figure comes out the same on every machine; text the bundled font lacks falls back to a system font.

Structs§

ChartExportRequest
What a chart export asks for: where, in what format, how.
ExportOptions
How an export is made: its size, colors, legend and words.
Figure
A chart ready to draw: what it plots, and what it says about its rows (a sample, values a range left out).
Palette
The colors a figure is drawn in.
Rgb
An sRGB color.

Enums§

ChartExportFormat
Export format for a chart.
ExportStyle
The colors an export is drawn in.
LegendPlace
Where the series are named.
LineWidth
A line chart’s stroke.
PointOpacity
How opaque a scatter’s points are.
PointSize
A scatter point’s radius.
SizePreset
A size an export is made at: pixels, and the resolution that makes them a physical size (a PDF’s page, an SVG’s inches, the text’s points).

Constants§

RECIPE_KEY
The key a recipe is kept under: a PNG chunk’s keyword, the SVG element’s name, the PDF’s info entry.
SERIES
Series colors a palette has: as many as the theme’s chart slots.

Functions§

auto_opacity
Opaque up to 1,000 points, 0.15 from 100,000, and between them along the log of the count: each tenfold more points is drawn as much fainter.
recipe_in
The recipe an exported chart carries, if it carries one.
render
The figure in format, as the bytes of the file.
svg
The SVG for figure, before its text is set.