-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
47 lines (25 loc) · 891 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Variables
var margin = {top: 100, right: 50, bottom: 100, left: 400, grid: 1};
var height = 50000 - (margin.top + margin.bottom);
var width = 1500 - (margin.left + margin.right);
var gridSize = {width: width / (4 + 2 * margin.grid), height: height / (5428 + 2 * margin.grid)};
var roundness = 1;
var mice = d3.dsv(",", "GLDS_4_analysis_simple.csv", function(d) {
return {
"name": d.Name, "desc": d.Description,
"sample": +d.sample, "value": +d.value,
"x": +d.x, "y": +d.y
};
});
// Building visualisation
var svg = createCanvas();
mice.then(function(dataset) {
// Creating rects and adding on-events
var rects = addRects(svg, dataset);
// Styling rects
styleRects(rects, dataset);
// Adding labels to columns
addColumnLabels();
// Adding labels to rows
addRowLabels(dataset);
});