Skip to main content

Crate chartlet

Crate chartlet 

Source

Modules§

qr
QR codes: encode text into a module matrix and draw it as SVG.

Structs§

BuiltinMetrics
CalendarDay
One day of a calendar heatmap.
CalendarSpec
A calendar heatmap of one year.
CartoucheSpec
The legend box printed on the map: heading, metadata line, and its corner.
CategoryAxisSpec
ChartError
ChartSpec
ChartWarning
DataPoint
DataTable
A chart’s data table as text, values written as the chart writes them.
LayerSpec
One layer of a pane. Which fields apply depends on mark; anything that belongs to a different mark is rejected with a path, never ignored.
Manifest
The provenance of one render: which version of chartlet produced which output from which specification, with which options and warnings. It carries no timestamp, so the same render always yields the same manifest.
MobileSpec
The size of the mobile variant, and the container width below which the HTML profile shows it instead of the chart at width × height.
OhlcPoint
One candlestick of an ohlc layer.
PaneSpec
One pane of a time chart: a value axis over the shared time axis, with its own layers.
RangeSpec
One span of a rangebar chart: a category with a low and a high value and, optionally, a central estimate.
ReferenceSpec
A reference line across a bar chart: a value every bar is read against.
RenderOptions
RenderOutput
SeriesSpec
One named series with one value per category; None marks a missing value.
StripesSpec
Warming stripes: one colored stripe per year.
TextAlternative
What a chart says without its graphic: the description its SVG carries and the data table of its HTML profile, as text, for hosts that build their own accessible wrapper around the SVG.
TimeAxisSpec
TimePoint
One observation of a line or area layer.
TopicLinkSpec
A neighborhood between two topics, drawn as a route.
TopicMapSpec
TopicSpec
One topic (or island) of a topicmap chart.
ValueAxisSpec
ZoomStep
A pre-computed zoom step: shows categories from..=to, or on a time chart the observations from from to to, as its own chart variant.

Enums§

AxisScale
How a value axis spaces its values.
CalendarLayout
How a calendar arranges the days of its year.
ChartType
Corner
Which corner of the canvas a cartouche is anchored to.
Curve
How a line or an area runs from one observation to the next.
Dash
The pattern of a line.
Gaps
Whether the time axis leaves a gap where an observation is missing, or collapses it.
LegendPlacement
Where a time chart names its series.
Mark
How a layer draws its data.
Orientation
RenderFormat
Shape
A marker shape for annotating a single point.
Stack
How the series of a bar chart share a category: stacked by value, or as shares of the category’s total.
Stroke
The weight of a line.
Styles
Where a chart’s styles live.
TableMode
Theme
The palette a chart is rendered in. Both palettes are expressed as CSS custom properties, so a host page can override any single color.
TimeAxisKind
What the positions of a time axis are: calendar timestamps, or plain numbers such as a distance, a depth or an age in millions of years.
TimePrecision
The precision a time axis names its observations in.
Tooltips
Which observations of a type: "time" chart carry a tooltip.
ValueFormat
Variant
Which layout the SVG profile renders. The HTML profile always carries the chart and, when the specification has one, its mobile variant.
ZoomBound
One end of a zoom step: a category index on a bar or line chart, a timestamp on a time chart. A whole number from 0 up reads as an index first, so that a category chart keeps its serialized form; on a time chart the same number is Unix seconds.

Traits§

TextMetrics

Functions§

render
Validates and renders an already parsed chart specification.
render_json
Parses and renders a chart specification.
render_with_metrics
Renders with caller-provided deterministic text metrics.
sha256
The SHA-256 digest of message, as FIPS 180-4 defines it. The working variables keep the standard’s one-letter names so the round function can be read against the specification.
stylesheet
The stylesheet every chart rendered with Styles::External relies on. It is the same for every chart, so a site serves it once as a cacheable file.
stylesheet_common
The part of the shared stylesheet that every chart relies on, whatever its type: colors, text, grid and axes. A page that loads type parts separately loads this part first.
stylesheet_for
The shared stylesheet with only the rules of chart_types: enough for a site that renders no other types. It is stylesheet_common followed by stylesheet_types, and the part of each type comes in the order of chart_types.
stylesheet_types
The parts of the shared stylesheet that only charts of chart_types use, without the common part. Each type’s rules style only charts of that type, so the parts of separate calls can be loaded as separate files, in any order, after stylesheet_common.
text_alternative
Validates a chart specification and returns its text alternative.