Commit 5dd8ff49 authored by Administrator's avatar Administrator

Merge branch 'samuel' into alex

Merge Samuel work on matrix
parents 0f584cf8 ba54c1f0
......@@ -69,7 +69,7 @@ def create_whitelist(user, corpus, size=100):
return white_list
#def create_cooc(user, corpus, whitelist, blacklist, synonymes):
def create_cooc(user=None, corpus=None, whitelist=None, size=150):
def create_cooc(user=None, corpus=None, whitelist=None, size=150, year_start=None, year_end=None):
cursor = connection.cursor()
try:
......@@ -169,7 +169,7 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
weight[cooccurrence.ngramx.terms] = weight.get(cooccurrence.ngramx.terms, 0) + cooccurrence.score
df = pd.DataFrame(matrix).T.fillna(0)
df = pd.DataFrame(matrix).fillna(0)
x = copy(df.values)
x = x / x.sum(axis=1)
......
......@@ -71,7 +71,11 @@ Last steps of configuration:
sudo tar xvjf gargantext_lib.tar.bz2
sudo chown user:user /srv/gargantext_lib
3) Explorer:
3) Explorer:
create mkdir /srv/gargantext_lib/js
sudo chown -R user:user /srv/gargantext_lib/
cd /srv/gargantext_lib/js
git clone git@github.com:PkSM3/garg.git
......@@ -100,6 +104,6 @@ Start the Python Notebook server
Start the Django server
-----------------------
in bash to launch python env : /srv/gargantext_env/bin/activate
In Pyvenv:
python manage.py runserver
File mode changed from 100644 to 100755
......@@ -78,13 +78,21 @@
<ul id="category-A" class="nav navbar-nav navbar-right">
<li>
<ul style="list-style-type: none; margin:0em 1em;">
<ul >
<li><div id="sliderANodeWeight"></div></li>
<li><div id="sliderAEdgeWeight"></div></li>
<li><div id="sliderANodeSize"></div></li>
</ul>
</li>
</ul>
<!--
a
a
a
a
a
a
-->
<ul id="filterslegend" class="nav navbar-nav navbar-right">
<li>
......@@ -99,7 +107,7 @@
<ul id="category-B" class="nav navbar-nav navbar-right">
<li>
<ul style="list-style-type: none; margin:0em 1em;">
<ul>
<li><div id="sliderBNodeWeight"></div></li>
<li><div id="sliderBEdgeWeight"></div></li>
<li><div id="sliderBNodeSize"></div></li>
......
......@@ -18,6 +18,14 @@ line {
text.active {
fill: red;
font-weight: bold;
font-size: medium;
}
text.inactive {
fill: #e3e4e1;
font-weight: normal;
font-size: small;
}
</style>
......@@ -57,15 +65,15 @@ var margin = {top: 80, right: 0, bottom: 10, left: 80},
height = 720;
var x = d3.scale.ordinal().rangeBands([0, width]),
z = d3.scale.linear().domain([0, 4]).clamp(true),
z = d3.scale.linear().domain([0, 4]).clamp(true), //alpha for color-cells
c = d3.scale.category10().domain(d3.range(10));
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
//.style("margin-left", -margin.left + "px")
.attr("width", "100%")
.attr("height", "100%")
.style("margin-left", "25%")
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
.attr("transform", "translate(" + "300" + "," + "300" + ")");//challenge: to calculate both parameters! maybe do something with the labels length
var filename = document.getElementById("graphid").innerHTML
d3.json(filename, function(miserables) {
......@@ -117,7 +125,7 @@ var svg = d3.select("body").append("svg")
.attr("x2", width);
row.append("text")
.attr("x", -6)
.attr("x", -6)//distance between row-label and matrix
.attr("y", x.rangeBand() / 2)
.attr("dy", ".32em")
.attr("text-anchor", "end")
......@@ -154,12 +162,25 @@ var svg = d3.select("body").append("svg")
}
function mouseover(p) {
d3.selectAll(".row text").classed("active", function(d, i) { return i == p.y; });
d3.selectAll(".column text").classed("active", function(d, i) { return i == p.x; });
d3.selectAll(".row text")
.classed("active", function(d, i) {
return i == p.y;
}).classed("inactive", function(d, i) {
return i != p.y;
});
d3.selectAll(".column text")
.classed("active", function(d, i) {
return i == p.x;
}).classed("inactive", function(d, i) {
return i != p.x;
});
}
function mouseout() {
d3.selectAll("text").classed("active", false);
d3.selectAll("text").classed("active", false).classed("inactive", false);
}
d3.select("#order").on("change", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment