|
| 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"); |
0 commit comments