@grunwaldlab/heat-tree 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -62
- package/dist/heat-tree.es.min.js +7360 -0
- package/dist/heat-tree.es.min.js.map +1 -0
- package/dist/heat-tree.iife.min.js +2 -0
- package/dist/heat-tree.iife.min.js.map +1 -0
- package/dist/heat-tree.umd.min.js +2 -0
- package/dist/heat-tree.umd.min.js.map +1 -0
- package/package.json +6 -5
- package/dist/heat-tree.es.js +0 -5083
- package/dist/heat-tree.es.js.map +0 -1
- package/dist/heat-tree.umd.js +0 -20
- package/dist/heat-tree.umd.js.map +0 -1
package/README.md
CHANGED
|
@@ -49,26 +49,23 @@ heatTree(
|
|
|
49
49
|
The `heatTree` function creates an interactive tree visualization in a specified container element.
|
|
50
50
|
|
|
51
51
|
```javascript
|
|
52
|
-
heatTree(
|
|
52
|
+
heatTree(containerSelector, treesInput, options);
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
**Parameters:**
|
|
56
56
|
|
|
57
|
-
- `treesConfig` (Object): Configuration object containing tree data
|
|
58
|
-
- `trees` (Array): Array of tree objects, each with:
|
|
59
|
-
- `newick` (string, required): Newick format tree string
|
|
60
|
-
- `name` (string, optional): Display name for the tree
|
|
61
|
-
- `metadata` (Array|Object, optional): Metadata tables (see Metadata section)
|
|
62
|
-
- `aesthetics` (Object, optional): Initial aesthetic mappings (see Aesthetics section)
|
|
63
|
-
|
|
64
57
|
- `containerSelector` (string): CSS selector for the container element (e.g., `'#my-tree'`)
|
|
65
|
-
|
|
58
|
+
- `treesInput` (Array/Object, optional): Configuration object containing tree data or an array of such objects
|
|
59
|
+
- `newick` (string, required): Newick format tree string
|
|
60
|
+
- `name` (string, optional): Display name for the tree
|
|
61
|
+
- `metadata` (Array|Object, optional): Metadata tables (see Metadata section)
|
|
62
|
+
- `aesthetics` (Object, optional): Initial aesthetic mappings (see Aesthetics section)
|
|
66
63
|
- `options` (Object, optional): Configuration options (see Options section)
|
|
67
64
|
|
|
68
|
-
You can also pass just a container selector to create an empty visualization:
|
|
65
|
+
You can also pass just a container selector to create an empty visualization (trees can be loaded interactively):
|
|
69
66
|
|
|
70
67
|
```javascript
|
|
71
|
-
heatTree('#container'
|
|
68
|
+
heatTree('#container');
|
|
72
69
|
```
|
|
73
70
|
|
|
74
71
|
### Adding Metadata
|
|
@@ -82,21 +79,17 @@ B\t892\tnursery
|
|
|
82
79
|
C\t234\tcity`;
|
|
83
80
|
|
|
84
81
|
heatTree(
|
|
82
|
+
'#container',
|
|
85
83
|
{
|
|
86
|
-
|
|
84
|
+
name: 'My Tree',
|
|
85
|
+
newick: newickString,
|
|
86
|
+
metadata: [
|
|
87
87
|
{
|
|
88
|
-
name: '
|
|
89
|
-
|
|
90
|
-
metadata: [
|
|
91
|
-
{
|
|
92
|
-
name: 'Sample Data',
|
|
93
|
-
data: metadata
|
|
94
|
-
}
|
|
95
|
-
]
|
|
88
|
+
name: 'Sample Data',
|
|
89
|
+
data: metadata
|
|
96
90
|
}
|
|
97
91
|
]
|
|
98
|
-
}
|
|
99
|
-
'#container'
|
|
92
|
+
}
|
|
100
93
|
);
|
|
101
94
|
```
|
|
102
95
|
|
|
@@ -108,21 +101,17 @@ Although the metadata columns used to color/size tree parts can be set interacti
|
|
|
108
101
|
|
|
109
102
|
```javascript
|
|
110
103
|
heatTree(
|
|
104
|
+
'#container',
|
|
111
105
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
'#container'
|
|
106
|
+
name: 'My Tree',
|
|
107
|
+
newick: newickString,
|
|
108
|
+
metadata: [{ name: 'Data', data: metadata }],
|
|
109
|
+
aesthetics: {
|
|
110
|
+
tipLabelColor: 'source', // Color tips by 'source' column
|
|
111
|
+
tipLabelSize: 'abundance', // Size tips by 'abundance' column
|
|
112
|
+
tipLabelStyle: 'font_style' // Style tips by 'font_style' column
|
|
113
|
+
}
|
|
114
|
+
}
|
|
126
115
|
);
|
|
127
116
|
```
|
|
128
117
|
|
|
@@ -186,19 +175,15 @@ Configure the visualization behavior and appearance:
|
|
|
186
175
|
|
|
187
176
|
```javascript
|
|
188
177
|
heatTree(
|
|
178
|
+
'#container',
|
|
189
179
|
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
tipLabelColor: 'source'
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
]
|
|
180
|
+
name: 'My Tree',
|
|
181
|
+
newick: newickString,
|
|
182
|
+
metadata: [{ name: 'Data', data: metadata }],
|
|
183
|
+
aesthetics: {
|
|
184
|
+
tipLabelColor: 'source'
|
|
185
|
+
}
|
|
200
186
|
},
|
|
201
|
-
'#container',
|
|
202
187
|
{
|
|
203
188
|
layout: 'circular',
|
|
204
189
|
branchLengthScale: 1.5,
|
|
@@ -217,21 +202,19 @@ The widget can be initialized with multiple trees:
|
|
|
217
202
|
|
|
218
203
|
```javascript
|
|
219
204
|
heatTree(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
'#container'
|
|
205
|
+
'#container',
|
|
206
|
+
[
|
|
207
|
+
{
|
|
208
|
+
name: 'Tree 1',
|
|
209
|
+
newick: newickString1,
|
|
210
|
+
metadata: [{ name: 'Data 1', data: metadata1 }]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'Tree 2',
|
|
214
|
+
newick: newickString2,
|
|
215
|
+
metadata: [{ name: 'Data 2', data: metadata2 }]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
235
218
|
);
|
|
236
219
|
```
|
|
237
220
|
|