
remove node modules make new data file for web ui initial commit of dashboard switch back to non SSL request move port splitting to common place; add to node resource location Signed-off-by: Patrick Reilly <patrick@kismatic.io> various path fixes make svg path relative work around missing mime type Signed-off-by: Patrick Reilly <patrick@kismatic.io> fix paths fix karma path remove bad protractor test
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
angular.module('kubernetesApp.components.dashboard')
|
|
.factory('d3DashboardService', [
|
|
'$document',
|
|
'$q',
|
|
'$rootScope',
|
|
function($document, $q, $rootScope) {
|
|
var d = $q.defer();
|
|
function onScriptLoad() {
|
|
// Load client in the browser
|
|
$rootScope.$apply(function() { d.resolve(window.d3); });
|
|
}
|
|
// Create a script tag with d3 as the source
|
|
// and call our onScriptLoad callback when it
|
|
// has been loaded
|
|
var scriptTag = $document[0].createElement('script');
|
|
scriptTag.type = 'text/javascript';
|
|
scriptTag.async = true;
|
|
scriptTag.src = 'vendor/d3/d3.min.js';
|
|
scriptTag.onreadystatechange = function() {
|
|
if (this.readyState == 'complete') onScriptLoad();
|
|
};
|
|
scriptTag.onload = onScriptLoad;
|
|
|
|
var s = $document[0].getElementsByTagName('body')[0];
|
|
s.appendChild(scriptTag);
|
|
|
|
return {
|
|
d3: function() { return d.promise; }
|
|
};
|
|
}
|
|
]);
|