-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathoverwriteTextFormat.html
More file actions
60 lines (52 loc) · 1.39 KB
/
overwriteTextFormat.html
File metadata and controls
60 lines (52 loc) · 1.39 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sequences sunburst</title>
<link rel="stylesheet" type="text/css" href="../sunburst.css"/>
<link rel="stylesheet" type="text/css" href="./examples.css"/>
<script src="../node_modules/d3/dist/d3.min.js" type="text/javascript"></script>
<script src="../sunburst.js" type="text/javascript"></script>
<style type="text/css">
#sunburst-description {
font-size: 2em;
line-height: 1.5em;
margin-top: -2em;
}
</style>
</head>
<body>
<div id="main">
<div id="sunburst-breadcrumbs"></div>
<div id="sunburst-chart">
<div id="sunburst-description"></div>
</div>
</div>
<script type="text/javascript">
(function() {
// create chart
var sunburst = new Sunburst({
colors: {
"home": "#5687d1",
"product": "#7b615c",
"search": "#de783b",
"account": "#6ab975",
"other": "#a173d1",
"end": "#bbbbbb"
}
});
sunburst.formatDescription = function(sequence, value, percentage) {
var obj = sequence[sequence.length-1];
return "<b>" + obj.data.name + "</b><br>" +
value + "<br>" +
percentage + " %";
}
sunburst.formatBreadcrumbText = function(sequence, value, percentage) {
return "Val: " + value.toExponential();
}
// load data from file
sunburst.loadCsv("visit-sequences.csv");
})();
</script>
</body>
</html>