It might occur to you that you have a lot of timestamped objects that you want to cluster.
<iframe src="https://musebrarian.github.io//" width="100%" height="600"></iframe>The idea behind this library is to cluster a given array of timestamped objects.
// you can embed the file via node.js require command
var TimeCluster = require("./lib/timeCluster.js");
- then you define an object and pass an array of timestamped objects
var x = new TimeCluster(list);
- you can specify a timframe, like this:
var x = new TimeCluster(list, "day"); // valid calls are "minute", "hour", "day", "week", "year"
- and you can also specify the field which contains the timestamp
var x = new TimeCluster(list, "day", "date"); // default is "time"
- The functions returns an array of clustered objects