Skip to content
Open
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
27 changes: 17 additions & 10 deletions angular-vis.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
angular.module('ngVis', [])

.factory('VisDataSet', function () {
'use strict';

.factory('vis', ['$window', function ($window) {
// Create the global vis object
if (!$window.vis) {
return {};
}
return $window.vis;
}])

.factory('VisDataSet', ['vis', function (vis) {
return function (data, options) {
// Create the new dataSets
return new vis.DataSet(data, options);
};
})
}])

/**
* TimeLine directive
*/
.directive('visTimeline', function () {
.directive('visTimeline', ['vis', function (vis) {
'use strict';
return {
restrict: 'EA',
Expand Down Expand Up @@ -73,12 +80,12 @@ angular.module('ngVis', [])
});
}
};
})
}])

/**
* Directive for network chart.
*/
.directive('visNetwork', function () {
.directive('visNetwork', ['vis', function (vis) {
return {
restrict: 'EA',
transclude: false,
Expand Down Expand Up @@ -159,12 +166,12 @@ angular.module('ngVis', [])
});
}
};
})
}])

/**
* Directive for graph2d.
*/
.directive('visGraph2d', function () {
.directive('visGraph2d', ['vis', function (vis) {
'use strict';
return {
restrict: 'EA',
Expand Down Expand Up @@ -223,5 +230,5 @@ angular.module('ngVis', [])
});
}
};
})
}])
;