chrono-phylo-tree 1.0.4 → 1.0.5
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 +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -12,6 +12,14 @@ You can test and explore the functionality of the chrono-phylo-tree library by v
|
|
12
12
|
|
13
13
|
### Updates
|
14
14
|
|
15
|
+
**1.0.5**
|
16
|
+
|
17
|
+
- PhTree's lines' width can depend or not on the species' duration
|
18
|
+
- It's possible to know the steps until a species
|
19
|
+
- It's possible to count the maximum steps until the last descendant of a species
|
20
|
+
|
21
|
+
**1.0.2**
|
22
|
+
|
15
23
|
- The duration of the species must be greater than 0
|
16
24
|
- Menu doesn't close when a function throws error
|
17
25
|
|
@@ -256,6 +264,34 @@ allDescendants(): Species[]
|
|
256
264
|
|
257
265
|
Returns an array of all descendants of the species, sorted by appearance time.
|
258
266
|
|
267
|
+
#### stepsChain
|
268
|
+
|
269
|
+
```typescript
|
270
|
+
stepsChain(desc: Species): Species[]
|
271
|
+
```
|
272
|
+
|
273
|
+
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.
|
274
|
+
|
275
|
+
- **desc**: The descendant species to which the chain is traced.
|
276
|
+
|
277
|
+
#### stepsUntil
|
278
|
+
|
279
|
+
```typescript
|
280
|
+
stepsUntil(desc: Species): number
|
281
|
+
```
|
282
|
+
|
283
|
+
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`.
|
284
|
+
|
285
|
+
- **desc**: The descendant species to which the number of steps is calculated.
|
286
|
+
|
287
|
+
#### stepsUntilLastDescendant
|
288
|
+
|
289
|
+
```typescript
|
290
|
+
stepsUntilLastDescendant(): number
|
291
|
+
```
|
292
|
+
|
293
|
+
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`.
|
294
|
+
|
259
295
|
#### toJSON
|
260
296
|
|
261
297
|
```typescript
|
@@ -395,6 +431,7 @@ The `PhTree` component accepts the following props:
|
|
395
431
|
- **padding**: `number` (optional, default: `0`)The padding around the tree.
|
396
432
|
- **stroke**: `string` (optional, default: `"grey"`)The stroke color for the tree lines.
|
397
433
|
- **format**: `(n: number) => string` (optional, default: `(n) => n.toString()`)A function to format the display of time values.
|
434
|
+
- **chronoScale**: `boolean` (optional, default: `true`)If `true`, the width of the lines depend on the durection of the species.
|
398
435
|
- **presentTime**: `number` (optional)The current time to highlight in the tree.
|
399
436
|
- **children**:`(species: Species, showMenu: boolean,toggleShowMenu: (species: Species) => void) => React.ReactNode` (optional) Render prop to customize the menu content.
|
400
437
|
|
@@ -491,6 +528,7 @@ nvbtn00_0;Eliminar todas las especies;Delete all species
|
|
491
528
|
nvbtn01;Ejemplo;Example
|
492
529
|
nvbtn02;Descargar JSON;Download JSON
|
493
530
|
nvlbl05;Idioma;Language
|
531
|
+
nvlbl06;Escala Cronológica;Chronological Scale
|
494
532
|
splbl00;Nombre;Name
|
495
533
|
splbl01;Aparición;Apparition
|
496
534
|
splbl02;Duración;Duration
|
@@ -650,6 +688,7 @@ Below is a list of some of the translation codes used in the application:
|
|
650
688
|
| `nvbtn01` | Ejemplo | Example |
|
651
689
|
| `nvbtn02` | Descargar JSON | Download JSON |
|
652
690
|
| `nvlbl05` | Idioma | Language |
|
691
|
+
| `nvlbl06` | Escala Cronológica | Chronological Scale |
|
653
692
|
| `splbl00` | Nombre | Name |
|
654
693
|
| `splbl01` | Aparición | Apparition |
|
655
694
|
| `splbl02` | Duración | Duration |
|