From 9b83c756f5de299c6beb5108ceec3f0f90472532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Aristar=C3=A1n?= Date: Wed, 17 Dec 2014 16:30:36 -0500 Subject: [PATCH 1/4] merge --- app/index.html | 15 +++++++------- app/scripts/main.coffee | 44 ++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/app/index.html b/app/index.html index 277252c..92420fa 100644 --- a/app/index.html +++ b/app/index.html @@ -4,12 +4,13 @@ Node Mapper - - - - - + + + + + + @@ -18,7 +19,7 @@ Node Mapper -
+
1. Upload a Google Spreadsheet
@@ -63,4 +64,4 @@
- \ No newline at end of file + diff --git a/app/scripts/main.coffee b/app/scripts/main.coffee index d9cecb8..7e51245 100644 --- a/app/scripts/main.coffee +++ b/app/scripts/main.coffee @@ -1,8 +1,6 @@ app = angular.module('app', []) angular.module('app').controller('projectCtrl', ['$scope', ($scope) -> - # $scope.url = 'https://docs.google.com/spreadsheets/d/13VWRA1Vjcn9bu55SCBIFCUoC0kXhlhNrclK67O7ItcM/pubhtml' - # $scope.url = 'https://docs.google.com/spreadsheets/d/1ozfvHPGlDLIE2idxnj2iDg2H_ZLJYxtgwSgjCKGfnUw/pubhtml' $scope.url = 'https://docs.google.com/spreadsheets/d/1nNgKW8EZ98SKOTMEj9wujsJIJfmlRuFUowwRtSbduuQ/pubhtml' getSpreadsheetData = (key) -> console.log("Key:", key) @@ -41,26 +39,28 @@ angular.module('app').directive("network", ["$window", "$timeout", unless data then return nodeData = data.Data.elements nodes = data.Nodes.elements - edges = data.Connections.elements - console.log(nodeData, nodes, edges) + edges = data.Connections.elements.map (e) -> + source: (nodes.findIndex (n) -> n.id == e.source) + target: (nodes.findIndex (n) -> n.id == e.target) - network = d3plus.viz() - .type("network") - .color("type of entity") - .container("#viz") - .text("name") - .font( - size: 10 - ) - .data(nodeData) - .nodes(nodes) - .edges(edges) - .edges( - label: "type" - ) - .id("id") - .tooltip(["type of entity"]) - .draw() + container = document.getElementById('viz') + svg = d3.select("viz").append("svg") + .attr("width", container.scrollWidth) + .attr("height", container.scrollHeight); + + d3cola = cola.d3adaptor() + .linkDistance(120) + .avoidOverlaps(true) + .size([container.scrollWidth, container.scrollHeight]) + + d3cola.nodes(nodes) + .links(links) + .start(10,10,10) + + link = svg.selectAll(".link") + .data(graph.links) + .enter().append("line") + .attr("class", "link") ) -]) \ No newline at end of file +]) From 69f4fae22a4ccb0e13667bdd70996e0ddae85ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Aristar=C3=A1n?= Date: Wed, 17 Dec 2014 21:12:12 -0500 Subject: [PATCH 2/4] Merge branch 'master' of github.com:MacroConnections/node-mapper --- app/index.html | 40 +++++++--- app/scripts/lib/array.prototype.findIndex.js | 31 ++++++++ app/scripts/lib/cola.v3.min.js | 3 + app/scripts/lib/lodash.min.js | 56 ++++++++++++++ app/scripts/main.coffee | 77 ++++++++++++++++---- app/styles/styles.scss | 14 +++- 6 files changed, 197 insertions(+), 24 deletions(-) create mode 100644 app/scripts/lib/array.prototype.findIndex.js create mode 100644 app/scripts/lib/cola.v3.min.js create mode 100644 app/scripts/lib/lodash.min.js diff --git a/app/index.html b/app/index.html index 92420fa..a0f7c85 100644 --- a/app/index.html +++ b/app/index.html @@ -9,8 +9,8 @@ - - + + @@ -39,13 +39,35 @@
Connections: {{data.Connections.elements}}
-->
-
-
2. Configure
- -
Edge Label
- + +
  • +
    Node Color
    + +
  • +
  • +
    Edge Label
    + +
  • +
  • +
    Edge Opacity
    +