Commit e39a8c68 authored by Fintan Mc Gee's avatar Fintan Mc Gee

Merge branch 'develop'

parents d25c241f 5716fe56
......@@ -28,7 +28,9 @@ var express = require("express"), // a web application framework
rServer = require("./rServer.js"),
config = cfg.config,
sLog = require("./serverLogging.js");
sLog = require("./serverLogging.js"),
archiver = require('archiver');
//require('array.prototype.find');
//r = require('request'); // the request module applies nice syntactic sugar and functionality on top of HTTP module
......@@ -536,7 +538,10 @@ var updateLayer_cb = function (req, res) {
//var updatedNodeCount = graphObj.userGraphs[req.user.username].updatePositions(req.body.positionMap);
if(req.body.operationType === "createEmptyLayer") {
graphObj.userGraphs[req.user.username].createEmptyLayer(req.body.layerName);
} else if(req.body.operationType === "addNodeLabelToLayer") {
}else if(req.body.operationType === "deleteLayer") {
graphObj.userGraphs[req.user.username].deleteLayer(req.body.layerName);
}else if(req.body.operationType === "addNodeLabelToLayer") {
graphObj.userGraphs[req.user.username].addNodeLabelToLayer(req.body.layerName,req.body.masterNodeType);
}else if(req.body.operationType === "addLinkTypeToLayer") {
graphObj.userGraphs[req.user.username].addLinkTypeToLayer(req.body.layerName,req.body.masterEdgeType);
......@@ -553,6 +558,11 @@ var updateLayer_cb = function (req, res) {
//(targetLayerName,masterProjectionNodeTypes, masterProjectionEdgeTypes, projectionEdgeType)
graphObj.userGraphs[req.user.username].projectNodesInLayer(req.body.layerName,req.body.masterNodeType,req.body.masterEdgeType,req.body.newProjectionEdgeType)
}
/*else if(req.body.operationType === "copyNodeToLayer") {
//(targetLayerName,masterProjectionNodeTypes, masterProjectionEdgeTypes, projectionEdgeType)
var node= graphObj.userGraphs[req.user.username].node[req.body.nodeId]
graphObj.userGraphs[req.user.username].getLayerByName(req.body.layerName).copyNodeToLayer(node);
}*/
else {
sLog.log("***********updateLayer: Unknow operation for server Update" + "\n\n");
}
......@@ -813,6 +823,51 @@ simple_serve.get('/writeDebugCSV', blizaarSystem.ensureAuthenticated,function(r
res.json({msg: "CSV files written to server"})
});
});
simple_serve.get('/getTSVData', blizaarSystem.ensureAuthenticated,function(req,res) {
var csvData = graphObj.convertToCSVDataStructure(graphObj.userGraphs[req.user.username]);
// data structure will contain nodes and links for all layers
var dateObject= new Date();
var dateString = dateObject.toISOString();
dateString = dateString.replace(/:/g,"_");
var graphDirName = '/savedGraphs/' + req.user.username + "_"+ dateString;
fs.mkdir( __dirname + graphDirName,function() {
var layer;
for (layer in csvData) {
fs.writeFileSync("./" + graphDirName + "/" + layer + "_nodes.tsv", csvData[layer].nodes);
fs.writeFileSync("./" + graphDirName + "/" + layer + "_links.tsv", csvData[layer].links);
}
var output = fs.createWriteStream( './' + graphDirName + '.zip');
var archive = archiver('zip', {
zlib: { level: 9 } // Sets the compression level.
});
output.on('close', function() {
console.log(archive.pointer() + ' total bytes');
console.log('TSV archive has been finalized and the output file descriptor has closed.');
// res.json({msg: "TSV Files added to zip files written to server"})
res.download('./' + graphDirName + '.zip')
});
output.on('end', function() {
console.log('Data has been drained');
});
// good practice to catch this error explicitly
archive.on('error', function(err) {
throw err;
});
archive.pipe(output);
archive.directory('./' + graphDirName + '/', false);
archive.finalize();
// res.json({msg: "CSV files written to server"})
});
});
// below lnes fare for testing marias R functionality
// simple_serve.get('/sendDebugJSONtoR', blizaarSystem.ensureAuthenticated,function(req,res) {
// // var csvData = graphObj.convertToCSVDataStructure(graphObj.userGraphs[req.user.username]);
......
......@@ -84,6 +84,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-rc7/vega-embed.js"></script>
<!--<script src="./node_modules/vega-lite/build/vega-lite.min.js"></script>-->
<script src="http://marvl.infotech.monash.edu/webcola/cola.v3.min.js"></script>
<!--color brewer-->
<script src="./node_modules/colorbrewer/colorbrewer.js"></script>
<!-- hiveplot lib-->
......@@ -136,6 +137,8 @@
<script src="js/controllers/combinedListViewController.js"></script>
<script src="js/controllers/simpleNodeLinkController.js"></script>
<script src="js/controllers/hivePlotController.js"></script>
<script src="js/controllers/aspectSelectionController.js"></script>
<script src="js/controllers/sideMenuController.js"></script>
<!-- Font-->
<!--Directives-->
......@@ -162,6 +165,7 @@
<script src="./js/directives/edgeAttributeBarChartDirective.js"></script>
<script src="./js/directives/attributeTimeHistogramDirective.js"></script>
<script src="./js/directives/edgeHistogramDirective.js"></script>
<script src="./js/directives/svgLabelsDirective.js"></script>
<!--Services-->
<script src="./js/services/multiLayerGraphService.js"></script>
<script src="./js/services/dataService.js"></script>
......
......@@ -188,10 +188,19 @@
/*border-color: #787878;*/
/*}*/
.bordered-graph{
border-style: solid;
border-color: #787878;
height: 90vh;
width: 95vw;
overflow-y: auto;
overflow-x: auto;
}
.bordered-graph-list{
border-style: solid;
border-color: #787878;
height: 764px;
width: 100%;
height: 84vh;
width: 95vw;
overflow-y: auto;
overflow-x: auto;
}
......@@ -436,6 +445,16 @@ position: relative;
padding: 0px;
}
.smallTable{
font-size: 10px;
height: 14px;
padding-top: 0px;
padding-right: 2px;
padding-bottom: 0px;
padding-left: 2px;
text-align:center;
}
.ListGraphHeaderForm{
font-size: 12px;
height: 20px;
......
<ng-include src="'./html/templates/userServerGraphsSmall.html'"></ng-include>
<ng-include src="'./html/templates/topAspectDataToolBar.html'"></ng-include>
<H2 class="centered"><span>Bio Data View</span></H2>
<div ng-controller="bioListViewCtrl" >
<div style="position:absolute; width:100%">
......
<ng-include src="'./html/templates/userServerGraphsSmall.html'"></ng-include>
<H2 class="centered"><span>Digital Humanities List View</span></H2>
<ng-include src="'./html/templates/topAspectDataToolBar.html'"></ng-include>
<!--<H2 class="centered"><span>Digital Humanities List View</span></H2>-->
<div ng-controller="DHListViewCtrl" >
<ng-include src="'./html/templates/sideMenus.html'"></ng-include>
<div style="position:relative;display:inline-block;width: 95%;">
......@@ -69,7 +69,7 @@
<!--<div class="row">-->
<!--<div class="col-sm-2">-->
<!--</div>-->
<list-view-directive class="bordered-graph" hidemasterlayer="true"
<list-view-directive class="bordered-graph-list" hidemasterlayer="true"
clickfunc="highlight"></list-view-directive>
<div class="centeredDiv" id="graphDiv"></div>
......
This diff is collapsed.
<!--<H2 class = "centered"><span>Node Link</span></H2>-->
<ng-include src="'./html/templates/topAspectDataToolBar.html'"></ng-include>
<ng-include src="'./html/templates/sideMenus.html'"></ng-include>
<ng-include src="'./html/templates/warningMessage.html'"></ng-include>
<div style="position:relative;display:inline-block;width: 95%;">
<svg-labels-directive class="bordered-graph"></svg-labels-directive>
<!--<div class ="centeredDiv" id="graphDiv"></div><ng-include src="'./html/templates/simpleGraphOptions.html'"></ng-include>-->
<div id="tooltip"></div>
<div id="nodeInfo"></div>
</div>
\ No newline at end of file
<h2 class="page-header">Small Multiples View</h2>
<ng-include src="'./html/templates/topAspectDataToolBar.html'"></ng-include>
<!--<h2 class="page-header">Small Multiples View</h2>-->
<div style="position: relative;">
<div style="z-index: 1;" ng-controller="multipleLayersCtrl" class="centeredDiv">
......
<H2 class = "centered"><span>SVG Rendering</span></H2>
<!--<H2 class = "centered"><span>SVG Rendering</span></H2>-->
<svg-directive class="bordered-graph"></svg-directive>
<div class ="centeredDiv" id="graphDiv"></div>
<ng-include src="'./html/templates/simpleGraphOptions.html'"></ng-include>
<div id="tooltip"></div><
<div id="tooltip"></div>
<div id="nodeInfo"></div>
<div class="centeredDiv" >
<table class="table table-striped">
<tr>
<tr ng-show="getControlVisibility('nodeLinkView')">
<th class="info tr-options"> Icons</th>
<td>
<div class="centeredDiv" ng-controller="iconsCtrl">
<label class="switchCustom">
<input type="checkbox" ng-model="model.displayIcons">
<div class="customSlider round"></div>
</label>
<label class="switchCustom">
<input type="checkbox" ng-model="model.displayIcons">
<div class="customSlider round"></div>
</label>
</div>
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th class="info tr-options">Layer Display Options</th>
<td>
<label class="switchCustom">
<input type="checkbox" ng-model="model.showMasterLayer" ng-change="refreshGraph()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Show Master Layer</label>
</td>
<td> <label class="switchCustom">
<tr ng-show="getControlVisibility('listView')">
<th class="info tr-options">List Display Options</th>
<td>
<label class="switchCustom">
<input type="checkbox" ng-model="model.showMasterLayer" ng-change="updateListDisplayValues()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Show Master Layer</label>
</td>
<td> <label class="switchCustom">
<input type="checkbox" ng-model="model.showIntraLayerEdges" ng-change="refreshGraph()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Within Layer Edges</label>
</td>
<td>
<label class="switchCustom">
<input type="checkbox" ng-model="model.showInterLayerEdges" ng-change="refreshGraph()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Between Layer Edges</label>
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<input type="checkbox" ng-model="model.showIntraLayerEdges" ng-change="updateListDisplayValues()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Within Layer Edges</label>
</td>
<td>
<label class="switchCustom">
<input type="checkbox" ng-model="model.showInterLayerEdges" ng-change="updateListDisplayValues()" >
<div class="customSlider round"></div>
</label>
<br />
<label>Between Layer Edges</label>
</td>
</tr>
</table>
</div>
<div class="centeredDiv" ng-controller="GraphLayoutCtrl">
<table class="table table-striped">
<tr ng-show="getControlVisibility('nodeLinkView')">
<th class="info tr-options"> Force Layout </th>
<td>
<button class="btn btn-default" id="layoutGraph" ng-click="setLayoutValues()">Layout</button>
</td>
<td> <label>Force Charge</label></td>
<td><input class="form-control" type="number" id="charge" min="-1000" max="-1" value="-120" ng-model="model.charge"> </td>
<td><label>Link Distance:</label> </td>
<td> <input class="form-control" type="number" id="linkDistance" min="1" max="1000" value="20" ng-model="model.linkDistance"></td>
</tr>
<tr ng-show="getControlVisibility('nodeLinkView')">
<th class="info tr-options"> Node Overlap </th>
<td>
<button class="btn btn-default" id="layoutGraph" ng-click="reduceOverlap()">Reduce Overlap</button>
</td>
<td></td>
<td> </td>
<td><label>Separation Distance:</label> </td>
<td> <input class="form-control" type="number" id="linkDistance" min="1" max="1000" value="20" ng-model="model.separationDistance"></td>
</tr>
<tr ng-show="getControlVisibility('listView')">
<th class="info tr-options"> List Ordering </th>
<td>
<button class="btn btn-default" id="layoutGraph" ng-click="doGlobalOrdering()">Global Order</button>
</td>
<td>
<label>Attribute:</label>
</td>
<td>
<select class="form-control" id="sortAttributeSelect" ng-model="model.selectedSortAttribute">
<option ng-selected="{{sortAttributeName == model.selectedSortAttribute}}" ng-repeat="sortAttributeName in model.sortAttributes" value="{{sortAttributeName}}">{{sortAttributeName}}</option>
</select>
</td>
<td>
<label>Sort Order:</label>
</td>
<td>
<select class="form-control" id="sortDirectionSelect" ng-model="model.selectedSortDirection">
<option ng-repeat="sortDirection in model.sortDirections" value="{{sortDirection}}">{{sortDirection}}</option>
</select>
</td>
</tr>
</table>
<div class="centeredDiv" ng-controller="serverLayoutCtrl" ng-init="initializeServerLayout()">
<table class="table table-striped">
<tr ng-show="getControlVisibility('nodeLinkView')">
<th class="info tr-options"> Server Layout </th>
<td>
<button class="btn btn-default" id="doServerLayout" ng-click="doServerLayout()">calculate</button>
</td>
<td> <label>Layout Name:</label></td>
<td><select class="form-control" id="serverLayoutSelect" ng-model="model.layoutName">
<option ng-repeat="layoutName in model.layoutList" value="{{layoutName}}">{{layoutName}}</option>
</select> </td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</div>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<td style="padding:2px;"> <button class="btn btn-default" title="Visual Settings for the Current View" id="visualButton" ng-click="clickButton('Visual_settings','options_modal_expandable',0)"><span class="glyphicon glyphicon-eye-open"></span></button></td>
</tr>
<tr>
<td style="padding:2px;"> <button class="btn btn-default" id="tooltipButton" title="Settings for the tool tip when hovering ona node" ng-click="clickButton('Tooltip','options_modal_expandable',0)"><span class="glyphicon glyphicon-question-sign"></span></button></td>
<td style="padding:2px;"> <button class="btn btn-default" id="tooltipButton" title="Settings for the tool tip when hovering on a node" ng-click="clickButton('Tooltip','options_modal_expandable',0)"><span class="glyphicon glyphicon-question-sign"></span></button></td>
</tr>
<tr>
<td style="padding:2px;"> <button class="btn btn-default" id="centralitiesButton" title="Calculation of network centralities and node resizing" ng-click="clickButton('Centralities','options_modal_expandable',0)"><span class=" glyphicon glyphicon-record"></span></button></td>
......
<div class="col-md-6 smallForm" ng-controller="AspectSelectionCtrl" ng-init="initializeAspects()">
<div class="col-md-1 smallForm" > <span ng-show="getControlVisibility('aspect')">Aspect Name:</span></div>
<!--<div class="col-md-1 smallForm">-->
<!--<div class="btn btn-default smallForm" ng-click="updateAspects()">Update</div>-->
<!--</div>-->
<div class="col-md-2 smallForm" >
<select class="form-control smallForm" id="serverGraphNames" ng-model="model.selectedAspectName" ng-change="changeAspect()" ng-show="getControlVisibility('aspect')">
<option ng-selected="{{sAspect == model.selectedAspectName}}" ng-repeat="sAspect in model.availableAspects" value="{{sAspect}}">{{sAspect}}</option>
</select>
</div>
<div class="col-md-1 smallForm"></div>
<div class="col-md-1 smallForm" > <span ng-show="getControlVisibility('layers')">Layer Name:</span></div>
<!--<div class="col-md-1 smallForm">-->
<!--<div class="btn btn-default smallForm" ng-click="updateAspects()">Update</div>-->
<!--</div>-->
<div class="col-md-2 smallForm" >
<select class="form-control smallForm" id="topLayerNameSelect" ng-model="model.selectedLayerLocal" ng-show="getControlVisibility('layers')">
<option ng-selected="{{layerName == model.selectedLayerLocal}}" ng-repeat="layerName in model.layerList" value="{{layerName}}">{{layerName}}</option>
</select>
</div>
<div class="col-md-5 smallForm">
</div>
</div>
\ No newline at end of file
<div style="position:absolute; width:100%">
<div style="position:absolute; width:100%" ng-controller="SideMenuCtrl">
<div id="options_modal_expandable" class="modal-dialog modal-lg"
style="transform: translate(-95%, 0px);position: absolute; z-index: 2; left:0" ng-controller="NavBarCtrl">
style="transform: translate(-95%, 0px);position: absolute; z-index: 2; left:0" >
<div class="modal-content">
<div class="modal-header">
<ul class="nav nav-tabs">
......@@ -42,7 +42,7 @@
</div>
<div id="options_modal_expandable2" class="modal-dialog modal-lg"
style="transform: translate(95%, 0px);right: 0;z-index: 2; position: absolute" ng-controller="NavBarCtrl">
style="transform: translate(95%, 0px);right: 0;z-index: 2; position: absolute">
<div class="modal-content">
<div class="modal-header">
<ul class="nav nav-tabs">
......
<div class ="centeredDiv">
<div class="row">
<ng-include src="'./html/templates/aspectSelection.html'"></ng-include>
<ng-include src="'./html/templates/userServerGraphsSmall.html'"></ng-include>
</div>
</div>
\ No newline at end of file
<div class ="centeredDiv" ng-controller="GraphSaveAndLoadCtrl" ng-init="initializeSources()">
<div class="row">
<div class="col-md-6 smallForm"></div>
<div class="col-md-6 smallForm">
<div class="col-md-4 smallForm"></div>
<div class="col-md-1 smallForm"> Work in Progress:</div>
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm" ng-click="saveGraphOnServer()">Save</div>
</div>
<div class="col-md-2 smallForm">
<input type="text" id="saveGraphName" class="form-control smallForm" ng-model="model.saveGraphName">
</div>
<div class="col-md-6 smallForm" ng-controller="GraphSaveAndLoadCtrl" ng-init="initializeSources()">
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm " ng-click="downloadGraphFromServer()">TSV</div>
</div>
<div class="col-md-4 smallForm"></div>
<!--<div class="col-md-1 smallForm"> Work in Progress:</div>-->
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm" ng-click="saveGraphOnServer()">Save</div>
</div>
<div class="col-md-2 smallForm">
<input type="text" id="saveGraphName" class="form-control smallForm" ng-model="model.saveGraphName">
</div>
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm " ng-click="loadGraphFromServer()">Load</div>
</div>
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm " ng-click="loadGraphFromServer()">Load</div>
</div>
<!--<div class="col-md-1 smallForm">-->
<!--<div class="btn btn-default smallForm " ng-click="deleteGraphFromServer()">Delete</div>-->
<!--&lt;!&ndash;<div class="btn btn-default smallForm " ng-click="loadGraphFromServer()">Load</div>&ndash;&gt;-->
<!--</div>-->
<div class="col-md-2 smallForm">
<select class="form-control smallForm" id="serverGraphNames" ng-model="model.loadGraphName" >
<option ng-repeat="sGraph in model.availableServerGraphs" value="{{sGraph}}">{{sGraph}}</option>
</select>
</div>
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm " ng-click="deleteGraphFromServer()">Delete</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="col-md-2 smallForm">
<select class="form-control smallForm" id="serverGraphNames" ng-model="model.loadGraphName">
<option ng-repeat="sGraph in model.availableServerGraphs" value="{{sGraph}}">{{sGraph}}</option>
</select>
</div>
<div class="col-md-1 smallForm">
<div class="btn btn-default smallForm " ng-click="deleteGraphFromServer()">Delete</div>
</div>
</div>
......@@ -20,6 +20,9 @@ angular.module(
$routeProvider.when('/svgView', {
templateUrl: 'html/partials/svgGraphDisplay.html'
});
$routeProvider.when('/nodeLink', {
templateUrl: 'html/partials/nodeLinkDisplay.html'
});
$routeProvider.when('/canvas2dView', {
templateUrl: 'html/partials/canvasGraphDisplay.html'
});
......
This diff is collapsed.
/**
* Created by Fitnan MCGee on .06032018
*/
angular.module('blizaarModule.controllers')
.controller('SideMenuCtrl', ['$scope', '$location','dataService', function($scope, $location,dataService) {
console.log("SideMenuCtrl installed");
$scope.model = {};
// $scope.model.leftItemName = 'view_expandable';
$scope.model.leftItemName = 'left_buttons';
$scope.model.rightItemName = 'right_buttons';
// left item is index 0, right item is index1
$scope.model.optionVisibility = [false,false];
// display Variables
$scope.model.displayIcons;
$scope.model.showMasterLayer = false;
$scope.model.showIntraLayerEdges = false;
$scope.model.showInterLayerEdges = false;
$scope.isActive = function(viewLocation){
return viewLocation === $location.path();
};
$scope.isLeftItemActive = function(itemName){
// console.log(itemName, itemName==$scope.model.leftItemName);
return itemName === $scope.model.leftItemName;
};
$scope.clickLeftItem= function(itemName){
if(itemName !== $scope.model.leftItemName)
{
// var oldName = $scope.model.leftItemName;
$('#'+$scope.model.leftIt/emName).css('width', '20%');
$scope.model.leftItemName = itemName;
$('#'+itemName).css('width', '80%');
}
};
$scope.clickItem = function(itemName){
// console.log(itemName, itemName==$scope.model.leftItemName);
$scope.model.leftItemName=itemName;
console.log(itemName, itemName===$scope.model.leftItemName)
};
$scope.switchOptionVisibility = function(id,hideTranslatePercentage,showTranslatePercentage, index){
$scope.model.optionVisibility[index] = !$scope.model.optionVisibility[index];
if($scope.model.optionVisibility[index]){
$('#'+id).css('transform','translate(' + showTranslatePercentage + '%, 0px)');
}
else{
$('#'+id).css('transform','translate(' + hideTranslatePercentage + '%, 0px)');
}
};
$scope.clickButton = function(itemName, sourceID,index){
// index is used to identify the visbility index ( i.e. which should be shown or hidden
// console.log(itemName, itemName==$scope.model.leftItemName);
if(index == 1) {
$scope.model.rightItemName = itemName;
} else {
$scope.model.leftItemName = itemName;
}
//console.log(itemName, itemName===$scope.model.leftItemName);
$scope.switchOptionVisibility(sourceID, -95, 0,index);
};
$scope.init = function() {
$scope.model.displayIcons = $scope.getDisplayIcons();
if($scope.getShowMasterLayer) {
$scope.model.showMasterLayer = $scope.getShowMasterLayer();
$scope.model.showIntraLayerEdges = $scope.getShowIntraLayerEdges();
$scope.model.showInterLayerEdges = $scope.getShowInterLayerEdges();
}
}
$scope.updateIcons = function() {
$scope.setDisplayIcons($scope.model.displayIcons);
}
$scope.updateListDisplayValues = function() {
if( $scope.setShowMasterLayer) {
$scope.setShowMasterLayer($scope.model.showMasterLayer);
$scope.setShowIntraLayerEdges($scope.model.showIntraLayerEdges);
$scope.setShowInterLayerEdges($scope.model.showInterLayerEdges);
$scope.refreshGraph();
}
}
}]);
\ No newline at end of file
......@@ -38,16 +38,23 @@ angular.module('blizaarModule.controllers', [])
$scope.model.QBEDistinctNodes = undefined;
$scope.model.graphSummary = {nodeCount:0,nodeTypes:[],edgeCount:0,edgeTypes:[]};
$scope.model.queryHistory = []; // keep history of query operations sent to the back end//
$scope.model.displayIcons = false;
$scope.model.multiLayerGraph = null;
$scope.model.selectedLayer = ["MasterLayer"];
$scope.model.selectedAspectLayers = [];
$scope.model.selectedAspectName = "Master";
$scope.model.availableAspects = [];
$scope.model.showWarningText =false; // used to show warning messages tzo user
$scope.model.warningBoldText = "Warning Text"; // Bold text to be displayed at start of bootstrap alert
$scope.model.warningTextBody = "Warning Text Body"; // Bold text to be displayed at start of bootstrap alert
$scope.model.controlVisibility = {aspect:true, layers:true, download:true, saveLoad:true, listView: false, nodeLinkView:false } // a set fof variabel used to determine if some fields are to be displayed in specific views
// Declare the list of accessible files
// $scope.model.availableNodeLabels = []; // Deprecated by filter controller
// Declare the selected file
......@@ -166,12 +173,20 @@ angular.module('blizaarModule.controllers', [])
});
xScale = d3.scaleLinear().domain([minX-10, maxX+10]).range([edgeBuffer, width - edgeBuffer]);
yScale = d3.scaleLinear().domain([minY-10, maxY+10]).range([edgeBuffer, height - edgeBuffer]);
var maxX =-999999, maxY = -9999999, minY = 9999999999 , minX = 9999999999999 ;
graph.nodes.forEach(function (n) {
n.x = xScale(n.x);
n.y = yScale(n.y);
n.px = n.x;
n.py = n.y;
// if(n.x > maxX) maxX = n.x;
// if(n.y > maxY) maxY = n.y;
// if(n.x < minX) minX = n.x;
// if(n.y < minY) minY = n.y;
});
// console.log("Rescale Complete: Graph nodes in the range from [" + minX + "," + minY+ "] to ["+ maxX + ","+ maxY+ "]");
};
// Handle the event of changing rendering type or file name
......@@ -588,6 +603,11 @@ angular.module('blizaarModule.controllers', [])
return $scope.model.displayIcons;
}
$scope.setDisplayIcons = function(val ){
$scope.model.displayIcons = val;
}
$scope.getUseDrag = function(){
return $scope.model.useDrag;
}
......@@ -595,10 +615,98 @@ angular.module('blizaarModule.controllers', [])
return $scope.model.useLasso;
}
$scope.getGlobalSelectedAspect= function(){
return $scope.model.selectedAspectName;
}
$scope.setGlobalSelectedAspectNoRefresh= function(aspectName){
$scope.model.selectedAspectName = aspectName;
}
$scope.setGlobalSelectedAspect= function(aspectName){
$scope.model.selectedAspectName = aspectName;
$scope.model.selectedAspectLayers = [];
angular.element(document).ready(function () {
$rootScope.$broadcast ('refreshGraph');
});
}
$scope.refreshAspectList = function() {
angular.element(document).ready(function () {
$rootScope.$broadcast('aspectsUpdated');
});