Skip to content

Commit 462570a

Browse files
committed
Final update files
1 parent a88f21b commit 462570a

File tree

20 files changed

+6565
-467
lines changed

20 files changed

+6565
-467
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.idea/workspace.xml

Lines changed: 141 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascripts/init.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
const initWidth = 1400,
2+
initHeight = 660,
3+
initMinFont = 15,
4+
initMaxFont = 35,
5+
initFlag = "none";// none / fa/ f / a
6+
7+
var initTop = 15;
8+
9+
var globalWidth = initWidth,
10+
globalHeight = initHeight,
11+
globalMinFont = initMinFont,
12+
globalMaxFont = initMaxFont,
13+
globalFlag = initFlag,
14+
globalTop = initTop,
15+
globalData,
16+
isRel = document.getElementById("rel").checked;
17+
18+
var allW;
19+
20+
21+
const color = d3.scale.category10();
22+
const axis = d3.svg.axis().ticks(4);
23+
const axisFont = d3.svg.axis().tickValues([0, 25, 50, 75, 100]);
24+
25+
d3.select('#widthSlider').call(d3.slider()
26+
.axis(axis)
27+
.value([0, initWidth])
28+
.min(0)
29+
.max(maxWidth)
30+
.step(20)
31+
.on("slide", function (evt, value) {
32+
d3.select('#widthText').text(value[1]);
33+
}))
34+
;
35+
d3.select('#heightSlider').call(d3.slider()
36+
.axis(axis)
37+
.value([0, initHeight])
38+
.min(0)
39+
.max(maxHeight)
40+
.step(20)
41+
.on("slide", function (evt, value) {
42+
d3.select('#heightText').text(value[1]);
43+
}))
44+
;
45+
d3.select('#fontSlider').call(d3.slider().axis(axisFont).value([initMinFont, initMaxFont]).on("slide", function (evt, value) {
46+
d3.select('#fontMin').text(value[0].toFixed(0));
47+
d3.select('#fontMax').text(value[1].toFixed(0));
48+
}));
49+
50+
d3.select('#topRankSlider').call(d3.slider()
51+
.axis(axis)
52+
.value([0, initTop])
53+
.min(0)
54+
.max(maxTop)
55+
.step(5)
56+
.on("slide", function (evt, value) {
57+
d3.select('#topRankText').text(value[1]);
58+
}))
59+
;
60+
const metricName = [["Importance value (tf-idf ratio) "],["Compactness "],["All Words Area/Stream Area"],
61+
["Weighted Display Rate"],["Average Normalized Frequency "]];
62+
63+
var metric = d3.select("body").append("svg")
64+
.attr("width",360)
65+
.attr("height", 250)
66+
.attr("class","metricSVG")
67+
.attr("id","metricSVG");
68+
69+
metric.append("text").attr("y", 15).attr("font-weight",600).text("Metrics");
70+
71+
d3.select("body")
72+
// .append("div")
73+
.append("table")
74+
.attr("class","metTable")
75+
.style("border-collapse", "collapse")
76+
.style("border", "2px black solid")
77+
78+
.selectAll("tr")
79+
.data(metricName)
80+
.enter().append("tr")
81+
82+
.selectAll("td")
83+
.data(function(d){return d;})
84+
.enter().append("td")
85+
.style("border", "1px black solid")
86+
.style("padding", "10px")
87+
.text(function(d){return d;})
88+
.style("font-size", "13px");
89+
90+
var metric2 = d3.select("body").append("svg")
91+
.attr("width",100)
92+
.attr("height", 300)
93+
.attr("class","metricSVG2")
94+
.attr("id","metricSVG2");

javascripts/jquery/jquery-1.9.0.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javascripts/jquery/tester.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/************** test case **********************/
2+
(function() {
3+
var resultsTest;
4+
this.assert = function assert(value, desc) {
5+
var li = document.createElement("li");
6+
li.className = value ? "pass" : "fail";
7+
var span = document.createElement("span");
8+
span.innerHTML = desc;
9+
li.appendChild(span);
10+
resultsTest.appendChild(li);
11+
if (!value) {
12+
li.parentNode.parentNode.className = "fail";
13+
}
14+
return li;
15+
};
16+
this.test = function test(name, fn) {
17+
resultsTest = document.getElementById("testResults");
18+
resultsTest = assert(true, name).appendChild(
19+
document.createElement("ul"));
20+
fn();
21+
};
22+
})();
23+
function clearTestResult() {
24+
$("#testResults ul li").remove();
25+
}
26+
/***************************************/

0 commit comments

Comments
 (0)