-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (31 loc) · 926 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var phyloviz_graph = require('phyloviz_bundle');
var random_profiles = require('profile_generator');
var options = {
profile_length: 10, //default 7
number_of_profiles: 300, //default 10
min: 1, //default 1
max: 4, //default 7
distribution: 'poisson' //default "normal"
}
var input = {
name: "datasetName",
key:"ST",
data_type: "profile",
profiles: null,
schemegenes: null,
metadata: ['ST','From'],
isolates: [{'ST': 1, 'From': 'Japan'}, {'ST': 2, 'From': 'Portugal'}, {'ST': 3, 'From': 'USA'}, {'ST': 4, 'From': 'Spain'}],
newick: undefined,
linkMethod: 'isolates',
propertyIndex: 1 //From
}
var canvasID = 'testDiv';
var phylovizObject = {};
random_profiles(options, function(profileData){
input.profiles = profileData.profiles;
input.schemegenes = profileData.schemegenes;
phyloviz_graph(input, canvasID, function(graphObject){
phylovizObject = graphObject;
console.log(graphObject);
});
});