Heatmap for time series - mwasiluk/ODC-d3 GitHub Wiki

Heatmap for time series extends Heatmap with support for handling data in time series.

#Demo Online demo

Sample usage

Heatmap is created using an ODCD3.HeatmapTimeSeries function:


var placeholderSelector = "#plot";
var data = [ ... ]; // array of arrays/objects 
var config = { //optional config object
    ...
};

var plot = new ODCD3.HeatmapTimeSeries(placeholderSelector, data, config);  

#Configuration

The ODCD3.HeatmapTimeSeries function extends ODCD3.Heatmap and takes 3 parameters:

  1. selector for plot placeholder element - d3.select compatible (string or node)
  2. data to plot (array of arrays / objects)
  3. optional config object

Configuration object properties added to base Heatmap configuration:

  • x - time axis configuration
    • format - input data d3 time format, default: undefined (guessed based on the x.intervalToFormats config array)
    • displayFormat - d3 time format for display, default: undefined (same as in x.format option)
    • fillMissing - fill missing values (gaps in time axis ticks) using interval and intervalStep options, default: false
    • interval - d3 interval name used to fill missing ticks, default: undefined (guessed based on the x.intervalToFormats config array)
    • intervalStep - interval step used to fill missing ticks, default: 1
  • z - color axis configuration
    • fillMissing - fill missing values with the nearest previous value, default: true