Scatterplot Matrix - mwasiluk/ODC-d3 GitHub Wiki

A scatterplot matrix is a matrix showing the scatter plots of all pairs of given variables. The scatterplot matrix of n variables X1, ..., Xn is the n × n matrix whose i,j entry contains scatterplot of Xi and Xj.

Scatterplot Matrix extends [Chart With Color Groups](Chart With Color Groups) and ScatterPlot Configuration

#Demo Online demo

Sample usage

Scatterplot matrix is created using an ODCD3.ScatterPlotMatrix function:


var placeholderSelector = "#scatterplot";
var data = [ ... ]; // array of arrays/objects 
var config = { //optional config object
    size: 200,
    guides: true,
    ...
};

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

#Configuration

Configuration object properties (not inherited from ScatterPlot Configuration):

  • size - scatter plot cell size (default: computed using svg width and minCellSize and maxCellSize)
  • minCellSize - minimum plot cell size (default: 50)
  • maxCellSize - maximum plot cell size (default: 1000)
  • padding - scatter plot cell padding (default: 20)
  • brush - enable brushing, boolean (default: true)
  • guides - show axis guides, boolean (default: true)
  • ticks - ticks number, (default: computed using cell size)
  • variables - plot variables configuration object:
    • labels - optional array of variable labels (for the diagonal of the plot)
    • keys - optional array of variable keys in datum (object properties / array indices), used for selecting plot variables
    • value - variable value accessor function, may be used to override default accessor:
      function (datum, variableKey) {
         return datum[variableKey];
      }
  • groups - groups configuration object:
    • key - default value: undefined
    • includeInPlot - include group as variable in plot, boolean (default: false)