-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tree.js
66 lines (61 loc) · 2.02 KB
/
Tree.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var treeify = require('treeify'),
fs = require('fs'),
chalk = require('chalk');
var Eukaryotes = {
'asdasdsa':{
'Green plants': 'green algae & land plants',
'Rhodophyta': 'red algae',
'Glaucophytes': 'microalgae'
},
'Unikonts': {
'Opisthokonts': {
'Animals': null,
'Choanoflagellates': null,
'Filasterea': null,
'Ichthyosporea': null,
'Fungi': 'mushrooms, sac fungi, yeast, molds, etc',
'Nucleariidae': 'filose amoebae'
},
'Amoebozoa': 'amoebae, slime molds, and parasitic protists',
},
'Chromalveolates': {
'': {
'Rhizaria': {
'Cercozoa': 'amoeboflagellates',
'Foraminifera': 'complex cells with reticulopodia',
'Radiolaria': null
},
'Alveolates': 'dinoflagellates, ciliates and apicomplexan parasites',
'Stramenopiles': 'e.g. water molds, diatoms, brown algae'
},
'Hacrobia': 'Haptophyta, Cryptomonads, etc.'
},
'Excavates': {
'Malawimonads': null,
'Discicristates': {
'Euglenozoa': 'euglenids, diplonemids and kinetoplastids',
'Heterolobosea': 'amoeboflagellates with discoidal mitchondrial cristae',
'Jakobida': 'free-living, heterotrophic flagellates'
},
'Parabasalids': 'trichomonads and hypermastigotes',
'Fornicata': 'diplomonads and retortamonads',
'Preaxostyla': 'oxymonads and Trimastix'
}
};
var j = fs.readFileSync('/tmp/Thurs/cetus/zpoolList.json').toString();
Eukaryotes = JSON.parse(j);
treeify.asLines(Eukaryotes, true, function(line) {
console.log(chalk.grey.bgWhite(line));
});
var tree = require('pretty-tree');
var str = tree({
label: '(root)', // the label of this node
nodes: [{
label: '(child)',
leaf: {
hello: 'world',
hej: 'verden'
}
}]
});
console.log(str);