diff --git a/README.md b/README.md index 86979d88..696f851d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ GraphSpace has three dummy users: Requirements =================================== 1. Python v2.7.10 -2. [postgreSQL](https://github.com/Murali-group/GraphSpace/wiki/PostgreSQL-Installation) +2. [postgreSQL](https://github.com/Murali-group/GraphSpace/wiki/PostgreSQL-Installation) with pg_trgm extension 3. virtualenv 4. [bower](https://bower.io/) 5. [ElasticSearch](https://github.com/Murali-group/GraphSpace/wiki/Steps-for-setting-up-ElasticSearch-on-AWS) diff --git a/static/js/graphs_page.js b/static/js/graphs_page.js index 02da7544..70c37990 100644 --- a/static/js/graphs_page.js +++ b/static/js/graphs_page.js @@ -1725,6 +1725,21 @@ var graphPage = { $('#edgeSourceArrowShape').val(collection.style('source-arrow-shape')); $('#edgeTargetArrowShape').val(collection.style('target-arrow-shape')); $("#edgeLineColorPicker").colorpicker('setValue', collection.style('line-color')); + + + //if default (haystack, haystack-radius: 0 set to none + if (collection.style('curve-style') == "haystack" && collection.style("haystack-radius") == "0") + { + $("#edgeBend").val("none"); + } + else if (collection.style('curve-style') == "unbundled-bezier" && collection.style("control-point-distances") == "40 -40") + { + $("#edgeBend").val("unbundled-bezier2"); + } + else + { + $("#edgeBend").val(collection.style('curve-style')); + } collection.select(); } else { $('#edgeWidth').val(null); @@ -1850,6 +1865,74 @@ var graphPage = { } }); + $('#edgeBend').on('change', function (e) { + if (_.isEmpty($('#edgeBend').val())) { + return $.notify({ + message: 'Please enter valid edge type!', + }, { + type: 'warning' + }); + } else { + //none + //Do nothing + + //bezier + if ($('#edgeBend').val() == "bezier") + { + + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + "control-point-step-size": "40px", + 'curve-style': $('#edgeBend').val() + }); + } + //unbndled-bezier + else if ($('#edgeBend').val() == "unbundled-bezier") + { + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + "control-point-distances": "120", + "control-point-weights": "0.1", + 'curve-style': $('#edgeBend').val() + }); + } + //unbundled-bezier(multiple) + else if ($('#edgeBend').val() == "unbundled-bezier2") + { + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + "control-point-distances": "40 -40", + "control-point-weights": "0.25 0.75", + 'curve-style': "unbundled-bezier" + }); + } + //haystack + else if ($('#edgeBend').val() == "haystack") + { + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + "haystack-radius": "0.5", + 'curve-style': $('#edgeBend').val() + }); + } + //segments + else if ($('#edgeBend').val() == "segments") + { + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + "segment-weights": "0.25 0.75", + "segment-distances": "40 -40", + 'curve-style': $('#edgeBend').val() + }); + } + //none + else + { + graphPage.layoutEditor.edgeEditor.updateEdgeProperty({ + //Default settings + "haystack-radius": "0", + 'curve-style': "haystack" + }); + } + } + }); + + $('#nodeBackgroundColorPicker').on('changeColor', graphPage.layoutEditor.edgeEditor.onEdgeLineColorChange); } diff --git a/templates/graph/edge_editor.html b/templates/graph/edge_editor.html index 6a417731..4d36c8ed 100644 --- a/templates/graph/edge_editor.html +++ b/templates/graph/edge_editor.html @@ -57,6 +57,28 @@ + + +
+ +
+ +
+
+ + + + + + +