2 * Copyright (c) 2014 DataTorrent, Inc. ALL Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 .config(function ($routeProvider) {
23 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/view.html',
24 controller: 'DemoCtrl',
26 description: 'This is the simplest demo.'
29 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/view.html',
30 controller: 'ResizeDemoCtrl',
32 description: 'This demo showcases widget resizing.'
34 .when('/custom-settings', {
35 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/view.html',
36 controller: 'CustomSettingsDemoCtrl',
37 title: 'custom widget settings',
38 description: 'This demo showcases overriding the widget settings dialog/modal ' +
39 'for the entire dashboard and for a specific widget. Click on the cog of each ' +
40 'widget to see the custom modal. \n"configurable widget" has "limit" option in the modal ' +
41 'that controls RandomDataModel.'
43 .when('/explicit-saving', {
44 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/view.html',
45 controller: 'ExplicitSaveDemoCtrl',
46 title: 'explicit saving',
47 description: 'This demo showcases an option to only save the dashboard state '+
48 'explicitly, e.g. by user input. Notice the "all saved" button in the controls ' +
49 'updates as you make saveable changes.'
52 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/layouts.html',
53 controller: 'LayoutsDemoCtrl',
54 title: 'dashboard layouts',
55 description: 'This demo showcases the ability to have "dashboard layouts", ' +
56 'meaning the ability to have multiple arbitrary configurations of widgets. For more ' +
57 'information, take a look at [issue #31](https://github.com/DataTorrent/malhar-angular-dashboard/issues/31)'
60 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/layouts.html',
61 controller: 'LayoutsDemoExplicitSaveCtrl',
62 title: 'layouts explicit saving',
63 description: 'This demo showcases dashboard layouts with explicit saving enabled.'
69 .controller('NavBarCtrl', function($scope, $route) {
70 $scope.$route = $route;
72 .factory('widgetDefinitions', function(RandomDataModel) {
76 directive: 'wt-scope-watch',
87 directive: 'wt-scope-watch',
88 dataAttrName: 'value',
89 dataModelType: RandomDataModel
93 templateUrl: 'app/fusion/scripts/view-models/reportdashboard-page/src/app/template/resizable.html',
95 class: 'demo-widget-resizable'
100 directive: 'wt-fluid',
107 name: 'raptor-report-data',
108 directive: 'raptor-report-data',
115 name: 'raptor-report-chart',
116 directive: 'raptor-report-chart',
124 directive: 'r-cloud',
133 .value('defaultWidgets', [
134 // { name: 'random' },
136 // { name: 'datamodel' },
150 // {"name":"raptor-report","title":"Spam Source Line Chart","style":{},"size":{"height":"450px","width":"40%"},"attrs":{"value":"randomValue"},"report_id":"3360"}
153 .controller('DemoCtrl', function ($scope, $interval, $window, widgetDefinitions, defaultWidgets) {
155 $scope.dashboardOptions = {
157 widgetDefinitions: widgetDefinitions,
158 defaultWidgets: defaultWidgets,
159 storage: $window.localStorage,
160 storageId: 'demo_simple'
162 $scope.randomValue = Math.random();
163 $interval(function () {
164 $scope.randomValue = Math.random();