-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #398 from josenavas/decomposition-view
WIP: Decomposition view
- Loading branch information
Showing
5 changed files
with
455 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Emperor test</title> | ||
<meta charset="utf-8"> | ||
<style> | ||
body { | ||
margin: 0px; | ||
background-color: #000000; | ||
overflow: hidden; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<!-- Libraries the code depends on --> | ||
<script src="../vendor/js/underscore-min.js"></script> | ||
<script src="../vendor/js/chroma.min.js"></script> | ||
<script src="../vendor/js/three.min.js"></script>> | ||
|
||
<!--Source files to test--> | ||
<script src="model.js"></script> | ||
<script src="view.js"></script> | ||
<script src="sceneplotview3d.js"></script> | ||
|
||
<script> | ||
|
||
var name = "pcoa"; | ||
var ids = ['PC.636', 'PC.635', 'PC.356', 'PC.481', 'PC.354', 'PC.593', | ||
'PC.355', 'PC.607', 'PC.634']; | ||
var coords = [ | ||
[-0.276542, -0.144964, 0.066647, -0.067711, 0.176070, 0.072969, | ||
-0.229889, -0.046599], | ||
[-0.237661, 0.046053, -0.138136, 0.159061, -0.247485, -0.115211, | ||
-0.112864, 0.064794], | ||
[0.228820, -0.130142, -0.287149, 0.086450, 0.044295, 0.206043, | ||
0.031000, 0.071992], | ||
[0.042263, -0.013968, 0.063531, -0.346121, -0.127814, 0.013935, | ||
0.030021, 0.140148], | ||
[0.280399, -0.006013, 0.023485, -0.046811, -0.146624, 0.005670, | ||
-0.035430, -0.255786], | ||
[0.232873, 0.139788, 0.322871, 0.183347, 0.020466, 0.054059, | ||
-0.036625, 0.099824], | ||
[0.170518, -0.194113, -0.030897, 0.019809, 0.155100, -0.279924, | ||
0.057609, 0.024248], | ||
[-0.091330, 0.424147, -0.135627, -0.057519, 0.151363, -0.025394, | ||
0.051731, -0.038738], | ||
[-0.349339, -0.120788, 0.115275, 0.069495, -0.025372, 0.067853, | ||
0.244448, -0.059883]]; | ||
var pct_var = [26.6887048633, 16.2563704022, 13.7754129161, | ||
11.217215823, 10.024774995, 8.22835130237, 7.55971173665, | ||
6.24945796136]; | ||
var md_headers = ['SampleID', 'LinkerPrimerSequence', | ||
'Treatment', 'DOB']; | ||
var metadata = [ | ||
['PC.636', 'YATGCTGCCTCCCGTAGGAGT', 'Control', '20070314'], | ||
['PC.635', 'YATGCTGCCTCCCGTAGGAGT', 'Fast', '20071112'], | ||
['PC.356', 'YATGCTGCCTCCCGTAGGAGT', 'Fast', '20080116'], | ||
['PC.481', 'YATGCTGCCTCCCGTAGGAGT', 'Fast', '20080116'], | ||
['PC.354', 'YATGCTGCCTCCCGTAGGAGT', 'Control', '20071210'], | ||
['PC.593', 'YATGCTGCCTCCCGTAGGAGT', 'Fast', '20080116'], | ||
['PC.355', 'YATGCTGCCTCCCGTAGGAGT', 'Control', '20061218'], | ||
['PC.607', 'YATGCTGCCTCCCGTAGGAGT', 'Control', '20061218'], | ||
['PC.634', 'YATGCTGCCTCCCGTAGGAGT', 'Control', '20061126']]; | ||
|
||
var dm, dv, spv; | ||
|
||
init(); | ||
animate(); | ||
|
||
function init() { | ||
// Initialize the DecompositionModel | ||
dm = new DecompositionModel(name, ids, coords, pct_var, | ||
md_headers, metadata); | ||
// Initialize the DecompositionView | ||
dv = new DecompositionView(dm); | ||
// Initialize the ScenePlotView3D | ||
spv = new ScenePlotView3D(window.innerWidth, window.innerHeight, [dv]); | ||
|
||
document.body.appendChild(spv.renderer.domElement); | ||
|
||
window.addEventListener( 'resize', onWindowResize, false ); | ||
|
||
} | ||
|
||
function onWindowResize() { | ||
spv.resize(window.innerWidth, window.innerHeight); | ||
} | ||
|
||
function animate() { | ||
requestAnimationFrame(animate); | ||
spv.render(); | ||
} | ||
|
||
</script> | ||
|
||
</body> | ||
</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
Oops, something went wrong.