-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinit.js
More file actions
98 lines (84 loc) · 2.55 KB
/
init.js
File metadata and controls
98 lines (84 loc) · 2.55 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const initWidth = (window.innerWidth - 430) ? (window.innerWidth - 430) : 1250,
initHeight = 660,
initMinFont = 15,
initMaxFont = 35,
initFlag = "none";// none / fa/ f / a
var initTop = 15;
var globalWidth = initWidth,
globalHeight = initHeight,
globalMinFont = initMinFont,
globalMaxFont = initMaxFont,
globalFlag = initFlag,
globalTop = initTop,
globalData,
isRel = document.getElementById("rel").checked;
var allW;
const color = d3.scale.category10();
const axis = d3.svg.axis().ticks(4);
const axisFont = d3.svg.axis().tickValues([0, 25, 50, 75, 100]);
d3.select('#widthSlider').call(d3.slider()
.axis(axis)
.value([0, initWidth])
.min(0)
.max(maxWidth)
.step(20)
.on("slide", function (evt, value) {
d3.select('#widthText').text(value[1]);
}))
;
d3.select('#heightSlider').call(d3.slider()
.axis(axis)
.value([0, initHeight])
.min(0)
.max(maxHeight)
.step(20)
.on("slide", function (evt, value) {
d3.select('#heightText').text(value[1]);
}))
;
d3.select('#fontSlider').call(d3.slider().axis(axisFont).value([initMinFont, initMaxFont]).on("slide", function (evt, value) {
d3.select('#fontMin').text(value[0].toFixed(0));
d3.select('#fontMax').text(value[1].toFixed(0));
}));
d3.select('#topRankSlider').call(d3.slider()
.axis(axis)
.value([0, initTop])
.min(0)
.max(maxTop)
.step(5)
.on("slide", function (evt, value) {
d3.select('#topRankText').text(value[1]);
}))
;
const metricName = [["Importance value (tf-idf ratio) "],["Compactness "],["All Words Area/Stream Area"],
["Weighted Display Rate"],["Average Normalized Frequency "]];
var metric = d3.select("body").append("svg")
.attr("width",360)
.attr("height", 250)
.attr("class","metricSVG")
.attr("id","metricSVG")
.append("g");
metric.append("text")
.attr("transform", "translate(0,15)")
.attr("font-weight",600).text("Metrics");
d3.select("body")
// .append("div")
.append("table")
.attr("class","metTable")
.style("border-collapse", "collapse")
.style("border", "2px black solid")
.selectAll("tr")
.data(metricName)
.enter().append("tr")
.selectAll("td")
.data(function(d){return d;})
.enter().append("td")
.style("border", "1px black solid")
.style("padding", "10px")
.text(function(d){return d;})
.style("font-size", "13px");
var metric2 = d3.select("body").append("svg")
.attr("width",100)
.attr("height", 300)
.attr("class","metricSVG2")
.attr("id","metricSVG2");