phylotree 2.4.0 → 2.5.0
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/dist/phylotree.d.ts +113 -0
- package/package.json +3 -3
package/dist/phylotree.d.ts
CHANGED
|
@@ -116,6 +116,8 @@ export class TreeRender {
|
|
|
116
116
|
label_width: number;
|
|
117
117
|
/** Rightmost leaf x position */
|
|
118
118
|
right_most_leaf: number;
|
|
119
|
+
/** The container element */
|
|
120
|
+
container: string | HTMLElement;
|
|
119
121
|
|
|
120
122
|
constructor(phylotree: Phylotree, options?: RenderOptions);
|
|
121
123
|
|
|
@@ -166,6 +168,117 @@ export class TreeRender {
|
|
|
166
168
|
|
|
167
169
|
/** Selection callback setter */
|
|
168
170
|
selectionCallback(callback: (selection: PhylotreeNode[]) => void): this;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get or set spacing in the x-direction (horizontal spacing between nodes)
|
|
174
|
+
* @param attr The new spacing value if setting
|
|
175
|
+
* @param skip_render Whether to skip re-rendering after setting
|
|
176
|
+
* @returns The current spacing_x value if getting, or the TreeRender instance if setting
|
|
177
|
+
*/
|
|
178
|
+
spacing_x(): number;
|
|
179
|
+
spacing_x(attr: number, skip_render?: boolean): this;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Get or set spacing in the y-direction (vertical spacing between levels)
|
|
183
|
+
* @param attr The new spacing value if setting
|
|
184
|
+
* @param skip_render Whether to skip re-rendering after setting
|
|
185
|
+
* @returns The current spacing_y value if getting, or the TreeRender instance if setting
|
|
186
|
+
*/
|
|
187
|
+
spacing_y(): number;
|
|
188
|
+
spacing_y(attr: number, skip_render?: boolean): this;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Get or set the font size for labels
|
|
192
|
+
* @param attr The new font size if setting
|
|
193
|
+
* @returns The current font size if getting, or the TreeRender instance if setting
|
|
194
|
+
*/
|
|
195
|
+
font_size(): number;
|
|
196
|
+
font_size(attr: number): this;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get or set the scale bar font size
|
|
200
|
+
* @param attr The new font size if setting
|
|
201
|
+
* @returns The current scale bar font size if getting, or the TreeRender instance if setting
|
|
202
|
+
*/
|
|
203
|
+
scale_bar_font_size(): number;
|
|
204
|
+
scale_bar_font_size(attr: number): this;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Get or set the node circle size
|
|
208
|
+
* @param attr The new circle size if setting
|
|
209
|
+
* @param attr2 Optional second parameter
|
|
210
|
+
* @returns The current node circle size if getting, or the TreeRender instance if setting
|
|
211
|
+
*/
|
|
212
|
+
node_circle_size(): number;
|
|
213
|
+
node_circle_size(attr: number, attr2?: number): this;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Get or set CSS classes
|
|
217
|
+
* @param opt CSS class options
|
|
218
|
+
* @returns The current CSS classes if getting, or the TreeRender instance if setting
|
|
219
|
+
*/
|
|
220
|
+
css(): { [key: string]: string };
|
|
221
|
+
css(opt: { [key: string]: string }): this;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get or set transitions
|
|
225
|
+
* @param arg Transition settings
|
|
226
|
+
* @returns The current transition settings if getting, or the TreeRender instance if setting
|
|
227
|
+
*/
|
|
228
|
+
transitions(): boolean | null;
|
|
229
|
+
transitions(arg: boolean): this;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Layout the tree
|
|
233
|
+
* @param transitions Whether to use transitions
|
|
234
|
+
* @returns The TreeRender instance
|
|
235
|
+
*/
|
|
236
|
+
layout(transitions?: boolean): this;
|
|
237
|
+
|
|
238
|
+
/** Refresh the tree display */
|
|
239
|
+
refresh(): this;
|
|
240
|
+
|
|
241
|
+
/** Place nodes in the layout */
|
|
242
|
+
placenodes(): this;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Set the separation function for node spacing
|
|
246
|
+
* @param callback Function that returns additional spacing between nodes
|
|
247
|
+
* @returns The TreeRender instance
|
|
248
|
+
*/
|
|
249
|
+
separation(callback: (node: PhylotreeNode, previous: PhylotreeNode) => number): this;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Set internal node labels based on children
|
|
253
|
+
* @param callback Function that determines label based on children
|
|
254
|
+
* @param respect_existing Whether to respect existing selections
|
|
255
|
+
* @returns The TreeRender instance
|
|
256
|
+
*/
|
|
257
|
+
internalLabel(callback: (children: PhylotreeNode[]) => boolean, respect_existing?: boolean): this;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Get or set the count handler callback
|
|
261
|
+
* @param callback Function called with selection count
|
|
262
|
+
* @returns The current handler if getting, or the TreeRender instance if setting
|
|
263
|
+
*/
|
|
264
|
+
countHandler(): ((count: number) => void) | null;
|
|
265
|
+
countHandler(callback: (count: number) => void): this;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Update the selection key name
|
|
269
|
+
* @param old_key The old key name
|
|
270
|
+
* @param new_key The new key name
|
|
271
|
+
* @returns The TreeRender instance
|
|
272
|
+
*/
|
|
273
|
+
updateKeyName(old_key: string, new_key: string | null): this;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Set the size of the tree display
|
|
277
|
+
* @param attr Size as [width, height]
|
|
278
|
+
* @returns The current size if getting, or the TreeRender instance if setting
|
|
279
|
+
*/
|
|
280
|
+
set_size(): [number, number];
|
|
281
|
+
set_size(attr: [number, number]): this;
|
|
169
282
|
}
|
|
170
283
|
|
|
171
284
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phylotree",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "dist/phylotree.js",
|
|
5
5
|
"types": "dist/phylotree.d.ts",
|
|
6
6
|
"unpkg": "dist/phylotree.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"commander": "^14.0.0",
|
|
27
27
|
"csv-stringify": "^6.6.0",
|
|
28
28
|
"d3": "^7.9.0",
|
|
29
|
-
"fast-xml-parser": "^5.
|
|
29
|
+
"fast-xml-parser": "^5.3.4",
|
|
30
30
|
"jquery": "^3.7.1",
|
|
31
|
-
"lodash": "^4.17.
|
|
31
|
+
"lodash": "^4.17.23",
|
|
32
32
|
"moment": "^2.30.1",
|
|
33
33
|
"pretty-data": "^0.40.0",
|
|
34
34
|
"underscore": "^1.13.7",
|