-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
rest_service/src/main/resources/static/scripts/controllers/controller.rankings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* The controller for the analytics view. | ||
*/ | ||
(function () { | ||
'use strict'; | ||
|
||
angular | ||
.module('ostMapApp') | ||
.controller('RankingsCtrl', RankingsCtrl); | ||
|
||
/** | ||
* Inject all dependencies for the controller | ||
* $scope to interact with the view | ||
* @type {string[]} | ||
*/ | ||
RankingsCtrl.$inject = [ | ||
'$scope', | ||
'httpService', | ||
]; | ||
|
||
/** | ||
* The controller logic | ||
* | ||
* @param $scope | ||
* @constructor | ||
*/ | ||
function RankingsCtrl($scope, httpService) { | ||
// httpService.getHighScoreFromServer(); | ||
// $scope.data.highScore = httpService.getHighScore(); | ||
$scope.data = [] | ||
$scope.data.highScore = {"area":[{"user":"Zorne","area":6174893.727618582,"coordinates":[[-0.2147884,-0.4614716],[27.2147884,38.4614716],[49,26.546974]]},{"user":"Falk","area":2465661.8600413124,"coordinates":[[0,0],[10,10],[10,20],[20,0]]},{"user":"Oliver","area":54980.275141825,"coordinates":[[-2.2147884,52.4614716],[-4.2147884,54.4614716],[-5.2147884,55.4614716],[-8.2147884,53.4614716]]}],"path":[{"user":"Zorne","distance":7589.900654023497,"coordinates":[[49,26.546974],[27.2147884,38.4614716],[-0.2147884,-0.4614716]]},{"user":"Falk","distance":5818.530021620169,"coordinates":[[0,0],[20,0],[10,20],[10,10],[10,10],[10,10],[10,10]]},{"user":"Peter","distance":4925.676750216901,"coordinates":[[-3.2147884,53.4614716],[47.2147884,28.4614716]]},{"user":"Oliver","distance":1062.1904270002783,"coordinates":[[-3.2147884,53.4614716],[-4.2147884,54.4614716],[-5.2147884,55.4614716],[-2.2147884,52.4614716],[-8.2147884,53.4614716]]}]} | ||
|
||
|
||
$scope.goToHighScoreArea = function() { | ||
//TODO: move map to highscore, render area | ||
} | ||
$scope.goToHighScoreDistance = function() { | ||
//TODO: move map to highscore, render path | ||
} | ||
|
||
} | ||
})(); |
100 changes: 30 additions & 70 deletions
100
rest_service/src/main/resources/static/views/analyticsView.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,35 @@ | ||
<br> | ||
<div class="analyticsViewContainer" > | ||
<!--<uib-tabset active="active">--> | ||
<!--<uib-tab index="0" heading="Tweet Frequency">--> | ||
<br> | ||
<div class="btn-group "> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="0">Now</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="60">1h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="120">2h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="240">4h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="360">6h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="720">12h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="1440">1d</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="2880">2d</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="5760">4d</label> | ||
</div> | ||
<div class="btn-group"> | ||
<label class="btn btn-danger btn-lg" ng-click="autoUpdate()" ng-model="autoUpdateEnabled" uib-btn-checkbox>AutoUpdate</label> | ||
<label class="btn btn-danger btn-lg" ng-click="updateFilters()">Manual Update</label> | ||
</div> | ||
<br> | ||
<br> | ||
<br> | ||
<div class="btn-group "> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="0">Now</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="60">1h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="120">2h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="240">4h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="360">6h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="720">12h</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="1440">1d</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="2880">2d</label> | ||
<label class="btn btn-success btn-lg" ng-model="timeFilter" uib-btn-radio="5760">4d</label> | ||
</div> | ||
<div class="btn-group"> | ||
<label class="btn btn-danger btn-lg" ng-click="autoUpdate()" ng-model="autoUpdateEnabled" uib-btn-checkbox>AutoUpdate</label> | ||
<label class="btn btn-danger btn-lg" ng-click="updateFilters()">Manual Update</label> | ||
</div> | ||
<br> | ||
<br> | ||
|
||
<rickshaw | ||
rickshaw-options="options" | ||
rickshaw-features="features" | ||
rickshaw-series="data.series"> | ||
</rickshaw> | ||
<rickshaw | ||
rickshaw-options="options" | ||
rickshaw-features="features" | ||
rickshaw-series="data.series"> | ||
</rickshaw> | ||
|
||
<div id="chart"></div> | ||
<code> | ||
DEBUG<br> | ||
<!--data.tweetFrequency: {{data.tweetFrequency}}<br>--> | ||
autoUpdateEnabled: {{autoUpdateEnabled}}<br> | ||
Current Filters: {{timeFilter/60}}h<br> | ||
</code> | ||
<!--</uib-tab>--> | ||
|
||
|
||
<!--<uib-tab index="1" heading="Scoreboard: Area">--> | ||
<br> | ||
<div class="col-xs-6 col-md-4"> | ||
<div class="panel panel-default"> | ||
<!-- Table --> | ||
<table class="table table-hover tabled-striped"> | ||
<caption>Top 10 Users: Area Covered</caption> | ||
<tr ng-repeat="tweet in data.tweets|limitTo:10" ng-click="search.setHashtagFilter(tweet.user.screen_name)"> | ||
<td> | ||
<p>#{{tweet.user.screen_name}}</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<!--</uib-tab>--> | ||
|
||
|
||
<!--<uib-tab index="2" heading="Scoreboard: Distance">--> | ||
<br> | ||
<div class="col-xs-6 col-md-4"> | ||
<div class="panel panel-default"> | ||
<!-- Table --> | ||
<table class="table table-hover tabled-striped"> | ||
<caption>Top 10 Users: Distance Covered</caption> | ||
<tr ng-repeat="tweet in data.tweets|limitTo:10" ng-click="search.setHashtagFilter(tweet.user.screen_name)"> | ||
<td> | ||
<p>#{{tweet.user.screen_name}}</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<!--</uib-tab>--> | ||
<!--</uib-tabset>--> | ||
<div id="chart"></div> | ||
<code> | ||
DEBUG<br> | ||
<!--data.tweetFrequency: {{data.tweetFrequency}}<br>--> | ||
autoUpdateEnabled: {{autoUpdateEnabled}}<br> | ||
Current Filters: {{timeFilter/60}}h<br> | ||
</code> | ||
</div> |
38 changes: 38 additions & 0 deletions
38
rest_service/src/main/resources/static/views/rankingsView.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<br> | ||
<div class="analyticsViewContainer" > | ||
<br> | ||
<div class="col-xs-6 col-md-4"> | ||
<div class="panel panel-default"> | ||
<!-- Table --> | ||
<table class="table table-hover tabled-striped"> | ||
<caption>Top 10 Users: Area Covered</caption> | ||
<tr ng-repeat="score in data.highScore.area" ng-click="goToHighScoreArea()"> | ||
<td> | ||
<p>{{score.user}}</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
|
||
|
||
<br> | ||
<div class="col-xs-6 col-md-4"> | ||
<div class="panel panel-default"> | ||
<!-- Table --> | ||
<table class="table table-hover tabled-striped"> | ||
<caption>Top 10 Users: Distance Covered</caption> | ||
<tr ng-repeat="score in data.highScore.path" ng-click="goToHighScoreDistance()"> | ||
<td> | ||
<p>{{score.user}}</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
|
||
<code> | ||
DEBUG<br> | ||
High Score Data: {{highScore}}<br> | ||
</code> | ||
</div> |