w2v-server: fix spacing and indent
diff --git a/templates/index.html.ep b/templates/index.html.ep
index bfb8f02..427fb56 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -10,8 +10,8 @@
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<script
src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
- integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
- crossorigin="anonymous"></script>
+ integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
+ crossorigin="anonymous"></script>
<script>
$('#firstable').hide();
$(document).ready(function() {
@@ -178,7 +178,10 @@
letter-spacing: normal;
text-transform: uppercase;
text-shadow: none;
- word-wrap: break-word;
+ word-wrap: break-word;
+ }
+
+
showoptions, #SEARCH {
margin-left: 10px;
margin-right: 10px;
@@ -201,62 +204,53 @@
.tabs-left-vertical .ui-tabs-panel {
height: 20em;
- }
+ }
- .mono {
- font-family: "DejaVu Sans Mono", Inconsolata, SourceCodePro, Courier;
- }
+ .mono {
+ font-family: "DejaVu Sans Mono", Inconsolata, SourceCodePro, Courier;
+ }
- .ui-tooltip-content {
- font-size: 9pt;
- color: #222222;
- }
-
- svg > .ui-tooltip-content {
- font-size: 8pt;
- color: #222222;
- }
-
- a.merged {
- color: green;
- fill: green;
- }
-
- #first a {
- text-decoration: none;
- }
-
- a.marked, #first a.marked {
- text-decoration: underline;
- }
+ .ui-tooltip-content {
+ font-size: 9pt;
+ color: #222222;
+ }
- a.target {
- color: red;
- fill: red;
- }
+ svg > .ui-tooltip-content {
+ font-size: 8pt;
+ color: #222222;
+ }
+
+ a.merged {
+ color: green;
+ fill: green;
+ }
+
+ #first a {
+ text-decoration: none;
+ }
+
+ a.marked, #first a.marked {
+ text-decoration: underline;
+ }
+
+ a.target {
+ color: red;
+ fill: red;
+ }
table.display {
width: 40% important!;
margin: 1; /* <- works for me this way ****/
}
+
table.dataTable thead th, table.dataTable thead td, table.dataTable tbody td {
padding: 2px 2px;
// border-bottom: 1px solid #111;
}
- #collocators {
- margin-bottom: 15px;
- }
-
- #topwrapper {
- width: 100%;
- // border: 1px solid red;
- overflow: hidden; /* will contain if #first is longer than #second */
- }
- #wrapper {
- // border: 1px solid red;
- overflow: hidden; /* will contain if #first is longer than #second */
- }
+ #collocators {
+ margin-bottom: 15px;
+ }
#header {
width: 100%;
@@ -264,6 +258,17 @@
overflow: hidden; /* will contain if #first is longer than #second */
}
+ #topwrapper {
+ width: 100%;
+ // border: 1px solid red;
+ overflow: hidden; /* will contain if #first is longer than #second */
+ }
+
+ #wrapper {
+ // border: 1px solid red;
+ overflow: hidden; /* will contain if #first is longer than #second */
+ }
+
#pagetitle {
max-width: 460px;
margin-right: 20px;
@@ -272,17 +277,6 @@
// border: 1px solid green;
}
- #first {
- margin-right: 20px;
- float: left;
- overflow: hidden; /* if you don't want #second to wrap below #first */
- // border: 1px solid green;
- }
- #tabs {
- margin-right: 20px;
- overflow: hidden; /* if you don't want #second to wrap below #first */
- }
-
#options {
float: left;
width: 800px;
@@ -294,6 +288,16 @@
width: 50%;
}
+ #first {
+ margin-right: 20px;
+ float: left;
+ overflow: hidden; /* if you don't want #second to wrap below #first */
+ // border: 1px solid green;
+ }
+ #tabs {
+ margin-right: 20px;
+ overflow: hidden; /* if you don't want #second to wrap below #first */
+ }
.tabs-min {
background: transparent;
@@ -332,37 +336,37 @@
border: 1px solid #333;
}
- #second {
- min-width: 800px;
+ #second {
+ min-width: 800px;
// border: 1px solid #333;
- overflow: hidden; /* if you don't want #second to wrap below #first */
- }
- #som2 svg {
- border: 1px solid #333;
- }
+ overflow: hidden; /* if you don't want #second to wrap below #first */
+ }
+ #som2 svg {
+ border: 1px solid #333;
+ }
- #cost {
- font-size: 8pt;
- color: #222222;
- margin-top: 4px;
- margin-bottom: 12px;
- }
+ #cost {
+ font-size: 8pt;
+ color: #222222;
+ margin-top: 4px;
+ margin-bottom: 12px;
+ }
- #sominfo1, #sominfo {
- font-size: 8pt;
- color: #222222;
- margin-top: 0px;
- }
+ #sominfo1, #sominfo {
+ font-size: 8pt;
+ color: #222222;
+ margin-top: 0px;
+ }
- #somcolor1, #somcolor2, #somcolor3 {
- display: inline-block;
- height: 10px;
- width: 10px;
- }
+ #somcolor1, #somcolor2, #somcolor3 {
+ display: inline-block;
+ height: 10px;
+ width: 10px;
+ }
- #third {
- border: 1px solid #333;
- }
+ #third {
+ border: 1px solid #333;
+ }
</style>
<script>
@@ -388,19 +392,19 @@
T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
return "translate(" +
- (d.x) + "," +
- (d.y) + ")";
+ (d.x) + "," +
+ (d.y) + ")";
});
}
-
+
function updateEmbedding() {
var Y = T.getSolution();
svg.selectAll('.tsnet')
.data(data.words)
- .attr("transform", function(d, i) {
+ .attr("transform", function(d, i) {
return "translate(" +
- ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
- ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
+ ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
+ ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
}
var svg;
@@ -411,19 +415,19 @@
function drawEmbedding() {
$("#embed").empty();
var div = d3.select("#embed");
-
+
// get min and max in each column of Y
var Y = T.Y;
-
+
svg = div.append("svg") // svg is global
.attr("width", mapWidth)
.attr("height", mapHeight);
-
+
var g = svg.selectAll(".b")
.data(data.words)
.enter().append("g")
.attr("class", "tsnet");
-
+
g.append("a")
.attr("xlink:href", function(word) {
return (data.urlprefix+word);})
@@ -446,7 +450,7 @@
return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
} else {
return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
- }
+ }
} else {
return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
@@ -455,7 +459,7 @@
.attr("text-anchor", "top")
.attr("font-size", 12)
.text(function(d) { return d; });
-
+
var zoomListener = d3.behavior.zoom()
.scaleExtent([0.1, 10])
.center([0,0])
@@ -479,7 +483,7 @@
function stopStep() {
clearInterval(iter_id);
text = svg.selectAll("text");
-
+
// jitter function needs different data and co-ordinate representation
labels = d3.range(data.words.length).map(function(i) {
var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
@@ -491,7 +495,7 @@
name: data.words[i]
};
});
-
+
// get the actual label bounding boxes for the jitter function
var index = 0;
text.each(function() {
@@ -500,7 +504,7 @@
index += 1;
});
-
+
// setTimeout(updateEmbedding, 1);
// setTimeout(
labeler = d3.labeler()
@@ -529,7 +533,7 @@
function step() {
var i = T.iter;
-
+
if(i > <%= $no_iterations %>) {
stopStep();
} else {
@@ -656,8 +660,8 @@
<%= sprintf("%.3f", $item->{dist}) %>
</td>
<td>
- % my $class = ($marked->{$item->{word}}? "marked " : "");
- % my $r = $item->{rank};
+ % my $class = ($marked->{$item->{word}}? "marked " : "");
+ % my $r = $item->{rank};
% if($r < $mergedEnd) {
% $class .= "merged";
% $r .= " (merged vocab)";