Skip to content

Commit

Permalink
Merge pull request #55 from bd2kccd/v1.3.3
Browse files Browse the repository at this point in the history
V1.3.3
  • Loading branch information
kvb2univpitt authored Apr 7, 2017
2 parents 5faa71d + c4f76d9 commit bb948ac
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>edu.pitt.dbmi</groupId>
<artifactId>causal-web</artifactId>
<version>1.4.0</version>
<version>1.3.3</version>
<packaging>jar</packaging>

<name>causal-web</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/ccd.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ccd.email.admin.sendto=${spring.mail.username}
ccd.acct.reg.activ.required=false

# LABELS
ccd.app.title=Causal Web v1.3.2
ccd.app.title=Causal Web v1.3.3
ccd.app.copyright=University of Pittsburgh and Carnegie Mellon University

ccd.app.agreement=TERMS AND CONDITIONS&#10;&#10;\
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/static/img/pags/ab_direct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 13 additions & 18 deletions src/main/resources/static/js/algo/d3jsplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ function plotGraph(links) {

// Default distance accessor is 30
simulation.force("link")
.distance(60);
.distance(50);

// Each node conects to itself, so we can highlight this node when it's selected
for (i = 0; i < nodes.length; i++) {
linkedByIndex[i + "," + i] = 1;
}
;

// Add all the connections based on links
// Must call this after simulation.force("link").links(links)
Expand Down Expand Up @@ -208,29 +207,25 @@ function plotGraph(links) {
function ticked() {
// Position nodes
node.attr("cx", function (d) {
// This makes sure the nodes won't go out of the container
// Bounding box example: http://mbostock.github.io/d3/talk/20110921/bounding.html
return d.x = Math.max(nodeRadius, Math.min(svgWidth - nodeRadius, d.x));
//return d.x;
})
.attr("cy", function (d) {
return d.y = Math.max(nodeRadius, Math.min(svgHeight - nodeRadius, d.y));
//return d.y;
});
return d.x;
})
.attr("cy", function (d) {
return d.y;
});

// Position links
// Use path instead of line since IE 10 doesn't render the links correctly
link.attr("d", positionLink).each(function () {
this.parentNode.insertBefore(this, this);
});
this.parentNode.insertBefore(this, this);
});

// Position node text
text.attr("x", function (d) {
return d.x + nodeRadius;
})
.attr("y", function (d) {
return d.y + nodeRadius / 2;
});
return d.x - (nodeRadius / 2);
})
.attr("y", function (d) {
return d.y - (1.5 * nodeRadius);
});
}

// Position the edge link
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/static/js/algo/d3jsplot.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 66 additions & 4 deletions src/main/resources/templates/algorithm/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,75 @@
<div class="col-lg-12">
<h3 class="page-header">Causal Graph of <span class="label label-primary" th:text="${plot}">Title</span></h3>
<ul>
<li>You can use the mouse wheel to zoom in/out this graph.</li>
<li>You can drag the entire graph by dragging an empty space on the graph.</li>
<li>You can highlight a node and all the edges of this node by double clicking the node, and double clicking again on any node to disable the highlighting.</li>
<li>You can search and locate a node by entering its name(case-insensitive) in the search box.</li>
<li>You can use the mouse wheel to zoom in/out this graph.</li>
<li>You can drag the entire graph by dragging an empty space on the graph.</li>
<li>You can highlight a node and all the edges of this node by double clicking the node, and double clicking again on any node to disable the highlighting.</li>
<li>You can search and locate a node by entering its name(case-insensitive) in the search box.</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-body">
<table class="table table-responsive">
<thead>
<tr>
<th>Edge Types</th>
<th>Present Relationships</th>
<th>Absent Relationships</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="../../static/img/pags/small_ab_direct.png" th:src="@{/img/pags/small_ab_direct.png}" alt="A --&gt; B" /></td>
<td>
A is a cause of B.<br />
It may be a direct or indirect cause that may include other measured variables. Also, there may be an unmeasured confounder of A and B.
</td>
<td>B is not a cause of A</td>
</tr>
<tr>
<td><img src="../../static/img/pags/small_ab_bidirect.png" th:src="@{/img/pags/small_ab_bidirect.png}" alt="A &lt;-&gt; B" /></td>
<td>There is an unmeasured confounder (call it L) of A and B. There may be measured variables along the causal pathway from L to A or from L to B.</td>
<td>
A is not a cause of B.<br />
B is not a cause of A.
</td>
</tr>
<tr>
<td><img src="../../static/img/pags/small_ab_pd_direct.png" th:src="@{/img/pags/small_ab_pd_direct.png}" alt="A o-&gt; B" /></td>
<td>Either A is a cause of B (i.e, A --&gt; B) or there is an unmeasured confounder of A and B (i.e, A &lt;-&gt; B) or both.</td>
<td>B is not a cause of A.</td>
</tr>
<tr>
<td><img src="../../static/img/pags/small_ab_pd_bidrect.png" th:src="@{/img/pags/small_ab_pd_bidrect.png}" alt="A o-o B" /></td>
<td>
Exactly one of the following holds:
<ol>
<li>A is a cause of B</li>
<li>B is a cause of A</li>
<li>there is an unmeasured confounder of A and B</li>
<li>both a and c</li>
<li>both b and c</li>
</ol>
</td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">If an edge is dashed that means there is no latent confounder. Otherwise, there is possibly latent confounder.</td>
</tr>
<tr>
<td colspan="3">If an edge is green that means it is definitely direct. Otherwise, it is possibly direct.</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<iframe src="#" th:src="@{/algorithm/results/d3graph(file=${fileName})}" marginwidth="0" marginheight="0" scrolling="no"></iframe>
Expand Down

0 comments on commit bb948ac

Please sign in to comment.