Home > plot

plot package#

A simple and forgiving chart plotting library for JavaScript and TypeScript.

Example 1#

const data = [10, 30, 15, 45]; // Array of numbers.
plot(data)
.renderImage("./myplot.png"); // Need @plotex/render-image installed for this.

Example 2#

const htmlElement = ...; // An element in the DOM.
const data = [10, 30, 15, 45]; // Array of numbers.
plot(data)
.renderDOM(htmlElement); // Need @plotex/render-dom installed for this.

Functions#

FunctionDescription
plot(input, plotDef, axisMap)Create a plot from regular JavaScript data.

Interfaces#

InterfaceDescription
IAnnotationSpecAnnotations to render on the chart for each named data series.
IAxisConfigConfigures an axis of the chart.
IAxisMapMaps the columns in a dataframe to an axis in the chart.
IDataSpecSpecifes data to be rendered on the chart in values/annotations form.
IMultiSeriesSpecA collection of named data series.Add your named data series as fields in this object.
IPlotAPIFluent API for configuring the plot.
IPlotConfigDefines the configuration for the chart.
ISeriesSpecA single data series with optional annotations.
IXAxisConfigConfigures the X axis of the chart.
IYAxisConfigConfigures a Y axis of the chart.
IYAxisSeriesConfigRelates a single Y axis to data series.

Type Aliases#

Type AliasDescription
PlotInputInputs data to the plot function.
SeriesSpecA single data series.Can be an array of values or an ISeriesSpec object.
ValueArrayA simple array of primitive values or an array of objects (with fields that have primitive values).