UNPKG

clustergrammer

Version:

This is a clustergram implemented in D3.js. I started from the example http://bost.ocks.org/mike/miserables/ and added the following features

24 lines (20 loc) 608 B
var colors = require('../colors'); module.exports = function(params) { var group_colors = []; // var max_groups; // // if (params.network_data.row_nodes.length > params.network_data.col_nodes.length) { // max_groups = params.network_data.row_nodes; // } else { // max_groups = params.network_data.col_nodes; // } for (var i = 0; i < params.network_data.row_nodes.length; i++) { // grab colors from the list if (i === 1) { group_colors[i] = colors.get_default_color(); } else { group_colors[i] = colors.get_random_color(i); } } return group_colors; };