-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathChordChart.html
45 lines (41 loc) · 1.27 KB
/
ChordChart.html
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
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<title>Chord Chart</title>
<script src="../references/d3.js"></script>
<script src="../references/knockout-3.4.0.js"></script>
<script src="../build/koextensions.js"></script>
</head>
<body>
<div id="chordChart" data-bind="chordChart: chordChartData, chartOptions:chordOptions"></div>
<script>
var matrix = [
[0, 20, 10, 30,5],
[20, 0, 20, 30,15],
[10, 20, 0, 10,25],
[30, 30, 10, 0,30],
[5, 15 ,25 ,30,0]
];
var names = ['CZ', 'FR', 'PL', 'RU','DE'];
function TestViewModel() {
var self = this;
self.chordChartData = ko.observable();
self.chordOptions = {
height:500,
width:500,
fillParentController:true,
chordFormat: function(d){
return "Some value: " + d
}
}
}
var vm = new TestViewModel();
ko.applyBindings(vm);
vm.chordChartData({
matrix: matrix,
names: names
});
</script>
</body>
</html>