Socket
Socket
Sign inDemoInstall

@apio/timeframes

Package Overview
Dependencies
0
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @apio/timeframes

Library for dealing with timeseries data


Version published
Weekly downloads
39
increased by77.27%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

📦 0.1.1 (24 Oct 2022)

  • 770b5 chore(release): 0.1.19
  • ebd32 📦 Release 0.1.17 standard-version [skip ci]
  • 724e6 chore(release): 0.1.17
  • d20ba 📦 Release 0.1.15 standard-version [skip ci]
  • 50bc1 chore(release): 0.1.15
  • f29a3 fix: TimeFrame.rows() should return Row[]
  • 76e67 📦 Release 0.1.13 standard-version [skip ci]
  • 7eaf8 chore(release): 0.1.13
  • 75a4d doc: update docs
  • 497de perf: add index to series
  • 5cdb1 doc: fix TimeFrame.aggregate() doc
  • 525e8 perf: multiple perf improvements
  • 92e13 fix: add guard for computations with empty timeframes
  • cd22f 📦 Release 0.1.11 standard-version [skip ci]
  • cc952 chore(release): 0.1.11
  • 8813b Merge pull request #1 from fatmatto/aggregation
  • 7cfff feat: aggrefation
  • b86d5 📦 Release 0.1.9 standard-version [skip ci]

Readme

Source

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()

Keywords

FAQs

Last updated on 14 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc