Simple configurable Correlation Matrix DEMO
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Correlation Matrix</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
</head>
<body>
<div style="display:inline-block;" id="legend"></div>
<div style="display:inline-block; float:left" id="container"></div>
<script src="main.js"></script>
<script>
var correlationMatrix = [
[1, 0.3, 0, 0.8, 0, 0.2, 1, 0.5, 0, 0.75],
[0.3, 1, 0.5, 0.2, 0.4, 0.3, 0.8, 0.1, 1, 0],
[0, 0.5, 1, 0.4, 0, 0.9, 0, 0.2, 1, 0.3],
[0.8, 0.2, 0.4, 1, 0.3, 0.4, 0.1, 1, 0.2, 0.9],
[0, 0.4, 0, 0.3, 1, 0.1, 0.4, 0, 0.6, 0.7],
[0.2, 0.3, 0.9, 0.4, 0.1, 1, 0, 0.1, 0.4, 0.1],
[1, 0.8, 0, 0.1, 0.4, 0, 1, 0.5, 0, 1],
[0.5, 0.1, 0.2, 1, 0.1, 0, 0.5, 1, 0, 0.4],
[0, 1, 1, 0.2, 0.6, 0.4, 0, 0, 1, 0.6],
[0.75, 0, 0.3, 0.9, 0.7, 0.1, 1, 0.4, 0.6, 1]
];
var labels = ['Var 1', 'Var 2', 'Var 3', 'Var 4', 'Var 5', 'Var 6', 'Var 7', 'Var 8', 'Var 9', 'Var 10'];
Matrix({
container : '#container',
data : correlationMatrix,
labels : labels,
start_color : '#ffffff',
end_color : '#3498db'
});
</script>
</body>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js