Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
83 changes: 83 additions & 0 deletions static/js/graphs_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

}
Expand Down
22 changes: 22 additions & 0 deletions templates/graph/edge_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@
</select>
</div>
</div>


<div class="form-group">
<label for="edgeBend" class="col-sm-4 control-label">Edge Type</label>
<div class="col-sm-8">
<select id="edgeBend" class="form-control">
<option value="none">none</option>
<option value="bezier">bezier</option>
<option value="unbundled-bezier">unbundled-bezier</option>
<option value="unbundled-bezier2">unbundled-bezier(multiple)</option>
<option value="haystack">haystack</option>
<option value="segments">segments</option>
</select>
</div>
</div>







</div>
</li>
<li>
Expand Down