npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

directus-extension-calculated-time-series-panel

v1.0.1

Published

This is a Directus extension providing a flexible panel that can display a time series chart based on calculated values with support for grouping and filtering.

Readme

Features Overview

Available panel properties for configuring via the Directus Insights graphical user interface (the provided examples correspond to a multiseries bar chart with 3 series - income, expenses, profit):

  • fields (example: income.netto, expenses.netto)
  • value expressions (example: sum(attr(income, "netto")); sum(attr(expenses, "netto")); sum(attr(income, "netto")) - sum(attr(expenses, "netto")))
  • value labels (example: income, expenses, profit)
  • filters (example: {"income": { "_and": [ { "issue_date": { "_gte": "{{start_date}}" } }, { "issue_date": { "_lte": "{{end_date}}" } } ] }, "expenses": { "_and": [ { "date": { "_gte": "{{start_date}}" } }, { "date": { "_lte": "{{end_date}}" } } ] }})
  • chart type (available options: bar, line)
  • time fields (example: income.issue_date, expenses.date)
  • group precission (available options: second, minute, hour, day, week, month, year)
  • colors (example: green, red, yellow)
  • date range (example: Past 12 months)

The extension utilizes math.js as expression parser. Look up the official documentation of math.js for the list of supported operations in the expression. Additionally, the following math.js extension functions are supported for working with collections:

sum, avg, count, attr, max, min, median, round, ceil, floor, abs

Thanks to the attr function it is possible access any field of any available collection using the syntax attr(<collectionName>, "<fieldName>") (see examples above)

Each expression is processed in the context of the current time interval. For example if the sum function is used in valueExpressions, and the precision is set to month then the sum is calculated over items corresponding to each of the individual months in the range. If the range is 12 months, then each of the valueExpressions expressions provided will be evaluated exactly 13 times (past 12 months + current month). The size of the time intervals is determined by the precision property which indicates the grouping behaviour of the data processing algorithm and the range is determined by the range property.

Note: leading and trailing multiseries zero value entries will be automatically removed from the chart to simplify the chart and improve readability, unless it would result in no data being displayed at all.