chrono-phylo-tree 1.0.12 → 1.0.13
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 +52 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -12,6 +12,10 @@ 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.12**
|
16
|
+
|
17
|
+
- New functions for Species class.
|
18
|
+
|
15
19
|
**1.0.11**
|
16
20
|
|
17
21
|
- Species class has a new property (`image?: string`).
|
@@ -233,6 +237,54 @@ copy(): Species
|
|
233
237
|
|
234
238
|
Creates a deep copy of the current species and its descendants.
|
235
239
|
|
240
|
+
#### unlinkAncestor
|
241
|
+
|
242
|
+
```typescript
|
243
|
+
unlinkAncestor(): [Species, Species] | undefined
|
244
|
+
```
|
245
|
+
|
246
|
+
Removes the ancestor link from the current species. If the species has no ancestor, the method returns `undefined`. Otherwise, it returns an array containing the first ancestor of the previous ancestor and the current species.
|
247
|
+
|
248
|
+
#### unlinkDescendant
|
249
|
+
|
250
|
+
```typescript
|
251
|
+
unlinkDescendant(descendant: Species): [Species, Species] | undefined
|
252
|
+
```
|
253
|
+
|
254
|
+
Removes the descendant link from the current species. If the descendant is not linked to the current species, the method returns `undefined`. Otherwise, it returns an array containing the first ancestor of the current species and the unlinked descendant.
|
255
|
+
|
256
|
+
- **descendant**: The descendant species to unlink.
|
257
|
+
|
258
|
+
#### linkAncestor
|
259
|
+
|
260
|
+
```typescript
|
261
|
+
linkAncestor(ancestor: Species): void
|
262
|
+
```
|
263
|
+
|
264
|
+
Links the current species to a specified ancestor. The method ensures the ancestor's appearance time is valid relative to the current species and updates the descendant list of the ancestor.
|
265
|
+
|
266
|
+
- **ancestor**: The ancestor species to link.
|
267
|
+
|
268
|
+
#### linkDescendant
|
269
|
+
|
270
|
+
```typescript
|
271
|
+
linkDescendant(descendant: Species): void
|
272
|
+
```
|
273
|
+
|
274
|
+
Links the current species to a specified descendant. The method ensures the descendant's appearance time is valid relative to the current species and updates the ancestor of the descendant.
|
275
|
+
|
276
|
+
- **descendant**: The descendant species to link.
|
277
|
+
|
278
|
+
#### linkDescendants
|
279
|
+
|
280
|
+
```typescript
|
281
|
+
linkDescendants(descendants: Species[]): void
|
282
|
+
```
|
283
|
+
|
284
|
+
Links the current species to multiple descendants. The method attempts to link each descendant and logs any errors encountered without interrupting the process.
|
285
|
+
|
286
|
+
- **descendants**: An array of descendant species to link.
|
287
|
+
|
236
288
|
#### addDescendant
|
237
289
|
|
238
290
|
```typescript
|