How to use the pondjs.TimeSeries function in pondjs

To help you get started, we’ve selected a few pondjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esnet / react-timeseries-charts / src / website / examples / stockchart / Index.js View on Github external
const name = "AAPL-price";
const columns = ["time", "open", "close", "low", "high"];
const events = aapl.map(item => {
    const timestamp = moment(new Date(item.date));
    const { open, close, low, high } = item;
    return new TimeEvent(timestamp.toDate(), {
        open: +open,
        close: +close,
        low: +low,
        high: +high
    });
});
const collection = new Collection(events);
const sortedCollection = collection.sortByTime();
const series = new TimeSeries({ name, columns, collection: sortedCollection });

//
// Volume
//

const volumeEvents = aapl.map(item => {
    const index = item.date.replace(/\//g, "-");
    const { volume } = item;
    return new IndexedEvent(index, { volume: +volume });
});
const volumeCollection = new Collection(volumeEvents);
const sortedVolumeCollection = volumeCollection.sortByTime();

const seriesVolume = new TimeSeries({
    name: "AAPL-volume",
    utc: false,
github esnet / react-timeseries-charts / src / website / packages / charts / examples / stockchart / Index.js View on Github external
const name = "AAPL-price";
const columns = ["time", "open", "close", "low", "high"];
const events = aapl.map(item => {
    const timestamp = moment(new Date(item.date));
    const { open, close, low, high } = item;
    return new TimeEvent(timestamp.toDate(), {
        open: +open,
        close: +close,
        low: +low,
        high: +high
    });
});
const collection = new Collection(events);
const sortedCollection = collection.sortByTime();
const series = new TimeSeries({ name, columns, collection: sortedCollection });

//
// Volume
//

const volumeEvents = aapl.map(item => {
    const index = item.date.replace(/\//g, "-");
    const { volume } = item;
    return new IndexedEvent(index, { volume: +volume });
});
const volumeCollection = new Collection(volumeEvents);
const sortedVolumeCollection = volumeCollection.sortByTime();

const seriesVolume = new TimeSeries({
    name: "AAPL-volume",
    utc: false,
github esnet / react-timeseries-charts / src / website / packages / charts / examples / nyc / Index.js View on Github external
return new IndexedEvent(
        date,
        {
            temp: [
                +record_min_temp, //eslint-disable-line
                +actual_min_temp, //eslint-disable-line
                +actual_max_temp, //eslint-disable-line
                +record_max_temp //eslint-disable-line
            ]
        },
        false
    );
});

const collection = new Collection(events);
const series = new TimeSeries({ name, collection });

//
// Styles
//

class nyc extends React.Component {
    //eslint-disable-line
    state = {
        timerange: new TimeRange([1425168000000, 1433116800000]),
        selection: null
    };

    handleTimeRangeChange = timerange => {
        this.setState({ timerange });
    };
github openpowerquality / opq / view / app / imports / ui / components / LiveData / LiveTrendDataDisplay.jsx View on Github external
{graphData.map(set => {
                  const series = new TimeSeries({
                    name: set.label,
                    columns: ['time', 'value'],
                    points: set.data,
                  });
                  const style = { value: { normal: { stroke: this.state.lineColors[set.label], strokeWidth: 2 } } };
                  return ;
                })}
github openpowerquality / opq / view / app / imports / ui / components / BoxTrends.jsx View on Github external
{graphData.map(set => {
                    const series = new TimeSeries({
                      name: set.label,
                      columns: ['time', 'value'],
                      points: set.data,
                    });
                    const style = { value: { normal: { stroke: this.state.lineColors[set.label], strokeWidth: 2 } } };
                    return ;
                  })}
github CommonGarden / Grow-IoT / imports / app / pages / ThingDetail.jsx View on Github external
getEvents(type) {
    const e = this.props[`${type}Events`];

    let data = {
      name: type,
      columns: ["time", "value"],
      points: []
    };
    _.each(e, (value, key, list) => {
      data.points.unshift([value.event.timestamp.getTime(), value.event.message])
    });
    if (data.points[0]) return new TimeSeries(data);
  }
github CommonGarden / Grow-IoT / imports / app / components / things / Misc / DrDose.jsx View on Github external
getEvents(type) {
    const e = this.props[`${type}Events`];

    let data = {
      name: type,
      columns: ["time", "value"],
      points: []
    };
    _.each(e, (value, key, list) => {
      data.points.unshift([value.event.timestamp.getTime(), value.event.message])
    });
    if (data.points[0]) return new TimeSeries(data);
  }
github CommonGarden / Grow-IoT / imports / app / components / things / Misc / TentacleExample.jsx View on Github external
getEvents(type) {
    const e = this.props[`${type}Events`];

    let data = {
      name: type,
      columns: ["time", "value"],
      points: []
    };
    _.each(e, (value, key, list) => {
      data.points.unshift([value.event.timestamp.getTime(), value.event.message])
    });
    if (data.points[0]) return new TimeSeries(data);
  }
github CommonGarden / Grow-IoT / imports / app / components / things / Misc / ClimateSensor.jsx View on Github external
getEvents(type) {
    const e = this.props[`${type}Events`];

    let data = {
      name: type,
      columns: ["time", "value"],
      points: []
    };
    _.each(e, (value, key, list) => {
      data.points.unshift([value.event.timestamp.getTime(), value.event.message])
    });
    if (data.points[0]) return new TimeSeries(data);
  }
github CommonGarden / Grow-IoT / imports / app / components / things / Misc / PlusFarm.jsx View on Github external
getEvents(type) {
    const e = this.props[`${type}Events`];

    let data = {
      name: type,
      columns: ["time", "value"],
      points: []
    };
    _.each(e, (value, key, list) => {
      data.points.unshift([value.event.timestamp.getTime(), value.event.message])
    });
    if (data.points[0]) return new TimeSeries(data);
  }

pondjs

A timeseries library build on top of immutable.js

BSD-3-Clause-LBNL
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular pondjs functions