display svg icon

This commit is contained in:
Lee moon soo 2017-01-08 00:35:44 -08:00
parent 47de6d9684
commit fb7a1471df
6 changed files with 20 additions and 9 deletions

View file

@ -16,9 +16,9 @@
angular.module('zeppelinWebApp').controller('HeliumCtrl', HeliumCtrl);
HeliumCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
HeliumCtrl.$inject = ['$scope', '$rootScope', '$http', '$sce', 'baseUrlSrv', 'ngToast'];
function HeliumCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
function HeliumCtrl($scope, $rootScope, $http, $sce, baseUrlSrv, ngToast) {
$scope.packageInfos = {};
$scope.defaultVersions = {};
@ -27,7 +27,9 @@
// show enabled version if any version of package is enabled
for (var name in packageInfos) {
var pkgs = packageInfos[name];
for (var pkg in pkgs) {
for (var pkgIdx in pkgs) {
var pkg = pkgs[pkgIdx];
pkg.pkg.icon = $sce.trustAsHtml(pkg.pkg.icon);
if (pkg.enabled) {
defaultVersions[name] = pkg;
}

View file

@ -29,7 +29,7 @@ limitations under the License.
style="margin-bottom:20px">
<div class="col-md-12">
<div style="height:25px">
<div style="float:left;width:20px;height:20px"
<div style="float:left;width:28px;height:22px;padding:2px;2px;2px;2px"
ng-bind-html=pkgInfo.pkg.icon></div>
<b style="float:left">{{pkgName}}</b>
<div ng-show="!pkgInfo.enabled"

View file

@ -36,6 +36,7 @@ import ScatterchartVisualization from '../../../visualization/builtins/visualiza
'$http',
'$q',
'$templateRequest',
'$sce',
'websocketMsgSrv',
'baseUrlSrv',
'ngToast',
@ -45,7 +46,7 @@ import ScatterchartVisualization from '../../../visualization/builtins/visualiza
];
function ResultCtrl($scope, $rootScope, $route, $window, $routeParams, $location,
$timeout, $compile, $http, $q, $templateRequest, websocketMsgSrv,
$timeout, $compile, $http, $q, $templateRequest, $sce, websocketMsgSrv,
baseUrlSrv, ngToast, saveAsService, noteVarShareService, heliumService) {
/**
@ -161,7 +162,7 @@ import ScatterchartVisualization from '../../../visualization/builtins/visualiza
$scope.builtInTableDataVisualizationList.push({
id: vis.id,
name: vis.name,
icon: vis.icon
icon: $sce.trustAsHtml(vis.icon)
});
builtInVisualizations[vis.id] = {
class: vis.class
@ -435,7 +436,7 @@ import ScatterchartVisualization from '../../../visualization/builtins/visualiza
builtInViz.instance.resize();
});
} catch (err) {
console.log('Graph drawing error %o', err);
console.error('Graph drawing error %o', err);
}
} else {
$timeout(retryRenderer, 10);

View file

@ -17,6 +17,11 @@
height: 30px;
}
.result-chart-selector button svg {
width: 100%;
height: 100%;
}
.rotate90 {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);

View file

@ -31,7 +31,7 @@
if (response.substring(0, 'ERROR:'.length) !== 'ERROR:') {
eval(response);
} else {
console.log(response);
console.error(response);
}
});

View file

@ -175,7 +175,10 @@ public class HeliumVisualizationFactory {
File tabledataModuleInstallPath = new File(workingDirectory,
"node_modules/zeppelin-tabledata");
if (tabledataModulePath != null && !tabledataModuleInstallPath.exists()) {
FileUtils.copyDirectory(tabledataModulePath, tabledataModuleInstallPath, npmPackageCopyFilter);
FileUtils.copyDirectory(
tabledataModulePath,
tabledataModuleInstallPath,
npmPackageCopyFilter);
}
// install visualization module