Skip to content

Commit

Permalink
Worked on false colour images
Browse files Browse the repository at this point in the history
Tried the static image and tiled images approach.
Added a new demos folder.

Cleaned up dependencies and module architecture.
  • Loading branch information
atruskie committed Nov 19, 2014
1 parent 2b3afd9 commit 83d6101
Show file tree
Hide file tree
Showing 18 changed files with 120 additions and 19 deletions.
13 changes: 5 additions & 8 deletions src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var app = angular.module('baw',
'decipher.tags',
'angular-growl',
'LocalStorageModule',
"bawApp.vendorServices",
"bawApp.vendorServices", /* Loads all vendor libraries that are automatically wrapped in a module */


'url', /* a custom uri formatter */
Expand Down Expand Up @@ -91,18 +91,14 @@ var app = angular.module('baw',
'audio-control',
'draggabilly',

'bawApp.d3', /* our d3 integration */
'bawApp.d3.calendarView',
'bawApp.d3.timelineView',
'bawApp.d3.dotView',
'bawApp.d3.terrainView',
'bawApp.d3.audioView',
'bawApp.d3', /* our d3 controls */

'bawApp.accounts',
'bawApp.annotationViewer',
'bawApp.audioEvents',
'bawApp.annotationLibrary',
'bawApp.bookmarks',
"bawApp.demo",
'bawApp.error',
'bawApp.home',
'bawApp.listen',
Expand Down Expand Up @@ -175,7 +171,8 @@ var app = angular.module('baw',
title: 'Audio Events' }).
when('/library/:recordingId/audio_events/:audioEventId', {templateUrl: paths.site.files.library.item, controller: 'AnnotationItemCtrl', title: 'Annotation :audioEventId'}).

when('/d3Test', {templateUrl: paths.site.files.d3.testPage, controller: 'D3TestPageCtrl', title: 'D3 Test Page' }).
when('/demo/d3', {templateUrl: paths.site.files.demo.d3, controller: 'D3TestPageCtrl', title: 'D3 Test Page' }).
when('/demo/rendering', {templateUrl: paths.site.files.demo.rendering, controller: 'RenderingCtrl', title: 'Rendering' }).

// missing route page
when('/', {templateUrl: paths.site.files.home, controller: 'HomeCtrl'}).
Expand Down
2 changes: 1 addition & 1 deletion src/app/d3Bindings/audioView/audioView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* d3 Audio View directive
* Created by Mark on 30/09/2014
*/
angular.module("bawApp.d3.audioView", ["bawApp.d3"])
angular.module("bawApp.d3.audioView", ["bawApp.vendorServices.auto"])
.directive("bawAudioView", ["d3", "moment", function (d3, moment) {

// d3 functions
Expand Down
2 changes: 1 addition & 1 deletion src/app/d3Bindings/calendarView/calendarView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created by Anthony on 23/08/2014, modified by Mark.
* based on http://bl.ocks.org/mbostock/4063318
*/
angular.module("bawApp.d3.calendarView", ["bawApp.d3"])
angular.module("bawApp.d3.calendarView", ["bawApp.vendorServices.auto"])
.directive(
"bawCalendarView",
["d3", "moment",
Expand Down
7 changes: 7 additions & 0 deletions src/app/d3Bindings/d3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
angular.module("bawApp.d3", [
"bawApp.d3.audioView",
"bawApp.d3.calendarView",
"bawApp.d3.dotView",
"bawApp.d3.terrainView",
"bawApp.d3.timelineView"
]);
2 changes: 1 addition & 1 deletion src/app/d3Bindings/dotView/dotView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created by Mark on 10/09/2014.
* Based on http://neuralengr.com/asifr/journals/journals_dbs.html
*/
angular.module("bawApp.d3.dotView", ["bawApp.d3"])
angular.module("bawApp.d3.dotView", ["bawApp.vendorServices.auto"])
.directive("bawDotView", ["d3", "moment", function (d3, moment) {

function DotViewDetails(elementId, jsonResponse) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/d3Bindings/terrainView/terrainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created by Mark on 10/09/2014.
* Based on http://mbostock.github.io/d3/talk/20111018/area-gradient.html
*/
angular.module("bawApp.d3.terrainView", ["bawApp.d3"])
angular.module("bawApp.d3.terrainView", ["bawApp.vendorServices.auto"])
.directive("bawTerrainView", ["d3", "moment", function (d3, moment) {

var m = [79, 80, 160, 79],
Expand Down
2 changes: 1 addition & 1 deletion src/app/d3Bindings/timelineView/timelineView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created by Mark on 09/09/2014.
* based on http://bl.ocks.org/bunkat/2338034
*/
angular.module("bawApp.d3.timelineView", ["bawApp.d3"])
angular.module("bawApp.d3.timelineView", ["bawApp.vendorServices.auto"])
.directive("bawTimelineView", ["d3", "moment", function (d3, moment) {

function Details(elementId, jsonResponse) {
Expand Down
12 changes: 12 additions & 0 deletions src/app/demo/_rendering.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

.renderedImage {
width: 1440px;
height: 350px;
background-color: lime;
outline: thick dashed;
margin: 15px;
}

.blank {
background-color: blue;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var bawD3 = bawD3 || angular.module("bawApp.d3", []);

bawD3.controller(
angular.module("bawApp.demo.d3", [])
.controller(
"D3TestPageCtrl",
["$scope", "conf.paths", "$http", "$routeParams", "$location", "$q",
"Site", "Project", "AudioRecording",
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions src/app/demo/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
angular.module("bawApp.demo", [
"bawApp.demo.rendering",
"bawApp.demo.d3"
]);
27 changes: 27 additions & 0 deletions src/app/demo/rendering.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Created by Anthony on 19/11/2014.
*/
angular.module("bawApp.demo.rendering", [])
.controller(
"RenderingCtrl",
[
"$scope",
function($scope) {

$scope.loadStatic = function() {
$scope.staticSrc = "assets/temp/eabad986-56d9-47b5-bec6-47458ffd3eae_101023-0000.ACI-ENT-EVN.png"
};

var min = 0,
max = 1435,
basePath = "assets/temp/tiles/tile_{0}.png";
//. "C:\Program Files\ImageMagick-6.9.0-Q16\convert.exe" -crop 1435x1@ .\eabad986-56d9-47b5-bec6-47458ffd3eae_101023-0000.ACI-ENT-EVN-trimmed72.png tiles/tile_%d.png
$scope.loadTiles = function() {
$scope.tiles = [];
for (i = min; i < max; i++) {
$scope.tiles[i] = basePath.format(i);
}
}
}
]
);
46 changes: 46 additions & 0 deletions src/app/demo/rendering.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<div id="content">
<h1>
False Colour Rendering Experiment
</h1>
<section>
<h2>
Static image
</h2>
<div>
<button ng-click="loadStatic()">Load</button>
</div>
<div>
<div class="renderedImage" >
<img class="blank" ng-src="{{staticSrc}}" src="" />
</div>
</div>
</section>
<section>
<h2>
Bitmap image
</h2>
<div>
<button>Render</button>
</div>
<div>
<div class="renderedImage" >
<canvas class="blank"></canvas>
</div>
</div>
</section>
<section>
<h2>
Stacked images
</h2>
<div>
<button ng-click="loadTiles()">Load</button>
</div>
<div>
<div class="renderedImage">
<div class="blank">
<img ng-repeat="t in tiles" ng-src="{{t}}" />
</div>
</div>
</div>
</section>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/baw.configuration.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ angular.module('bawApp.configuration', ['url'])
recordings: {
recentRecordings: 'recordings/recentRecordings/recentRecordings.tpl.html'
},
d3: {
testPage: 'd3Bindings/d3TestPage.tpl.html'
demo: {
d3: 'demo/d3TestPage.tpl.html',
rendering: 'demo/rendering.tpl.html'
}
},
// routes used by angular
Expand Down
9 changes: 8 additions & 1 deletion src/components/services/vendorServices/externals.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,12 @@ angular
};

// HACK: d3 is stubborn, forcibly remove it from window
delete $windowProvider.$get().d3;
var window = $windowProvider.$get();
if (window.d3) {
delete window.d3;
}
else {
console.warn("D3 not on window, hack not required");
}

}]);
1 change: 1 addition & 0 deletions src/sass/application.tpl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ $DEBUG: '<%= build_configs.current.key === "development" %>' == 'true';
@import "../app/recordInformation/record_information";
@import "../app/recordings/audio_recordings";
@import "../app/recordings/recentRecordings/recentRecordings";
@import "../app/demo/rendering";
@import "../app/search/saved_searches";
@import "../app/sites/sites";
@import "../app/tags/tags";
Expand Down

0 comments on commit 83d6101

Please sign in to comment.