Expand description
§Mondrian Charts
§Representation
A Mondrian chart is represented using the MondrianChart<S, P> type. This
type has two generic arguments, S and P:
Srefers to the type of series data from which the chart was generated.Prefers to the type of data points from which the chart was generated.
Within the chart are shape lists (one for each series of type S), which are
used to contain shapes. Shapes are used to visualize data points,
although it differs per type of shape whether that shape is used to represent a
single data point or multiple.
Whenever a chart is rendered to its output format, all the shapes in a given shape list are usually rendered in the same color. If you want to render a legend along with the chart, a single shape list would correspond to a single item in the legend.
X and Y axis of a chart are represented using the Axis type.
§Generation
To generate Mondrian charts, use the generate() or
generate_from_timeseries() functions.
Currently, this crate only contains generators to create charts from Fiberplane data types, although we welcome contributions to generate charts from other types.
§Rendering
Use the chart_to_image() function to render a static image file, such as
a PNG file. All image formats from the image crate are supported.
Charts can also be serialized to SVG using the chart_to_svg() function.
Currently, all images are first converted to SVG before being rendered to a
binary format, although this may change in the future.
§Features
This crate offers the following feature flags, all of which are enabled by default:
fiberplane: Supports generating charts from Fiberplane data type.image: Supports rendering charts to static images, such as PNGs.svg: Supports serializing charts to SVG strings.
Re-exports§
pub use resvg::usvg::fontdb;
Structs§
- Area
- An area to be drawn between two lines that share their X coordinates.
- Area
Point - A single data point in an area shape.
- Axis
- Defines the range of values that are displayed along a given axis.
- Chart
Options - Options used for rendering charts.
- Combined
Source Data - All the data necessary to generate an abstract chart from a combination of timeseries data, events and an optional target latency.
- Image
Options - Options for generating an image from a Mondrian chart.
- Line
- A line to be drawn between two or more points.
- Metric
- A single metric value.
- Mondrian
Chart - An abstract chart with information about what to render and where to render it.
- Point
- A single point in the chart.
- Provider
Event - A single event that is used within providers.
- Rectangle
- A rectangle to be rendered inside the chart.
- Shape
List - List of shapes that belongs together.
- Time
Range - A range in time from a given timestamp (inclusive) up to another timestamp (exclusive).
- Timeseries
- A series of metrics over time, with metadata.
- Timeseries
Source Data - All the data necessary to generate an abstract chart from an array of timeseries.
- Timestamp
Enums§
- Formatter
Kind - Graph
Type - Image
Error - The generic error type for image operations.
- Image
Format - An enumeration of supported image formats. Not all formats support both encoding and decoding.
- Image
Rendering Error - Point
Source - Source type for points in charts that contain combined data sources.
- Series
Source - Source type for series in charts that contain combined data sources.
- Shape
- An abstract shape used to visualize data points.
- Stacking
Type
Functions§
- chart_
to_ image - chart_
to_ svg - generate
- Generates an abstract chart from a combination of timeseries data, events and an optional target latency.
- generate_
from_ timeseries - Generates an abstract chart from the given timeseries data.