Crate mondrian_charts

Crate mondrian_charts 

Source
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:

  • S refers to the type of series data from which the chart was generated.
  • P refers 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.
AreaPoint
A single data point in an area shape.
Axis
Defines the range of values that are displayed along a given axis.
ChartOptions
Options used for rendering charts.
CombinedSourceData
All the data necessary to generate an abstract chart from a combination of timeseries data, events and an optional target latency.
ImageOptions
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.
MondrianChart
An abstract chart with information about what to render and where to render it.
Point
A single point in the chart.
ProviderEvent
A single event that is used within providers.
Rectangle
A rectangle to be rendered inside the chart.
ShapeList
List of shapes that belongs together.
TimeRange
A range in time from a given timestamp (inclusive) up to another timestamp (exclusive).
Timeseries
A series of metrics over time, with metadata.
TimeseriesSourceData
All the data necessary to generate an abstract chart from an array of timeseries.
Timestamp

Enums§

FormatterKind
GraphType
ImageError
The generic error type for image operations.
ImageFormat
An enumeration of supported image formats. Not all formats support both encoding and decoding.
ImageRenderingError
PointSource
Source type for points in charts that contain combined data sources.
SeriesSource
Source type for series in charts that contain combined data sources.
Shape
An abstract shape used to visualize data points.
StackingType

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.