# react-timeseries-table **Repository Path**: mirrors_esnet/react-timeseries-table ## Basic Information - **Project Name**: react-timeseries-table - **Description**: Got a TimeSeries? Build a Table. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # React Timeseries Table This library contains a `Table` component for rendering [pond.js](http://software.es.net/pond) TimeSeries objects. The library is used on the public facing [ESnet Portal](http://my.es.net). Getting started --------------- This library is intended to be installed with [npm](https://www.npmjs.com/) and the built into your project with a tool like [Webpack](https://webpack.github.io/). It expects React to be present, as well as our TimeSeries abstraction library, [pond.js](http://software.es.net/pond). More on this library below. To install: npm install react-timeseries-table pondjs --save Once installed, you can import the `Table` component from the library: import Table from "react-timeseries-table"; Then we construct our table in the `render()` function of our component. For a simple example let's create a table from some network availability data. The first step is to take our data and construct a new `TimeSeries` object. The pond.js constructor uses a pretty simple format. Just supply a name, the columns and list of points. For the columns, the first column should be either "index" for a string based time range (such as a month, as shown below), or "time", for a timestamp (represented by number of ms since the epoch): const availability = new TimeSeries({ "name": "availability", "columns": ["index", "uptime", "notes", "outages"], "points": [ ["2015-06", 100, "", 0], ["2015-05", 92, "Router failure June 12", 26], ["2015-04", 87, "Planned downtime in April", 82], ["2015-03", 99, "Minor outage March 2", 4], ... ] }); Now that we have a TimeSeries made from our data, we need to define what our table will look like. We do this by defining our columns. This maps our data into our table: const columns = [ {key: "time", label: "Timestamp"}, {key: "uptime", label: "Availability"}, {key: "outages", label: "Outages", format: "04d"} ]; Then we can render our table: