Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hackermd committed Aug 15, 2018
1 parent 20240dd commit 17e04bf
Show file tree
Hide file tree
Showing 4 changed files with 2,271 additions and 37 deletions.
35 changes: 26 additions & 9 deletions build/dicom-microscopy-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50172,6 +50172,7 @@

var DICOMwebClient = unwrapExports(dicomwebClient);

const _usewebgl = Symbol('usewebgl');
const _map = Symbol('map');
const _features = Symbol('features');
const _drawingSource = Symbol('drawingSource');
Expand All @@ -50189,6 +50190,7 @@
* options:
* - client (instance of DICOMwebClient)
* - metadata (array of DICOM JSON metadata for each image instance)
* - useWebGL (whether WebGL renderer should be used; default: true)
* - onClickHandler (on-event handler function)
* - onSingleClickHandler (on-event handler function)
* - onDoubleClickHandler (on-event handler function)
Expand All @@ -50207,6 +50209,11 @@
* - pixel
*/
constructor(options) {
if ('useWebGL' in options) {
this[_usewebgl] = options.useWebGL;
} else {
this[_usewebgl] = true;
}
this[_client] = options.client;

// Collection of Openlayers "VectorLayer" instances indexable by
Expand Down Expand Up @@ -50266,7 +50273,6 @@
return 0;
}
});
console.log(this[_pyramid]);

/*
* Collect relevant information from DICOM metadata for each pyramid
Expand Down Expand Up @@ -50563,14 +50569,25 @@
* Creates the map with the defined layers and view and renders it via
* WebGL.
*/
this[_map] = new WebGLMap({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
if (this[_usewebgl]) {
this[_map] = new WebGLMap({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
} else {
this[_map] = new Map({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
}
for (let control in this[_controls]) {
// options.controls
// TODO: enable user to select controls and style them
Expand Down
34 changes: 26 additions & 8 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function _scoordCoordinates2geometryCoordinates(coordinates) {
}


const _usewebgl = Symbol('usewebgl');
const _map = Symbol('map');
const _features = Symbol('features');
const _drawingSource = Symbol('drawingSource');
Expand All @@ -126,6 +127,7 @@ class VLWholeSlideMicroscopyImageViewer {
* options:
* - client (instance of DICOMwebClient)
* - metadata (array of DICOM JSON metadata for each image instance)
* - useWebGL (whether WebGL renderer should be used; default: true)
* - onClickHandler (on-event handler function)
* - onSingleClickHandler (on-event handler function)
* - onDoubleClickHandler (on-event handler function)
Expand All @@ -144,6 +146,11 @@ class VLWholeSlideMicroscopyImageViewer {
* - pixel
*/
constructor(options) {
if ('useWebGL' in options) {
this[_usewebgl] = options.useWebGL;
} else {
this[_usewebgl] = true;
}
this[_client] = options.client;

// Collection of Openlayers "VectorLayer" instances indexable by
Expand Down Expand Up @@ -509,14 +516,25 @@ class VLWholeSlideMicroscopyImageViewer {
* Creates the map with the defined layers and view and renders it via
* WebGL.
*/
this[_map] = new WebGLMap({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
if (this[_usewebgl]) {
this[_map] = new WebGLMap({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
} else {
this[_map] = new Map({
layers: [imageLayer, this[_drawingLayer]],
view: view,
controls: [],
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
logo: false
});
}
for (let control in this[_controls]) {
// options.controls
// TODO: enable user to select controls and style them
Expand Down
Loading

0 comments on commit 17e04bf

Please sign in to comment.