React-sim
GitHub

Time Series is a frame helper with which you can plot some changes in your data object during your simulation.

0
100

In this example, we are throwing 2 dice 100 times, and we are plotting the average value of the roll during the process. We are also looking at the distribution of the rolls.

Series parameter

TimeSeries, Counter and Indicator all rely on a parameter called series.

TimeSeries and Counter can take either an array of series or a single series, Indicator only takes a single series.

series is an object with three properties:

NameDescription
label
string
Describes the series,
color
string
Color of the series,
accessor
function
Function that turns a data object into the value that you want to plot.

TimeSeries

NameDescription
series
series object or array
Either a single series object or an array of series. the accessor function is going to be called on every item in cachedData and the result will be plotted.
stacked
boolean, default: false
If true, represents the time series as full-height, stacked area charts. If false, the series are line charts.
height
number, optional
Height of the chart.
padding
number, optional
Padding of the chart.
width
number, optional
Width of the chart.

Counter

NameDescription
series
series object or array
Either a single series object or an array of series. the accessor function is going to be called on every item in data and a single number will be shown per series.
height
number, optional
Height of the counter card.
padding
number, optional
Padding of the counter card.
width
number, optional
Width of the counter card.

Indicator

NameDescription
series
series object or array
A single series object. The accessor function is going to be called on every item in data and a single number will be shown per series.
height
number, optional
Height of the indicator card.
padding
number, optional
Padding of the indicator card.
width
number, optional
Width of the indicator card.
Edit this page on GitHub
Previous:
Grid
Next:
API Reference
React-SimGitHub