0.5.38 • Published 6 years ago

time-series-scroller v0.5.38

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

Build status

time-series-scroller

Specialized time-series-over-domain component focused on code quality and performance. 100% functional, yet not mature - still beta/under development (see project goals below). All components are written from scratch using D3 and primitive HTML elements, this is not a wrapper over a third-party library.

Getting started with the development version

git clone https://github.com/carldata/time-series-scroller.git
cd time-series-scroller
npm i
npm run dev

Demo

See it in action !

Getting started with the npm-dependency

npm i time-series-scroller --save-dev

Project goals

  • High performance (works with 2M points)
  • High maintainabilty
  • Simplicity (KISS+DRY)
  • High specialization (time series only !)
  • SCSS variables imported as variables in JavaScript
  • SCSS variables defining attributes / data structures for styling
  • StoryBook demonstrations
  • Zooming in/out redesigned
  • Documentation
    • reusable actions/reducers
    • how to integrate
    • bucketing algorithm
    • how to draw in D3, problems encountered
  • 100% test coverage
  • Wrappers to / means of integration with the other frameworks (AngularJS, AngualarIO, Vue etc.)

Description

Simple, highly performant and customizable React/Redux module for displaying time series. When dug deeper, consists of the following components:

Note that each of the components can be used separately for different purposes :) Eg. HpSlider can be used straight-away to control a temperature or humidity in an air-conditioning online controlling system :) HpTimeSeriesScroller component can be seen as a demo how HpSlider and HpTimeSeriesChart can interact - keep in mind HpTimeSeriesScroller is a fully stateful component that (currently) does not provide means to share the internal state with a Redux store. If you are not OK with this, write your own version !

Glossary

  • domain - an (inclusive) range of integer numbers (from/to); keep in mind HpSlider, HpTimeSeriesChart components do not work on date-time values like "2015-03-04 12:45:40", but numbers (integers) translated from date-time values - it is quite easy to do this kind of conversion in JavaScript by calling Date.prototype.getTime
  • hp = high performant

Testing

npm run test

Currently it checks the bucketing algorithm calculations:

 PASS  __tests__/time-series-chart/calculations.ts
  time-series-chart calculations test
    ✓ evenly distributed time series is placed into buckets properly (18ms)
    ✓ time series is transformed to no empty buckets (6ms)
    ✓ buckets are fed with proper data (17ms)
    ✓ not-evenly distributed series gets transformed to buckets under specific filter conditions - test A (6ms)
    ✓ not-evenly distributed series gets transformed to buckets under specific filter conditions - test B (2ms)
    ✓ not-evenly distributed series has no buckets but shadow buckets get found (8ms)

  console.log __tests__/time-series-chart/calculations.ts:31
    Running with hours: 17, distribution: 15, numberOfBuckets: 275

  console.log __tests__/time-series-chart/calculations.ts:48
    Running with minutes: 557, numberOfBuckets: 8, division: 5

Test Suites: 1 passed, 1 total
Tests:       6 passed, 6 total
Snapshots:   0 total

Exposing as npm package:

In src folder run:

grunt --os=osx //mac
grunt --os=win //windows

then

npm version patch
0.5.38

6 years ago

0.5.37

6 years ago

0.5.36

6 years ago

0.5.35

6 years ago

0.5.34

6 years ago

0.5.33

6 years ago

0.5.32

6 years ago

0.5.31

6 years ago

0.5.30

6 years ago

0.5.29

6 years ago

0.5.28

6 years ago

0.5.27

6 years ago

0.5.26

6 years ago

0.5.25

6 years ago

0.5.24

6 years ago

0.5.23

6 years ago

0.5.22

6 years ago

0.5.21

6 years ago

0.5.20

6 years ago

0.5.19

6 years ago

0.5.18

6 years ago

0.5.17

6 years ago

0.5.16

6 years ago

0.5.15

6 years ago

0.5.14

6 years ago

0.5.12

6 years ago

0.5.11

6 years ago

0.5.10

6 years ago

0.5.9

6 years ago

0.5.8

6 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

1.0.0

6 years ago