1. Made style changes to person level vis front end.
2. Updated co-author vis from Asik. 3. Made code changes so that graphml sent to the flash vis will always be ordered by node ids instead of letting flash vis handle it.
This commit is contained in:
parent
bfe2991398
commit
94b6c47294
5 changed files with 44 additions and 3 deletions
|
@ -339,7 +339,7 @@ function renderCoAuthorshipVisualization() {
|
|||
"src", swfLink,
|
||||
"flashVars", "graphmlUrl=" + egoCoAuthorshipDataFeederURL,
|
||||
"width", "600",
|
||||
"height", "840",
|
||||
"height", "850",
|
||||
"align", "top",
|
||||
"id", "CoAuthor",
|
||||
"quality", "high",
|
||||
|
|
|
@ -4,6 +4,9 @@ package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
|
|||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -86,8 +89,11 @@ public class CoAuthorshipGraphMLWriter {
|
|||
|
||||
Set<Edge> edges = visVOContainer.getEdges();
|
||||
|
||||
List<Edge> orderedEdges = new ArrayList<Edge>(edges);
|
||||
|
||||
Collections.sort(orderedEdges, new EdgeComparator());
|
||||
|
||||
for (Edge currentEdge : edges) {
|
||||
for (Edge currentEdge : orderedEdges) {
|
||||
|
||||
/*
|
||||
* This method actually creates the XML code for a single edge. "graphMLContent"
|
||||
|
@ -182,8 +188,13 @@ public class CoAuthorshipGraphMLWriter {
|
|||
* */
|
||||
getNodeContent(graphMLContent, egoNode);
|
||||
|
||||
List<Node> orderedAuthorNodes = new ArrayList<Node>(authorNodes);
|
||||
orderedAuthorNodes.remove(egoNode);
|
||||
|
||||
for (Node currNode : authorNodes) {
|
||||
Collections.sort(orderedAuthorNodes, new NodeComparator());
|
||||
|
||||
|
||||
for (Node currNode : orderedAuthorNodes) {
|
||||
|
||||
/*
|
||||
* We have already printed the Ego Node info.
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Edge;
|
||||
|
||||
|
||||
public class EdgeComparator implements Comparator<Edge> {
|
||||
|
||||
@Override
|
||||
public int compare(Edge arg0, Edge arg1) {
|
||||
return arg1.getEdgeID() - arg0.getEdgeID();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.visualization.coauthorship;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Node;
|
||||
|
||||
|
||||
public class NodeComparator implements Comparator<Node> {
|
||||
|
||||
@Override
|
||||
public int compare(Node arg0, Node arg1) {
|
||||
return arg1.getNodeID() - arg0.getNodeID();
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Loading…
Add table
Reference in a new issue