chrono-phylo-tree 1.0.7 → 1.0.9
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 +27 -10
- package/package.json +1 -1
package/README.md
CHANGED
@@ -12,18 +12,28 @@ You can test and explore the functionality of the chrono-phylo-tree library by v
|
|
12
12
|
|
13
13
|
### Updates
|
14
14
|
|
15
|
-
|
15
|
+
#### 1.0.9
|
16
|
+
|
17
|
+
- Translation to German thanks to [u/Kneeerg](https://www.reddit.com/user/Kneeerg/)
|
18
|
+
|
19
|
+
- PhTree allows to execute functions when the mouse is over the buttons
|
20
|
+
|
21
|
+
#### 1.0.8
|
22
|
+
|
23
|
+
- Species class' step functions can include or not species whose `display` is `false`.
|
24
|
+
|
25
|
+
#### 1.0.7
|
16
26
|
|
17
27
|
- The default duration of the ancestors and descendants are the duration of the species
|
18
28
|
- MultiplePhTrees component allows to show the phylogenetic tree from multiple common ancestors
|
19
29
|
|
20
|
-
|
30
|
+
#### 1.0.5
|
21
31
|
|
22
32
|
- PhTree's lines' width can depend or not on the species' duration
|
23
33
|
- It's possible to know the steps until a species
|
24
34
|
- It's possible to count the maximum steps until the last descendant of a species
|
25
35
|
|
26
|
-
|
36
|
+
#### 1.0.2
|
27
37
|
|
28
38
|
- The duration of the species must be greater than 0
|
29
39
|
- Menu doesn't close when a function throws error
|
@@ -272,31 +282,37 @@ Returns an array of all descendants of the species, sorted by appearance time.
|
|
272
282
|
#### stepsChain
|
273
283
|
|
274
284
|
```typescript
|
275
|
-
stepsChain(desc: Species): Species[]
|
285
|
+
stepsChain(desc: Species, includeNotDisplay = false): Species[]
|
276
286
|
```
|
277
287
|
|
278
288
|
Returns an array of `Species` objects representing the chain of species from the current species (`this`) to the specified descendant (`desc`). The chain includes all intermediate species in the lineage. If the specified descendant is not a descendant of the current species, the method returns an empty array.
|
279
289
|
|
280
290
|
- **desc**: The descendant species to which the chain is traced.
|
281
291
|
|
292
|
+
- **includeNotDisplay**: If `true`, include the species whose `display` is `false`.
|
293
|
+
|
282
294
|
#### stepsUntil
|
283
295
|
|
284
296
|
```typescript
|
285
|
-
stepsUntil(desc: Species): number
|
297
|
+
stepsUntil(desc: Species, includeNotDisplay = false): number
|
286
298
|
```
|
287
299
|
|
288
300
|
Returns the number of steps (generations) from the current species (`this`) to the specified descendant (`desc`). If the specified descendant is not a descendant of the current species, the method returns `undefined`.
|
289
301
|
|
290
302
|
- **desc**: The descendant species to which the number of steps is calculated.
|
291
303
|
|
304
|
+
- **includeNotDisplay**: If `true`, include the species whose `display` is `false`.
|
305
|
+
|
292
306
|
#### stepsUntilLastDescendant
|
293
307
|
|
294
308
|
```typescript
|
295
|
-
stepsUntilLastDescendant(): number
|
309
|
+
stepsUntilLastDescendant(includeNotDisplay = false): number
|
296
310
|
```
|
297
311
|
|
298
312
|
Returns the maximum number of steps (generations) from the current species (`this`) to its most distant descendant. If the current species has no descendants, the method returns `0`.
|
299
313
|
|
314
|
+
- **includeNotDisplay**: If `true`, include the species whose `display` is `false`.
|
315
|
+
|
300
316
|
#### toJSON
|
301
317
|
|
302
318
|
```typescript
|
@@ -437,8 +453,9 @@ The `PhTree` component accepts the following props:
|
|
437
453
|
- **stroke**: `string` (optional, default: `"grey"`)The stroke color for the tree lines.
|
438
454
|
- **format**: `(n: number) => string` (optional, default: `(n) => n.toString()`)A function to format the display of time values.
|
439
455
|
- **chronoScale**: `boolean` (optional, default: `true`)If `true`, the width of the lines depend on the durection of the species.
|
456
|
+
- **handleMouseMove**: `(x: number, y: number) => void` (optional)a function that depends on the mouse position.
|
440
457
|
- **presentTime**: `number` (optional)The current time to highlight in the tree.
|
441
|
-
- **children**:`(species: Species, showMenu: boolean,toggleShowMenu: (species: Species) => void) => React.ReactNode` (optional) Render prop to customize the menu content.
|
458
|
+
- **children**:`(species: Species | undefined, showMenu: boolean, toggleShowMenu: (species: Species) => void, hoverSpecies: Species | undefined) => React.ReactNode` (optional) Render prop to customize the menu content.
|
442
459
|
|
443
460
|
### State
|
444
461
|
|
@@ -449,8 +466,8 @@ The `PhTree` component accepts the following props:
|
|
449
466
|
## Methods
|
450
467
|
|
451
468
|
- **toggleShowMenu**: `(species: Species) => void`Toggles the visibility of the menu for a given species.
|
452
|
-
- **toggleShowDesc**: `(species: Species) => void`
|
453
|
-
|
469
|
+
- **toggleShowDesc**: `(species: Species) => void`Toggles the visibility of descendants for a given species, if `false`, its `descendants` won't be displayed and the `line` will extend until its `absoluteExtinction()`.
|
470
|
+
- **hoverShowMenu**: `(sp: Species | undefined) => void`Toggles the visibility of info about the species
|
454
471
|
|
455
472
|
### Rendering
|
456
473
|
|
@@ -494,7 +511,7 @@ The `MultiplePhTrees` component accepts the following props:
|
|
494
511
|
|
495
512
|
- **presentTime**: `number` (optional) - The current time to highlight in the tree.
|
496
513
|
|
497
|
-
- **children**: `(species: Species, showMenu: boolean, toggleShowMenu: (species: Species) => void) => React.ReactNode` (optional) - Render prop to customize the menu content.
|
514
|
+
- **children**: `(species: Species | undefined, showMenu: boolean, toggleShowMenu: (species: Species) => void) => React.ReactNode` (optional) - Render prop to customize the menu content.
|
498
515
|
|
499
516
|
### Rendering
|
500
517
|
|