w2v-server: improve self-links in tsne-map and som
diff --git a/js/som.js b/js/som.js
index ca16d28..e496d36 100644
--- a/js/som.js
+++ b/js/som.js
@@ -135,7 +135,10 @@
// var avg, avgsim1, avgsim2, minsim;
var refIndex;
var colorScale;
-
+ var urlprefix = new URLSearchParams(window.location.search);
+ urlprefix.delete("word");
+ urlprefix.append("word","");
+
if(no_targets > 1) {
refIndex=1;
colorScale = d3.scale.linear()
@@ -192,7 +195,7 @@
.enter().append("g")
.attr("class", "u");
g.append("a")
- .attr("xlink:href", function(word) {return data.urlprefix+word;})
+ .attr("xlink:href", function(word) {return "?"+urlprefix+word;})
.attr("title", function(d, i) {
return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
})