Nerfing Powerful Megalomaniacs

    @apio/timeframes
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.35 • Public • Published

    Timeframes

    Library for dealing with timeseries data

    ⚠️ This is a work in progress

    Quickstart

    Install through NPM

    npm i @apio/timeframes

    There are a few examples that you can check out in the examples directory.

    TimeSeries

    // Pass an array of points
    // a point is a tuple [DateLike, PointValue]
    // DateLike is value that can be passed to new Date()
    // PointValue is any value, but preferably a number (to compute sums averages ecc)
    const ts = new TimeSerie([["2022-01-01", 12],["2022-01-02", 13]])
    const sum = ts.sum()
    const avg = ts.avg()

    TimeFrames

    // Each item is a row
    const rows = [
      {time: "2022-01-01", value1:10, value2:140},
      {time: "2022-01-02", value1:41}, // here value2 is null
      {time: "2022-01-03", value1:78, value2:301},
    ]
    const ts = new TimeFrame(rows)
    // column() extracts columns as timeseries
    const total1 = ts.column("value1").sum()

    Install

    npm i @apio/timeframes

    DownloadsWeekly Downloads

    42

    Version

    0.1.35

    License

    MIT

    Unpacked Size

    462 kB

    Total Files

    54

    Last publish

    Collaborators

    • fatmatto
    • matteodisabatino