Skip to main content

Types


RootBucket#

RootBucket is the top level bucket which represents one time slice in the timeseries data.

RootBucket {
t_start: string;
t_end: string;
entries: Bucket[];
}
FieldTypeDescription
t_startstringStart time of the data slice of your data bucket. It maps to the position of the bar's left side, if the data for bar is newly entering.
t_endstringEnd time of the data slice of your data bucket. It maps to the position of the bar's right side, if the data for bar is exiting.
entriesArray<Bucket>List of data buckets, where each item will map to an individual bar in the chart.

It represents one time slice (whose width maps to the time interval) of the entire timeseries data.

Bucket#

Bucket {
key: string;
start: number;
end: number;
data: unknown;
buckets?: Bucket[];
}
FieldTypeDescription
keystringKey of the bucket. Should be unique among its peer buckets.
startnumberStart time of the bucket data, in milliseconds. NOTE: This will automatically be filled and overwritten by monochron if you're working with TimeseriesChart. Only applicable if you're working with RealtimeChart.
endnumberEnd time of the bucket data, in milliseconds. NOTE: This will automatically be filled and overwritten by monochron if you're working with TimeseriesChart. Only applicable if you're working with RealtimeChart.
dataunknownData object of your entry. You can use this field to format your row as you like. In TypeScript you will need to cast this to your known type, i.e. const person = bucket.data as Person;
bucketsArray<Bucket>Optional. monochron supports recursive rows in the chart (i.e. rows in a row in a row, etc). Structure buckets if you're intending to do this.

It represents a single row (at whatever depth) in the chart.

RenderRowFunc#

type RenderRowFunc = (
value: Bucket,
RowComponent: (props: RowProps) => ReactElement
) => ReactNode;

The function you can use to format your row. See renderRow prop of TimeseriesChart or RealtimeChart.

Row#

<Row
key={key}
start={startTime}
end={endTime}
>
<p>My row</p>
</Row>

You cannot import and use Row directly. You will be passed this component in RenderRowFunc